23#include "config_components.h"
40 CUVIDPICPARAMS *pp = &
ctx->pic_params;
41 CUVIDMPEG2PICPARAMS *ppc = &pp->CodecSpecific.mpeg2;
44 AVFrame *cur_frame =
s->cur_pic.ptr->f;
55 *pp = (CUVIDPICPARAMS) {
56 .PicWidthInMbs = (cur_frame->
width + 15) / 16,
57 .FrameHeightInMbs = (cur_frame->
height + 15) / 16,
58 .CurrPicIdx = cf->
idx,
60 .field_pic_flag =
s->picture_structure !=
PICT_FRAME,
62 .second_field =
s->picture_structure !=
PICT_FRAME && !
s->first_field,
68 .CodecSpecific.mpeg2 = {
72 .picture_coding_type =
s->pict_type,
73 .full_pel_forward_vector =
s->full_pel[0],
74 .full_pel_backward_vector =
s->full_pel[1],
75 .f_code = { {
s->mpeg_f_code[0][0],
76 s->mpeg_f_code[0][1] },
77 {
s->mpeg_f_code[1][0],
78 s->mpeg_f_code[1][1] } },
79 .intra_dc_precision =
s->intra_dc_precision,
80 .frame_pred_frame_dct =
s->frame_pred_frame_dct,
81 .concealment_motion_vectors =
s->concealment_motion_vectors,
82 .q_scale_type =
s->q_scale_type,
83 .intra_vlc_format =
s->intra_vlc_format,
84 .alternate_scan =
s->alternate_scan,
85 .top_field_first =
s->top_field_first,
89 for (
i = 0;
i < 64; ++
i) {
90 int n =
s->idsp.idct_permutation[
i];
91 ppc->QuantMatrixIntra[
i] =
s->intra_matrix[n];
92 ppc->QuantMatrixInter[
i] =
s->inter_matrix[n];
106#if CONFIG_MPEG1_NVDEC_HWACCEL || CONFIG_MPEG2_NVDEC_HWACCEL
114#if CONFIG_MPEG2_NVDEC_HWACCEL
116 .p.name =
"mpeg2_nvdec",
123 .frame_params = nvdec_mpeg12_cuda_frame_params,
130#if CONFIG_MPEG1_NVDEC_CUARRAY_HWACCEL || CONFIG_MPEG2_NVDEC_CUARRAY_HWACCEL
131static int nvdec_mpeg12_cuarray_frame_params(
AVCodecContext *avctx,
138#if CONFIG_MPEG2_NVDEC_CUARRAY_HWACCEL
140 .p.name =
"mpeg2_nvdec_cuarray",
147 .frame_params = nvdec_mpeg12_cuarray_frame_params,
154#if CONFIG_MPEG1_NVDEC_HWACCEL
156 .p.name =
"mpeg1_nvdec",
163 .frame_params = nvdec_mpeg12_cuda_frame_params,
170#if CONFIG_MPEG1_NVDEC_CUARRAY_HWACCEL
172 .p.name =
"mpeg1_nvdec_cuarray",
179 .frame_params = nvdec_mpeg12_cuarray_frame_params,
static AVFormatContext * ctx
Libavcodec external API header.
#define i(width, name, range_min, range_max)
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
const struct FFHWAccel ff_mpeg2_nvdec_cuarray_hwaccel
const struct FFHWAccel ff_mpeg1_nvdec_cuarray_hwaccel
const struct FFHWAccel ff_mpeg1_nvdec_hwaccel
const struct FFHWAccel ff_mpeg2_nvdec_hwaccel
common internal api header.
#define PICT_BOTTOM_FIELD
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_mpeg12_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, enum AVPixelFormat hw_format)
static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, const uint8_t *buffer, uint32_t size)
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
@ AV_PIX_FMT_CUARRAY
hardware decoding through openharmony
A reference to a data buffer.
main external API structure.
struct AVCodecInternal * internal
Private context used for internal data.
void * hwaccel_priv_data
hwaccel-specific private data
This structure describes decoded (raw) audio or video data.
void * private_ref
RefStruct reference for internal use by a single libav* library.
This struct stores per-frame lavc-internal data and is attached to it via private_ref.