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 "formats.h"
#include "internal.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 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 31 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 328 of file vf_deinterlace_vaapi.c.

◆ FLAGS

Definition at line 329 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 51 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 65 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 77 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 157 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 175 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_init()

static av_cold int deint_vaapi_init ( AVFilterContext avctx)
static

Definition at line 316 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, "mode" },
{ "default", "Use the highest-numbered (and therefore possibly most advanced) deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingNone }, 0, 0, FLAGS, "mode" },
{ "bob", "Use the bob deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingBob }, 0, 0, FLAGS, "mode" },
{ "weave", "Use the weave deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingWeave }, 0, 0, FLAGS, "mode" },
{ "motion_adaptive", "Use the motion adaptive deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionAdaptive }, 0, 0, FLAGS, "mode" },
{ "motion_compensated", "Use the motion compensated deinterlacing algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionCompensated }, 0, 0, FLAGS, "mode" },
{ "rate", "Generate output at frame rate or field rate",
OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 2, FLAGS, "rate" },
{ "frame", "Output at frame rate (one frame of output for each field-pair)",
0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "rate" },
{ "field", "Output at field rate (one frame of output for each field)",
0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, FLAGS, "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 330 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 358 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 365 of file vf_deinterlace_vaapi.c.

◆ deint_vaapi_outputs

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

Definition at line 374 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 382 of file vf_deinterlace_vaapi.c.

OFFSET
#define OFFSET(x)
Definition: vf_deinterlace_vaapi.c:328
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:371
FLAGS
#define FLAGS
Definition: vf_deinterlace_vaapi.c:329
deint_vaapi_config_output
static int deint_vaapi_config_output(AVFilterLink *outlink)
Definition: vf_deinterlace_vaapi.c:157
deint_vaapi_init
static av_cold int deint_vaapi_init(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:316
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:168
init
static int init
Definition: av_tx.c:47
deint_vaapi_outputs
static const AVFilterPad deint_vaapi_outputs[]
Definition: vf_deinterlace_vaapi.c:374
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
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:358
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
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:680
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
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
deint_vaapi_options
static const AVOption deint_vaapi_options[]
Definition: vf_deinterlace_vaapi.c:330
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
deint_vaapi_filter_frame
static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_deinterlace_vaapi.c:175
DeintVAAPIContext
Definition: vf_deinterlace_vaapi.c:33
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:282
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
deint_vaapi_inputs
static const AVFilterPad deint_vaapi_inputs[]
Definition: vf_deinterlace_vaapi.c:365