[FFmpeg-devel] [PATCH] IFF: Add error checking to byterun1 decoder

Sebastian Vater cdgs.basty
Mon May 24 16:15:39 CEST 2010


Ronald S. Bultje a ?crit :
> Hi,
>
> On Mon, May 24, 2010 at 9:51 AM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>   
>> This makes the code larger and slower actually (I tried this out when
>> you told me that for the first time), because there are three checks to
>> be done:
>> 0 <= value < 128
>> 128 <= value < 255
>> value == 255
>>
>> Making it unsigned I have to do sth. like:
>> if (value < 128) {
>> } else if (value < 255) {
>> } else {
>> }
>>
>> This is slower than just:
>> if (value >= 0) { // No extra cmp instruction required, it just uses the
>> flag setting of the movzbl (%esi),al to test if it's >= 0
>> } else if (value != -128) {
>> } else {
>> }
>>     
>
> You're over-optimizing stuff that isn't really all that important, imo...
>   

Oh, this optimization was not done by me, it was in the original
byterun1 decoder as well...changing this as you suggested would just
cause extra work for less speed/size, that's more ridiculous than the
other way around, right? ;)

-- 

Best regards,
                   :-) Basty/CDGS (-:




More information about the ffmpeg-devel mailing list