45 #define EXPMAX ((19+EXPVLCBITS-1)/EXPVLCBITS)
47 #define HGAINVLCBITS 9
48 #define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
98 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++)
187 float *
out,
float *val_max_ptr,
191 float p, q, w,
v, val_max;
210 *val_max_ptr = val_max;
222 if (i == 0 || i >= 8)
235 1.7782794100389e-04, 2.0535250264571e-04,
236 2.3713737056617e-04, 2.7384196342644e-04,
237 3.1622776601684e-04, 3.6517412725484e-04,
238 4.2169650342858e-04, 4.8696752516586e-04,
239 5.6234132519035e-04, 6.4938163157621e-04,
240 7.4989420933246e-04, 8.6596432336006e-04,
241 1.0000000000000e-03, 1.1547819846895e-03,
242 1.3335214321633e-03, 1.5399265260595e-03,
243 1.7782794100389e-03, 2.0535250264571e-03,
244 2.3713737056617e-03, 2.7384196342644e-03,
245 3.1622776601684e-03, 3.6517412725484e-03,
246 4.2169650342858e-03, 4.8696752516586e-03,
247 5.6234132519035e-03, 6.4938163157621e-03,
248 7.4989420933246e-03, 8.6596432336006e-03,
249 1.0000000000000e-02, 1.1547819846895e-02,
250 1.3335214321633e-02, 1.5399265260595e-02,
251 1.7782794100389e-02, 2.0535250264571e-02,
252 2.3713737056617e-02, 2.7384196342644e-02,
253 3.1622776601684e-02, 3.6517412725484e-02,
254 4.2169650342858e-02, 4.8696752516586e-02,
255 5.6234132519035e-02, 6.4938163157621e-02,
256 7.4989420933246e-02, 8.6596432336007e-02,
257 1.0000000000000e-01, 1.1547819846895e-01,
258 1.3335214321633e-01, 1.5399265260595e-01,
259 1.7782794100389e-01, 2.0535250264571e-01,
260 2.3713737056617e-01, 2.7384196342644e-01,
261 3.1622776601684e-01, 3.6517412725484e-01,
262 4.2169650342858e-01, 4.8696752516586e-01,
263 5.6234132519035e-01, 6.4938163157621e-01,
264 7.4989420933246e-01, 8.6596432336007e-01,
265 1.0000000000000e+00, 1.1547819846895e+00,
266 1.3335214321633e+00, 1.5399265260595e+00,
267 1.7782794100389e+00, 2.0535250264571e+00,
268 2.3713737056617e+00, 2.7384196342644e+00,
269 3.1622776601684e+00, 3.6517412725484e+00,
270 4.2169650342858e+00, 4.8696752516586e+00,
271 5.6234132519035e+00, 6.4938163157621e+00,
272 7.4989420933246e+00, 8.6596432336007e+00,
273 1.0000000000000e+01, 1.1547819846895e+01,
274 1.3335214321633e+01, 1.5399265260595e+01,
275 1.7782794100389e+01, 2.0535250264571e+01,
276 2.3713737056617e+01, 2.7384196342644e+01,
277 3.1622776601684e+01, 3.6517412725484e+01,
278 4.2169650342858e+01, 4.8696752516586e+01,
279 5.6234132519035e+01, 6.4938163157621e+01,
280 7.4989420933246e+01, 8.6596432336007e+01,
281 1.0000000000000e+02, 1.1547819846895e+02,
282 1.3335214321633e+02, 1.5399265260595e+02,
283 1.7782794100389e+02, 2.0535250264571e+02,
284 2.3713737056617e+02, 2.7384196342644e+02,
285 3.1622776601684e+02, 3.6517412725484e+02,
286 4.2169650342858e+02, 4.8696752516586e+02,
287 5.6234132519035e+02, 6.4938163157621e+02,
288 7.4989420933246e+02, 8.6596432336007e+02,
289 1.0000000000000e+03, 1.1547819846895e+03,
290 1.3335214321633e+03, 1.5399265260595e+03,
291 1.7782794100389e+03, 2.0535250264571e+03,
292 2.3713737056617e+03, 2.7384196342644e+03,
293 3.1622776601684e+03, 3.6517412725484e+03,
294 4.2169650342858e+03, 4.8696752516586e+03,
295 5.6234132519035e+03, 6.4938163157621e+03,
296 7.4989420933246e+03, 8.6596432336007e+03,
297 1.0000000000000e+04, 1.1547819846895e+04,
298 1.3335214321633e+04, 1.5399265260595e+04,
299 1.7782794100389e+04, 2.0535250264571e+04,
300 2.3713737056617e+04, 2.7384196342644e+04,
301 3.1622776601684e+04, 3.6517412725484e+04,
302 4.2169650342858e+04, 4.8696752516586e+04,
303 5.6234132519035e+04, 6.4938163157621e+04,
304 7.4989420933246e+04, 8.6596432336007e+04,
305 1.0000000000000e+05, 1.1547819846895e+05,
306 1.3335214321633e+05, 1.5399265260595e+05,
307 1.7782794100389e+05, 2.0535250264571e+05,
308 2.3713737056617e+05, 2.7384196342644e+05,
309 3.1622776601684e+05, 3.6517412725484e+05,
310 4.2169650342858e+05, 4.8696752516586e+05,
311 5.6234132519035e+05, 6.4938163157621e+05,
312 7.4989420933246e+05, 8.6596432336007e+05,
320 int last_exp,
n, code;
323 uint32_t *q, *q_end, iv;
324 const float *ptab = pow_tab + 60;
325 const uint32_t *iptab = (
const uint32_t*)ptab;
334 iv = iptab[last_exp];
342 }
while ((n -= 4) > 0);
353 last_exp += code - 60;
360 iv = iptab[last_exp];
369 }
while ((n -= 4) > 0);
385 int block_len, bsize,
n;
403 memcpy(out+n+block_len, in+n+block_len, n*
sizeof(
float));
421 memcpy(out, in, n*
sizeof(
float));
425 memset(out+n+block_len, 0, n*
sizeof(
float));
436 int n,
v,
a, ch, bsize;
437 int coef_nb_bits, total_gain;
553 val = (int)0x80000000;
556 if (val == (
int)0x80000000) {
601 0, ptr, 0, nb_coefs[ch],
612 mdct_norm = 1.0 / (float)n4;
614 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;
653 for(i = 0;i <
n; i++) {
654 v = exponents[i<<bsize>>esize];
657 exp_power[j] = e2 /
n;
659 tprintf(s->
avctx,
"%d: power=%f (%d)\n", j, exp_power[j], n);
661 exponents += n<<bsize>>esize;
676 mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
681 for(i = 0;i <
n; i++) {
685 exponents[i<<bsize>>esize] * mult1;
687 exponents += n<<bsize>>esize;
690 for(i = 0;i <
n; i++) {
693 *coefs++ = ((*coefs1++) + noise) *
694 exponents[i<<bsize>>esize] *
mult;
696 exponents += n<<bsize>>esize;
702 mult1 = mult * exponents[((-1<<bsize))>>esize];
703 for(i = 0; i <
n; i++) {
712 for(i = 0;i <
n; i++) {
713 *coefs++ = coefs1[i] * exponents[i<<bsize>>esize] *
mult;
716 for(i = 0;i <
n; i++)
793 memcpy(samples[ch] + samples_offset, s->
frame_out[ch],
800 dump_floats(s,
"samples", 6, samples[ch] + samples_offset, s->
frame_len);
808 int *got_frame_ptr,
AVPacket *avpkt)
812 int buf_size = avpkt->
size;
814 int nb_frames, bit_offset, i, pos,
len,
ret;
819 tprintf(avctx,
"***decode_superframe:\n");
825 if (buf_size < avctx->block_align) {
827 "Input packet size too small (%d < %d)\n",
840 if (nb_frames <= 0) {
859 "Invalid last frame bit offset %d > buf size %d (%d)\n",
903 for(i=0;i<nb_frames;i++) {
913 len = buf_size - pos;
927 av_dlog(s->
avctx,
"%d %d %d %d outbytes:%td eaten:%d\n",
929 (int8_t *)samples - (int8_t *)data, avctx->
block_align);
948 #if CONFIG_WMAV1_DECODER
964 #if CONFIG_WMAV2_DECODER