Lines Matching refs:ch

497     int bin, band, ch;
503 for (ch = 1; ch <= s->fbw_channels; ch++) {
504 if (s->channel_in_cpl[ch]) {
505 int cpl_coord = s->cpl_coords[ch][band] << 5;
507 s->fixed_coeffs[ch][bin] =
510 if (ch == 2 && s->phase_flags[band]) {
618 int ch, i;
620 for (ch = 1; ch <= s->fbw_channels; ch++) {
621 if (!s->dither_flag[ch] && s->channel_in_cpl[ch]) {
624 s->fixed_coeffs[ch][i] = 0;
631 int ch, mant_groups *m)
633 if (!s->channel_uses_aht[ch]) {
634 ac3_decode_transform_coeffs_ch(s, ch, m);
640 ff_eac3_decode_transform_coeffs_aht_ch(s, ch);
641 for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
642 s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin];
652 int ch, end;
658 for (ch = 1; ch <= s->channels; ch++) {
660 decode_transform_coeffs_ch(s, blk, ch, &m);
663 if (s->channel_in_cpl[ch]) {
671 end = s->end_freq[ch];
674 s->fixed_coeffs[ch][end] = 0;
712 int ch;
714 for (ch = 1; ch <= channels; ch++) {
715 if (s->block_switch[ch]) {
719 x[i] = s->transform_coeffs[ch][2 * i];
722 s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1 + offset],
725 s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1 + offset],
729 x[i] = s->transform_coeffs[ch][2 * i + 1];
730 s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1 + offset], x);
732 s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
734 s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1 + offset],
737 s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1 + offset],
740 memcpy(s->delay[ch - 1 + offset], s->tmp_output + 128, 128 * sizeof(FFTSample));
844 start_subband, end_subband, ch;
850 for (ch = 1; ch <= fbw_channels; ch++)
851 s->channel_uses_spx[ch] = get_bits1(bc);
900 int ch, bnd;
902 for (ch = 1; ch <= fbw_channels; ch++) {
903 if (s->channel_uses_spx[ch]) {
904 if (s->first_spx_coords[ch] || get_bits1(bc)) {
908 s->first_spx_coords[ch] = 0;
958 s->spx_noise_blend[ch][bnd] = (int)((accu + (1<<22)) >> 23);
960 s->spx_signal_blend[ch][bnd] = (int)((accu + (1<<22)) >> 23);
963 s->spx_noise_blend [ch][bnd] = nblend * spx_coord;
964 s->spx_signal_blend[ch][bnd] = sblend * spx_coord;
969 s->first_spx_coords[ch] = 1;
980 int ch;
1006 for (ch = 1; ch <= fbw_channels; ch++)
1007 s->channel_in_cpl[ch] = get_bits1(bc);
1033 for (ch = 1; ch <= fbw_channels; ch++) {
1034 s->channel_in_cpl[ch] = 0;
1035 s->first_cpl_coords[ch] = 1;
1048 int ch, bnd;
1051 for (ch = 1; ch <= fbw_channels; ch++) {
1052 if (s->channel_in_cpl[ch]) {
1053 if ((s->eac3 && s->first_cpl_coords[ch]) || get_bits1(bc)) {
1055 s->first_cpl_coords[ch] = 0;
1062 s->cpl_coords[ch][bnd] = cpl_coord_mant << 22;
1064 s->cpl_coords[ch][bnd] = (cpl_coord_mant + 16) << 21;
1065 s->cpl_coords[ch][bnd] >>= (cpl_coord_exp + master_cpl_coord);
1074 s->first_cpl_coords[ch] = 1;
1094 int i, bnd, seg, ch, ret;
1104 for (ch = 1; ch <= fbw_channels; ch++) {
1105 s->block_switch[ch] = get_bits1(gbc);
1106 if (ch > 1 && s->block_switch[ch] != s->block_switch[1])
1113 for (ch = 1; ch <= fbw_channels; ch++) {
1114 s->dither_flag[ch] = get_bits1(gbc);
1145 for (ch = 1; ch <= fbw_channels; ch++) {
1146 s->channel_uses_spx[ch] = 0;
1147 s->first_spx_coords[ch] = 1;
1195 for (ch = !cpl_in_use; ch <= s->channels; ch++) {
1197 s->exp_strategy[blk][ch] = get_bits(gbc, 2 - (ch == s->lfe_ch));
1198 if (s->exp_strategy[blk][ch] != EXP_REUSE)
1199 bit_alloc_stages[ch] = 3;
1203 for (ch = 1; ch <= fbw_channels; ch++) {
1204 s->start_freq[ch] = 0;
1205 if (s->exp_strategy[blk][ch] != EXP_REUSE) {
1207 int prev = s->end_freq[ch];
1208 if (s->channel_in_cpl[ch])
1209 s->end_freq[ch] = s->start_freq[CPL_CH];
1210 else if (s->channel_uses_spx[ch])
1211 s->end_freq[ch] = s->spx_src_start_freq;
1218 s->end_freq[ch] = bandwidth_code * 3 + 73;
1220 group_size = 3 << (s->exp_strategy[blk][ch] - 1);
1221 s->num_exp_groups[ch] = (s->end_freq[ch] + group_size-4) / group_size;
1222 if (blk > 0 && s->end_freq[ch] != prev)
1232 for (ch = !cpl_in_use; ch <= s->channels; ch++) {
1233 if (s->exp_strategy[blk][ch] != EXP_REUSE) {
1234 s->dexps[ch][0] = get_bits(gbc, 4) << !ch;
1235 if (decode_exponents(s, gbc, s->exp_strategy[blk][ch],
1236 s->num_exp_groups[ch], s->dexps[ch][0],
1237 &s->dexps[ch][s->start_freq[ch]+!!ch])) {
1240 if (ch != CPL_CH && ch != s->lfe_ch)
1253 for (ch = !cpl_in_use; ch <= s->channels; ch++)
1254 bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
1268 for (i = ch = !cpl_in_use; ch <= s->channels; ch++) {
1270 if (ch == i || s->snr_offset_strategy == 2)
1273 if (blk && s->snr_offset[ch] != snr) {
1274 bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 1);
1276 s->snr_offset[ch] = snr;
1280 int prev = s->fast_gain[ch];
1281 s->fast_gain[ch] = ff_ac3_fast_gain_tab[get_bits(gbc, 3)];
1283 if (blk && prev != s->fast_gain[ch])
1284 bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
1295 for (ch = !cpl_in_use; ch <= s->channels; ch++) {
1296 int prev = s->fast_gain[ch];
1297 s->fast_gain[ch] = ff_ac3_fast_gain_tab[get_bits(gbc, 3)];
1299 if (blk && prev != s->fast_gain[ch])
1300 bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
1303 for (ch = !cpl_in_use; ch <= s->channels; ch++)
1304 s->fast_gain[ch] = ff_ac3_fast_gain_tab[4];
1336 for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
1337 s->dba_mode[ch] = get_bits(gbc, 2);
1338 if (s->dba_mode[ch] == DBA_RESERVED) {
1342 bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
1345 for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
1346 if (s->dba_mode[ch] == DBA_NEW) {
1347 s->dba_nsegs[ch] = get_bits(gbc, 3) + 1;
1348 for (seg = 0; seg < s->dba_nsegs[ch]; seg++) {
1349 s->dba_offsets[ch][seg] = get_bits(gbc, 5);
1350 s->dba_lengths[ch][seg] = get_bits(gbc, 4);
1351 s->dba_values[ch][seg] = get_bits(gbc, 3);
1354 bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
1358 for (ch = 0; ch <= s->channels; ch++) {
1359 s->dba_mode[ch] = DBA_NONE;
1364 for (ch = !cpl_in_use; ch <= s->channels; ch++) {
1365 if (bit_alloc_stages[ch] > 2) {
1367 ff_ac3_bit_alloc_calc_psd(s->dexps[ch],
1368 s->start_freq[ch], s->end_freq[ch],
1369 s->psd[ch], s->band_psd[ch]);
1371 if (bit_alloc_stages[ch] > 1) {
1374 if (ff_ac3_bit_alloc_calc_mask(&s->bit_alloc_params, s->band_psd[ch],
1375 s->start_freq[ch], s->end_freq[ch],
1376 s->fast_gain[ch], (ch == s->lfe_ch),
1377 s->dba_mode[ch], s->dba_nsegs[ch],
1378 s->dba_offsets[ch], s->dba_lengths[ch],
1379 s->dba_values[ch], s->mask[ch])) {
1384 if (bit_alloc_stages[ch] > 0) {
1386 const uint8_t *bap_tab = s->channel_uses_aht[ch] ?
1388 s->ac3dsp.bit_alloc_calc_bap(s->mask[ch], s->psd[ch],
1389 s->start_freq[ch], s->end_freq[ch],
1390 s->snr_offset[ch],
1392 bap_tab, s->bap[ch]);
1413 for (ch = 1; ch <= s->channels; ch++) {
1416 if (s->channel_mode == AC3_CHMODE_DUALMONO && ch <= 2)
1417 audio_channel = 2-ch;
1424 scale_coefs(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
1429 s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch],
1430 s->fixed_coeffs[ch], gain, 256);
1491 int blk, ch, err, offset, ret;
1651 for (ch = 0; ch < AC3_MAX_CHANNELS; ch++) {
1652 output[ch] = s->output[ch + offset];
1653 s->outptr[ch] = s->output[ch + offset];
1655 for (ch = 0; ch < s->channels; ch++) {
1656 if (ch < s->out_channels)
1657 s->outptr[channel_map[ch]] = s->output_buffer[ch + offset];
1665 for (ch = 0; ch < s->out_channels; ch++)
1666 memcpy(s->output_buffer[ch + offset] + AC3_BLOCK_SIZE*blk, output[ch], AC3_BLOCK_SIZE*sizeof(SHORTFLOAT));
1667 for (ch = 0; ch < s->out_channels; ch++)
1668 output[ch] = s->outptr[channel_map[ch]];
1669 for (ch = 0; ch < s->out_channels; ch++) {
1670 if (!ch || channel_map[ch])
1671 s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE;
1676 for (ch = 0; ch < s->out_channels; ch++)
1677 memcpy(s->output[ch + offset], output[ch], AC3_BLOCK_SIZE*sizeof(SHORTFLOAT));
1719 for (ch = 0; ch < EAC3_MAX_CHANNELS; ch++)
1720 extended_channel_map[ch] = ch;
1732 for (ch = 0; ch < 16; ch++) {
1733 if (s->channel_map & (1 << (EAC3_MAX_CHANNELS - ch - 1))) {
1734 channel_layout |= ff_eac3_custom_channel_map_locations[ch][1];
1746 for (ch = 0; ch < EAC3_MAX_CHANNELS; ch++) {
1747 if (s->channel_map & (1 << (EAC3_MAX_CHANNELS - ch - 1))) {
1748 if (ff_eac3_custom_channel_map_locations[ch][0]) {
1750 ff_ctzll(ff_eac3_custom_channel_map_locations[ch][1]));
1761 if ((1ULL << i) & ff_eac3_custom_channel_map_locations[ch][1]) {
1781 for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++) {
1782 int map = extended_channel_map[ch];
1783 av_assert0(ch>=AV_NUM_DATA_POINTERS || frame->extended_data[ch] == frame->data[ch]);
1784 memcpy((SHORTFLOAT *)frame->extended_data[ch],