Go to the documentation of this file.
23 #include "config_components.h"
38 CUVIDPICPARAMS *pp = &
ctx->pic_params;
39 CUVIDMPEG2PICPARAMS *ppc = &pp->CodecSpecific.mpeg2;
42 AVFrame *cur_frame =
s->cur_pic.ptr->f;
53 *pp = (CUVIDPICPARAMS) {
54 .PicWidthInMbs = (cur_frame->
width + 15) / 16,
55 .FrameHeightInMbs = (cur_frame->
height + 15) / 16,
56 .CurrPicIdx = cf->
idx,
58 .field_pic_flag =
s->picture_structure !=
PICT_FRAME,
60 .second_field =
s->picture_structure !=
PICT_FRAME && !
s->first_field,
66 .CodecSpecific.mpeg2 = {
70 .picture_coding_type =
s->pict_type,
71 .full_pel_forward_vector =
s->full_pel[0],
72 .full_pel_backward_vector =
s->full_pel[1],
73 .f_code = { {
s->mpeg_f_code[0][0],
74 s->mpeg_f_code[0][1] },
75 {
s->mpeg_f_code[1][0],
76 s->mpeg_f_code[1][1] } },
77 .intra_dc_precision =
s->intra_dc_precision,
78 .frame_pred_frame_dct =
s->frame_pred_frame_dct,
79 .concealment_motion_vectors =
s->concealment_motion_vectors,
80 .q_scale_type =
s->q_scale_type,
81 .intra_vlc_format =
s->intra_vlc_format,
82 .alternate_scan =
s->alternate_scan,
83 .top_field_first =
s->top_field_first,
87 for (
i = 0;
i < 64; ++
i) {
88 int n =
s->idsp.idct_permutation[
i];
89 ppc->QuantMatrixIntra[
i] =
s->intra_matrix[n];
90 ppc->QuantMatrixInter[
i] =
s->inter_matrix[n];
103 #if CONFIG_MPEG2_NVDEC_HWACCEL
105 .
p.
name =
"mpeg2_nvdec",
119 #if CONFIG_MPEG1_NVDEC_HWACCEL
121 .
p.
name =
"mpeg1_nvdec",
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
uint8_t * data
The data buffer.
int ff_nvdec_get_ref_idx(AVFrame *frame)
AVHWAccel p
The public AVHWAccel.
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
This structure describes decoded (raw) audio or video data.
#define PICT_BOTTOM_FIELD
int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame)
static int nvdec_mpeg12_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
const struct FFHWAccel ff_mpeg1_nvdec_hwaccel
int ff_nvdec_simple_end_frame(AVCodecContext *avctx)
int ff_nvdec_decode_init(AVCodecContext *avctx)
struct AVCodecInternal * internal
Private context used for internal data.
@ AV_PICTURE_TYPE_I
Intra.
void * hwaccel_priv_data
hwaccel-specific private data
int ff_nvdec_decode_uninit(AVCodecContext *avctx)
AVBufferRef * private_ref
AVBufferRef for internal use by a single libav* library.
const char * name
Name of the hardware accelerated codec.
#define i(width, name, range_min, range_max)
const struct FFHWAccel ff_mpeg2_nvdec_hwaccel
main external API structure.
int ff_nvdec_simple_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size, int supports_444)
@ AV_PICTURE_TYPE_P
Predicted.
A reference to a data buffer.
static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
void * hwaccel_priv
Per-frame private data for hwaccels.
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding