[FFmpeg-cvslog] aacdec: add a decoder DSP structure

Lynne git at videolan.org
Tue Apr 23 09:58:19 EEST 2024


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Wed Mar 13 06:35:38 2024 +0100| [ed009bfd3d2d8c37395373201afc58bb32cf1366] | committer: Lynne

aacdec: add a decoder DSP structure

To be used to abstract away DSP functions.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed009bfd3d2d8c37395373201afc58bb32cf1366
---

 libavcodec/aacdec.h | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacdec.h b/libavcodec/aacdec.h
index e55fea6e40..052ed59e01 100644
--- a/libavcodec/aacdec.h
+++ b/libavcodec/aacdec.h
@@ -41,6 +41,8 @@
 #include "aac.h"
 #include "mpeg4audio.h"
 
+typedef struct AACDecContext AACDecContext;
+
 /**
  * Output configuration status
  */
@@ -197,12 +199,37 @@ typedef struct DynamicRangeControl {
                                                      */
 } DynamicRangeControl;
 
+/**
+ * DSP-specific primitives
+ */
+typedef struct AACDecDSP {
+    void (*dequant_scalefactors)(SingleChannelElement *sce);
+
+    void (*apply_mid_side_stereo)(AACDecContext *ac, ChannelElement *cpe);
+    void (*apply_intensity_stereo)(AACDecContext *ac, ChannelElement *cpe,
+                                   int ms_present);
+
+    void (*apply_tns)(void *_coef_param, TemporalNoiseShaping *tns,
+                      IndividualChannelStream *ics, int decode);
+
+    void (*apply_ltp)(AACDecContext *ac, SingleChannelElement *sce);
+    void (*update_ltp)(AACDecContext *ac, SingleChannelElement *sce);
+
+    void (*imdct_and_windowing)(AACDecContext *ac, SingleChannelElement *sce);
+    void (*imdct_and_windowing_960)(AACDecContext *ac, SingleChannelElement *sce);
+    void (*imdct_and_windowing_ld)(AACDecContext *ac, SingleChannelElement *sce);
+    void (*imdct_and_windowing_eld)(AACDecContext *ac, SingleChannelElement *sce);
+} AACDecDSP;
+
 /**
  * main AAC decoding context
  */
-typedef struct AACDecContext {
+struct AACDecContext {
     const struct AVClass  *class;
     struct AVCodecContext *avctx;
+
+    AACDecDSP dsp;
+
     struct AVFrame *frame;
 
     int is_saved;                 ///< Set if elements have stored overlap from previous frame.
@@ -298,7 +325,7 @@ typedef struct AACDecContext {
     void (*update_ltp)(struct AACDecContext *ac, SingleChannelElement *sce);
     void (*vector_pow43)(int *coefs, int len);
     void (*subband_scale)(int *dst, int *src, int scale, int offset, int len, void *log_context);
-} AACDecContext;
+};
 
 #if defined(USE_FIXED) && USE_FIXED
 #define fdsp          RENAME_FIXED(fdsp)



More information about the ffmpeg-cvslog mailing list