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
100 int transf_size = 1 << nbits;
104 for (i = 0; i < transf_size / 2; i++)
105 FFSWAP(
float, spec[i], spec[transf_size - 1 - i]);
107 mdct_context->
imdct_half(mdct_context, out, spec);
113 int band_num, band_samples, log2_block_count, nbits, num_blocks, block_size;
114 unsigned int start_pos, ref_pos = 0, pos = 0;
125 num_blocks = 1 << log2_block_count;
127 if (num_blocks == 1) {
130 block_size = band_samples >> log2_block_count;
135 if (nbits != 5 && nbits != 7 && nbits != 8)
143 prev_buf = &su->
spectrum[1][ref_pos + band_samples - 16];
144 for (j=0; j < num_blocks; j++) {
149 &su->
spectrum[0][ref_pos + start_pos], ff_sine_32, 16);
151 prev_buf = &su->
spectrum[0][ref_pos+start_pos + 16];
152 start_pos += block_size;
157 memcpy(q->
bands[band_num] + 32, &su->
spectrum[0][ref_pos + 16], 240 *
sizeof(
float));
159 ref_pos += band_samples;
174 int log2_block_count_tmp, i;
176 for (i = 0; i < 2; i++) {
178 log2_block_count_tmp =
get_bits(gb, 2);
179 if (log2_block_count_tmp & 1)
181 log2_block_cnt[i] = 2 - log2_block_count_tmp;
185 log2_block_count_tmp =
get_bits(gb, 2);
186 if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3)
198 int bits_used, band_num, bfu_num, i;
208 bits_used = su->
num_bfus * 10 + 32 +
222 idwls[i] = idsfs[i] = 0;
230 int word_len = !!idwls[bfu_num] + idwls[bfu_num];
232 bits_used += word_len * num_specs;
242 float max_quant = 1.0 / (float)((1 << (word_len - 1)) - 1);
244 for (i = 0; i < num_specs; i++) {
248 spec[pos+i] =
get_sbits(gb, word_len) * scale_factor * max_quant;
251 memset(&spec[pos], 0, num_specs *
sizeof(
float));
263 float iqmf_temp[512 + 46];
278 int *got_frame_ptr,
AVPacket *avpkt)
280 const uint8_t *buf = avpkt->
data;
281 int buf_size = avpkt->
size;
288 if (buf_size < 212 * q->channels) {
408 .priv_data_size =
sizeof(
AT1Ctx),