1 /*****************************************************************************
2 * algo_basic.h : Basic algorithms for the VLC deinterlacer
3 *****************************************************************************
4 * Copyright (C) 2000-2011 the VideoLAN team
7 * Author: Sam Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef VLC_DEINTERLACE_ALGO_BASIC_H
25 #define VLC_DEINTERLACE_ALGO_BASIC_H 1
29 * Basic deinterlace algorithms: Discard, Bob, Linear, Mean and Blend.
32 /* Forward declarations */
36 /*****************************************************************************
38 *****************************************************************************/
41 * RenderDiscard: only keep top or bottom field, discard the other.
43 * For a 2x (framerate-doubling) near-equivalent, see RenderBob().
45 * @param p_filter The filter instance. Must be non-NULL.
46 * @param p_outpic Output frame. Must be allocated by caller.
47 * @param p_pic Input frame. Must exist.
48 * @param i_field Keep which field? 0 = top field, 1 = bottom field.
52 void RenderDiscard( filter_t *p_filter,
53 picture_t *p_outpic, picture_t *p_pic, int i_field );
56 * RenderBob: basic framerate doubler.
58 * Creates an illusion of full vertical resolution while running.
60 * For a 1x (non-doubling) near-equivalent, see RenderDiscard().
62 * @param p_filter The filter instance. Must be non-NULL.
63 * @param p_outpic Output frame. Must be allocated by caller.
64 * @param p_pic Input frame. Must exist.
65 * @param i_field Render which field? 0 = top field, 1 = bottom field.
69 void RenderBob( filter_t *p_filter,
70 picture_t *p_outpic, picture_t *p_pic, int i_field );
73 * RenderLinear: Bob with linear interpolation.
75 * There is no 1x (non-doubling) equivalent for this filter.
77 * @param p_filter The filter instance. Must be non-NULL.
78 * @param p_outpic Output frame. Must be allocated by caller.
79 * @param p_pic Input frame. Must exist.
80 * @param i_field Render which field? 0 = top field, 1 = bottom field.
84 void RenderLinear( filter_t *p_filter,
85 picture_t *p_outpic, picture_t *p_pic, int i_field );
88 * RenderMean: half-resolution blender.
90 * Renders the mean of the top and bottom fields.
92 * Obviously, there is no 2x equivalent for this filter.
94 * @param p_filter The filter instance. Must be non-NULL.
95 * @param p_outpic Output frame. Must be allocated by caller.
96 * @param p_pic Input frame. Must exist.
99 void RenderMean( filter_t *p_filter,
100 picture_t *p_outpic, picture_t *p_pic );
103 * RenderBlend: full-resolution blender.
105 * The first line is copied; for the rest of the lines, line N
106 * is the mean of lines N and N-1 in the input.
108 * Obviously, there is no 2x equivalent for this filter.
110 * @param p_filter The filter instance. Must be non-NULL.
111 * @param p_outpic Output frame. Must be allocated by caller.
112 * @param p_pic Input frame. Must exist.
115 void RenderBlend( filter_t *p_filter,
116 picture_t *p_outpic, picture_t *p_pic );