comparison aacenc.c @ 11706:15e7486e5c7a libavcodec

Set cur_channel in the AAC encoder context where needed. Most coder functions read it. Carting this around in the context may be suboptimal; a refactor should be considered.
author alexc
date Tue, 11 May 2010 18:53:49 +0000
parents 855ec3d8a62b
children 907ac02ef561
comparison
equal deleted inserted replaced
11705:a66b535972b7 11706:15e7486e5c7a
559 FFPsyWindowInfo* wi = windows + start_ch; 559 FFPsyWindowInfo* wi = windows + start_ch;
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->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda); 565 s->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda);
565 } 566 }
566 cpe->common_window = 0; 567 cpe->common_window = 0;
567 if (chans > 1 568 if (chans > 1
568 && wi[0].window_type[0] == wi[1].window_type[0] 569 && wi[0].window_type[0] == wi[1].window_type[0]
574 cpe->common_window = 0; 575 cpe->common_window = 0;
575 break; 576 break;
576 } 577 }
577 } 578 }
578 } 579 }
580 s->cur_channel = start_ch;
579 if (cpe->common_window && s->coder->search_for_ms) 581 if (cpe->common_window && s->coder->search_for_ms)
580 s->coder->search_for_ms(s, cpe, s->lambda); 582 s->coder->search_for_ms(s, cpe, s->lambda);
581 adjust_frame_information(s, cpe, chans); 583 adjust_frame_information(s, cpe, chans);
582 put_bits(&s->pb, 3, tag); 584 put_bits(&s->pb, 3, tag);
583 put_bits(&s->pb, 4, chan_el_counter[tag]++); 585 put_bits(&s->pb, 4, chan_el_counter[tag]++);