23 #include <vdpau/vdpau.h>
42 VdpPictureInfoVP9 *
info = &pic_ctx->
info.vp9;
51 info->lastReference = VDP_INVALID_HANDLE;
52 info->goldenReference = VDP_INVALID_HANDLE;
53 info->altReference = VDP_INVALID_HANDLE;
55 if (
h->refs[
h->h.refidx[0]].f &&
h->refs[
h->h.refidx[0]].f->private_ref) {
58 if (
h->refs[
h->h.refidx[1]].f &&
h->refs[
h->h.refidx[1]].f->private_ref) {
61 if (
h->refs[
h->h.refidx[2]].f &&
h->refs[
h->h.refidx[2]].f->private_ref) {
65 info->profile =
h->h.profile;
66 info->frameContextIdx =
h->h.framectxid;
67 info->keyFrame =
h->h.keyframe;
68 info->showFrame = !
h->h.invisible;
69 info->errorResilient =
h->h.errorres;
70 info->frameParallelDecoding =
h->h.parallelmode;
75 info->intraOnly =
h->h.intraonly;
76 info->allowHighPrecisionMv =
h->h.keyframe ? 0 :
h->h.highprecisionmvs;
77 info->refreshEntropyProbs =
h->h.refreshctx;
82 info->loopFilterLevel =
h->h.filter.level;
83 info->loopFilterSharpness =
h->h.filter.sharpness;
84 info->modeRefLfEnabled =
h->h.lf_delta.enabled;
86 info->log2TileColumns =
h->h.tiling.log2_tile_cols;
87 info->log2TileRows =
h->h.tiling.log2_tile_rows;
89 info->segmentEnabled =
h->h.segmentation.enabled;
90 info->segmentMapUpdate =
h->h.segmentation.update_map;
91 info->segmentMapTemporalUpdate =
h->h.segmentation.temporal;
92 info->segmentFeatureMode =
h->h.segmentation.absolute_vals;
94 info->qpYAc =
h->h.yac_qi;
95 info->qpYDc =
h->h.ydc_qdelta;
96 info->qpChDc =
h->h.uvdc_qdelta;
97 info->qpChAc =
h->h.uvac_qdelta;
99 info->resetFrameContext =
h->h.resetctx;
100 info->mcompFilterType =
h->h.filtermode ^ (
h->h.filtermode <= 1);
101 info->uncompressedHeaderSize =
h->h.uncompressed_header_size;
102 info->compressedHeaderSize =
h->h.compressed_header_size;
103 info->refFrameSignBias[0] = 0;
107 info->mbModeLfDelta[
i] =
h->h.lf_delta.mode[
i];
110 info->mbRefLfDelta[
i] =
h->h.lf_delta.ref[
i];
113 info->mbSegmentTreeProbs[
i] =
h->h.segmentation.prob[
i];
116 info->activeRefIdx[
i] =
h->h.refidx[
i];
117 info->segmentPredProbs[
i] =
h->h.segmentation.pred_prob[
i];
118 info->refFrameSignBias[
i + 1] =
h->h.signbias[
i];
122 info->segmentFeatureEnable[
i][0] =
h->h.segmentation.feat[
i].q_enabled;
123 info->segmentFeatureEnable[
i][1] =
h->h.segmentation.feat[
i].lf_enabled;
124 info->segmentFeatureEnable[
i][2] =
h->h.segmentation.feat[
i].ref_enabled;
125 info->segmentFeatureEnable[
i][3] =
h->h.segmentation.feat[
i].skip_enabled;
127 info->segmentFeatureData[
i][0] =
h->h.segmentation.feat[
i].q_val;
128 info->segmentFeatureData[
i][1] =
h->h.segmentation.feat[
i].lf_val;
129 info->segmentFeatureData[
i][2] =
h->h.segmentation.feat[
i].ref_val;
130 info->segmentFeatureData[
i][3] = 0;
136 info->colorSpace = 0;
139 info->colorSpace = 1;
142 info->colorSpace = 2;
145 info->colorSpace = 3;
148 info->colorSpace = 4;
151 info->colorSpace = 5;
154 info->colorSpace = 6;
157 info->colorSpace = 7;
209 profile = VDP_DECODER_PROFILE_VP9_PROFILE_0;
212 profile = VDP_DECODER_PROFILE_VP9_PROFILE_1;
215 profile = VDP_DECODER_PROFILE_VP9_PROFILE_2;
218 profile = VDP_DECODER_PROFILE_VP9_PROFILE_3;
static double val(void *priv, double ch)
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
int ff_vdpau_common_uninit(AVCodecContext *avctx)
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
common internal API header
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 / SMPTE RP177 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)
@ 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
@ AVCOL_SPC_SMPTE240M
functionally identical to above
#define FF_ARRAY_ELEMS(a)
main external API structure.
int width
picture width / height.
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
enum AVColorSpace colorspace
YUV colorspace type.
int depth
Number of bits in the component.
const char * name
Name of the hardware accelerated codec.
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
union VDPAUPictureInfo info
VDPAU picture information.
Public libavcodec VDPAU header.
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
const AVHWAccel ff_vp9_vdpau_hwaccel
static const uint8_t start_code_prefix[3]
static int vdpau_vp9_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
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_init(AVCodecContext *avctx)