120 enum OCStatus oc_type,
int get_new_frame);
122 #define overread_err "Input buffer exhausted before END element found\n"
127 for (i = 0; i < tags; i++) {
128 int syn_ele =
layout[i][0];
130 sum += (1 + (syn_ele ==
TYPE_CPE)) *
150 int type,
int id,
int *channels)
155 if (!ac->
che[type][
id]) {
172 if (ac->
che[type][
id])
185 for (type = 0; type < 4; type++) {
205 for (ch = 0; ch < avctx->
channels; ch++) {
222 uint64_t right,
int pos)
224 if (layout_map[offset][0] ==
TYPE_CPE) {
226 .av_position = left | right,
228 .elem_id = layout_map[
offset][1],
236 .elem_id = layout_map[
offset][1],
240 .av_position = right,
242 .elem_id = layout_map[offset + 1][1],
252 int num_pos_channels = 0;
256 for (i = *current; i < tags; i++) {
257 if (layout_map[i][2] != pos)
267 num_pos_channels += 2;
278 return num_pos_channels;
283 int i,
n, total_non_cc_elements;
285 int num_front_channels, num_side_channels, num_back_channels;
294 if (num_front_channels < 0)
298 if (num_side_channels < 0)
302 if (num_back_channels < 0)
306 if (num_front_channels & 1) {
310 .elem_id = layout_map[i][1],
314 num_front_channels--;
316 if (num_front_channels >= 4) {
321 num_front_channels -= 2;
323 if (num_front_channels >= 2) {
328 num_front_channels -= 2;
330 while (num_front_channels >= 2) {
335 num_front_channels -= 2;
338 if (num_side_channels >= 2) {
343 num_side_channels -= 2;
345 while (num_side_channels >= 2) {
350 num_side_channels -= 2;
353 while (num_back_channels >= 4) {
358 num_back_channels -= 2;
360 if (num_back_channels >= 2) {
365 num_back_channels -= 2;
367 if (num_back_channels) {
371 .elem_id = layout_map[i][1],
382 .elem_id = layout_map[i][1],
391 .elem_id = layout_map[i][1],
398 total_non_cc_elements = n = i;
401 for (i = 1; i <
n; i++)
402 if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
410 for (i = 0; i < total_non_cc_elements; i++) {
411 layout_map[i][0] = e2c_vec[i].
syn_ele;
412 layout_map[i][1] = e2c_vec[i].
elem_id;
414 if (e2c_vec[i].av_position != UINT64_MAX) {
427 ac->
oc[0] = ac->
oc[1];
438 ac->
oc[1] = ac->
oc[0];
453 uint8_t layout_map[MAX_ELEM_ID * 4][3],
int tags,
454 enum OCStatus oc_type,
int get_new_frame)
457 int i, channels = 0,
ret;
461 memcpy(ac->
oc[1].
layout_map, layout_map, tags *
sizeof(layout_map[0]));
469 for (i = 0; i < tags; i++) {
470 int type = layout_map[i][0];
471 int id = layout_map[i][1];
472 int position = layout_map[i][2];
479 if (ac->
oc[1].
m4ac.
ps == 1 && channels == 2) {
506 for (type = 3; type >= 0; type--) {
510 for (j = 0; j <= 1; j++) {
529 if (channel_config < 1 || channel_config > 7) {
531 "invalid default channel configuration (%d)\n",
537 *tags *
sizeof(*layout_map));
551 uint8_t layout_map[MAX_ELEM_ID*4][3];
558 &layout_map_tags, 2) < 0)
570 uint8_t layout_map[MAX_ELEM_ID * 4][3];
577 &layout_map_tags, 1) < 0)
665 layout_map[0][0] = syn_ele;
667 layout_map[0][2] = type;
681 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
691 "Sample rate index in program config element does not "
692 "match the sample rate index configured by the container.\n");
709 if (
get_bits_left(gb) < 4 * (num_front + num_side + num_back + num_lfe + num_assoc_data + num_cc)) {
752 int extension_flag,
ret, ep_config, res_flags;
753 uint8_t layout_map[MAX_ELEM_ID*4][3];
769 if (channel_config == 0) {
771 tags =
decode_pce(avctx, m4ac, layout_map, gb);
776 &tags, channel_config)))
782 }
else if (m4ac->
sbr == 1 && m4ac->
ps == -1)
788 if (extension_flag) {
801 "AAC data resilience (flags %x)",
817 "epConfig %d", ep_config);
829 int ret, ep_config, res_flags;
830 uint8_t layout_map[MAX_ELEM_ID*4][3];
832 const int ELDEXT_TERM = 0;
845 "AAC data resilience (flags %x)",
856 while (
get_bits(gb, 4) != ELDEXT_TERM) {
870 &tags, channel_config)))
879 "epConfig %d", ep_config);
906 av_dlog(avctx,
"audio specific config size %d\n", bit_size >> 3);
907 for (i = 0; i < bit_size >> 3; i++)
908 av_dlog(avctx,
"%02x ", data[i]);
915 sync_extension)) < 0)
919 "invalid sampling rate index %d\n",
926 "invalid low delay sampling rate index %d\n",
950 "Audio object type %s%d",
951 m4ac->
sbr == 1 ?
"SBR+" :
"",
957 "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
974 union {
unsigned u;
int s; }
v = { previous_val * 1664525
u + 1013904223 };
997 if (92017 <= rate)
return 0;
998 else if (75132 <= rate)
return 1;
999 else if (55426 <= rate)
return 2;
1000 else if (46009 <= rate)
return 3;
1001 else if (37566 <= rate)
return 4;
1002 else if (27713 <= rate)
return 5;
1003 else if (23004 <= rate)
return 6;
1004 else if (18783 <= rate)
return 7;
1005 else if (13856 <= rate)
return 8;
1006 else if (11502 <= rate)
return 9;
1007 else if (9391 <= rate)
return 10;
1018 #define AAC_INIT_VLC_STATIC(num, size) \
1019 INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
1020 ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]), \
1021 sizeof(ff_aac_spectral_bits[num][0]), \
1022 ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \
1023 sizeof(ff_aac_spectral_codes[num][0]), \
1048 uint8_t layout_map[MAX_ELEM_ID*4][3];
1049 int layout_map_tags;
1158 "Invalid Predictor Reset Group.\n");
1199 "AAC LD is only defined for ONLY_LONG_SEQUENCE but "
1212 for (i = 0; i < 7; i++) {
1250 "Prediction is not allowed in AAC-LC.\n");
1255 "LTP in ER AAC LD not yet implemented.\n");
1266 "Number of scalefactor bands in group (%d) "
1267 "exceeds limit (%d).\n",
1294 while (k < ics->max_sfb) {
1297 int sect_band_type =
get_bits(gb, 4);
1298 if (sect_band_type == 12) {
1303 sect_len_incr =
get_bits(gb, bits);
1304 sect_end += sect_len_incr;
1309 if (sect_end > ics->
max_sfb) {
1311 "Number of bands (%d) exceeds limit (%d).\n",
1315 }
while (sect_len_incr == (1 << bits) - 1);
1316 for (; k < sect_end; k++) {
1317 band_type [idx] = sect_band_type;
1318 band_type_run_end[idx++] = sect_end;
1336 unsigned int global_gain,
1339 int band_type_run_end[120])
1342 int offset[3] = { global_gain, global_gain - 90, 0 };
1346 for (i = 0; i < ics->
max_sfb;) {
1347 int run_end = band_type_run_end[idx];
1348 if (band_type[idx] ==
ZERO_BT) {
1349 for (; i < run_end; i++, idx++)
1353 for (; i < run_end; i++, idx++) {
1354 offset[2] +=
get_vlc2(gb, vlc_scalefactors.
table, 7, 3) - 60;
1355 clipped_offset = av_clip(offset[2], -155, 100);
1356 if (offset[2] != clipped_offset) {
1358 "If you heard an audible artifact, there may be a bug in the decoder. "
1359 "Clipped intensity stereo position (%d -> %d)",
1360 offset[2], clipped_offset);
1364 }
else if (band_type[idx] ==
NOISE_BT) {
1365 for (; i < run_end; i++, idx++) {
1366 if (noise_flag-- > 0)
1367 offset[1] +=
get_bits(gb, 9) - 256;
1369 offset[1] +=
get_vlc2(gb, vlc_scalefactors.
table, 7, 3) - 60;
1370 clipped_offset = av_clip(offset[1], -100, 155);
1371 if (offset[1] != clipped_offset) {
1373 "If you heard an audible artifact, there may be a bug in the decoder. "
1374 "Clipped noise gain (%d -> %d)",
1375 offset[1], clipped_offset);
1380 for (; i < run_end; i++, idx++) {
1381 offset[0] +=
get_vlc2(gb, vlc_scalefactors.
table, 7, 3) - 60;
1382 if (offset[0] > 255
U) {
1384 "Scalefactor (%d) out of range.\n", offset[0]);
1399 const uint16_t *swb_offset,
int num_swb)
1404 if (pulse_swb >= num_swb)
1406 pulse->
pos[0] = swb_offset[pulse_swb];
1408 if (pulse->
pos[0] > 1023)
1411 for (i = 1; i < pulse->
num_pulse; i++) {
1413 if (pulse->
pos[i] > 1023)
1428 int w,
filt, i, coef_len, coef_res, coef_compress;
1435 for (filt = 0; filt < tns->
n_filt[w]; filt++) {
1439 if ((tns->
order[w][filt] =
get_bits(gb, 5 - 2 * is8)) > tns_max_order) {
1441 "TNS filter order %d is greater than maximum %d.\n",
1442 tns->
order[w][filt], tns_max_order);
1446 if (tns->
order[w][filt]) {
1449 coef_len = coef_res + 3 - coef_compress;
1450 tmp2_idx = 2 * coef_compress + coef_res;
1452 for (i = 0; i < tns->
order[w][
filt]; i++)
1472 if (ms_present == 1) {
1477 }
else if (ms_present == 2) {
1483 static inline float *
VMUL2(
float *dst,
const float *
v,
unsigned idx,
1487 *dst++ = v[idx & 15] *
s;
1488 *dst++ = v[idx>>4 & 15] *
s;
1494 static inline float *
VMUL4(
float *dst,
const float *
v,
unsigned idx,
1498 *dst++ = v[idx & 3] *
s;
1499 *dst++ = v[idx>>2 & 3] *
s;
1500 *dst++ = v[idx>>4 & 3] *
s;
1501 *dst++ = v[idx>>6 & 3] *
s;
1507 static inline float *
VMUL2S(
float *dst,
const float *
v,
unsigned idx,
1508 unsigned sign,
const float *
scale)
1513 s0.
i ^= sign >> 1 << 31;
1516 *dst++ = v[idx & 15] * s0.
f;
1517 *dst++ = v[idx>>4 & 15] * s1.
f;
1524 static inline float *
VMUL4S(
float *dst,
const float *
v,
unsigned idx,
1525 unsigned sign,
const float *
scale)
1527 unsigned nz = idx >> 12;
1531 t.
i = s.
i ^ (sign & 1
U<<31);
1532 *dst++ = v[idx & 3] * t.
f;
1534 sign <<= nz & 1; nz >>= 1;
1535 t.
i = s.
i ^ (sign & 1
U<<31);
1536 *dst++ = v[idx>>2 & 3] * t.
f;
1538 sign <<= nz & 1; nz >>= 1;
1539 t.
i = s.
i ^ (sign & 1
U<<31);
1540 *dst++ = v[idx>>4 & 3] * t.
f;
1543 t.
i = s.
i ^ (sign & 1
U<<31);
1544 *dst++ = v[idx>>6 & 3] * t.
f;
1564 int pulse_present,
const Pulse *pulse,
1568 int i, k,
g, idx = 0;
1571 float *coef_base = coef;
1574 memset(coef + g * 128 + offsets[ics->
max_sfb], 0,
1575 sizeof(
float) * (c - offsets[ics->
max_sfb]));
1580 for (i = 0; i < ics->
max_sfb; i++, idx++) {
1581 const unsigned cbt_m1 = band_type[idx] - 1;
1582 float *cfo = coef + offsets[
i];
1583 int off_len = offsets[i + 1] - offsets[
i];
1587 for (group = 0; group < g_len; group++, cfo+=128) {
1588 memset(cfo, 0, off_len *
sizeof(
float));
1590 }
else if (cbt_m1 ==
NOISE_BT - 1) {
1591 for (group = 0; group < g_len; group++, cfo+=128) {
1595 for (k = 0; k < off_len; k++) {
1601 scale = sf[idx] / sqrtf(band_energy);
1610 switch (cbt_m1 >> 1) {
1612 for (group = 0; group < g_len; group++, cfo+=128) {
1622 cb_idx = cb_vector_idx[code];
1623 cf =
VMUL4(cf, vq, cb_idx, sf + idx);
1629 for (group = 0; group < g_len; group++, cfo+=128) {
1641 cb_idx = cb_vector_idx[code];
1642 nnz = cb_idx >> 8 & 15;
1645 cf =
VMUL4S(cf, vq, cb_idx, bits, sf + idx);
1651 for (group = 0; group < g_len; group++, cfo+=128) {
1661 cb_idx = cb_vector_idx[code];
1662 cf =
VMUL2(cf, vq, cb_idx, sf + idx);
1669 for (group = 0; group < g_len; group++, cfo+=128) {
1681 cb_idx = cb_vector_idx[code];
1682 nnz = cb_idx >> 8 & 15;
1683 sign = nnz ?
SHOW_UBITS(
re, gb, nnz) << (cb_idx >> 12) : 0;
1685 cf =
VMUL2S(cf, vq, cb_idx, sign, sf + idx);
1691 for (group = 0; group < g_len; group++, cfo+=128) {
1693 uint32_t *icf = (uint32_t *) cf;
1712 cb_idx = cb_vector_idx[code];
1718 for (j = 0; j < 2; j++) {
1740 unsigned v = ((
const uint32_t*)vq)[cb_idx & 15];
1741 *icf++ = (bits & 1
U<<31) | v;
1758 if (pulse_present) {
1760 for (i = 0; i < pulse->
num_pulse; i++) {
1761 float co = coef_base[ pulse->
pos[
i] ];
1762 while (offsets[idx + 1] <= pulse->
pos[i])
1764 if (band_type[idx] !=
NOISE_BT && sf[idx]) {
1765 float ico = -pulse->
amp[
i];
1768 ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
1770 coef_base[ pulse->
pos[
i] ] =
cbrtf(fabsf(ico)) * ico * sf[idx];
1781 tmp.
i = (tmp.
i + 0x00008000
U) & 0xFFFF0000U;
1789 tmp.
i = (tmp.
i + 0x00007FFF
U + (tmp.
i & 0x00010000
U >> 16)) & 0xFFFF0000
U;
1797 pun.
i &= 0xFFFF0000
U;
1804 const float a = 0.953125;
1805 const float alpha = 0.90625;
1809 float r0 = ps->
r0, r1 = ps->
r1;
1810 float cor0 = ps->
cor0, cor1 = ps->
cor1;
1811 float var0 = ps->
var0, var1 = ps->
var1;
1813 k1 = var0 > 1 ? cor0 *
flt16_even(a / var0) : 0;
1814 k2 = var1 > 1 ? cor1 *
flt16_even(a / var1) : 0;
1849 k < sce->ics.swb_offset[sfb + 1];
1878 int global_gain, eld_syntax, er_syntax, pulse_present = 0;
1894 if (!common_window && !scale_flag) {
1908 if (!eld_syntax && (pulse_present =
get_bits1(gb))) {
1911 "Pulse tool not allowed in eight short sequence.\n");
1916 "Pulse data corrupt or invalid.\n");
1921 if (tns->
present && !er_syntax)
1930 if (tns->
present && er_syntax)
1953 int g,
i, group, idx = 0;
1956 for (i = 0; i < ics->
max_sfb; i++, idx++) {
1960 for (group = 0; group < ics->
group_len[
g]; group++) {
1962 ch1 + group * 128 + offsets[i],
1963 offsets[i+1] - offsets[i]);
1986 int g, group,
i, idx = 0;
1990 for (i = 0; i < ics->
max_sfb;) {
1994 for (; i < bt_run_end; i++, idx++) {
1995 c = -1 + 2 * (sce1->
band_type[idx] - 14);
1997 c *= 1 - 2 * cpe->
ms_mask[idx];
1998 scale = c * sce1->
sf[idx];
1999 for (group = 0; group < ics->
group_len[
g]; group++)
2001 coef0 + group * 128 + offsets[i],
2003 offsets[i + 1] - offsets[i]);
2007 idx += bt_run_end -
i;
2023 int i,
ret, common_window, ms_present = 0;
2026 common_window = eld_syntax ||
get_bits1(gb);
2027 if (common_window) {
2038 if (ms_present == 3) {
2041 }
else if (ms_present)
2044 if ((ret =
decode_ics(ac, &cpe->
ch[0], gb, common_window, 0)))
2046 if ((ret =
decode_ics(ac, &cpe->
ch[1], gb, common_window, 0)))
2049 if (common_window) {
2063 1.09050773266525765921,
2064 1.18920711500272106672,
2099 scale = cce_scale[
get_bits(gb, 2)];
2104 for (c = 0; c < num_gain; c++) {
2108 float gain_cache = 1.0;
2111 gain = cge ?
get_vlc2(gb, vlc_scalefactors.
table, 7, 3) - 60: 0;
2112 gain_cache =
powf(scale, -gain);
2115 coup->
gain[
c][0] = gain_cache;
2118 for (sfb = 0; sfb < sce->
ics.
max_sfb; sfb++, idx++) {
2129 gain_cache =
powf(scale, -t) *
s;
2132 coup->
gain[
c][idx] = gain_cache;
2150 int num_excl_chan = 0;
2153 for (i = 0; i < 7; i++)
2157 return num_excl_chan / 7;
2169 int drc_num_bands = 1;
2190 for (i = 0; i < drc_num_bands; i++) {
2203 for (i = 0; i < drc_num_bands; i++) {
2214 int i, major, minor;
2221 for(i=0; i+1<
sizeof(
buf) && len>=8; i++, len-=8)
2228 if (sscanf(buf,
"libfaac %d.%d", &major, &minor) == 2){
2307 for (filt = 0; filt < tns->
n_filt[w]; filt++) {
2319 if ((size = end - start) <= 0)
2331 for (m = 0; m <
size; m++, start += inc)
2332 for (i = 1; i <=
FFMIN(m, order); i++)
2333 coef[start] -= coef[start - i * inc] * lpc[i - 1];
2336 for (m = 0; m <
size; m++, start += inc) {
2337 tmp[0] = coef[
start];
2338 for (i = 1; i <=
FFMIN(m, order); i++)
2339 coef[start] += tmp[i] * lpc[i - 1];
2340 for (i = order; i > 0; i--)
2341 tmp[i] = tmp[i - 1];
2363 memset(in, 0, 448 *
sizeof(
float));
2370 memset(in + 1024 + 576, 0, 448 *
sizeof(
float));
2385 float *predTime = sce->
ret;
2387 int16_t num_samples = 2048;
2389 if (ltp->
lag < 1024)
2390 num_samples = ltp->
lag + 1024;
2391 for (i = 0; i < num_samples; i++)
2393 memset(&predTime[i], 0, (2048 - i) *
sizeof(
float));
2402 for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
2403 sce->
coeffs[i] += predFreq[i];
2413 float *saved = sce->
saved;
2414 float *saved_ltp = sce->
coeffs;
2420 memcpy(saved_ltp, saved, 512 *
sizeof(
float));
2421 memset(saved_ltp + 576, 0, 448 *
sizeof(
float));
2423 for (i = 0; i < 64; i++)
2424 saved_ltp[i + 512] = ac->
buf_mdct[1023 - i] * swindow[63 - i];
2426 memcpy(saved_ltp, ac->
buf_mdct + 512, 448 *
sizeof(
float));
2427 memset(saved_ltp + 576, 0, 448 *
sizeof(
float));
2429 for (i = 0; i < 64; i++)
2430 saved_ltp[i + 512] = ac->
buf_mdct[1023 - i] * swindow[63 - i];
2433 for (i = 0; i < 512; i++)
2434 saved_ltp[i + 512] = ac->
buf_mdct[1023 - i] * lwindow[511 - i];
2450 float *saved = sce->
saved;
2460 for (i = 0; i < 1024; i += 128)
2475 memcpy( out, saved, 448 *
sizeof(
float));
2483 memcpy( out + 448 + 4*128, temp, 64 *
sizeof(
float));
2486 memcpy( out + 576, buf + 64, 448 *
sizeof(
float));
2492 memcpy( saved, temp + 64, 64 *
sizeof(
float));
2496 memcpy( saved + 448, buf + 7*128 + 64, 64 *
sizeof(
float));
2498 memcpy( saved, buf + 512, 448 *
sizeof(
float));
2499 memcpy( saved + 448, buf + 7*128 + 64, 64 *
sizeof(
float));
2501 memcpy( saved, buf + 512, 512 *
sizeof(
float));
2510 float *saved = sce->
saved;
2521 memcpy(saved, buf + 256, 256 *
sizeof(
float));
2528 float *saved = sce->
saved;
2533 const int n2 = n >> 1;
2534 const int n4 = n >> 2;
2541 for (i = 0; i < n2; i+=2) {
2543 temp = in[
i ]; in[
i ] = -in[n - 1 -
i]; in[n - 1 -
i] =
temp;
2544 temp = -in[i + 1]; in[i + 1] = in[n - 2 -
i]; in[n - 2 -
i] =
temp;
2547 for (i = 0; i <
n; i+=2) {
2557 for (i = n4; i < n2; i ++) {
2558 out[i - n4] = buf[n2 - 1 -
i] * window[i - n4] +
2559 saved[ i + n2] * window[i + n - n4] +
2560 -saved[ n + n2 - 1 -
i] * window[i + 2*n - n4] +
2561 -saved[2*n + n2 +
i] * window[i + 3*n - n4];
2563 for (i = 0; i < n2; i ++) {
2564 out[n4 +
i] = buf[
i] * window[i + n2 - n4] +
2565 -saved[ n - 1 -
i] * window[i + n2 + n - n4] +
2566 -saved[ n +
i] * window[i + n2 + 2*n - n4] +
2567 saved[2*n + n - 1 -
i] * window[i + n2 + 3*n - n4];
2569 for (i = 0; i < n4; i ++) {
2570 out[n2 + n4 +
i] = buf[ i + n2] * window[i + n - n4] +
2571 -saved[ n2 - 1 -
i] * window[i + 2*n - n4] +
2572 -saved[ n + n2 +
i] * window[i + 3*n - n4];
2576 memmove(saved + n, saved, 2 * n *
sizeof(
float));
2577 memcpy( saved, buf, n *
sizeof(
float));
2591 float *dest = target->
coeffs;
2593 int g,
i, group, k, idx = 0;
2596 "Dependent coupling is not supported together with LTP\n");
2600 for (i = 0; i < ics->
max_sfb; i++, idx++) {
2603 for (group = 0; group < ics->
group_len[
g]; group++) {
2604 for (k = offsets[i]; k < offsets[i + 1]; k++) {
2606 dest[group * 128 + k] += gain * src[group * 128 + k];
2628 float *dest = target->
ret;
2631 for (i = 0; i <
len; i++)
2632 dest[i] += gain * src[i];
2655 if (coup->
type[c] == type && coup->
id_select[c] == elem_id) {
2657 apply_coupling_method(ac, &cc->
ch[0], cce, index);
2662 apply_coupling_method(ac, &cc->
ch[1], cce, index++);
2687 for (type = 3; type >= 0; type--) {
2731 uint8_t layout_map[MAX_ELEM_ID*4][3];
2732 int layout_map_tags,
ret;
2740 "More than one AAC RDB per ADTS frame");
2763 layout_map_tags = 2;
2764 layout_map[0][0] = layout_map[1][0] =
TYPE_SCE;
2766 layout_map[0][1] = 0;
2767 layout_map[1][1] = 1;
2808 if (chan_config < 0 || chan_config >= 8) {
2816 if (!(che=
get_che(ac, elem_type, elem_id))) {
2818 "channel element %d.%d is not allocated\n",
2819 elem_type, elem_id);
2824 switch (elem_type) {
2855 int samples = 0, multiplier, audio_found = 0, pce_found = 0;
2856 int is_dmono, sce_count = 0;
2881 if (!(che=
get_che(ac, elem_type, elem_id))) {
2883 elem_type, elem_id);
2890 switch (elem_type) {
2917 uint8_t layout_map[MAX_ELEM_ID*4][3];
2927 "Not evaluating a further program_config_element as this construct is dubious at best.\n");
2956 elem_type_prev = elem_type;
2971 samples <<= multiplier;
2973 is_dmono = ac->
dmono_mode && sce_count == 2 &&
2980 *got_frame_ptr = !!samples;
2989 if (ac->
oc[1].
status && audio_found) {
2998 if (side && side_size>=4)
3008 int *got_frame_ptr,
AVPacket *avpkt)
3012 int buf_size = avpkt->
size;
3017 int new_extradata_size;
3020 &new_extradata_size);
3021 int jp_dualmono_size;
3026 if (new_extradata && 0) {
3033 memcpy(avctx->
extradata, new_extradata, new_extradata_size);
3044 if (jp_dualmono && jp_dualmono_size > 0)
3049 if (INT_MAX / 8 <= buf_size)
3069 for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++)
3070 if (buf[buf_offset])
3073 return buf_size > buf_offset ? buf_consumed : buf_size;
3082 for (type = 0; type < 4; type++) {
3083 if (ac->
che[type][i])
3097 #define LOAS_SYNC_WORD 0x2b7
3123 int sync_extension = 0;
3124 int bits_consumed, esize;
3132 if (config_start_bit % 8) {
3134 "Non-byte-aligned audio-specific config");
3140 gb->
buffer + (config_start_bit / 8),
3141 asclen, sync_extension);
3143 if (bits_consumed < 0)
3157 esize = (bits_consumed+7) / 8;
3172 return bits_consumed;
3181 if (audio_mux_version)
3186 if (audio_mux_version)
3206 if (!audio_mux_version) {
3237 if (audio_mux_version) {
3260 int mux_slot_length = 0;
3263 mux_slot_length += tmp;
3264 }
while (tmp == 255);
3265 return mux_slot_length;
3281 if (!use_same_mux) {
3286 "no decoder config found\n");
3294 }
else if (mux_slot_length_bytes * 8 + 256 <
get_bits_left(gb)) {
3296 "frame length mismatch %d << %d\n",
3306 int *got_frame_ptr,
AVPacket *avpkt)
3321 if (muxlength > avpkt->
size)
3345 "ADTS header detected, probably as result of configuration "
3381 #define AACDEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
3383 {
"dual_mono_mode",
"Select the channel to decode for dual mono",