33 CUVIDPICPARAMS *pp = &
ctx->pic_params;
34 CUVIDMPEG2PICPARAMS *ppc = &pp->CodecSpecific.mpeg2;
37 AVFrame *cur_frame =
s->current_picture.f;
48 *pp = (CUVIDPICPARAMS) {
49 .PicWidthInMbs = (cur_frame->
width + 15) / 16,
50 .FrameHeightInMbs = (cur_frame->
height + 15) / 16,
51 .CurrPicIdx = cf->
idx,
53 .field_pic_flag =
s->picture_structure !=
PICT_FRAME,
55 .second_field =
s->picture_structure !=
PICT_FRAME && !
s->first_field,
61 .CodecSpecific.mpeg2 = {
65 .picture_coding_type =
s->pict_type,
66 .full_pel_forward_vector =
s->full_pel[0],
67 .full_pel_backward_vector =
s->full_pel[1],
68 .f_code = { {
s->mpeg_f_code[0][0],
69 s->mpeg_f_code[0][1] },
70 {
s->mpeg_f_code[1][0],
71 s->mpeg_f_code[1][1] } },
72 .intra_dc_precision =
s->intra_dc_precision,
73 .frame_pred_frame_dct =
s->frame_pred_frame_dct,
74 .concealment_motion_vectors =
s->concealment_motion_vectors,
75 .q_scale_type =
s->q_scale_type,
76 .intra_vlc_format =
s->intra_vlc_format,
77 .alternate_scan =
s->alternate_scan,
78 .top_field_first =
s->top_field_first,
82 for (
i = 0;
i < 64; ++
i) {
83 ppc->QuantMatrixIntra[
i] =
s->intra_matrix[
i];
84 ppc->QuantMatrixInter[
i] =
s->inter_matrix[
i];
97 #if CONFIG_MPEG2_NVDEC_HWACCEL
99 .
name =
"mpeg2_nvdec",
113 #if CONFIG_MPEG1_NVDEC_HWACCEL
115 .
name =
"mpeg1_nvdec",
Libavcodec external API header.
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
const AVHWAccel ff_mpeg1_nvdec_hwaccel
const AVHWAccel ff_mpeg2_nvdec_hwaccel
#define PICT_BOTTOM_FIELD
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size, int supports_444)
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)
static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
static int nvdec_mpeg12_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
A reference to a data buffer.
uint8_t * data
The 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.
AVBufferRef * private_ref
AVBufferRef for internal use by a single libav* library.
const char * name
Name of the hardware accelerated codec.
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
void * hwaccel_priv
Per-frame private data for hwaccels.