History

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

Xuewei Meng committed 7 years ago

Commit f0c97d61 parent 43458852 files · +16 −0Browse files

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/vf_derain.c+4−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 typedef struct DRContext {
3535 const AVClass *class;
3636
37+ int filter_type;
3738 char *model_filename;
3839 DNNBackendType backend_type;
3940 DNNModule *dnn_module;
@@ -46,6 +47,9 @@ typedef struct DRContext { · 6 unmodified lines
4647 #define OFFSET(x) offsetof(DRContext, x)
4748 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
4849 static const AVOption derain_options[] = {
50+ { "filter_type", "filter type(derain/dehaze)", OFFSET(filter_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "type" },
51+ { "derain", "derain filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "type" },
52+ { "dehaze", "dehaze filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "type" },
4953 { "dnn_backend", "DNN backend", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
5054 { "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
5155 #if (CONFIG_LIBTENSORFLOW == 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t