[Ffmpeg-devel] [PATCH] h264 optimization: common case hl_decode_mb

Alexander Strange astrange
Fri Feb 23 22:41:19 CET 2007


On Feb 23, 2007, at 6:25 AM, Michael Niedermayer wrote:

> ok, first, tabs are forbidden in svn
> second, could you try something like:
>
> static always_inline hl_decode_mb_internal(H264Context *h, int  
> complex){
>     ...
>     if(complex){
>         interlacing and other complex code
>     }
>     ...
>     if( ...
>     ...
> }
>
> static hl_decode_mb_simple(H264Context *h){
>     hl_decode_mb_internal(h, 0);
> }
>
> static hl_decode_mb_complex(H264Context *h){
>     hl_decode_mb_internal(h, 1);
> }
>
> that prevents code duplication (which is definitly bad for the  
> already pretty
> large h264.c)

I went with this method; the code generated is just about the same as  
the first patch.

It lets us skip some other branches (h264 vs. svq3 idct, chroma)  
which are under the function call overhead, so I think it's better  
even if it does increase the total binary size a little.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-hldecodemb-simple-2.diff
Type: application/octet-stream
Size: 7141 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070223/6a2a75e0/attachment.obj>
-------------- next part --------------




More information about the ffmpeg-devel mailing list