diff options
Diffstat (limited to 'lib/rbcodec/codecs')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/mdct.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/mdct.c b/lib/rbcodec/codecs/libopus/celt/mdct.c index 0f9af9eac4..877366361d 100644 --- a/lib/rbcodec/codecs/libopus/celt/mdct.c +++ b/lib/rbcodec/codecs/libopus/celt/mdct.c | |||
@@ -249,17 +249,20 @@ void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scala | |||
249 | const kiss_fft_scalar * OPUS_RESTRICT xp1 = in; | 249 | const kiss_fft_scalar * OPUS_RESTRICT xp1 = in; |
250 | const kiss_fft_scalar * OPUS_RESTRICT xp2 = in+stride*(N2-1); | 250 | const kiss_fft_scalar * OPUS_RESTRICT xp2 = in+stride*(N2-1); |
251 | kiss_fft_scalar * OPUS_RESTRICT yp = f2; | 251 | kiss_fft_scalar * OPUS_RESTRICT yp = f2; |
252 | const kiss_twiddle_scalar *t = &l->trig[0]; | 252 | const kiss_twiddle_scalar *t0 = &l->trig[0]; |
253 | const kiss_twiddle_scalar *t1 = &l->trig[N4<<shift]; | ||
253 | for(i=0;i<N4;i++) | 254 | for(i=0;i<N4;i++) |
254 | { | 255 | { |
255 | kiss_fft_scalar yr, yi; | 256 | kiss_fft_scalar yr, yi; |
256 | yr = -S_MUL(*xp2, t[i<<shift]) + S_MUL(*xp1,t[(N4-i)<<shift]); | 257 | yr = -S_MUL(*xp2, *t0) + S_MUL(*xp1, *t1); |
257 | yi = -S_MUL(*xp2, t[(N4-i)<<shift]) - S_MUL(*xp1,t[i<<shift]); | 258 | yi = -S_MUL(*xp2, *t1) - S_MUL(*xp1, *t0); |
258 | /* works because the cos is nearly one */ | 259 | /* works because the cos is nearly one */ |
259 | *yp++ = yr - S_MUL(yi,sine); | 260 | *yp++ = yr - S_MUL(yi,sine); |
260 | *yp++ = yi + S_MUL(yr,sine); | 261 | *yp++ = yi + S_MUL(yr,sine); |
261 | xp1+=2*stride; | 262 | xp1+=2*stride; |
262 | xp2-=2*stride; | 263 | xp2-=2*stride; |
264 | t0 += stride; | ||
265 | t1 -= stride; | ||
263 | } | 266 | } |
264 | } | 267 | } |
265 | 268 | ||
@@ -269,19 +272,21 @@ void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scala | |||
269 | /* Post-rotate */ | 272 | /* Post-rotate */ |
270 | { | 273 | { |
271 | kiss_fft_scalar * OPUS_RESTRICT fp = f; | 274 | kiss_fft_scalar * OPUS_RESTRICT fp = f; |
272 | const kiss_twiddle_scalar *t = &l->trig[0]; | 275 | const kiss_twiddle_scalar *t0 = &l->trig[0]; |
273 | 276 | const kiss_twiddle_scalar *t1 = &l->trig[N4<<shift]; | |
274 | for(i=0;i<N4;i++) | 277 | for(i=0;i<N4;i++) |
275 | { | 278 | { |
276 | kiss_fft_scalar re, im, yr, yi; | 279 | kiss_fft_scalar re, im, yr, yi; |
277 | re = fp[0]; | 280 | re = fp[0]; |
278 | im = fp[1]; | 281 | im = fp[1]; |
279 | /* We'd scale up by 2 here, but instead it's done when mixing the windows */ | 282 | /* We'd scale up by 2 here, but instead it's done when mixing the windows */ |
280 | yr = S_MUL(re,t[i<<shift]) - S_MUL(im,t[(N4-i)<<shift]); | 283 | yr = S_MUL(re, *t0) - S_MUL(im, *t1); |
281 | yi = S_MUL(im,t[i<<shift]) + S_MUL(re,t[(N4-i)<<shift]); | 284 | yi = S_MUL(im, *t0) + S_MUL(re, *t1); |
282 | /* works because the cos is nearly one */ | 285 | /* works because the cos is nearly one */ |
283 | *fp++ = yr - S_MUL(yi,sine); | 286 | *fp++ = yr - S_MUL(yi,sine); |
284 | *fp++ = yi + S_MUL(yr,sine); | 287 | *fp++ = yi + S_MUL(yr,sine); |
288 | t0 += stride; | ||
289 | t1 -= stride; | ||
285 | } | 290 | } |
286 | } | 291 | } |
287 | /* De-shuffle the components for the middle of the window only */ | 292 | /* De-shuffle the components for the middle of the window only */ |