45 #define AT1_MAX_BFU 52
46 #define AT1_SU_SIZE 212
47 #define AT1_SU_SAMPLES 512
48 #define AT1_FRAME_SIZE AT1_SU_SIZE * 2
49 #define AT1_SU_MAX_BITS AT1_SU_SIZE * 8
50 #define AT1_MAX_CHANNELS 2
52 #define AT1_QMF_BANDS 3
53 #define IDX_LOW_BAND 0
54 #define IDX_MID_BAND 1
55 #define IDX_HIGH_BAND 2
96 int transf_size = 1 << nbits;
100 for (i = 0; i < transf_size / 2; i++)
101 FFSWAP(
float, spec[i], spec[transf_size - 1 - i]);
103 mdct_context->
imdct_half(mdct_context, out, spec);
109 int band_num, band_samples, log2_block_count, nbits, num_blocks, block_size;
110 unsigned int start_pos, ref_pos = 0, pos = 0;
121 num_blocks = 1 << log2_block_count;
123 if (num_blocks == 1) {
126 block_size = band_samples >> log2_block_count;
131 if (nbits != 5 && nbits != 7 && nbits != 8)
139 prev_buf = &su->
spectrum[1][ref_pos + band_samples - 16];
140 for (j=0; j < num_blocks; j++) {
145 &su->
spectrum[0][ref_pos + start_pos], ff_sine_32, 16);
147 prev_buf = &su->
spectrum[0][ref_pos+start_pos + 16];
148 start_pos += block_size;
153 memcpy(q->
bands[band_num] + 32, &su->
spectrum[0][ref_pos + 16], 240 *
sizeof(
float));
155 ref_pos += band_samples;
170 int log2_block_count_tmp, i;
172 for (i = 0; i < 2; i++) {
174 log2_block_count_tmp =
get_bits(gb, 2);
175 if (log2_block_count_tmp & 1)
177 log2_block_cnt[i] = 2 - log2_block_count_tmp;
181 log2_block_count_tmp =
get_bits(gb, 2);
182 if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3)
194 int bits_used, band_num, bfu_num, i;
204 bits_used = su->
num_bfus * 10 + 32 +
218 idwls[i] = idsfs[i] = 0;
226 int word_len = !!idwls[bfu_num] + idwls[bfu_num];
228 bits_used += word_len * num_specs;
238 float max_quant = 1.0 / (float)((1 << (word_len - 1)) - 1);
240 for (i = 0; i < num_specs; i++) {
244 spec[pos+i] =
get_sbits(gb, word_len) * scale_factor * max_quant;
247 memset(&spec[pos], 0, num_specs *
sizeof(
float));
259 float iqmf_temp[512 + 46];
274 int *got_frame_ptr,
AVPacket *avpkt)
277 int buf_size = avpkt->
size;
283 if (buf_size < 212 * avctx->channels) {
295 for (ch = 0; ch < avctx->
channels; ch++) {
388 .priv_data_size =
sizeof(
AT1Ctx),