]> git.sesse.net Git - ffmpeg/blob - libavfilter/interlace.h
Merge commit '122de16dd8108a59a55d30543c9f28b5f61b02d1'
[ffmpeg] / libavfilter / interlace.h
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18
19 /**
20  * @file
21  * progressive to interlaced content filter, inspired by heavy debugging of
22  * tinterlace filter.
23  */
24
25 #ifndef AVFILTER_INTERLACE_H
26 #define AVFILTER_INTERLACE_H
27
28 #include "libavutil/common.h"
29 #include "libavutil/imgutils.h"
30 #include "libavutil/opt.h"
31
32 #include "avfilter.h"
33 #include "formats.h"
34 #include "internal.h"
35 #include "video.h"
36
37 enum ScanMode {
38     MODE_TFF = 0,
39     MODE_BFF = 1,
40 };
41
42 enum FieldType {
43     FIELD_UPPER = 0,
44     FIELD_LOWER = 1,
45 };
46
47 enum VLPFilter {
48     VLPF_OFF = 0,
49     VLPF_LIN = 1,
50     VLPF_CMP = 2,
51 };
52
53 typedef struct InterlaceContext {
54     const AVClass *class;
55     enum ScanMode scan;    // top or bottom field first scanning
56     int lowpass;           // enable or disable low pass filtering
57     AVFrame *cur, *next;   // the two frames from which the new one is obtained
58     void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp,
59                          ptrdiff_t mref, ptrdiff_t pref);
60 } InterlaceContext;
61
62 void ff_interlace_init_x86(InterlaceContext *interlace);
63
64 #endif /* AVFILTER_INTERLACE_H */