comparison aacenc.c @ 11728:907ac02ef561 libavcodec

aacenc: Fix psy logic. Set band info before determining scalefactors. Use the look ahead for windowing decision.
author alexc
date Fri, 14 May 2010 16:49:11 +0000
parents 15e7486e5c7a
children 6598cef880fc
comparison
equal deleted inserted replaced
11727:0c98bdb71f48 11728:907ac02ef561
560 tag = chan_map[i+1]; 560 tag = chan_map[i+1];
561 chans = tag == TYPE_CPE ? 2 : 1; 561 chans = tag == TYPE_CPE ? 2 : 1;
562 cpe = &s->cpe[i]; 562 cpe = &s->cpe[i];
563 for (j = 0; j < chans; j++) { 563 for (j = 0; j < chans; j++) {
564 s->cur_channel = start_ch + j; 564 s->cur_channel = start_ch + j;
565 ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[j]);
565 s->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda); 566 s->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda);
566 } 567 }
567 cpe->common_window = 0; 568 cpe->common_window = 0;
568 if (chans > 1 569 if (chans > 1
569 && wi[0].window_type[0] == wi[1].window_type[0] 570 && wi[0].window_type[0] == wi[1].window_type[0]
590 encode_ms_info(&s->pb, cpe); 591 encode_ms_info(&s->pb, cpe);
591 } 592 }
592 } 593 }
593 for (j = 0; j < chans; j++) { 594 for (j = 0; j < chans; j++) {
594 s->cur_channel = start_ch + j; 595 s->cur_channel = start_ch + j;
595 ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[j]);
596 encode_individual_channel(avctx, s, &cpe->ch[j], cpe->common_window); 596 encode_individual_channel(avctx, s, &cpe->ch[j], cpe->common_window);
597 } 597 }
598 start_ch += chans; 598 start_ch += chans;
599 } 599 }
600 600