[FFmpeg-cvslog] r23322 - trunk/libavcodec/aaccoder.c

Alex Converse alex.converse
Wed May 26 01:43:15 CEST 2010


2010/5/25 M?ns Rullg?rd <mans at mansr.com>:
> Alex Converse <alex.converse at gmail.com> writes:
>
>> 2010/5/25 M?ns Rullg?rd <mans at mansr.com>:
>>> Alex Converse <alex.converse at gmail.com> writes:
>>>
>>>> On Tue, May 25, 2010 at 7:12 PM, Aurelien Jacobs <aurel at gnuage.org> wrote:
>>>>> On Tue, May 25, 2010 at 08:35:02PM +0200, alexc wrote:
>>>>>> Author: alexc
>>>>>> Date: Tue May 25 20:35:01 2010
>>>>>> New Revision: 23322
>>>>>>
>>>>>> Log:
>>>>>> aacenc: Split find_max_val() from find_min_book() to eliminate duplicate searches.
>>>>>>
>>>>>> [...]
>>>>>>
>>>>>> @@ -567,9 +572,10 @@ static void search_for_quantizers_anmr(A
>>>>>> ? ? ? ? ? ? ? ? ?maxscale = av_clip_uint8(log2(qmax)*4 + ?6 + SCALE_ONE_POS - SCALE_DIV_512);
>>>>>> ? ? ? ? ? ? ? ? ?minscale = av_clip(minscale - q0, 0, TRELLIS_STATES - 1);
>>>>>> ? ? ? ? ? ? ? ? ?maxscale = av_clip(maxscale - q0, 0, TRELLIS_STATES);
>>>>>> + ? ? ? ? ? ? ? ?float maxval = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], s->scoefs+start);
>>>>>
>>>>> Mixed declaration and code...
>>>>>
>>>>
>>>> Fixed.
>>>>
>>>> Why is this considered bad?
>>>
>>> I personally consider it bad style. ?Practically, there are a number
>>> of compiler that choke on it but otherwise work decently.
>>
>> Practically it's not that hard to extend your compiler to support it.
>
> Have you ever tried hacking compilers? ?Closed-source ones?
>

Yes. I've hacked some closed derivatives of suif.

> Making it good style is of course much harder...
>

Putting the declaration closer to where the code is actually used
seems much more readable to me.



More information about the ffmpeg-cvslog mailing list