23#include "config_components.h"
38 MPVContext *
const s = &m->
h.
c;
41 CUVIDPICPARAMS *pp = &
ctx->pic_params;
42 CUVIDMPEG4PICPARAMS *ppc = &pp->CodecSpecific.mpeg4;
45 AVFrame *cur_frame =
s->cur_pic.ptr->f;
56 *pp = (CUVIDPICPARAMS) {
57 .PicWidthInMbs = (cur_frame->
width + 15) / 16,
58 .FrameHeightInMbs = (cur_frame->
height + 15) / 16,
59 .CurrPicIdx = cf->
idx,
66 .CodecSpecific.mpeg4 = {
70 .video_object_layer_width =
s->width,
71 .video_object_layer_height =
s->height,
73 .top_field_first =
s->top_field_first,
76 .quarter_sample =
s->quarter_sample,
82 .vop_rounding_type =
s->no_rounding,
83 .alternate_vertical_scan_flag =
s->alternate_scan,
84 .interlaced = !
s->progressive_sequence,
85 .vop_fcode_forward = m->
f_code,
86 .vop_fcode_backward = m->
b_code,
87 .trd = {
s->pp_time,
s->pp_field_time >> 1 },
88 .trb = {
s->pb_time,
s->pb_field_time >> 1 },
95 for (
i = 0;
i < 64; ++
i) {
96 int n =
s->idsp.idct_permutation[
i];
97 ppc->QuantMatrixIntra[
i] =
s->intra_matrix[n];
98 ppc->QuantMatrixInter[
i] =
s->inter_matrix[n];
118#if CONFIG_MPEG4_NVDEC_HWACCEL
126 .p.name =
"mpeg4_nvdec",
133 .frame_params = nvdec_mpeg4_cuda_frame_params,
140#if CONFIG_MPEG4_NVDEC_CUARRAY_HWACCEL
148 .p.name =
"mpeg4_nvdec_cuarray",
155 .frame_params = nvdec_mpeg4_cuarray_frame_params,
static AVFormatContext * ctx
Libavcodec external API header.
#define i(width, name, range_min, range_max)
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PICTURE_TYPE_S
S(GMC)-VOP MPEG-4.
const struct FFHWAccel ff_mpeg4_nvdec_hwaccel
const struct FFHWAccel ff_mpeg4_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_mpeg4_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, enum AVPixelFormat hw_format)
static int nvdec_mpeg4_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, const uint8_t *buffer, uint32_t size)
static int nvdec_mpeg4_decode_slice(AVCodecContext *avctx, 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.
const struct AVCodec * codec
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.
int divx_packed
divx specific, used to workaround (many) bugs in divx5
int b_code
backward MV resolution for B-frames
int time_increment_bits
number of bits to represent the fractional part of time
int f_code
forward MV resolution
int resync_marker
could this stream contain resync markers