libavfilter/dnn: add layout option to openvino backend

Dnn models have different input layout (NCHW or NHWC), so a
"layout" option is added
Use openvino's API to do layout conversion for input data. Use swscale
to do layout conversion for output data as openvino doesn't have
similiar C API for output.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
This commit is contained in:
Wenbin Chen
2023-09-21 09:26:31 +08:00
committed by Guo Yejun
parent 58d9b5caf3
commit 74ce1d2d11
3 changed files with 185 additions and 20 deletions

View File

@@ -56,12 +56,19 @@ typedef enum {
DFT_ANALYTICS_CLASSIFY, // classify for each bounding box
}DNNFunctionType;
typedef enum {
DL_NONE,
DL_NCHW,
DL_NHWC,
} DNNLayout;
typedef struct DNNData{
void *data;
int width, height, channels;
// dt and order together decide the color format
DNNDataType dt;
DNNColorOrder order;
DNNLayout layout;
} DNNData;
typedef struct DNNExecBaseParams {