Commit a617dd7f authored by superdump's avatar superdump

More OKed hunks of the AAC decoder from SoC


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14694 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 16c58ee1
This diff is collapsed.
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
size); size);
#define MAX_CHANNELS 64 #define MAX_CHANNELS 64
#define MAX_ELEM_ID 16
#define IVQUANT_SIZE 1024 #define IVQUANT_SIZE 1024
...@@ -76,6 +77,17 @@ enum AudioObjectType { ...@@ -76,6 +77,17 @@ enum AudioObjectType {
AOT_SSC, ///< N SinuSoidal Coding AOT_SSC, ///< N SinuSoidal Coding
}; };
enum RawDataBlockType {
TYPE_SCE,
TYPE_CPE,
TYPE_CCE,
TYPE_LFE,
TYPE_DSE,
TYPE_PCE,
TYPE_FIL,
TYPE_END,
};
enum ExtensionPayloadID { enum ExtensionPayloadID {
EXT_FILL, EXT_FILL,
EXT_FILL_DATA, EXT_FILL_DATA,
...@@ -111,6 +123,35 @@ enum ChannelPosition { ...@@ -111,6 +123,35 @@ enum ChannelPosition {
AAC_CHANNEL_CC = 5, AAC_CHANNEL_CC = 5,
}; };
/**
* The point during decoding at which channel coupling is applied.
*/
enum CouplingPoint {
BEFORE_TNS,
BETWEEN_TNS_AND_IMDCT,
AFTER_IMDCT = 3,
};
/**
* Individual Channel Stream
*/
/**
* Dynamic Range Control - decoded from the bitstream but not processed further.
*/
typedef struct {
int pce_instance_tag; ///< Indicates with which program the DRC info is associated.
int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative
int dyn_rng_ctl[17]; ///< DRC magnitude information
int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing.
int band_incr; ///< Number of DRC bands greater than 1 having DRC info.
int interpolation_scheme; ///< Indicates the interpolation scheme used in the SBR QMF domain.
int band_top[17]; ///< Indicates the top of the i-th DRC band in units of 4 spectral lines.
int prog_ref_level; /**< A reference level for the long-term program audio level for all
* channels combined.
*/
} DynamicRangeControl;
typedef struct { typedef struct {
int num_pulse; int num_pulse;
int start; int start;
...@@ -134,9 +175,15 @@ typedef struct { ...@@ -134,9 +175,15 @@ typedef struct {
int is_saved; ///< Set if elements have stored overlap from previous frame. int is_saved; ///< Set if elements have stored overlap from previous frame.
DynamicRangeControl che_drc; DynamicRangeControl che_drc;
/**
* @defgroup elements
* @{
*/
enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel mapping with the enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel mapping with the
* first index as the first 4 raw data block types * first index as the first 4 raw data block types
*/ */
ChannelElement * che[4][MAX_ELEM_ID];
/** @} */
/** /**
* @defgroup tables Computed / set up during initialization. * @defgroup tables Computed / set up during initialization.
...@@ -145,6 +192,7 @@ typedef struct { ...@@ -145,6 +192,7 @@ typedef struct {
MDCTContext mdct; MDCTContext mdct;
MDCTContext mdct_small; MDCTContext mdct_small;
DSPContext dsp; DSPContext dsp;
int random_state;
/** @} */ /** @} */
/** /**
......
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
#include <stdint.h> #include <stdint.h>
const uint8_t ff_aac_num_swb_1024[] = {
41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40
};
const uint8_t ff_aac_num_swb_128[] = {
12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15
};
const uint32_t ff_aac_scalefactor_code[121] = { const uint32_t ff_aac_scalefactor_code[121] = {
0x3ffe8, 0x3ffe6, 0x3ffe7, 0x3ffe5, 0x7fff5, 0x7fff1, 0x7ffed, 0x7fff6, 0x3ffe8, 0x3ffe6, 0x3ffe7, 0x3ffe5, 0x7fff5, 0x7fff1, 0x7ffed, 0x7fff6,
0x7ffee, 0x7ffef, 0x7fff0, 0x7fffc, 0x7fffd, 0x7ffff, 0x7fffe, 0x7fff7, 0x7ffee, 0x7ffef, 0x7fff0, 0x7fffc, 0x7fffd, 0x7ffff, 0x7fffe, 0x7fff7,
...@@ -796,6 +804,13 @@ const float ff_aac_ivquant_tab[IVQUANT_SIZE] = { ...@@ -796,6 +804,13 @@ const float ff_aac_ivquant_tab[IVQUANT_SIZE] = {
4064.0312908, 4074.6805676, 4085.3368071, 4096.0000000, 4064.0312908, 4074.6805676, 4085.3368071, 4096.0000000,
}; };
/**
* Table of pow(2, (i - 200)/4.) used for different purposes depending on the
* range of indices to the table:
* [ 0, 255] scale factor decoding when using C dsp.float_to_int16
* [60, 315] scale factor decoding when using SIMD dsp.float_to_int16
* [45, 300] intensity stereo position decoding mapped in reverse order i.e. 0->300, 1->299, ..., 254->46, 255->45
*/
const float ff_aac_pow2sf_tab[316] = { const float ff_aac_pow2sf_tab[316] = {
8.88178420e-16, 1.05622810e-15, 1.25607397e-15, 1.49373210e-15, 8.88178420e-16, 1.05622810e-15, 1.25607397e-15, 1.49373210e-15,
1.77635684e-15, 2.11245619e-15, 2.51214793e-15, 2.98746420e-15, 1.77635684e-15, 2.11245619e-15, 2.51214793e-15, 2.98746420e-15,
......
...@@ -35,6 +35,18 @@ ...@@ -35,6 +35,18 @@
#include <stdint.h> #include <stdint.h>
/* NOTE:
* Tables in this file are used by the AAC decoder and will be used by the AAC
* encoder.
*/
/* @name number of scalefactor window bands for long and short transform windows respectively
* @{
*/
extern const uint8_t ff_aac_num_swb_1024[];
extern const uint8_t ff_aac_num_swb_128 [];
// @}
extern const uint32_t ff_aac_scalefactor_code[121]; extern const uint32_t ff_aac_scalefactor_code[121];
extern const uint8_t ff_aac_scalefactor_bits[121]; extern const uint8_t ff_aac_scalefactor_bits[121];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment