1 /*
2 * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
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 * Note: Rounding-to-nearest used unless otherwise stated
21 *
22 */
23 #include <stdint.h>
24
25 #include "config.h"
28
31 {
32 for (
int i = 0;
i < n;
i++)
34 }
35
38 int n)
39 {
40 for (
int i = 0;
i < n;
i++) {
43 }
44 }
45
50 {
51 INT64FLOAT inre0[6], inre1[6], inim0[6], inim1[6];
52
53 for (int j = 0; j < 6; j++) {
54 inre0[j] = in[j][0] + in[12 - j][0];
55 inre1[j] = in[j][1] - in[12 - j][1];
56 inim0[j] = in[j][1] + in[12 - j][1];
57 inim1[j] = in[j][0] - in[12 - j][0];
58 }
59
60 for (
int i = 0;
i < n;
i++) {
63
64 for (int j = 0; j < 6; j++) {
69 }
70 #if USE_FIXED
71 out[
i *
stride][0] = (int)((sum_re + 0x40000000) >> 31);
72 out[
i *
stride][1] = (int)((sum_im + 0x40000000) >> 31);
73 #else
76 #endif /* USE_FIXED */
77 }
78 }
79
83 {
85 for (
int j = 0; j <
len; j++) {
88 }
89 }
90 }
91
95 {
97 for (
int n = 0; n <
len; n++) {
98 out[0][n][
i] = in[
i][n][0];
99 out[1][n][
i] = in[
i][n][1];
100 }
101 }
102 }
103
110 {
112 Q31(0.56471812200776
f),
113 Q31(0.48954165955695
f) };
115 int m, n;
116
119
120 for (n = 0; n <
len; n++) {
126 INTFLOAT link_delay_re = ap_delay[m][n+2-m][0];
127 INTFLOAT link_delay_im = ap_delay[m][n+2-m][1];
128 INTFLOAT fractional_delay_re = Q_fract[m][0];
129 INTFLOAT fractional_delay_im = Q_fract[m][1];
132 in_re =
AAC_MSUB30(link_delay_re, fractional_delay_re,
133 link_delay_im, fractional_delay_im);
135 in_im =
AAC_MADD30(link_delay_re, fractional_delay_im,
136 link_delay_im, fractional_delay_re);
140 }
143 }
144 }
145
149 {
158 int n;
159
160 for (n = 0; n <
len; n++) {
161 //l is s, r is d
167 h1 += hs1;
168 h2 += hs2;
169 h3 += hs3;
174 }
175 }
176
180 {
185 UINTFLOAT hs00 = h_step[0][0], hs10 = h_step[1][0];
186 UINTFLOAT hs01 = h_step[0][1], hs11 = h_step[1][1];
187 UINTFLOAT hs02 = h_step[0][2], hs12 = h_step[1][2];
188 UINTFLOAT hs03 = h_step[0][3], hs13 = h_step[1][3];
189 int n;
190
191 for (n = 0; n <
len; n++) {
192 //l is s, r is d
197 h00 += hs00;
198 h01 += hs01;
199 h02 += hs02;
200 h03 += hs03;
201 h10 += hs10;
202 h11 += hs11;
203 h12 += hs12;
204 h13 += hs13;
205
206 l[n][0] =
AAC_MSUB30_V8(h00, l_re, h02, r_re, h10, l_im, h12, r_im);
207 l[n][1] =
AAC_MADD30_V8(h00, l_im, h02, r_im, h10, l_re, h12, r_re);
208 r[n][0] =
AAC_MSUB30_V8(h01, l_re, h03, r_re, h11, l_im, h13, r_im);
209 r[n][1] =
AAC_MADD30_V8(h01, l_im, h03, r_im, h11, l_re, h13, r_re);
210 }
211 }
212
214 {
223
224 #if !USE_FIXED
225 #if ARCH_ARM
227 #elif ARCH_AARCH64
229 #elif ARCH_RISCV
231 #elif ARCH_X86
233 #endif
234 #endif /* !USE_FIXED */
235 }