24#include <vdpau/vdpau.h>
38 MPVContext *
const s = &
ctx->h.c;
46 info->forward_reference = VDP_INVALID_HANDLE;
47 info->backward_reference = VDP_INVALID_HANDLE;
48 info->vop_coding_type = 0;
50 switch (
s->pict_type) {
53 assert(
ref != VDP_INVALID_HANDLE);
55 info->vop_coding_type = 2;
59 assert(
ref != VDP_INVALID_HANDLE);
63 info->trd[0] =
s->pp_time;
64 info->trb[0] =
s->pb_time;
65 info->trd[1] =
s->pp_field_time >> 1;
66 info->trb[1] =
s->pb_field_time >> 1;
67 info->vop_time_increment_resolution =
s->avctx->framerate.num;
68 info->vop_fcode_forward =
ctx->f_code;
69 info->vop_fcode_backward =
ctx->b_code;
70 info->resync_marker_disable = !
ctx->resync_marker;
71 info->interlaced = !
s->progressive_sequence;
72 info->quant_type =
ctx->mpeg_quant;
73 info->quarter_sample =
s->quarter_sample;
75 info->rounding_control =
s->no_rounding;
76 info->alternate_vertical_scan_flag =
s->alternate_scan;
77 info->top_field_first =
s->top_field_first;
78 for (
i = 0;
i < 64; ++
i) {
79 int n =
s->idsp.idct_permutation[
i];
80 info->intra_quantizer_matrix[
i] =
s->intra_matrix[n];
81 info->non_intra_quantizer_matrix[
i] =
s->inter_matrix[n];
101 profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP;
107 profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
117 .p.name =
"mpeg4_vdpau",
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE
#define AV_PROFILE_UNKNOWN
#define AV_PROFILE_MPEG4_SIMPLE
int(* init)(AVBSFContext *ctx)
av_cold int ff_vdpau_common_uninit(AVCodecContext *avctx)
int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
av_cold int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level)
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
Header providing the internals of AVHWAccel.
const struct FFHWAccel ff_mpeg4_vdpau_hwaccel
Macro definitions for various function/variable attributes.
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
A reference to a data buffer.
main external API structure.
int level
Encoding level descriptor.
const struct AVCodec * codec
void * hwaccel_picture_private
RefStruct reference for hardware accelerator private data.
union VDPAUPictureInfo info
VDPAU picture information.
static int ref[MAX_W *MAX_W]
static AVFormatContext * ctx
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)
static av_cold int vdpau_mpeg4_init(AVCodecContext *avctx)
static int vdpau_mpeg4_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, const uint8_t *buffer, uint32_t size)