diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2015-11-14 01:57:25 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-21 13:38:45 +0300 |
commit | 6662ca28d4c03c2f45fdba3945c7f0e7bdf64264 (patch) | |
tree | 25f28457b59152e0d72d26d42543e8ae37eca088 | |
parent | f2d9ae6e49ed534786eed45ce434ed9780710910 (diff) |
avcodec/atrac1: fix decoder: QMF delay compensation should be 39 samples
This also adds a new fate test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/atrac1.c | 8 | ||||
-rw-r--r-- | tests/fate/atrac.mak | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index b70cf4fd92..a8c8c91bcc 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -65,7 +65,7 @@ typedef struct AT1SUCtx { DECLARE_ALIGNED(32, float, spec2)[AT1_SU_SAMPLES]; ///< mdct buffer DECLARE_ALIGNED(32, float, fst_qmf_delay)[46]; ///< delay line for the 1st stacked QMF filter DECLARE_ALIGNED(32, float, snd_qmf_delay)[46]; ///< delay line for the 2nd stacked QMF filter - DECLARE_ALIGNED(32, float, last_qmf_delay)[256+23]; ///< delay line for the last stacked QMF filter + DECLARE_ALIGNED(32, float, last_qmf_delay)[256+39]; ///< delay line for the last stacked QMF filter } AT1SUCtx; /** @@ -260,9 +260,9 @@ static void at1_subband_synthesis(AT1Ctx *q, AT1SUCtx* su, float *pOut) /* combine low and middle bands */ ff_atrac_iqmf(q->bands[0], q->bands[1], 128, temp, su->fst_qmf_delay, iqmf_temp); - /* delay the signal of the high band by 23 samples */ - memcpy( su->last_qmf_delay, &su->last_qmf_delay[256], sizeof(float) * 23); - memcpy(&su->last_qmf_delay[23], q->bands[2], sizeof(float) * 256); + /* delay the signal of the high band by 39 samples */ + memcpy( su->last_qmf_delay, &su->last_qmf_delay[256], sizeof(float) * 39); + memcpy(&su->last_qmf_delay[39], q->bands[2], sizeof(float) * 256); /* combine (low + middle) and high bands */ ff_atrac_iqmf(temp, su->last_qmf_delay, 256, pOut, su->snd_qmf_delay, iqmf_temp); diff --git a/tests/fate/atrac.mak b/tests/fate/atrac.mak index 0a086d8fba..acf79a539c 100644 --- a/tests/fate/atrac.mak +++ b/tests/fate/atrac.mak @@ -1,6 +1,13 @@ -FATE_ATRAC1-$(call DEMDEC, AEA, ATRAC1) += fate-atrac1 -fate-atrac1: CMD = pcm -i $(TARGET_SAMPLES)/atrac1/test_tones_small.aea -fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm +FATE_ATRAC1 += fate-atrac1-1 +fate-atrac1-1: CMD = pcm -i $(TARGET_SAMPLES)/atrac1/test_tones_small.aea +fate-atrac1-1: REF = $(SAMPLES)/atrac1/test_tones_small_fixed_delay.pcm + +FATE_ATRAC1 += fate-atrac1-2 +fate-atrac1-2: CMD = pcm -i $(TARGET_SAMPLES)/atrac1/chirp_tone_10-16000.aea +fate-atrac1-2: REF = $(SAMPLES)/atrac1/chirp_tone_10-16000.pcm +fate-atrac1-2: FUZZ = 61 + +FATE_ATRAC1-$(call DEMDEC, AEA, ATRAC1) += $(FATE_ATRAC1) FATE_ATRAC3 += fate-atrac3-1 fate-atrac3-1: CMD = pcm -i $(TARGET_SAMPLES)/atrac3/mc_sich_at3_066_small.wav |