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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Mar 14 23:05:03 CET 2009


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?

> @@ -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)?
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.

> @@ -236,9 +242,11 @@
>          CHECK_ST_WARNING("Error when calling vdp_presentation_queue_block_until_surface_idle")
>  
>          vdp_st = vdp_video_mixer_render(video_mixer, VDP_INVALID_HANDLE, 0,
> -                                        field, 0, NULL,
> -                                        surface_render[vid_surface_num].surface,
> -                                        0, NULL, &src_rect_vid,
> +                                        field, (deint > 2) ? 2 : 0, past_pict,
> +                                        surface_render[current_pict].surface,
> +                                        (deint > 2) ? 1 : 0,
> +                                        &surface_render[vid_surface_num].surface,
> +                                        &src_rect_vid,
>                                          output_surface,
>                                          NULL, &out_rect_vid, 0, NULL);

Please don't bloat the function call, it is horribly huge as it is.
Particularly since it might be better to display the first frames with
bob deinterlacing than just discarding them as I think you do now...



More information about the MPlayer-dev-eng mailing list