FFmpeg
Data Structures | Macros | Functions | Variables
vf_xmedian.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/qsort.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "framesync.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  XMedianContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(XMedianContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int comparei (const void *p1, const void *p2)
 
static int median_frames16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int median_frames8 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int process_frame (FFFrameSync *fs)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int activate (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (xmedian)
 

Variables

static const AVOption xmedian_options []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_xmedian
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(XMedianContext, x)

Definition at line 320 of file vf_xmedian.c.

◆ FLAGS

Definition at line 321 of file vf_xmedian.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 54 of file vf_xmedian.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 86 of file vf_xmedian.c.

◆ comparei()

static int comparei ( const void *  p1,
const void *  p2 
)
static

Definition at line 117 of file vf_xmedian.c.

Referenced by median_frames16(), and median_frames8().

◆ median_frames16()

static int median_frames16 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 124 of file vf_xmedian.c.

Referenced by config_output().

◆ median_frames8()

static int median_frames8 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 168 of file vf_xmedian.c.

Referenced by config_output().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 210 of file vf_xmedian.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 237 of file vf_xmedian.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 303 of file vf_xmedian.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 314 of file vf_xmedian.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( xmedian  )

Variable Documentation

◆ xmedian_options

const AVOption xmedian_options[]
static
Initial value:
= {
{ "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=3}, 3, 255, .flags = FLAGS },
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, .flags = FLAGS },
{ NULL },
}

Definition at line 323 of file vf_xmedian.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}

Definition at line 329 of file vf_xmedian.c.

◆ ff_vf_xmedian

AVFilter ff_vf_xmedian
Initial value:
= {
.name = "xmedian",
.description = NULL_IF_CONFIG_SMALL("Pick median pixels from several video inputs."),
.priv_size = sizeof(XMedianContext),
.priv_class = &xmedian_class,
.init = init,
}

Definition at line 340 of file vf_xmedian.c.

FLAGS
#define FLAGS
Definition: vf_xmedian.c:321
AVFILTER_FLAG_DYNAMIC_INPUTS
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:105
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_xmedian.c:237
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_xmedian.c:54
NULL
#define NULL
Definition: coverity.c:32
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_xmedian.c:86
planes
static const struct @314 planes[]
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
XMedianContext
Definition: vf_xmedian.c:34
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_xmedian.c:303
activate
static int activate(AVFilterContext *ctx)
Definition: vf_xmedian.c:314
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
outputs
static const AVFilterPad outputs[]
Definition: vf_xmedian.c:329
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
OFFSET
#define OFFSET(x)
Definition: vf_xmedian.c:320