[FFmpeg-devel] [PATCH] Speed up dct32() in mpegaudiodec and make it avoid trashing its input

Michael Niedermayer michaelni
Mon Jun 7 02:31:39 CEST 2010


On Sun, Jun 06, 2010 at 04:16:27PM +0200, Vitor Sessak wrote:
> $subj. This should make the function suitable to be moved to the common DCT 
> framework after my patch in the thread "[PATCH] SSE dct32()".
>
> Benchmarks:
>
> Fixed point, patched:
> 4554 dezicycles in dct32, 128 runs, 0 skips
> 4880 dezicycles in dct32, 256 runs, 0 skips
> 5078 dezicycles in dct32, 512 runs, 0 skips
> 4443 dezicycles in dct32, 1024 runs, 0 skips
> 4112 dezicycles in dct32, 2048 runs, 0 skips
> 4122 dezicycles in dct32, 4095 runs, 1 skips
> 4054 dezicycles in dct32, 8190 runs, 2 skips
> 4008 dezicycles in dct32, 16379 runs, 5 skips
> 3968 dezicycles in dct32, 32759 runs, 9 skips
> 3911 dezicycles in dct32, 65516 runs, 20 skips
> 3868 dezicycles in dct32, 131042 runs, 30 skips
> 3844 dezicycles in dct32, 262075 runs, 69 skipss
> 3860 dezicycles in dct32, 524151 runs, 137 skipss
> 3881 dezicycles in dct32, 1048328 runs, 248 skips
> 3852 dezicycles in dct32, 2096579 runs, 573 skips
> 3838 dezicycles in dct32, 4193100 runs, 1204 skips
> 3831 dezicycles in dct32, 8386205 runs, 2403 skips

seeing the whole output is not interrestingm seeing the last score
of several runs is interresting

[...]
> -#define ADD(a, b) tab[a] += tab[b]
> +#define ADD(a, b) val##a += val##b
>  
> +
> +#define SWAPSUM(a,b,c)\
> +{\
> +    FFSWAP(INTFLOAT, val##a, val##b);\
> +    ADD(a, c);                     \
> +}

swaping variables is always a redundant operation in code lacking
backward branches.

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- 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/20100607/943db1fb/attachment.pgp>



More information about the ffmpeg-devel mailing list