comparison ac3enc.c @ 4705:84a455e801c0 libavcodec

simplify
author jbr
date Thu, 22 Mar 2007 05:38:00 +0000
parents 0cb02a723a62
children 1d8b06947276
comparison
equal deleted inserted replaced
4704:0cb02a723a62 4705:84a455e801c0
465 int16_t psd[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], 465 int16_t psd[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
466 uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], 466 uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
467 int frame_bits, int csnroffst, int fsnroffst) 467 int frame_bits, int csnroffst, int fsnroffst)
468 { 468 {
469 int i, ch; 469 int i, ch;
470 int snroffset;
471
472 snroffset = (((csnroffst - 15) << 4) + fsnroffst) << 2;
470 473
471 /* compute size */ 474 /* compute size */
472 for(i=0;i<NB_BLOCKS;i++) { 475 for(i=0;i<NB_BLOCKS;i++) {
473 s->mant1_cnt = 0; 476 s->mant1_cnt = 0;
474 s->mant2_cnt = 0; 477 s->mant2_cnt = 0;
475 s->mant4_cnt = 0; 478 s->mant4_cnt = 0;
476 for(ch=0;ch<s->nb_all_channels;ch++) { 479 for(ch=0;ch<s->nb_all_channels;ch++) {
477 ff_ac3_bit_alloc_calc_bap(mask[i][ch], psd[i][ch], 480 ff_ac3_bit_alloc_calc_bap(mask[i][ch], psd[i][ch],
478 0, s->nb_coefs[ch], 481 0, s->nb_coefs[ch],
479 (((csnroffst-15) << 4) + 482 snroffset,
480 fsnroffst) << 2,
481 s->bit_alloc.floor, bap[i][ch]); 483 s->bit_alloc.floor, bap[i][ch]);
482 frame_bits += compute_mantissa_size(s, bap[i][ch], 484 frame_bits += compute_mantissa_size(s, bap[i][ch],
483 s->nb_coefs[ch]); 485 s->nb_coefs[ch]);
484 } 486 }
485 } 487 }