[FFmpeg-devel] [PATCH] Optimization of original IFF codec

Sebastian Vater cdgs.basty
Mon Apr 26 20:10:57 CEST 2010


Sebastian Vater a ?crit :
> Hi Mans!
>
> M?ns Rullg?rd a ?crit :
>   
>> Sebastian Vater <cdgs.basty at googlemail.com> writes:
>>
>>   
>>     
>>> Hi Mans!
>>>
>>> M?ns Rullg?rd a ?crit :
>>>     
>>>       
>>>> This is inefficient.  You are building the table afresh on each call
>>>> to the function.  Make the table static const, dropping the shift, and
>>>> instead shift the table value inside the loop.
>>>>   
>>>>       
>>>>         
>>> I just benchmarked both, my solution is way faster:
>>>     
>>>       
>> I don't believe that, simply because it has more work to do.  How did
>> you benchmark it?
>>   
>>     
> Why? The init is done only once per call, but moving the bit-shift in
> the inner-loop will shift every inner-loop iteration.
>
>   
I also took a look on disassembly output...the shift out-side the loop
for lut init is only done once, gcc optimizes that and just puts the
precalculated shift-result into the correct positions.

-- 

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





More information about the ffmpeg-devel mailing list