X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Faacdectab.h;h=34b0abe729501121cb4344fc598f9c5be910abf0;hb=6752dd5aeeca9b6180d9fe0827fd438af426556e;hp=b7a9787a30d51317893037e8180ee664b6b9dd72;hpb=cc0591dab0a5508518413260c77750577c30b0d6;p=ffmpeg diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h index b7a9787a30d..34b0abe7295 100644 --- a/libavcodec/aacdectab.h +++ b/libavcodec/aacdectab.h @@ -21,14 +21,14 @@ */ /** - * @file aacdectab.h + * @file libavcodec/aacdectab.h * AAC decoder data * @author Oded Shimon ( ods15 ods15 dyndns org ) * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) */ -#ifndef FFMPEG_AACDECTAB_H -#define FFMPEG_AACDECTAB_H +#ifndef AVCODEC_AACDECTAB_H +#define AVCODEC_AACDECTAB_H #include "aac.h" @@ -142,7 +142,8 @@ static const uint16_t *swb_offset_1024[] = { swb_offset_1024_96, swb_offset_1024_96, swb_offset_1024_64, swb_offset_1024_48, swb_offset_1024_48, swb_offset_1024_32, swb_offset_1024_24, swb_offset_1024_24, swb_offset_1024_16, - swb_offset_1024_16, swb_offset_1024_16, swb_offset_1024_8 + swb_offset_1024_16, swb_offset_1024_16, swb_offset_1024_8, + swb_offset_1024_8 }; static const uint16_t *swb_offset_128[] = { @@ -151,9 +152,60 @@ static const uint16_t *swb_offset_128[] = { swb_offset_128_96, swb_offset_128_96, swb_offset_128_96, swb_offset_128_48, swb_offset_128_48, swb_offset_128_48, swb_offset_128_24, swb_offset_128_24, swb_offset_128_16, - swb_offset_128_16, swb_offset_128_16, swb_offset_128_8 + swb_offset_128_16, swb_offset_128_16, swb_offset_128_8, + swb_offset_128_8 }; // @} -#endif /* FFMPEG_AACDECTAB_H */ +/* @name tns_max_bands + * The maximum number of scalefactor bands on which TNS can operate for the long + * and short transforms respectively. The index to these tables is related to + * the sample rate of the audio. + * @{ + */ +static const uint8_t tns_max_bands_1024[] = { + 31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39 +}; + +static const uint8_t tns_max_bands_128[] = { + 9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 +}; +// @} + +/* @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 float tns_tmp2_map_1_3[4] = { + 0.00000000, -0.43388373, 0.64278758, 0.34202015, +}; + +static const float tns_tmp2_map_0_3[8] = { + 0.00000000, -0.43388373, -0.78183150, -0.97492790, + 0.98480773, 0.86602539, 0.64278758, 0.34202015, +}; + +static const float tns_tmp2_map_1_4[8] = { + 0.00000000, -0.20791170, -0.40673664, -0.58778524, + 0.67369562, 0.52643216, 0.36124167, 0.18374951, +}; + +static const float tns_tmp2_map_0_4[16] = { + 0.00000000, -0.20791170, -0.40673664, -0.58778524, + -0.74314481, -0.86602539, -0.95105654, -0.99452192, + 0.99573416, 0.96182561, 0.89516330, 0.79801720, + 0.67369562, 0.52643216, 0.36124167, 0.18374951, +}; + +static const float * const tns_tmp2_map[4] = { + tns_tmp2_map_0_3, + tns_tmp2_map_0_4, + tns_tmp2_map_1_3, + tns_tmp2_map_1_4 +}; +// @} + +#endif /* AVCODEC_AACDECTAB_H */