Mercurial > libavcodec.hg
comparison aac.h @ 9935:d09283aeeef8 libavcodec
Merge the AAC encoder from SoC svn. It is still considered experimental.
author | alexc |
---|---|
date | Wed, 08 Jul 2009 20:01:31 +0000 |
parents | 63325f71bd79 |
children | 98fd723f72e7 |
comparison
equal
deleted
inserted
replaced
9934:ff96ee73b08b | 9935:d09283aeeef8 |
---|---|
114 float r1; | 114 float r1; |
115 } PredictorState; | 115 } PredictorState; |
116 | 116 |
117 #define MAX_PREDICTORS 672 | 117 #define MAX_PREDICTORS 672 |
118 | 118 |
119 #define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times | |
120 #define SCALE_ONE_POS 140 ///< scalefactor index that corresponds to scale=1.0 | |
121 #define SCALE_MAX_POS 255 ///< scalefactor index maximum value | |
122 #define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard | |
123 #define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference | |
124 | |
119 /** | 125 /** |
120 * Individual Channel Stream | 126 * Individual Channel Stream |
121 */ | 127 */ |
122 typedef struct { | 128 typedef struct { |
123 uint8_t max_sfb; ///< number of scalefactor bands per group | 129 uint8_t max_sfb; ///< number of scalefactor bands per group |
124 enum WindowSequence window_sequence[2]; | 130 enum WindowSequence window_sequence[2]; |
125 uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sinus window. | 131 uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sinus window. |
126 int num_window_groups; | 132 int num_window_groups; |
127 uint8_t group_len[8]; | 133 uint8_t group_len[8]; |
128 const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window | 134 const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window |
135 const uint8_t *swb_sizes; ///< table of scalefactor band sizes for a particular window | |
129 int num_swb; ///< number of scalefactor window bands | 136 int num_swb; ///< number of scalefactor window bands |
130 int num_windows; | 137 int num_windows; |
131 int tns_max_bands; | 138 int tns_max_bands; |
132 int predictor_present; | 139 int predictor_present; |
133 int predictor_initialized; | 140 int predictor_initialized; |
163 */ | 170 */ |
164 } DynamicRangeControl; | 171 } DynamicRangeControl; |
165 | 172 |
166 typedef struct { | 173 typedef struct { |
167 int num_pulse; | 174 int num_pulse; |
175 int start; | |
168 int pos[4]; | 176 int pos[4]; |
169 int amp[4]; | 177 int amp[4]; |
170 } Pulse; | 178 } Pulse; |
171 | 179 |
172 /** | 180 /** |
187 * Single Channel Element - used for both SCE and LFE elements. | 195 * Single Channel Element - used for both SCE and LFE elements. |
188 */ | 196 */ |
189 typedef struct { | 197 typedef struct { |
190 IndividualChannelStream ics; | 198 IndividualChannelStream ics; |
191 TemporalNoiseShaping tns; | 199 TemporalNoiseShaping tns; |
192 enum BandType band_type[120]; ///< band types | 200 Pulse pulse; |
201 enum BandType band_type[128]; ///< band types | |
193 int band_type_run_end[120]; ///< band type run end points | 202 int band_type_run_end[120]; ///< band type run end points |
194 float sf[120]; ///< scalefactors | 203 float sf[120]; ///< scalefactors |
204 int sf_idx[128]; ///< scalefactor indices (used by encoder) | |
205 uint8_t zeroes[128]; ///< band is not coded (used by encoder) | |
195 DECLARE_ALIGNED_16(float, coeffs[1024]); ///< coefficients for IMDCT | 206 DECLARE_ALIGNED_16(float, coeffs[1024]); ///< coefficients for IMDCT |
196 DECLARE_ALIGNED_16(float, saved[512]); ///< overlap | 207 DECLARE_ALIGNED_16(float, saved[1024]); ///< overlap |
197 DECLARE_ALIGNED_16(float, ret[1024]); ///< PCM output | 208 DECLARE_ALIGNED_16(float, ret[1024]); ///< PCM output |
198 PredictorState predictor_state[MAX_PREDICTORS]; | 209 PredictorState predictor_state[MAX_PREDICTORS]; |
199 } SingleChannelElement; | 210 } SingleChannelElement; |
200 | 211 |
201 /** | 212 /** |
202 * channel element - generic struct for SCE/CPE/CCE/LFE | 213 * channel element - generic struct for SCE/CPE/CCE/LFE |
203 */ | 214 */ |
204 typedef struct { | 215 typedef struct { |
205 // CPE specific | 216 // CPE specific |
206 uint8_t ms_mask[120]; ///< Set if mid/side stereo is used for each scalefactor window band | 217 int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream. |
218 int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder) | |
219 uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band | |
207 // shared | 220 // shared |
208 SingleChannelElement ch[2]; | 221 SingleChannelElement ch[2]; |
209 // CCE specific | 222 // CCE specific |
210 ChannelCoupling coup; | 223 ChannelCoupling coup; |
211 } ChannelElement; | 224 } ChannelElement; |