1 /**************************************************************************
3 * Copyright 2010 Thomas Balling Sørensen.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #include "util/u_memory.h"
29 #include "util/u_math.h"
30 #include "util/u_debug.h"
31 #include "util/u_video.h"
33 #include "vl/vl_vlc.h"
35 #include "vdpau_private.h"
38 * Create a VdpDecoder.
41 vlVdpDecoderCreate(VdpDevice device
,
42 VdpDecoderProfile profile
,
43 uint32_t width
, uint32_t height
,
44 uint32_t max_references
,
47 struct pipe_video_codec templat
= {};
48 struct pipe_context
*pipe
;
49 struct pipe_screen
*screen
;
51 vlVdpDecoder
*vldecoder
;
54 uint32_t maxwidth
, maxheight
;
57 return VDP_STATUS_INVALID_POINTER
;
60 if (!(width
&& height
))
61 return VDP_STATUS_INVALID_VALUE
;
63 templat
.profile
= ProfileToPipe(profile
);
64 if (templat
.profile
== PIPE_VIDEO_PROFILE_UNKNOWN
)
65 return VDP_STATUS_INVALID_DECODER_PROFILE
;
67 dev
= vlGetDataHTAB(device
);
69 return VDP_STATUS_INVALID_HANDLE
;
72 screen
= dev
->vscreen
->pscreen
;
74 pipe_mutex_lock(dev
->mutex
);
76 supported
= screen
->get_video_param
80 PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
81 PIPE_VIDEO_CAP_SUPPORTED
84 pipe_mutex_unlock(dev
->mutex
);
85 return VDP_STATUS_INVALID_DECODER_PROFILE
;
88 maxwidth
= screen
->get_video_param
92 PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
93 PIPE_VIDEO_CAP_MAX_WIDTH
95 maxheight
= screen
->get_video_param
99 PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
100 PIPE_VIDEO_CAP_MAX_HEIGHT
102 if (width
> maxwidth
|| height
> maxheight
) {
103 pipe_mutex_unlock(dev
->mutex
);
104 return VDP_STATUS_INVALID_SIZE
;
107 vldecoder
= CALLOC(1,sizeof(vlVdpDecoder
));
109 pipe_mutex_unlock(dev
->mutex
);
110 return VDP_STATUS_RESOURCES
;
113 DeviceReference(&vldecoder
->device
, dev
);
115 templat
.entrypoint
= PIPE_VIDEO_ENTRYPOINT_BITSTREAM
;
116 templat
.chroma_format
= PIPE_VIDEO_CHROMA_FORMAT_420
;
117 templat
.width
= width
;
118 templat
.height
= height
;
119 templat
.max_references
= max_references
;
121 vldecoder
->decoder
= pipe
->create_video_codec(pipe
, &templat
);
123 if (!vldecoder
->decoder
) {
124 ret
= VDP_STATUS_ERROR
;
128 *decoder
= vlAddDataHTAB(vldecoder
);
130 ret
= VDP_STATUS_ERROR
;
134 pipe_mutex_init(vldecoder
->mutex
);
135 pipe_mutex_unlock(dev
->mutex
);
137 return VDP_STATUS_OK
;
140 vldecoder
->decoder
->destroy(vldecoder
->decoder
);
143 pipe_mutex_unlock(dev
->mutex
);
144 DeviceReference(&vldecoder
->device
, NULL
);
150 * Destroy a VdpDecoder.
153 vlVdpDecoderDestroy(VdpDecoder decoder
)
155 vlVdpDecoder
*vldecoder
;
157 vldecoder
= (vlVdpDecoder
*)vlGetDataHTAB(decoder
);
159 return VDP_STATUS_INVALID_HANDLE
;
161 pipe_mutex_lock(vldecoder
->mutex
);
162 vldecoder
->decoder
->destroy(vldecoder
->decoder
);
163 pipe_mutex_unlock(vldecoder
->mutex
);
164 pipe_mutex_destroy(vldecoder
->mutex
);
166 vlRemoveDataHTAB(decoder
);
167 DeviceReference(&vldecoder
->device
, NULL
);
170 return VDP_STATUS_OK
;
174 * Retrieve the parameters used to create a VdpDecoder.
177 vlVdpDecoderGetParameters(VdpDecoder decoder
,
178 VdpDecoderProfile
*profile
,
182 vlVdpDecoder
*vldecoder
;
184 vldecoder
= (vlVdpDecoder
*)vlGetDataHTAB(decoder
);
186 return VDP_STATUS_INVALID_HANDLE
;
188 *profile
= PipeToProfile(vldecoder
->decoder
->profile
);
189 *width
= vldecoder
->decoder
->width
;
190 *height
= vldecoder
->decoder
->height
;
192 return VDP_STATUS_OK
;
196 vlVdpGetReferenceFrame(VdpVideoSurface handle
, struct pipe_video_buffer
**ref_frame
)
198 vlVdpSurface
*surface
;
200 /* if surfaces equals VDP_STATUS_INVALID_HANDLE, they are not used */
201 if (handle
== VDP_INVALID_HANDLE
) {
203 return VDP_STATUS_OK
;
206 surface
= vlGetDataHTAB(handle
);
208 return VDP_STATUS_INVALID_HANDLE
;
210 *ref_frame
= surface
->video_buffer
;
212 return VDP_STATUS_INVALID_HANDLE
;
214 return VDP_STATUS_OK
;
218 * Decode a mpeg 1/2 video.
221 vlVdpDecoderRenderMpeg12(struct pipe_mpeg12_picture_desc
*picture
,
222 VdpPictureInfoMPEG1Or2
*picture_info
)
226 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding MPEG12\n");
228 r
= vlVdpGetReferenceFrame(picture_info
->forward_reference
, &picture
->ref
[0]);
229 if (r
!= VDP_STATUS_OK
)
232 r
= vlVdpGetReferenceFrame(picture_info
->backward_reference
, &picture
->ref
[1]);
233 if (r
!= VDP_STATUS_OK
)
236 picture
->picture_coding_type
= picture_info
->picture_coding_type
;
237 picture
->picture_structure
= picture_info
->picture_structure
;
238 picture
->frame_pred_frame_dct
= picture_info
->frame_pred_frame_dct
;
239 picture
->q_scale_type
= picture_info
->q_scale_type
;
240 picture
->alternate_scan
= picture_info
->alternate_scan
;
241 picture
->intra_vlc_format
= picture_info
->intra_vlc_format
;
242 picture
->concealment_motion_vectors
= picture_info
->concealment_motion_vectors
;
243 picture
->intra_dc_precision
= picture_info
->intra_dc_precision
;
244 picture
->f_code
[0][0] = picture_info
->f_code
[0][0] - 1;
245 picture
->f_code
[0][1] = picture_info
->f_code
[0][1] - 1;
246 picture
->f_code
[1][0] = picture_info
->f_code
[1][0] - 1;
247 picture
->f_code
[1][1] = picture_info
->f_code
[1][1] - 1;
248 picture
->num_slices
= picture_info
->slice_count
;
249 picture
->top_field_first
= picture_info
->top_field_first
;
250 picture
->full_pel_forward_vector
= picture_info
->full_pel_forward_vector
;
251 picture
->full_pel_backward_vector
= picture_info
->full_pel_backward_vector
;
252 picture
->intra_matrix
= picture_info
->intra_quantizer_matrix
;
253 picture
->non_intra_matrix
= picture_info
->non_intra_quantizer_matrix
;
255 return VDP_STATUS_OK
;
259 * Decode a mpeg 4 video.
262 vlVdpDecoderRenderMpeg4(struct pipe_mpeg4_picture_desc
*picture
,
263 VdpPictureInfoMPEG4Part2
*picture_info
)
268 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding MPEG4\n");
270 r
= vlVdpGetReferenceFrame(picture_info
->forward_reference
, &picture
->ref
[0]);
271 if (r
!= VDP_STATUS_OK
)
274 r
= vlVdpGetReferenceFrame(picture_info
->backward_reference
, &picture
->ref
[1]);
275 if (r
!= VDP_STATUS_OK
)
278 for (i
= 0; i
< 2; ++i
) {
279 picture
->trd
[i
] = picture_info
->trd
[i
];
280 picture
->trb
[i
] = picture_info
->trb
[i
];
282 picture
->vop_time_increment_resolution
= picture_info
->vop_time_increment_resolution
;
283 picture
->vop_coding_type
= picture_info
->vop_coding_type
;
284 picture
->vop_fcode_forward
= picture_info
->vop_fcode_forward
;
285 picture
->vop_fcode_backward
= picture_info
->vop_fcode_backward
;
286 picture
->resync_marker_disable
= picture_info
->resync_marker_disable
;
287 picture
->interlaced
= picture_info
->interlaced
;
288 picture
->quant_type
= picture_info
->quant_type
;
289 picture
->quarter_sample
= picture_info
->quarter_sample
;
290 picture
->short_video_header
= picture_info
->short_video_header
;
291 picture
->rounding_control
= picture_info
->rounding_control
;
292 picture
->alternate_vertical_scan_flag
= picture_info
->alternate_vertical_scan_flag
;
293 picture
->top_field_first
= picture_info
->top_field_first
;
294 picture
->intra_matrix
= picture_info
->intra_quantizer_matrix
;
295 picture
->non_intra_matrix
= picture_info
->non_intra_quantizer_matrix
;
297 return VDP_STATUS_OK
;
301 vlVdpDecoderRenderVC1(struct pipe_vc1_picture_desc
*picture
,
302 VdpPictureInfoVC1
*picture_info
)
306 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding VC-1\n");
308 r
= vlVdpGetReferenceFrame(picture_info
->forward_reference
, &picture
->ref
[0]);
309 if (r
!= VDP_STATUS_OK
)
312 r
= vlVdpGetReferenceFrame(picture_info
->backward_reference
, &picture
->ref
[1]);
313 if (r
!= VDP_STATUS_OK
)
316 picture
->slice_count
= picture_info
->slice_count
;
317 picture
->picture_type
= picture_info
->picture_type
;
318 picture
->frame_coding_mode
= picture_info
->frame_coding_mode
;
319 picture
->postprocflag
= picture_info
->postprocflag
;
320 picture
->pulldown
= picture_info
->pulldown
;
321 picture
->interlace
= picture_info
->interlace
;
322 picture
->tfcntrflag
= picture_info
->tfcntrflag
;
323 picture
->finterpflag
= picture_info
->finterpflag
;
324 picture
->psf
= picture_info
->psf
;
325 picture
->dquant
= picture_info
->dquant
;
326 picture
->panscan_flag
= picture_info
->panscan_flag
;
327 picture
->refdist_flag
= picture_info
->refdist_flag
;
328 picture
->quantizer
= picture_info
->quantizer
;
329 picture
->extended_mv
= picture_info
->extended_mv
;
330 picture
->extended_dmv
= picture_info
->extended_dmv
;
331 picture
->overlap
= picture_info
->overlap
;
332 picture
->vstransform
= picture_info
->vstransform
;
333 picture
->loopfilter
= picture_info
->loopfilter
;
334 picture
->fastuvmc
= picture_info
->fastuvmc
;
335 picture
->range_mapy_flag
= picture_info
->range_mapy_flag
;
336 picture
->range_mapy
= picture_info
->range_mapy
;
337 picture
->range_mapuv_flag
= picture_info
->range_mapuv_flag
;
338 picture
->range_mapuv
= picture_info
->range_mapuv
;
339 picture
->multires
= picture_info
->multires
;
340 picture
->syncmarker
= picture_info
->syncmarker
;
341 picture
->rangered
= picture_info
->rangered
;
342 picture
->maxbframes
= picture_info
->maxbframes
;
343 picture
->deblockEnable
= picture_info
->deblockEnable
;
344 picture
->pquant
= picture_info
->pquant
;
346 return VDP_STATUS_OK
;
350 vlVdpDecoderRenderH264(struct pipe_h264_picture_desc
*picture
,
351 VdpPictureInfoH264
*picture_info
)
355 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding H264\n");
357 picture
->pps
->sps
->mb_adaptive_frame_field_flag
= picture_info
->mb_adaptive_frame_field_flag
;
358 picture
->pps
->sps
->frame_mbs_only_flag
= picture_info
->frame_mbs_only_flag
;
359 picture
->pps
->sps
->log2_max_frame_num_minus4
= picture_info
->log2_max_frame_num_minus4
;
360 picture
->pps
->sps
->pic_order_cnt_type
= picture_info
->pic_order_cnt_type
;
361 picture
->pps
->sps
->log2_max_pic_order_cnt_lsb_minus4
= picture_info
->log2_max_pic_order_cnt_lsb_minus4
;
362 picture
->pps
->sps
->delta_pic_order_always_zero_flag
= picture_info
->delta_pic_order_always_zero_flag
;
363 picture
->pps
->sps
->direct_8x8_inference_flag
= picture_info
->direct_8x8_inference_flag
;
365 picture
->pps
->transform_8x8_mode_flag
= picture_info
->transform_8x8_mode_flag
;
366 picture
->pps
->chroma_qp_index_offset
= picture_info
->chroma_qp_index_offset
;
367 picture
->pps
->second_chroma_qp_index_offset
= picture_info
->second_chroma_qp_index_offset
;
368 picture
->pps
->pic_init_qp_minus26
= picture_info
->pic_init_qp_minus26
;
369 picture
->pps
->entropy_coding_mode_flag
= picture_info
->entropy_coding_mode_flag
;
370 picture
->pps
->deblocking_filter_control_present_flag
= picture_info
->deblocking_filter_control_present_flag
;
371 picture
->pps
->redundant_pic_cnt_present_flag
= picture_info
->redundant_pic_cnt_present_flag
;
372 picture
->pps
->constrained_intra_pred_flag
= picture_info
->constrained_intra_pred_flag
;
373 picture
->pps
->weighted_pred_flag
= picture_info
->weighted_pred_flag
;
374 picture
->pps
->weighted_bipred_idc
= picture_info
->weighted_bipred_idc
;
375 picture
->pps
->bottom_field_pic_order_in_frame_present_flag
= picture_info
->pic_order_present_flag
;
376 memcpy(picture
->pps
->ScalingList4x4
, picture_info
->scaling_lists_4x4
, 6*16);
377 memcpy(picture
->pps
->ScalingList8x8
, picture_info
->scaling_lists_8x8
, 2*64);
379 picture
->slice_count
= picture_info
->slice_count
;
380 picture
->field_order_cnt
[0] = picture_info
->field_order_cnt
[0];
381 picture
->field_order_cnt
[1] = picture_info
->field_order_cnt
[1];
382 picture
->is_reference
= picture_info
->is_reference
;
383 picture
->frame_num
= picture_info
->frame_num
;
384 picture
->field_pic_flag
= picture_info
->field_pic_flag
;
385 picture
->bottom_field_flag
= picture_info
->bottom_field_flag
;
386 picture
->num_ref_frames
= picture_info
->num_ref_frames
;
388 picture
->num_ref_idx_l0_active_minus1
= picture_info
->num_ref_idx_l0_active_minus1
;
389 picture
->num_ref_idx_l1_active_minus1
= picture_info
->num_ref_idx_l1_active_minus1
;
391 for (i
= 0; i
< 16; ++i
) {
392 VdpStatus ret
= vlVdpGetReferenceFrame
394 picture_info
->referenceFrames
[i
].surface
,
397 if (ret
!= VDP_STATUS_OK
)
400 picture
->is_long_term
[i
] = picture_info
->referenceFrames
[i
].is_long_term
;
401 picture
->top_is_reference
[i
] = picture_info
->referenceFrames
[i
].top_is_reference
;
402 picture
->bottom_is_reference
[i
] = picture_info
->referenceFrames
[i
].bottom_is_reference
;
403 picture
->field_order_cnt_list
[i
][0] = picture_info
->referenceFrames
[i
].field_order_cnt
[0];
404 picture
->field_order_cnt_list
[i
][1] = picture_info
->referenceFrames
[i
].field_order_cnt
[1];
405 picture
->frame_num_list
[i
] = picture_info
->referenceFrames
[i
].frame_idx
;
408 return VDP_STATUS_OK
;
412 vlVdpDecoderFixVC1Startcode(uint32_t *num_buffers
, const void *buffers
[], unsigned sizes
[])
414 static const uint8_t vc1_startcode
[] = { 0x00, 0x00, 0x01, 0x0D };
418 /* search the first 64 bytes for a startcode */
419 vl_vlc_init(&vlc
, *num_buffers
, buffers
, sizes
);
420 while (vl_vlc_search_byte(&vlc
, 64*8, 0x00) && vl_vlc_bits_left(&vlc
) >= 32) {
421 uint32_t value
= vl_vlc_peekbits(&vlc
, 32);
422 if (value
== 0x0000010D ||
423 value
== 0x0000010C ||
426 vl_vlc_eatbits(&vlc
, 8);
429 /* none found, ok add one manually */
430 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Manually adding VC-1 startcode\n");
431 for (i
= *num_buffers
; i
> 0; --i
) {
432 buffers
[i
] = buffers
[i
- 1];
433 sizes
[i
] = sizes
[i
- 1];
436 buffers
[0] = vc1_startcode
;
441 * Decode a compressed field/frame and render the result into a VdpVideoSurface.
444 vlVdpDecoderRender(VdpDecoder decoder
,
445 VdpVideoSurface target
,
446 VdpPictureInfo
const *picture_info
,
447 uint32_t bitstream_buffer_count
,
448 VdpBitstreamBuffer
const *bitstream_buffers
)
450 const void * buffers
[bitstream_buffer_count
+ 1];
451 unsigned sizes
[bitstream_buffer_count
+ 1];
452 vlVdpDecoder
*vldecoder
;
453 vlVdpSurface
*vlsurf
;
455 struct pipe_screen
*screen
;
456 struct pipe_video_codec
*dec
;
457 bool buffer_support
[2];
459 struct pipe_h264_sps sps
= {};
460 struct pipe_h264_pps pps
= { &sps
};
462 struct pipe_picture_desc base
;
463 struct pipe_mpeg12_picture_desc mpeg12
;
464 struct pipe_mpeg4_picture_desc mpeg4
;
465 struct pipe_vc1_picture_desc vc1
;
466 struct pipe_h264_picture_desc h264
;
469 if (!(picture_info
&& bitstream_buffers
))
470 return VDP_STATUS_INVALID_POINTER
;
472 vldecoder
= (vlVdpDecoder
*)vlGetDataHTAB(decoder
);
474 return VDP_STATUS_INVALID_HANDLE
;
475 dec
= vldecoder
->decoder
;
476 screen
= dec
->context
->screen
;
478 vlsurf
= (vlVdpSurface
*)vlGetDataHTAB(target
);
480 return VDP_STATUS_INVALID_HANDLE
;
482 if (vlsurf
->device
!= vldecoder
->device
)
483 return VDP_STATUS_HANDLE_DEVICE_MISMATCH
;
485 if (vlsurf
->video_buffer
!= NULL
&& vlsurf
->video_buffer
->chroma_format
!= dec
->chroma_format
)
486 // TODO: Recreate decoder with correct chroma
487 return VDP_STATUS_INVALID_CHROMA_TYPE
;
489 buffer_support
[0] = screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
490 PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE
);
491 buffer_support
[1] = screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
492 PIPE_VIDEO_CAP_SUPPORTS_INTERLACED
);
494 if (vlsurf
->video_buffer
== NULL
||
495 !screen
->is_video_format_supported(screen
, vlsurf
->video_buffer
->buffer_format
,
496 dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
) ||
497 !buffer_support
[vlsurf
->video_buffer
->interlaced
]) {
499 pipe_mutex_lock(vlsurf
->device
->mutex
);
501 /* destroy the old one */
502 if (vlsurf
->video_buffer
)
503 vlsurf
->video_buffer
->destroy(vlsurf
->video_buffer
);
505 /* set the buffer format to the prefered one */
506 vlsurf
->templat
.buffer_format
= screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
507 PIPE_VIDEO_CAP_PREFERED_FORMAT
);
509 /* also set interlacing to decoders preferences */
510 vlsurf
->templat
.interlaced
= screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
511 PIPE_VIDEO_CAP_PREFERS_INTERLACED
);
513 /* and recreate the video buffer */
514 vlsurf
->video_buffer
= dec
->context
->create_video_buffer(dec
->context
, &vlsurf
->templat
);
516 /* still no luck? get me out of here... */
517 if (!vlsurf
->video_buffer
) {
518 pipe_mutex_unlock(vlsurf
->device
->mutex
);
519 return VDP_STATUS_NO_IMPLEMENTATION
;
521 vlVdpVideoSurfaceClear(vlsurf
);
522 pipe_mutex_unlock(vlsurf
->device
->mutex
);
525 for (i
= 0; i
< bitstream_buffer_count
; ++i
) {
526 buffers
[i
] = bitstream_buffers
[i
].bitstream
;
527 sizes
[i
] = bitstream_buffers
[i
].bitstream_bytes
;
530 memset(&desc
, 0, sizeof(desc
));
531 desc
.base
.profile
= dec
->profile
;
532 switch (u_reduce_video_profile(dec
->profile
)) {
533 case PIPE_VIDEO_FORMAT_MPEG12
:
534 ret
= vlVdpDecoderRenderMpeg12(&desc
.mpeg12
, (VdpPictureInfoMPEG1Or2
*)picture_info
);
536 case PIPE_VIDEO_FORMAT_MPEG4
:
537 ret
= vlVdpDecoderRenderMpeg4(&desc
.mpeg4
, (VdpPictureInfoMPEG4Part2
*)picture_info
);
539 case PIPE_VIDEO_FORMAT_VC1
:
540 if (dec
->profile
== PIPE_VIDEO_PROFILE_VC1_ADVANCED
)
541 vlVdpDecoderFixVC1Startcode(&bitstream_buffer_count
, buffers
, sizes
);
542 ret
= vlVdpDecoderRenderVC1(&desc
.vc1
, (VdpPictureInfoVC1
*)picture_info
);
544 case PIPE_VIDEO_FORMAT_MPEG4_AVC
:
545 desc
.h264
.pps
= &pps
;
546 ret
= vlVdpDecoderRenderH264(&desc
.h264
, (VdpPictureInfoH264
*)picture_info
);
549 return VDP_STATUS_INVALID_DECODER_PROFILE
;
552 if (ret
!= VDP_STATUS_OK
)
555 pipe_mutex_lock(vldecoder
->mutex
);
556 dec
->begin_frame(dec
, vlsurf
->video_buffer
, &desc
.base
);
557 dec
->decode_bitstream(dec
, vlsurf
->video_buffer
, &desc
.base
, bitstream_buffer_count
, buffers
, sizes
);
558 dec
->end_frame(dec
, vlsurf
->video_buffer
, &desc
.base
);
559 pipe_mutex_unlock(vldecoder
->mutex
);