[FFmpeg-cvslog] avfilter/vf_cropdetect: Unroll 1byte per sample loop

Michael Niedermayer git at videolan.org
Tue Dec 30 03:57:35 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 30 02:31:10 2014 +0100| [60e2c3110ae338fb7ea545f317f952df5acbb349] | committer: Michael Niedermayer

avfilter/vf_cropdetect: Unroll 1byte per sample loop

12807 -> 6336 decicycles

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60e2c3110ae338fb7ea545f317f952df5acbb349
---

 libavfilter/vf_cropdetect.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index fb7be8e..5b59dbd 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -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;



More information about the ffmpeg-cvslog mailing list