[FFmpeg-soc] [soc]: r1620 - dirac/libavcodec/dirac_wavelet.c

Michael Niedermayer michaelni at gmx.at
Thu Dec 20 21:54:48 CET 2007


On Thu, Dec 20, 2007 at 08:18:48PM +0100, lu_zero wrote:
> Author: lu_zero
> Date: Thu Dec 20 20:18:48 2007
> New Revision: 1620
> 
> Log:
> Fold even and odd passes for 53

benchmark missing :)

also combining even & odd does not need unrolling the loops by x2
which should have been done seperately and benchmarked seperately ideally
ohh well its not really important, it would just have been nice ...


> 
> Modified:
>    dirac/libavcodec/dirac_wavelet.c
> 
> Modified: dirac/libavcodec/dirac_wavelet.c
> ==============================================================================
> --- dirac/libavcodec/dirac_wavelet.c	(original)
> +++ dirac/libavcodec/dirac_wavelet.c	Thu Dec 20 20:18:48 2007
> @@ -166,28 +166,43 @@ START_TIMER
>                         + synthline[1]
>                         + 2) >> 2;
>          data[0] = (synthline[0] + 1) >> 1;
> -        for (x = 1; x < width - 1; x++) {
> +
> +        for (x = 1; x < width - 2; x += 2) {
> +        // even
>              synthline[2*x] -= (synthline[2*x - 1]
>                               + synthline[2*x + 1]
>                               + 2) >> 2;
>              data[2*x] = (synthline[2*x] + 1) >> 1;
> +            synthline[2*x + 2] -= (synthline[2*x + 1]
> +                                 + synthline[2*x + 3]
> +                                 + 2) >> 2;
> +            data[2*x + 2] = (synthline[2*x + 2] + 1) >> 1;
> +        // odd
> +            synthline[2*x - 1] += (synthline[2*x - 2]
> +                                 + synthline[2*x]
> +                                 + 1) >> 1;
> +            data[2*x - 1] = (synthline[2*x - 1] + 1) >> 1;
> +            synthline[2*x + 1] += (synthline[2*x]
> +                                 + synthline[2*x + 2]
> +                                 + 1) >> 1;
> +            data[2*x + 1] = (synthline[2*x + 1] + 1) >> 1;
>          }

is it really needed to write both data and synthline here, isnt one unused?
also cant the 2 arrays be merged?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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-soc/attachments/20071220/b18e205f/attachment.pgp>


More information about the FFmpeg-soc mailing list