Show a patch.

GET /api/patches/18418/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 18418,
    "url": "https://patchwork.libcamera.org/api/patches/18418/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18418/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20230318234014.29506-10-dan.scally@ideasonboard.com>",
    "date": "2023-03-18T23:40:12",
    "name": "[libcamera-devel,09/11] apps: qcam: Add support for IPU3_Y10",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "9c4c69300383baadd47202f9b9d2d338e292d169",
    "submitter": {
        "id": 156,
        "url": "https://patchwork.libcamera.org/api/people/156/?format=api",
        "name": "Dan Scally",
        "email": "dan.scally@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18418/mbox/",
    "series": [
        {
            "id": 3807,
            "url": "https://patchwork.libcamera.org/api/series/3807/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3807",
            "date": "2023-03-18T23:40:03",
            "name": "Support OV7251 in IPU3 pipeline and qcam",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3807/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18418/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18418/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 0F7C7C3264\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 18 Mar 2023 23:40:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A5400626E4;\n\tSun, 19 Mar 2023 00:40:41 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ABA6D626F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 19 Mar 2023 00:40:34 +0100 (CET)",
            "from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B35DB6C;\n\tSun, 19 Mar 2023 00:40:34 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679182841;\n\tbh=C37Hro6tCy34wIVwFypxMDCtp37LTHZR+pvMjoVAx+I=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=JsudmhWNe5KEgYP4tfbNUjju6m1Yob6MwEB8fCTU2GGkfFMFzS00Bhrq83WSSmGr9\n\t1hlyuB6QiDQxt6JqsmcxplwZfhmcPgn2SK6m8E0WAyr0FBmfz9Gwql8w3dwp4plcpr\n\t5qCAdA8ZzgupXjeFi6zcAUu4Q3zIsWMaQVbBiiNb+IJPErAla6iAp+8T1e8eGjyyqX\n\tUJkjZfxbA2J//YTNiVZWyBQmxu2KQ9oXWoNCy/5twPWTF1DcfkhYZ6pZmRtC1nWg9L\n\tEfJVeOboCPRDPZU7cHige0u1uUTXYRf/so/H2z3ezsXAZM2qWvWa2Tc2sIZmgFg5xj\n\tqanlwinnffxrw==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679182834;\n\tbh=C37Hro6tCy34wIVwFypxMDCtp37LTHZR+pvMjoVAx+I=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=nnmxLe98vM8MyrdGmtIk4vMjwM9VSmIJe6ZiJtIzjlIDTHZcnG5qGX4NwW3YqULlz\n\t2qmdh6fqj0hv+Pd+rAo/nj+fsA56crrxrQvu4QmxCue9ybUgnEDIXtLUimf53IFfqY\n\txS/f1kJcq8J+CSevtHkm1tUkwHu47mjce5sUiMhU="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nnmxLe98\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 18 Mar 2023 23:40:12 +0000",
        "Message-Id": "<20230318234014.29506-10-dan.scally@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230318234014.29506-1-dan.scally@ideasonboard.com>",
        "References": "<20230318234014.29506-1-dan.scally@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 09/11] apps: qcam: Add support for IPU3_Y10",
        "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>",
        "From": "Daniel Scally via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Daniel Scally <dan.scally@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add support for the IPU3_Y10 format to the FormatConverter.\n\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n src/apps/qcam/format_converter.cpp | 50 ++++++++++++++++++++++++++++++\n src/apps/qcam/format_converter.h   |  2 ++\n 2 files changed, 52 insertions(+)",
    "diff": "diff --git a/src/apps/qcam/format_converter.cpp b/src/apps/qcam/format_converter.cpp\nindex de76b32c..7f5648f3 100644\n--- a/src/apps/qcam/format_converter.cpp\n+++ b/src/apps/qcam/format_converter.cpp\n@@ -169,6 +169,10 @@ int FormatConverter::configure(const libcamera::PixelFormat &format,\n \t\tformatFamily_ = MJPEG;\n \t\tbreak;\n \n+\tcase libcamera::formats::Y10_IPU3:\n+\t\tformatFamily_ = IPU3Packed;\n+\t\tbreak;\n+\n \tdefault:\n \t\treturn -EINVAL;\n \t};\n@@ -199,6 +203,9 @@ void FormatConverter::convert(const Image *src, size_t size, QImage *dst)\n \tcase YUVPlanar:\n \t\tconvertYUVPlanar(src, dst->bits());\n \t\tbreak;\n+\tcase IPU3Packed:\n+\t\tconvertIPU3Packed(src, dst->bits(), size);\n+\t\tbreak;\n \t};\n }\n \n@@ -357,3 +364,46 @@ void FormatConverter::convertYUVSemiPlanar(const Image *srcImage, unsigned char\n \t\t}\n \t}\n }\n+\n+void FormatConverter::convertIPU3Packed(const Image *srcImage, unsigned char *dst, size_t size)\n+{\n+\tconst unsigned char *src = srcImage->data(0).data();\n+\tunsigned int bytesprocessed = 0;\n+\tunsigned int lsb_shift;\n+\tunsigned int msb_shift;\n+\tunsigned int index;\n+\tunsigned int x = 0;\n+\tuint16_t pixel;\n+\n+\twhile (bytesprocessed < size) {\n+\t\tfor (unsigned int i = 0; i < 25; ++i) {\n+\t\t\tindex = (i * 10) / 8;\n+\t\t\tlsb_shift = (i * 10) % 8;\n+\t\t\tmsb_shift = 8 - lsb_shift;\n+\n+\t\t\t/*\n+\t\t\t * The IPU3-packed format can result in padding at the\n+\t\t\t * end of a 32-byte block if the last pixel in a row is\n+\t\t\t * within that block. Check whether we're on the line's\n+\t\t\t * last pixel and skip the rest of the block if so.\n+\t\t\t */\n+\t\t\tif (x == width_) {\n+\t\t\t\tx = 0;\n+\t\t\t\tdst += width_ * 4;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tpixel = (((src + bytesprocessed)[index+1] << msb_shift) & 0x3ff)\n+\t\t\t      | (((src + bytesprocessed)[index+0] >> lsb_shift) & 0x3ff);\n+\n+\t\t\tdst[4 * x + 0] = (pixel >> 2) & 0xff;\n+\t\t\tdst[4 * x + 1] = (pixel >> 2) & 0xff;\n+\t\t\tdst[4 * x + 2] = (pixel >> 2) & 0xff;\n+\t\t\tdst[4 * x + 3] = 0xff;\n+\n+\t\t\tx++;\n+\t\t}\n+\n+\t\tbytesprocessed += 32;\n+\t}\n+}\ndiff --git a/src/apps/qcam/format_converter.h b/src/apps/qcam/format_converter.h\nindex 37dbfae2..940f8b6b 100644\n--- a/src/apps/qcam/format_converter.h\n+++ b/src/apps/qcam/format_converter.h\n@@ -31,12 +31,14 @@ private:\n \t\tYUVPacked,\n \t\tYUVPlanar,\n \t\tYUVSemiPlanar,\n+\t\tIPU3Packed,\n \t};\n \n \tvoid convertRGB(const Image *src, unsigned char *dst);\n \tvoid convertYUVPacked(const Image *src, unsigned char *dst);\n \tvoid convertYUVPlanar(const Image *src, unsigned char *dst);\n \tvoid convertYUVSemiPlanar(const Image *src, unsigned char *dst);\n+\tvoid convertIPU3Packed(const Image *src, unsigned char *dst, size_t size);\n \n \tlibcamera::PixelFormat format_;\n \tunsigned int width_;\n",
    "prefixes": [
        "libcamera-devel",
        "09/11"
    ]
}