44 #define EXPMAX ((19+EXPVLCBITS-1)/EXPVLCBITS)
46 #define HGAINVLCBITS 9
47 #define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
92 av_log(avctx,
AV_LOG_WARNING,
"Disabling use_variable_block_len, if this fails contact the ffmpeg developers and send us the file\n");
142 t.v = ((
u.v <<
LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23);
153 wdel =
M_PI / frame_len;
154 for(i=0;i<frame_len;i++)
181 float *
out,
float *val_max_ptr,
185 float p, q, w,
v, val_max;
204 *val_max_ptr = val_max;
216 if (i == 0 || i >= 8)
229 1.7782794100389e-04, 2.0535250264571e-04,
230 2.3713737056617e-04, 2.7384196342644e-04,
231 3.1622776601684e-04, 3.6517412725484e-04,
232 4.2169650342858e-04, 4.8696752516586e-04,
233 5.6234132519035e-04, 6.4938163157621e-04,
234 7.4989420933246e-04, 8.6596432336006e-04,
235 1.0000000000000e-03, 1.1547819846895e-03,
236 1.3335214321633e-03, 1.5399265260595e-03,
237 1.7782794100389e-03, 2.0535250264571e-03,
238 2.3713737056617e-03, 2.7384196342644e-03,
239 3.1622776601684e-03, 3.6517412725484e-03,
240 4.2169650342858e-03, 4.8696752516586e-03,
241 5.6234132519035e-03, 6.4938163157621e-03,
242 7.4989420933246e-03, 8.6596432336006e-03,
243 1.0000000000000e-02, 1.1547819846895e-02,
244 1.3335214321633e-02, 1.5399265260595e-02,
245 1.7782794100389e-02, 2.0535250264571e-02,
246 2.3713737056617e-02, 2.7384196342644e-02,
247 3.1622776601684e-02, 3.6517412725484e-02,
248 4.2169650342858e-02, 4.8696752516586e-02,
249 5.6234132519035e-02, 6.4938163157621e-02,
250 7.4989420933246e-02, 8.6596432336007e-02,
251 1.0000000000000e-01, 1.1547819846895e-01,
252 1.3335214321633e-01, 1.5399265260595e-01,
253 1.7782794100389e-01, 2.0535250264571e-01,
254 2.3713737056617e-01, 2.7384196342644e-01,
255 3.1622776601684e-01, 3.6517412725484e-01,
256 4.2169650342858e-01, 4.8696752516586e-01,
257 5.6234132519035e-01, 6.4938163157621e-01,
258 7.4989420933246e-01, 8.6596432336007e-01,
259 1.0000000000000e+00, 1.1547819846895e+00,
260 1.3335214321633e+00, 1.5399265260595e+00,
261 1.7782794100389e+00, 2.0535250264571e+00,
262 2.3713737056617e+00, 2.7384196342644e+00,
263 3.1622776601684e+00, 3.6517412725484e+00,
264 4.2169650342858e+00, 4.8696752516586e+00,
265 5.6234132519035e+00, 6.4938163157621e+00,
266 7.4989420933246e+00, 8.6596432336007e+00,
267 1.0000000000000e+01, 1.1547819846895e+01,
268 1.3335214321633e+01, 1.5399265260595e+01,
269 1.7782794100389e+01, 2.0535250264571e+01,
270 2.3713737056617e+01, 2.7384196342644e+01,
271 3.1622776601684e+01, 3.6517412725484e+01,
272 4.2169650342858e+01, 4.8696752516586e+01,
273 5.6234132519035e+01, 6.4938163157621e+01,
274 7.4989420933246e+01, 8.6596432336007e+01,
275 1.0000000000000e+02, 1.1547819846895e+02,
276 1.3335214321633e+02, 1.5399265260595e+02,
277 1.7782794100389e+02, 2.0535250264571e+02,
278 2.3713737056617e+02, 2.7384196342644e+02,
279 3.1622776601684e+02, 3.6517412725484e+02,
280 4.2169650342858e+02, 4.8696752516586e+02,
281 5.6234132519035e+02, 6.4938163157621e+02,
282 7.4989420933246e+02, 8.6596432336007e+02,
283 1.0000000000000e+03, 1.1547819846895e+03,
284 1.3335214321633e+03, 1.5399265260595e+03,
285 1.7782794100389e+03, 2.0535250264571e+03,
286 2.3713737056617e+03, 2.7384196342644e+03,
287 3.1622776601684e+03, 3.6517412725484e+03,
288 4.2169650342858e+03, 4.8696752516586e+03,
289 5.6234132519035e+03, 6.4938163157621e+03,
290 7.4989420933246e+03, 8.6596432336007e+03,
291 1.0000000000000e+04, 1.1547819846895e+04,
292 1.3335214321633e+04, 1.5399265260595e+04,
293 1.7782794100389e+04, 2.0535250264571e+04,
294 2.3713737056617e+04, 2.7384196342644e+04,
295 3.1622776601684e+04, 3.6517412725484e+04,
296 4.2169650342858e+04, 4.8696752516586e+04,
297 5.6234132519035e+04, 6.4938163157621e+04,
298 7.4989420933246e+04, 8.6596432336007e+04,
299 1.0000000000000e+05, 1.1547819846895e+05,
300 1.3335214321633e+05, 1.5399265260595e+05,
301 1.7782794100389e+05, 2.0535250264571e+05,
302 2.3713737056617e+05, 2.7384196342644e+05,
303 3.1622776601684e+05, 3.6517412725484e+05,
304 4.2169650342858e+05, 4.8696752516586e+05,
305 5.6234132519035e+05, 6.4938163157621e+05,
306 7.4989420933246e+05, 8.6596432336007e+05,
314 int last_exp, n, code;
317 uint32_t *q, *q_end, iv;
318 const float *ptab = pow_tab + 60;
319 const uint32_t *iptab = (
const uint32_t*)ptab;
328 iv = iptab[last_exp];
336 }
while ((n -= 4) > 0);
347 last_exp += code - 60;
354 iv = iptab[last_exp];
363 }
while ((n -= 4) > 0);
379 int block_len, bsize, n;
397 memcpy(out+n+block_len, in+n+block_len, n*
sizeof(
float));
415 memcpy(out, in, n*
sizeof(
float));
419 memset(out+n+block_len, 0, n*
sizeof(
float));
430 int n,
v,
a, ch, bsize;
431 int coef_nb_bits, total_gain;
543 val = (int)0x80000000;
546 if (val == (
int)0x80000000) {
591 0, ptr, 0, nb_coefs[ch],
602 mdct_norm = 1.0 / (float)n4;
604 mdct_norm *= sqrt(n4);
612 float *coefs, *exponents,
mult, mult1,
noise;
613 int i, j, n, n1, last_high_band, esize;
619 mult = pow(10, total_gain * 0.05) / s->
max_exponent[ch];
621 coefs = s->
coefs[ch];
627 exponents[i<<bsize>>esize] * mult1;
643 for(i = 0;i < n; i++) {
644 v = exponents[i<<bsize>>esize];
647 exp_power[j] = e2 / n;
649 tprintf(s->
avctx,
"%d: power=%f (%d)\n", j, exp_power[j], n);
651 exponents += n<<bsize>>esize;
666 mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
671 for(i = 0;i < n; i++) {
675 exponents[i<<bsize>>esize] * mult1;
677 exponents += n<<bsize>>esize;
680 for(i = 0;i < n; i++) {
683 *coefs++ = ((*coefs1++) + noise) *
684 exponents[i<<bsize>>esize] *
mult;
686 exponents += n<<bsize>>esize;
692 mult1 = mult * exponents[((-1<<bsize))>>esize];
693 for(i = 0; i < n; i++) {
702 for(i = 0;i < n; i++) {
703 *coefs++ = coefs1[i] * exponents[i<<bsize>>esize] *
mult;
706 for(i = 0;i < n; i++)
783 memcpy(samples[ch] + samples_offset, s->
frame_out[ch],
790 dump_floats(s,
"samples", 6, samples[ch] + samples_offset, s->
frame_len);
798 int *got_frame_ptr,
AVPacket *avpkt)
802 int buf_size = avpkt->
size;
804 int nb_frames, bit_offset, i, pos,
len, ret;
809 tprintf(avctx,
"***decode_superframe:\n");
815 if (buf_size < avctx->block_align) {
817 "Input packet size too small (%d < %d)\n",
830 if (nb_frames <= 0) {
851 "Invalid last frame bit offset %d > buf size %d (%d)\n",
895 for(i=0;i<nb_frames;i++) {
905 len = buf_size - pos;
919 av_dlog(s->
avctx,
"%d %d %d %d outbytes:%td eaten:%d\n",
921 (int8_t *)samples - (int8_t *)data, avctx->
block_align);
940 #if CONFIG_WMAV1_DECODER
956 #if CONFIG_WMAV2_DECODER