2014-11-15 02:09:28 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2011 Stefano Sabatini
|
|
|
|
* Copyright (c) 2010 Baptiste Coudurier
|
|
|
|
* Copyright (c) 2003 Michael Zucchi <notzed@ximian.com>
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* temporal field interlace filter, ported from MPlayer/libmpcodecs
|
|
|
|
*/
|
|
|
|
#ifndef AVFILTER_TINTERLACE_H
|
|
|
|
#define AVFILTER_TINTERLACE_H
|
|
|
|
|
2017-09-19 20:23:23 +00:00
|
|
|
#include "libavutil/bswap.h"
|
2014-11-15 02:09:28 +00:00
|
|
|
#include "libavutil/opt.h"
|
2017-09-19 20:23:23 +00:00
|
|
|
#include "libavutil/pixdesc.h"
|
2017-09-18 21:57:17 +00:00
|
|
|
#include "drawutils.h"
|
2014-11-15 02:09:28 +00:00
|
|
|
#include "avfilter.h"
|
|
|
|
|
2017-04-20 21:33:39 +00:00
|
|
|
#define TINTERLACE_FLAG_VLPF 01
|
2018-08-23 21:37:10 +00:00
|
|
|
#define TINTERLACE_FLAG_CVLPF 2
|
|
|
|
#define TINTERLACE_FLAG_EXACT_TB 4
|
2019-12-06 10:01:11 +00:00
|
|
|
#define TINTERLACE_FLAG_BYPASS_IL 8
|
2017-04-20 21:33:39 +00:00
|
|
|
|
2019-12-06 09:35:41 +00:00
|
|
|
enum VLPFilter {
|
|
|
|
VLPF_OFF = 0,
|
|
|
|
VLPF_LIN = 1,
|
|
|
|
VLPF_CMP = 2,
|
|
|
|
};
|
|
|
|
|
2014-11-15 02:09:28 +00:00
|
|
|
enum TInterlaceMode {
|
|
|
|
MODE_MERGE = 0,
|
|
|
|
MODE_DROP_EVEN,
|
|
|
|
MODE_DROP_ODD,
|
|
|
|
MODE_PAD,
|
|
|
|
MODE_INTERLEAVE_TOP,
|
|
|
|
MODE_INTERLEAVE_BOTTOM,
|
|
|
|
MODE_INTERLACEX2,
|
2015-09-30 13:35:55 +00:00
|
|
|
MODE_MERGEX2,
|
2014-11-15 02:09:28 +00:00
|
|
|
MODE_NB,
|
|
|
|
};
|
|
|
|
|
2018-08-23 21:37:10 +00:00
|
|
|
enum InterlaceScanMode {
|
|
|
|
MODE_TFF = 0,
|
|
|
|
MODE_BFF,
|
|
|
|
};
|
|
|
|
|
2017-05-12 18:00:49 +00:00
|
|
|
typedef struct TInterlaceContext {
|
2014-11-15 02:09:28 +00:00
|
|
|
const AVClass *class;
|
2015-03-23 18:31:17 +00:00
|
|
|
int mode; ///< TInterlaceMode, interlace mode selected
|
2014-12-01 19:52:10 +00:00
|
|
|
AVRational preout_time_base;
|
2014-11-15 02:09:28 +00:00
|
|
|
int flags; ///< flags affecting interlacing algorithm
|
2019-12-06 09:35:41 +00:00
|
|
|
int lowpass; ///< legacy interlace filter lowpass mode
|
2014-11-15 02:09:28 +00:00
|
|
|
int vsub; ///< chroma vertical subsampling
|
|
|
|
AVFrame *cur;
|
|
|
|
AVFrame *next;
|
|
|
|
uint8_t *black_data[4]; ///< buffer used to fill padded lines
|
|
|
|
int black_linesize[4];
|
2017-09-18 21:57:17 +00:00
|
|
|
FFDrawContext draw;
|
|
|
|
FFDrawColor color;
|
2017-09-19 20:23:23 +00:00
|
|
|
const AVPixFmtDescriptor *csp;
|
2014-11-15 02:20:02 +00:00
|
|
|
void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
|
2017-09-19 20:23:23 +00:00
|
|
|
ptrdiff_t mref, ptrdiff_t pref, int clip_max);
|
2014-11-15 02:09:28 +00:00
|
|
|
} TInterlaceContext;
|
|
|
|
|
2014-11-15 02:49:37 +00:00
|
|
|
void ff_tinterlace_init_x86(TInterlaceContext *interlace);
|
|
|
|
|
2014-11-15 02:09:28 +00:00
|
|
|
#endif /* AVFILTER_TINTERLACE_H */
|