From patchwork Tue Sep 6 19:58:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 37732 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp3476686pzh; Tue, 6 Sep 2022 12:59:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6aLRHJwVn3kIOtl4V6k8aMHtZcCC2MuRzKGadrHPh8gRXTXYJKqas5bTnv27r21Il71847 X-Received: by 2002:a17:907:629b:b0:74f:94f3:786 with SMTP id nd27-20020a170907629b00b0074f94f30786mr82827ejc.606.1662494346324; Tue, 06 Sep 2022 12:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662494346; cv=none; d=google.com; s=arc-20160816; b=KGbRD59ZgRL6e/wp+8PdjAHMt0VGV5EX0FNqd3VEPPeZyoig6njrJV+Fa56Gh+Dv2R qYiBChyzJnJtmcRJ5aUHwRq5myr/49L5yuSOT4Tns2GhK21dz8eiC/m1t2XKcqeRHKaW AKtpHYp4eMPZccVL/l1Yopa6FrGBjOsxADtIG2cjpXiTWk7OTKF89FmE3TBw6g1eherM wsNzDivJbSW89tNCzrWKg5jbnAK3Aay6oOECzqz+swhcGrrM+gaELASei1L692/T1YLF B1PE8+MU/rAaSDf6JrfMriwF5074uUDFWNrk+3cis7mLm1IEFUheHAcFGx8u9J1j+WX8 a/hQ== 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=Yw5yE9IRCKlcj1s1qK864c+ElwsbUF2yPIYhhl+y95c=; b=nLMLnaN34GV0eeUtySRVO974ulhD1qgbDf85mi0kJ8eAaJPlFMbpCHCn4HRfDbeOJK Ph7C0rSHEDzCXGmS6XaddZfzAjSjpCCSprhgxCjDzG91OzhJnD6lVWR8wHUq3okUsSBQ ATwAA2+vDD+RKeSPVyBQuIMrSkPQnCDWpHKK+riHEbuFFf9ODTG9o6lQ5N5tfhFYF7P1 0pTlB96EdtTIYR3e0KuFSJeV7FED5uMxpxq+wGlSUw8aduZbsM4jm/fyFvAEiwF9aCyy pRL+XKTBKsiLZZViS9MPI06Ef0oD9ryarMx393+F8pICGkWbdBnsEcp2gCgU88W/lZgG uO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=A0lATjhG; 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 dz11-20020a0564021d4b00b004483613511esi10472170edb.618.2022.09.06.12.59.06; Tue, 06 Sep 2022 12:59:06 -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=A0lATjhG; 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 4C8A468BB3F; Tue, 6 Sep 2022 22:58:41 +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 A817368BB39 for ; Tue, 6 Sep 2022 22:58:33 +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 6037C3F41A; Tue, 6 Sep 2022 14:58:32 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1662494312; bh=b6FXNd5OydxOd3m3nFpL+p6TvsJs+Yld3LPSP46vHMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A0lATjhGxyO6wS7BqOwx0vrfsy0D9ffu56KLj6YI+Cgn7bQ8mpY177wfsy5hB9dNz kJxx5Zpq/HK3Fs/moLTBKcGsQGkHPte8AR8Mj1OqGTy5ZVAxUhi4rMPDBunH4hF9yW P21SJfvIoSl/gTD1U5Eo7uiJcCLMyo9huN8qNGg0Zxmo10DENFs3WiChiKE15L9Ap5 cfDKOFkcHBaTv5kGa4kLQVeO6vIumusqlELjG4UIABUULLsUekSm50RT9WFVCN5oNt ZlUfZnWTAyEYDV+vSwLCV1A9mtJQccPuy2+mVMFHJkld0BG8rt2R9eqp1OCNdgzyVD o04bbo3DB8a1Q== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Sep 2022 12:58:21 -0700 Message-Id: <20220906195822.83664-4-philipl@overt.org> In-Reply-To: <20220906195822.83664-1-philipl@overt.org> References: <20220906195822.83664-1-philipl@overt.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] swscale/output: add support for XV30LE 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: 6FBXBhfnUsi9 Signed-off-by: Philip Langdale --- libswscale/output.c | 31 ++++++++++++++++++++++++ libswscale/utils.c | 2 +- tests/ref/fate/filter-pixdesc-xv30le | 1 + tests/ref/fate/filter-pixfmts-copy | 1 + tests/ref/fate/filter-pixfmts-crop | 1 + tests/ref/fate/filter-pixfmts-field | 1 + tests/ref/fate/filter-pixfmts-fieldorder | 1 + tests/ref/fate/filter-pixfmts-hflip | 1 + tests/ref/fate/filter-pixfmts-il | 1 + tests/ref/fate/filter-pixfmts-null | 1 + tests/ref/fate/filter-pixfmts-scale | 1 + tests/ref/fate/filter-pixfmts-transpose | 1 + tests/ref/fate/filter-pixfmts-vflip | 1 + 13 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/ref/fate/filter-pixdesc-xv30le diff --git a/libswscale/output.c b/libswscale/output.c index ba7ecb52d7..d8aa5f39db 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -2600,6 +2600,34 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter, } } +static void +yuv2xv30le_X_c(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, int y) +{ + int i; + for (i = 0; i < dstW; i++) { + int Y = 1 << 16, U = 1 << 16, V = 1 << 16; + int j; + + for (j = 0; j < lumFilterSize; j++) + Y += lumSrc[j][i] * lumFilter[j]; + + for (j = 0; j < chrFilterSize; j++) { + U += chrUSrc[j][i] * chrFilter[j]; + V += chrVSrc[j][i] * chrFilter[j]; + } + + Y = av_clip_uintp2(Y >> 17, 10); + U = av_clip_uintp2(U >> 17, 10); + V = av_clip_uintp2(V >> 17, 10); + + AV_WL32(dest + 4 * i, U | Y << 10 | V << 20); + } +} + static void yuv2xv36le_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, @@ -3218,6 +3246,9 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, case AV_PIX_FMT_VUYX: *yuv2packedX = yuv2vuyx_X_c; break; + case AV_PIX_FMT_XV30LE: + *yuv2packedX = yuv2xv30le_X_c; + break; case AV_PIX_FMT_XV36LE: *yuv2packedX = yuv2xv36le_X_c; break; diff --git a/libswscale/utils.c b/libswscale/utils.c index 9166e80002..ec67020cc9 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -265,7 +265,7 @@ static const FormatEntry format_entries[] = { [AV_PIX_FMT_VUYX] = { 1, 1 }, [AV_PIX_FMT_RGBAF16BE] = { 1, 0 }, [AV_PIX_FMT_RGBAF16LE] = { 1, 0 }, - [AV_PIX_FMT_XV30LE] = { 1, 0 }, + [AV_PIX_FMT_XV30LE] = { 1, 1 }, [AV_PIX_FMT_XV36LE] = { 1, 1 }, }; diff --git a/tests/ref/fate/filter-pixdesc-xv30le b/tests/ref/fate/filter-pixdesc-xv30le new file mode 100644 index 0000000000..9b5ad5417e --- /dev/null +++ b/tests/ref/fate/filter-pixdesc-xv30le @@ -0,0 +1 @@ +pixdesc-xv30le fb76a14d6d5cf3a0b48f30b2fb59becd diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy index c88594f3aa..67383c43f8 100644 --- a/tests/ref/fate/filter-pixfmts-copy +++ b/tests/ref/fate/filter-pixfmts-copy @@ -95,6 +95,7 @@ vuya 3d5e934651cae1ce334001cb1829ad22 vuyx 3f68ea6ec492b30d867cb5401562264e x2bgr10le 550c0d190cf695afa4eaacb644db6b75 x2rgb10le c1e3ac21be04a16bb157b22784524520 +xv30le c14b5a953bf3be56346f66ca174a5b1b xv36le 3f8ced42a081639a39ec5929dd77b017 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop index bdad0d02cd..bdb2536f7d 100644 --- a/tests/ref/fate/filter-pixfmts-crop +++ b/tests/ref/fate/filter-pixfmts-crop @@ -92,6 +92,7 @@ vuya 76578a705ff3a37559653c1289bd03dd vuyx 5d2bae51a2f4892bd5f177f190cc323b x2bgr10le 84de725b85662c362862820dc4a309aa x2rgb10le f4265aca7a67dbfa9354370098ca6f33 +xv30le a9edb820819b900a4a897fee4562a4fb xv36le 90a187adf00a1b15c33d064ae2582804 xyz12be cb4571f9aaa7b59f999ef327276104b7 xyz12le cd6aae8d26b18bdb4b9d068586276d91 diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field index 04c51dba45..853e1b064c 100644 --- a/tests/ref/fate/filter-pixfmts-field +++ b/tests/ref/fate/filter-pixfmts-field @@ -95,6 +95,7 @@ vuya f72bcf29d75cd143d0c565f7cc49119a vuyx 6257cd1ce11330660e9fa9c675acbdcc x2bgr10le dbe21538d7cb1744914f6bd46ec09b55 x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677 +xv30le e940366c78efc9e292e9de28cf04dba9 xv36le aa5a867879a70e1040dfafe3e03167d5 xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437 xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5 diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder index 27d72b72aa..3e190c2d43 100644 --- a/tests/ref/fate/filter-pixfmts-fieldorder +++ b/tests/ref/fate/filter-pixfmts-fieldorder @@ -84,6 +84,7 @@ vuya a3891d4168ff208948fd0b3ba0910495 vuyx d7a900e970c9a69ed41f8b220114b9fa x2bgr10le 86474d84f26c5c51d6f75bf7e1de8da8 x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676 +xv30le 25aac48128d94010a3660839500caee5 xv36le 1bde4bee8b938d7bf20e75bc848e4765 xyz12be 15f5cda71de5fef9cec5e75e3833b6bc xyz12le 7be6c8781f38c21a6b8f602f62ca31e6 diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip index b949628061..fd5e9723fd 100644 --- a/tests/ref/fate/filter-pixfmts-hflip +++ b/tests/ref/fate/filter-pixfmts-hflip @@ -92,6 +92,7 @@ vuya 7e530261e7ac4eae4fd616fd7572d0b8 vuyx 3ce9890363cad3984521293be1eb679c x2bgr10le 827cc659f29378e00c5a7d2c0ada8f9a x2rgb10le d4a8189b65395a88d0a38a7053f3359f +xv30le 072aa2b61ce1e764f9d1957e8abee9a9 xv36le cc569285784e38a489f4a286598f05da xyz12be 25f90259ff8a226befdaec3dfe82996e xyz12le 926c0791d59aaff61b2778e8ada3316d diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il index 064f75b125..d82f08d637 100644 --- a/tests/ref/fate/filter-pixfmts-il +++ b/tests/ref/fate/filter-pixfmts-il @@ -94,6 +94,7 @@ vuya b9deab5ba249dd608b709c09255a4932 vuyx 49cc92fcc002ec0f312017014dd68c0c x2bgr10le 135acaff8318cf9861bb0f7849a9e5e9 x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94 +xv30le 7f6414a3fc700380025c29812e8376a9 xv36le 066378fad80e34bc3edd22f657be6ff8 xyz12be 7c7d54c55f136cbbc50b18029f3be0b3 xyz12le 090ba6b1170baf2b1358b43b971d33b0 diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null index c88594f3aa..67383c43f8 100644 --- a/tests/ref/fate/filter-pixfmts-null +++ b/tests/ref/fate/filter-pixfmts-null @@ -95,6 +95,7 @@ vuya 3d5e934651cae1ce334001cb1829ad22 vuyx 3f68ea6ec492b30d867cb5401562264e x2bgr10le 550c0d190cf695afa4eaacb644db6b75 x2rgb10le c1e3ac21be04a16bb157b22784524520 +xv30le c14b5a953bf3be56346f66ca174a5b1b xv36le 3f8ced42a081639a39ec5929dd77b017 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale index 3381a118d6..10b94ac516 100644 --- a/tests/ref/fate/filter-pixfmts-scale +++ b/tests/ref/fate/filter-pixfmts-scale @@ -95,6 +95,7 @@ vuya ffa817e283bf6a0b6fba21b07523ccaa vuyx ba182200e20e0c82765eba15217848d3 x2bgr10le d57b9a99033cc7b65ddd111578f2d385 x2rgb10le d56bdb23fa6a8e12a0b4394987f89935 +xv30le afe68d8a47e8460e0164970b1da0c5be xv36le eaf5fbd9d5ea04aeefb40f3d7c2ea289 xyz12be c7ba8345998c0141ddc079cdd29b1a40 xyz12le 95f5d3a0de834cc495c9032a14987cde diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose index e270096a60..24f4249639 100644 --- a/tests/ref/fate/filter-pixfmts-transpose +++ b/tests/ref/fate/filter-pixfmts-transpose @@ -86,6 +86,7 @@ vuya 9ece18a345beb17cd19e09e443eca4bf vuyx 4c2929cd1c6e5512f62e802f482f0ef2 x2bgr10le 4aa774b6d8f6d446a64f1f288e5c97eb x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845 +xv30le b1ac5a12f46d32c70acb63f89838ab76 xv36le f15a1d1af2a2967ec6a5efebc87e1ef1 xyz12be 68e5cba640f6e4ef72dff950e88b5342 xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9 diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip index 73a7ba0ee8..4fff17e7ab 100644 --- a/tests/ref/fate/filter-pixfmts-vflip +++ b/tests/ref/fate/filter-pixfmts-vflip @@ -95,6 +95,7 @@ vuya fb849f76e56181e005c31fce75d7038c vuyx 7a8079a97610e2c1c97aa8832b58a102 x2bgr10le 795b66a5fc83cd2cf300aae51c230f80 x2rgb10le 262c502230cf3724f8e2cf4737f18a42 +xv30le 7e29ee107a1fabf3c7251f337d4b9fe5 xv36le aad3c6b5799b4e46a9c9ac27ee7db9bd xyz12be 810644e008deb231850d779aaa27cc7e xyz12le 829701db461b43533cf9241e0743bc61