2014-11-15 04:09:28 +02: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 22:23:23 +02:00
|
|
|
#include "libavutil/bswap.h"
|
2014-11-15 04:09:28 +02:00
|
|
|
#include "libavutil/opt.h"
|
2017-09-19 22:23:23 +02:00
|
|
|
#include "libavutil/pixdesc.h"
|
2017-09-18 23:57:17 +02:00
|
|
|
#include "drawutils.h"
|
2014-11-15 04:09:28 +02:00
|
|
|
#include "avfilter.h"
|
|
|
|
|
2017-04-20 23:33:39 +02:00
|
|
|
#define TINTERLACE_FLAG_VLPF 01
|
2018-08-23 23:37:10 +02:00
|
|
|
#define TINTERLACE_FLAG_CVLPF 2
|
|
|
|
#define TINTERLACE_FLAG_EXACT_TB 4
|
2019-12-06 12:01:11 +02:00
|
|
|
#define TINTERLACE_FLAG_BYPASS_IL 8
|
2017-04-20 23:33:39 +02:00
|
|
|
|
2019-12-06 11:35:41 +02:00
|
|
|
enum VLPFilter {
|
|
|
|
VLPF_OFF = 0,
|
|
|
|
VLPF_LIN = 1,
|
|
|
|
VLPF_CMP = 2,
|
|
|
|
};
|
|
|
|
|
2014-11-15 04:09:28 +02: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 15:35:55 +02:00
|
|
|
MODE_MERGEX2,
|
2014-11-15 04:09:28 +02:00
|
|
|
MODE_NB,
|
|
|
|
};
|
|
|
|
|
2018-08-23 23:37:10 +02:00
|
|
|
enum InterlaceScanMode {
|
|
|
|
MODE_TFF = 0,
|
|
|
|
MODE_BFF,
|
|
|
|
};
|
|
|
|
|
2017-05-12 20:00:49 +02:00
|
|
|
typedef struct TInterlaceContext {
|
2014-11-15 04:09:28 +02:00
|
|
|
const AVClass *class;
|
2015-03-23 20:31:17 +02:00
|
|
|
int mode; ///< TInterlaceMode, interlace mode selected
|
2014-12-01 21:52:10 +02:00
|
|
|
AVRational preout_time_base;
|
2014-11-15 04:09:28 +02:00
|
|
|
int flags; ///< flags affecting interlacing algorithm
|
2019-12-06 11:35:41 +02:00
|
|
|
int lowpass; ///< legacy interlace filter lowpass mode
|
2014-11-15 04:09:28 +02:00
|
|
|
int frame; ///< number of the output frame
|
|
|
|
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 23:57:17 +02:00
|
|
|
FFDrawContext draw;
|
|
|
|
FFDrawColor color;
|
2017-09-19 22:23:23 +02:00
|
|
|
const AVPixFmtDescriptor *csp;
|
2014-11-15 04:20:02 +02:00
|
|
|
void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
|
2017-09-19 22:23:23 +02:00
|
|
|
ptrdiff_t mref, ptrdiff_t pref, int clip_max);
|
2014-11-15 04:09:28 +02:00
|
|
|
} TInterlaceContext;
|
|
|
|
|
2014-11-15 04:49:37 +02:00
|
|
|
void ff_tinterlace_init_x86(TInterlaceContext *interlace);
|
|
|
|
|
2014-11-15 04:09:28 +02:00
|
|
|
#endif /* AVFILTER_TINTERLACE_H */
|