summaryrefslogtreecommitdiff
path: root/libavfilter/vf_dnn_processing.c
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2020-08-07 14:32:55 +0800
committerGuo, Yejun <yejun.guo@intel.com>2020-08-12 15:43:40 +0800
commit0a51abe8ab71c03eff66200265142fc910bcbfe2 (patch)
tree2f3e24f02a5f54f6ebd95950774f5adf7587229f /libavfilter/vf_dnn_processing.c
parent4ed6bca4ae578e050d60aa96dbbdefd60f6d67c4 (diff)
dnn: add backend options when load the model
different backend might need different options for a better performance, so, add the parameter into dnn interface, as a preparation. Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Diffstat (limited to 'libavfilter/vf_dnn_processing.c')
-rw-r--r--libavfilter/vf_dnn_processing.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
index 4b31808abf..b6dfc4e697 100644
--- a/libavfilter/vf_dnn_processing.c
+++ b/libavfilter/vf_dnn_processing.c
@@ -41,6 +41,7 @@ typedef struct DnnProcessingContext {
DNNBackendType backend_type;
char *model_inputname;
char *model_outputname;
+ char *backend_options;
DNNModule *dnn_module;
DNNModel *model;
@@ -69,6 +70,7 @@ static const AVOption dnn_processing_options[] = {
{ "model", "path to model file", OFFSET(model_filename), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },
{ "input", "input name of the model", OFFSET(model_inputname), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },
{ "output", "output name of the model", OFFSET(model_outputname), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },
+ { "options", "backend options", OFFSET(backend_options), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },
{ NULL }
};
@@ -101,7 +103,7 @@ static av_cold int init(AVFilterContext *context)
return AVERROR(EINVAL);
}
- ctx->model = (ctx->dnn_module->load_model)(ctx->model_filename);
+ ctx->model = (ctx->dnn_module->load_model)(ctx->model_filename, ctx->backend_options);
if (!ctx->model) {
av_log(ctx, AV_LOG_ERROR, "could not load DNN model\n");
return AVERROR(EINVAL);