1 /*****************************************************************************
2 * algo_basic.h : Basic algorithms for the VLC deinterlacer
3 *****************************************************************************
4 * Copyright (C) 2000-2011 VLC authors and VideoLAN
7 * Author: Sam Hocevar <sam@zoy.org>
8 * Damien Lucas <nitrox@videolan.org> (Bob, Blend)
9 * Laurent Aimar <fenrir@videolan.org> (Bob, Blend)
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 #ifndef VLC_DEINTERLACE_ALGO_BASIC_H
27 #define VLC_DEINTERLACE_ALGO_BASIC_H 1
31 * Basic deinterlace algorithms: Discard, Bob, Linear, Mean and Blend.
34 /* Forward declarations */
38 /*****************************************************************************
40 *****************************************************************************/
43 * RenderDiscard: only keep top or bottom field, discard the other.
45 * For a 2x (framerate-doubling) near-equivalent, see RenderBob().
47 * @param p_outpic Output frame. Must be allocated by caller.
48 * @param p_pic Input frame. Must exist.
49 * @param i_field Keep which field? 0 = top field, 1 = bottom field.
53 void RenderDiscard( 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_outpic Output frame. Must be allocated by caller.
63 * @param p_pic Input frame. Must exist.
64 * @param i_field Render which field? 0 = top field, 1 = bottom field.
68 void RenderBob( picture_t *p_outpic, picture_t *p_pic, int i_field );
71 * RenderLinear: Bob with linear interpolation.
73 * There is no 1x (non-doubling) equivalent for this filter.
75 * @param p_filter The filter instance. Must be non-NULL.
76 * @param p_outpic Output frame. Must be allocated by caller.
77 * @param p_pic Input frame. Must exist.
78 * @param i_field Render which field? 0 = top field, 1 = bottom field.
82 void RenderLinear( filter_t *p_filter,
83 picture_t *p_outpic, picture_t *p_pic, int i_field );
86 * RenderMean: half-resolution blender.
88 * Renders the mean of the top and bottom fields.
90 * Obviously, there is no 2x equivalent for this filter.
92 * @param p_filter The filter instance. Must be non-NULL.
93 * @param p_outpic Output frame. Must be allocated by caller.
94 * @param p_pic Input frame. Must exist.
97 void RenderMean( filter_t *p_filter,
98 picture_t *p_outpic, picture_t *p_pic );
101 * RenderBlend: full-resolution blender.
103 * The first line is copied; for the rest of the lines, line N
104 * is the mean of lines N and N-1 in the input.
106 * Obviously, there is no 2x equivalent for this filter.
108 * @param p_filter The filter instance. Must be non-NULL.
109 * @param p_outpic Output frame. Must be allocated by caller.
110 * @param p_pic Input frame. Must exist.
113 void RenderBlend( filter_t *p_filter,
114 picture_t *p_outpic, picture_t *p_pic );