diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-02-29 17:06:47 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-04-23 08:31:28 +0200 |
commit | 8b2261e573b9c5c06f8b3783b98bf18ac34527f4 (patch) | |
tree | 92a501daa067183e6ab0e529ebbbe77a414e6e01 | |
parent | 5bd7b8d9995bfec13172993457d6c59b45b5ec01 (diff) | |
download | ffmpeg-8b2261e573b9c5c06f8b3783b98bf18ac34527f4.tar.gz |
avcodec/aacdec: Always include AV(Fixed|Float)DSPContext in AACDecContext
Up until now, AACDecContext included pointers to one of these
contexts depending upon USE_FIXED. Yet deduplicating
the common parts of the float and fixed-point AAC decoders
needs common structures, so we put both of these pointers
in a union.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/aacdec.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/aacdec.h b/libavcodec/aacdec.h index e8d3297d17..e5165e9b54 100644 --- a/libavcodec/aacdec.h +++ b/libavcodec/aacdec.h @@ -67,6 +67,9 @@ enum CouplingPoint { AFTER_IMDCT = 3, }; +// Supposed to be equal to AAC_RENAME() in case of USE_FIXED. +#define RENAME_FIXED(name) name ## _fixed + /** * Long Term Prediction */ @@ -227,11 +230,10 @@ typedef struct AACDecContext { av_tx_fn mdct960_fn; av_tx_fn mdct1024_fn; av_tx_fn mdct_ltp_fn; -#if USE_FIXED - AVFixedDSPContext *fdsp; -#else - AVFloatDSPContext *fdsp; -#endif /* USE_FIXED */ + union { + AVFixedDSPContext *RENAME_FIXED(fdsp); + AVFloatDSPContext *fdsp; + }; int random_state; /** @} */ @@ -272,6 +274,10 @@ typedef struct AACDecContext { 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) +#endif + void ff_aacdec_init_mips(AACDecContext *c); #endif /* AVCODEC_AACDEC_H */ |