From patchwork Sat Aug 20 01:24:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 37360 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp100296pzh; Fri, 19 Aug 2022 18:24:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR5LUOn47IRcYNNQSW7CZv/emlCwK/4Ef0nzqVkiywqTi73krflbYHDk5nh6YCSp9ewisPDo X-Received: by 2002:a17:906:7951:b0:73c:37bb:7bcb with SMTP id l17-20020a170906795100b0073c37bb7bcbmr5151621ejo.619.1660958682162; Fri, 19 Aug 2022 18:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660958682; cv=none; d=google.com; s=arc-20160816; b=AQJOohrPjITW+TyjNtImSPpujhLvxYWg98uXQKAJqQxgLPvGgNr4SJT0RvIwfL97Kw 2wnMd06XSGllmtbLOfh89b1+Pzt+ib134zsQ6YfoYaYsI1LdCh50An6jDNyCY4vWBMKg zTPZ4CE/CtfIj10TPaoCT1FdsoJgV4VsnndAiQw04HX5ETkpoA+DRaW4qac0yr+8Z97M 5Q5x9BB8aQIh11ZJgNXWwsL/qs2LHVcOcm/uHljv26UXj8cg8qqy1bUX4O2Uxziy+BjW o7abI8GKdYQqGkZ/MwLxosuw5M2xDLaayQYf/qaMOersOWI4+PvU13RnTFJw633b/bNj 6Xbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=MyZZ7oqs/qLpKgyhZQSbA/w3w6wglNpSns8neNUyB38=; b=pyXnZi4EpKD2eb83gNX1tYVhEXpm8aUpAEhcv0hoLQnk1pRD9HikxRL+S7hAClbY32 2zvWlq1PRM4eg1KKc8I3e20YY2jaurCNHMHNf8nik6+TZtRL9IuMjABKCzh4GHMQOCPI Tt68/40wcLuSv+116RHX6TE6faAwkIsjlOXnnI8Xib3TrE7ulEW03h0HyX/sxf06lzQ9 yBS6Rlv+17MAU+MCXueLoNT4Pc7bs2+XWC6rjUtrXSG3Fyi9Y0rv3Ft3soLqhIA9JodK pmOOCkXD5B7OkiFVVdcBLcpRy5ibuphi1rAriQ9ixgQyhTZutkgaHtcSuefmWYuZwSs3 YHJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=l6RPZBoY; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=overt.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id mp41-20020a1709071b2900b0072efc11c532si4213098ejc.41.2022.08.19.18.24.41; Fri, 19 Aug 2022 18:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=l6RPZBoY; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=overt.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 90DE568B7AE; Sat, 20 Aug 2022 04:24:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7CF5A68B8B6 for ; Sat, 20 Aug 2022 04:24:17 +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 C21B23F89B; Fri, 19 Aug 2022 20:24:15 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1660958656; bh=Yx7wRoC5IvLNh1Nzkp69OkQldyDNjXj9Uu/d4BETJjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l6RPZBoYRicSnbAt+DQNEKNi2iiW0kTMxN9/Qq164MrUpCaiwrRGVYGBF11bAZS25 HnKXO2mmpoK0KXYishQlSvzYQZsmKxh1q4kHJNOjqd9rSDFChXgNyV/ON98VEk13Ak nGremwxllvt7mMpVSlkHdge1pwuZ9JUP0Bv1Dqmf8q7BU4Xms6B8fN5ftNhM4zpKiM XvVZJ0ptd7sYjzvlwr0oEAaUnhAEjdKhK+DG5NnbweQZgl9IEXOxFFrYTxG/Xi50F/ ZOIIRWROvY0DXy9GeURAMwMpU122AT3qHOjBFymGS4a20AdU2Ls4S4OMdzOvGCrxoc H8saJuCyyUhkQ== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Aug 2022 18:24:02 -0700 Message-Id: <20220820012404.932086-2-philipl@overt.org> In-Reply-To: <20220820012404.932086-1-philipl@overt.org> References: <20220820012404.932086-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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Xb2QwBnjnjgP 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 | 12 ++++++++++++ libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c | 1 + tests/ref/fate/imgutils | 1 + tests/ref/fate/sws-pixdesc-query | 3 +++ 5 files changed, 19 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f7558ff8b9..a7aadc18cc 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2504,6 +2504,18 @@ 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 */ + }, + .flags = AV_PIX_FMT_FLAG_ALPHA, + }, [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/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index f79d99e513..045f751831 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 @@ -665,6 +666,7 @@ ALPHA: rgbaf16be rgbaf16le vuya + vuyx ya16be ya16le ya8 @@ -753,6 +755,7 @@ Packed: uyvy422 uyyvyy411 vuya + vuyx x2bgr10be x2bgr10le x2rgb10be