Browse Source

Revert "deinterlace: remove always false b_half_height variable"

This reverts commit fbbd68f8cf.

There are in fact the "discard" and "mean" deinterlace filters that use half
height.
pull/176/head
Steve Lhomme 1 year ago
parent
commit
13849b5561
  1. 9
      modules/video_filter/deinterlace/common.c
  2. 1
      modules/video_filter/deinterlace/common.h
  3. 39
      modules/video_filter/deinterlace/deinterlace.c

9
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;

1
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

39
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,
};

Loading…
Cancel
Save