From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 609A342458 for ; Sat, 20 Aug 2022 04:32:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 69FED68B965; Sat, 20 Aug 2022 07:32:04 +0300 (EEST) Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C6FAF68B54C for ; Sat, 20 Aug 2022 07:31:56 +0300 (EEST) Received: from authenticated-user (mail.overt.org [157.230.92.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 629923F22B; Fri, 19 Aug 2022 23:31:55 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1660969915; bh=0p/xIchCzLf02a5+Ma/Mq012C21/TVBfWZYnZCAqI6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fds3FtqkRY9ENQYkEOt+7l4Ca41PrabrKd3qgPSjzRwSTxnlELvpASmsnmEANFcCW Pz4ID9XLMW6JUbM/0H858BH1d+Ub5prdKoD3FdXSaVrbNy6L2NsFlJ5VrsfY8Lr9F7 koOGEWJe7SFdF2oLJYIZ3ADPlXywovp12cP46X4l7JzK6U1ZRQ12/A2lOfzwGf9Tor yRudFW7+uwxwu+w+uuVkKZszMmhBeijfcwvmpRKjtkOcrD8kvpj8XwuschwqtOi64c D/9ETn6mcDKTAGTEBljzdqokQgQZsViYWSn9kMrHrb8X+1JC27idauAUeudRCof8CS QPFl3jaLyVK/w== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Aug 2022 21:31:44 -0700 Message-Id: <20220820043146.398996-2-philipl@overt.org> In-Reply-To: <20220820043146.398996-1-philipl@overt.org> References: <20220820043146.398996-1-philipl@overt.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Introduce VUYX format X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Philip Langdale Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This is the alphaless version of VUYA that I introduced recently. After further discussion and noting that the Intel vaapi driver explicitly lists XYUV as a support format for encoding and decoding 8bit 444 content, we decided to switch our usage and avoid the overhead of having a declared alpha channel around. Note that I am not removing VUYA, as this turned out to have another use, which was to replace the need for v408enc/dec when dealing with the format. The vaapi switching will happen in the next change Signed-off-by: Philip Langdale --- libavutil/pixdesc.c | 11 +++++++++++ libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c | 1 + tests/ref/fate/imgutils | 1 + tests/ref/fate/pixfmt_best | 2 +- tests/ref/fate/sws-pixdesc-query | 3 +++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f7558ff8b9..79ebfd3f16 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2504,6 +2504,17 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_ALPHA, }, + [AV_PIX_FMT_VUYX] = { + .name = "vuyx", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 2, 0, 8 }, /* Y */ + { 0, 4, 1, 0, 8 }, /* U */ + { 0, 4, 0, 0, 8 }, /* V */ + }, + }, [AV_PIX_FMT_RGBAF16BE] = { .name = "rgbaf16be", .nb_components = 4, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 86c9bdefeb..7d45561395 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -372,6 +372,8 @@ enum AVPixelFormat { AV_PIX_FMT_RGBAF16BE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian AV_PIX_FMT_RGBAF16LE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian + AV_PIX_FMT_VUYX, ///< packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined + 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 de53baf092..0542af494f 100644 --- a/libavutil/tests/pixfmt_best.c +++ b/libavutil/tests/pixfmt_best.c @@ -84,6 +84,7 @@ int main(void) TEST(AV_PIX_FMT_GBRP, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_0RGB, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_GBRP16, AV_PIX_FMT_RGB48); + TEST(AV_PIX_FMT_VUYX, AV_PIX_FMT_YUV444P); // Formats additionally containing alpha (here ignored). TEST(AV_PIX_FMT_YA8, AV_PIX_FMT_GRAY8); diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils index 01c9877de5..47b73b1b64 100644 --- a/tests/ref/fate/imgutils +++ b/tests/ref/fate/imgutils @@ -249,3 +249,4 @@ p416le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 vuya planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 rgbaf16be planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 rgbaf16le planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 +vuyx planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 diff --git a/tests/ref/fate/pixfmt_best b/tests/ref/fate/pixfmt_best index 1da1846275..783c5fe640 100644 --- a/tests/ref/fate/pixfmt_best +++ b/tests/ref/fate/pixfmt_best @@ -1 +1 @@ -74 tests passed, 0 tests failed. +75 tests passed, 0 tests failed. diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index f79d99e513..f54372d364 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -219,6 +219,7 @@ isYUV: uyvy422 uyyvyy411 vuya + vuyx xyz12be xyz12le y210be @@ -753,6 +754,7 @@ Packed: uyvy422 uyyvyy411 vuya + vuyx x2bgr10be x2bgr10le x2rgb10be @@ -984,5 +986,6 @@ SwappedChroma: nv21 nv42 vuya + vuyx yvyu422 -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".