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

◆ OFFSET

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

Definition at line 48 of file vf_limiter.c.

◆ FLAGS

Definition at line 49 of file vf_limiter.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( limiter  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 60 of file vf_limiter.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 69 of file vf_limiter.c.

◆ limiter8()

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 99 of file vf_limiter.c.

Referenced by config_props().

◆ limiter16()

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 115 of file vf_limiter.c.

Referenced by config_props().

◆ config_props()

static int config_props ( AVFilterLink inlink)
static

Definition at line 136 of file vf_limiter.c.

◆ filter_slice()

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

Definition at line 171 of file vf_limiter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 204 of file vf_limiter.c.

Variable Documentation

◆ limiter_options

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 }
}

Definition at line 51 of file vf_limiter.c.

◆ inputs

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

Definition at line 233 of file vf_limiter.c.

◆ outputs

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

Definition at line 243 of file vf_limiter.c.

◆ ff_vf_limiter

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,
}

Definition at line 251 of file vf_limiter.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_limiter.c:60
max
#define max(a, b)
Definition: cuda_runtime.h:33
inputs
static const AVFilterPad inputs[]
Definition: vf_limiter.c:233
OFFSET
#define OFFSET(x)
Definition: vf_limiter.c:48
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_limiter.c:69
NULL
#define NULL
Definition: coverity.c:32
LimiterContext
Definition: vf_limiter.c:35
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
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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
planes
static const struct @315 planes[]
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_limiter.c:204
outputs
static const AVFilterPad outputs[]
Definition: vf_limiter.c:243
config_props
static int config_props(AVFilterLink *inlink)
Definition: vf_limiter.c:136
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
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
FLAGS
#define FLAGS
Definition: vf_limiter.c:49
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
min
float min
Definition: vorbis_enc_data.h:456