diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-02-29 21:51:59 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-04 02:11:53 +0100 |
commit | 4ed0fea0fa6189a69f549f4c40a6b51c155ef584 (patch) | |
tree | e64d1cad8bbf347016c49141004ded31827874c7 /libavcodec/aacdec_fixed.c | |
parent | b9dea251d5ef29c44e9216dd23930d3695a34919 (diff) | |
download | ffmpeg-4ed0fea0fa6189a69f549f4c40a6b51c155ef584.tar.gz |
avcodec/aactab: Deduplicate ltp_coef and tns_tmp2_map tables
This will allow to make aac_defines.h decoder-only.
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/aacdec_fixed.c')
-rw-r--r-- | libavcodec/aacdec_fixed.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 2abe6acb6b..5d5ae34838 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -89,6 +89,49 @@ DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_128))[128]; DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_960))[960]; DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_120))[120]; +/* @name ltp_coef + * Table of the LTP coefficients + */ +static const int ltp_coef_fixed[8] = { + Q30(0.570829), Q30(0.696616), Q30(0.813004), Q30(0.911304), + Q30(0.984900), Q30(1.067894), Q30(1.194601), Q30(1.369533), +}; + +/* @name tns_tmp2_map + * Tables of the tmp2[] arrays of LPC coefficients used for TNS. + * The suffix _M_N[] indicate the values of coef_compress and coef_res + * respectively. + * @{ + */ +static const int tns_tmp2_map_1_3[4] = { + Q31(0.00000000), Q31(-0.43388373), Q31(0.64278758), Q31(0.34202015), +}; + +static const int tns_tmp2_map_0_3[8] = { + Q31(0.00000000), Q31(-0.43388373), Q31(-0.78183150), Q31(-0.97492790), + Q31(0.98480773), Q31( 0.86602539), Q31( 0.64278758), Q31( 0.34202015), +}; + +static const int tns_tmp2_map_1_4[8] = { + Q31(0.00000000), Q31(-0.20791170), Q31(-0.40673664), Q31(-0.58778524), + Q31(0.67369562), Q31( 0.52643216), Q31( 0.36124167), Q31( 0.18374951), +}; + +static const int tns_tmp2_map_0_4[16] = { + Q31( 0.00000000), Q31(-0.20791170), Q31(-0.40673664), Q31(-0.58778524), + Q31(-0.74314481), Q31(-0.86602539), Q31(-0.95105654), Q31(-0.99452192), + Q31( 0.99573416), Q31( 0.96182561), Q31( 0.89516330), Q31( 0.79801720), + Q31( 0.67369562), Q31( 0.52643216), Q31( 0.36124167), Q31( 0.18374951), +}; + +static const int * const tns_tmp2_map_fixed[4] = { + tns_tmp2_map_0_3, + tns_tmp2_map_0_4, + tns_tmp2_map_1_3, + tns_tmp2_map_1_4 +}; +// @} + static av_always_inline void reset_predict_state(PredictorState *ps) { ps->r0.mant = 0; |