summaryrefslogtreecommitdiff
path: root/libavfilter/dnn
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2021-03-01 19:23:20 +0800
committerGuo, Yejun <yejun.guo@intel.com>2021-04-08 09:23:02 +0800
commit59021d79a24e28434f57376276625bc44eff340c (patch)
treeb67d8f2e1b0b7697bd6e3e39a931652917084c2f /libavfilter/dnn
parentd2ccbc966b151f2500aa43e789288af188258ba3 (diff)
lavfi/dnn: refine code for frame pre/proc processing
Diffstat (limited to 'libavfilter/dnn')
-rw-r--r--libavfilter/dnn/dnn_backend_native.c8
-rw-r--r--libavfilter/dnn/dnn_backend_openvino.c8
-rw-r--r--libavfilter/dnn/dnn_backend_tf.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/libavfilter/dnn/dnn_backend_native.c b/libavfilter/dnn/dnn_backend_native.c
index d8ae36c52d..d9762eeaf6 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -310,8 +310,8 @@ static DNNReturnType execute_model_native(const DNNModel *model, const char *inp
input.data = oprd->data;
input.dt = oprd->data_type;
if (do_ioproc) {
- if (native_model->model->pre_proc != NULL) {
- native_model->model->pre_proc(in_frame, &input, native_model->model->filter_ctx);
+ if (native_model->model->frame_pre_proc != NULL) {
+ native_model->model->frame_pre_proc(in_frame, &input, native_model->model->filter_ctx);
} else {
ff_proc_from_frame_to_dnn(in_frame, &input, native_model->model->func_type, ctx);
}
@@ -358,8 +358,8 @@ static DNNReturnType execute_model_native(const DNNModel *model, const char *inp
output.dt = oprd->data_type;
if (do_ioproc) {
- if (native_model->model->post_proc != NULL) {
- native_model->model->post_proc(out_frame, &output, native_model->model->filter_ctx);
+ if (native_model->model->frame_post_proc != NULL) {
+ native_model->model->frame_post_proc(out_frame, &output, native_model->model->filter_ctx);
} else {
ff_proc_from_dnn_to_frame(out_frame, &output, ctx);
}
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 66845fbd51..3bea2d526a 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -166,8 +166,8 @@ static DNNReturnType fill_model_input_ov(OVModel *ov_model, RequestItem *request
for (int i = 0; i < request->task_count; ++i) {
task = request->tasks[i];
if (task->do_ioproc) {
- if (ov_model->model->pre_proc != NULL) {
- ov_model->model->pre_proc(task->in_frame, &input, ov_model->model->filter_ctx);
+ if (ov_model->model->frame_pre_proc != NULL) {
+ ov_model->model->frame_pre_proc(task->in_frame, &input, ov_model->model->filter_ctx);
} else {
ff_proc_from_frame_to_dnn(task->in_frame, &input, ov_model->model->func_type, ctx);
}
@@ -237,8 +237,8 @@ static void infer_completion_callback(void *args)
for (int i = 0; i < request->task_count; ++i) {
task = request->tasks[i];
if (task->do_ioproc) {
- if (task->ov_model->model->post_proc != NULL) {
- task->ov_model->model->post_proc(task->out_frame, &output, task->ov_model->model->filter_ctx);
+ if (task->ov_model->model->frame_post_proc != NULL) {
+ task->ov_model->model->frame_post_proc(task->out_frame, &output, task->ov_model->model->filter_ctx);
} else {
ff_proc_from_dnn_to_frame(task->out_frame, &output, ctx);
}
diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index c0aa510630..fb799d2b70 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -756,8 +756,8 @@ static DNNReturnType execute_model_tf(const DNNModel *model, const char *input_n
input.data = (float *)TF_TensorData(input_tensor);
if (do_ioproc) {
- if (tf_model->model->pre_proc != NULL) {
- tf_model->model->pre_proc(in_frame, &input, tf_model->model->filter_ctx);
+ if (tf_model->model->frame_pre_proc != NULL) {
+ tf_model->model->frame_pre_proc(in_frame, &input, tf_model->model->filter_ctx);
} else {
ff_proc_from_frame_to_dnn(in_frame, &input, tf_model->model->func_type, ctx);
}
@@ -818,8 +818,8 @@ static DNNReturnType execute_model_tf(const DNNModel *model, const char *input_n
output.dt = TF_TensorType(output_tensors[i]);
if (do_ioproc) {
- if (tf_model->model->post_proc != NULL) {
- tf_model->model->post_proc(out_frame, &output, tf_model->model->filter_ctx);
+ if (tf_model->model->frame_post_proc != NULL) {
+ tf_model->model->frame_post_proc(out_frame, &output, tf_model->model->filter_ctx);
} else {
ff_proc_from_dnn_to_frame(out_frame, &output, ctx);
}