From patchwork Sun Aug 20 15:10:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cox X-Patchwork-Id: 34981 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:47ca:b0:130:ccc6:6c4b with SMTP id ey10csp936264pzb; Sun, 20 Aug 2023 08:10:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4ZB3U89UlBZqTS2QpwTDJjtHV8ZxA6+HXtdfbqbI8vo2aDgEBs2SE+e9OfWb2F4OcxaUd X-Received: by 2002:a2e:7c0e:0:b0:2bc:39f5:ecb4 with SMTP id x14-20020a2e7c0e000000b002bc39f5ecb4mr2414980ljc.25.1692544245134; Sun, 20 Aug 2023 08:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692544245; cv=none; d=google.com; s=arc-20160816; b=PB2nCyN6CUyjewbI+FuqlITPA/eEIPWKf/AS5JtCB5O+0Rw7SFcr3GvTEMZoGo7rbj Fu9vZb1OKq5ZRFt+4k/cl9QGiMra4miUoEpXEY0r3s/5ZvZUEXeq4GsCVAKp1TareTP8 Eqg6SrD2WuftzM25uQWeTda55md4nXoLNFDjVCElBPEfA2asScv7oauua92HyPnyXrf/ wSFaAEbejUVdybterNjsyoi/wjZZxvMrWeZ0sQYnvDJ10wVEaZ9AtM9K5Hc1GcLfrTny El/E4sM+MTlr75IwHn5R3wrjYsEPNOIhrtIIWDgYuhITz5zLoMs1mueCspjw1Af8HO17 ZPjQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=Uy5B3K+cppopWsCmjCzkWFi9WmhfGo+GnYC09bYBc2M=; fh=9QDi6dFFPFAV43XzYhuUbqo2pwrpR9p92hw/7eQiArk=; b=Z6xcEMU5uMI62fWlMhgmwICaZCRGQu7pkV6WPWSzdNr68SOOp4TXBM+oGmkQCwDmO1 rrFWoNN1JP6fopTZnlzpKcxqkaaWaxhzplbeC334yk8yKFM3U5/6t5AUIncmiT6InZJp 34FxYr0uMV7+U2cuR61XgsGm+YytsW0sFmBMsosaE3mCn1N3Y8yjankIs9FYRFz8gAZd LLqta9IYjh5Up9A/bUv+wQVKoRucDRJJRPuUi6IQ5nieKec/jAO59/uqb1+4Xodwwm+7 PKqhPNP6HKQoejkFfL4JKJoZvXnuxRahtY/ItvddVhft8tlTGNUUsn/5vOhkQbzLx3XR GXfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kynesim-co-uk.20221208.gappssmtp.com header.s=20221208 header.b=PPzXHdyD; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c13-20020a170906340d00b009a1977de475si145452ejb.995.2023.08.20.08.10.44; Sun, 20 Aug 2023 08:10:45 -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=@kynesim-co-uk.20221208.gappssmtp.com header.s=20221208 header.b=PPzXHdyD; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EA0368BBC9; Sun, 20 Aug 2023 18:10:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CBD2E68B4D7 for ; Sun, 20 Aug 2023 18:10:33 +0300 (EEST) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-31ad9155414so2230996f8f.3 for ; Sun, 20 Aug 2023 08:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kynesim-co-uk.20221208.gappssmtp.com; s=20221208; t=1692544233; x=1693149033; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dcIbeiwvYiRLL5LNftOFHhwXr/BhFFcaNziiweWv0sU=; b=PPzXHdyDpxkPHdo02mSfJHqFWAmbvu/nNgbD2XkKYRKOYVdcjmEQimjHbimdrlmXjH nl6VyOMZY0Y5h0RugNUk8a7ttUduXD9TVY9JI/mtKvkih5T63wiv4N24PMeAikpXGrQW Mm3Ddz7e4I1h8c9sw7Eq1LN7LF1Y8cazjuKGbALg2VIxRAqlhv4+vajj4virxX4CpgZ0 TWFKDkg5K5AKmxwLr3APNJkU+whmNTL3SOjivKjIpJbw7z0RVDItt+HpthZyBr1GcyGh t3HD/WCXx/E+6QdmxplCgd6MYVfNDeJ2pIfr/GTLVO6Mmmy+Y5aX68xpXL/JsbtE4FKl gpuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692544233; x=1693149033; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dcIbeiwvYiRLL5LNftOFHhwXr/BhFFcaNziiweWv0sU=; b=NFDdJbhf/j9EaGP6tuxZTurt9uZTZ/SvESqrgD/DQtM4vPsmNc9qzXXd9tnROvr+GS 4/aUwKEu4gpsLfAZ3X7rQ+ajhOjYsVWPbt2F21Y8AtZUuOLSo3jJpShueASrHv/fCykt 5vXjjqkAr6YMGn7AChAE+b++J/YfEZLxf2b5iGZyliwqxTSpGSlqusEGtDVezkaEwCW5 YQEkjr2crfsfrMXfg3F76TWMDIdDbH6pgsCUaQiemvKoG46PE9lvlAqUJoQ/93yxOCYa De7zOoXkV8kDGYScda1q+1b48lsjcTeyShlWptEA4M631tYyMHcOpqSnLaFNxyOus+MT BX4Q== X-Gm-Message-State: AOJu0Ywe3VQDVCcrbVyE7H3ZYw9mGgDsmOl+KJMpeO4TBTFTmtCXJ0ft jUf/E3Xmdwx0Brh2V/KSYGhpj18XnINDkigePNU= X-Received: by 2002:adf:ea81:0:b0:319:67da:ed68 with SMTP id s1-20020adfea81000000b0031967daed68mr3332435wrm.7.1692544232916; Sun, 20 Aug 2023 08:10:32 -0700 (PDT) Received: from sucnaath.outer.uphall.net (cpc1-cmbg20-2-0-cust759.5-4.cable.virginm.net. [86.21.218.248]) by smtp.gmail.com with ESMTPSA id b4-20020adff904000000b003197c7d08ddsm9494476wrr.71.2023.08.20.08.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 08:10:32 -0700 (PDT) From: John Cox To: ffmpeg-devel@ffmpeg.org Date: Sun, 20 Aug 2023 15:10:16 +0000 Message-Id: <20230820151022.2204421-1-jc@kynesim.co.uk> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1 0/6] swscale: Add dedicated RGB->YUV unscaled functions & aarch64 asm 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: John Cox Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: jJ3PDwJBDAQx This patch set expands the set of dedicated RGB->YUV unscaled functions to help with encoding camera output on a Pi. Obviously there are other uses but that was the motivation. It enforces the general bitexact path for the fate tests that depend on it. It renames the existing bgr function as bgr... so we don't end up with the counterintuative situation where BGR is handled by rgb... and BGR would be handled by rgb.. Adds RGB functions Improves the rounding in the dedicated function as that improves its score when tested with test/swscale and fixes it to allow any width (contrary to the comment any height was already allowed). Adds XRGB->YUV functions to complete the set Adds Aarch64 neon for BGR24 & RGB24 I haven't built fate tests for this as I'm not quite sure what the appropriate tests would be. The x86 asm doesn't match either the C template with improved rounding or the previous template (I'm not quite sure what it does but it produces a different score out of tests/swscale to either method) so a simple results match isn't going to work. Regards John Cox John Cox (6): fate-filter-fps: Set swscale bitexact for tests that do conversions swscale: Rename BGR24->YUV conversion functions as bgr... swscale: Add explicit rgb24->yv12 conversion swscale: RGB24->YUV allow odd widths & improve C rounding swscale: Add unscaled XRGB->YUV420P functions swscale: Add aarch64 functions for RGB24->YUV420P libswscale/aarch64/rgb2rgb.c | 8 + libswscale/aarch64/rgb2rgb_neon.S | 356 ++++++++++++++++++++++++++++++ libswscale/bayer_template.c | 2 +- libswscale/rgb2rgb.c | 25 +++ libswscale/rgb2rgb.h | 23 ++ libswscale/rgb2rgb_template.c | 174 +++++++++++++-- libswscale/swscale_unscaled.c | 114 +++++++++- libswscale/x86/rgb2rgb_template.c | 13 +- tests/fate/filter-video.mak | 4 +- 9 files changed, 694 insertions(+), 25 deletions(-)