aacdec: fix priming/skip for AAC HE/HE2
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Aug 2012 22:13:22 +0000 (00:13 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Aug 2012 22:22:58 +0000 (00:22 +0200)
There is a remaining error of 2 - 8 samples in some but not all cases,
the source of the error is unknown ATM.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacdec.c
tests/fate/aac.mak

index ee6b112..b0a072d 100644 (file)
@@ -2539,6 +2539,12 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
         ac->oc[1].status = OC_LOCKED;
     }
 
         ac->oc[1].status = OC_LOCKED;
     }
 
+    if (multiplier) {
+        int side_size;
+        uint32_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
+        if (side && side_size>=4)
+            AV_WL32(side, 2*AV_RL32(side));
+    }
     return 0;
 fail:
     pop_output_configuration(ac);
     return 0;
 fail:
     pop_output_configuration(ac);
index 0a075ca..2b615ab 100644 (file)
@@ -46,17 +46,17 @@ fate-aac-am05_44: CMP_SHIFT = 12288
 FATE_AAC += fate-aac-al_sbr_hq_cm_48_2
 fate-aac-al_sbr_hq_cm_48_2: CMD = pcm -i $(SAMPLES)/aac/al_sbr_cm_48_2.mp4
 fate-aac-al_sbr_hq_cm_48_2: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_2.s16
 FATE_AAC += fate-aac-al_sbr_hq_cm_48_2
 fate-aac-al_sbr_hq_cm_48_2: CMD = pcm -i $(SAMPLES)/aac/al_sbr_cm_48_2.mp4
 fate-aac-al_sbr_hq_cm_48_2: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_2.s16
-fate-aac-al_sbr_hq_cm_48_2: CMP_SHIFT = 4096
+fate-aac-al_sbr_hq_cm_48_2: CMP_SHIFT = 8192
 
 FATE_AAC += fate-aac-al_sbr_hq_cm_48_5.1
 fate-aac-al_sbr_hq_cm_48_5.1: CMD = pcm -i $(SAMPLES)/aac/al_sbr_cm_48_5.1.mp4
 fate-aac-al_sbr_hq_cm_48_5.1: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_5.1_reorder.s16
 
 FATE_AAC += fate-aac-al_sbr_hq_cm_48_5.1
 fate-aac-al_sbr_hq_cm_48_5.1: CMD = pcm -i $(SAMPLES)/aac/al_sbr_cm_48_5.1.mp4
 fate-aac-al_sbr_hq_cm_48_5.1: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_5.1_reorder.s16
-fate-aac-al_sbr_hq_cm_48_5.1: CMP_SHIFT = 12288
+fate-aac-al_sbr_hq_cm_48_5.1: CMP_SHIFT = 24576
 
 FATE_AAC += fate-aac-al_sbr_ps_06_ur
 fate-aac-al_sbr_ps_06_ur: CMD = pcm -i $(SAMPLES)/aac/al_sbr_ps_06_new.mp4
 fate-aac-al_sbr_ps_06_ur: REF = $(SAMPLES)/aac/al_sbr_ps_06_ur.s16
 
 FATE_AAC += fate-aac-al_sbr_ps_06_ur
 fate-aac-al_sbr_ps_06_ur: CMD = pcm -i $(SAMPLES)/aac/al_sbr_ps_06_new.mp4
 fate-aac-al_sbr_ps_06_ur: REF = $(SAMPLES)/aac/al_sbr_ps_06_ur.s16
-fate-aac-al_sbr_ps_06_ur: CMP_SHIFT = 4096
+fate-aac-al_sbr_ps_06_ur: CMP_SHIFT = 8192
 
 FATE_AAC += fate-aac-latm_000000001180bc60
 fate-aac-latm_000000001180bc60: CMD = pcm -i $(SAMPLES)/aac/latm_000000001180bc60.mpg
 
 FATE_AAC += fate-aac-latm_000000001180bc60
 fate-aac-latm_000000001180bc60: CMD = pcm -i $(SAMPLES)/aac/latm_000000001180bc60.mpg
@@ -73,7 +73,7 @@ fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
 
 fate-aac-ct%: CMD = pcm -i $(SAMPLES)/aac/CT_DecoderCheck/$(@:fate-aac-ct-%=%)
 fate-aac-ct%: REF = $(SAMPLES)/aac/CT_DecoderCheck/aacPlusv2.wav
 
 fate-aac-ct%: CMD = pcm -i $(SAMPLES)/aac/CT_DecoderCheck/$(@:fate-aac-ct-%=%)
 fate-aac-ct%: REF = $(SAMPLES)/aac/CT_DecoderCheck/aacPlusv2.wav
-fate-aac-ct%: CMP_SHIFT = 4096
+fate-aac-ct%: CMP_SHIFT = 8192
 fate-aac-ct-sbr_i-ps_i.aac: CMP_SHIFT = 0
 
 FATE_AAC_CT = sbr_bc-ps_i.3gp  \
 fate-aac-ct-sbr_i-ps_i.aac: CMP_SHIFT = 0
 
 FATE_AAC_CT = sbr_bc-ps_i.3gp  \