From patchwork Tue Sep 6 19:58:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 37731 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp3476654pzh; Tue, 6 Sep 2022 12:58:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4KJFF4uLVNfYqSiGJHGz/gZOPTIuefZNNKNRgvK3rtYMQzaMJbu4d1n9QGPUams6AB6+Uz X-Received: by 2002:a05:6402:5193:b0:43e:1d52:fd70 with SMTP id q19-20020a056402519300b0043e1d52fd70mr224617edd.150.1662494338351; Tue, 06 Sep 2022 12:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662494338; cv=none; d=google.com; s=arc-20160816; b=lU9Ugvhv9d0aoGYJkX2eH6AmoxBRbfLwislUGBi6HX8Rntof4UX3ofahIAqWqnlae6 dejKSkTNUxnvg2/A+EL4irobM1vULDiUbFE2ZeVSUB0AiXGdYWGKiZpHxQVFwWNDJBUZ R/1hAwTWOCnCgG/AYq8DxgUSUxdZGv6DyQsD9lsXNRx8UtzyeZTfoDrSZEqbSpSu/jwh NOgkGyiUcQ++LaEs5wOttlslhV8LtHvZ9RFZ1oXGOKUwqzfw/vqG9K6Rc8bGJyx+GAtg AMdWGCLqdI/4vma3sOGTWBm2AY83ckImfOQ11myxHE4pflsQO3ygnK3QgUqoYbH7iyWt DYKw== 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=dDZBCshlxH6pU6rlWyrrJmN95mb/z7JHxEINTeZSvRw=; b=AnF8BUy8kF47/b8VHwatv9phu4S6XhUbTLwTd6M3qFysxbOwLs+BRCPlVynbtzaWrj WcwhM+LP/Jpx630J/UE/tPBayzhNnGatbERcrW/LRWpXhcUsWaYdTFVaCvfHhTqnOHa3 I5DrffeUROtz6ErmNtnOeoBZOk2/hcfkZ1ghm34lpBbGDc3sXOTjYkNQ7n/ENWdEj8X1 EqwQQg5ZLnBF4w5vNroGC7z3V8j4cI/2CXtnyWFdQnnVxveapc6vuCy88JTO80czhtd/ JM2QVaqoKc76yYt1WJUXZAi2L3P3u9R37Af4XgweZfH/YzuFvKwWxfTbvlKksM2V07Xo W6+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=uA0wDGVq; 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 hc32-20020a17090716a000b007417559b3f0si10591509ejc.40.2022.09.06.12.58.58; Tue, 06 Sep 2022 12:58:58 -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=uA0wDGVq; 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 9011D68BB55; Tue, 6 Sep 2022 22:58:40 +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 2C7BE68B1D1 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 D2CC03F418; Tue, 6 Sep 2022 14:58:31 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1662494312; bh=A3tEpCh6+b60YW5tLwIwyaPhJPkWRC99YajKgAG1GvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uA0wDGVq9z5rPYvPAH8gGRKdxiNmnklAGlBto2smh+Ju8f3DlhTxwAwH8h8C9L5cG wTDthd9/aRwqYm0HT84ODB8KvOXYQ+85aYZ7edB57qnlbkMjDNfK2X6irvUNaR9GZL yxHq30DREZSanCXXHAvSLqkOh0TFlWM42U29nCQkhmFdBTCvuCxg7Uarssmepib+Z6 tCA7bm4sdxT4SO07bZLP3Rm+XHgkh1aeQWqiu3+j+lkXmaWWtWSlw5SYiidwSElsww 6JwW3slwXgHzhzTTzJPWpsrkp0ZWPRlCj2hvwa+ifZreIw2LFU1M5gxfcj8QXCfwlI yv0ASBF85udPw== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Sep 2022 12:58:20 -0700 Message-Id: <20220906195822.83664-3-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 2/4] swscale/output: add support for XV36LE 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: SoMz/GUP8eei Signed-off-by: Philip Langdale --- libswscale/output.c | 29 ++++++++++++++++++++++++ libswscale/utils.c | 2 +- tests/ref/fate/filter-pixdesc-xv36le | 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, 41 insertions(+), 1 deletion(-) create mode 100644 tests/ref/fate/filter-pixdesc-xv36le diff --git a/libswscale/output.c b/libswscale/output.c index 5cbc7ab748..ba7ecb52d7 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -2600,6 +2600,32 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter, } } +static void +yuv2xv36le_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 << 14, U = 1 << 14, V = 1 << 14; + 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]; + } + + AV_WL16(dest + 8 * i + 2, av_clip_uintp2(Y >> 15, 12) << 4); + AV_WL16(dest + 8 * i + 0, av_clip_uintp2(U >> 15, 12) << 4); + AV_WL16(dest + 8 * i + 4, av_clip_uintp2(V >> 15, 12) << 4); + } +} + static void yuv2vuyX_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, @@ -3192,5 +3218,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, case AV_PIX_FMT_VUYX: *yuv2packedX = yuv2vuyx_X_c; break; + case AV_PIX_FMT_XV36LE: + *yuv2packedX = yuv2xv36le_X_c; + break; } } diff --git a/libswscale/utils.c b/libswscale/utils.c index 599c326754..9166e80002 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -266,7 +266,7 @@ static const FormatEntry format_entries[] = { [AV_PIX_FMT_RGBAF16BE] = { 1, 0 }, [AV_PIX_FMT_RGBAF16LE] = { 1, 0 }, [AV_PIX_FMT_XV30LE] = { 1, 0 }, - [AV_PIX_FMT_XV36LE] = { 1, 0 }, + [AV_PIX_FMT_XV36LE] = { 1, 1 }, }; int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, diff --git a/tests/ref/fate/filter-pixdesc-xv36le b/tests/ref/fate/filter-pixdesc-xv36le new file mode 100644 index 0000000000..8ba8099423 --- /dev/null +++ b/tests/ref/fate/filter-pixdesc-xv36le @@ -0,0 +1 @@ +pixdesc-xv36le 9d00bb58092f8b6d5d6fd71a8aec719a diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy index d92dd169dc..c88594f3aa 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 +xv36le 3f8ced42a081639a39ec5929dd77b017 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c ya16be 37c07787e544f900c87b853253bfc8dd diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop index f7103a5906..bdad0d02cd 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 +xv36le 90a187adf00a1b15c33d064ae2582804 xyz12be cb4571f9aaa7b59f999ef327276104b7 xyz12le cd6aae8d26b18bdb4b9d068586276d91 ya16be a3d18014454942a96f15a49947c0c55d diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field index 910728e512..04c51dba45 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 +xv36le aa5a867879a70e1040dfafe3e03167d5 xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437 xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5 ya16be 40403b5277364777e0671da4d38e01ac diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder index 258c8563f0..27d72b72aa 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 +xv36le 1bde4bee8b938d7bf20e75bc848e4765 xyz12be 15f5cda71de5fef9cec5e75e3833b6bc xyz12le 7be6c8781f38c21a6b8f602f62ca31e6 ya16be 0f13e0f52586d172aaa07710fa3e8f31 diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip index 1e37027ec2..b949628061 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 +xv36le cc569285784e38a489f4a286598f05da xyz12be 25f90259ff8a226befdaec3dfe82996e xyz12le 926c0791d59aaff61b2778e8ada3316d ya16be d5b342355bdd9e3197e01b13b7c6301e diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il index 9efbf5d8e1..064f75b125 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 +xv36le 066378fad80e34bc3edd22f657be6ff8 xyz12be 7c7d54c55f136cbbc50b18029f3be0b3 xyz12le 090ba6b1170baf2b1358b43b971d33b0 ya16be 7bc720918bc0132e9717acbde89874e0 diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null index d92dd169dc..c88594f3aa 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 +xv36le 3f8ced42a081639a39ec5929dd77b017 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c ya16be 37c07787e544f900c87b853253bfc8dd diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale index 017eeee84f..3381a118d6 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 +xv36le eaf5fbd9d5ea04aeefb40f3d7c2ea289 xyz12be c7ba8345998c0141ddc079cdd29b1a40 xyz12le 95f5d3a0de834cc495c9032a14987cde ya16be 20d4842899d61068f5fb6af478bf26a6 diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose index f1b16ca528..e270096a60 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 +xv36le f15a1d1af2a2967ec6a5efebc87e1ef1 xyz12be 68e5cba640f6e4ef72dff950e88b5342 xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9 ya16be 3e161cb5f225922a80fefdc9cc02a4f9 diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip index 814008cefd..73a7ba0ee8 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 +xv36le aad3c6b5799b4e46a9c9ac27ee7db9bd xyz12be 810644e008deb231850d779aaa27cc7e xyz12le 829701db461b43533cf9241e0743bc61 ya16be 55b1dbbe4d56ed0d22461685ce85520d