diff options
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 4ed8f8f0ae..70fbb534fb 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1065,7 +1065,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) ff_mdct_init(&ac->mdct_ltp, 11, 0, -2.0 * 32768.0); // window initialization ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); - ff_kbd_window_init(ff_aac_kbd_long_512, 4.0, 512); ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); ff_init_ff_sine_windows(10); ff_init_ff_sine_windows( 9); @@ -2430,14 +2429,20 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) float *in = sce->coeffs; float *out = sce->ret; float *saved = sce->saved; - const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_512 : ff_sine_512; float *buf = ac->buf_mdct; // imdct ac->mdct.imdct_half(&ac->mdct_ld, buf, in); // window overlapping - ac->fdsp.vector_fmul_window(out, saved, buf, lwindow_prev, 256); + if (ics->use_kb_window[1]) { + // AAC LD uses a low overlap sine window instead of a KBD window + memcpy(out, saved, 192 * sizeof(float)); + ac->fdsp.vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64); + memcpy( out + 320, buf + 64, 192 * sizeof(float)); + } else { + ac->fdsp.vector_fmul_window(out, saved, buf, ff_sine_512, 256); + } // buffer update memcpy(saved, buf + 256, 256 * sizeof(float)); |