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 "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 VFR   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 AVFILTER_DEFINE_CLASS (chromashift)
 
 AVFILTER_DEFINE_CLASS (rgbashift)
 

Variables

static const AVOption chromashift_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_vf_chromashift
 
static const AVOption rgbashift_options []
 
const 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 415 of file vf_chromashift.c.

◆ VFR

Definition at line 416 of file vf_chromashift.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 55 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.

Referenced by process_command().

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 403 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 = VFR },
{ "cbv", "shift chroma-blue vertically", OFFSET(cbv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "crh", "shift chroma-red horizontally", OFFSET(crh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "crv", "shift chroma-red vertically", OFFSET(crv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "edge", "set edge operation", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = VFR, "edge" },
{ "smear", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, .flags = VFR, "edge" },
{ "wrap", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, .flags = VFR, "edge" },
{ NULL },
}

Definition at line 418 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 429 of file vf_chromashift.c.

◆ outputs

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

Definition at line 439 of file vf_chromashift.c.

◆ ff_vf_chromashift

const 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 449 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 = VFR },
{ "rv", "shift red vertically", OFFSET(rv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "gh", "shift green horizontally", OFFSET(gh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "gv", "shift green vertically", OFFSET(gv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "bh", "shift blue horizontally", OFFSET(bh), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "bv", "shift blue vertically", OFFSET(bv), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "ah", "shift alpha horizontally", OFFSET(ah), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "av", "shift alpha vertically", OFFSET(av), AV_OPT_TYPE_INT, {.i64=0}, -255, 255, .flags = VFR },
{ "edge", "set edge operation", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = VFR, "edge" },
{ "smear", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, .flags = VFR, "edge" },
{ "wrap", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, .flags = VFR, "edge" },
{ NULL },
}

Definition at line 461 of file vf_chromashift.c.

◆ ff_vf_rgbashift

const 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 478 of file vf_chromashift.c.

ChromaShiftContext
Definition: vf_chromashift.c:33
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_chromashift.c:403
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_chromashift.c:55
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_chromashift.c:375
NULL
#define NULL
Definition: coverity.c:32
rv
int32_t rv
Definition: input.c:405
OFFSET
#define OFFSET(x)
Definition: vf_chromashift.c:415
inputs
static const AVFilterPad inputs[]
Definition: vf_chromashift.c:429
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:117
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:126
bv
int32_t bv
Definition: input.c:405
gv
int32_t gv
Definition: input.c:405
VFR
#define VFR
Definition: vf_chromashift.c:416
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
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:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
outputs
static const AVFilterPad outputs[]
Definition: vf_chromashift.c:439