Patch Detail
Show a patch.
GET /api/1.1/patches/19470/?format=api
{ "id": 19470, "url": "https://patchwork.libcamera.org/api/1.1/patches/19470/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19470/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240130181311.43745-2-hdegoede@redhat.com>", "date": "2024-01-30T18:13:10", "name": "[RFC,1/2] libcamera: debayer: Move sizes() to DebayerCpu implementation", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5deb7a5792b57f2afd8aeddcb72a5484293ad863", "submitter": { "id": 102, "url": "https://patchwork.libcamera.org/api/1.1/people/102/?format=api", "name": "Hans de Goede", "email": "hdegoede@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19470/mbox/", "series": [ { "id": 4162, "url": "https://patchwork.libcamera.org/api/1.1/series/4162/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4162", "date": "2024-01-30T18:13:09", "name": "libcamera: debayer_cpu: Stop requiring 2 lines of padding at the top/bottom", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4162/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19470/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19470/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B08ADC32A9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jan 2024 18:13:23 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7580D62131;\n\tTue, 30 Jan 2024 19:13:21 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DAEED6212F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jan 2024 19:13:18 +0100 (CET)", "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n\t[66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-622-J7japHXTMIKBxBC9mitQ8Q-1; Tue, 30 Jan 2024 13:13:14 -0500", "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55E1F101A526;\n\tTue, 30 Jan 2024 18:13:14 +0000 (UTC)", "from shalem.redhat.com (unknown [10.39.192.94])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 5C76240C122E;\n\tTue, 30 Jan 2024 18:13:13 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"SLzSTIVy\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1706638397;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=U0bMaMtknryfhkQqNQUEoHRL3v5MS+VNOg+/vLle8rs=;\n\tb=SLzSTIVyguKYt4b2AhXy5vmSjYoXlyJAdpZT+9fNEziXBZVoWm0WGq17R68ckz03eJqyhg\n\tktYMQY4IcKEcuZ39QsbMNRZwXdkd9Nxnk3QGvJ+xH8skTubHtxlZHgzPJWZXNrBOumJekM\n\td074TXf3CG0zdNfKimLY76hl3+tZf/o=", "X-MC-Unique": "J7japHXTMIKBxBC9mitQ8Q-1", "From": "Hans de Goede <hdegoede@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[RFC 1/2] libcamera: debayer: Move sizes() to DebayerCpu\n\timplementation", "Date": "Tue, 30 Jan 2024 19:13:10 +0100", "Message-ID": "<20240130181311.43745-2-hdegoede@redhat.com>", "In-Reply-To": "<20240130181311.43745-1-hdegoede@redhat.com>", "References": "<20240130181311.43745-1-hdegoede@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.2", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Cc": "Maxime Ripard <mripard@redhat.com>, Pavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The amount of padding needed for interpolation at the borders depends\non the implementation.\n\nStop assuming that all implementations need a pattern-width x pattern-height\nborder around the output size for padding and move the sizes()\nmethod out of the base-class.\n\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\n---\n .../libcamera/internal/software_isp/debayer.h | 26 +------------------\n .../internal/software_isp/debayer_cpu.h | 1 +\n src/libcamera/software_isp/debayer_cpu.cpp | 26 +++++++++++++++++++\n 3 files changed, 28 insertions(+), 25 deletions(-)", "diff": "diff --git a/include/libcamera/internal/software_isp/debayer.h b/include/libcamera/internal/software_isp/debayer.h\nindex 9109bf32..ab1ce994 100644\n--- a/include/libcamera/internal/software_isp/debayer.h\n+++ b/include/libcamera/internal/software_isp/debayer.h\n@@ -94,31 +94,7 @@ public:\n \t *\n \t * \\return The valid size ranges or an empty range if there are none.\n \t */\n-\tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize)\n-\t{\n-\t\tSize pattern_size = patternSize(inputFormat);\n-\n-\t\tif (pattern_size.isNull())\n-\t\t\treturn {};\n-\n-\t\t/*\n-\t\t * For debayer interpolation a border of pattern-height x pattern-width\n-\t\t * is kept around the entire image. Combined with a minimum-size of\n-\t\t * pattern-height x pattern-width this means the input-size needs to be\n-\t\t * at least (3 * pattern-height) x (3 * pattern-width).\n-\t\t */\n-\t\tif (inputSize.width < (3 * pattern_size.width) ||\n-\t\t inputSize.height < (3 * pattern_size.height)) {\n-\t\t\tLOG(Debayer, Warning)\n-\t\t\t\t<< \"Input format size too small: \" << inputSize.toString();\n-\t\t\treturn {};\n-\t\t}\n-\n-\t\treturn SizeRange(Size(pattern_size.width, pattern_size.height),\n-\t\t\t\t Size((inputSize.width - 2 * pattern_size.width) & ~(pattern_size.width - 1),\n-\t\t\t\t (inputSize.height - 2 * pattern_size.height) & ~(pattern_size.height - 1)),\n-\t\t\t\t pattern_size.width, pattern_size.height);\n-\t}\n+\tvirtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;\n \n \t/**\n \t * \\brief Signals when the input buffer is ready.\ndiff --git a/include/libcamera/internal/software_isp/debayer_cpu.h b/include/libcamera/internal/software_isp/debayer_cpu.h\nindex 52af117f..bcb634d5 100644\n--- a/include/libcamera/internal/software_isp/debayer_cpu.h\n+++ b/include/libcamera/internal/software_isp/debayer_cpu.h\n@@ -62,6 +62,7 @@ public:\n \t\tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n \n \tvoid process(FrameBuffer *input, FrameBuffer *output, DebayerParams params);\n+\tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n \n \t/**\n \t * \\brief Get the file descriptor for the statistics.\ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex b6393925..14fc383e 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -945,4 +945,30 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n \tinputBufferReady.emit(input);\n }\n \n+SizeRange DebayerCpu::sizes(PixelFormat inputFormat, const Size &inputSize)\n+{\n+\tSize pattern_size = patternSize(inputFormat);\n+\n+\tif (pattern_size.isNull())\n+\t\treturn {};\n+\n+\t/*\n+\t * For debayer interpolation a border of pattern-height x pattern-width\n+\t * is kept around the entire image. Combined with a minimum-size of\n+\t * pattern-height x pattern-width this means the input-size needs to be\n+\t * at least (3 * pattern-height) x (3 * pattern-width).\n+\t */\n+\tif (inputSize.width < (3 * pattern_size.width) ||\n+\t inputSize.height < (3 * pattern_size.height)) {\n+\t\tLOG(Debayer, Warning)\n+\t\t\t<< \"Input format size too small: \" << inputSize.toString();\n+\t\treturn {};\n+\t}\n+\n+\treturn SizeRange(Size(pattern_size.width, pattern_size.height),\n+\t\t\t Size((inputSize.width - 2 * pattern_size.width) & ~(pattern_size.width - 1),\n+\t\t\t (inputSize.height - 2 * pattern_size.height) & ~(pattern_size.height - 1)),\n+\t\t\t pattern_size.width, pattern_size.height);\n+}\n+\n } /* namespace libcamera */\n", "prefixes": [ "RFC", "1/2" ] }