From 95716fe7798ef207bb7924dff81970a45c358173 Mon Sep 17 00:00:00 2001 From: sunyuechi Date: Fri, 1 Dec 2023 04:21:53 +0800 Subject: [PATCH 1/3] lvac/aacenc: add ff_aac_dsp_init This is for clarity and use in testing, consistent with other parts of the code. --- libavcodec/aacenc.c | 24 ++++++++++++++---------- libavcodec/aacenc.h | 1 + 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 5e6a255a8f..443b25e25a 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -1381,16 +1381,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) ff_lpc_init(&s->lpc, 2*avctx->frame_size, TNS_MAX_ORDER, FF_LPC_TYPE_LEVINSON); s->random_state = 0x1f2e3d4c; - s->abs_pow34 = abs_pow34_v; - s->quant_bands = quantize_bands; - -#if ARCH_X86 - ff_aac_dsp_init_x86(s); -#endif - -#if HAVE_MIPSDSP - ff_aac_coder_init_mips(s); -#endif + ff_aac_dsp_init(s); ff_af_queue_init(avctx, &s->afq); @@ -1444,3 +1435,16 @@ const FFCodec ff_aac_encoder = { AV_SAMPLE_FMT_NONE }, .p.priv_class = &aacenc_class, }; + +void ff_aac_dsp_init(AACEncContext *s){ + s->abs_pow34 = abs_pow34_v; + s->quant_bands = quantize_bands; + +#if ARCH_X86 + ff_aac_dsp_init_x86(s); +#endif + +#if HAVE_MIPSDSP + ff_aac_coder_init_mips(s); +#endif +} diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h index b030c652ae..09dd8639be 100644 --- a/libavcodec/aacenc.h +++ b/libavcodec/aacenc.h @@ -154,6 +154,7 @@ typedef struct AACEncContext { } buffer; } AACEncContext; +void ff_aac_dsp_init(AACEncContext *s); void ff_aac_dsp_init_x86(AACEncContext *s); void ff_aac_coder_init_mips(AACEncContext *c); void ff_quantize_band_cost_cache_init(struct AACEncContext *s); -- 2.43.0