24 #include <vdpau/vdpau.h>
37 Picture *pic =
s->current_picture_ptr;
44 info->forward_reference = VDP_INVALID_HANDLE;
45 info->backward_reference = VDP_INVALID_HANDLE;
46 info->vop_coding_type = 0;
48 switch (
s->pict_type) {
51 assert(
ref != VDP_INVALID_HANDLE);
53 info->vop_coding_type = 2;
57 assert(
ref != VDP_INVALID_HANDLE);
61 info->trd[0] =
s->pp_time;
62 info->trb[0] =
s->pb_time;
63 info->trd[1] =
s->pp_field_time >> 1;
64 info->trb[1] =
s->pb_field_time >> 1;
65 info->vop_time_increment_resolution =
s->avctx->framerate.num;
66 info->vop_fcode_forward =
s->f_code;
67 info->vop_fcode_backward =
s->b_code;
68 info->resync_marker_disable = !
ctx->resync_marker;
69 info->interlaced = !
s->progressive_sequence;
70 info->quant_type =
s->mpeg_quant;
71 info->quarter_sample =
s->quarter_sample;
73 info->rounding_control =
s->no_rounding;
74 info->alternate_vertical_scan_flag =
s->alternate_scan;
75 info->top_field_first =
s->top_field_first;
76 for (
i = 0;
i < 64; ++
i) {
77 int n =
s->idsp.idct_permutation[
i];
78 info->intra_quantizer_matrix[
i] =
s->intra_matrix[n];
79 info->non_intra_quantizer_matrix[
i] =
s->inter_matrix[n];
99 profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP;
105 profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
115 .
name =
"mpeg4_vdpau",
Libavcodec external API header.
#define FF_PROFILE_MPEG4_SIMPLE
#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE
#define FF_PROFILE_UNKNOWN
static av_cold int init(AVCodecContext *avctx)
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
int ff_vdpau_common_uninit(AVCodecContext *avctx)
int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, const uint8_t *buf, uint32_t size)
int ff_vdpau_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
#define HWACCEL_CAP_ASYNC_SAFE
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
main external API structure.
const struct AVCodec * codec
const char * name
Name of the hardware accelerated codec.
void * hwaccel_picture_private
Hardware accelerator private data.
union VDPAUPictureInfo info
VDPAU picture information.
static int ref[MAX_W *MAX_W]
VdpPictureInfoMPEG4Part2 mpeg4
Public libavcodec VDPAU header.
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
static uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
Extract VdpVideoSurface from an AVFrame.
static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
const AVHWAccel ff_mpeg4_vdpau_hwaccel
static int vdpau_mpeg4_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
static int vdpau_mpeg4_init(AVCodecContext *avctx)