[FFmpeg-cvslog] avfilter/vf_interlace: fix numerical options
Thomas Mundt
git at videolan.org
Fri Sep 7 19:50:08 EEST 2018
ffmpeg | branch: master | Thomas Mundt <tmundt75 at gmail.com> | Thu Aug 23 23:37:10 2018 +0200| [f4438e387e039cd078879096453c54d5ce2c94d1] | committer: Paul B Mahol
avfilter/vf_interlace: fix numerical options
Regression since 9c01cdb94e24aaf50f867a0a5c42b097c17c42b1
Signed-off-by: Thomas Mundt <tmundt75 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f4438e387e039cd078879096453c54d5ce2c94d1
---
libavfilter/tinterlace.h | 9 +++++++--
libavfilter/vf_tinterlace.c | 19 +++++++++++++++----
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
index b5c39aac52..5bcb9a583a 100644
--- a/libavfilter/tinterlace.h
+++ b/libavfilter/tinterlace.h
@@ -34,8 +34,8 @@
#include "avfilter.h"
#define TINTERLACE_FLAG_VLPF 01
-#define TINTERLACE_FLAG_EXACT_TB 2
-#define TINTERLACE_FLAG_CVLPF 4
+#define TINTERLACE_FLAG_CVLPF 2
+#define TINTERLACE_FLAG_EXACT_TB 4
enum TInterlaceMode {
MODE_MERGE = 0,
@@ -49,6 +49,11 @@ enum TInterlaceMode {
MODE_NB,
};
+enum InterlaceScanMode {
+ MODE_TFF = 0,
+ MODE_BFF,
+};
+
typedef struct TInterlaceContext {
const AVClass *class;
int mode; ///< TInterlaceMode, interlace mode selected
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 4f5c10d7ac..22746ebfb1 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -60,10 +60,10 @@ static const AVOption tinterlace_options[] = {
AVFILTER_DEFINE_CLASS(tinterlace);
static const AVOption interlace_options[] = {
- { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"},
- { "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
- { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
- { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0,INT_MAX, 0, "flags" },
+ { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_TFF}, 0, 1, FLAGS, "mode"},
+ { "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_TFF}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
+ { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_BFF}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
+ { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0, 2, 0, "flags" },
{ "off", "disable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" },
{ "linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" },
{ "complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
@@ -511,6 +511,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
return ret;
}
+static int init_interlace(AVFilterContext *ctx)
+{
+ TInterlaceContext *tinterlace = ctx->priv;
+
+ if (tinterlace->mode <= MODE_BFF)
+ tinterlace->mode += MODE_INTERLEAVE_TOP;
+
+ return 0;
+}
+
static const AVFilterPad tinterlace_inputs[] = {
{
.name = "default",
@@ -545,6 +555,7 @@ AVFilter ff_vf_interlace = {
.name = "interlace",
.description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."),
.priv_size = sizeof(TInterlaceContext),
+ .init = init_interlace,
.uninit = uninit,
.query_formats = query_formats,
.inputs = tinterlace_inputs,
More information about the ffmpeg-cvslog
mailing list