avfilter/vf_cropdetect: Unroll 1byte per sample loop
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Dec 2014 01:31:10 +0000 (02:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Dec 2014 01:32:00 +0000 (02:32 +0100)
12807 -> 6336 decicycles

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_cropdetect.c

index fb7be8e..5b59dbd 100644 (file)
@@ -68,6 +68,12 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i
 
     switch (bpp) {
     case 1:
+        while (len >= 8) {
+            total += src[       0] + src[  stride] + src[2*stride] + src[3*stride]
+                  +  src[4*stride] + src[5*stride] + src[6*stride] + src[7*stride];
+            src += 8*stride;
+            len -= 8;
+        }
         while (--len >= 0) {
             total += src[0];
             src += stride;