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
95 int transf_size = 1 << nbits;
99 for (i = 0; i < transf_size / 2; i++)
100 FFSWAP(
float, spec[i], spec[transf_size - 1 - i]);
102 mdct_context->
imdct_half(mdct_context, out, spec);
108 int band_num, band_samples, log2_block_count, nbits, num_blocks, block_size;
109 unsigned int start_pos, ref_pos = 0, pos = 0;
120 num_blocks = 1 << log2_block_count;
122 if (num_blocks == 1) {
125 block_size = band_samples >> log2_block_count;
130 if (nbits != 5 && nbits != 7 && nbits != 8)
138 prev_buf = &su->
spectrum[1][ref_pos + band_samples - 16];
139 for (j=0; j < num_blocks; j++) {
144 &su->
spectrum[0][ref_pos + start_pos], ff_sine_32, 16);
146 prev_buf = &su->
spectrum[0][ref_pos+start_pos + 16];
147 start_pos += block_size;
152 memcpy(q->
bands[band_num] + 32, &su->
spectrum[0][ref_pos + 16], 240 *
sizeof(
float));
154 ref_pos += band_samples;
169 int log2_block_count_tmp, i;
171 for (i = 0; i < 2; i++) {
173 log2_block_count_tmp =
get_bits(gb, 2);
174 if (log2_block_count_tmp & 1)
176 log2_block_cnt[i] = 2 - log2_block_count_tmp;
180 log2_block_count_tmp =
get_bits(gb, 2);
181 if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3)
193 int bits_used, band_num, bfu_num, i;
203 bits_used = su->
num_bfus * 10 + 32 +
217 idwls[i] = idsfs[i] = 0;
225 int word_len = !!idwls[bfu_num] + idwls[bfu_num];
227 bits_used += word_len * num_specs;
237 float max_quant = 1.0 / (float)((1 << (word_len - 1)) - 1);
239 for (i = 0; i < num_specs; i++) {
243 spec[pos+i] =
get_sbits(gb, word_len) * scale_factor * max_quant;
246 memset(&spec[pos], 0, num_specs *
sizeof(
float));
258 float iqmf_temp[512 + 46];
273 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++) {
384 .priv_data_size =
sizeof(
AT1Ctx),