FFmpeg
Data Structures | Macros | Functions | Variables
vf_limiter.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "limiter.h"
#include "video.h"

Go to the source code of this file.

Data Structures

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

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (limiter)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static void limiter8 (const uint8_t *src, uint8_t *dst, ptrdiff_t slinesize, ptrdiff_t dlinesize, int w, int h, int min, int max)
 
static void limiter16 (const uint8_t *ssrc, uint8_t *ddst, ptrdiff_t slinesize, ptrdiff_t dlinesize, int w, int h, int min, int max)
 
static int config_props (AVFilterLink *inlink)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption limiter_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_limiter
 

Macro Definition Documentation

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

Definition at line 48 of file vf_limiter.c.

Definition at line 49 of file vf_limiter.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( limiter  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 60 of file vf_limiter.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 69 of file vf_limiter.c.

static void limiter8 ( const uint8_t src,
uint8_t dst,
ptrdiff_t  slinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  min,
int  max 
)
static

Definition at line 98 of file vf_limiter.c.

Referenced by config_props().

static void limiter16 ( const uint8_t ssrc,
uint8_t ddst,
ptrdiff_t  slinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  min,
int  max 
)
static

Definition at line 114 of file vf_limiter.c.

Referenced by config_props().

static int config_props ( AVFilterLink inlink)
static

Definition at line 135 of file vf_limiter.c.

static int filter_slice ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 170 of file vf_limiter.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 203 of file vf_limiter.c.

Variable Documentation

const AVOption limiter_options[]
static
Initial value:
= {
{ "min", "set min value", OFFSET(min), AV_OPT_TYPE_INT, {.i64=0}, 0, 65535, .flags = FLAGS },
{ "max", "set max value", OFFSET(max), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, .flags = FLAGS },
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, .flags = FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_limiter.c:48
#define max(a, b)
Definition: cuda_runtime.h:33
#define FLAGS
Definition: vf_limiter.c:49
static const struct @317 planes[]
float min

Definition at line 51 of file vf_limiter.c.

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_props,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_limiter.c:203
static int config_props(AVFilterLink *inlink)
Definition: vf_limiter.c:135

Definition at line 232 of file vf_limiter.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 242 of file vf_limiter.c.

AVFilter ff_vf_limiter
Initial value:
= {
.name = "limiter",
.description = NULL_IF_CONFIG_SMALL("Limit pixels components to the specified range."),
.priv_size = sizeof(LimiterContext),
.priv_class = &limiter_class,
.init = init,
}
static av_cold int init(AVFilterContext *ctx)
Definition: vf_limiter.c:60
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
static const AVFilterPad inputs[]
Definition: vf_limiter.c:232
static const AVFilterPad outputs[]
Definition: vf_limiter.c:242
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static int query_formats(AVFilterContext *ctx)
Definition: vf_limiter.c:69
#define flags(name, subs,...)
Definition: cbs_av1.c:561

Definition at line 250 of file vf_limiter.c.