FFmpeg
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.

◆ BRIGHTNESS_MAX

#define BRIGHTNESS_MAX   100.0F

Definition at line 32 of file vf_procamp_vaapi.c.

◆ 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.

◆ CONTRAST_MAX

#define CONTRAST_MAX   10.0F

Definition at line 36 of file vf_procamp_vaapi.c.

◆ 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.

◆ HUE_MAX

#define HUE_MAX   180.0F

Definition at line 40 of file vf_procamp_vaapi.c.

◆ 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.

◆ SATURATION_MAX

#define SATURATION_MAX   10.0F

Definition at line 44 of file vf_procamp_vaapi.c.

◆ 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 193 of file vf_procamp_vaapi.c.

◆ FLAGS

Definition at line 194 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 181 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 195 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 }
}

Definition at line 217 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 }
}

Definition at line 227 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,
}

Definition at line 236 of file vf_procamp_vaapi.c.

procamp_vaapi_outputs
static const AVFilterPad procamp_vaapi_outputs[]
Definition: vf_procamp_vaapi.c:227
procamp_vaapi_filter_frame
static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_procamp_vaapi.c:128
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
CONTRAST_MAX
#define CONTRAST_MAX
Definition: vf_procamp_vaapi.c:36
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:365
FLAGS
#define FLAGS
Definition: vf_procamp_vaapi.c:194
procamp_vaapi_inputs
static const AVFilterPad procamp_vaapi_inputs[]
Definition: vf_procamp_vaapi.c:217
BRIGHTNESS_MIN
#define BRIGHTNESS_MIN
Definition: vf_procamp_vaapi.c:31
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
HUE_DEFAULT
#define HUE_DEFAULT
Definition: vf_procamp_vaapi.c:41
CONTRAST_DEFAULT
#define CONTRAST_DEFAULT
Definition: vf_procamp_vaapi.c:37
SATURATION_DEFAULT
#define SATURATION_DEFAULT
Definition: vf_procamp_vaapi.c:45
ff_vaapi_vpp_config_input
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
ff_vaapi_vpp_ctx_uninit
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:680
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
ProcampVAAPIContext
Definition: vf_procamp_vaapi.c:47
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
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:226
HUE_MIN
#define HUE_MIN
Definition: vf_procamp_vaapi.c:39
SATURATION_MIN
#define SATURATION_MIN
Definition: vf_procamp_vaapi.c:43
SATURATION_MAX
#define SATURATION_MAX
Definition: vf_procamp_vaapi.c:44
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:193
BRIGHTNESS_DEFAULT
#define BRIGHTNESS_DEFAULT
Definition: vf_procamp_vaapi.c:33
CONTRAST_MIN
#define CONTRAST_MIN
Definition: vf_procamp_vaapi.c:35
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
HUE_MAX
#define HUE_MAX
Definition: vf_procamp_vaapi.c:40
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
procamp_vaapi_init
static av_cold int procamp_vaapi_init(AVFilterContext *avctx)
Definition: vf_procamp_vaapi.c:181
BRIGHTNESS_MAX
#define BRIGHTNESS_MAX
Definition: vf_procamp_vaapi.c:32