43 #define EXPMAX ((19 + EXPVLCBITS - 1) / EXPVLCBITS)
45 #define HGAINVLCBITS 9
46 #define HGAINMAX ((13 + HGAINVLCBITS - 1) / HGAINVLCBITS)
52 int prec,
const float *
tab,
int n)
57 for (i = 0; i <
n; i++) {
86 flags2 =
AV_RL16(extradata + 2);
88 flags2 =
AV_RL16(extradata + 4);
96 av_log(avctx,
AV_LOG_WARNING,
"Disabling use_variable_block_len, if this fails contact the ffmpeg developers and send us the file\n");
148 t.v = ((
u.v <<
LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23);
159 wdel =
M_PI / frame_len;
160 for (i = 0; i < frame_len; i++)
164 for (i = 0; i < 256; i++) {
190 float p, q, w,
v, val_max;
193 for (i = 0; i <
n; i++) {
209 *val_max_ptr = val_max;
221 if (i == 0 || i >= 8)
234 1.7782794100389e-04, 2.0535250264571e-04,
235 2.3713737056617e-04, 2.7384196342644e-04,
236 3.1622776601684e-04, 3.6517412725484e-04,
237 4.2169650342858e-04, 4.8696752516586e-04,
238 5.6234132519035e-04, 6.4938163157621e-04,
239 7.4989420933246e-04, 8.6596432336006e-04,
240 1.0000000000000e-03, 1.1547819846895e-03,
241 1.3335214321633e-03, 1.5399265260595e-03,
242 1.7782794100389e-03, 2.0535250264571e-03,
243 2.3713737056617e-03, 2.7384196342644e-03,
244 3.1622776601684e-03, 3.6517412725484e-03,
245 4.2169650342858e-03, 4.8696752516586e-03,
246 5.6234132519035e-03, 6.4938163157621e-03,
247 7.4989420933246e-03, 8.6596432336006e-03,
248 1.0000000000000e-02, 1.1547819846895e-02,
249 1.3335214321633e-02, 1.5399265260595e-02,
250 1.7782794100389e-02, 2.0535250264571e-02,
251 2.3713737056617e-02, 2.7384196342644e-02,
252 3.1622776601684e-02, 3.6517412725484e-02,
253 4.2169650342858e-02, 4.8696752516586e-02,
254 5.6234132519035e-02, 6.4938163157621e-02,
255 7.4989420933246e-02, 8.6596432336007e-02,
256 1.0000000000000e-01, 1.1547819846895e-01,
257 1.3335214321633e-01, 1.5399265260595e-01,
258 1.7782794100389e-01, 2.0535250264571e-01,
259 2.3713737056617e-01, 2.7384196342644e-01,
260 3.1622776601684e-01, 3.6517412725484e-01,
261 4.2169650342858e-01, 4.8696752516586e-01,
262 5.6234132519035e-01, 6.4938163157621e-01,
263 7.4989420933246e-01, 8.6596432336007e-01,
264 1.0000000000000e+00, 1.1547819846895e+00,
265 1.3335214321633e+00, 1.5399265260595e+00,
266 1.7782794100389e+00, 2.0535250264571e+00,
267 2.3713737056617e+00, 2.7384196342644e+00,
268 3.1622776601684e+00, 3.6517412725484e+00,
269 4.2169650342858e+00, 4.8696752516586e+00,
270 5.6234132519035e+00, 6.4938163157621e+00,
271 7.4989420933246e+00, 8.6596432336007e+00,
272 1.0000000000000e+01, 1.1547819846895e+01,
273 1.3335214321633e+01, 1.5399265260595e+01,
274 1.7782794100389e+01, 2.0535250264571e+01,
275 2.3713737056617e+01, 2.7384196342644e+01,
276 3.1622776601684e+01, 3.6517412725484e+01,
277 4.2169650342858e+01, 4.8696752516586e+01,
278 5.6234132519035e+01, 6.4938163157621e+01,
279 7.4989420933246e+01, 8.6596432336007e+01,
280 1.0000000000000e+02, 1.1547819846895e+02,
281 1.3335214321633e+02, 1.5399265260595e+02,
282 1.7782794100389e+02, 2.0535250264571e+02,
283 2.3713737056617e+02, 2.7384196342644e+02,
284 3.1622776601684e+02, 3.6517412725484e+02,
285 4.2169650342858e+02, 4.8696752516586e+02,
286 5.6234132519035e+02, 6.4938163157621e+02,
287 7.4989420933246e+02, 8.6596432336007e+02,
288 1.0000000000000e+03, 1.1547819846895e+03,
289 1.3335214321633e+03, 1.5399265260595e+03,
290 1.7782794100389e+03, 2.0535250264571e+03,
291 2.3713737056617e+03, 2.7384196342644e+03,
292 3.1622776601684e+03, 3.6517412725484e+03,
293 4.2169650342858e+03, 4.8696752516586e+03,
294 5.6234132519035e+03, 6.4938163157621e+03,
295 7.4989420933246e+03, 8.6596432336007e+03,
296 1.0000000000000e+04, 1.1547819846895e+04,
297 1.3335214321633e+04, 1.5399265260595e+04,
298 1.7782794100389e+04, 2.0535250264571e+04,
299 2.3713737056617e+04, 2.7384196342644e+04,
300 3.1622776601684e+04, 3.6517412725484e+04,
301 4.2169650342858e+04, 4.8696752516586e+04,
302 5.6234132519035e+04, 6.4938163157621e+04,
303 7.4989420933246e+04, 8.6596432336007e+04,
304 1.0000000000000e+05, 1.1547819846895e+05,
305 1.3335214321633e+05, 1.5399265260595e+05,
306 1.7782794100389e+05, 2.0535250264571e+05,
307 2.3713737056617e+05, 2.7384196342644e+05,
308 3.1622776601684e+05, 3.6517412725484e+05,
309 4.2169650342858e+05, 4.8696752516586e+05,
310 5.6234132519035e+05, 6.4938163157621e+05,
311 7.4989420933246e+05, 8.6596432336007e+05,
319 int last_exp,
n, code;
322 uint32_t *q, *q_end, iv;
323 const float *ptab = pow_tab + 60;
324 const uint32_t *iptab = (
const uint32_t *) ptab;
333 iv = iptab[last_exp];
341 }
while ((n -= 4) > 0);
352 last_exp += code - 60;
359 iv = iptab[last_exp];
368 }
while ((n -= 4) > 0);
383 int block_len, bsize,
n;
400 memcpy(out + n + block_len, in + n + block_len, n *
sizeof(
float));
417 memcpy(out, in, n *
sizeof(
float));
422 memset(out + n + block_len, 0, n *
sizeof(
float));
432 int n,
v,
a, ch, bsize;
433 int coef_nb_bits, total_gain;
452 "prev_block_len_bits %d out of range\n",
460 "block_len_bits %d out of range\n",
473 "next_block_len_bits %d out of range\n",
540 for (i = 0; i <
n; i++) {
554 val = (int) 0x80000000;
555 for (i = 0; i <
n; i++) {
557 if (val == (
int) 0x80000000) {
564 "hgain vlc invalid\n");
603 0, ptr, 0, nb_coefs[ch],
613 mdct_norm = 1.0 / (float) n4;
615 mdct_norm *= sqrt(n4);
622 float *coefs, *exponents,
mult, mult1,
noise;
623 int i, j,
n, n1, last_high_band, esize;
629 mult = pow(10, total_gain * 0.05) / s->
max_exponent[ch];
631 coefs = s->
coefs[ch];
637 exponents[i << bsize >> esize] * mult1;
648 for (j = 0; j < n1; j++) {
654 for (i = 0; i <
n; i++) {
655 v = exponents[i << bsize >> esize];
658 exp_power[j] = e2 /
n;
660 tprintf(s->
avctx,
"%d: power=%f (%d)\n", j, exp_power[j], n);
662 exponents += n << bsize >> esize;
667 for (j = -1; j < n1; j++) {
675 mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
680 for (i = 0; i <
n; i++) {
683 *coefs++ = noise * exponents[i << bsize >> esize] * mult1;
685 exponents += n << bsize >> esize;
688 for (i = 0; i <
n; i++) {
691 *coefs++ = ((*coefs1++) + noise) *
692 exponents[i << bsize >> esize] *
mult;
694 exponents += n << bsize >> esize;
700 mult1 = mult * exponents[((-1 << bsize)) >> esize];
701 for (i = 0; i <
n; i++) {
710 for (i = 0; i <
n; i++)
711 *coefs++ = coefs1[i] * exponents[i << bsize >> esize] * mult;
713 for (i = 0; i <
n; i++)
791 memcpy(samples[ch] + samples_offset, s->
frame_out[ch],
798 dump_floats(s,
"samples", 6, samples[ch] + samples_offset,
807 int *got_frame_ptr,
AVPacket *avpkt)
811 int buf_size = avpkt->
size;
813 int nb_frames, bit_offset, i, pos,
len,
ret;
818 tprintf(avctx,
"***decode_superframe:\n");
824 if (buf_size < avctx->block_align) {
826 "Input packet size too small (%d < %d)\n",
839 if (nb_frames <= 0) {
842 "nb_frames is %d bits left %d\n",
878 "Invalid last frame bit offset %d > buf size %d (%d)\n",
922 for (i = 0; i < nb_frames; i++) {
933 len = buf_size - pos;
949 (int8_t *) samples - (int8_t *) data, avctx->
block_align);
969 #if CONFIG_WMAV1_DECODER
985 #if CONFIG_WMAV2_DECODER