[FFmpeg-devel] [PATCH] Use clear_blocks instead of memset in vp3.c

Baptiste Coudurier baptiste.coudurier
Sun Aug 31 02:18:57 CEST 2008


Michael Niedermayer wrote:
> On Sat, Aug 30, 2008 at 03:00:00PM -0700, Baptiste Coudurier wrote:
>> Hi,
>> David Conrad wrote:
>>> On Aug 30, 2008, at 3:05 PM, David Conrad wrote:
>>>> Hi,
>>>> This uses the dsp clear_blocks() function to zero blocks in vp3  
>>>> rather than memset.
>>> Sorry, ignore this, I didn't realize clear_blocks was plural (yes I  
>>> should test patches before sending them...)
>> However, a version of clear_blocks that would take number of blocks to
>> clear is welcome, I know several places where it would be useful.
> yes though it may not be as usefull as it seems
> clearing 64 16bit words with mmx needs just
> 16 instructions, 
> the loop will add about 3
> then there is call overhead, returning pushing parameters on the stack
> getting them off the stack againm the dsp pointer and soon clearing a
> single block will spend most of its time in things completely unrelated to the
> actual clearing.
> Now if this is compared to plain C clearing with int32 or int64 writes
> but inlined or memset that is generated by a sane compiler, the clear_1block
> code may suddenly not be that much better anymore ...

I see, I remember than when decoding 4:2:2 (8 blocks), calling
clear_blocks[0]  + clear_blocks[2] overlapped, was faster than
clear_blocks[0] + memset ...

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA

More information about the ffmpeg-devel mailing list