52 struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
54 pic_ctx->bitstream_buffers_allocated = 0;
55 pic_ctx->bitstream_buffers_used = 0;
56 pic_ctx->bitstream_buffers = NULL;
60 #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG1_VDPAU_HWACCEL || \
61 CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \
62 CONFIG_VC1_VDPAU_HWACCEL || CONFIG_WMV3_VDPAU_HWACCEL
73 res = hwctx->
render2(avctx, &pic->
f, (
void *)&pic_ctx->info,
74 pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
77 pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
80 av_freep(&pic_ctx->bitstream_buffers);
89 VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
91 buffers =
av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated,
92 (pic_ctx->bitstream_buffers_used + 1) *
sizeof(*buffers));
96 pic_ctx->bitstream_buffers = buffers;
97 buffers += pic_ctx->bitstream_buffers_used++;
99 buffers->struct_version = VDP_BITSTREAM_BUFFER_VERSION;
100 buffers->bitstream =
buf;
101 buffers->bitstream_bytes =
size;
110 VdpReferenceFrameH264 *rf, *rf2;
112 int i, list, pic_frame_idx;
117 rf = &render->
info.
h264.referenceFrames[0];
118 #define H264_RF_COUNT FF_ARRAY_ELEMS(render->info.h264.referenceFrames)
120 for (list = 0; list < 2; ++list) {
124 for (i = 0; i < ls; ++i) {
133 rf2 = &render->
info.
h264.referenceFrames[0];
136 (rf2->surface == render_ref->
surface)
137 && (rf2->is_long_term == pic->
long_ref)
138 && (rf2->frame_idx == pic_frame_idx)
152 rf->surface = render_ref->
surface;
156 rf->field_order_cnt[0] = pic->
field_poc[0];
157 rf->field_order_cnt[1] = pic->
field_poc[1];
158 rf->frame_idx = pic_frame_idx;
165 rf->surface = VDP_INVALID_HANDLE;
166 rf->is_long_term = 0;
167 rf->top_is_reference = 0;
168 rf->bottom_is_reference = 0;
169 rf->field_order_cnt[0] = 0;
170 rf->field_order_cnt[1] = 0;
192 #if CONFIG_H264_VDPAU_DECODER
201 for (i = 0; i < 2; ++i) {
205 render->
info.
h264.field_order_cnt[i] = foc;
219 if (render->
info.
h264.slice_count < 1)
255 #if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
257 int buf_size,
int slice_count)
283 for (i = 0; i < 64; ++i) {
288 render->
info.
mpeg.forward_reference = VDP_INVALID_HANDLE;
289 render->
info.
mpeg.backward_reference = VDP_INVALID_HANDLE;
306 render->
info.
mpeg.slice_count = slice_count;
314 #if CONFIG_VC1_VDPAU_DECODER
325 render->
info.
vc1.frame_coding_mode = v->
fcm ? v->
fcm + 1 : 0;
355 render->
info.
vc1.forward_reference = VDP_INVALID_HANDLE;
356 render->
info.
vc1.backward_reference = VDP_INVALID_HANDLE;
359 render->
info.
vc1.picture_type = 4;
378 render->
info.
vc1.slice_count = 1;
385 #if CONFIG_MPEG4_VDPAU_DECODER
414 for (i = 0; i < 64; ++i) {
418 render->
info.
mpeg4.forward_reference = VDP_INVALID_HANDLE;
419 render->
info.
mpeg4.backward_reference = VDP_INVALID_HANDLE;
#define PICT_BOTTOM_FIELD
VdpDecoderRender * render
VDPAU decoder render callback.
int chroma_qp_index_offset[2]
int extended_mv
Ext MV in P/B (not in Simple)
int broadcast
TFF/RFF present.
unsigned int ref_count[2]
num_ref_idx_l0/1_active_minus1 + 1
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
VdpPictureInfoMPEG1Or2 mpeg
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
void ff_vdpau_h264_picture_complete(H264Context *h)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
int long_ref
1->long term reference 0->short term reference
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
uint8_t scaling_matrix4[6][16]
int deblocking_filter_parameters_present
deblocking_filter_parameters_present_flag
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
int interlace
Progressive/interlaced (RPTFTM syntax element)
int cabac
entropy_coding_mode_flag
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
int resync_marker
could this stream contain resync markers
Picture current_picture
copy of the current picture structure.
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
VdpDecoder decoder
VDPAU decoder handle.
int redundant_pic_cnt_present
redundant_pic_cnt_present_flag
VdpBitstreamBuffer * bitstream_buffers
The user is responsible for freeing this buffer using av_freep().
uint16_t pp_time
time distance between the last 2 p,s,i frames
int ff_vdpau_common_start_frame(Picture *pic, av_unused const uint8_t *buffer, av_unused uint32_t size)
int psf
Progressive Segmented Frame.
static uintptr_t ff_vdpau_get_surface_id(Picture *pic)
Extract VdpVideoSurface from a Picture.
H.264 / AVC / MPEG4 part10 codec.
int mb_aff
mb_adaptive_frame_field_flag
int overlap
overlapped transforms in use
This structure is used to share data between the libavcodec library and the client video application...
int poc_type
pic_order_cnt_type
int constrained_intra_pred
constrained_intra_pred_flag
#define MAKE_ACCESSORS(str, name, type, field)
int weighted_pred
weighted_pred_flag
int quarter_sample
1->qpel, 0->half pel ME/MC
Libavcodec external API header.
#define av_unused
Disable warnings about deprecated features This is useful for sections of code kept for backward comp...
int postprocflag
Per-frame processing suggestion flag present.
int delta_pic_order_always_zero_flag
uint8_t scaling_matrix8[6][64]
union AVVDPAUPictureInfo info
picture parameter information for all supported codecs
int ref_frame_count
num_ref_frames
int tfcntrflag
TFCNTR present.
Picture * current_picture_ptr
pointer to the current picture
void * hwaccel_picture_private
hardware accelerator private data
int init_qp
pic_init_qp_minus26 + 26
int frame_num
h264 frame_num (raw frame_num from slice header)
int direct_8x8_inference_flag
VdpPictureInfoMPEG4Part2 mpeg4
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
int pic_order_present
pic_order_present_flag
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
int finterpflag
INTERPFRM present.
uint16_t inter_matrix[64]
AVVDPAUContext * av_alloc_vdpaucontext(void)
allocation function for AVVDPAUContext
int concealment_motion_vectors
void * hwaccel_context
Hardware accelerator context.
void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
int multires
frame-level RESPIC syntax element present
main external API structure.
int bitstream_buffers_used
int extended_dmv
Additional extended dmv range at P/B frame-level.
int bitstream_buffers_allocated
Describe size/location of the compressed video data.
void ff_vdpau_h264_set_reference_frames(H264Context *h)
void ff_vdpau_h264_picture_start(H264Context *h)
int quantizer_mode
2bits, quantizer mode used for sequence, see QUANT_*
int f_code
forward MV resolution
int log2_max_poc_lsb
log2_max_pic_order_cnt_lsb_minus4
int max_b_frames
max number of b-frames for encoding
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int(* AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, const VdpPictureInfo *, uint32_t, const VdpBitstreamBuffer *)
int vstransform
variable-size [48]x[48] transform type + info
void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
Public libavcodec VDPAU header.
int field_poc[2]
h264 top/bottom POC
int transform_8x8_mode
transform_8x8_mode_flag
uint16_t pb_field_time
like above, just for interlaced
struct AVCodecContext * avctx
void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf, int buf_size, int slice_count)
This structure is used as a callback between the FFmpeg decoder (vd_) and presentation (vo_) module...
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
int log2_max_frame_num
log2_max_frame_num_minus4 + 4
Picture last_picture
copy of the previous picture structure.
int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t size)
int pic_id
h264 pic_num (short -> no wrap version of pic_num, pic_num & max_pic_num; long -> long_pic_num) ...
void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf, int buf_size)
Picture next_picture
copy of the next picture structure.
uint16_t intra_matrix[64]
matrix transmitted in the bitstream
int dquant
How qscale varies with MBs, 2bits (not in Simple)
int b_code
backward MV resolution for B Frames (mpeg4)
void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf, int buf_size)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
VdpVideoSurface surface
Used as rendered surface, never changed.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
uint16_t pb_time
time distance between the last b and p,s,i frame
int short_ref_count
number of actual short term references