23#include "config_components.h"
42 CUVIDPICPARAMS *pp = &
ctx->pic_params;
43 CUVIDVP9PICPARAMS *ppc = &pp->CodecSpecific.vp9;
57 *pp = (CUVIDPICPARAMS) {
58 .PicWidthInMbs = (cur_frame->
width + 15) / 16,
59 .FrameHeightInMbs = (cur_frame->
height + 15) / 16,
60 .CurrPicIdx = cf->
idx,
62 .CodecSpecific.vp9 = {
63 .width = cur_frame->
width,
64 .height = cur_frame->
height,
70 .profile =
h->h.profile,
71 .frameContextIdx =
h->h.framectxid,
72 .frameType = !
h->h.keyframe,
73 .showFrame = !
h->h.invisible,
74 .errorResilient =
h->h.errorres,
75 .frameParallelDecoding =
h->h.parallelmode,
78 .intraOnly =
h->h.intraonly,
79 .allow_high_precision_mv =
h->h.keyframe ? 0 :
h->h.highprecisionmvs,
80 .refreshEntropyProbs =
h->h.refreshctx,
82 .bitDepthMinus8Luma = pixdesc->
comp[0].
depth - 8,
83 .bitDepthMinus8Chroma = pixdesc->
comp[1].
depth - 8,
85 .loopFilterLevel =
h->h.filter.level,
86 .loopFilterSharpness =
h->h.filter.sharpness,
87 .modeRefLfEnabled =
h->h.lf_delta.enabled,
89 .log2_tile_columns =
h->h.tiling.log2_tile_cols,
90 .log2_tile_rows =
h->h.tiling.log2_tile_rows,
92 .segmentEnabled =
h->h.segmentation.enabled,
93 .segmentMapUpdate =
h->h.segmentation.update_map,
94 .segmentMapTemporalUpdate =
h->h.segmentation.temporal,
95 .segmentFeatureMode =
h->h.segmentation.absolute_vals,
98 .qpYDc =
h->h.ydc_qdelta,
99 .qpChDc =
h->h.uvdc_qdelta,
100 .qpChAc =
h->h.uvac_qdelta,
102 .resetFrameContext =
h->h.resetctx,
103 .mcomp_filter_type =
h->h.filtermode ^ (
h->h.filtermode <= 1),
105 .frameTagSize =
h->h.uncompressed_header_size,
106 .offsetToDctParts =
h->h.compressed_header_size,
108 .refFrameSignBias[0] = 0,
112 for (
i = 0;
i < 2;
i++)
113 ppc->mbModeLfDelta[
i] =
h->h.lf_delta.mode[
i];
115 for (
i = 0;
i < 4;
i++)
116 ppc->mbRefLfDelta[
i] =
h->h.lf_delta.ref[
i];
118 for (
i = 0;
i < 7;
i++)
119 ppc->mb_segment_tree_probs[
i] =
h->h.segmentation.prob[
i];
121 for (
i = 0;
i < 3;
i++) {
122 ppc->activeRefIdx[
i] =
h->h.refidx[
i];
123 ppc->segment_pred_probs[
i] =
h->h.segmentation.pred_prob[
i];
124 ppc->refFrameSignBias[
i + 1] =
h->h.signbias[
i];
127 for (
i = 0;
i < 8;
i++) {
128 ppc->segmentFeatureEnable[
i][0] =
h->h.segmentation.feat[
i].q_enabled;
129 ppc->segmentFeatureEnable[
i][1] =
h->h.segmentation.feat[
i].lf_enabled;
130 ppc->segmentFeatureEnable[
i][2] =
h->h.segmentation.feat[
i].ref_enabled;
131 ppc->segmentFeatureEnable[
i][3] =
h->h.segmentation.feat[
i].skip_enabled;
133 ppc->segmentFeatureData[
i][0] =
h->h.segmentation.feat[
i].q_val;
134 ppc->segmentFeatureData[
i][1] =
h->h.segmentation.feat[
i].lf_val;
135 ppc->segmentFeatureData[
i][2] =
h->h.segmentation.feat[
i].ref_val;
136 ppc->segmentFeatureData[
i][3] = 0;
178#if CONFIG_VP9_NVDEC_HWACCEL
186 .p.name =
"vp9_nvdec",
193 .frame_params = nvdec_vp9_cuda_frame_params,
200#if CONFIG_VP9_NVDEC_CUARRAY_HWACCEL
208 .p.name =
"vp9_nvdec_cuarray",
215 .frame_params = nvdec_vp9_cuarray_frame_params,
static AVFormatContext * ctx
Libavcodec external API header.
#define i(width, name, range_min, range_max)
const struct FFHWAccel ff_vp9_nvdec_hwaccel
const struct FFHWAccel ff_vp9_nvdec_cuarray_hwaccel
common internal api header.
int ff_nvdec_simple_end_frame(AVCodecContext *avctx)
int ff_nvdec_simple_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
int ff_nvdec_decode_init(AVCodecContext *avctx)
int ff_nvdec_get_ref_idx(AVFrame *frame)
int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame)
int ff_nvdec_decode_uninit(AVCodecContext *avctx)
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, enum AVPixelFormat hw_format, int dpb_size, int supports_444)
static int nvdec_vp9_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, const uint8_t *buffer, uint32_t size)
static int nvdec_vp9_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, enum AVPixelFormat hw_format)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
@ AV_PIX_FMT_CUARRAY
hardware decoding through openharmony
@ 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
A reference to a data buffer.
main external API structure.
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
enum AVColorSpace colorspace
YUV colorspace type.
struct AVCodecInternal * internal
Private context used for internal data.
void * hwaccel_priv_data
hwaccel-specific private data
int depth
Number of bits in the component.
This structure describes decoded (raw) audio or video data.
void * private_ref
RefStruct reference for internal use by a single libav* library.
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.
This struct stores per-frame lavc-internal data and is attached to it via private_ref.