1 /*
2 * Copyright (c) 2011 Mans Rullgard
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
27
29
31 {
33 /* compute mdct windows */
34 for (
i = 0;
i < 36;
i++) {
35 for (j = 0; j < 4; j++) {
36 double d;
37
38 if (j == 2 &&
i % 3 != 1)
39 continue;
40
41 d = sin(
M_PI * (
i + 0.5) / 36.0);
42 if (j == 1) {
44 else if (
i >= 24) d = sin(
M_PI * (
i - 18 + 0.5) / 12.0);
45 else if (
i >= 18) d = 1;
46 } else if (j == 3) {
48 else if (
i < 12) d = sin(
M_PI * (
i - 6 + 0.5) / 12.0);
49 else if (
i < 18) d = 1;
50 }
51 //merge last stage of imdct into the window coefficients
53
54 if (j == 2) {
57 } else {
61 }
62 }
63 }
64
65 /* NOTE: we do frequency inversion after the MDCT by changing
66 the sign of the right window coefs */
67 for (j = 0; j < 4; j++) {
73 }
74 }
75
76 #if ARCH_X86
78 #endif
79 }
80
82 {
84
87
90
93
94 #if ARCH_AARCH64
96 #elif ARCH_ARM
98 #elif ARCH_PPC
100 #elif ARCH_X86
102 #endif
103 #if HAVE_MIPSFPU
105 #endif
106 #if HAVE_MIPSDSP
108 #endif
109 }