Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FFmpeg/FFmpeg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ed2b69a4c32a
Choose a base ref
...
head repository: FFmpeg/FFmpeg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c0209facd268
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Sep 28, 2012

  1. aacdec: detect faac and skip correct amount of startup samples

    This also fixes aac in adts and other containers than mov.
    
    Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
    michaelni committed Sep 28, 2012
    Copy the full SHA
    bfe735b View commit details
  2. mov: remove default of 1024 sample skip for aac.

    It is not correct in all cases and it is less predictable than a skip of 0
    for user applications.
    
    Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
    michaelni committed Sep 28, 2012
    Copy the full SHA
    c0209fa View commit details
Showing with 28 additions and 17 deletions.
  1. +28 −0 libavcodec/aacdec.c
  2. +0 −2 libavformat/mov.c
  3. +0 −15 tests/fate/aac.mak
28 changes: 28 additions & 0 deletions libavcodec/aacdec.c
Original file line number Diff line number Diff line change
@@ -1947,6 +1947,32 @@ static int decode_dynamic_range(DynamicRangeControl *che_drc,
return n;
}

static int decode_fill(AACContext *ac, GetBitContext *gb, int len) {
uint8_t buf[256];
int i, major, minor;

if (len < 13+7*8)
goto unknown;

get_bits(gb, 13); len -= 13;

for(i=0; i+1<sizeof(buf) && len>=8; i++, len-=8)
buf[i] = get_bits(gb, 8);

buf[i] = 0;
if (ac->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(ac->avctx, AV_LOG_DEBUG, "FILL:%s\n", buf);

if (sscanf(buf, "libfaac %d.%d", &major, &minor) == 2){
ac->avctx->internal->skip_samples = 1024;
}

unknown:
skip_bits_long(gb, len);

return 0;
}

/**
* Decode extension data (incomplete); reference: table 4.51.
*
@@ -1988,6 +2014,8 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
res = decode_dynamic_range(&ac->che_drc, gb, cnt);
break;
case EXT_FILL:
decode_fill(ac, gb, 8 * cnt - 4);
break;
case EXT_FILL_DATA:
case EXT_DATA_ELEMENT:
default:
2 changes: 0 additions & 2 deletions libavformat/mov.c
Original file line number Diff line number Diff line change
@@ -3135,8 +3135,6 @@ static int mov_read_header(AVFormatContext *s)
AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data;
if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->codec->codec_id == AV_CODEC_ID_AAC) {
if(!sc->start_pad)
sc->start_pad = 1024;
st->skip_samples = sc->start_pad;
}
}
15 changes: 0 additions & 15 deletions tests/fate/aac.mak
Original file line number Diff line number Diff line change
@@ -1,62 +1,50 @@
FATE_AAC += fate-aac-al04_44
fate-aac-al04_44: CMD = pcm -i $(SAMPLES)/aac/al04_44.mp4
fate-aac-al04_44: REF = $(SAMPLES)/aac/al04_44.s16
fate-aac-al04_44: CMP_SHIFT = 2048

FATE_AAC += fate-aac-al05_44
fate-aac-al05_44: CMD = pcm -i $(SAMPLES)/aac/al05_44.mp4
fate-aac-al05_44: REF = $(SAMPLES)/aac/al05_44.s16
fate-aac-al05_44: CMP_SHIFT = 4096

FATE_AAC += fate-aac-al06_44
fate-aac-al06_44: CMD = pcm -i $(SAMPLES)/aac/al06_44.mp4
fate-aac-al06_44: REF = $(SAMPLES)/aac/al06_44_reorder.s16
fate-aac-al06_44: CMP_SHIFT = 6144

FATE_AAC += fate-aac-al07_96
fate-aac-al07_96: CMD = pcm -i $(SAMPLES)/aac/al07_96.mp4
fate-aac-al07_96: REF = $(SAMPLES)/aac/al07_96_reorder.s16
fate-aac-al07_96: CMP_SHIFT = 12288

FATE_AAC += fate-aac-al15_44
fate-aac-al15_44: CMD = pcm -i $(SAMPLES)/aac/al15_44.mp4
fate-aac-al15_44: REF = $(SAMPLES)/aac/al15_44_reorder.s16
fate-aac-al15_44: CMP_SHIFT = 12288

FATE_AAC += fate-aac-al17_44
fate-aac-al17_44: CMD = pcm -i $(SAMPLES)/aac/al17_44.mp4
fate-aac-al17_44: REF = $(SAMPLES)/aac/al17_44.s16
fate-aac-al17_44: CMP_SHIFT = 4096

FATE_AAC += fate-aac-al18_44
fate-aac-al18_44: CMD = pcm -i $(SAMPLES)/aac/al18_44.mp4
fate-aac-al18_44: REF = $(SAMPLES)/aac/al18_44.s16
fate-aac-al18_44: CMP_SHIFT = 2048

FATE_AAC += fate-aac-am00_88
fate-aac-am00_88: CMD = pcm -i $(SAMPLES)/aac/am00_88.mp4
fate-aac-am00_88: REF = $(SAMPLES)/aac/am00_88.s16
fate-aac-am00_88: CMP_SHIFT = 2048

FATE_AAC += fate-aac-am05_44
fate-aac-am05_44: CMD = pcm -i $(SAMPLES)/aac/am05_44.mp4
fate-aac-am05_44: REF = $(SAMPLES)/aac/am05_44_reorder.s16
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-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-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-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
@@ -65,16 +53,13 @@ fate-aac-latm_000000001180bc60: REF = $(SAMPLES)/aac/latm_000000001180bc60.s16
FATE_AAC += fate-aac-ap05_48
fate-aac-ap05_48: CMD = pcm -i $(SAMPLES)/aac/ap05_48.mp4
fate-aac-ap05_48: REF = $(SAMPLES)/aac/ap05_48.s16
fate-aac-ap05_48: CMP_SHIFT = 4096

FATE_AAC += fate-aac-latm_stereo_to_51
fate-aac-latm_stereo_to_51: CMD = pcm -i $(SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
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%: CMP_SHIFT = 8192
fate-aac-ct-sbr_i-ps_i.aac: CMP_SHIFT = 0

FATE_AAC_CT = sbr_bc-ps_i.3gp \
sbr_bic-ps_i.3gp \