FFmpeg
Data Structures | Macros | Functions | Variables
vf_mestimate_d3d12.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_d3d12va_internal.h"
#include "libavutil/hwcontext_d3d12va.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/motion_vector.h"
#include "libavutil/mem.h"
#include "avfilter.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  MEstimateD3D12Context
 

Macros

#define OFFSET(x)   offsetof(MEstimateD3D12Context, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static int mestimate_d3d12_init (AVFilterContext *ctx)
 
static int mestimate_d3d12_create_objects (AVFilterContext *ctx)
 
static int mestimate_d3d12_create_motion_estimator (AVFilterContext *ctx, int width, int height)
 
static int mestimate_d3d12_config_props (AVFilterLink *outlink)
 
static int mestimate_d3d12_sync_gpu (MEstimateD3D12Context *s)
 
static void d3d12_barrier_transition (D3D12_RESOURCE_BARRIER *barrier, ID3D12Resource *resource, D3D12_RESOURCE_STATES state_before, D3D12_RESOURCE_STATES state_after)
 
static void add_mv_data (AVMotionVector *mv, int mb_size, int x, int y, int x_mv, int y_mv, int dir)
 
static int mestimate_d3d12_read_motion_vectors (AVFilterContext *ctx, AVFrame *out, int direction)
 
static int mestimate_d3d12_filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold void mestimate_d3d12_uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (mestimate_d3d12)
 

Variables

static const AVFilterPad mestimate_d3d12_inputs []
 
static const AVFilterPad mestimate_d3d12_outputs []
 
static const AVOption mestimate_d3d12_options []
 
const FFFilter ff_vf_mestimate_d3d12
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 961 of file vf_mestimate_d3d12.c.

◆ FLAGS

Definition at line 962 of file vf_mestimate_d3d12.c.

Function Documentation

◆ mestimate_d3d12_init()

static int mestimate_d3d12_init ( AVFilterContext ctx)
static

Definition at line 86 of file vf_mestimate_d3d12.c.

◆ mestimate_d3d12_create_objects()

static int mestimate_d3d12_create_objects ( AVFilterContext ctx)
static

Definition at line 111 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_config_props().

◆ mestimate_d3d12_create_motion_estimator()

static int mestimate_d3d12_create_motion_estimator ( AVFilterContext ctx,
int  width,
int  height 
)
static

Definition at line 170 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_config_props().

◆ mestimate_d3d12_config_props()

static int mestimate_d3d12_config_props ( AVFilterLink outlink)
static

Definition at line 366 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_filter_frame().

◆ mestimate_d3d12_sync_gpu()

static int mestimate_d3d12_sync_gpu ( MEstimateD3D12Context s)
static

Definition at line 426 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_filter_frame().

◆ d3d12_barrier_transition()

static void d3d12_barrier_transition ( D3D12_RESOURCE_BARRIER *  barrier,
ID3D12Resource *  resource,
D3D12_RESOURCE_STATES  state_before,
D3D12_RESOURCE_STATES  state_after 
)
inlinestatic

Definition at line 439 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_filter_frame().

◆ add_mv_data()

static void add_mv_data ( AVMotionVector mv,
int  mb_size,
int  x,
int  y,
int  x_mv,
int  y_mv,
int  dir 
)
static

Definition at line 452 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_read_motion_vectors().

◆ mestimate_d3d12_read_motion_vectors()

static int mestimate_d3d12_read_motion_vectors ( AVFilterContext ctx,
AVFrame out,
int  direction 
)
static

Definition at line 468 of file vf_mestimate_d3d12.c.

Referenced by mestimate_d3d12_filter_frame().

◆ mestimate_d3d12_filter_frame()

static int mestimate_d3d12_filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 552 of file vf_mestimate_d3d12.c.

◆ mestimate_d3d12_uninit()

static av_cold void mestimate_d3d12_uninit ( AVFilterContext ctx)
static

Definition at line 916 of file vf_mestimate_d3d12.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( mestimate_d3d12  )

Variable Documentation

◆ mestimate_d3d12_inputs

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

Definition at line 945 of file vf_mestimate_d3d12.c.

◆ mestimate_d3d12_outputs

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

Definition at line 953 of file vf_mestimate_d3d12.c.

◆ mestimate_d3d12_options

const AVOption mestimate_d3d12_options[]
static
Initial value:
= {
{ "mb_size", "macroblock size, only 8 and 16 are supported", OFFSET(block_size), AV_OPT_TYPE_INT, {.i64 = 16}, 8, 16, FLAGS },
{ NULL }
}

Definition at line 964 of file vf_mestimate_d3d12.c.

◆ ff_vf_mestimate_d3d12

const FFFilter ff_vf_mestimate_d3d12
Initial value:
= {
.p.name = "mestimate_d3d12",
.p.description = NULL_IF_CONFIG_SMALL("Generate motion vectors using D3D12 hardware acceleration."),
.p.priv_class = &mestimate_d3d12_class,
.priv_size = sizeof(MEstimateD3D12Context),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 971 of file vf_mestimate_d3d12.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:263
mestimate_d3d12_init
static int mestimate_d3d12_init(AVFilterContext *ctx)
Definition: vf_mestimate_d3d12.c:86
FLAGS
#define FLAGS
Definition: vf_mestimate_d3d12.c:962
mestimate_d3d12_uninit
static av_cold void mestimate_d3d12_uninit(AVFilterContext *ctx)
Definition: vf_mestimate_d3d12.c:916
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:264
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_D3D12
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
Definition: pixfmt.h:440
OFFSET
#define OFFSET(x)
Definition: vf_mestimate_d3d12.c:961
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:207
mestimate_d3d12_config_props
static int mestimate_d3d12_config_props(AVFilterLink *outlink)
Definition: vf_mestimate_d3d12.c:366
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:550
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
MEstimateD3D12Context
Definition: vf_mestimate_d3d12.c:37
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:188
mestimate_d3d12_outputs
static const AVFilterPad mestimate_d3d12_outputs[]
Definition: vf_mestimate_d3d12.c:953
mestimate_d3d12_filter_frame
static int mestimate_d3d12_filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_mestimate_d3d12.c:552
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:183
mestimate_d3d12_inputs
static const AVFilterPad mestimate_d3d12_inputs[]
Definition: vf_mestimate_d3d12.c:945
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:253