diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-05 02:18:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-05 02:18:57 +0100 |
commit | fd53f9d985c90be417d2acd5bc7f4300054d9dcd (patch) | |
tree | 1093ec6f0e06c572a0fbd6cd619bce673baacc51 /libavcodec | |
parent | f200ec20b8156d0c81d4eef5f8a3e2d3094427c3 (diff) | |
parent | 7f29644108c5fbd80f160930b31b78b8704c1a49 (diff) | |
download | ffmpeg-fd53f9d985c90be417d2acd5bc7f4300054d9dcd.tar.gz |
Merge commit '7f29644108c5fbd80f160930b31b78b8704c1a49'
* commit '7f29644108c5fbd80f160930b31b78b8704c1a49':
aac: Fix low delay windowing.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacdec.c | 11 | ||||
-rw-r--r-- | libavcodec/aactab.c | 1 | ||||
-rw-r--r-- | libavcodec/aactab.h | 1 |
3 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index bb69d5d0e7..365df2117d 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1133,7 +1133,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); @@ -2529,14 +2528,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)); diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index 5a2aea4852..eb882e8976 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -34,7 +34,6 @@ #include <stdint.h> DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024]; -DECLARE_ALIGNED(32, float, ff_aac_kbd_long_512 )[512]; DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; const uint8_t ff_aac_num_swb_1024[] = { diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 4d0b104653..5ed850888f 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -45,7 +45,6 @@ * @{ */ DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_1024)[1024]; -DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_512 )[512]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_128)[128]; const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window)[1920]; // @} |