44 #define EXPMAX ((19+EXPVLCBITS-1)/EXPVLCBITS)
46 #define HGAINVLCBITS 9
47 #define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
97 av_log(avctx,
AV_LOG_WARNING,
"Disabling use_variable_block_len, if this fails contact the ffmpeg developers and send us the file\n");
150 t.v = ((u.v <<
LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23);
161 wdel =
M_PI / frame_len;
162 for(i=0;i<frame_len;i++)
189 float *out,
float *val_max_ptr,
193 float p, q, w, v, val_max;
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);
387 int block_len, bsize, n;
405 memcpy(out+n+block_len, in+n+block_len, n*
sizeof(
float));
423 memcpy(out, in, n*
sizeof(
float));
427 memset(out+n+block_len, 0, n*
sizeof(
float));
438 int n, v,
a, ch, bsize;
439 int coef_nb_bits, total_gain;
551 val = (int)0x80000000;
554 if (val == (
int)0x80000000) {
599 0, ptr, 0, nb_coefs[ch],
610 mdct_norm = 1.0 / (float)n4;
612 mdct_norm *= sqrt(n4);
620 float *coefs, *exponents,
mult, mult1,
noise;
621 int i, j, n, n1, last_high_band, esize;
627 mult = pow(10, total_gain * 0.05) / s->
max_exponent[ch];
629 coefs = s->
coefs[ch];
635 exponents[i<<bsize>>esize] * mult1;
651 for(i = 0;i < n; i++) {
652 v = exponents[i<<bsize>>esize];
655 exp_power[j] = e2 / n;
657 tprintf(s->
avctx,
"%d: power=%f (%d)\n", j, exp_power[j], n);
659 exponents += n<<bsize>>esize;
674 mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
679 for(i = 0;i < n; i++) {
683 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;
714 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, s->
frame_len);
806 int *got_frame_ptr,
AVPacket *avpkt)
809 int buf_size = avpkt->
size;
811 int nb_frames, bit_offset, i, pos,
len, ret;
816 tprintf(avctx,
"***decode_superframe:\n");
822 if (buf_size < avctx->block_align) {
824 "Input packet size too small (%d < %d)\n",
854 "Invalid last frame bit offset %d > buf size %d (%d)\n",
898 for(i=0;i<nb_frames;i++) {
908 len = buf_size - pos;
922 av_dlog(s->
avctx,
"%d %d %d %d outbytes:%td eaten:%d\n",
924 (int8_t *)samples - (int8_t *)data, avctx->
block_align);
944 #if CONFIG_WMAV1_DECODER
960 #if CONFIG_WMAV2_DECODER