FFmpeg
Data Structures | Macros | Functions | Variables
vf_chromashift.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.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  ChromaShiftContext
 

Macros

#define DEFINE_SMEAR(depth, type, div)
 
#define DEFINE_WRAP(depth, type, div)
 
#define DEFINE_RGBASMEAR(depth, type, div)
 
#define DEFINE_RGBAWRAP(depth, type, div)
 
#define OFFSET(x)   offsetof(ChromaShiftContext, x)
 
#define VF   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
 AVFILTER_DEFINE_CLASS (chromashift)
 
 AVFILTER_DEFINE_CLASS (rgbashift)
 

Variables

static const AVOption chromashift_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_chromashift
 
static const AVOption rgbashift_options []
 
AVFilter ff_vf_rgbashift
 

Macro Definition Documentation

◆ DEFINE_SMEAR

#define DEFINE_SMEAR (   depth,
  type,
  div 
)

Definition at line 92 of file vf_chromashift.c.

◆ DEFINE_WRAP

#define DEFINE_WRAP (   depth,
  type,
  div 
)

Definition at line 134 of file vf_chromashift.c.

◆ DEFINE_RGBASMEAR

#define DEFINE_RGBASMEAR (   depth,
  type,
  div 
)

Definition at line 189 of file vf_chromashift.c.

◆ DEFINE_RGBAWRAP

#define DEFINE_RGBAWRAP (   depth,
  type,
  div 
)

Definition at line 256 of file vf_chromashift.c.

◆ OFFSET

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

Definition at line 403 of file vf_chromashift.c.

◆ VF

Definition at line 404 of file vf_chromashift.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 56 of file vf_chromashift.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 345 of file vf_chromashift.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 375 of file vf_chromashift.c.

◆ AVFILTER_DEFINE_CLASS() [1/2]

AVFILTER_DEFINE_CLASS ( chromashift  )

◆ AVFILTER_DEFINE_CLASS() [2/2]

AVFILTER_DEFINE_CLASS ( rgbashift  )

Variable Documentation

◆ chromashift_options

const AVOption chromashift_options[]
static
Initial value:
= {
{ "cbh", "shift chroma-blue horizontally", OFFSET(cbh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "cbv", "shift chroma-blue vertically", OFFSET(cbv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "crh", "shift chroma-red horizontally", OFFSET(crh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "crv", "shift chroma-red vertically", OFFSET(crv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "edge", "set edge operation", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = VF, "edge" },
{ "smear", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, .flags = VF, "edge" },
{ "wrap", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, .flags = VF, "edge" },
{ NULL },
}

Definition at line 406 of file vf_chromashift.c.

◆ inputs

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

Definition at line 417 of file vf_chromashift.c.

◆ outputs

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

Definition at line 427 of file vf_chromashift.c.

◆ ff_vf_chromashift

AVFilter ff_vf_chromashift
Initial value:
= {
.name = "chromashift",
.description = NULL_IF_CONFIG_SMALL("Shift chroma."),
.priv_size = sizeof(ChromaShiftContext),
.priv_class = &chromashift_class,
}

Definition at line 437 of file vf_chromashift.c.

◆ rgbashift_options

const AVOption rgbashift_options[]
static
Initial value:
= {
{ "rh", "shift red horizontally", OFFSET(rh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "rv", "shift red vertically", OFFSET(rv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "gh", "shift green horizontally", OFFSET(gh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "gv", "shift green vertically", OFFSET(gv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "bh", "shift blue horizontally", OFFSET(bh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "bv", "shift blue vertically", OFFSET(bv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "ah", "shift alpha horizontally", OFFSET(ah), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "av", "shift alpha vertically", OFFSET(av), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VF },
{ "edge", "set edge operation", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = VF, "edge" },
{ "smear", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, .flags = VF, "edge" },
{ "wrap", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, .flags = VF, "edge" },
{ NULL },
}

Definition at line 448 of file vf_chromashift.c.

◆ ff_vf_rgbashift

AVFilter ff_vf_rgbashift
Initial value:
= {
.name = "rgbashift",
.description = NULL_IF_CONFIG_SMALL("Shift RGBA."),
.priv_size = sizeof(ChromaShiftContext),
.priv_class = &rgbashift_class,
}

Definition at line 465 of file vf_chromashift.c.

ChromaShiftContext
Definition: vf_chromashift.c:34
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_chromashift.c:56
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_chromashift.c:375
VF
#define VF
Definition: vf_chromashift.c:404
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_chromashift.c:403
inputs
static const AVFilterPad inputs[]
Definition: vf_chromashift.c:417
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
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_chromashift.c:345
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(name, subs,...)
Definition: cbs_av1.c:565
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232
outputs
static const AVFilterPad outputs[]
Definition: vf_chromashift.c:427