]> git.sesse.net Git - vlc/blob - modules/video_filter/deinterlace/algo_basic.h
Cast or convert <ctype.h> functions it parameters to unsigned char
[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  *         Damien Lucas <nitrox@videolan.org>  (Bob, Blend)
9  *         Laurent Aimar <fenrir@videolan.org> (Bob, Blend)
10  *
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.
15  *
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.
20  *
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  *****************************************************************************/
25
26 #ifndef VLC_DEINTERLACE_ALGO_BASIC_H
27 #define VLC_DEINTERLACE_ALGO_BASIC_H 1
28
29 /**
30  * \file
31  * Basic deinterlace algorithms: Discard, Bob, Linear, Mean and Blend.
32  */
33
34 /* Forward declarations */
35 struct filter_t;
36 struct picture_t;
37
38 /*****************************************************************************
39  * Functions
40  *****************************************************************************/
41
42 /**
43  * RenderDiscard: only keep top or bottom field, discard the other.
44  *
45  * For a 2x (framerate-doubling) near-equivalent, see RenderBob().
46  *
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.
51  * @see RenderBob()
52  * @see Deinterlace()
53  */
54 void RenderDiscard( filter_t *p_filter,
55                     picture_t *p_outpic, picture_t *p_pic, int i_field );
56
57 /**
58  * RenderBob: basic framerate doubler.
59  *
60  * Creates an illusion of full vertical resolution while running.
61  *
62  * For a 1x (non-doubling) near-equivalent, see RenderDiscard().
63  *
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.
68  * @see RenderLinear()
69  * @see Deinterlace()
70  */
71 void RenderBob( filter_t *p_filter,
72                 picture_t *p_outpic, picture_t *p_pic, int i_field );
73
74 /**
75  * RenderLinear: Bob with linear interpolation.
76  *
77  * There is no 1x (non-doubling) equivalent for this filter.
78  *
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.
83  * @see RenderBob()
84  * @see Deinterlace()
85  */
86 void RenderLinear( filter_t *p_filter,
87                    picture_t *p_outpic, picture_t *p_pic, int i_field );
88
89 /**
90  * RenderMean: half-resolution blender.
91  *
92  * Renders the mean of the top and bottom fields.
93  *
94  * Obviously, there is no 2x equivalent for this filter.
95  *
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.
99  * @see Deinterlace()
100  */
101 void RenderMean( filter_t *p_filter,
102                  picture_t *p_outpic, picture_t *p_pic );
103
104 /**
105  * RenderBlend: full-resolution blender.
106  *
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.
109  *
110  * Obviously, there is no 2x equivalent for this filter.
111  *
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.
115  * @see Deinterlace()
116  */
117 void RenderBlend( filter_t *p_filter,
118                   picture_t *p_outpic, picture_t *p_pic );
119
120 #endif