22 #ifndef AVCODEC_AACENC_H 23 #define AVCODEC_AACENC_H 25 #include "libavutil/float_dsp.h" 30 #include "audio_frame_queue.h" 35 typedef enum AACCoder {
60 int win,
int group_len,
const float lambda);
62 int scale_idx,
int cb,
const float lambda,
int rtz);
98 uint8_t config_map[16];
99 uint8_t reorder_map[16];
139 .layout = AV_CH_LAYOUT_MONO,
140 .num_ele = { 1, 0, 0, 0 },
141 .pairing = { { 0 }, },
143 .config_map = { 1, TYPE_SCE, },
144 .reorder_map = { 0 },
147 .layout = AV_CH_LAYOUT_STEREO,
148 .num_ele = { 1, 0, 0, 0 },
149 .pairing = { { 1 }, },
151 .config_map = { 1, TYPE_CPE, },
152 .reorder_map = { 0, 1 },
155 .layout = AV_CH_LAYOUT_2POINT1,
156 .num_ele = { 1, 0, 0, 1 },
157 .pairing = { { 1 }, },
158 .index = { { 0 },{ 0 },{ 0 },{ 0 } },
159 .config_map = { 2, TYPE_CPE, TYPE_LFE },
160 .reorder_map = { 0, 1, 2 },
163 .layout = AV_CH_LAYOUT_2_1,
164 .num_ele = { 1, 0, 1, 0 },
165 .pairing = { { 1 },{ 0 },{ 0 } },
166 .index = { { 0 },{ 0 },{ 0 }, },
167 .config_map = { 2, TYPE_CPE, TYPE_SCE },
168 .reorder_map = { 0, 1, 2 },
171 .layout = AV_CH_LAYOUT_SURROUND,
172 .num_ele = { 2, 0, 0, 0 },
173 .pairing = { { 1, 0 }, },
174 .index = { { 0, 0 }, },
175 .config_map = { 2, TYPE_CPE, TYPE_SCE, },
176 .reorder_map = { 0, 1, 2 },
179 .layout = AV_CH_LAYOUT_3POINT1,
180 .num_ele = { 2, 0, 0, 1 },
181 .pairing = { { 1, 0 }, },
182 .index = { { 0, 0 }, { 0 }, { 0 }, { 0 }, },
183 .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_LFE },
184 .reorder_map = { 0, 1, 2, 3 },
187 .layout = AV_CH_LAYOUT_4POINT0,
188 .num_ele = { 2, 0, 1, 0 },
189 .pairing = { { 1, 0 }, { 0 }, { 0 }, },
190 .index = { { 0, 0 }, { 0 }, { 1 } },
191 .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_SCE },
192 .reorder_map = { 0, 1, 2, 3 },
195 .layout = AV_CH_LAYOUT_4POINT1,
196 .num_ele = { 2, 1, 1, 0 },
197 .pairing = { { 1, 0 }, { 0 }, { 0 }, },
198 .index = { { 0, 0 }, { 1 }, { 2 }, { 0 } },
199 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_SCE },
200 .reorder_map = { 0, 1, 2, 3, 4 },
203 .layout = AV_CH_LAYOUT_2_2,
204 .num_ele = { 1, 1, 0, 0 },
205 .pairing = { { 1 }, { 1 }, },
206 .index = { { 0 }, { 1 }, },
207 .config_map = { 2, TYPE_CPE, TYPE_CPE },
208 .reorder_map = { 0, 1, 2, 3 },
211 .layout = AV_CH_LAYOUT_QUAD,
212 .num_ele = { 1, 0, 1, 0 },
213 .pairing = { { 1 }, { 0 }, { 1 }, },
214 .index = { { 0 }, { 0 }, { 1 } },
215 .config_map = { 2, TYPE_CPE, TYPE_CPE },
216 .reorder_map = { 0, 1, 2, 3 },
219 .layout = AV_CH_LAYOUT_5POINT0,
220 .num_ele = { 2, 1, 0, 0 },
221 .pairing = { { 1, 0 }, { 1 }, },
222 .index = { { 0, 0 }, { 1 } },
223 .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE },
224 .reorder_map = { 0, 1, 2, 3, 4 },
227 .layout = AV_CH_LAYOUT_5POINT1,
228 .num_ele = { 2, 1, 1, 0 },
229 .pairing = { { 1, 0 }, { 0 }, { 1 }, },
230 .index = { { 0, 0 }, { 1 }, { 1 } },
231 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE },
232 .reorder_map = { 0, 1, 2, 3, 4, 5 },
235 .layout = AV_CH_LAYOUT_5POINT0_BACK,
236 .num_ele = { 2, 0, 1, 0 },
237 .pairing = { { 1, 0 }, { 0 }, { 1 } },
238 .index = { { 0, 0 }, { 0 }, { 1 } },
239 .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE },
240 .reorder_map = { 0, 1, 2, 3, 4 },
243 .layout = AV_CH_LAYOUT_5POINT1_BACK,
244 .num_ele = { 2, 1, 1, 0 },
245 .pairing = { { 1, 0 }, { 0 }, { 1 }, },
246 .index = { { 0, 0 }, { 1 }, { 1 } },
247 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE },
248 .reorder_map = { 0, 1, 2, 3, 4, 5 },
251 .layout = AV_CH_LAYOUT_6POINT0,
252 .num_ele = { 2, 1, 1, 0 },
253 .pairing = { { 1, 0 }, { 1 }, { 0 }, },
254 .index = { { 0, 0 }, { 1 }, { 1 } },
255 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
256 .reorder_map = { 0, 1, 2, 3, 4, 5 },
259 .layout = AV_CH_LAYOUT_6POINT0_FRONT,
260 .num_ele = { 2, 1, 0, 0 },
261 .pairing = { { 1, 1 }, { 1 } },
262 .index = { { 1, 0 }, { 2 }, },
263 .config_map = { 3, TYPE_CPE, TYPE_CPE, TYPE_CPE, },
264 .reorder_map = { 0, 1, 2, 3, 4, 5 },
267 .layout = AV_CH_LAYOUT_HEXAGONAL,
268 .num_ele = { 2, 0, 2, 0 },
269 .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, },
270 .index = { { 0, 0 },{ 0 },{ 1, 1 } },
271 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, },
272 .reorder_map = { 0, 1, 2, 3, 4, 5 },
275 .layout = AV_CH_LAYOUT_6POINT1,
276 .num_ele = { 2, 1, 2, 0 },
277 .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, },
278 .index = { { 0, 0 },{ 1 },{ 1, 2 } },
279 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
280 .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
283 .layout = AV_CH_LAYOUT_6POINT1_BACK,
284 .num_ele = { 2, 1, 2, 0 },
285 .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, },
286 .index = { { 0, 0 }, { 1 }, { 1, 2 } },
287 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
288 .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
291 .layout = AV_CH_LAYOUT_6POINT1_FRONT,
292 .num_ele = { 2, 1, 2, 0 },
293 .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, },
294 .index = { { 0, 0 }, { 1 }, { 1, 2 } },
295 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
296 .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
299 .layout = AV_CH_LAYOUT_7POINT0,
300 .num_ele = { 2, 1, 1, 0 },
301 .pairing = { { 1, 0 }, { 1 }, { 1 }, },
302 .index = { { 0, 0 }, { 1 }, { 2 }, },
303 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
304 .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
307 .layout = AV_CH_LAYOUT_7POINT0_FRONT,
308 .num_ele = { 2, 1, 1, 0 },
309 .pairing = { { 1, 0 }, { 1 }, { 1 }, },
310 .index = { { 0, 0 }, { 1 }, { 2 }, },
311 .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
312 .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
315 .layout = AV_CH_LAYOUT_7POINT1,
316 .num_ele = { 2, 1, 2, 0 },
317 .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, },
318 .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
319 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
320 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
323 .layout = AV_CH_LAYOUT_7POINT1_WIDE,
324 .num_ele = { 2, 1, 2, 0 },
325 .pairing = { { 1, 0 }, { 0 },{ 1, 1 }, },
326 .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
327 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
328 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
331 .layout = AV_CH_LAYOUT_7POINT1_WIDE_BACK,
332 .num_ele = { 2, 1, 2, 0 },
333 .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, },
334 .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
335 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
336 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
339 .layout = AV_CH_LAYOUT_OCTAGONAL,
340 .num_ele = { 2, 1, 2, 0 },
341 .pairing = { { 1, 0 }, { 1 }, { 1, 0 }, },
342 .index = { { 0, 0 }, { 1 }, { 2, 1 } },
343 .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE },
344 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
347 .layout = AV_CH_LAYOUT_OCTAGONAL | AV_CH_TOP_CENTER,
348 .num_ele = { 2, 2, 2, 0 },
349 .pairing = { { 1, 0 }, { 1, 0 }, { 1, 0 }, },
350 .index = { { 0, 0 }, { 1, 1 }, { 2, 2 } },
351 .config_map = { 6, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
352 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
355 .layout = AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_BACK_CENTER |
356 AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_TOP_CENTER,
357 .num_ele = { 2, 2, 2, 0 },
358 .pairing = { { 1, 1 }, { 1, 0 }, { 1, 0 }, },
359 .index = { { 0, 1 }, { 2, 0 }, { 3, 1 } },
360 .config_map = { 6, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
361 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
364 .layout = AV_CH_LAYOUT_HEXADECAGONAL,
365 .num_ele = { 4, 2, 4, 0 },
366 .pairing = { { 1, 0, 1, 0 }, { 1, 1 }, { 1, 0, 1, 0 }, },
367 .index = { { 0, 0, 1, 1 }, { 2, 3 }, { 4, 2, 5, 3 } },
368 .config_map = { 10, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
369 .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
384 float *planar_samples[16];
404 enum RawDataBlockType cur_type;
410 uint16_t quantize_band_cost_cache_generation;
413 void (*abs_pow34)(
float *out,
const float *in,
const int size);
414 void (*quant_bands)(
int *out,
const float *in,
const float *scaled,
415 int size,
int is_signed,
int maxval,
const float Q34,
416 const float rounding);
425 void ff_quantize_band_cost_cache_init(
struct AACEncContext *s);
Definition: put_bits.h:35
int lambda_count
count(lambda), for Qvg reporting
Definition: aacenc.h:403
Definition: psymodel.c:93
AACEncOptions options
encoding options
Definition: aacenc.h:378
AAC encoder context.
Definition: aacenc.h:376
LPCContext lpc
used by TNS
Definition: aacenc.h:388
int samplerate_index
MPEG-4 samplerate index.
Definition: aacenc.h:389
const uint8_t * chan_map
channel configuration map
Definition: aacenc.h:392
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:120
context used by psychoacoustic model
Definition: psymodel.h:89
int profile
copied from avctx
Definition: aacenc.h:386
const uint8_t * reorder_map
lavc to aac reorder map
Definition: aacenc.h:391
int cur_channel
current channel for coder context
Definition: aacenc.h:398
int last_frame_pb_count
number of bits for the previous frame
Definition: aacenc.h:401
int channels
channel count
Definition: aacenc.h:390
FFTContext mdct128
short (128 samples) frame transform context
Definition: aacenc.h:381
Definition: float_dsp.h:24
Definition: audio_frame_queue.h:32
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:1518
float lambda_sum
sum(lambda), for Qvg reporting
Definition: aacenc.h:402
Describe the class of an AVClass context structure.
Definition: log.h:67
int needs_pce
flag for non-standard layout
Definition: aacenc.h:387
AACPCEInfo pce
PCE data, if needed.
Definition: aacenc.h:383
Single Channel Element - used for both SCE and LFE elements.
Definition: aac.h:248
ChannelElement * cpe
channel elements
Definition: aacenc.h:394
channel element - generic struct for SCE/CPE/CCE/LFE
Definition: aac.h:275
FFTContext mdct1024
long (1024 samples) frame transform context
Definition: aacenc.h:380