From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1C56542FA1 for ; Sat, 16 Jul 2022 12:53:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9579C68B868; Sat, 16 Jul 2022 15:53:52 +0300 (EEST) Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9927068B6D0 for ; Sat, 16 Jul 2022 15:53:45 +0300 (EEST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-10bec750eedso12207593fac.8 for ; Sat, 16 Jul 2022 05:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=CrAKgqrgdc4+yWEWceMScLZDPwCHNNCQVVVuLHBLWtY=; b=m1FR3poB+FQqzl5dReWHkbxnL0RD/r7MneUzLdVUIAJQWSPQvHnjUTtju3a19btdtJ lvkK+a8S3IScXIOnkB3NrEYFK4u440kcwK8HITGqnhmk3cWYAeohxFDAey0v5Qt0eW/S O2yUqttKRzwNHg/yXuOzsWqVyoAL4vLaljQUSL/SSXsBZ+cRQJOvylmxC8N6otgAyGGx 8wfHo9rl4N2g4wSuEgHSZv4zhWik1icOS0b/Tvej22B5ybzwFmUhS6oX1GNr3GSf+H0g w3LoBdQQqPY8mNmrtJCO/X5X9wnIQzfGHYDHouo0dSIX1uXDnEj5zriBHpGYbbmjwC7m 51Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=CrAKgqrgdc4+yWEWceMScLZDPwCHNNCQVVVuLHBLWtY=; b=DUS64fSIqbV201XrIYO3GGPHJbla6vFTeNibWRfndRhIrk5uRUTiH/JR+JFYk01q7x wOnsiId66+VyYSp2A2VlYntHIB0sT7AH1S1WMjn4Wc1NSDsJmnA3PEO0hQRGf/xsiMYF 6Om8dRGd5XE/LqF7nj+SMEplFeli2aaBrCkC1sBOPrsJEqMHW0r4WO426zh2UyUuRMXt aJ7bQ1UNejle0gHs4UhEuzhng6Bh2HgM+o+44TJP2Owlg0XrTYw+74ZhB+B9e0jeNsvZ /ms80dnJAmA3TNJ/1IoSFKuDad96mthbDVFdQ2/ZFD/Ekm90q0+d8PIlCJl8o2itsBfU b3Qg== X-Gm-Message-State: AJIora+4G9ZORrT4Eg+Uk8/1hY5+mviHXzg3LfOo/STgYURsxnDzrx9z Jjh6TrXrFY71IzMoHaIz69OeRhv6fRaptQ== X-Google-Smtp-Source: AGRyM1tdQuNnycmky2smJPy7Xzk+VQTJZUpdr2wOIXZAdizm6S/1bVCR4jQmZA7eUln7svBo6OEjvQ== X-Received: by 2002:a05:6871:413:b0:10b:f0ea:d445 with SMTP id d19-20020a056871041300b0010bf0ead445mr12674983oag.78.1657976023378; Sat, 16 Jul 2022 05:53:43 -0700 (PDT) Received: from [192.168.0.13] ([186.136.131.204]) by smtp.gmail.com with ESMTPSA id u20-20020a056870701400b0010c222f9faesm3666482oae.10.2022.07.16.05.53.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Jul 2022 05:53:42 -0700 (PDT) Message-ID: Date: Sat, 16 Jul 2022 09:53:41 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220713175948.1955-1-jamrial@gmail.com> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/aacdec: don't force HE-AACv2 profile if no PS info is present X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/14/2022 9:10 AM, Andreas Rheinhardt wrote: > James Almer: >> Should fix ticket #3361 >> >> Signed-off-by: James Almer >> --- >> 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. > >> 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". _______________________________________________ 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".