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>
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
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 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 General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, 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_filter The filter instance. Must be non-NULL.
48 * @param p_outpic Output frame. Must be allocated by caller.
49 * @param p_pic Input frame. Must exist.
50 * @param i_field Keep which field? 0 = top field, 1 = bottom field.
54 void RenderDiscard( filter_t *p_filter,
55 picture_t *p_outpic, picture_t *p_pic, int i_field );
58 * RenderBob: basic framerate doubler.
60 * Creates an illusion of full vertical resolution while running.
62 * For a 1x (non-doubling) near-equivalent, see RenderDiscard().
64 * @param p_filter The filter instance. Must be non-NULL.
65 * @param p_outpic Output frame. Must be allocated by caller.
66 * @param p_pic Input frame. Must exist.
67 * @param i_field Render which field? 0 = top field, 1 = bottom field.
71 void RenderBob( filter_t *p_filter,
72 picture_t *p_outpic, picture_t *p_pic, int i_field );
75 * RenderLinear: Bob with linear interpolation.
77 * There is no 1x (non-doubling) equivalent for this filter.
79 * @param p_filter The filter instance. Must be non-NULL.
80 * @param p_outpic Output frame. Must be allocated by caller.
81 * @param p_pic Input frame. Must exist.
82 * @param i_field Render which field? 0 = top field, 1 = bottom field.
86 void RenderLinear( filter_t *p_filter,
87 picture_t *p_outpic, picture_t *p_pic, int i_field );
90 * RenderMean: half-resolution blender.
92 * Renders the mean of the top and bottom fields.
94 * Obviously, there is no 2x equivalent for this filter.
96 * @param p_filter The filter instance. Must be non-NULL.
97 * @param p_outpic Output frame. Must be allocated by caller.
98 * @param p_pic Input frame. Must exist.
101 void RenderMean( filter_t *p_filter,
102 picture_t *p_outpic, picture_t *p_pic );
105 * RenderBlend: full-resolution blender.
107 * The first line is copied; for the rest of the lines, line N
108 * is the mean of lines N and N-1 in the input.
110 * Obviously, there is no 2x equivalent for this filter.
112 * @param p_filter The filter instance. Must be non-NULL.
113 * @param p_outpic Output frame. Must be allocated by caller.
114 * @param p_pic Input frame. Must exist.
117 void RenderBlend( filter_t *p_filter,
118 picture_t *p_outpic, picture_t *p_pic );