[vlc-devel] [PATCH 1/9] video_format: add the number of fields per picture in the video format

Romain Vimont rom1v at videolabs.io
Mon Nov 16 15:38:21 CET 2020


On Mon, Nov 16, 2020 at 01:44:12PM +0100, Steve Lhomme wrote:
> In general it's 2 fields. If the number of fields changes in the source, the
> (deinterlacing) filters should be updated.
> 
> By default the video format is progressive and the i_num_fields can be ignored.
> It should be set to 2 for progressive to be consistent with how the value was
> set so far.
> 
> This field is more stable than the picture i_nb_fields that also included
> repeated fields and pictures. It only contains the information about the
> number of fields in each actual picture.
> ---
>  include/vlc_es.h                      | 3 +++
>  modules/visualization/visual/visual.c | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/vlc_es.h b/include/vlc_es.h
> index 404a937d833..459d16b3c37 100644
> --- a/include/vlc_es.h
> +++ b/include/vlc_es.h
> @@ -376,6 +376,8 @@ struct video_format_t
>      video_multiview_mode_t multiview_mode;        /** Multiview mode, 2D, 3D */
>      bool b_multiview_right_eye_first;   /** Multiview left or right eye first*/
>  
> +    unsigned int    i_num_fields;          /**< number of fields per picture */

The number of fields may vary per picture:
https://code.videolan.org/videolan/vlc/-/blob/a708c988091d6bc770212f5deeaba45e2395f4b2/modules/video_filter/deinterlace/deinterlace.c#L223-224

So I think it does not make sense to expose it in video_format_t, and
the deinterlace/splitfields information should be encoded differently.

Regards


More information about the vlc-devel mailing list