FFmpeg
Loading...
Searching...
No Matches
dxva2_internal.h File Reference
#include "config.h"
#include "config_components.h"
#include <objbase.h>
#include "libavutil/hwcontext.h"
#include "avcodec.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

union  AVDXVAContext
 
struct  FFDXVASharedContext
 

Macros

#define COBJMACROS
 
#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG   1
 Work around for DXVA2/Direct3D11 and old UVD/UVD+ ATI video cards.
 
#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO   2
 Work around for DXVA2/Direct3D11 and old Intel GPUs with ClearVideo interface.
 
#define DXVA2_VAR(ctx, var)
 
#define D3D11VA_VAR(ctx, var)
 
#define DXVA_SHARED_CONTEXT(avctx)
 
#define DXVA_CONTEXT(avctx)
 
#define D3D11VA_CONTEXT(ctx)
 
#define DXVA2_CONTEXT(ctx)
 
#define DXVA2_CONTEXT_VAR(avctx, ctx, var)
 
#define DXVA_CONTEXT_REPORT_ID(avctx, ctx)
 
#define DXVA_CONTEXT_WORKAROUND(avctx, ctx)
 
#define DXVA_CONTEXT_COUNT(avctx, ctx)
 
#define DXVA_CONTEXT_DECODER(avctx, ctx)
 
#define DXVA_CONTEXT_CFG(avctx, ctx)
 
#define DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx)
 
#define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx)
 
#define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx)
 
#define DXVA_CONTEXT_VALID(avctx, ctx)
 

Typedefs

typedef void DECODER_BUFFER_DESC
 

Functions

unsigned ff_dxva2_get_surface_index (const AVCodecContext *avctx, AVDXVAContext *, const AVFrame *frame, int curr)
 
int ff_dxva2_commit_buffer (AVCodecContext *, AVDXVAContext *, DECODER_BUFFER_DESC *, unsigned type, const void *data, unsigned size, unsigned mb_count)
 
int ff_dxva2_common_end_frame (AVCodecContext *, AVFrame *, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*commit_bs_si)(AVCodecContext *, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *slice))
 
int ff_dxva2_decode_init (AVCodecContext *avctx)
 
int ff_dxva2_decode_uninit (AVCodecContext *avctx)
 
int ff_dxva2_common_frame_params (AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
 
int ff_dxva2_is_d3d11 (const AVCodecContext *avctx)
 
unsigned * ff_dxva2_get_report_id (const AVCodecContext *avctx, AVDXVAContext *ctx)
 
void ff_dxva2_h264_fill_picture_parameters (const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_H264 *pp)
 
void ff_dxva2_h264_fill_scaling_lists (const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_H264 *qm)
 
void ff_dxva2_mpeg2_fill_picture_parameters (AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PictureParameters *pp)
 
void ff_dxva2_mpeg2_fill_quantization_matrices (AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_QmatrixData *qm)
 
void ff_dxva2_mpeg2_fill_slice (AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, const uint8_t *buffer, unsigned size)
 
void ff_dxva2_vc1_fill_picture_parameters (AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PictureParameters *pp)
 
void ff_dxva2_vc1_fill_slice (AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, unsigned size)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file dxva2_internal.h.

◆ FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG

#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG   1

Work around for DXVA2/Direct3D11 and old UVD/UVD+ ATI video cards.

Definition at line 34 of file dxva2_internal.h.

Referenced by ff_dxva2_h264_fill_picture_parameters(), and ff_dxva2_h264_fill_scaling_lists().

◆ FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO

#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO   2

Work around for DXVA2/Direct3D11 and old Intel GPUs with ClearVideo interface.

Definition at line 35 of file dxva2_internal.h.

Referenced by dxva_get_decoder_guid(), ff_dxva2_h264_fill_picture_parameters(), and fill_slice_long().

◆ DXVA2_VAR

#define DXVA2_VAR ( ctx,
var )
Value:
0

Definition at line 42 of file dxva2_internal.h.

◆ D3D11VA_VAR

#define D3D11VA_VAR ( ctx,
var )
Value:
0

Definition at line 50 of file dxva2_internal.h.

◆ DXVA_SHARED_CONTEXT

◆ DXVA_CONTEXT

◆ D3D11VA_CONTEXT

◆ DXVA2_CONTEXT

◆ DXVA2_CONTEXT_VAR

