23#include <vdpau/vdpau.h>
41 VdpPictureInfoVP9 *
info = &pic_ctx->
info.vp9;
50 info->lastReference = VDP_INVALID_HANDLE;
51 info->goldenReference = VDP_INVALID_HANDLE;
52 info->altReference = VDP_INVALID_HANDLE;
54 if (
h->refs[
h->h.refidx[0]].f &&
h->refs[
h->h.refidx[0]].f->private_ref) {
57 if (
h->refs[
h->h.refidx[1]].f &&
h->refs[
h->h.refidx[1]].f->private_ref) {
60 if (
h->refs[
h->h.refidx[2]].f &&
h->refs[
h->h.refidx[2]].f->private_ref) {
64 info->profile =
h->h.profile;
65 info->frameContextIdx =
h->h.framectxid;
66 info->keyFrame =
h->h.keyframe;
67 info->showFrame = !
h->h.invisible;
68 info->errorResilient =
h->h.errorres;
69 info->frameParallelDecoding =
h->h.parallelmode;
74 info->intraOnly =
h->h.intraonly;
75 info->allowHighPrecisionMv =
h->h.keyframe ? 0 :
h->h.highprecisionmvs;
76 info->refreshEntropyProbs =
h->h.refreshctx;
81 info->loopFilterLevel =
h->h.filter.level;
82 info->loopFilterSharpness =
h->h.filter.sharpness;
83 info->modeRefLfEnabled =
h->h.lf_delta.enabled;
85 info->log2TileColumns =
h->h.tiling.log2_tile_cols;
86 info->log2TileRows =
h->h.tiling.log2_tile_rows;
88 info->segmentEnabled =
h->h.segmentation.enabled;
89 info->segmentMapUpdate =
h->h.segmentation.update_map;
90 info->segmentMapTemporalUpdate =
h->h.segmentation.temporal;
91 info->segmentFeatureMode =
h->h.segmentation.absolute_vals;
93 info->qpYAc =
h->h.yac_qi;
94 info->qpYDc =
h->h.ydc_qdelta;
95 info->qpChDc =
h->h.uvdc_qdelta;
96 info->qpChAc =
h->h.uvac_qdelta;
98 info->resetFrameContext =
h->h.resetctx;
99 info->mcompFilterType =
h->h.filtermode ^ (
h->h.filtermode <= 1);
100 info->uncompressedHeaderSize =
h->h.uncompressed_header_size;
101 info->compressedHeaderSize =
h->h.compressed_header_size;
102 info->refFrameSignBias[0] = 0;
106 info->mbModeLfDelta[
i] =
h->h.lf_delta.mode[
i];
109 info->mbRefLfDelta[
i] =
h->h.lf_delta.ref[
i];
112 info->mbSegmentTreeProbs[
i] =
h->h.segmentation.prob[
i];
115 info->activeRefIdx[
i] =
h->h.refidx[
i];
116 info->segmentPredProbs[
i] =
h->h.segmentation.pred_prob[
i];
117 info->refFrameSignBias[
i + 1] =
h->h.signbias[
i];
121 info->segmentFeatureEnable[
i][0] =
h->h.segmentation.feat[
i].q_enabled;
122 info->segmentFeatureEnable[
i][1] =
h->h.segmentation.feat[
i].lf_enabled;
123 info->segmentFeatureEnable[
i][2] =
h->h.segmentation.feat[
i].ref_enabled;
124 info->segmentFeatureEnable[
i][3] =
h->h.segmentation.feat[
i].skip_enabled;
126 info->segmentFeatureData[
i][0] =
h->h.segmentation.feat[
i].q_val;
127 info->segmentFeatureData[
i][1] =
h->h.segmentation.feat[
i].lf_val;
128 info->segmentFeatureData[
i][2] =
h->h.segmentation.feat[
i].ref_val;
129 info->segmentFeatureData[
i][3] = 0;
135 info->colorSpace = 0;
138 info->colorSpace = 1;
141 info->colorSpace = 2;
144 info->colorSpace = 3;
147 info->colorSpace = 4;
150 info->colorSpace = 5;
153 info->colorSpace = 6;
156 info->colorSpace = 7;
208 profile = VDP_DECODER_PROFILE_VP9_PROFILE_0;
211 profile = VDP_DECODER_PROFILE_VP9_PROFILE_1;
214 profile = VDP_DECODER_PROFILE_VP9_PROFILE_2;
217 profile = VDP_DECODER_PROFILE_VP9_PROFILE_3;
227 .p.name =
"vp9_vdpau",
static double val(void *priv, double ch)
Libavcodec external API header.
#define i(width, name, range_min, range_max)
int(* init)(AVBSFContext *ctx)
av_cold int ff_vdpau_common_uninit(AVCodecContext *avctx)
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
av_cold int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, const uint8_t *buf, uint32_t size)
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, struct vdpau_picture_context *pic_ctx)
int ff_vdpau_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
const struct FFHWAccel ff_vp9_vdpau_hwaccel
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
@ AVCOL_SPC_SMPTE240M
derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
@ AVCOL_SPC_RESERVED
reserved for future use by ITU-T and ISO/IEC just like 15-255 are
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
main external API structure.
int width
picture width / height.
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
int level
Encoding level descriptor.
enum AVColorSpace colorspace
YUV colorspace type.
int depth
Number of bits in the component.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
void * hwaccel_picture_private
RefStruct reference.
union VDPAUPictureInfo info
VDPAU picture information.
Public libavcodec VDPAU header.
static const uint8_t start_code_prefix[3]
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
static int vdpau_vp9_end_frame(AVCodecContext *avctx)
static int vdpau_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
static int vdpau_vp9_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, const uint8_t *buffer, uint32_t size)
static av_cold int vdpau_vp9_init(AVCodecContext *avctx)