summaryrefslogtreecommitdiff
path: root/libavfilter/vf_derain.c
diff options
context:
space:
mode:
authorXuewei Meng <xwmeng96@gmail.com>2019-08-22 18:28:44 +0800
committerSteven Liu <lq@chinaffmpeg.org>2019-08-26 10:59:01 +0800
commitf0c97d613ea764db8e78b9cc40ff1c821b140c79 (patch)
tree5f4675e0b3e60b43a2bbaf213c908eab7e4011e1 /libavfilter/vf_derain.c
parent434588596fef6bd2cef17f8c9c2979a010153edd (diff)
libavfilter: Add dehaze-filter option in existing derain.
Add the support of dehaze filter in existing derain filter source code. As the processing procedure in FFmpeg is the same for current derain and dehaze, we reuse the derain filter source code. The model training and generation scripts are in repo https://github.com/XueweiMeng/derain_filter.git Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Diffstat (limited to 'libavfilter/vf_derain.c')
-rw-r--r--libavfilter/vf_derain.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/vf_derain.c b/libavfilter/vf_derain.c
index c380b40122..ddf3632e46 100644
--- a/libavfilter/vf_derain.c
+++ b/libavfilter/vf_derain.c
@@ -34,6 +34,7 @@
typedef struct DRContext {
const AVClass *class;
+ int filter_type;
char *model_filename;
DNNBackendType backend_type;
DNNModule *dnn_module;
@@ -46,6 +47,9 @@ typedef struct DRContext {
#define OFFSET(x) offsetof(DRContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static const AVOption derain_options[] = {
+ { "filter_type", "filter type(derain/dehaze)", OFFSET(filter_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "type" },
+ { "derain", "derain filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "type" },
+ { "dehaze", "dehaze filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "type" },
{ "dnn_backend", "DNN backend", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
{ "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
#if (CONFIG_LIBTENSORFLOW == 1)