FFmpeg  4.0
Data Structures | Macros | Functions | Variables
vf_procamp_vaapi.c File Reference
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "vaapi_vpp.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 []
 
AVFilter ff_vf_procamp_vaapi
 

Macro Definition Documentation

◆ BRIGHTNESS_MIN

#define BRIGHTNESS_MIN   -100.0F

Definition at line 31 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ BRIGHTNESS_MAX

#define BRIGHTNESS_MAX   100.0F

Definition at line 32 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ BRIGHTNESS_DEFAULT

#define BRIGHTNESS_DEFAULT   0.0F

Definition at line 33 of file vf_procamp_vaapi.c.

◆ CONTRAST_MIN

#define CONTRAST_MIN   0.0F

Definition at line 35 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ CONTRAST_MAX

#define CONTRAST_MAX   10.0F

Definition at line 36 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ CONTRAST_DEFAULT

#define CONTRAST_DEFAULT   1.0F

Definition at line 37 of file vf_procamp_vaapi.c.

◆ HUE_MIN

#define HUE_MIN   -180.0F

Definition at line 39 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ HUE_MAX

#define HUE_MAX   180.0F

Definition at line 40 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ HUE_DEFAULT

#define HUE_DEFAULT   0.0F

Definition at line 41 of file vf_procamp_vaapi.c.

◆ SATURATION_MIN

#define SATURATION_MIN   0.0F

Definition at line 43 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ SATURATION_MAX

#define SATURATION_MAX   10.0F

Definition at line 44 of file vf_procamp_vaapi.c.

Referenced by procamp_vaapi_build_filter_params().

◆ SATURATION_DEFAULT

#define SATURATION_DEFAULT   1.0F

Definition at line 45 of file vf_procamp_vaapi.c.

◆ OFFSET

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

Definition at line 216 of file vf_procamp_vaapi.c.

◆ FLAGS

Definition at line 217 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 56 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 66 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 128 of file vf_procamp_vaapi.c.

◆ procamp_vaapi_init()

static av_cold int procamp_vaapi_init ( AVFilterContext avctx)
static

Definition at line 204 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 },
}
#define NULL
Definition: coverity.c:32
#define CONTRAST_DEFAULT
#define HUE_MIN
#define HUE_DEFAULT
#define OFFSET(x)
#define HUE_MAX
#define CONTRAST_MIN
#define BRIGHTNESS_MAX
#define SATURATION_MIN
#define SATURATION_MAX
#define BRIGHTNESS_DEFAULT
#define CONTRAST_MAX
#define FLAGS
#define SATURATION_DEFAULT
#define BRIGHTNESS_MIN

Definition at line 218 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,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)

Definition at line 240 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,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
Definition: vaapi_vpp.c:95

Definition at line 250 of file vf_procamp_vaapi.c.

◆ ff_vf_procamp_vaapi

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,
}
#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:385
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int procamp_vaapi_init(AVFilterContext *avctx)
static const AVFilterPad procamp_vaapi_outputs[]
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
static const AVFilterPad procamp_vaapi_inputs[]
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:365

Definition at line 259 of file vf_procamp_vaapi.c.