FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_deinterlace_d3d12.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_d3d12va.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  DeinterlaceD3D12Context
 

Macros

#define COBJMACROS
 
#define MAX_REFERENCES   8
 
#define OFFSET(x)   offsetof(DeinterlaceD3D12Context, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Enumerations

enum  DeinterlaceD3D12Method { DEINT_D3D12_METHOD_DEFAULT = 0, DEINT_D3D12_METHOD_BOB = 1, DEINT_D3D12_METHOD_CUSTOM = 2 }
 Deinterlace method enumeration Maps to D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG values. More...
 

Functions

static av_cold int deint_d3d12_init (AVFilterContext *ctx)
 
static void release_d3d12_resources (DeinterlaceD3D12Context *s)
 
static void deint_d3d12_clear_queue (DeinterlaceD3D12Context *s)
 
static DXGI_COLOR_SPACE_TYPE get_dxgi_colorspace (enum AVColorSpace colorspace, enum AVColorTransferCharacteristic trc, int is_10bit)
 
static AVRational get_input_framerate (AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in)
 
static D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS get_deint_method (DeinterlaceD3D12Context *s, AVFilterContext *ctx)
 
static int deint_d3d12_configure_processor (DeinterlaceD3D12Context *s, AVFilterContext *ctx, AVFrame *in)
 
static void add_resource_barrier (D3D12_RESOURCE_BARRIER *barriers, int *count, ID3D12Resource *resource, D3D12_RESOURCE_STATES before, D3D12_RESOURCE_STATES after)
 
static int deint_d3d12_process_frame (AVFilterContext *ctx, AVFilterLink *outlink, AVFrame *input_frame, int field, int queue_idx)
 
static int deint_d3d12_filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int deint_d3d12_request_frame (AVFilterLink *link)
 
static int deint_d3d12_config_output (AVFilterLink *outlink)
 
static av_cold void deint_d3d12_uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (deinterlace_d3d12)
 

Variables

static const AVFilterPad deint_d3d12_inputs []
 
static const AVFilterPad deint_d3d12_outputs []
 
static const AVOption deinterlace_d3d12_options []
 
const FFFilter ff_vf_deinterlace_d3d12
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file vf_deinterlace_d3d12.c.

◆ MAX_REFERENCES

#define MAX_REFERENCES   8

Definition at line 34 of file vf_deinterlace_d3d12.c.

◆ OFFSET

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

Definition at line 1084 of file vf_deinterlace_d3d12.c.

◆ FLAGS

Definition at line 1085 of file vf_deinterlace_d3d12.c.

Enumeration Type Documentation

◆ DeinterlaceD3D12Method

Deinterlace method enumeration Maps to D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG values.

Enumerator
DEINT_D3D12_METHOD_DEFAULT 
DEINT_D3D12_METHOD_BOB 
DEINT_D3D12_METHOD_CUSTOM 

Definition at line 40 of file vf_deinterlace_d3d12.c.

Function Documentation

◆ deint_d3d12_init()

static av_cold int deint_d3d12_init ( AVFilterContext ctx)
static

Definition at line 101 of file vf_deinterlace_d3d12.c.

◆ release_d3d12_resources()

static void release_d3d12_resources ( DeinterlaceD3D12Context s)
static

Definition at line 109 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_config_output(), and deint_d3d12_uninit().

◆ deint_d3d12_clear_queue()

static void deint_d3d12_clear_queue ( DeinterlaceD3D12Context s)
static

Definition at line 165 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_config_output(), and deint_d3d12_uninit().

◆ get_dxgi_colorspace()

static DXGI_COLOR_SPACE_TYPE get_dxgi_colorspace ( enum AVColorSpace  colorspace,
enum AVColorTransferCharacteristic  trc,
int  is_10bit 
)
static

Definition at line 173 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_filter_frame().

◆ get_input_framerate()

static AVRational get_input_framerate ( AVFilterContext ctx,
AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 203 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_filter_frame().

◆ get_deint_method()

static D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS get_deint_method ( DeinterlaceD3D12Context s,
AVFilterContext ctx 
)
static

Definition at line 223 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_configure_processor().

◆ deint_d3d12_configure_processor()

static int deint_d3d12_configure_processor ( DeinterlaceD3D12Context s,
AVFilterContext ctx,
AVFrame in 
)
static

Definition at line 261 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_filter_frame().

◆ add_resource_barrier()

static void add_resource_barrier ( D3D12_RESOURCE_BARRIER *  barriers,
int *  count,
ID3D12Resource *  resource,
D3D12_RESOURCE_STATES  before,
D3D12_RESOURCE_STATES  after 
)
static

Definition at line 509 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_process_frame().

◆ deint_d3d12_process_frame()

static int deint_d3d12_process_frame ( AVFilterContext ctx,
AVFilterLink outlink,
AVFrame input_frame,
int  field,
int  queue_idx 
)
static

Definition at line 526 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_filter_frame().

◆ deint_d3d12_filter_frame()

static int deint_d3d12_filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 782 of file vf_deinterlace_d3d12.c.

Referenced by deint_d3d12_request_frame().

◆ deint_d3d12_request_frame()

static int deint_d3d12_request_frame ( AVFilterLink link)
static

Definition at line 960 of file vf_deinterlace_d3d12.c.

◆ deint_d3d12_config_output()

static int deint_d3d12_config_output ( AVFilterLink outlink)
static

Definition at line 980 of file vf_deinterlace_d3d12.c.

◆ deint_d3d12_uninit()

static av_cold void deint_d3d12_uninit ( AVFilterContext ctx)
static

Definition at line 1056 of file vf_deinterlace_d3d12.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( deinterlace_d3d12  )

Variable Documentation

◆ deint_d3d12_inputs

const AVFilterPad deint_d3d12_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = deint_d3d12_filter_frame,
},
}