#define DXVA2_CONTEXT_VAR ( avctx,
ctx,
var )
Value:
(avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? D3D11VA_VAR(ctx, var) : DXVA2_VAR(ctx, var)))
int ff_dxva2_is_d3d11(const AVCodecContext *avctx)
Definition dxva2.c:1068
#define D3D11VA_VAR(ctx, var)
#define DXVA2_VAR(ctx, var)
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
Definition pixfmt.h:440

Definition at line 123 of file dxva2_internal.h.

◆ DXVA_CONTEXT_REPORT_ID

#define DXVA_CONTEXT_REPORT_ID ( avctx,
ctx )
Value:
unsigned * ff_dxva2_get_report_id(const AVCodecContext *avctx, AVDXVAContext *ctx)
Definition dxva2.c:1077

Definition at line 125 of file dxva2_internal.h.

Referenced by ff_dxva2_h264_fill_picture_parameters(), ff_dxva2_hevc_fill_picture_parameters(), ff_dxva2_vc1_fill_picture_parameters(), and ff_dxva2_vp9_fill_picture_parameters().

◆ DXVA_CONTEXT_WORKAROUND

#define DXVA_CONTEXT_WORKAROUND ( avctx,
ctx )
Value:
DXVA2_CONTEXT_VAR(avctx, ctx, workaround)
#define DXVA2_CONTEXT_VAR(avctx, ctx, var)

Definition at line 126 of file dxva2_internal.h.

Referenced by ff_dxva2_h264_fill_picture_parameters(), ff_dxva2_h264_fill_scaling_lists(), and fill_slice_long().

◆ DXVA_CONTEXT_COUNT

#define DXVA_CONTEXT_COUNT ( avctx,
ctx )
Value:
DXVA2_CONTEXT_VAR(avctx, ctx, surface_count)

Definition at line 127 of file dxva2_internal.h.

Referenced by ff_dxva2_get_surface_index().

◆ DXVA_CONTEXT_DECODER

#define DXVA_CONTEXT_DECODER ( avctx,
ctx )
Value:
(avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? (void *)D3D11VA_VAR(ctx, decoder) : (void *)DXVA2_VAR(ctx, decoder)))
static const chunk_decoder decoder[8]
Definition dfa.c:331

Definition at line 128 of file dxva2_internal.h.

◆ DXVA_CONTEXT_CFG

#define DXVA_CONTEXT_CFG ( avctx,
ctx )
Value:
(avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? (void *)D3D11VA_VAR(ctx, cfg) : (void *)DXVA2_VAR(ctx, cfg)))
static CheckasmConfig cfg
Definition checkasm.c:74

Definition at line 129 of file dxva2_internal.h.

◆ DXVA_CONTEXT_CFG_BITSTREAM

#define DXVA_CONTEXT_CFG_BITSTREAM ( avctx,
ctx )
Value:
DXVA2_CONTEXT_VAR(avctx, ctx, cfg->ConfigBitstreamRaw)

Definition at line 130 of file dxva2_internal.h.

Referenced by is_slice_short().

◆ DXVA_CONTEXT_CFG_INTRARESID

#define DXVA_CONTEXT_CFG_INTRARESID ( avctx,
ctx )
Value:
DXVA2_CONTEXT_VAR(avctx, ctx, cfg->ConfigIntraResidUnsigned)

Definition at line 131 of file dxva2_internal.h.

Referenced by ff_dxva2_vc1_fill_picture_parameters().

◆ DXVA_CONTEXT_CFG_RESIDACCEL

#define DXVA_CONTEXT_CFG_RESIDACCEL ( avctx,
ctx )
Value:
DXVA2_CONTEXT_VAR(avctx, ctx, cfg->ConfigResidDiffAccelerator)

Definition at line 132 of file dxva2_internal.h.

Referenced by ff_dxva2_vc1_fill_picture_parameters().

◆ DXVA_CONTEXT_VALID

#define DXVA_CONTEXT_VALID ( avctx,
ctx )
Value:
(DXVA_CONTEXT_DECODER(avctx, ctx) && \
DXVA_CONTEXT_CFG(avctx, ctx) && \
(ff_dxva2_is_d3d11(avctx) || DXVA2_VAR(ctx, surface_count)))
#define DXVA_CONTEXT_DECODER(avctx, ctx)

Definition at line 133 of file dxva2_internal.h.

