diff options
author | Guo, Yejun <yejun.guo@intel.com> | 2021-03-01 19:23:20 +0800 |
---|---|---|
committer | Guo, Yejun <yejun.guo@intel.com> | 2021-04-08 09:23:02 +0800 |
commit | 59021d79a24e28434f57376276625bc44eff340c (patch) | |
tree | b67d8f2e1b0b7697bd6e3e39a931652917084c2f /libavfilter/dnn_interface.h | |
parent | d2ccbc966b151f2500aa43e789288af188258ba3 (diff) | |
download | ffmpeg-59021d79a24e28434f57376276625bc44eff340c.tar.gz |
lavfi/dnn: refine code for frame pre/proc processing
Diffstat (limited to 'libavfilter/dnn_interface.h')
-rw-r--r-- | libavfilter/dnn_interface.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h index d3a0c58a61..3c7846f1a5 100644 --- a/libavfilter/dnn_interface.h +++ b/libavfilter/dnn_interface.h @@ -63,6 +63,8 @@ typedef struct DNNData{ DNNColorOrder order; } DNNData; +typedef int (*FramePrePostProc)(AVFrame *frame, DNNData *model, AVFilterContext *filter_ctx); + typedef struct DNNModel{ // Stores model that can be different for different backends. void *model; @@ -80,10 +82,10 @@ typedef struct DNNModel{ const char *output_name, int *output_width, int *output_height); // set the pre process to transfer data from AVFrame to DNNData // the default implementation within DNN is used if it is not provided by the filter - int (*pre_proc)(AVFrame *frame_in, DNNData *model_input, AVFilterContext *filter_ctx); + FramePrePostProc frame_pre_proc; // set the post process to transfer data from DNNData to AVFrame // the default implementation within DNN is used if it is not provided by the filter - int (*post_proc)(AVFrame *frame_out, DNNData *model_output, AVFilterContext *filter_ctx); + FramePrePostProc frame_post_proc; } DNNModel; // Stores pointers to functions for loading, executing, freeing DNN models for one of the backends. |