[vlc-devel] [PATCH 09/11] video_filter:deinterlace: move all phosphor handling after GetOutputFormat

Steve Lhomme robux4 at videolabs.io
Tue Jun 27 10:21:45 CEST 2017


--
replaces https://patches.videolan.org/patch/17099/
- don't use a flag anymore to detect phosphor mode
---
 modules/video_filter/deinterlace/deinterlace.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c
index 5eeeb8c127..b793fc482d 100644
--- a/modules/video_filter/deinterlace/deinterlace.c
+++ b/modules/video_filter/deinterlace/deinterlace.c
@@ -260,15 +260,6 @@ static void GetOutputFormat( filter_t *p_filter,
     {
         p_dst->i_frame_rate *= 2;
     }
-
-    if( p_sys->i_mode == DEINTERLACE_PHOSPHOR  &&
-        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 )
-    {
-        p_dst->i_chroma = p_src->i_chroma == VLC_CODEC_J420 ? VLC_CODEC_J422 :
-                                                              VLC_CODEC_I422;
-    }
 }
 
 /*****************************************************************************
@@ -721,6 +712,10 @@ notsupp:
     }
 
     /* */
+    video_format_t fmt;
+    GetOutputFormat( p_filter, &fmt, &p_filter->fmt_in.video );
+
+    /* */
     if( p_sys->i_mode == DEINTERLACE_PHOSPHOR )
     {
         int i_c420 = var_GetInteger( p_filter,
@@ -750,11 +745,16 @@ notsupp:
         msg_Dbg( p_filter, "using Phosphor dimmer strength %d", i_dimmer );
         /* The internal value ranges from 0 to 3. */
         p_sys->phosphor.i_dimmer_strength = i_dimmer - 1;
+
+        if( 2 * chroma->p[1].h.num == chroma->p[1].h.den &&
+            2 * chroma->p[2].h.num == chroma->p[2].h.den &&
+            i_c420 == PC_UPCONVERT )
+        {
+            fmt.i_chroma = p_filter->fmt_in.video.i_chroma == VLC_CODEC_J420 ?
+                        VLC_CODEC_J422 : VLC_CODEC_I422;
+        }
     }
 
-    /* */
-    video_format_t fmt;
-    GetOutputFormat( p_filter, &fmt, &p_filter->fmt_in.video );
     if( !p_filter->b_allow_fmt_out_change &&
         ( fmt.i_chroma != p_filter->fmt_in.video.i_chroma ||
           fmt.i_height != p_filter->fmt_in.video.i_height ) )
-- 
2.12.1



More information about the vlc-devel mailing list