[vlc-devel] [PATCH 08/10] video_filter:deinterlace: use a flag to know if we're using the phosphor method

Steve Lhomme robux4 at gmail.com
Tue Jun 27 08:32:31 CEST 2017


On Mon, Jun 26, 2017 at 7:52 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 26 juin 2017 19:20:17 GMT+02:00, Steve Lhomme <robux4 at videolabs.io> a
> écrit :
>>
>> ---
>>  modules/video_filter/deinterlace/deinterlace.c | 6 ++++--
>>  modules/video_filter/deinterlace/deinterlace.h | 2 ++
>>  2 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/video_filter/deinterlace/deinterlace.c
>> b/modules/video_filter/deinterlace/deinterlace.c
>> index 4ebc3826ab..9baa049ccb 100644
>> --- a/modules/video_filter/deinterlace/deinterlace.c
>> +++ b/modules/video_filter/deinterlace/deinterlace.c
>> @@ -155,6 +155,7 @@ static void SetFilterMethod( filter_t *p_filter, const
>> char *mode, bool pack )
>>      p_sys->b_half_height = false;
>>      p_sys->b_use_frame_history = false;
>>      p_sys->b_single_field = false;
>> +    p_sys->b_phosphor_mode = false;
>>
>>      if ( !strcmp( mode, "auto" ) || !strcmp( mode, "x" ) )
>>      {
>> @@ -215,6 +216,7 @@ static void SetFilterMethod( filter_t *p_filter, const
>> char *mode, bool pack )
>>      else if( !strcmp( mode, "phosphor" ) )
>>      {
>>          p_sys->i_mode = DEINTERLACE_PHOSPHOR;
>> +        p_sys->b_phosphor_mode = true;
>>          p_sys->b_double_rate = true;
>>          p_sys->b_use_frame_history = true;
>>      }
>> @@ -261,7 +263,7 @@ static void GetOutputFormat( filter_t *p_filter,
>>          p_dst->i_frame_rate *= 2;
>>      }
>>
>> -    if( p_sys->i_mode == DEINTERLACE_PHOSPHOR  &&
>> +    if( p_sys->b_phosphor_mode &&
>>          2 * p_sys->chroma->p[1].h.num == p_sys->chroma->p[1].h.den &&
>>          2 * p_sys->chroma->p[2].h.num == p_sys->chroma->p[2].h.den &&
>>          p_sys->phosphor.i_chroma_for_420 == PC_UPCONVERT )
>> @@ -726,7 +728,7 @@ notsupp:
>>      }
>>
>>      /* */
>> -    if( p_sys->i_mode == DEINTERLACE_PHOSPHOR )
>> +    if( p_sys->b_phosphor_mode )
>>      {
>>          int i_c420 = var_GetInteger( p_filter,
>>                                       FILTER_CFG_PREFIX "phosphor-chroma"
>> );
>> diff --git a/modules/video_filter/deinterlace/deinterlace.h
>> b/modules/video_filter/deinterlace/deinterlace.h
>> index 3059f09f2a..d09cac5f24 100644
>> --- a/modules/video_filter/deinterlace/deinterlace.h
>> +++ b/modules/video_filter/deinterlace/deinterlace.h
>> @@ -120,6 +120,8 @@ struct filter_sys_t
>>      picture_t *pp_history[HISTORY_SIZE];
>>
>>      /* Algorithm-specific substructures */
>> +    bool b_phosphor_mode;     /**< The filter mode is "phosphor" */
>> +
>>      union {
>>          phosphor_sys_t phosphor; /**< Phosphor algorithm state. */
>>          ivtc_sys_t ivtc;         /**< IVTC algorithm state. */
>
>
> Seems like a failure to abstract the algorithms correctly, TBH.

But I'm not abstracting the algorithms, just the field references and
timestamps. All the filter_sys_t stuff remain as it is for now. That
may be done later but IMO not necessary, there's little to gain.

> --
> Rémi Denis-Courmont
> Typed on an inconvenient virtual keyboard
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list