77 total += src[0] + src[1] + src[2];
109 s->
x1 = inlink->
w - 1;
110 s->
y1 = inlink->
h - 1;
122 int w, h, x, y, shrink_by;
135 for (y = 0; y < s->
y1; y++) {
142 for (y = frame->
height - 1; y > s->
y2; y--) {
149 for (y = 0; y < s->
x1; y++) {
156 for (y = frame->
width - 1; y > s->
x2; y--) {
178 shrink_by = w % s->
round;
180 x += (shrink_by/2 + 1) & ~1;
182 shrink_by = h % s->
round;
184 y += (shrink_by/2 + 1) & ~1;
187 "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pts:%"PRId64
" t:%f crop=%d:%d:%d:%d\n",
188 s->
x1, s->
x2, s->
y1, s->
y2, w, h, x, y, frame->
pts,
196 #define OFFSET(x) offsetof(CropDetectContext, x)
197 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
199 {
"limit",
"Threshold below which the pixel is considered black",
OFFSET(limit),
AV_OPT_TYPE_INT, { .i64 = 24 }, 0, INT_MAX,
FLAGS },
201 {
"reset",
"Recalculate the crop area after this many frames",
OFFSET(reset_count),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
FLAGS },
232 .
name =
"cropdetect",
236 .priv_class = &cropdetect_class,
241 .
inputs = avfilter_vf_cropdetect_inputs,
243 .
outputs = avfilter_vf_cropdetect_outputs,