41 int x,
y, w_opt, h_opt, w, h;
43 unsigned char yuv_color[4];
89 s->
w, s->
y, s->
w, s->
h,
98 int plane, x, y, xb = s->
x, yb = s->
y;
99 unsigned char *row[4];
101 for (y =
FFMAX(yb, 0); y < frame->
height && y < (yb + s->
h); y++) {
104 for (plane = 1; plane < 3; plane++)
105 row[plane] = frame->
data[plane] +
108 for (x =
FFMAX(xb, 0); x < (xb + s->
w) && x < frame->
width; x++) {
111 if ((y - yb < 3) || (yb + s->
h - y < 4) ||
112 (x - xb < 3) || (xb + s->
w - x < 4)) {
113 row[0][x ] = (1 - alpha) * row[0][x ] + alpha * s->
yuv_color[
Y];
123 #define OFFSET(x) offsetof(DrawBoxContext, x)
124 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
165 .priv_class = &drawbox_class,
169 .
inputs = avfilter_vf_drawbox_inputs,
170 .
outputs = avfilter_vf_drawbox_outputs,
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static const AVFilterPad outputs[]
Main libavfilter public API header.
int h
agreed upon image height
Various defines for YUV<->RGB conversion.
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
const char * name
Pad name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int query_formats(AVFilterContext *ctx)
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
#define AV_LOG_VERBOSE
Detailed information.
static const AVFilterPad avfilter_vf_drawbox_outputs[]
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
A filter pad used for either input or output.
A link between two filters.
static int config_input(AVFilterLink *inlink)
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
#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
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
static const AVFilterPad avfilter_vf_drawbox_inputs[]
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
if(ac->has_optimized_func)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static const AVOption options[]
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int hsub
chroma subsampling
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
static const AVClass drawbox_class
#define RGB_TO_U_CCIR(r1, g1, b1, shift)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define RGB_TO_V_CCIR(r1, g1, b1, shift)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal and external API header
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 av_cold int init(AVFilterContext *ctx)
#define RGB_TO_Y_CCIR(r, g, b)
AVFilterContext * dst
dest filter
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
unsigned char yuv_color[4]
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
AVPixelFormat
Pixel format.