Referenced by dxva2_av1_start_frame(), dxva2_h264_start_frame(), dxva2_hevc_start_frame(), dxva2_mpeg2_start_frame(), dxva2_vc1_start_frame(), and dxva2_vp9_start_frame().

Typedef Documentation

◆ DECODER_BUFFER_DESC

typedef void DECODER_BUFFER_DESC

Definition at line 72 of file dxva2_internal.h.

Function Documentation

◆ ff_dxva2_get_surface_index()

◆ ff_dxva2_commit_buffer()

◆ ff_dxva2_common_end_frame()

int ff_dxva2_common_end_frame ( AVCodecContext * avctx,
AVFrame * frame,
const void * pp,
unsigned pp_size,
const void * qm,
unsigned qm_size,
int(* commit_bs_si )(AVCodecContext *, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *slice) )

◆ ff_dxva2_decode_init()

int ff_dxva2_decode_init ( AVCodecContext * avctx)

Definition at line 668 of file dxva2.c.

◆ ff_dxva2_decode_uninit()

int ff_dxva2_decode_uninit ( AVCodecContext * avctx)

Definition at line 743 of file dxva2.c.

Referenced by dxva2_av1_uninit(), and ff_dxva2_decode_init().

◆ ff_dxva2_common_frame_params()

int ff_dxva2_common_frame_params ( AVCodecContext * avctx,
AVBufferRef * hw_frames_ctx )

Definition at line 602 of file dxva2.c.

◆ ff_dxva2_is_d3d11()

◆ ff_dxva2_get_report_id()

unsigned * ff_dxva2_get_report_id ( const AVCodecContext * avctx,
AVDXVAContext * ctx )

Definition at line 1077 of file dxva2.c.

◆ ff_dxva2_h264_fill_picture_parameters()

void ff_dxva2_h264_fill_picture_parameters ( const AVCodecContext * avctx,
AVDXVAContext * ctx,
DXVA_PicParams_H264 * pp )

Definition at line 51 of file dxva2_h264.c.

Referenced by d3d12va_h264_start_frame(), and dxva2_h264_start_frame().

◆ ff_dxva2_h264_fill_scaling_lists()

void ff_dxva2_h264_fill_scaling_lists ( const AVCodecContext * avctx,
AVDXVAContext * ctx,
DXVA_Qmatrix_H264 * qm )

Definition at line 168 of file dxva2_h264.c.

Referenced by d3d12va_h264_start_frame(), and dxva2_h264_start_frame().

◆ ff_dxva2_mpeg2_fill_picture_parameters()

void ff_dxva2_mpeg2_fill_picture_parameters ( AVCodecContext * avctx,
AVDXVAContext * ctx,
DXVA_PictureParameters * pp )

Definition at line 43 of file dxva2_mpeg2.c.

Referenced by d3d12va_mpeg2_start_frame(), and dxva2_mpeg2_start_frame().

◆ ff_dxva2_mpeg2_fill_quantization_matrices()

void ff_dxva2_mpeg2_fill_quantization_matrices ( AVCodecContext * avctx,
AVDXVAContext * ctx,
DXVA_QmatrixData * qm )

Definition at line 109 of file dxva2_mpeg2.c.

Referenced by d3d12va_mpeg2_start_frame(), and dxva2_mpeg2_start_frame().

◆ ff_dxva2_mpeg2_fill_slice()

void ff_dxva2_mpeg2_fill_slice ( AVCodecContext * avctx,
DXVA_SliceInfo * slice,
unsigned position,
const uint8_t * buffer,
unsigned size )

Definition at line 126 of file dxva2_mpeg2.c.

Referenced by d3d12va_mpeg2_decode_slice(), and dxva2_mpeg2_decode_slice().

◆ ff_dxva2_vc1_fill_picture_parameters()

void ff_dxva2_vc1_fill_picture_parameters ( AVCodecContext * avctx,
AVDXVAContext * ctx,
DXVA_PictureParameters * pp )

Definition at line 43 of file dxva2_vc1.c.

Referenced by d3d12va_vc1_start_frame(), and dxva2_vc1_start_frame().

◆ ff_dxva2_vc1_fill_slice()

void ff_dxva2_vc1_fill_slice ( AVCodecContext * avctx,
DXVA_SliceInfo * slice,
unsigned position,
unsigned size )

Definition at line 167 of file dxva2_vc1.c.

Referenced by d3d12va_vc1_decode_slice(), and dxva2_vc1_decode_slice().