[FFmpeg-devel] [PATCH] More H.264 decoding speed tweaks

Michael Niedermayer michaelni
Sat Jun 21 03:10:21 CEST 2008


On Fri, Jun 20, 2008 at 06:27:48PM -0600, Jason Garrett-Glaser wrote:
> Mostly write-combining/similar, along with removal of "dc_add" from
> the main decoding loop.

split it please, these are 2 seperate changes


>  Justification for this: in all my tests the
> cost of the extra memory load, comparison, and relatively
> unpredictable branch exceeded the savings from using dc_add.  I
> suspect others may want to run some START_TIMER/STOP_TIMER benchmarks
> on this just to make sure its true for other processors too, and it
> isn't just something bizarre about my machine or input test files.

As you say you did test, please post your results and cpu type and compiler
ver.

If you tested on x86-64 i like to see the uint64_t changes tested on a x86-32,
i will do that myself if noone else does. If you did test on x86-32 already
then that half of the patch should be ok.

The other half partially reverts
    r4971 | lorenm | 2006-02-10 07:55:25 +0100 (Fri, 10 Feb 2006) | 2 lines

    h264: special case dc-only idct. ~1% faster overall

Before i approve that i like to understand better what part of what patch
improved speed for whom. r4971 did changes unrelated to dc-only idct its
possible they where behind the speed improvents, this needs to be checked.
And possibly your patch could be simplified by looking at
r4971->r4970


[...]
> +    if(transform_bypass)
>          idct_add = IS_8x8DCT(mb_type) ? s->dsp.add_pixels8 : s->dsp.add_pixels4;
> -    }else if(IS_8x8DCT(mb_type)){
> -        idct_dc_add = s->dsp.h264_idct8_dc_add;
> +    else if(IS_8x8DCT(mb_type))

please keep the {}  i prefer {} between if /else as they dont eat a line but
make possible future patches clearer
if(){
    a
+   b
}else ...

vs.

+if(){
-if()
    a
+   b
+}else ...
-else


[...]
> @@ -2607,26 +2582,17 @@
>                        s->dsp.weight_h264_pixels_tab, s->dsp.biweight_h264_pixels_tab);
>          }
>  
> -
>          if(!IS_INTRA4x4(mb_type)){

cosmetic, you should know iam picky about these in functional changes :)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080621/32870dab/attachment.pgp>



More information about the ffmpeg-devel mailing list