From patchwork Mon Nov 22 20:53:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ridley Combs X-Patchwork-Id: 31534 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp7582608iob; Mon, 22 Nov 2021 12:54:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxL/FhalWD/sCUSfny23109j62tBOYuJBB4RrcKzQmVv0H8DErjjpMFoWe2HrxenjQdFY2e X-Received: by 2002:a17:907:d08:: with SMTP id gn8mr46815ejc.395.1637614449402; Mon, 22 Nov 2021 12:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637614449; cv=none; d=google.com; s=arc-20160816; b=Y3b9wbtS4UQZTc0UgZaJlbdd84fGt4NIy+yMc0Kgh4daXAkjjPQWdelwd+7ww+h5Q6 gBwHZ4fvUNTGspg+CCNc2KVBDWPY//6qnWJcJzWNj+qKyJ8qRT56coitUUQgEgjl4Qtv b4A/pW8HjtGEhs4RKuWdlvNljHdxALF7cl/Qd2fMmHxmTN+AElVDAv2QO6T8O3SCcWOR 6oSVwVOGoIfmeA/jGfMXNslDoCNcD0qyavN9vHa34HAOHgHVIq3Xj4lQWuKjxIlT11vm hjdoHG9TLw+Ty3z/xbbpJfas8jEsztUbNTQs8DR+JaTKaLxmWstxuiumAmBHe5kASEhb x3HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=nNtzfJRkEdkFY38sQcadh3h8TvGRr5ZF3vpoIp8G8+E=; b=gXV8ouwJsKmC5uShiU0W7iQ33VucDvY++6cPS/a4W/NZPVSvK4q5M9oo7wXe8PTEa5 JwAe0Ve4t2lnJo2K9bpWu9zwWQkn7cb6uqccrBNhGMTglGnDYCLhTESAPdEYvN72k3gd h1dFjGp4NJtUm7hrATc8gHHEd6+P22VU6IVfDV83cnwKWIa1E4/XsmClY5UhOmkDNC9G Ka97qARta4gtCXg+fMdqAHImTLuH2picoiuIjzw/jVUOWMzrezUSBT4/CK2sXZxB3k6g FNYX6yZHP0bt2zXzfpb4aUO/dttd2eYdij9idJFJrNW6Nrf24NOBHUG+fBQGR4ZxkQ+g V6tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rcombs.me header.s=google header.b=bysjxkYJ; 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=rcombs.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f21si36525530edf.172.2021.11.22.12.54.09; Mon, 22 Nov 2021 12:54:09 -0800 (PST) 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=@rcombs.me header.s=google header.b=bysjxkYJ; 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=rcombs.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAB35689FB5; Mon, 22 Nov 2021 22:53:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ECDE46808E6 for ; Mon, 22 Nov 2021 22:53:36 +0200 (EET) Received: by mail-io1-f46.google.com with SMTP id v23so25124265iom.12 for ; Mon, 22 Nov 2021 12:53:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rcombs.me; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3NHh9bfvCdA+YyzzG5seJP/EBMQbqQh6uUJfMfy3mh0=; b=bysjxkYJhc7am9M2CIjIw9nzjky4TIURHssnRF5Hd/T4+HX86/7Mhd1uOKJC82CsUX naxMG3NF+OlKPwgHrLS+ZZAt9UN7b0o1tJbnIUrvm63s4ajfEBd2fiWpYdI35/KAUt+S 4bpUYEX94tky27wN3CuIbHu7y3Y6oKnSv4qIkHnfS1mbpIrhpXZtJgnBnwFQfIvT1kyE 1pLYVeLtb5hBFnERdfOJClY5py4a7YpX6vmQANFE8xi8FDME2eUcj1plGihgqbVsy5+z 1TyX+sLN0Vk51yK2Pr1buhaykLbf8bNNRGyaCuYIUFi4brcWblI4uUJEYQ7NSrAUx/M8 WHQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3NHh9bfvCdA+YyzzG5seJP/EBMQbqQh6uUJfMfy3mh0=; b=kvZjPxPOUKWNvXJecRgr5wOWLNEzFDUvYr6ofDduSUVeI13rFFaTLDnOmRiJbvp+mi knJBen901U2dJGLgUa+ddUimmk/csPupMqPB/e9F7z3nPXI2gys8jbaLfaOn4TO24XYX XLFeEJJeynPqpiI9vx+osPPbDuJjmssExv5KjIEyOH1OkaYMzkTtTPF+PFKbaeqbt2MR S9Q/04sscJ92V1p4CMPhVZqRC3K7aX8vixljiBqLMV3o4CduY6xuwmGeMeeS9FYz9ssO lCRlua0+58bw2KoNKxbMnco9A61N0gKv1xtX6wuiTFKISE4aJkHIkqmGT8v0Ikh8FUIi KZyA== X-Gm-Message-State: AOAM5310a83+TvYvhL6X9A+jvbI2Gs/gz/8EV56dc9VOsq895Aky7Pwj yweykB4W9kQz+yO4VVOe/YwbZSFF6rXWICo= X-Received: by 2002:a5d:848a:: with SMTP id t10mr8371792iom.207.1637614415054; Mon, 22 Nov 2021 12:53:35 -0800 (PST) Received: from rcombs-mbp.localdomain ([2601:243:2000:5ac:edf5:499:2479:42a8]) by smtp.gmail.com with ESMTPSA id b3sm3571580ile.26.2021.11.22.12.53.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Nov 2021 12:53:34 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Nov 2021 14:53:17 -0600 Message-Id: <20211122205330.43546-3-rcombs@rcombs.me> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211122205330.43546-1-rcombs@rcombs.me> References: <20211122205330.43546-1-rcombs@rcombs.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/16] swscale: add P210/P410/P216/P416 input 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: aCMUWC1D3hU9 --- libswscale/input.c | 16 ++++++++++++ libswscale/utils.c | 8 ++++++ libswscale/version.h | 2 +- tests/ref/fate/sws-pixdesc-query | 44 ++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/libswscale/input.c b/libswscale/input.c index 1351ea5bd4..6acc39f89f 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -1238,15 +1238,23 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) c->chrToYV12 = read_ayuv64le_UV_c; break; case AV_PIX_FMT_P010LE: + case AV_PIX_FMT_P210LE: + case AV_PIX_FMT_P410LE: c->chrToYV12 = p010LEToUV_c; break; case AV_PIX_FMT_P010BE: + case AV_PIX_FMT_P210BE: + case AV_PIX_FMT_P410BE: c->chrToYV12 = p010BEToUV_c; break; case AV_PIX_FMT_P016LE: + case AV_PIX_FMT_P216LE: + case AV_PIX_FMT_P416LE: c->chrToYV12 = p016LEToUV_c; break; case AV_PIX_FMT_P016BE: + case AV_PIX_FMT_P216BE: + case AV_PIX_FMT_P416BE: c->chrToYV12 = p016BEToUV_c; break; case AV_PIX_FMT_Y210LE: @@ -1519,6 +1527,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GRAY16LE: case AV_PIX_FMT_P016LE: + case AV_PIX_FMT_P216LE: + case AV_PIX_FMT_P416LE: c->lumToYV12 = bswap16Y_c; break; case AV_PIX_FMT_YUVA420P9LE: @@ -1561,6 +1571,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GRAY16BE: case AV_PIX_FMT_P016BE: + case AV_PIX_FMT_P216BE: + case AV_PIX_FMT_P416BE: c->lumToYV12 = bswap16Y_c; break; case AV_PIX_FMT_YUVA420P9BE: @@ -1687,9 +1699,13 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) c->lumToYV12 = bgr64LEToY_c; break; case AV_PIX_FMT_P010LE: + case AV_PIX_FMT_P210LE: + case AV_PIX_FMT_P410LE: c->lumToYV12 = p010LEToY_c; break; case AV_PIX_FMT_P010BE: + case AV_PIX_FMT_P210BE: + case AV_PIX_FMT_P410BE: c->lumToYV12 = p010BEToY_c; break; case AV_PIX_FMT_GRAYF32LE: diff --git a/libswscale/utils.c b/libswscale/utils.c index c726922527..ae92ac9fbc 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -268,6 +268,14 @@ static const FormatEntry format_entries[] = { [AV_PIX_FMT_Y210LE] = { 1, 0 }, [AV_PIX_FMT_X2RGB10LE] = { 1, 1 }, [AV_PIX_FMT_X2BGR10LE] = { 1, 1 }, + [AV_PIX_FMT_P210BE] = { 1, 0 }, + [AV_PIX_FMT_P210LE] = { 1, 0 }, + [AV_PIX_FMT_P410BE] = { 1, 0 }, + [AV_PIX_FMT_P410LE] = { 1, 0 }, + [AV_PIX_FMT_P216BE] = { 1, 0 }, + [AV_PIX_FMT_P216LE] = { 1, 0 }, + [AV_PIX_FMT_P416BE] = { 1, 0 }, + [AV_PIX_FMT_P416LE] = { 1, 0 }, }; int sws_isSupportedInput(enum AVPixelFormat pix_fmt) diff --git a/libswscale/version.h b/libswscale/version.h index 0d3b7cf363..15ad54319c 100644 --- a/libswscale/version.h +++ b/libswscale/version.h @@ -28,7 +28,7 @@ #define LIBSWSCALE_VERSION_MAJOR 6 #define LIBSWSCALE_VERSION_MINOR 1 -#define LIBSWSCALE_VERSION_MICRO 100 +#define LIBSWSCALE_VERSION_MICRO 101 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ LIBSWSCALE_VERSION_MINOR, \ diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index a74109c3d7..553c039061 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -13,6 +13,10 @@ is16BPS: gray16le p016be p016le + p216be + p216le + p416be + p416le rgb48be rgb48le rgba64be @@ -57,6 +61,10 @@ isNBPS: nv20le p010be p010le + p210be + p210le + p410be + p410le x2bgr10be x2bgr10le x2rgb10be @@ -140,6 +148,10 @@ isBE: nv20be p010be p016be + p210be + p216be + p410be + p416be rgb444be rgb48be rgb555be @@ -193,6 +205,14 @@ isYUV: p010le p016be p016le + p210be + p210le + p216be + p216le + p410be + p410le + p416be + p416le uyvy422 uyyvyy411 xyz12be @@ -287,6 +307,14 @@ isPlanarYUV: p010le p016be p016le + p210be + p210le + p216be + p216le + p410be + p410le + p416be + p416le yuv410p yuv411p yuv420p @@ -370,6 +398,14 @@ isSemiPlanarYUV: p010le p016be p016le + p210be + p210le + p216be + p216le + p410be + p410le + p416be + p416le isRGB: 0bgr @@ -751,6 +787,14 @@ Planar: p010le p016be p016le + p210be + p210le + p216be + p216le + p410be + p410le + p416be + p416le yuv410p yuv411p yuv420p