Message ID | PH7PR11MB58878E868D9EE9845AC141C5DAE69@PH7PR11MB5887.namprd11.prod.outlook.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v2] libavfilter/dnn: fix openvino async mode | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
> -----Original Message----- > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of > Saliev, Rafik F > Sent: Friday, December 16, 2022 6:35 PM > To: ffmpeg-devel@ffmpeg.org > Subject: [FFmpeg-devel] [PATCH v2] libavfilter/dnn: fix openvino async mode > > Bugfix: The OpenVino DNN backend in the 'async' mode sets 'task- > >inference_done' to 'complete' prior to data copy from OpenVino output > buffer to task's output frame. > This order causes task destroy in ff_dnn_get_result_common() prior to model > output processing. > > Signed-off-by: Rafik Saliev <rafik.f.saliev@intel.com> > --- > libavfilter/dnn/dnn_backend_openvino.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/dnn/dnn_backend_openvino.c > b/libavfilter/dnn/dnn_backend_openvino.c > index b494f26f55..b67f288336 100644 > --- a/libavfilter/dnn/dnn_backend_openvino.c > +++ b/libavfilter/dnn/dnn_backend_openvino.c > @@ -244,7 +244,6 @@ static void infer_completion_callback(void *args) > av_assert0(request->lltask_count >= 1); > for (int i = 0; i < request->lltask_count; ++i) { > task = request->lltasks[i]->task; > - task->inference_done++; > > switch (ov_model->model->func_type) { > case DFT_PROCESS_FRAME: > @@ -278,6 +277,7 @@ static void infer_completion_callback(void *args) > break; > } > > + task->inference_done++; > av_freep(&request->lltasks[i]); > output.data = (uint8_t *)output.data > + output.width * output.height * output.channels * > get_datatype_size(output.dt); > -- LGTM, will push soon, thanks.
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c index b494f26f55..b67f288336 100644 --- a/libavfilter/dnn/dnn_backend_openvino.c +++ b/libavfilter/dnn/dnn_backend_openvino.c @@ -244,7 +244,6 @@ static void infer_completion_callback(void *args) av_assert0(request->lltask_count >= 1); for (int i = 0; i < request->lltask_count; ++i) { task = request->lltasks[i]->task; - task->inference_done++; switch (ov_model->model->func_type) { case DFT_PROCESS_FRAME: @@ -278,6 +277,7 @@ static void infer_completion_callback(void *args) break; } + task->inference_done++; av_freep(&request->lltasks[i]); output.data = (uint8_t *)output.data + output.width * output.height * output.channels * get_datatype_size(output.dt);
Bugfix: The OpenVino DNN backend in the 'async' mode sets 'task->inference_done' to 'complete' prior to data copy from OpenVino output buffer to task's output frame. This order causes task destroy in ff_dnn_get_result_common() prior to model output processing. Signed-off-by: Rafik Saliev <rafik.f.saliev@intel.com> --- libavfilter/dnn/dnn_backend_openvino.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)