[MPlayer-dev-eng] [PATCH]Implement advanced deinterlacing for vdpau with SW decoders

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Mar 15 11:40:26 CET 2009


Reimar Döffinger <Reimar.Doeffinger <at> gmx.de> writes:

> 
> On Sat, Mar 14, 2009 at 06:02:29PM +0100, Carl Eugen Hoyos wrote:
> > Reimar, could you comment if the overall idea is ok and how to avoid to  
> > always feature_enable DEINTERLACE_TEMPORAL? I would really like to have  
> > temporal deinterlacing the standard if "D" is pressed.
> 
> You can enable or disable a feature any time you want, but you have to
> create the video mixer with those features...
> 
> >  /* number of video and output surfaces */
> > -#define NUM_OUTPUT_SURFACES                2
> > +#define NUM_OUTPUT_SURFACES                5
> 
> Why?

Because three additional surfaces are needed for advanced deinterlacing?

> > @@ -220,6 +221,11 @@
> >      for (i = 0; i <= !!(deint > 1); i++) {
> >          int field = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
> >          VdpOutputSurface output_surface;
> > +        VdpVideoSurface const past_pict[2] =
> > {surface_render[(vid_surface_num+2)&3].surface,
> > +        surface_render[(vid_surface_num+1)&3].surface};
> > +        int current_pict = (deint > 2) ? (vid_surface_num + 3) & 3 :
> > vid_surface_num;
> 
> This is confusing, -1, -2, -3 would be clearer (making vid_surface_num
> unsigned might be a good idea though)?

That turned out to be more difficult than expected.
Should I use INT_MAX instead of -1?
Or leave the additions?

> But thinking of hoe to extend this to accelerated video, I think it
> would be better to create a global
> VdpVideoSurface past_surfaces[3];
> and queue them up in there in draw_image.

You mean three pointers to VdpVideoSurface? Or copy the surfaces?
I don't see how this works with the way draw_image() calls get_surface().

[...]
> >          vdp_st = vdp_video_mixer_render(...
[...]
> Please don't bloat the function call, it is horribly huge as it is.

I agree.

> Particularly since it might be better to display the first frames with
> bob deinterlacing than just discarding them as I think you do now...

All frames are shown with the patch as I sent it.

Carl Eugen




More information about the MPlayer-dev-eng mailing list