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
74 hwctx->
info = pic_ctx->info;
82 res = hwctx->
render2(avctx, &pic->
f, (
void *)&pic_ctx->info,
83 pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
86 pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
89 av_freep(&pic_ctx->bitstream_buffers);
106 VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
108 buffers =
av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated,
109 (pic_ctx->bitstream_buffers_used + 1) *
sizeof(*buffers));
113 pic_ctx->bitstream_buffers = buffers;
114 buffers += pic_ctx->bitstream_buffers_used++;
116 buffers->struct_version = VDP_BITSTREAM_BUFFER_VERSION;
117 buffers->bitstream =
buf;
118 buffers->bitstream_bytes =
size;
127 VdpReferenceFrameH264 *rf, *rf2;
129 int i, list, pic_frame_idx;
134 rf = &render->
info.
h264.referenceFrames[0];
135 #define H264_RF_COUNT FF_ARRAY_ELEMS(render->info.h264.referenceFrames)
137 for (list = 0; list < 2; ++list) {
141 for (i = 0; i < ls; ++i) {
150 rf2 = &render->
info.
h264.referenceFrames[0];
153 (rf2->surface == render_ref->
surface)
154 && (rf2->is_long_term == pic->
long_ref)
155 && (rf2->frame_idx == pic_frame_idx)
169 rf->surface = render_ref->
surface;
173 rf->field_order_cnt[0] = pic->
field_poc[0];
174 rf->field_order_cnt[1] = pic->
field_poc[1];
175 rf->frame_idx = pic_frame_idx;
182 rf->surface = VDP_INVALID_HANDLE;
183 rf->is_long_term = 0;
184 rf->top_is_reference = 0;
185 rf->bottom_is_reference = 0;
186 rf->field_order_cnt[0] = 0;
187 rf->field_order_cnt[1] = 0;
209 #if CONFIG_H264_VDPAU_DECODER
218 for (i = 0; i < 2; ++i) {
222 render->
info.
h264.field_order_cnt[i] = foc;
236 if (render->
info.
h264.slice_count < 1)
272 #if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
274 int buf_size,
int slice_count)
300 for (i = 0; i < 64; ++i) {
305 render->
info.
mpeg.forward_reference = VDP_INVALID_HANDLE;
306 render->
info.
mpeg.backward_reference = VDP_INVALID_HANDLE;
323 render->
info.
mpeg.slice_count = slice_count;
331 #if CONFIG_VC1_VDPAU_DECODER
342 render->
info.
vc1.frame_coding_mode = v->
fcm ? v->
fcm + 1 : 0;
372 render->
info.
vc1.forward_reference = VDP_INVALID_HANDLE;
373 render->
info.
vc1.backward_reference = VDP_INVALID_HANDLE;
376 render->
info.
vc1.picture_type = 4;
395 render->
info.
vc1.slice_count = 1;
402 #if CONFIG_MPEG4_VDPAU_DECODER
431 for (i = 0; i < 64; ++i) {
435 render->
info.
mpeg4.forward_reference = VDP_INVALID_HANDLE;
436 render->
info.
mpeg4.backward_reference = VDP_INVALID_HANDLE;