From patchwork Wed Feb 10 04:58:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25533 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 4D28344BDDC for ; Wed, 10 Feb 2021 07:08:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 337CE68A3DF; Wed, 10 Feb 2021 07:08:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02F0A68A30C for ; Wed, 10 Feb 2021 07:08:29 +0200 (EET) IronPort-SDR: m26tWQe4sIFto1LieoMAAHRCwg09VN/kDm6sDX0bcXfyy+jdAKekxrwqyD93SgMq/LiYwLCSm2 XzmmYtBsSUpA== X-IronPort-AV: E=McAfee;i="6000,8403,9890"; a="178504177" X-IronPort-AV: E=Sophos;i="5.81,167,1610438400"; d="scan'208";a="178504177" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 21:08:27 -0800 IronPort-SDR: 3bPoNNNrF7jwIl6SxmzpQ+GwSLzMvZGut84Q/N3AlZhORiGqDEO3fsbQjB/hys88tKlp5NczaE bpXLSzHjrglA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,167,1610438400"; d="scan'208";a="587228188" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by fmsmga005.fm.intel.com with ESMTP; 09 Feb 2021 21:08:26 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 Feb 2021 12:58:26 +0800 Message-Id: <20210210045826.14820-1-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 05/10] dnn_interface.h: add enum DNNColorOrder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: yejun.guo@intel.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" the data type and order together decide the color format, we could not use AVPixelFormat directly because not all the possible formats are covered by it. Signed-off-by: Guo, Yejun --- libavfilter/dnn_interface.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h index 2fb9b15676..d3a0c58a61 100644 --- a/libavfilter/dnn_interface.h +++ b/libavfilter/dnn_interface.h @@ -36,6 +36,11 @@ typedef enum {DNN_NATIVE, DNN_TF, DNN_OV} DNNBackendType; typedef enum {DNN_FLOAT = 1, DNN_UINT8 = 4} DNNDataType; +typedef enum { + DCO_NONE, + DCO_BGR, +} DNNColorOrder; + typedef enum { DAST_FAIL, // something wrong DAST_EMPTY_QUEUE, // no more inference result to get @@ -52,8 +57,10 @@ typedef enum { typedef struct DNNData{ void *data; - DNNDataType dt; int width, height, channels; + // dt and order together decide the color format + DNNDataType dt; + DNNColorOrder order; } DNNData; typedef struct DNNModel{