From: "Kristofer Björkström" <Kristofer.Bjorkstrom@axis.com> To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] avcodec: add ACC_NON_HE decoder Date: Tue, 31 Jan 2023 16:34:25 +0000 Message-ID: <DU0PR02MB91717986FFEF47B09CEDEA17F8D09@DU0PR02MB9171.eurprd02.prod.outlook.com> (raw) As ACC decoder but with HE and HEv2 disabled. Signed-off-by: Kristofer Björkström <kristofb@axis.com> --- Changelog | 1 + configure | 1 + libavcodec/Makefile | 3 +++ libavcodec/aacdec.c | 21 +++++++++++++++++++++ libavcodec/aacdec_template.c | 8 ++++++++ libavcodec/aactab.c | 2 +- libavcodec/aarch64/Makefile | 4 ++++ libavcodec/allcodecs.c | 1 + libavcodec/arm/Makefile | 4 ++++ libavcodec/mips/Makefile | 4 ++++ libavcodec/version.h | 2 +- libavcodec/x86/Makefile | 4 ++++ tests/checkasm/Makefile | 2 ++ tests/checkasm/checkasm.c | 2 +- 14 files changed, 56 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index aa0dad13a1..a9f5b54baa 100644 --- a/Changelog +++ b/Changelog @@ -35,6 +35,7 @@ version <next>: - ffmpeg CLI new options: -enc_stats_pre[_fmt], -enc_stats_post[_fmt] - hstack_vaapi, vstack_vaapi and xstack_vaapi filters - XMD ADPCM decoder and demuxer +- ACC NON HE decoder version 5.1: diff --git a/configure b/configure index 47790d10f5..7a06c1a34c 100755 --- a/configure +++ b/configure @@ -2746,6 +2746,7 @@ rdft_select="fft" # decoders / encoders aac_decoder_select="adts_header mpeg4audio sinewin" +aac_non_he_decoder_select="adts_header mpeg4audio sinewin" aac_fixed_decoder_select="adts_header mpeg4audio" aac_encoder_select="audio_frame_queue iirfilter lpc sinewin" aac_latm_decoder_select="aac_decoder aac_latm_parser" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 304c2bc2e3..43d86e1899 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -180,6 +180,9 @@ OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps_common.o aacps_float.o \ kbdwin.o \ sbrdsp.o aacpsdsp_float.o cbrt_data.o +OBJS-$(CONFIG_AAC_NON_HE_DECODER) += aacdec.o aactab.o aacsbr.o aacps_common.o aacps_float.o \ + kbdwin.o \ + sbrdsp.o aacpsdsp_float.o cbrt_data.o OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aactab.o aacsbr_fixed.o aacps_common.o aacps_fixed.o \ kbdwin.o \ sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index ca31540d3c..b55de9e180 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -571,6 +571,27 @@ const FFCodec ff_aac_decoder = { .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), }; +const FFCodec ff_aac_non_he_decoder = { + .p.name = "aac", + CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, + .priv_data_size = sizeof(AACContext), + .init = aac_decode_init, + .close = aac_decode_close, + FF_CODEC_DECODE_CB(aac_decode_frame), + .p.sample_fmts = (const enum AVSampleFormat[]) { + AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE + }, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) + .p.ch_layouts = aac_ch_layout, + .flush = flush, + .p.priv_class = &aac_decoder_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), +}; + /* Note: This decoder filter is intended to decode LATM streams transferred in MPEG transport streams which only contain one program. diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 444dc4fa9d..bdadecac54 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -93,6 +93,7 @@ #include "libavutil/thread.h" #include "decode.h" #include "internal.h" +#include "config_components.h" static VLC vlc_scalefactors; static VLC vlc_spectral[11]; @@ -1019,7 +1020,14 @@ static int decode_audio_specific_config_gb(AACContext *ac, *m4ac = m4ac_bak; return AVERROR_INVALIDDATA; } +#if CONFIG_AAC_NON_HE_DECODER + if (m4ac->ps > 0 || m4ac->sbr > 0 || avctx->profile >= FF_PROFILE_AAC_HE) { + av_log(avctx, AV_LOG_ERROR, "HE-AAC is not supported\n"); + + return AVERROR_INVALIDDATA; + } +#endif skip_bits_long(gb, i); switch (m4ac->object_type) { diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index 0f4941d5df..cf75904958 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -39,7 +39,7 @@ float ff_aac_pow2sf_tab[428]; float ff_aac_pow34sf_tab[428]; -#if CONFIG_AAC_ENCODER || CONFIG_AAC_DECODER +#if CONFIG_AAC_ENCODER || CONFIG_AAC_DECODER || CONFIG_AAC_NON_HE_DECODER #include "kbdwin.h" #include "sinewin.h" diff --git a/libavcodec/aarch64/Makefile b/libavcodec/aarch64/Makefile index 02fb51c3ab..016371a166 100644 --- a/libavcodec/aarch64/Makefile +++ b/libavcodec/aarch64/Makefile @@ -17,6 +17,8 @@ OBJS-$(CONFIG_VP8DSP) += aarch64/vp8dsp_init_aarch64.o # decoders/encoders OBJS-$(CONFIG_AAC_DECODER) += aarch64/aacpsdsp_init_aarch64.o \ aarch64/sbrdsp_init_aarch64.o +OBJS-$(CONFIG_AAC_NON_HE_DECODER) += aarch64/aacpsdsp_init_aarch64.o \ + aarch64/sbrdsp_init_aarch64.o OBJS-$(CONFIG_DCA_DECODER) += aarch64/synth_filter_init.o OBJS-$(CONFIG_OPUS_DECODER) += aarch64/opusdsp_init.o OBJS-$(CONFIG_RV40_DECODER) += aarch64/rv40dsp_init_aarch64.o @@ -36,6 +38,7 @@ ARMV8-OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp.o # subsystems NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/sbrdsp_neon.o +NEON-OBJS-$(CONFIG_AAC_NON_HE_DECODER) += aarch64/sbrdsp_neon.o NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o NEON-OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_neon.o NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o @@ -56,6 +59,7 @@ NEON-OBJS-$(CONFIG_VP8DSP) += aarch64/vp8dsp_neon.o # decoders/encoders NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/aacpsdsp_neon.o +NEON-OBJS-$(CONFIG_AAC_NON_HE_DECODER) += aarch64/aacpsdsp_neon.o NEON-OBJS-$(CONFIG_DCA_DECODER) += aarch64/synth_filter_neon.o NEON-OBJS-$(CONFIG_OPUS_DECODER) += aarch64/opusdsp_neon.o NEON-OBJS-$(CONFIG_VORBIS_DECODER) += aarch64/vorbisdsp_neon.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index ff82423a88..72ae363fbf 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -423,6 +423,7 @@ extern const FFCodec ff_zmbv_decoder; /* audio codecs */ extern const FFCodec ff_aac_encoder; extern const FFCodec ff_aac_decoder; +extern const FFCodec ff_aac_non_he_decoder; extern const FFCodec ff_aac_fixed_decoder; extern const FFCodec ff_aac_latm_decoder; extern const FFCodec ff_ac3_encoder; diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index 5d284bdc01..f813cdc65f 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -35,6 +35,8 @@ OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_arm.o # decoders/encoders OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \ arm/sbrdsp_init_arm.o +OBJS-$(CONFIG_AAC_NON_HE_DECODER) += arm/aacpsdsp_init_arm.o \ + arm/sbrdsp_init_arm.o OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_init_arm.o OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \ arm/flacdsp_arm.o @@ -134,6 +136,8 @@ NEON-OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_neon.o \ # decoders/encoders NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \ arm/sbrdsp_neon.o +NEON-OBJS-$(CONFIG_AAC_NON_HE_DECODER) += arm/aacpsdsp_neon.o \ + arm/sbrdsp_neon.o NEON-OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_neon.o NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_neon.o NEON-OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_neon.o \ diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile index 05ed63bf3e..1070b5e77f 100644 --- a/libavcodec/mips/Makefile +++ b/libavcodec/mips/Makefile @@ -20,6 +20,10 @@ OBJS-$(CONFIG_AAC_DECODER) += mips/aacdec_mips.o \ mips/aacsbr_mips.o \ mips/sbrdsp_mips.o \ mips/aacpsdsp_mips.o +OBJS-$(CONFIG_AAC_NON_HE_DECODER) += mips/aacdec_mips.o \ + mips/aacsbr_mips.o \ + mips/sbrdsp_mips.o \ + mips/aacpsdsp_mips.o MIPSDSP-OBJS-$(CONFIG_AAC_ENCODER) += mips/aaccoder_mips.o MIPSFPU-OBJS-$(CONFIG_AAC_ENCODER) += mips/iirfilter_mips.o OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o \ diff --git a/libavcodec/version.h b/libavcodec/version.h index 2ed4ef5547..499c6bb175 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 60 +#define LIBAVCODEC_VERSION_MINOR 61 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 118daca333..64fec2ce59 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -41,6 +41,8 @@ OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o # decoders/encoders OBJS-$(CONFIG_AAC_DECODER) += x86/aacpsdsp_init.o \ x86/sbrdsp_init.o +OBJS-$(CONFIG_AAC_NON_HE_DECODER) += x86/aacpsdsp_init.o \ + x86/sbrdsp_init.o OBJS-$(CONFIG_AAC_ENCODER) += x86/aacencdsp_init.o OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp_init.o OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp_init.o @@ -151,6 +153,8 @@ X86ASM-OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp.o \ # decoders/encoders X86ASM-OBJS-$(CONFIG_AAC_DECODER) += x86/aacpsdsp.o \ x86/sbrdsp.o +X86ASM-OBJS-$(CONFIG_AAC_NON_HE_DECODER) += x86/aacpsdsp.o \ + x86/sbrdsp.o X86ASM-OBJS-$(CONFIG_AAC_ENCODER) += x86/aacencdsp.o X86ASM-OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp.o X86ASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile index a6f06c7007..dd8ac1f278 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -20,6 +20,8 @@ AVCODECOBJS-$(CONFIG_VIDEODSP) += videodsp.o # decoders/encoders AVCODECOBJS-$(CONFIG_AAC_DECODER) += aacpsdsp.o \ sbrdsp.o +AVCODECOBJS-$(CONFIG_AAC_NON_HE_DECODER) += aacpsdsp.o \ + sbrdsp.o AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o AVCODECOBJS-$(CONFIG_EXR_DECODER) += exrdsp.o diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index e96d84a7da..8f7796ca3a 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -74,7 +74,7 @@ static const struct { void (*func)(void); } tests[] = { #if CONFIG_AVCODEC - #if CONFIG_AAC_DECODER + #if CONFIG_AAC_DECODER || CONFIG_AAC_NON_HE_DECODER { "aacpsdsp", checkasm_check_aacpsdsp }, { "sbrdsp", checkasm_check_sbrdsp }, #endif -- 2.30.2 _______________________________________________ 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 reply other threads:[~2023-01-31 16:34 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-31 16:34 Kristofer Björkström [this message] 2023-01-31 20:01 ` Lynne 2023-01-31 20:18 ` Andreas Rheinhardt 2023-02-01 14:55 ` Kristofer Björkström 2023-02-01 15:19 ` Jean-Baptiste Kempf
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=DU0PR02MB91717986FFEF47B09CEDEA17F8D09@DU0PR02MB9171.eurprd02.prod.outlook.com \ --to=kristofer.bjorkstrom@axis.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