Commit f4438e38 authored by Thomas Mundt's avatar Thomas Mundt Committed by Paul B Mahol

avfilter/vf_interlace: fix numerical options

Regression since 9c01cdb9Signed-off-by: 's avatarThomas Mundt <tmundt75@gmail.com>
parent cc24665f
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "avfilter.h" #include "avfilter.h"
#define TINTERLACE_FLAG_VLPF 01 #define TINTERLACE_FLAG_VLPF 01
#define TINTERLACE_FLAG_EXACT_TB 2 #define TINTERLACE_FLAG_CVLPF 2
#define TINTERLACE_FLAG_CVLPF 4 #define TINTERLACE_FLAG_EXACT_TB 4
enum TInterlaceMode { enum TInterlaceMode {
MODE_MERGE = 0, MODE_MERGE = 0,
...@@ -49,6 +49,11 @@ enum TInterlaceMode { ...@@ -49,6 +49,11 @@ enum TInterlaceMode {
MODE_NB, MODE_NB,
}; };
enum InterlaceScanMode {
MODE_TFF = 0,
MODE_BFF,
};
typedef struct TInterlaceContext { typedef struct TInterlaceContext {
const AVClass *class; const AVClass *class;
int mode; ///< TInterlaceMode, interlace mode selected int mode; ///< TInterlaceMode, interlace mode selected
......
...@@ -60,10 +60,10 @@ static const AVOption tinterlace_options[] = { ...@@ -60,10 +60,10 @@ static const AVOption tinterlace_options[] = {
AVFILTER_DEFINE_CLASS(tinterlace); AVFILTER_DEFINE_CLASS(tinterlace);
static const AVOption interlace_options[] = { static const AVOption interlace_options[] = {
{ "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"}, { "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_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "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_INTERLEAVE_BOTTOM}, 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,INT_MAX, 0, "flags" }, { "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" }, { "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" }, { "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" }, { "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) ...@@ -511,6 +511,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
return ret; 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[] = { static const AVFilterPad tinterlace_inputs[] = {
{ {
.name = "default", .name = "default",
...@@ -545,6 +555,7 @@ AVFilter ff_vf_interlace = { ...@@ -545,6 +555,7 @@ AVFilter ff_vf_interlace = {
.name = "interlace", .name = "interlace",
.description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."),
.priv_size = sizeof(TInterlaceContext), .priv_size = sizeof(TInterlaceContext),
.init = init_interlace,
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = tinterlace_inputs, .inputs = tinterlace_inputs,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment