36 uint64_t accu = 0,
round;
37 uint64_t accu0 = 0, accu1 = 0, accu2 = 0, accu3 = 0;
42 for (
i = 0;
i < n;
i += 2) {
43 accu0 += (int64_t)x[
i + 0][0] * x[
i + 0][0];
44 accu1 += (int64_t)x[
i + 0][1] * x[
i + 0][1];
45 accu2 += (int64_t)x[
i + 1][0] * x[
i + 1][0];
46 accu3 += (int64_t)x[
i + 1][1] * x[
i + 1][1];
47 if ((accu0|accu1|accu2|accu3) > UINT64_MAX - INT32_MIN*(int64_t)INT32_MIN ||
i+2>=n) {
52 while ((accu0|accu1|accu2|accu3) > (UINT64_MAX - accu) >> 2) {
60 accu += accu0 + accu1 + accu2 + accu3;
61 accu0 = accu1 = accu2 = accu3 = 0;
70 while (
u < 0x80000000U) {
77 round = 1ULL << (nz-1);
78 u = ((accu +
round) >> nz);
88 for (
i = 1;
i < 64;
i += 2)
89 x[
i] = -(
unsigned)x[
i];
97 for (k = 1; k < 32; k++) {
98 z[64+2*k ] = -z[64 - k];
99 z[64+2*k+1] = z[ k + 1];
106 for (k = 0; k < 32; k++) {
115 for (
i = 0;
i < 32;
i++) {
116 v[
i] = (
int)(0x10U +
src[63 - 2*
i ]) >> 5;
117 v[63 -
i] = (
int)(0x10U -
src[63 - 2*
i - 1]) >> 5;
125 int i = (
int)(accu >> 32);
130 while (
FFABS(
i) < 0x40000000) {
139 mant = (mant + 0x40LL)>>7;
148 int64_t real_sum, imag_sum;
149 int64_t accu_re = 0, accu_im = 0;
152 for (
i = 1;
i < 38;
i++) {
153 accu_re += (uint64_t)x[
i][0] * x[
i+lag][0];
154 accu_re += (uint64_t)x[
i][1] * x[
i+lag][1];
155 accu_im += (uint64_t)x[
i][0] * x[
i+lag][1];
156 accu_im -= (uint64_t)x[
i][1] * x[
i+lag][0];
162 accu_re += (uint64_t)x[ 0][0] * x[lag][0];
163 accu_re += (uint64_t)x[ 0][1] * x[lag][1];
164 accu_im += (uint64_t)x[ 0][0] * x[lag][1];
165 accu_im -= (uint64_t)x[ 0][1] * x[lag][0];
173 accu_re += (uint64_t)x[38][0] * x[39][0];
174 accu_re += (uint64_t)x[38][1] * x[39][1];
175 accu_im += (uint64_t)x[38][0] * x[39][1];
176 accu_im -= (uint64_t)x[38][1] * x[39][0];
182 for (
i = 1;
i < 38;
i++) {
183 accu_re += (uint64_t)x[
i][0] * x[
i][0];
184 accu_re += (uint64_t)x[
i][1] * x[
i][1];
187 accu_re += (uint64_t)x[ 0][0] * x[ 0][0];
188 accu_re += (uint64_t)x[ 0][1] * x[ 0][1];
193 accu_re += (uint64_t)x[38][0] * x[38][0];
194 accu_re += (uint64_t)x[38][1] * x[38][1];
208 const int alpha0[2],
const int alpha1[2],
209 int bw,
int start,
int end)
215 accu = (int64_t)alpha0[0] * bw;
216 alpha[2] = (
int)((accu + 0x40000000) >> 31);
217 accu = (int64_t)alpha0[1] * bw;
218 alpha[3] = (
int)((accu + 0x40000000) >> 31);
219 accu = (int64_t)bw * bw;
220 bw = (
int)((accu + 0x40000000) >> 31);
221 accu = (int64_t)alpha1[0] * bw;
222 alpha[0] = (
int)((accu + 0x40000000) >> 31);
223 accu = (int64_t)alpha1[1] * bw;
224 alpha[1] = (
int)((accu + 0x40000000) >> 31);
226 for (
i = start;
i < end;
i++) {
227 accu = (int64_t)X_low[
i][0] * 0x20000000;
228 accu += (int64_t)X_low[
i - 2][0] *
alpha[0];
229 accu -= (int64_t)X_low[
i - 2][1] *
alpha[1];
230 accu += (int64_t)X_low[
i - 1][0] *
alpha[2];
231 accu -= (int64_t)X_low[
i - 1][1] *
alpha[3];
232 X_high[
i][0] = (
int)((accu + 0x10000000) >> 29);
234 accu = (int64_t)X_low[
i][1] * 0x20000000;
235 accu += (int64_t)X_low[
i - 2][1] *
alpha[0];
236 accu += (int64_t)X_low[
i - 2][0] *
alpha[1];
237 accu += (int64_t)X_low[
i - 1][1] *
alpha[2];
238 accu += (int64_t)X_low[
i - 1][0] *
alpha[3];
239 X_high[
i][1] = (
int)((accu + 0x10000000) >> 29);
244 const SoftFloat *g_filt,
int m_max, intptr_t ixh)
249 for (m = 0; m < m_max; m++) {
250 if (22 - g_filt[m].
exp < 61) {
251 int64_t
r = 1LL << (22-g_filt[m].
exp);
252 accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7);
253 Y[m][0] = (
int)((accu +
r) >> (23-g_filt[m].
exp));
255 accu = (int64_t)X_high[m][ixh][1] * ((g_filt[m].mant + 0x40)>>7);
256 Y[m][1] = (
int)((accu +
r) >> (23-g_filt[m].
exp));
271 for (m = 0; m < m_max; m++) {
272 unsigned y0 =
Y[m][0];
273 unsigned y1 =
Y[m][1];
282 }
else if (
shift < 30) {
295 }
else if (
shift < 30) {
298 accu = (int64_t)q_filt[m].mant * ff_sbr_noise_table_fixed[
noise][0];
299 tmp = (
int)((accu + 0x40000000) >> 31);
302 accu = (int64_t)q_filt[m].mant * ff_sbr_noise_table_fixed[
noise][1];
303 tmp = (
int)((accu + 0x40000000) >> 31);
309 phi_sign1 = -phi_sign1;