FFmpeg
Data Structures | Macros | Functions | Variables
vf_procamp_vaapi.c File Reference
#include <string.h>
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "vaapi_vpp.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ProcampVAAPIContext
 

Macros

#define BRIGHTNESS_MIN   -100.0F
 
#define BRIGHTNESS_MAX   100.0F
 
#define BRIGHTNESS_DEFAULT   0.0F
 
#define CONTRAST_MIN   0.0F
 
#define CONTRAST_MAX   10.0F
 
#define CONTRAST_DEFAULT   1.0F
 
#define HUE_MIN   -180.0F
 
#define HUE_MAX   180.0F
 
#define HUE_DEFAULT   0.0F
 
#define SATURATION_MIN   0.0F
 
#define SATURATION_MAX   10.0F
 
#define SATURATION_DEFAULT   1.0F
 
#define OFFSET(x)   offsetof(ProcampVAAPIContext, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
 

Functions

static float map (float x, float in_min, float in_max, float out_min, float out_max)
 
static int procamp_vaapi_build_filter_params (AVFilterContext *avctx)
 
static int procamp_vaapi_filter_frame (AVFilterLink *inlink, AVFrame *input_frame)
 
static av_cold int procamp_vaapi_init (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (procamp_vaapi)
 

Variables

static const AVOption procamp_vaapi_options []
 
static const AVFilterPad procamp_vaapi_inputs []
 
static const AVFilterPad procamp_vaapi_outputs []
 
const AVFilter ff_vf_procamp_vaapi
 

Macro Definition Documentation

◆ BRIGHTNESS_MIN

#define BRIGHTNESS_MIN   -100.0F

Definition at line 29 of file vf_procamp_vaapi.c.

◆ BRIGHTNESS_MAX

#define BRIGHTNESS_MAX   100.0F

Definition at line 30 of file vf_procamp_vaapi.c.

◆ BRIGHTNESS_DEFAULT

#define BRIGHTNESS_DEFAULT   0.0F

Definition at line 31 of file vf_procamp_vaapi.c.

◆ CONTRAST_MIN

#define CONTRAST_MIN   0.0F

Definition at line 33 of file vf_procamp_vaapi.c.

◆ CONTRAST_MAX

#define CONTRAST_MAX   10.0F

Definition at line 34 of file vf_procamp_vaapi.c.

◆ CONTRAST_DEFAULT

#define CONTRAST_DEFAULT   1.0F

Definition at line 35 of file vf_procamp_vaapi.c.

◆ HUE_MIN

#define HUE_MIN   -180.0F

Definition at line 37 of file vf_procamp_vaapi.c.

◆ HUE_MAX

#define HUE_MAX   180.0F

Definition at line 38 of file vf_procamp_vaapi.c.

◆ HUE_DEFAULT

#define HUE_DEFAULT   0.0F

Definition at line 39 of file vf_procamp_vaapi.c.

◆ SATURATION_MIN

#define SATURATION_MIN   0.0F

Definition at line 41 of file vf_procamp_vaapi.c.

◆ SATURATION_MAX

#define SATURATION_MAX   10.0F

Definition at line 42 of file vf_procamp_vaapi.c.

◆ SATURATION_DEFAULT

#define SATURATION_DEFAULT   1.0F

Definition at line 43 of file vf_procamp_vaapi.c.

◆ OFFSET

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

Definition at line 201 of file vf_procamp_vaapi.c.

◆ FLAGS

Definition at line 202 of file vf_procamp_vaapi.c.

Function Documentation

◆ map()

static float map ( float  x,
float  in_min,
float  in_max,
float  out_min,
float  out_max 
)
static

Definition at line 54 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ procamp_vaapi_build_filter_params()

static int procamp_vaapi_build_filter_params ( AVFilterContext avctx)
static

Definition at line 64 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_init().

◆ procamp_vaapi_filter_frame()

static int procamp_vaapi_filter_frame ( AVFilterLink inlink,
AVFrame input_frame 
)
static

Definition at line 126 of file vf_procamp_vaapi.c.

◆ procamp_vaapi_init()

static av_cold int procamp_vaapi_init ( AVFilterContext avctx)
static

Definition at line 182 of file vf_procamp_vaapi.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( procamp_vaapi  )

Variable Documentation

◆ procamp_vaapi_options

const AVOption procamp_vaapi_options[]
static
Initial value:
= {
{ "b", "Output video brightness",
{ "brightness", "Output video brightness",
{ "s", "Output video saturation",
{ "saturatio", "Output video saturation",
{ "c", "Output video contrast",
{ "contrast", "Output video contrast",
{ "h", "Output video hue",
OFFSET(hue), AV_OPT_TYPE_FLOAT, { .dbl = HUE_DEFAULT }, HUE_MIN, HUE_MAX, .flags = FLAGS },
{ "hue", "Output video hue",
OFFSET(hue), AV_OPT_TYPE_FLOAT, { .dbl = HUE_DEFAULT }, HUE_MIN, HUE_MAX, .flags = FLAGS },
{ NULL },
}

Definition at line 203 of file vf_procamp_vaapi.c.

◆ procamp_vaapi_inputs

const AVFilterPad procamp_vaapi_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = &procamp_vaapi_filter_frame,
.config_props = &ff_vaapi_vpp_config_input,
},
}

Definition at line 225 of file vf_procamp_vaapi.c.

◆ procamp_vaapi_outputs

const AVFilterPad procamp_vaapi_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &ff_vaapi_vpp_config_output,
},
}

Definition at line 234 of file vf_procamp_vaapi.c.

◆ ff_vf_procamp_vaapi

const AVFilter ff_vf_procamp_vaapi
Initial value:
= {
.name = "procamp_vaapi",
.description = NULL_IF_CONFIG_SMALL("ProcAmp (color balance) adjustments for hue, saturation, brightness, contrast"),
.priv_size = sizeof(ProcampVAAPIContext),
.priv_class = &procamp_vaapi_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 242 of file vf_procamp_vaapi.c.

procamp_vaapi_outputs
static const AVFilterPad procamp_vaapi_outputs[]
Definition: vf_procamp_vaapi.c:234
procamp_vaapi_filter_frame
static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_procamp_vaapi.c:126
CONTRAST_MAX
#define CONTRAST_MAX
Definition: vf_procamp_vaapi.c:34
FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:364
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:169
FLAGS
#define FLAGS
Definition: vf_procamp_vaapi.c:202
procamp_vaapi_inputs
static const AVFilterPad procamp_vaapi_inputs[]
Definition: vf_procamp_vaapi.c:225
BRIGHTNESS_MIN
#define BRIGHTNESS_MIN
Definition: vf_procamp_vaapi.c:29
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
NULL
#define NULL
Definition: coverity.c:32
HUE_DEFAULT
#define HUE_DEFAULT
Definition: vf_procamp_vaapi.c:39
CONTRAST_DEFAULT
#define CONTRAST_DEFAULT
Definition: vf_procamp_vaapi.c:35
SATURATION_DEFAULT
#define SATURATION_DEFAULT
Definition: vf_procamp_vaapi.c:43
ff_vaapi_vpp_config_input
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
ff_vaapi_vpp_ctx_uninit
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:719
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
ProcampVAAPIContext
Definition: vf_procamp_vaapi.c:45
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:106
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
HUE_MIN
#define HUE_MIN
Definition: vf_procamp_vaapi.c:37
SATURATION_MIN
#define SATURATION_MIN
Definition: vf_procamp_vaapi.c:41
SATURATION_MAX
#define SATURATION_MAX
Definition: vf_procamp_vaapi.c:42
ff_vaapi_vpp_config_output
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
Definition: vaapi_vpp.c:95
OFFSET
#define OFFSET(x)
Definition: vf_procamp_vaapi.c:201
BRIGHTNESS_DEFAULT
#define BRIGHTNESS_DEFAULT
Definition: vf_procamp_vaapi.c:31
CONTRAST_MIN
#define CONTRAST_MIN
Definition: vf_procamp_vaapi.c:33
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
HUE_MAX
#define HUE_MAX
Definition: vf_procamp_vaapi.c:38
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
procamp_vaapi_init
static av_cold int procamp_vaapi_init(AVFilterContext *avctx)
Definition: vf_procamp_vaapi.c:182
BRIGHTNESS_MAX
#define BRIGHTNESS_MAX
Definition: vf_procamp_vaapi.c:30