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 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
);
149 * Destroy a VdpDecoder.
152 vlVdpDecoderDestroy(VdpDecoder decoder
)
154 vlVdpDecoder
*vldecoder
;
156 vldecoder
= (vlVdpDecoder
*)vlGetDataHTAB(decoder
);
158 return VDP_STATUS_INVALID_HANDLE
;
160 pipe_mutex_lock(vldecoder
->mutex
);
161 vldecoder
->decoder
->destroy(vldecoder
->decoder
);
162 pipe_mutex_unlock(vldecoder
->mutex
);
163 pipe_mutex_destroy(vldecoder
->mutex
);
165 vlRemoveDataHTAB(decoder
);
168 return VDP_STATUS_OK
;
172 * Retrieve the parameters used to create a VdpDecoder.
175 vlVdpDecoderGetParameters(VdpDecoder decoder
,
176 VdpDecoderProfile
*profile
,
180 vlVdpDecoder
*vldecoder
;
182 vldecoder
= (vlVdpDecoder
*)vlGetDataHTAB(decoder
);
184 return VDP_STATUS_INVALID_HANDLE
;
186 *profile
= PipeToProfile(vldecoder
->decoder
->profile
);
187 *width
= vldecoder
->decoder
->width
;
188 *height
= vldecoder
->decoder
->height
;
190 return VDP_STATUS_OK
;
194 vlVdpGetReferenceFrame(VdpVideoSurface handle
, struct pipe_video_buffer
**ref_frame
)
196 vlVdpSurface
*surface
;
198 /* if surfaces equals VDP_STATUS_INVALID_HANDLE, they are not used */
199 if (handle
== VDP_INVALID_HANDLE
) {
201 return VDP_STATUS_OK
;
204 surface
= vlGetDataHTAB(handle
);
206 return VDP_STATUS_INVALID_HANDLE
;
208 *ref_frame
= surface
->video_buffer
;
210 return VDP_STATUS_INVALID_HANDLE
;
212 return VDP_STATUS_OK
;
216 * Decode a mpeg 1/2 video.
219 vlVdpDecoderRenderMpeg12(struct pipe_mpeg12_picture_desc
*picture
,
220 VdpPictureInfoMPEG1Or2
*picture_info
)
224 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding MPEG12\n");
226 r
= vlVdpGetReferenceFrame(picture_info
->forward_reference
, &picture
->ref
[0]);
227 if (r
!= VDP_STATUS_OK
)
230 r
= vlVdpGetReferenceFrame(picture_info
->backward_reference
, &picture
->ref
[1]);
231 if (r
!= VDP_STATUS_OK
)
234 picture
->picture_coding_type
= picture_info
->picture_coding_type
;
235 picture
->picture_structure
= picture_info
->picture_structure
;
236 picture
->frame_pred_frame_dct
= picture_info
->frame_pred_frame_dct
;
237 picture
->q_scale_type
= picture_info
->q_scale_type
;
238 picture
->alternate_scan
= picture_info
->alternate_scan
;
239 picture
->intra_vlc_format
= picture_info
->intra_vlc_format
;
240 picture
->concealment_motion_vectors
= picture_info
->concealment_motion_vectors
;
241 picture
->intra_dc_precision
= picture_info
->intra_dc_precision
;
242 picture
->f_code
[0][0] = picture_info
->f_code
[0][0] - 1;
243 picture
->f_code
[0][1] = picture_info
->f_code
[0][1] - 1;
244 picture
->f_code
[1][0] = picture_info
->f_code
[1][0] - 1;
245 picture
->f_code
[1][1] = picture_info
->f_code
[1][1] - 1;
246 picture
->num_slices
= picture_info
->slice_count
;
247 picture
->top_field_first
= picture_info
->top_field_first
;
248 picture
->full_pel_forward_vector
= picture_info
->full_pel_forward_vector
;
249 picture
->full_pel_backward_vector
= picture_info
->full_pel_backward_vector
;
250 picture
->intra_matrix
= picture_info
->intra_quantizer_matrix
;
251 picture
->non_intra_matrix
= picture_info
->non_intra_quantizer_matrix
;
253 return VDP_STATUS_OK
;
257 * Decode a mpeg 4 video.
260 vlVdpDecoderRenderMpeg4(struct pipe_mpeg4_picture_desc
*picture
,
261 VdpPictureInfoMPEG4Part2
*picture_info
)
266 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding MPEG4\n");
268 r
= vlVdpGetReferenceFrame(picture_info
->forward_reference
, &picture
->ref
[0]);
269 if (r
!= VDP_STATUS_OK
)
272 r
= vlVdpGetReferenceFrame(picture_info
->backward_reference
, &picture
->ref
[1]);
273 if (r
!= VDP_STATUS_OK
)
276 for (i
= 0; i
< 2; ++i
) {
277 picture
->trd
[i
] = picture_info
->trd
[i
];
278 picture
->trb
[i
] = picture_info
->trb
[i
];
280 picture
->vop_time_increment_resolution
= picture_info
->vop_time_increment_resolution
;
281 picture
->vop_coding_type
= picture_info
->vop_coding_type
;
282 picture
->vop_fcode_forward
= picture_info
->vop_fcode_forward
;
283 picture
->vop_fcode_backward
= picture_info
->vop_fcode_backward
;
284 picture
->resync_marker_disable
= picture_info
->resync_marker_disable
;
285 picture
->interlaced
= picture_info
->interlaced
;
286 picture
->quant_type
= picture_info
->quant_type
;
287 picture
->quarter_sample
= picture_info
->quarter_sample
;
288 picture
->short_video_header
= picture_info
->short_video_header
;
289 picture
->rounding_control
= picture_info
->rounding_control
;
290 picture
->alternate_vertical_scan_flag
= picture_info
->alternate_vertical_scan_flag
;
291 picture
->top_field_first
= picture_info
->top_field_first
;
292 picture
->intra_matrix
= picture_info
->intra_quantizer_matrix
;
293 picture
->non_intra_matrix
= picture_info
->non_intra_quantizer_matrix
;
295 return VDP_STATUS_OK
;
299 vlVdpDecoderRenderVC1(struct pipe_vc1_picture_desc
*picture
,
300 VdpPictureInfoVC1
*picture_info
)
304 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding VC-1\n");
306 r
= vlVdpGetReferenceFrame(picture_info
->forward_reference
, &picture
->ref
[0]);
307 if (r
!= VDP_STATUS_OK
)
310 r
= vlVdpGetReferenceFrame(picture_info
->backward_reference
, &picture
->ref
[1]);
311 if (r
!= VDP_STATUS_OK
)
314 picture
->slice_count
= picture_info
->slice_count
;
315 picture
->picture_type
= picture_info
->picture_type
;
316 picture
->frame_coding_mode
= picture_info
->frame_coding_mode
;
317 picture
->postprocflag
= picture_info
->postprocflag
;
318 picture
->pulldown
= picture_info
->pulldown
;
319 picture
->interlace
= picture_info
->interlace
;
320 picture
->tfcntrflag
= picture_info
->tfcntrflag
;
321 picture
->finterpflag
= picture_info
->finterpflag
;
322 picture
->psf
= picture_info
->psf
;
323 picture
->dquant
= picture_info
->dquant
;
324 picture
->panscan_flag
= picture_info
->panscan_flag
;
325 picture
->refdist_flag
= picture_info
->refdist_flag
;
326 picture
->quantizer
= picture_info
->quantizer
;
327 picture
->extended_mv
= picture_info
->extended_mv
;
328 picture
->extended_dmv
= picture_info
->extended_dmv
;
329 picture
->overlap
= picture_info
->overlap
;
330 picture
->vstransform
= picture_info
->vstransform
;
331 picture
->loopfilter
= picture_info
->loopfilter
;
332 picture
->fastuvmc
= picture_info
->fastuvmc
;
333 picture
->range_mapy_flag
= picture_info
->range_mapy_flag
;
334 picture
->range_mapy
= picture_info
->range_mapy
;
335 picture
->range_mapuv_flag
= picture_info
->range_mapuv_flag
;
336 picture
->range_mapuv
= picture_info
->range_mapuv
;
337 picture
->multires
= picture_info
->multires
;
338 picture
->syncmarker
= picture_info
->syncmarker
;
339 picture
->rangered
= picture_info
->rangered
;
340 picture
->maxbframes
= picture_info
->maxbframes
;
341 picture
->deblockEnable
= picture_info
->deblockEnable
;
342 picture
->pquant
= picture_info
->pquant
;
344 return VDP_STATUS_OK
;
348 vlVdpDecoderRenderH264(struct pipe_h264_picture_desc
*picture
,
349 VdpPictureInfoH264
*picture_info
)
353 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Decoding H264\n");
355 picture
->pps
->sps
->mb_adaptive_frame_field_flag
= picture_info
->mb_adaptive_frame_field_flag
;
356 picture
->pps
->sps
->frame_mbs_only_flag
= picture_info
->frame_mbs_only_flag
;
357 picture
->pps
->sps
->log2_max_frame_num_minus4
= picture_info
->log2_max_frame_num_minus4
;
358 picture
->pps
->sps
->pic_order_cnt_type
= picture_info
->pic_order_cnt_type
;
359 picture
->pps
->sps
->log2_max_pic_order_cnt_lsb_minus4
= picture_info
->log2_max_pic_order_cnt_lsb_minus4
;
360 picture
->pps
->sps
->delta_pic_order_always_zero_flag
= picture_info
->delta_pic_order_always_zero_flag
;
361 picture
->pps
->sps
->direct_8x8_inference_flag
= picture_info
->direct_8x8_inference_flag
;
363 picture
->pps
->transform_8x8_mode_flag
= picture_info
->transform_8x8_mode_flag
;
364 picture
->pps
->chroma_qp_index_offset
= picture_info
->chroma_qp_index_offset
;
365 picture
->pps
->second_chroma_qp_index_offset
= picture_info
->second_chroma_qp_index_offset
;
366 picture
->pps
->pic_init_qp_minus26
= picture_info
->pic_init_qp_minus26
;
367 picture
->pps
->entropy_coding_mode_flag
= picture_info
->entropy_coding_mode_flag
;
368 picture
->pps
->deblocking_filter_control_present_flag
= picture_info
->deblocking_filter_control_present_flag
;
369 picture
->pps
->redundant_pic_cnt_present_flag
= picture_info
->redundant_pic_cnt_present_flag
;
370 picture
->pps
->constrained_intra_pred_flag
= picture_info
->constrained_intra_pred_flag
;
371 picture
->pps
->weighted_pred_flag
= picture_info
->weighted_pred_flag
;
372 picture
->pps
->weighted_bipred_idc
= picture_info
->weighted_bipred_idc
;
373 picture
->pps
->bottom_field_pic_order_in_frame_present_flag
= picture_info
->pic_order_present_flag
;
374 memcpy(picture
->pps
->ScalingList4x4
, picture_info
->scaling_lists_4x4
, 6*16);
375 memcpy(picture
->pps
->ScalingList8x8
, picture_info
->scaling_lists_8x8
, 2*64);
377 picture
->slice_count
= picture_info
->slice_count
;
378 picture
->field_order_cnt
[0] = picture_info
->field_order_cnt
[0];
379 picture
->field_order_cnt
[1] = picture_info
->field_order_cnt
[1];
380 picture
->is_reference
= picture_info
->is_reference
;
381 picture
->frame_num
= picture_info
->frame_num
;
382 picture
->field_pic_flag
= picture_info
->field_pic_flag
;
383 picture
->bottom_field_flag
= picture_info
->bottom_field_flag
;
384 picture
->num_ref_frames
= picture_info
->num_ref_frames
;
386 picture
->num_ref_idx_l0_active_minus1
= picture_info
->num_ref_idx_l0_active_minus1
;
387 picture
->num_ref_idx_l1_active_minus1
= picture_info
->num_ref_idx_l1_active_minus1
;
389 for (i
= 0; i
< 16; ++i
) {
390 VdpStatus ret
= vlVdpGetReferenceFrame
392 picture_info
->referenceFrames
[i
].surface
,
395 if (ret
!= VDP_STATUS_OK
)
398 picture
->is_long_term
[i
] = picture_info
->referenceFrames
[i
].is_long_term
;
399 picture
->top_is_reference
[i
] = picture_info
->referenceFrames
[i
].top_is_reference
;
400 picture
->bottom_is_reference
[i
] = picture_info
->referenceFrames
[i
].bottom_is_reference
;
401 picture
->field_order_cnt_list
[i
][0] = picture_info
->referenceFrames
[i
].field_order_cnt
[0];
402 picture
->field_order_cnt_list
[i
][1] = picture_info
->referenceFrames
[i
].field_order_cnt
[1];
403 picture
->frame_num_list
[i
] = picture_info
->referenceFrames
[i
].frame_idx
;
406 return VDP_STATUS_OK
;
410 vlVdpDecoderFixVC1Startcode(uint32_t *num_buffers
, const void *buffers
[], unsigned sizes
[])
412 static const uint8_t vc1_startcode
[] = { 0x00, 0x00, 0x01, 0x0D };
416 /* search the first 64 bytes for a startcode */
417 vl_vlc_init(&vlc
, *num_buffers
, buffers
, sizes
);
418 while (vl_vlc_search_byte(&vlc
, 64*8, 0x00) && vl_vlc_bits_left(&vlc
) >= 32) {
419 uint32_t value
= vl_vlc_peekbits(&vlc
, 32);
420 if (value
== 0x0000010D ||
421 value
== 0x0000010C ||
424 vl_vlc_eatbits(&vlc
, 8);
427 /* none found, ok add one manually */
428 VDPAU_MSG(VDPAU_TRACE
, "[VDPAU] Manually adding VC-1 startcode\n");
429 for (i
= *num_buffers
; i
> 0; --i
) {
430 buffers
[i
] = buffers
[i
- 1];
431 sizes
[i
] = sizes
[i
- 1];
434 buffers
[0] = vc1_startcode
;
439 * Decode a compressed field/frame and render the result into a VdpVideoSurface.
442 vlVdpDecoderRender(VdpDecoder decoder
,
443 VdpVideoSurface target
,
444 VdpPictureInfo
const *picture_info
,
445 uint32_t bitstream_buffer_count
,
446 VdpBitstreamBuffer
const *bitstream_buffers
)
448 const void * buffers
[bitstream_buffer_count
+ 1];
449 unsigned sizes
[bitstream_buffer_count
+ 1];
450 vlVdpDecoder
*vldecoder
;
451 vlVdpSurface
*vlsurf
;
453 struct pipe_screen
*screen
;
454 struct pipe_video_codec
*dec
;
455 bool buffer_support
[2];
457 struct pipe_h264_sps sps
= {};
458 struct pipe_h264_pps pps
= { &sps
};
460 struct pipe_picture_desc base
;
461 struct pipe_mpeg12_picture_desc mpeg12
;
462 struct pipe_mpeg4_picture_desc mpeg4
;
463 struct pipe_vc1_picture_desc vc1
;
464 struct pipe_h264_picture_desc h264
;
467 if (!(picture_info
&& bitstream_buffers
))
468 return VDP_STATUS_INVALID_POINTER
;
470 vldecoder
= (vlVdpDecoder
*)vlGetDataHTAB(decoder
);
472 return VDP_STATUS_INVALID_HANDLE
;
473 dec
= vldecoder
->decoder
;
474 screen
= dec
->context
->screen
;
476 vlsurf
= (vlVdpSurface
*)vlGetDataHTAB(target
);
478 return VDP_STATUS_INVALID_HANDLE
;
480 if (vlsurf
->device
!= vldecoder
->device
)
481 return VDP_STATUS_HANDLE_DEVICE_MISMATCH
;
483 if (vlsurf
->video_buffer
!= NULL
&& vlsurf
->video_buffer
->chroma_format
!= dec
->chroma_format
)
484 // TODO: Recreate decoder with correct chroma
485 return VDP_STATUS_INVALID_CHROMA_TYPE
;
487 buffer_support
[0] = screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
488 PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE
);
489 buffer_support
[1] = screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
490 PIPE_VIDEO_CAP_SUPPORTS_INTERLACED
);
492 if (vlsurf
->video_buffer
== NULL
||
493 !screen
->is_video_format_supported(screen
, vlsurf
->video_buffer
->buffer_format
,
494 dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
) ||
495 !buffer_support
[vlsurf
->video_buffer
->interlaced
]) {
497 pipe_mutex_lock(vlsurf
->device
->mutex
);
499 /* destroy the old one */
500 if (vlsurf
->video_buffer
)
501 vlsurf
->video_buffer
->destroy(vlsurf
->video_buffer
);
503 /* set the buffer format to the prefered one */
504 vlsurf
->templat
.buffer_format
= screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
505 PIPE_VIDEO_CAP_PREFERED_FORMAT
);
507 /* also set interlacing to decoders preferences */
508 vlsurf
->templat
.interlaced
= screen
->get_video_param(screen
, dec
->profile
, PIPE_VIDEO_ENTRYPOINT_BITSTREAM
,
509 PIPE_VIDEO_CAP_PREFERS_INTERLACED
);
511 /* and recreate the video buffer */
512 vlsurf
->video_buffer
= dec
->context
->create_video_buffer(dec
->context
, &vlsurf
->templat
);
514 /* still no luck? get me out of here... */
515 if (!vlsurf
->video_buffer
) {
516 pipe_mutex_unlock(vlsurf
->device
->mutex
);
517 return VDP_STATUS_NO_IMPLEMENTATION
;
519 vlVdpVideoSurfaceClear(vlsurf
);
520 pipe_mutex_unlock(vlsurf
->device
->mutex
);
523 for (i
= 0; i
< bitstream_buffer_count
; ++i
) {
524 buffers
[i
] = bitstream_buffers
[i
].bitstream
;
525 sizes
[i
] = bitstream_buffers
[i
].bitstream_bytes
;
528 memset(&desc
, 0, sizeof(desc
));
529 desc
.base
.profile
= dec
->profile
;
530 switch (u_reduce_video_profile(dec
->profile
)) {
531 case PIPE_VIDEO_FORMAT_MPEG12
:
532 ret
= vlVdpDecoderRenderMpeg12(&desc
.mpeg12
, (VdpPictureInfoMPEG1Or2
*)picture_info
);
534 case PIPE_VIDEO_FORMAT_MPEG4
:
535 ret
= vlVdpDecoderRenderMpeg4(&desc
.mpeg4
, (VdpPictureInfoMPEG4Part2
*)picture_info
);
537 case PIPE_VIDEO_FORMAT_VC1
:
538 if (dec
->profile
== PIPE_VIDEO_PROFILE_VC1_ADVANCED
)
539 vlVdpDecoderFixVC1Startcode(&bitstream_buffer_count
, buffers
, sizes
);
540 ret
= vlVdpDecoderRenderVC1(&desc
.vc1
, (VdpPictureInfoVC1
*)picture_info
);
542 case PIPE_VIDEO_FORMAT_MPEG4_AVC
:
543 desc
.h264
.pps
= &pps
;
544 ret
= vlVdpDecoderRenderH264(&desc
.h264
, (VdpPictureInfoH264
*)picture_info
);
547 return VDP_STATUS_INVALID_DECODER_PROFILE
;
550 if (ret
!= VDP_STATUS_OK
)
553 pipe_mutex_lock(vldecoder
->mutex
);
554 dec
->begin_frame(dec
, vlsurf
->video_buffer
, &desc
.base
);
555 dec
->decode_bitstream(dec
, vlsurf
->video_buffer
, &desc
.base
, bitstream_buffer_count
, buffers
, sizes
);
556 dec
->end_frame(dec
, vlsurf
->video_buffer
, &desc
.base
);
557 pipe_mutex_unlock(vldecoder
->mutex
);