summaryrefslogtreecommitdiff
path: root/libavfilter/vf_derain.c
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2019-10-21 20:38:10 +0800
committerPedro Arthur <bygrandao@gmail.com>2019-10-30 11:00:41 -0300
commite1b45b85963b5aa9d67e23638ef9b045e7fbd875 (patch)
tree8f42ca165f693649ea2ec8f6f9a8e62c1a505027 /libavfilter/vf_derain.c
parentdff39ea9f0154ec52b7548b122a4a5332df3c2c6 (diff)
avfilter/dnn: get the data type of network output from dnn execution result
so, we can make a filter more general to accept different network models, by adding a data type convertion after getting data from network. After we add dt field into struct DNNData, it becomes the same as DNNInputData, so merge them with one struct: DNNData. Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
Diffstat (limited to 'libavfilter/vf_derain.c')
-rw-r--r--libavfilter/vf_derain.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_derain.c b/libavfilter/vf_derain.c
index b7bba09464..89f9d5a2ed 100644
--- a/libavfilter/vf_derain.c
+++ b/libavfilter/vf_derain.c
@@ -39,7 +39,7 @@ typedef struct DRContext {
DNNBackendType backend_type;
DNNModule *dnn_module;
DNNModel *model;
- DNNInputData input;
+ DNNData input;
DNNData output;
} DRContext;
@@ -137,7 +137,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int t = i * out->width * 3 + j;
int t_in = (i + pad_size) * in->width * 3 + j + pad_size * 3;
- out->data[0][k] = CLIP((int)((((float *)dr_context->input.data)[t_in] - dr_context->output.data[t]) * 255), 0, 255);
+ out->data[0][k] = CLIP((int)((((float *)dr_context->input.data)[t_in] - ((float *)dr_context->output.data)[t]) * 255), 0, 255);
}
}