46 #define EXPMAX ((19 + EXPVLCBITS - 1) / EXPVLCBITS)
48 #define HGAINVLCBITS 9
49 #define HGAINMAX ((13 + HGAINVLCBITS - 1) / HGAINVLCBITS)
55 int prec,
const float *
tab,
int n)
60 for (i = 0; i <
n; i++) {
89 flags2 =
AV_RL16(extradata + 2);
91 flags2 =
AV_RL16(extradata + 4);
99 av_log(avctx,
AV_LOG_WARNING,
"Disabling use_variable_block_len, if this fails contact the ffmpeg developers and send us the file\n");
151 t.v = ((
u.v <<
LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23);
162 wdel =
M_PI / frame_len;
163 for (i = 0; i < frame_len; i++)
167 for (i = 0; i < 256; i++) {
193 float p, q, w,
v, val_max;
196 for (i = 0; i <
n; i++) {
212 *val_max_ptr = val_max;
224 if (i == 0 || i >= 8)
237 1.7782794100389e-04, 2.0535250264571e-04,
238 2.3713737056617e-04, 2.7384196342644e-04,
239 3.1622776601684e-04, 3.6517412725484e-04,
240 4.2169650342858e-04, 4.8696752516586e-04,
241 5.6234132519035e-04, 6.4938163157621e-04,
242 7.4989420933246e-04, 8.6596432336006e-04,
243 1.0000000000000e-03, 1.1547819846895e-03,
244 1.3335214321633e-03, 1.5399265260595e-03,
245 1.7782794100389e-03, 2.0535250264571e-03,
246 2.3713737056617e-03, 2.7384196342644e-03,
247 3.1622776601684e-03, 3.6517412725484e-03,
248 4.2169650342858e-03, 4.8696752516586e-03,
249 5.6234132519035e-03, 6.4938163157621e-03,
250 7.4989420933246e-03, 8.6596432336006e-03,
251 1.0000000000000e-02, 1.1547819846895e-02,
252 1.3335214321633e-02, 1.5399265260595e-02,
253 1.7782794100389e-02, 2.0535250264571e-02,
254 2.3713737056617e-02, 2.7384196342644e-02,
255 3.1622776601684e-02, 3.6517412725484e-02,
256 4.2169650342858e-02, 4.8696752516586e-02,
257 5.6234132519035e-02, 6.4938163157621e-02,
258 7.4989420933246e-02, 8.6596432336007e-02,
259 1.0000000000000e-01, 1.1547819846895e-01,
260 1.3335214321633e-01, 1.5399265260595e-01,
261 1.7782794100389e-01, 2.0535250264571e-01,
262 2.3713737056617e-01, 2.7384196342644e-01,
263 3.1622776601684e-01, 3.6517412725484e-01,
264 4.2169650342858e-01, 4.8696752516586e-01,
265 5.6234132519035e-01, 6.4938163157621e-01,
266 7.4989420933246e-01, 8.6596432336007e-01,
267 1.0000000000000e+00, 1.1547819846895e+00,
268 1.3335214321633e+00, 1.5399265260595e+00,
269 1.7782794100389e+00, 2.0535250264571e+00,
270 2.3713737056617e+00, 2.7384196342644e+00,
271 3.1622776601684e+00, 3.6517412725484e+00,
272 4.2169650342858e+00, 4.8696752516586e+00,
273 5.6234132519035e+00, 6.4938163157621e+00,
274 7.4989420933246e+00, 8.6596432336007e+00,
275 1.0000000000000e+01, 1.1547819846895e+01,
276 1.3335214321633e+01, 1.5399265260595e+01,
277 1.7782794100389e+01, 2.0535250264571e+01,
278 2.3713737056617e+01, 2.7384196342644e+01,
279 3.1622776601684e+01, 3.6517412725484e+01,
280 4.2169650342858e+01, 4.8696752516586e+01,
281 5.6234132519035e+01, 6.4938163157621e+01,
282 7.4989420933246e+01, 8.6596432336007e+01,
283 1.0000000000000e+02, 1.1547819846895e+02,
284 1.3335214321633e+02, 1.5399265260595e+02,
285 1.7782794100389e+02, 2.0535250264571e+02,
286 2.3713737056617e+02, 2.7384196342644e+02,
287 3.1622776601684e+02, 3.6517412725484e+02,
288 4.2169650342858e+02, 4.8696752516586e+02,
289 5.6234132519035e+02, 6.4938163157621e+02,
290 7.4989420933246e+02, 8.6596432336007e+02,
291 1.0000000000000e+03, 1.1547819846895e+03,
292 1.3335214321633e+03, 1.5399265260595e+03,
293 1.7782794100389e+03, 2.0535250264571e+03,
294 2.3713737056617e+03, 2.7384196342644e+03,
295 3.1622776601684e+03, 3.6517412725484e+03,
296 4.2169650342858e+03, 4.8696752516586e+03,
297 5.6234132519035e+03, 6.4938163157621e+03,
298 7.4989420933246e+03, 8.6596432336007e+03,
299 1.0000000000000e+04, 1.1547819846895e+04,
300 1.3335214321633e+04, 1.5399265260595e+04,
301 1.7782794100389e+04, 2.0535250264571e+04,
302 2.3713737056617e+04, 2.7384196342644e+04,
303 3.1622776601684e+04, 3.6517412725484e+04,
304 4.2169650342858e+04, 4.8696752516586e+04,
305 5.6234132519035e+04, 6.4938163157621e+04,
306 7.4989420933246e+04, 8.6596432336007e+04,
307 1.0000000000000e+05, 1.1547819846895e+05,
308 1.3335214321633e+05, 1.5399265260595e+05,
309 1.7782794100389e+05, 2.0535250264571e+05,
310 2.3713737056617e+05, 2.7384196342644e+05,
311 3.1622776601684e+05, 3.6517412725484e+05,
312 4.2169650342858e+05, 4.8696752516586e+05,
313 5.6234132519035e+05, 6.4938163157621e+05,
314 7.4989420933246e+05, 8.6596432336007e+05,
322 int last_exp,
n, code;
325 uint32_t *q, *q_end, iv;
326 const float *ptab = pow_tab + 60;
327 const uint32_t *iptab = (
const uint32_t *) ptab;
336 iv = iptab[last_exp];
344 }
while ((n -= 4) > 0);
355 last_exp += code - 60;
362 iv = iptab[last_exp];
371 }
while ((n -= 4) > 0);
386 int block_len, bsize,
n;
403 memcpy(out + n + block_len, in + n + block_len, n *
sizeof(
float));
420 memcpy(out, in, n *
sizeof(
float));
425 memset(out + n + block_len, 0, n *
sizeof(
float));
435 int n,
v,
a, ch, bsize;
436 int coef_nb_bits, total_gain;
455 "prev_block_len_bits %d out of range\n",
463 "block_len_bits %d out of range\n",
476 "next_block_len_bits %d out of range\n",
543 for (i = 0; i <
n; i++) {
557 val = (int) 0x80000000;
558 for (i = 0; i <
n; i++) {
560 if (val == (
int) 0x80000000) {
567 "hgain vlc invalid\n");
606 0, ptr, 0, nb_coefs[ch],
616 mdct_norm = 1.0 / (float) n4;
618 mdct_norm *= sqrt(n4);
625 float *coefs, *exponents,
mult, mult1,
noise;
626 int i, j,
n, n1, last_high_band, esize;
632 mult = pow(10, total_gain * 0.05) / s->
max_exponent[ch];
634 coefs = s->
coefs[ch];
640 exponents[i << bsize >> esize] * mult1;
651 for (j = 0; j < n1; j++) {
657 for (i = 0; i <
n; i++) {
658 v = exponents[i << bsize >> esize];
661 exp_power[j] = e2 /
n;
663 tprintf(s->
avctx,
"%d: power=%f (%d)\n", j, exp_power[j], n);
665 exponents += n << bsize >> esize;
670 for (j = -1; j < n1; j++) {
678 mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
683 for (i = 0; i <
n; i++) {
686 *coefs++ = noise * exponents[i << bsize >> esize] * mult1;
688 exponents += n << bsize >> esize;
691 for (i = 0; i <
n; i++) {
694 *coefs++ = ((*coefs1++) + noise) *
695 exponents[i << bsize >> esize] *
mult;
697 exponents += n << bsize >> esize;
703 mult1 = mult * exponents[((-1 << bsize)) >> esize];
704 for (i = 0; i <
n; i++) {
713 for (i = 0; i <
n; i++)
714 *coefs++ = coefs1[i] * exponents[i << bsize >> esize] * mult;
716 for (i = 0; i <
n; i++)
794 memcpy(samples[ch] + samples_offset, s->
frame_out[ch],
801 dump_floats(s,
"samples", 6, samples[ch] + samples_offset,
810 int *got_frame_ptr,
AVPacket *avpkt)
814 int buf_size = avpkt->
size;
816 int nb_frames, bit_offset, i, pos,
len,
ret;
821 tprintf(avctx,
"***decode_superframe:\n");
827 if (buf_size < avctx->block_align) {
829 "Input packet size too small (%d < %d)\n",
842 if (nb_frames <= 0) {
860 "Invalid last frame bit offset %d > buf size %d (%d)\n",
904 for (i = 0; i < nb_frames; i++) {
915 len = buf_size - pos;
931 (int8_t *) samples - (int8_t *) data, avctx->
block_align);
951 #if CONFIG_WMAV1_DECODER
967 #if CONFIG_WMAV2_DECODER