Definition at line 1067 of file vf_deinterlace_d3d12.c.

◆ deint_d3d12_outputs

const AVFilterPad deint_d3d12_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = deint_d3d12_request_frame,
.config_props = deint_d3d12_config_output,
},
}

Definition at line 1075 of file vf_deinterlace_d3d12.c.

◆ deinterlace_d3d12_options

const AVOption deinterlace_d3d12_options[]
static
Initial value:
= {
{ "method", "Deinterlacing method",
{ "default", "Use best available deinterlacing method",
0, AV_OPT_TYPE_CONST, { .i64 = DEINT_D3D12_METHOD_DEFAULT }, 0, 0, FLAGS, .unit = "method" },
{ "bob", "Bob deinterlacing (simple field interpolation)",
0, AV_OPT_TYPE_CONST, { .i64 = DEINT_D3D12_METHOD_BOB }, 0, 0, FLAGS, .unit = "method" },
{ "custom", "Driver-defined advanced deinterlacing",
0, AV_OPT_TYPE_CONST, { .i64 = DEINT_D3D12_METHOD_CUSTOM }, 0, 0, FLAGS, .unit = "method" },
{ "mode", "Specify the interlacing mode",
OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, .unit = "mode" },
{ "frame", "Send one frame for each frame",
0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, .unit = "mode" },
{ "field", "Send one frame for each field",
0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, .unit = "mode" },
{ "deint", "Specify which frames to deinterlace",
OFFSET(deint), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, .unit = "deint" },
{ "all", "Deinterlace all frames",
0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, .unit = "deint" },
{ "interlaced", "Only deinterlace frames marked as interlaced",
0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, .unit = "deint" },
{ NULL }
}

Definition at line 1087 of file vf_deinterlace_d3d12.c.

◆ ff_vf_deinterlace_d3d12

const FFFilter ff_vf_deinterlace_d3d12
Initial value:
= {
.p.name = "deinterlace_d3d12",
.p.description = NULL_IF_CONFIG_SMALL("Deinterlacing using Direct3D12 Video Processor"),
.priv_size = sizeof(DeinterlaceD3D12Context),
.p.priv_class = &deinterlace_d3d12_class,
.uninit = deint_d3d12_uninit,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 1117 of file vf_deinterlace_d3d12.c.

deint_d3d12_request_frame
static int deint_d3d12_request_frame(AVFilterLink *link)
Definition: vf_deinterlace_d3d12.c:960
deint_d3d12_filter_frame
static int deint_d3d12_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_deinterlace_d3d12.c:782
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:264
mode
Definition: swscale.c:56
DEINT_D3D12_METHOD_BOB
@ DEINT_D3D12_METHOD_BOB
Definition: vf_deinterlace_d3d12.c:42
FLAGS
#define FLAGS
Definition: vf_deinterlace_d3d12.c:1085
OFFSET
#define OFFSET(x)
Definition: vf_deinterlace_d3d12.c:1084
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:265
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_D3D12
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
Definition: pixfmt.h:440
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:208
DEINT_D3D12_METHOD_CUSTOM
@ DEINT_D3D12_METHOD_CUSTOM
Definition: vf_deinterlace_d3d12.c:43
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
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:188
deint_d3d12_config_output
static int deint_d3d12_config_output(AVFilterLink *outlink)
Definition: vf_deinterlace_d3d12.c:980
DEINT_D3D12_METHOD_DEFAULT
@ DEINT_D3D12_METHOD_DEFAULT
Definition: vf_deinterlace_d3d12.c:41
DeinterlaceD3D12Context
Definition: vf_deinterlace_d3d12.c:46
deint_d3d12_uninit
static av_cold void deint_d3d12_uninit(AVFilterContext *ctx)
Definition: vf_deinterlace_d3d12.c:1056
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
deint_d3d12_inputs
static const AVFilterPad deint_d3d12_inputs[]
Definition: vf_deinterlace_d3d12.c:1067
deint_d3d12_init
static av_cold int deint_d3d12_init(AVFilterContext *ctx)
Definition: vf_deinterlace_d3d12.c:101
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:254
deint_d3d12_outputs
static const AVFilterPad deint_d3d12_outputs[]
Definition: vf_deinterlace_d3d12.c:1075