summaryrefslogtreecommitdiffstats
path: root/libavcodec/aaccoder.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-07-29 05:44:26 +0100
committerClaudio Freire <klaussfreire@gmail.com>2015-08-07 03:58:07 -0300
commitc47c781e83fd00914be244988381ace0b1b71628 (patch)
treea39d112539aef8fd8656cb65753660956f6f01bd /libavcodec/aaccoder.c
parent9c0407e8563f0eab49a25eae6b7a100287b9e635 (diff)
downloadffmpeg-streaming-c47c781e83fd00914be244988381ace0b1b71628.zip
ffmpeg-streaming-c47c781e83fd00914be244988381ace0b1b71628.tar.gz
aacenc: Move local encoder specific tables to a separate file
This commit moves any tables specific to the encoder from aacenc and aaccoder to a separate file called 'aacenctab.c/.h'. This was done as a clean up attempt as the encoder was filled with tables pasted in between functions which made it confusing to follow and track where each table and definition had been used. This commit solves this by simply exporting the smaller tables out to the aacenctab.h while the larger ones are compiled using aacenctab.c and are referenced from the header file. Signed-off-by: Claudio Freire <klaussfreire@gmail.com>
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r--libavcodec/aaccoder.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 0441971..d55b1a7 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -39,6 +39,7 @@
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"
+#include "aacenctab.h"
#include "aac_tablegen_decl.h"
/** Frequency in Hz for lower limit of noise substitution **/
@@ -56,37 +57,9 @@
/** Frequency in Hz for lower limit of intensity stereo **/
#define INT_STEREO_LOW_LIMIT 6100
-/** Total number of usable codebooks **/
-#define CB_TOT 12
-
-/** Total number of codebooks, including special ones **/
-#define CB_TOT_ALL 15
-
-/** bits needed to code codebook run value for long windows */
-static const uint8_t run_value_bits_long[64] = {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
-};
-
-/** bits needed to code codebook run value for short windows */
-static const uint8_t run_value_bits_short[16] = {
- 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
-};
-
-static const uint8_t * const run_value_bits[2] = {
- run_value_bits_long, run_value_bits_short
-};
-
#define ROUND_STANDARD 0.4054f
#define ROUND_TO_ZERO 0.1054f
-/** Map to convert values from BandCodingPath index to a codebook index **/
-static const uint8_t aac_cb_out_map[CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15};
-/** Inverse map to convert from codebooks to BandCodingPath indices **/
-static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14};
-
/**
* Quantize one coefficient.
* @return absolute value of the quantized coefficient
@@ -123,9 +96,6 @@ static void abs_pow34_v(float *out, const float *in, const int size)
#endif /* USE_REALLY_FULL_SEARCH */
}
-static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
-static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
-
/**
* Calculate rate distortion cost for quantizing with given codebook
*
OpenPOWER on IntegriCloud