[{"id":30908,"web_url":"https://patchwork.libcamera.org/comment/30908/","msgid":"<CAEmqJPpVT32V8wC+Ko-7aTbeV3Uh28VVYck8vdcVP1dt3QV+Eg@mail.gmail.com>","date":"2024-08-27T07:32:32","subject":"Re: [PATCH v1 0/7] Raspberry Pi: Add controls::rpi::ScalerCrops","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi all,\n\nGentle ping for any feedback on this please?\n\nThanks,\nNaush\n\nOn Thu, 8 Aug 2024 at 11:23, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> Hi,\n>\n> This patch series adds preliminary support for setting individual crop\n> rectangles for each ISP output stream. The current ScalerCrop control takes a\n> single rectangle and applies it to all output streams. In this series, we define\n> a new rpi::ScalerCrops vendor control that takes a span of rectangles, one for\n> each output stream. The behaviour of the existing ScalerCrop control remains\n> unchanged.\n>\n> One example of the use of this feature is when generating low resolution images\n> for AI inferencing. Typically, vision neural network models are trained on\n> square dimension image with 1:1 aspect ratio (e.g. 640x640 or 320x320). If an\n> application requests, say, a 1920x1080 (16:9) output stream + 640x640 (1:1)\n> inference stream, then the latter images end up squished and distorted. This\n> affects the performance of the neural network.  By allowing separate crops on\n> each stream, the inference stream can preserve the pixel aspect ratio for any\n> requested resolution.\n>\n> Note that VC4 based platforms cannot apply different crops to each output,\n> whereas the PiSP/Pi5 platform can. However, all the infrastructure for this\n> change lives in the core pipeline handler shared by both platforms.\n>\n> Thanks,\n> Naush\n>\n> Naushir Patuck (7):\n>   controls: rpi: Add a vendor rpi::ScalerCrops control\n>   pipeline: rpi: Remove CameraData::scalerCrop_\n>   pipeline: rpi: Pass crop rectangle as a parameter to\n>     platformSetIspCrop()\n>   pipeline: rpi: Introduce CameraData::CropParams\n>   pipeline: rpi: Track which ISP output is configured for a stream\n>   pipeline: rpi: Pass ISP output index into platformSetIspCrop()\n>   pipeline: rpi: Handler controls::rpi::ScalerCrops\n>\n>  src/ipa/rpi/common/ipa_base.cpp               |  2 +\n>  src/libcamera/control_ids_rpi.yaml            | 15 ++++\n>  .../pipeline/rpi/common/pipeline_base.cpp     | 84 +++++++++++++------\n>  .../pipeline/rpi/common/pipeline_base.h       | 26 +++++-\n>  src/libcamera/pipeline/rpi/vc4/vc4.cpp        | 18 ++--\n>  5 files changed, 112 insertions(+), 33 deletions(-)\n>\n> --\n> 2.34.1\n>","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 02F89C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Aug 2024 07:33:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D5BD363445;\n\tTue, 27 Aug 2024 09:33:13 +0200 (CEST)","from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com\n\t[IPv6:2607:f8b0:4864:20::112c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 074C56343E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Aug 2024 09:33:11 +0200 (CEST)","by mail-yw1-x112c.google.com with SMTP id\n\t00721157ae682-6ad20c373daso3203987b3.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Aug 2024 00:33:10 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"k3jJ/7MI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1724743990; x=1725348790;\n\tdarn=lists.libcamera.org; \n\th=to:subject:message-id:date:from:in-reply-to:references:mime-version\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=UQvy1QOngh1dx2xbFP3hOqL4Dx3juKWr4+/dv/2aO+Q=;\n\tb=k3jJ/7MIbkOKm2QIAAvKeNfxSLeDDy4aGLnmr0FN54LMZJ4SlDWCVYaYGloVujGbtf\n\t37sS9o1r1UyDN0pQg5p6Mai2y/1yFrdHKP4AQlgpTnS4gZ5jSA1dGMm7KDM3X8aWlRkq\n\tWcqWyFyJqLOY5YUrv9hLtixQz+S+hZbuTUdJYnDRZPMJKQLld/UIxPlwPknGISPmO5J+\n\tioL9jAjz/kCzxXjzu3BSEMgvp6rFheD0NmyART4dfTY7f13jJbyd1QpoeAAQjWAaWqbv\n\tNae9yxwepLV1TpAhGLy3eSPpMgnRIOvqPWYOIsYseP9uB9nzOrQ61lmKQFGHLyjlFCma\n\tscDg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1724743990; x=1725348790;\n\th=to:subject:message-id:date:from:in-reply-to:references:mime-version\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=UQvy1QOngh1dx2xbFP3hOqL4Dx3juKWr4+/dv/2aO+Q=;\n\tb=L5JRMuqfUciHZaZDaXo5QYlBqyBAPolGUQLCEO7nIUnPu2uKhyKx4cmXT7j/B5S3Wc\n\tr3HIUIym3wmMutSH4Nkl7xyRI2xNPGrEb4os6FXptxibmV+iABiFIBeg7SRc9nttp4uT\n\tMIDmRbVhtyPgEEghENxH2RmJHqdltgrnmo/MgR3UOnfUpA4OcBOs9TDFbkzX7ugmLuJx\n\twvN9MerXhFq9/5OQIEqTVqTBanBB2OuYINrfJk7WWlgzOXr9yVWp4mkQ6VM8US8jHpTc\n\toA3niLMKgVY/sC0rtDDXdbm+xckzetIUIZMa8o5Hfkehhvg5sTs/8ZARIf2+uvgbNJtl\n\ttbtw==","X-Gm-Message-State":"AOJu0YyE3HTNpQpeQEAGmY9OIGugwvBnifV6Krndc+1SVUOf9dTwnBO+\n\twetzquvXzP9KOBoxXHOVzka4E+xUsKkrm2L8BCZuFbkF1XVwiV2zggHoRbCpxvidGPycP9BhoQV\n\t5peSQ5gj0BHji1M7Jis5f9Yhj5MjFa0AW6oxvK2a/ysBfjiVI","X-Google-Smtp-Source":"AGHT+IFV9m+8lFpFNxj9v7YVNvhr069stOLGb4hZ/m/PvwkAFMGtaKxcUqVZZ5xbZNhV1oGSBStVn9khoZ2NJaUBiOA=","X-Received":"by 2002:a05:690c:5:b0:6cf:7847:6e3 with SMTP id\n\t00721157ae682-6cf78470954mr14997647b3.4.1724743989600;\n\tTue, 27 Aug 2024 00:33:09 -0700 (PDT)","MIME-Version":"1.0","References":"<20240808102346.13065-1-naush@raspberrypi.com>","In-Reply-To":"<20240808102346.13065-1-naush@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 27 Aug 2024 08:32:32 +0100","Message-ID":"<CAEmqJPpVT32V8wC+Ko-7aTbeV3Uh28VVYck8vdcVP1dt3QV+Eg@mail.gmail.com>","Subject":"Re: [PATCH v1 0/7] Raspberry Pi: Add controls::rpi::ScalerCrops","To":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]