aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/adler32.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-07-19 08:39:50 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-07-19 08:39:50 +0000
commit1d94a6620fb8b18ccbba75b7ca74db2fe885e054 (patch)
tree8c6d61f0cb05f00f6239cd18c266f4f77eaaa6df /libavutil/adler32.c
parentcfc4bd4695efcf6d9b246fad12b391161ff35c9c (diff)
downloadffmpeg-1d94a6620fb8b18ccbba75b7ca74db2fe885e054.tar.gz
simplify
Originally committed as revision 5786 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/adler32.c')
-rw-r--r--libavutil/adler32.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavutil/adler32.c b/libavutil/adler32.c
index 1d814b4561..84b432138e 100644
--- a/libavutil/adler32.c
+++ b/libavutil/adler32.c
@@ -11,21 +11,16 @@
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf) {s1 += *buf++; s2 += s1;}
-#define DO2(buf) DO1(buf); DO1(buf);
-#define DO4(buf) DO2(buf); DO2(buf);
-#define DO8(buf) DO4(buf); DO4(buf);
-#define DO16(buf) DO8(buf); DO8(buf);
+#define DO4(buf) DO1(buf); DO1(buf); DO1(buf); DO1(buf);
+#define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigned int len)
{
unsigned long s1 = adler & 0xffff;
unsigned long s2 = (adler >> 16) & 0xffff;
- int k;
-
- if (buf == NULL) return 1L;
while (len > 0) {
- k = FFMIN(len, NMAX);
+ int k = FFMIN(len, NMAX);
len -= k;
#ifndef CONFIG_SMALL
while (k >= 16) {