]> git.sesse.net Git - ffmpeg/blob - libavfilter/tinterlace.h
Merge commit '8f144d9e3d5cb2ca92e5bdf7cc9f72effa1bd2ce'
[ffmpeg] / libavfilter / tinterlace.h
1 /*
2  * Copyright (c) 2011 Stefano Sabatini
3  * Copyright (c) 2010 Baptiste Coudurier
4  * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 /**
24  * @file
25  * temporal field interlace filter, ported from MPlayer/libmpcodecs
26  */
27 #ifndef AVFILTER_TINTERLACE_H
28 #define AVFILTER_TINTERLACE_H
29
30 #include "libavutil/bswap.h"
31 #include "libavutil/opt.h"
32 #include "libavutil/pixdesc.h"
33 #include "drawutils.h"
34 #include "avfilter.h"
35
36 #define TINTERLACE_FLAG_VLPF 01
37 #define TINTERLACE_FLAG_EXACT_TB 2
38 #define TINTERLACE_FLAG_CVLPF 4
39
40 enum TInterlaceMode {
41     MODE_MERGE = 0,
42     MODE_DROP_EVEN,
43     MODE_DROP_ODD,
44     MODE_PAD,
45     MODE_INTERLEAVE_TOP,
46     MODE_INTERLEAVE_BOTTOM,
47     MODE_INTERLACEX2,
48     MODE_MERGEX2,
49     MODE_NB,
50 };
51
52 typedef struct TInterlaceContext {
53     const AVClass *class;
54     int mode;                   ///< TInterlaceMode, interlace mode selected
55     AVRational preout_time_base;
56     int flags;                  ///< flags affecting interlacing algorithm
57     int frame;                  ///< number of the output frame
58     int vsub;                   ///< chroma vertical subsampling
59     AVFrame *cur;
60     AVFrame *next;
61     uint8_t *black_data[4];     ///< buffer used to fill padded lines
62     int black_linesize[4];
63     FFDrawContext draw;
64     FFDrawColor color;
65     const AVPixFmtDescriptor *csp;
66     void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
67                          ptrdiff_t mref, ptrdiff_t pref, int clip_max);
68 } TInterlaceContext;
69
70 void ff_tinterlace_init_x86(TInterlaceContext *interlace);
71
72 #endif /* AVFILTER_TINTERLACE_H */