From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH] avcodec/aacdec: don't force HE-AACv2 profile if no PS info is present Date: Mon, 18 Jul 2022 15:57:53 +0200 Message-ID: <DB6PR0101MB2214BF7DB161376886A018F68F8C9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com> (raw) In-Reply-To: <b1698c85-2680-bf3b-2606-9eade28f9aa9@gmail.com> James Almer: > On 7/14/2022 9:10 AM, Andreas Rheinhardt wrote: >> James Almer: >>> Should fix ticket #3361 >>> >>> Signed-off-by: James Almer <jamrial@gmail.com> >>> --- >>> This also needs an update to some fate ref samples i'll upload before >>> pushing >>> (fate-aac-al_sbr_ps_04_ur and fate-aac-al_sbr_ps_06_ur which are now >>> decoded >>> properly as he_aac mono, so the .s16 files need to be replaced). >>> >> >> We have both a fixed-point AAC as well as a floating point AAC decoder. >> Is there actually a test that tests that the output they produce is >> reasonably close? If not, could we make the test so that the same file >> is decoded once with the fixed-point and once with the floating-point >> decoder and then compared? > > That wouldn't help much, i think. Almost all changes to *_template.c > files are going to affect both decoders, so a breakage would not be > detected if you compare their output with each other as they would both > exhibit it. > I actually thought that the aac_fixed tests used checksums instead of ref files; then changes and breakages would be visible by changes to these files. Apparently I was wrong about that and the ref files are used for both aac and aac_fixed. But a test like the one outlined above would nevertheless obviate the need for a new ref file. >> >>> libavcodec/aacdec_template.c | 15 ++++++--------- >>> libavcodec/aacsbr_template.c | 1 + >>> tests/fate/gapless.mak | 14 +++++++------- >>> .../audiomatch-afconvert-16000-stereo-he2-adts | 2 +- >>> 4 files changed, 15 insertions(+), 17 deletions(-) >>> >>> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c >>> index 10fba3d3b2..15c20c07d6 100644 >>> --- a/libavcodec/aacdec_template.c >>> +++ b/libavcodec/aacdec_template.c >>> @@ -967,8 +967,7 @@ static int decode_ga_specific_config(AACContext >>> *ac, AVCodecContext *avctx, >>> if (count_channels(layout_map, tags) > 1) { >>> m4ac->ps = 0; >>> - } else if (m4ac->sbr == 1 && m4ac->ps == -1) >>> - m4ac->ps = 1; >>> + } >>> if (ac && (ret = output_configure(ac, layout_map, tags, >>> OC_GLOBAL_HDR, 0))) >>> return ret; >>> @@ -2572,18 +2571,16 @@ static int >>> decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, >>> av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found >>> with a first occurrence after the first frame.\n"); >>> skip_bits_long(gb, 8 * cnt - 4); >>> return res; >>> - } else if (ac->oc[1].m4ac.ps == -1 && ac->oc[1].status < >>> OC_LOCKED && >>> - ac->avctx->ch_layout.nb_channels == 1) { >>> - ac->oc[1].m4ac.sbr = 1; >>> - ac->oc[1].m4ac.ps = 1; >>> - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; >>> - output_configure(ac, ac->oc[1].layout_map, >>> ac->oc[1].layout_map_tags, >>> - ac->oc[1].status, 1); >>> } else { >>> ac->oc[1].m4ac.sbr = 1; >>> ac->avctx->profile = FF_PROFILE_AAC_HE; >>> } >>> res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, >>> gb, crc_flag, cnt, elem_type); >>> + if (ac->oc[1].m4ac.ps == 1 && ac->oc[1].status < OC_LOCKED && >>> + ac->avctx->ch_layout.nb_channels == 1) { >>> + output_configure(ac, ac->oc[1].layout_map, >>> ac->oc[1].layout_map_tags, >>> + ac->oc[1].status, 1); >>> + } >>> break; >>> case EXT_DYNAMIC_RANGE: >>> res = decode_dynamic_range(&ac->che_drc, gb); >>> diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c >>> index b72c94b76d..f9925b40e5 100644 >>> --- a/libavcodec/aacsbr_template.c >>> +++ b/libavcodec/aacsbr_template.c >>> @@ -954,6 +954,7 @@ static void read_sbr_extension(AACContext *ac, >>> SpectralBandReplication *sbr, >>> *num_bits_left = 0; >>> } else { >>> *num_bits_left -= ff_ps_read_data(ac->avctx, gb, >>> &sbr->ps.common, *num_bits_left); >>> + ac->oc[1].m4ac.ps = 1; >>> ac->avctx->profile = FF_PROFILE_AAC_HE_V2; >>> } >>> break; >>> diff --git a/tests/fate/gapless.mak b/tests/fate/gapless.mak >>> index 68a396e187..7dd8ceb142 100644 >>> --- a/tests/fate/gapless.mak >>> +++ b/tests/fate/gapless.mak >>> @@ -47,27 +47,27 @@ fate-audiomatch-square-aac: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/squar >>> fate-audiomatch-afconvert-16000-mono-lc-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_lc.adts >>> $(SAMPLES)/audiomatch/tones_16000_mono.wav >>> fate-audiomatch-afconvert-16000-mono-lc-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_lc.m4a >>> $(SAMPLES)/audiomatch/tones_16000_mono.wav >>> -fate-audiomatch-afconvert-16000-mono-he-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_he.adts >>> $(SAMPLES)/audiomatch/tones_16000_mono.wav "-ac 1 -ar 16000" >>> -fate-audiomatch-afconvert-16000-mono-he-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_he.m4a >>> $(SAMPLES)/audiomatch/tones_16000_mono.wav "-ac 1 -ar 16000" >>> +fate-audiomatch-afconvert-16000-mono-he-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_he.adts >>> $(SAMPLES)/audiomatch/tones_16000_mono.wav "-ar 16000" >>> +fate-audiomatch-afconvert-16000-mono-he-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_he.m4a >>> $(SAMPLES)/audiomatch/tones_16000_mono.wav "-ar 16000" >>> fate-audiomatch-afconvert-16000-stereo-lc-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_lc.adts $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> >>> fate-audiomatch-afconvert-16000-stereo-lc-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_lc.m4a $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> >>> fate-audiomatch-afconvert-16000-stereo-he-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he.adts $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> "-ar 16000" >>> fate-audiomatch-afconvert-16000-stereo-he-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he.m4a $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> "-ar 16000" >>> -fate-audiomatch-afconvert-16000-stereo-he2-adts:CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he2.adts $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> "-ar 16000" >>> +fate-audiomatch-afconvert-16000-stereo-he2-adts:CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he2.adts $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> "-ac 2 -ar 16000" >>> fate-audiomatch-afconvert-16000-stereo-he2-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he2.m4a $(SAMPLES)/audiomatch/tones_16000_stereo.wav >>> "-ar 16000" >>> fate-audiomatch-afconvert-44100-mono-lc-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_lc.adts >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav >>> fate-audiomatch-afconvert-44100-mono-lc-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_lc.m4a >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav >>> -fate-audiomatch-afconvert-44100-mono-he-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_he.adts >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav "-ac 1" >>> -fate-audiomatch-afconvert-44100-mono-he-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_he.m4a >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav "-ac 1" >>> +fate-audiomatch-afconvert-44100-mono-he-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_he.adts >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav >>> +fate-audiomatch-afconvert-44100-mono-he-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_he.m4a >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav >>> fate-audiomatch-afconvert-44100-stereo-lc-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_lc.adts $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> >>> fate-audiomatch-afconvert-44100-stereo-lc-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_lc.m4a $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> >>> fate-audiomatch-afconvert-44100-stereo-he-adts: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he.adts $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> >>> fate-audiomatch-afconvert-44100-stereo-he-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he.m4a $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> >>> -fate-audiomatch-afconvert-44100-stereo-he2-adts:CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he2.adts $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> >>> +fate-audiomatch-afconvert-44100-stereo-he2-adts:CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he2.adts $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> "-ac 2" >>> fate-audiomatch-afconvert-44100-stereo-he2-m4a: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he2.m4a $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> >>> fate-audiomatch-dolby-44100-mono-lc-mp4: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_mono_aac_lc.mp4 >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav >>> -fate-audiomatch-dolby-44100-mono-he-mp4: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_mono_aac_he.mp4 >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav "-ac 1" >>> +fate-audiomatch-dolby-44100-mono-he-mp4: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_mono_aac_he.mp4 >>> $(SAMPLES)/audiomatch/tones_44100_mono.wav >>> fate-audiomatch-dolby-44100-stereo-lc-mp4: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_lc.mp4 >>> $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> fate-audiomatch-dolby-44100-stereo-he-mp4: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_he.mp4 >>> $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> fate-audiomatch-dolby-44100-stereo-he2-mp4: CMD = audio_match >>> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_he2.mp4 >>> $(SAMPLES)/audiomatch/tones_44100_stereo.wav >>> diff --git >>> a/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts >>> b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts >>> index 32b2627946..527c9acdba 100644 >>> --- a/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts >>> +++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts >>> @@ -1 +1 @@ >>> -presig: 5186 postsig:446 c: 0.9839 lenerr:5632 >>> +presig: 5154 postsig:446 c: 0.9839 lenerr:5600 >> _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-07-18 13:58 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-13 17:59 James Almer 2022-07-14 12:10 ` Andreas Rheinhardt 2022-07-16 12:53 ` James Almer 2022-07-18 13:57 ` Andreas Rheinhardt [this message] 2022-07-22 12:46 ` James Almer 2022-07-22 14:23 ` Andreas Rheinhardt 2022-07-22 14:51 ` James Almer 2022-07-22 14:56 ` Andreas Rheinhardt 2022-07-22 15:03 ` James Almer 2022-07-22 15:14 ` Andreas Rheinhardt 2022-07-22 15:37 ` James Almer 2022-07-22 23:00 ` Alex Converse 2022-07-22 23:10 ` James Almer 2022-08-02 17:48 ` James Almer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=DB6PR0101MB2214BF7DB161376886A018F68F8C9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git