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

Go to the source code of this file.

Data Structures

struct  DeintVAAPIContext
 

Macros

#define MAX_REFERENCES   8
 
#define D(name)   case VAProcDeinterlacing ## name: return #name
 
#define OFFSET(x)   offsetof(DeintVAAPIContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static const char * deint_vaapi_mode_name (int mode)
 
static void deint_vaapi_pipeline_uninit (AVFilterContext *avctx)
 
static int deint_vaapi_build_filter_params (AVFilterContext *avctx)
 
static int deint_vaapi_config_output (AVFilterLink *outlink)
 
static int deint_vaapi_filter_frame (AVFilterLink *inlink, AVFrame *input_frame)
 
static int deint_vaapi_request_frame (AVFilterLink *link)
 
static av_cold int deint_vaapi_init (AVFilterContext *avctx)
 

Variables

static const AVOption deint_vaapi_options []
 
static const AVClass deint_vaapi_class
 
static const AVFilterPad deint_vaapi_inputs []
 
static const AVFilterPad deint_vaapi_outputs []
 
const AVFilter ff_vf_deinterlace_vaapi
 

Macro Definition Documentation

◆ MAX_REFERENCES

#define MAX_REFERENCES   8

Definition at line 30 of file vf_deinterlace_vaapi.c.

◆ D

#define D (   name)    case VAProcDeinterlacing ## name: return #name

◆ OFFSET

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

Definition at line 365 of file vf_deinterlace_vaapi.c.

◆ FLAGS

Definition at line 366 of file vf_deinterlace_vaapi.c.

Function Documentation

◆ deint_vaapi_mode_name()

static const char* deint_vaapi_mode_name ( int  mode)
static

Definition at line 53 of file vf_deinterlace_vaapi.c.

Referenced by deint_vaapi_build_filter_params().

◆ deint_vaapi_pipeline_uninit()

static void deint_vaapi_pipeline_uninit ( AVFilterContext avctx)
static

Definition at line 67 of file vf_deinterlace_vaapi.c.

Referenced by deint_vaapi_init().

◆ deint_vaapi_build_filter_params()

static int deint_vaapi_build_filter_params ( AVFilterContext avctx)
static

Definition at line 79 of file vf_deinterlace_vaapi.c.

Referenced by deint_vaapi_init().

◆ deint_vaapi_config_output()

static int deint_vaapi_config_output ( AVFilterLink outlink)
static

Definition at line 159 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_filter_frame()

static int deint_vaapi_filter_frame ( AVFilterLink inlink,
AVFrame input_frame 
)
static

Definition at line 179 of file vf_deinterlace_vaapi.c.

Referenced by deint_vaapi_request_frame().

◆ deint_vaapi_request_frame()

static int deint_vaapi_request_frame ( AVFilterLink link)
static

Definition at line 334 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_init()

static av_cold int deint_vaapi_init ( AVFilterContext avctx)
static

Definition at line 353 of file vf_deinterlace_vaapi.c.

Variable Documentation

◆ deint_vaapi_options

const AVOption deint_vaapi_options[]
static
Initial value:
= {
{ "mode", "Deinterlacing mode",
OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = VAProcDeinterlacingNone },
VAProcDeinterlacingNone, VAProcDeinterlacingCount - 1, FLAGS, .unit = "mode" },
{ "default", "Use the highest-numbered (and therefore possibly most advanced) deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingNone }, 0, 0, FLAGS, .unit = "mode" },
{ "bob", "Use the bob deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingBob }, 0, 0, FLAGS, .unit = "mode" },
{ "weave", "Use the weave deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingWeave }, 0, 0, FLAGS, .unit = "mode" },
{ "motion_adaptive", "Use the motion adaptive deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionAdaptive }, 0, 0, FLAGS, .unit = "mode" },
{ "motion_compensated", "Use the motion compensated deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionCompensated }, 0, 0, FLAGS, .unit = "mode" },
{ "rate", "Generate output at frame rate or field rate",
OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 2, FLAGS, .unit = "rate" },
{ "frame", "Output at frame rate (one frame of output for each field-pair)",
0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, .unit = "rate" },
{ "field", "Output at field rate (one frame of output for each field)",
0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, FLAGS, .unit = "rate" },
{ "auto", "Only deinterlace fields, passing frames through unchanged",
OFFSET(auto_enable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL },
}

Definition at line 367 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_class

const AVClass deint_vaapi_class
static
Initial value:
= {
.class_name = "deinterlace_vaapi",
.item_name = av_default_item_name,
}

Definition at line 395 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_inputs

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

Definition at line 402 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_outputs

const AVFilterPad deint_vaapi_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = &deint_vaapi_request_frame,
.config_props = &deint_vaapi_config_output,
},
}

Definition at line 411 of file vf_deinterlace_vaapi.c.

◆ ff_vf_deinterlace_vaapi

const AVFilter ff_vf_deinterlace_vaapi
Initial value:
= {
.name = "deinterlace_vaapi",
.description = NULL_IF_CONFIG_SMALL("Deinterlacing of VAAPI surfaces"),
.priv_size = sizeof(DeintVAAPIContext),
.priv_class = &deint_vaapi_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 420 of file vf_deinterlace_vaapi.c.

OFFSET
#define OFFSET(x)
Definition: vf_deinterlace_vaapi.c:365
FLAGS
#define FLAGS
Definition: vf_deinterlace_vaapi.c:366
deint_vaapi_config_output
static int deint_vaapi_config_output(AVFilterLink *outlink)
Definition: vf_deinterlace_vaapi.c:159
deint_vaapi_init
static av_cold int deint_vaapi_init(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:353
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: vaapi_vpp.c:29
deint_vaapi_outputs
static const AVFilterPad deint_vaapi_outputs[]
Definition: vf_deinterlace_vaapi.c:411
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
deint_vaapi_request_frame
static int deint_vaapi_request_frame(AVFilterLink *link)
Definition: vf_deinterlace_vaapi.c:334
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
deint_vaapi_class
static const AVClass deint_vaapi_class
Definition: vf_deinterlace_vaapi.c:395
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
ff_vaapi_vpp_config_input
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:71
ff_vaapi_vpp_ctx_uninit
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:728
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: filters.h:206
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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:94
deint_vaapi_options
static const AVOption deint_vaapi_options[]
Definition: vf_deinterlace_vaapi.c:367
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
deint_vaapi_filter_frame
static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_deinterlace_vaapi.c:179
DeintVAAPIContext
Definition: vf_deinterlace_vaapi.c:32
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
deint_vaapi_inputs
static const AVFilterPad deint_vaapi_inputs[]
Definition: vf_deinterlace_vaapi.c:402