aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-30 02:35:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-30 02:39:36 +0100
commit5c7227bbb3c134979fb05d7f06cbc15cfcd3a1d4 (patch)
tree8813993d8ff2eb78b720c9679d0eb74d2e1c689f
parent60e2c3110ae338fb7ea545f317f952df5acbb349 (diff)
downloadffmpeg-5c7227bbb3c134979fb05d7f06cbc15cfcd3a1d4.tar.gz
avfilter/vf_cropdetect: Unroll 3 & 4 bytes per sample loop
19484 -> 10266 decicycles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vf_cropdetect.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 5b59dbd5dc..abfbd1d76c 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -81,6 +81,14 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i
break;
case 3:
case 4:
+ while (len >= 4) {
+ total += src[0] + src[1 ] + src[2 ]
+ + src[ stride] + src[1+ stride] + src[2+ stride];
+ + src[2*stride] + src[1+2*stride] + src[2+2*stride];
+ + src[3*stride] + src[1+3*stride] + src[2+3*stride];
+ src += 4*stride;
+ len -= 4;
+ }
while (--len >= 0) {
total += src[0] + src[1] + src[2];
src += stride;