aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aac/aacdec_fixed.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-06 13:28:19 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-07 00:01:39 +0200
commit8762aa4d62522f993a6f4b03902feb3e6a875b32 (patch)
treecf595dc62396f20b45f5ae031741bfdbddd55ecc /libavcodec/aac/aacdec_fixed.c
parent0fc3d8e4d6d38da5f456ca958647b4ac34926c67 (diff)
downloadffmpeg-8762aa4d62522f993a6f4b03902feb3e6a875b32.tar.gz
avcodec/aac/aacdec: Move init functions to aacdec_fixed/float
This allows to merge it with AACDecDSP.init and remove the latter (it is called only once anyway); it also allows to make the fixed/float AACDecDSP and AACDecProc implementations internal to aacdec_fixed/float.c (which also fixes a violation of our naming conventions). And it some linker errors when either decoder is disabled. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/aac/aacdec_fixed.c')
-rw-r--r--libavcodec/aac/aacdec_fixed.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/libavcodec/aac/aacdec_fixed.c b/libavcodec/aac/aacdec_fixed.c
index 083f3b073e..79d35e05fb 100644
--- a/libavcodec/aac/aacdec_fixed.c
+++ b/libavcodec/aac/aacdec_fixed.c
@@ -63,18 +63,6 @@ static void init_tables_fixed_fn(void)
init_sine_windows_fixed();
}
-static int init_fixed(AACDecContext *ac)
-{
- static AVOnce init_fixed_once = AV_ONCE_INIT;
- ff_thread_once(&init_fixed_once, init_tables_fixed_fn);
-
- ac->fdsp = avpriv_alloc_fixed_dsp(ac->avctx->flags & AV_CODEC_FLAG_BITEXACT);
- if (!ac->fdsp)
- return AVERROR(ENOMEM);
-
- return 0;
-}
-
static const int cce_scale_fixed[8] = {
Q30(1.0), //2^(0/8)
Q30(1.0905077327), //2^(1/8)
@@ -93,3 +81,23 @@ static const int cce_scale_fixed[8] = {
#include "aacdec_fixed_prediction.h"
#include "aacdec_dsp_template.c"
#include "aacdec_proc_template.c"
+
+av_cold int ff_aac_decode_init_fixed(AVCodecContext *avctx)
+{
+ static AVOnce init_fixed_once = AV_ONCE_INIT;
+ AACDecContext *ac = avctx->priv_data;
+
+ ac->is_fixed = 1;
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
+
+ ac->dsp = aac_dsp_fixed;
+ ac->proc = aac_proc_fixed;
+
+ ac->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & AV_CODEC_FLAG_BITEXACT);
+ if (!ac->fdsp)
+ return AVERROR(ENOMEM);
+
+ ff_thread_once(&init_fixed_once, init_tables_fixed_fn);
+
+ return ff_aac_decode_init(avctx);
+}