From patchwork Wed Aug 28 06:22:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 14733 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 858994487C8 for ; Wed, 28 Aug 2019 09:23:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5985B68ADD7; Wed, 28 Aug 2019 09:23:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 256D168AC42 for ; Wed, 28 Aug 2019 09:23:38 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 23:23:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,440,1559545200"; d="scan'208";a="180459896" Received: from icl-dev.sh.intel.com ([10.239.158.73]) by fmsmga008.fm.intel.com with ESMTP; 27 Aug 2019 23:23:34 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Aug 2019 14:22:14 +0800 Message-Id: <1566973334-19107-1-git-send-email-linjie.fu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH 1/2] lavu/pixfmt: add AYUV pixel format 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: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Add support for packed 4:4:4 pixel format AYUV. It is the format that VAAPI/QSV uses when coping with 4:4:4 surfaces. Alpha channel will be set to default value for HEVC REXT hw decode. Signed-off-by: Linjie Fu --- libavutil/pixdesc.c | 13 +++++++++++++ libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c | 1 + libavutil/version.h | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index b97b066..d217000 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -205,6 +205,19 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { { 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */ }, }, + [AV_PIX_FMT_AYUV] = { + .name = "ayuv", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 1, 0, 8, 3, 7, 2 }, /* Y */ + { 0, 4, 2, 0, 8, 3, 7, 3 }, /* U */ + { 0, 4, 3, 0, 8, 3, 7, 4 }, /* V */ + { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_ALPHA, + }, [AV_PIX_FMT_RGB24] = { .name = "rgb24", .nb_components = 3, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 8b54c94..adbaec8 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -348,6 +348,8 @@ enum AVPixelFormat { AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped + AV_PIX_FMT_AYUV, ///< packed YUV 4:4:4, 32bpp, A Y Cb Cr, + AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; diff --git a/libavutil/tests/pixfmt_best.c b/libavutil/tests/pixfmt_best.c index 53f7264..2939e48 100644 --- a/libavutil/tests/pixfmt_best.c +++ b/libavutil/tests/pixfmt_best.c @@ -91,6 +91,7 @@ int main(void) TEST(AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P); TEST(AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P); TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P); + TEST(AV_PIX_FMT_AYUV, AV_PIX_FMT_YUV444P); TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16); TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24); diff --git a/libavutil/version.h b/libavutil/version.h index ecc6a7c..658a508 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 33 +#define LIBAVUTIL_VERSION_MINOR 34 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \