Lines Matching defs:channel

29  * - reconstruction of per-channel data
53 * || | | || | | | || || subframes of channel 0
55 * || | | || | | | || || subframes of channel 1
64 * to improve the compression ratio. These channel transformations do not
77 * between the subframes of a channel. Scale factors are initially DPCM-coded.
81 * common quantization factor that can be adjusted for every channel by a
111 #define MAX_SUBFRAMES 32 ///< max number of subframes per channel
142 * @brief frame specific decoder context for a single channel
152 uint8_t grouped; ///< channel is part of a group
167 * @brief channel group for channel transformations
200 int8_t lfe_channel; ///< lfe channel index
242 uint8_t num_chgroups; ///< number of channel groups
243 WMAProChannelGrp chgroup[WMAPRO_MAX_CHANNELS]; ///< channel group information
245 WMAProChannelCtx channel[WMAPRO_MAX_CHANNELS]; ///< per channel data
486 s->channel[i].prev_block_len = s->samples_per_frame;
488 /** extract lfe channel position */
644 * samples per channel. The data for every channel might be split
646 * subframes for every channel.
651 * bitstream that indicates if the channel contains a subframe with the
653 * If a channel contains such a subframe, the subframe size gets added to
654 * the channel's subframe list.
663 uint16_t num_samples[WMAPRO_MAX_CHANNELS] = { 0 };/**< sum of samples for all currently known subframes of a channel */
664 uint8_t contains_subframe[WMAPRO_MAX_CHANNELS]; /**< flag indicating if a channel contains the current subframe */
672 * from missing samples in the 8 channel case).
678 s->channel[c].num_subframes = 0;
706 WMAProChannelCtx* chan = &s->channel[c];
719 "channel len > samples_per_frame\n");
735 for (i = 0; i < s->channel[c].num_subframes; i++) {
736 ff_dlog(s->avctx, "frame[%"PRIu32"] channel[%i] subframe[%i]"
738 s->channel[c].subframe_len[i]);
739 s->channel[c].subframe_offset[i] = offset;
740 offset += s->channel[c].subframe_len[i];
750 *@param chgroup channel group for which the matrix needs to be calculated
798 *@brief Decode channel transformation parameters
805 /* should never consume more than 1921 bits for the 8 channel case
810 /** in the one channel case channel transforms are pointless */
828 /** decode channel mask */
832 if (!s->channel[channel_idx].grouped
835 s->channel[channel_idx].grouped = 1;
836 *channel_data++ = s->channel[channel_idx].coeffs;
843 if (!s->channel[channel_idx].grouped)
844 *channel_data++ = s->channel[channel_idx].coeffs;
845 s->channel[channel_idx].grouped = 1;
854 "Unknown channel transform type");
913 *@param c current channel number
929 WMAProChannelCtx* ci = &s->channel[c];
936 ff_dlog(s->avctx, "decode coefficients for channel %i\n", c);
1034 s->channel[c].scale_factors = s->channel[c].saved_scale_factors[!s->channel[c].scale_factor_idx];
1035 sf_end = s->channel[c].scale_factors + s->num_bands;
1042 if (s->channel[c].reuse_sf) {
1043 const int8_t* sf_offsets = s->sf_offsets[s->table_idx][s->channel[c].table_idx];
1046 s->channel[c].scale_factors[b] =
1047 s->channel[c].saved_scale_factors[s->channel[c].scale_factor_idx][*sf_offsets++];
1050 if (!s->channel[c].cur_subframe || get_bits1(&s->gb)) {
1052 if (!s->channel[c].reuse_sf) {
1055 s->channel[c].scale_factor_step = get_bits(&s->gb, 2) + 1;
1056 val = 45 / s->channel[c].scale_factor_step;
1057 for (sf = s->channel[c].scale_factors; sf < sf_end; sf++) {
1091 s->channel[c].scale_factors[i] += (val ^ sign) - sign;
1095 s->channel[c].scale_factor_idx = !s->channel[c].scale_factor_idx;
1096 s->channel[c].table_idx = s->table_idx;
1097 s->channel[c].reuse_sf = 1;
1101 s->channel[c].max_scale_factor = s->channel[c].scale_factors[0];
1102 for (sf = s->channel[c].scale_factors + 1; sf < sf_end; sf++) {
1103 s->channel[c].max_scale_factor =
1104 FFMAX(s->channel[c].max_scale_factor, *sf);
1112 *@brief Reconstruct the individual channel data.
1176 int winlen = s->channel[c].prev_block_len;
1177 float* start = s->channel[c].coeffs - (winlen >> 1);
1191 s->channel[c].prev_block_len = s->subframe_len;
1211 /** reset channel context and find the next block offset and size
1212 == the next block of the channel with the smallest number of
1216 s->channel[i].grouped = 0;
1217 if (offset > s->channel[i].decoded_samples) {
1218 offset = s->channel[i].decoded_samples;
1220 s->channel[i].subframe_len[s->channel[i].cur_subframe];
1230 const int cur_subframe = s->channel[i].cur_subframe;
1232 total_samples -= s->channel[i].decoded_samples;
1235 if (offset == s->channel[i].decoded_samples &&
1236 subframe_len == s->channel[i].subframe_len[cur_subframe]) {
1237 total_samples -= s->channel[i].subframe_len[cur_subframe];
1238 s->channel[i].decoded_samples +=
1239 s->channel[i].subframe_len[cur_subframe];
1266 s->channel[c].coeffs = &s->channel[c].out[offset];
1303 if ((s->channel[c].transmit_coefs = get_bits1(&s->gb)))
1322 av_assert0(num_vec_coeffs + offset <= FF_ARRAY_ELEMS(s->channel[c].out));
1323 s->channel[c].num_vec_coeffs = num_vec_coeffs;
1328 s->channel[c].num_vec_coeffs = s->subframe_len;
1347 /** decode quantization step modifiers for every channel */
1350 s->channel[s->channel_indexes_for_cur_subframe[0]].quant_step = quant_step;
1355 s->channel[c].quant_step = quant_step;
1358 s->channel[c].quant_step += get_bits(&s->gb, modifier_len) + 1;
1360 ++s->channel[c].quant_step;
1376 if (s->channel[c].transmit_coefs &&
1380 memset(s->channel[c].coeffs, 0,
1381 sizeof(*s->channel[c].coeffs) * subframe_len);
1389 /** reconstruct the per channel data */
1393 const int* sf = s->channel[c].scale_factors;
1403 const int exp = s->channel[c].quant_step -
1404 (s->channel[c].max_scale_factor - *sf++) *
1405 s->channel[c].scale_factor_step;
1409 s->channel[c].coeffs + start,
1414 mdct->imdct_half(mdct, s->channel[c].coeffs, s->tmp);
1424 if (s->channel[c].cur_subframe >= s->channel[c].num_subframes) {
1428 ++s->channel[c].cur_subframe;
1489 s->channel[i].decoded_samples = 0;
1490 s->channel[i].cur_subframe = 0;
1491 s->channel[i].reuse_sf = 0;
1504 memcpy(frame->extended_data[i], s->channel[i].out,
1505 s->samples_per_frame * sizeof(*s->channel[i].out));
1509 memcpy(&s->channel[i].out[0],
1510 &s->channel[i].out[s->samples_per_frame],
1511 s->samples_per_frame * sizeof(*s->channel[i].out) >> 1);
1636 s->samples_per_frame * sizeof(*s->channel[i].out));
1638 memcpy(frame->extended_data[i], s->channel[i].out,
1639 s->samples_per_frame * sizeof(*s->channel[i].out) >> 1);
2044 memset(s->channel[i].out, 0, s->samples_per_frame *
2045 sizeof(*s->channel[i].out));