[FFmpeg-devel] [PATCH] adler32: rewrite using integer SIMD.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Feb 4 12:17:51 CET 2012



On 4 Feb 2012, at 07:55, Michael Niedermayer <michaelni at gmx.at> wrote:
> +#if HAVE_BIGENDIAN
> +            s2 += ((((a2&0xFFFF0000FFFF)+(b2&0xFFFF0000FFFF)+((a2>>16)&0xFFFF0000FFFF)+((b2>>16)&0xFFFF0000FFFF))*0x800000008)>>32)
> +                 - 2*((b1*0x3000200010000)>>48)
> +                 -   ((a1*0x1000100010001)>>48)
> +                 - 2*((a1*0x3000200010000)>>48);
> +#else
> +            s2 += ((((a2&0xFFFF0000FFFF)+(b2&0xFFFF0000FFFF)+((a2>>16)&0xFFFF0000FFFF)+((b2>>16)&0xFFFF0000FFFF))*0x800000008)>>32)
> +                 - 2*((a1*0x0000100020003)>>48)
> +                 -   ((b1*0x1000100010001)>>48)
> +                 - 2*((b1*0x0000100020003)>>48);

The first line seems the same to me.
Assume that's correct IMO it would be nicer to put it outside the ifdef.
Also a few comments might be nice to make it more obvious how it works (maybe it is obvious, I didn't check the adler32 code, but the large constants etc. make it rather bad to read.


More information about the ffmpeg-devel mailing list