46 #define AT1_MAX_BFU 52
47 #define AT1_SU_SIZE 212
48 #define AT1_SU_SAMPLES 512
49 #define AT1_FRAME_SIZE AT1_SU_SIZE * 2
50 #define AT1_SU_MAX_BITS AT1_SU_SIZE * 8
51 #define AT1_MAX_CHANNELS 2
53 #define AT1_QMF_BANDS 3
54 #define IDX_LOW_BAND 0
55 #define IDX_MID_BAND 1
56 #define IDX_HIGH_BAND 2
97 int transf_size = 1 << nbits;
101 for (i = 0; i < transf_size / 2; i++)
102 FFSWAP(
float, spec[i], spec[transf_size - 1 - i]);
104 mdct_context->
imdct_half(mdct_context, out, spec);
110 int band_num, band_samples, log2_block_count, nbits, num_blocks, block_size;
111 unsigned int start_pos, ref_pos = 0, pos = 0;
122 num_blocks = 1 << log2_block_count;
124 if (num_blocks == 1) {
127 block_size = band_samples >> log2_block_count;
132 if (nbits != 5 && nbits != 7 && nbits != 8)
140 prev_buf = &su->
spectrum[1][ref_pos + band_samples - 16];
141 for (j=0; j < num_blocks; j++) {
146 &su->
spectrum[0][ref_pos + start_pos], ff_sine_32, 16);
148 prev_buf = &su->
spectrum[0][ref_pos+start_pos + 16];
149 start_pos += block_size;
154 memcpy(q->
bands[band_num] + 32, &su->
spectrum[0][ref_pos + 16], 240 *
sizeof(
float));
156 ref_pos += band_samples;
171 int log2_block_count_tmp, i;
173 for (i = 0; i < 2; i++) {
175 log2_block_count_tmp =
get_bits(gb, 2);
176 if (log2_block_count_tmp & 1)
178 log2_block_cnt[i] = 2 - log2_block_count_tmp;
182 log2_block_count_tmp =
get_bits(gb, 2);
183 if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3)
195 int bits_used, band_num, bfu_num, i;
205 bits_used = su->
num_bfus * 10 + 32 +
219 idwls[i] = idsfs[i] = 0;
227 int word_len = !!idwls[bfu_num] + idwls[bfu_num];
229 bits_used += word_len * num_specs;
239 float max_quant = 1.0 / (float)((1 << (word_len - 1)) - 1);
241 for (i = 0; i < num_specs; i++) {
245 spec[pos+i] =
get_sbits(gb, word_len) * scale_factor * max_quant;
248 memset(&spec[pos], 0, num_specs *
sizeof(
float));
260 float iqmf_temp[512 + 46];
275 int *got_frame_ptr,
AVPacket *avpkt)
278 int buf_size = avpkt->
size;
284 if (buf_size < 212 * avctx->channels) {
296 for (ch = 0; ch < avctx->
channels; ch++) {
384 .priv_data_size =
sizeof(
AT1Ctx),