[vlc-commits] [Git][videolan/vlc][master] Revert "deinterlace: remove always false b_half_height variable"

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 31 11:03:01 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
13849b55 by Steve Lhomme at 2025-01-31T10:41:41+00:00
Revert "deinterlace: remove always false b_half_height variable"

This reverts commit fbbd68f8cfcba72cfa8031b6539dc7a4445df7e2.

There are in fact the "discard" and "mean" deinterlace filters that use half
height.

- - - - -


3 changed files:

- modules/video_filter/deinterlace/common.c
- modules/video_filter/deinterlace/common.h
- modules/video_filter/deinterlace/deinterlace.c


Changes:

=====================================
modules/video_filter/deinterlace/common.c
=====================================
@@ -35,6 +35,7 @@
 void InitDeinterlacingContext( struct deinterlace_ctx *p_context )
 {
     p_context->settings.b_double_rate = false;
+    p_context->settings.b_half_height = false;
     p_context->settings.b_use_frame_history = false;
     p_context->settings.b_custom_pts = false;
 
@@ -107,6 +108,14 @@ void GetDeinterlacingOutput( const struct deinterlace_ctx *p_context,
 {
     *p_dst = *p_src;
 
+    if( p_context->settings.b_half_height )
+    {
+        p_dst->i_height /= 2;
+        p_dst->i_visible_height /= 2;
+        p_dst->i_y_offset /= 2;
+        p_dst->i_sar_den *= 2;
+    }
+
     if( p_context->settings.b_double_rate )
     {
         p_dst->i_frame_rate *= 2;


=====================================
modules/video_filter/deinterlace/common.h
=====================================
@@ -58,6 +58,7 @@ typedef struct  {
     bool b_double_rate;       /**< Shall we double the framerate? */
     bool b_use_frame_history; /**< Use the input frame history buffer? */
     bool b_custom_pts;        /**< for inverse telecine */
+    bool b_half_height;       /**< Shall be divide the height by 2 */
 } deinterlace_algo;
 
 struct deinterlace_ctx


=====================================
modules/video_filter/deinterlace/deinterlace.c
=====================================
@@ -135,6 +135,29 @@ static int Open( filter_t *p_filter );
  */
 static void Flush( filter_t *p_filter );
 
+/**
+ * Mouse callback for the deinterlace filter.
+ *
+ * Open() sets this up as the mouse callback method (pf_video_mouse)
+ * in the filter structure.
+ *
+ * Currently, this handles the scaling of the y coordinate for algorithms
+ * that halve the output height.
+ *
+ * @param p_filter The filter instance.
+ * @param[out] p_mouse Updated mouse position data.
+ * @param[in] p_old Previous mouse position data. Unused in this filter.
+ * @param[in] p_new Latest mouse position data.
+ * @return VLC error code; currently always VLC_SUCCESS.
+ * @retval VLC_SUCCESS All ok.
+ * @see Open()
+ * @see filter_t
+ * @see vlc_mouse_t
+ */
+static int Mouse( filter_t *p_filter,
+                  vlc_mouse_t *p_mouse,
+                  const vlc_mouse_t *p_old );
+
 /*****************************************************************************
  * Extra documentation
  *****************************************************************************/
@@ -432,6 +455,21 @@ void Flush( filter_t *p_filter )
     IVTCClearState( p_filter );
 }
 
+/*****************************************************************************
+ * Mouse event callback
+ *****************************************************************************/
+
+int Mouse( filter_t *p_filter,
+           vlc_mouse_t *p_mouse,
+           const vlc_mouse_t *p_old )
+{
+    VLC_UNUSED(p_old);
+    filter_sys_t *p_sys = p_filter->p_sys;
+    if( p_sys->context.settings.b_half_height )
+        p_mouse->i_y *= 2;
+    return VLC_SUCCESS;
+}
+
 /*****************************************************************************
  * Close: clean up the filter
  *****************************************************************************/
@@ -448,6 +486,7 @@ static void Close( filter_t *p_filter )
 static const struct vlc_filter_operations filter_ops = {
     .filter_video = Deinterlace,
     .flush = Flush,
+    .video_mouse = Mouse,
     .close = Close,
 };
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/13849b5561eda64cd47e0c6f6848a3d9f734028a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/13849b5561eda64cd47e0c6f6848a3d9f734028a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list