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

Steve Lhomme robux4 at videolabs.io
Mon Jun 26 19:20:17 CEST 2017


---
 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. */
-- 
2.12.1



More information about the vlc-devel mailing list