comparison wmadec.c @ 9868:5cc32c474caf libavcodec

Introduce WMACoef typedef for decoded coefficients and change default type to float so that the run level decoding functionality can be shared with wmapro
author faust3
date Sat, 20 Jun 2009 09:05:28 +0000
parents eb5916527064
children 0e9a50fbed9f
comparison
equal deleted inserted replaced
9867:4ccec8d051fa 9868:5cc32c474caf
484 484
485 /* parse spectral coefficients : just RLE encoding */ 485 /* parse spectral coefficients : just RLE encoding */
486 for(ch = 0; ch < s->nb_channels; ch++) { 486 for(ch = 0; ch < s->nb_channels; ch++) {
487 if (s->channel_coded[ch]) { 487 if (s->channel_coded[ch]) {
488 int tindex; 488 int tindex;
489 int16_t* ptr = &s->coefs1[ch][0]; 489 WMACoef* ptr = &s->coefs1[ch][0];
490 490
491 /* special VLC tables are used for ms stereo because 491 /* special VLC tables are used for ms stereo because
492 there is potentially less energy there */ 492 there is potentially less energy there */
493 tindex = (ch == 1 && s->ms_stereo); 493 tindex = (ch == 1 && s->ms_stereo);
494 memset(ptr, 0, s->block_len * sizeof(int16_t)); 494 memset(ptr, 0, s->block_len * sizeof(WMACoef));
495 ff_wma_run_level_decode(s->avctx, &s->gb, &s->coef_vlc[tindex], 495 ff_wma_run_level_decode(s->avctx, &s->gb, &s->coef_vlc[tindex],
496 s->level_table[tindex], s->run_table[tindex], 496 s->level_table[tindex], s->run_table[tindex],
497 0, ptr, 0, nb_coefs[ch], 497 0, ptr, 0, nb_coefs[ch],
498 s->block_len, s->frame_len_bits, coef_nb_bits); 498 s->block_len, s->frame_len_bits, coef_nb_bits);
499 } 499 }
512 } 512 }
513 513
514 /* finally compute the MDCT coefficients */ 514 /* finally compute the MDCT coefficients */
515 for(ch = 0; ch < s->nb_channels; ch++) { 515 for(ch = 0; ch < s->nb_channels; ch++) {
516 if (s->channel_coded[ch]) { 516 if (s->channel_coded[ch]) {
517 int16_t *coefs1; 517 WMACoef *coefs1;
518 float *coefs, *exponents, mult, mult1, noise; 518 float *coefs, *exponents, mult, mult1, noise;
519 int i, j, n, n1, last_high_band, esize; 519 int i, j, n, n1, last_high_band, esize;
520 float exp_power[HIGH_BAND_MAX_SIZE]; 520 float exp_power[HIGH_BAND_MAX_SIZE];
521 521
522 coefs1 = s->coefs1[ch]; 522 coefs1 = s->coefs1[ch];