]> git.sesse.net Git - vlc/blob - modules/video_filter/deinterlace/algo_basic.h
Refactored deinterlacer module
[vlc] / modules / video_filter / deinterlace / algo_basic.h
1 /*****************************************************************************
2  * algo_basic.h : Basic algorithms for the VLC deinterlacer
3  *****************************************************************************
4  * Copyright (C) 2000-2011 the VideoLAN team
5  * $Id$
6  *
7  * Author: Sam Hocevar <sam@zoy.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifndef VLC_DEINTERLACE_ALGO_BASIC_H
25 #define VLC_DEINTERLACE_ALGO_BASIC_H 1
26
27 /**
28  * \file
29  * Basic deinterlace algorithms: Discard, Bob, Linear, Mean and Blend.
30  */
31
32 /* Forward declarations */
33 struct filter_t;
34 struct picture_t;
35
36 /*****************************************************************************
37  * Functions
38  *****************************************************************************/
39
40 /**
41  * RenderDiscard: only keep top or bottom field, discard the other.
42  *
43  * For a 2x (framerate-doubling) near-equivalent, see RenderBob().
44  *
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.
49  * @see RenderBob()
50  * @see Deinterlace()
51  */
52 void RenderDiscard( filter_t *p_filter,
53                     picture_t *p_outpic, picture_t *p_pic, int i_field );
54
55 /**
56  * RenderBob: basic framerate doubler.
57  *
58  * Creates an illusion of full vertical resolution while running.
59  *
60  * For a 1x (non-doubling) near-equivalent, see RenderDiscard().
61  *
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.
66  * @see RenderLinear()
67  * @see Deinterlace()
68  */
69 void RenderBob( filter_t *p_filter,
70                 picture_t *p_outpic, picture_t *p_pic, int i_field );
71
72 /**
73  * RenderLinear: Bob with linear interpolation.
74  *
75  * There is no 1x (non-doubling) equivalent for this filter.
76  *
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.
81  * @see RenderBob()
82  * @see Deinterlace()
83  */
84 void RenderLinear( filter_t *p_filter,
85                    picture_t *p_outpic, picture_t *p_pic, int i_field );
86
87 /**
88  * RenderMean: half-resolution blender.
89  *
90  * Renders the mean of the top and bottom fields.
91  *
92  * Obviously, there is no 2x equivalent for this filter.
93  *
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.
97  * @see Deinterlace()
98  */
99 void RenderMean( filter_t *p_filter,
100                  picture_t *p_outpic, picture_t *p_pic );
101
102 /**
103  * RenderBlend: full-resolution blender.
104  *
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.
107  *
108  * Obviously, there is no 2x equivalent for this filter.
109  *
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.
113  * @see Deinterlace()
114  */
115 void RenderBlend( filter_t *p_filter,
116                   picture_t *p_outpic, picture_t *p_pic );
117
118 #endif