/*
* Video Decode and Presentation API for UNIX (VDPAU) is used for
- * HW decode acceleration for MPEG-1/2, H.264 and VC-1.
+ * HW decode acceleration for MPEG-1/2, MPEG-4 ASP, H.264 and VC-1.
*
* Copyright (c) 2008 NVIDIA
*
for (list = 0; list < 2; ++list) {
Picture **lp = list ? h->long_ref : h->short_ref;
- int ls = list ? h->long_ref_count : h->short_ref_count;
+ int ls = list ? 16 : h->short_ref_count;
for (i = 0; i < ls; ++i) {
pic = lp[i];
render->bitstream_buffers_used++;
}
-void ff_vdpau_h264_picture_complete(MpegEncContext *s)
+void ff_vdpau_h264_picture_start(MpegEncContext *s)
{
H264Context *h = s->avctx->priv_data;
struct vdpau_render_state *render;
render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
assert(render);
- render->info.h264.slice_count = h->slice_num;
- if (render->info.h264.slice_count < 1)
- return;
-
for (i = 0; i < 2; ++i) {
int foc = s->current_picture_ptr->field_poc[i];
if (foc == INT_MAX)
render->info.h264.field_order_cnt[i] = foc;
}
+ render->info.h264.frame_num = h->frame_num;
+}
+
+void ff_vdpau_h264_picture_complete(MpegEncContext *s)
+{
+ H264Context *h = s->avctx->priv_data;
+ struct vdpau_render_state *render;
+
+ render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ assert(render);
+
+ render->info.h264.slice_count = h->slice_num;
+ if (render->info.h264.slice_count < 1)
+ return;
+
render->info.h264.is_reference = (s->current_picture_ptr->reference & 3) ? VDP_TRUE : VDP_FALSE;
- render->info.h264.frame_num = h->frame_num;
render->info.h264.field_pic_flag = s->picture_structure != PICT_FRAME;
render->info.h264.bottom_field_flag = s->picture_structure == PICT_BOTTOM_FIELD;
render->info.h264.num_ref_frames = h->sps.ref_frame_count;
assert(render);
/* fill VdpPictureInfoMPEG4Part2 struct */
+ render->info.mpeg4.trd[0] = s->pp_time;
+ render->info.mpeg4.trb[0] = s->pb_time;
+ render->info.mpeg4.trd[1] = s->pp_field_time >> 1;
+ render->info.mpeg4.trb[1] = s->pb_field_time >> 1;
render->info.mpeg4.vop_time_increment_resolution = s->avctx->time_base.den;
render->info.mpeg4.vop_coding_type = 0;
render->info.mpeg4.vop_fcode_forward = s->f_code;