aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/adler32.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-04 20:27:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-04 20:27:02 +0100
commitd3f912c1f06b90960659d59bb75d2eb98932fde6 (patch)
tree8883bdb68632c4abb85dab4c7eea03bc89b51661 /libavutil/adler32.c
parent26585d2a7f5f13bec3ed8623119bf625fdb728f4 (diff)
downloadffmpeg-d3f912c1f06b90960659d59bb75d2eb98932fde6.tar.gz
adler32: add comment for the SIMD code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/adler32.c')
-rw-r--r--libavutil/adler32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavutil/adler32.c b/libavutil/adler32.c
index c5f96db5e5..bc9b9a7e5a 100644
--- a/libavutil/adler32.c
+++ b/libavutil/adler32.c
@@ -57,6 +57,11 @@ unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
len2 -= 8;
buf+=8;
}
+
+ //We combine the 8 interleaved adler32 checksums without overflows
+ //Decreasing the number of iterations would allow below code to be
+ //simplified but would likely be slower due to the fewer iterations
+ //of the inner loop
s1 += ((a1+b1)*0x1000100010001)>>48;
s2 += ((((a2&0xFFFF0000FFFF)+(b2&0xFFFF0000FFFF)+((a2>>16)&0xFFFF0000FFFF)+((b2>>16)&0xFFFF0000FFFF))*0x800000008)>>32)
#if HAVE_BIGENDIAN