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
99 int transf_size = 1 << nbits;
103 for (i = 0; i < transf_size / 2; i++)
104 FFSWAP(
float, spec[i], spec[transf_size - 1 - i]);
106 mdct_context->
imdct_half(mdct_context, out, spec);
112 int band_num, band_samples, log2_block_count, nbits, num_blocks, block_size;
113 unsigned int start_pos, ref_pos = 0, pos = 0;
124 num_blocks = 1 << log2_block_count;
126 if (num_blocks == 1) {
129 block_size = band_samples >> log2_block_count;
134 if (nbits != 5 && nbits != 7 && nbits != 8)
142 prev_buf = &su->
spectrum[1][ref_pos + band_samples - 16];
143 for (j=0; j < num_blocks; j++) {
148 &su->
spectrum[0][ref_pos + start_pos], ff_sine_32, 16);
150 prev_buf = &su->
spectrum[0][ref_pos+start_pos + 16];
151 start_pos += block_size;
156 memcpy(q->
bands[band_num] + 32, &su->
spectrum[0][ref_pos + 16], 240 *
sizeof(
float));
158 ref_pos += band_samples;
173 int log2_block_count_tmp, i;
175 for (i = 0; i < 2; i++) {
177 log2_block_count_tmp =
get_bits(gb, 2);
178 if (log2_block_count_tmp & 1)
180 log2_block_cnt[i] = 2 - log2_block_count_tmp;
184 log2_block_count_tmp =
get_bits(gb, 2);
185 if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3)
197 int bits_used, band_num, bfu_num, i;
207 bits_used = su->
num_bfus * 10 + 32 +
221 idwls[i] = idsfs[i] = 0;
229 int word_len = !!idwls[bfu_num] + idwls[bfu_num];
231 bits_used += word_len * num_specs;
241 float max_quant = 1.0 / (float)((1 << (word_len - 1)) - 1);
243 for (i = 0; i < num_specs; i++) {
247 spec[pos+i] =
get_sbits(gb, word_len) * scale_factor * max_quant;
250 memset(&spec[pos], 0, num_specs *
sizeof(
float));
262 float iqmf_temp[512 + 46];
277 int *got_frame_ptr,
AVPacket *avpkt)
279 const uint8_t *buf = avpkt->
data;
280 int buf_size = avpkt->
size;
287 if (buf_size < 212 * q->channels) {
407 .priv_data_size =
sizeof(
AT1Ctx),