[FFmpeg-devel] [PATCH] AAC decoder round 8
Robert Swain
robert.swain
Mon Aug 18 00:10:11 CEST 2008
2008/8/15 Michael Niedermayer <michaelni at gmx.at>:
> On Fri, Aug 15, 2008 at 04:12:48PM +0100, Robert Swain wrote:
> [...]
>> >> + const int is8 = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE;
>> >> + const int tns_max_order = is8 ? 7 : ac->m4ac.object_type == AOT_AAC_MAIN ? 20 : 12;
>> >> + for (w = 0; w < ics->num_windows; w++) {
>> >> + tns->n_filt[w] = get_bits(gb, 2 - is8);
>> >> +
>> >> + if (tns->n_filt[w])
>> >> + coef_res = get_bits1(gb) + 3;
>> >> +
>> >> + for (filt = 0; filt < tns->n_filt[w]; filt++) {
>> >> + tns->length[w][filt] = get_bits(gb, 6 - 2*is8);
>> >> +
>> >
>> >> + if ((tns->order[w][filt] = get_bits(gb, 5 - 2*is8)) <= tns_max_order) {
>> >> + tns->direction[w][filt] = get_bits1(gb);
>> >> + coef_compress = get_bits1(gb);
>> >> + coef_len = coef_res - coef_compress;
>> >> + tns->tmp2_map[w][filt] = tns_tmp2_map[2*coef_compress + coef_res - 3];
>> >
>> > the 3 can be moved to "coef_len = coef_res - coef_compress + 3"
>>
>> But, unless I'm missing something, that will change the behaviour of
>> the code as more bits will be read in the loop you quoted just below.
>
> hmmm, removing the + 3 from "coef_res = get_bits1(gb) + 3;" and adding 3
> to all uses of coef_res should be fine.
Ah, I see. Done.
Rob
More information about the ffmpeg-devel
mailing list