Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-09 04:06:17 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-09-09 04:06:17 +0400
commit02946120fc30022f367d5af646b84251c2456e2d (patch)
treea1d1ab59b99b9ff0d31237978266b3c2da6ed187 /libavfilter/vf_cropdetect.c
parent5109ce2017c15202275b33bce58ec9d88044eeb5 (diff)
avfilter/vf_cropdetect: Do not check lines or columns twice on black frames
Idea from patch by: hjiodjf 97xgw46 <jfbvxt@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_cropdetect.c')
-rw-r--r--libavfilter/vf_cropdetect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index f85a0bbf93..76aa7b2d1e 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -143,7 +143,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
}
- for (y = frame->height - 1; y > s->y2; y--) {
+ for (y = frame->height - 1; y > FFMAX(s->y2, s->y1); y--) {
if (checkline(ctx, frame->data[0] + frame->linesize[0] * y, bpp, frame->width, bpp) > s->limit) {
s->y2 = y;
break;
@@ -157,7 +157,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
}
- for (y = frame->width - 1; y > s->x2; y--) {
+ for (y = frame->width - 1; y > FFMAX(s->x2, s->x1); y--) {
if (checkline(ctx, frame->data[0] + bpp*y, frame->linesize[0], frame->height, bpp) > s->limit) {
s->x2 = y;
break;