Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 12-13-09, 03:03 PM   #1
seaweed
Registered User
 
Join Date: Sep 2009
Posts: 57
Default Frame reordering with vdpau

Hi I am using libavcodec demuxer / decoder integration with VDPAU
I am not clear if VDPAU internally handles re-ordering or I have to provide ordered compressed slices to VDPAU? I am setting SLICE_FLAG_CODED_ORDER bit in avcontext->slice_flags but when I check the ordering when vdpau decoder_render is called, the slices are not ordered (has some B frames in the video). My question is does VDPAU autometically handle reordering?

Also whats the best way to check if a video surface is used for reference and if it s not , I can go ahead and clear the surface? It seems VDPAU render state's flags (libavcodec/vdpau.h, FF_VDPAU_STATE_USED_FOR_REFERENCE etc) are not set autometically.

Thanks
Seaweed
seaweed is offline   Reply With Quote
Old 12-14-09, 10:41 AM   #2
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Frame reordering with vdpau

seaweed,

Are you talking about re-ordering slices within a frame, or re-order frames between decode and display?

Either way, all the slices for a given picture in the bitstream need to be provided in-order to VDPAU in a single call to VdpDecoderRender. No re-ordering is required for slices within a picture (assuming no bizarre muxing format that I'm not aware of). Pictures should be decoded in the order they are present in the bitstream (again, assuming no bizarre muxing format that I'm not aware of). The order that pictures should be displayed is almost certainly different to the order in which they must be decoded. It is up to the application, not VDPAU, to handle re-ordering pictures between decode and display. I believe ffmpeg implements any re-ordering algorithm required, but I'm not completely certain.

ffmpeg's FF_VDPAU_STATE_USED_FOR_REFERENCE flag definition may be simply a convenience for the application; in other words, the application must handle setting/clearing this flag. I imagine you'll find examples on how this might be used in the MPlayer source, in vd_ffmpeg.c and vo_vdpau.c.
Stephen Warren is offline   Reply With Quote
Old 12-29-09, 05:04 PM   #3
seaweed
Registered User
 
Join Date: Sep 2009
Posts: 57
Default Re: Frame reordering with vdpau

Hi Stephen, Thanks for replying, sorry I didn't replied sooner. My answers are inline:

Quote:
Originally Posted by Stephen Warren View Post
seaweed,
Are you talking about re-ordering slices within a frame, or re-order frames between decode and display?
I was talking about both, but I would imagine the field ordering is handled via the mechanism of populating the surface history ( past, current, future) in conjunction with the VdpVideoMixerPictureStructure parameter for top and bottom field. The confusion about re-ordering arose since I am submitting frames, but not fields.

Quote:
Originally Posted by Stephen Warren View Post
Either way, all the slices for a given picture in the bitstream need to be provided in-order to VDPAU in a single call to VdpDecoderRender. No re-ordering is required for slices within a picture (assuming no bizarre muxing format that I'm not aware of). Pictures should be decoded in the order they are present in the bitstream (again, assuming no bizarre muxing format that I'm not aware of). The order that pictures should be displayed is almost certainly different to the order in which they must be decoded. It is up to the application, not VDPAU, to handle re-ordering pictures between decode and display. I believe ffmpeg implements any re-ordering algorithm required, but I'm not completely certain.
Fair enough, I think ffmpeg handles it quite well actually, without any additional timestamp based re-ordering, when I pass the decoded frames to VdpDecoderRender as they come (when compressed bitstream have B frames and I/P frames), I don't see any jerkiness on the rendered video. ffmpeg seems to sort the frames in display order.

Quote:
Originally Posted by Stephen Warren View Post
ffmpeg's FF_VDPAU_STATE_USED_FOR_REFERENCE flag definition may be simply a convenience for the application; in other words, the application must handle setting/clearing this flag. I imagine you'll find examples on how this might be used in the MPlayer source, in vd_ffmpeg.c and vo_vdpau.c.
Thats what I thought. BTW I don't think mplayer uses that flag currently.
seaweed is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:36 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.