]> git.sesse.net Git - vlc/blob - modules/video_filter/deinterlace/algo_basic.h
Check for MMXEXT and SSE at build-time if possible
[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_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.
50  * @see RenderBob()
51  * @see Deinterlace()
52  */
53 void RenderDiscard( 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_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.
65  * @see RenderLinear()
66  * @see Deinterlace()
67  */
68 void RenderBob( picture_t *p_outpic, picture_t *p_pic, int i_field );
69
70 /**
71  * RenderLinear: Bob with linear interpolation.
72  *
73  * There is no 1x (non-doubling) equivalent for this filter.
74  *
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.
79  * @see RenderBob()
80  * @see Deinterlace()
81  */
82 void RenderLinear( filter_t *p_filter,
83                    picture_t *p_outpic, picture_t *p_pic, int i_field );
84
85 /**
86  * RenderMean: half-resolution blender.
87  *
88  * Renders the mean of the top and bottom fields.
89  *
90  * Obviously, there is no 2x equivalent for this filter.
91  *
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.
95  * @see Deinterlace()
96  */
97 void RenderMean( filter_t *p_filter,
98                  picture_t *p_outpic, picture_t *p_pic );
99
100 /**
101  * RenderBlend: full-resolution blender.
102  *
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.
105  *
106  * Obviously, there is no 2x equivalent for this filter.
107  *
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.
111  * @see Deinterlace()
112  */
113 void RenderBlend( filter_t *p_filter,
114                   picture_t *p_outpic, picture_t *p_pic );
115
116 #endif