68 total += src[0] + src[1] + src[2];
106 cd->
x1 = inlink->
w - 1;
107 cd->
y1 = inlink->
h - 1;
120 int w, h, x, y, shrink_by;
133 for (y = 0; y < cd->
y1; y++) {
140 for (y = picref->
video->
h-1; y > cd->
y2; y--) {
147 for (y = 0; y < cd->
x1; y++) {
154 for (y = picref->
video->
w-1; y > cd->
x2; y--) {
176 shrink_by = w % cd->
round;
178 x += (shrink_by/2 + 1) & ~1;
180 shrink_by = h % cd->
round;
182 y += (shrink_by/2 + 1) & ~1;
185 "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",
186 cd->
x1, cd->
x2, cd->
y1, cd->
y2, w, h, x, y, picref->
pos, picref->
pts,
195 .
name =
"cropdetect",
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVFilterBufferRefVideoProps * video
video buffer specific properties
int linesize[8]
number of bytes per line
AVFilter avfilter_vf_cropdetect
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
int h
agreed upon image height
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
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.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
static double av_q2d(AVRational a)
Convert rational to double.
int64_t pts
presentation timestamp.
A filter pad used for either input or output.
A link between two filters.
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
#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
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,...)
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
int w
agreed upon image width
as above, but U and V bytes are swapped
int format
agreed upon media format
static int query_formats(AVFilterContext *ctx)
A reference to an AVFilterBuffer.
void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
start_frame() handler for filters which simply pass video along
const char * name
filter name
AVFilterBufferRef * avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
get_video_buffer() handler for filters which simply pass video along
AVFilterLink ** outputs
array of pointers to output links
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static void end_frame(AVFilterLink *inlink)
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 * cur_buf
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp)