74 total += src[0] + src[1] + src[2];
112 cd->
x1 = inlink->
w - 1;
113 cd->
y1 = inlink->
h - 1;
125 int w, h, x, y, shrink_by;
138 for (y = 0; y < cd->
y1; y++) {
145 for (y = frame->
video->
h-1; y > cd->
y2; y--) {
152 for (y = 0; y < cd->
x1; y++) {
159 for (y = frame->
video->
w-1; y > cd->
x2; y--) {
181 shrink_by = w % cd->
round;
183 x += (shrink_by/2 + 1) & ~1;
185 shrink_by = h % cd->
round;
187 y += (shrink_by/2 + 1) & ~1;
190 "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pos:%"PRId64
" pts:%"PRId64
" t:%f crop=%d:%d:%d:%d\n",
191 cd->
x1, cd->
x2, cd->
y1, cd->
y2, w, h, x, y, frame->
pos, frame->
pts,
219 .
name =
"cropdetect",
227 .
inputs = avfilter_vf_cropdetect_inputs,
229 .
outputs = avfilter_vf_cropdetect_outputs,
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
AVFilterBufferRefVideoProps * video
video buffer specific properties
int linesize[8]
number of bytes per line
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
AVFilter avfilter_vf_cropdetect
static const AVFilterPad outputs[]
static av_cold int init(AVFilterContext *ctx, const char *args)
int h
agreed upon image height
int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
Send a frame of data to the next filter.
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
Compute the max pixel step for each plane of an image with a format described by pixdesc.
const char * name
Pad name.
static double av_q2d(AVRational a)
Convert rational to double.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
int64_t pts
presentation timestamp.
A filter pad used for either input or output.
A link between two filters.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
void av_log(void *avcl, int level, const char *fmt,...)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
common internal API header
as above, but U and V bytes are swapped
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
int format
agreed upon media format
static int query_formats(AVFilterContext *ctx)
A reference to an AVFilterBuffer.
static const AVFilterPad avfilter_vf_cropdetect_inputs[]
static const AVFilterPad inputs[]
const char * name
filter name
AVFilterLink ** outputs
array of pointers to output links
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static const AVFilterPad avfilter_vf_cropdetect_outputs[]
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame)
int64_t pos
byte position in stream, -1 if unknown
AVFilterContext * dst
dest filter
uint8_t * data[8]
picture/audio data for each plane
static int config_input(AVFilterLink *inlink)
AVFilterBufferRef * ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
AVPixelFormat
Pixel format.
static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp)