From patchwork Wed Jul 29 09:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 9063 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5596FBD86F for ; Wed, 29 Jul 2020 09:32:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F34C161981; Wed, 29 Jul 2020 11:32:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="CnDD6Ivc"; dkim-atps=neutral Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 23BCB618DD for ; Wed, 29 Jul 2020 11:32:04 +0200 (CEST) Received: by mail-wr1-x430.google.com with SMTP id f1so20389887wro.2 for ; Wed, 29 Jul 2020 02:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o0YUxw+uDPMlnAd3aW4hDq3HsBWLGrTzEDNEWORcFoU=; b=CnDD6Ivc5jPeZpfgJ0XmZUOSXpM/jeRPkbcozCVoGD+wnJYjwp8sQf4+jKPOd9aYkZ pQI1xJYm2WQXV3jPI9iGO+Fx7QvMtyWCUmAYNbsyn/cZMLGqeA4+UdZHaC9nsKeuEwMf EmGZt/Q4kXeROKlIUXI8JhOWnKtPwwhCD+n8zr3NY53fo8NIGVmRZ6JAYqj3Wl0pztlz AgWqO7hl2w+9tbuOuTV6DXZGqTg0m5Nrg8d1l4ohX1W+E2JmsdVFN9xnJUUFTdenTAj4 rmbweJNbbpgKTjA04sq58fpuz/jHsiM7P7p36Omi2RbhV1jvHW/s8XUJznVrh7zNMG0r FswA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o0YUxw+uDPMlnAd3aW4hDq3HsBWLGrTzEDNEWORcFoU=; b=GQdfgu3PeNMLxVSXY/cAXtpSTVQF7kTdLksXbW2DSm/2Brc+l7Aeq8/Jbjxg0nHNPp Joh1O44PDfvLWV54C327gRFUDiO24GS8Ap84WHgJKuDYxX/Ysz02l7f90zGiIpL3WGY0 vKK+EIeBaMUgjh5p979j0QXbeLp40Gw0xKkmnvtu1DdBEi0Tqz13HaMdCMntqDud2V/r U/KndOPaWXcxx0WacJUba+p+W4RJTZkRgedn4scWi7I9AuepyPRRzX1aCD0lWX8GIqW+ iZFf9uHybCVGf5fH8aZuLSiz1ei+CGAbVrtFEHnDPXU4329TcbyWWfd2dTil/Z2mWmgc H5BA== X-Gm-Message-State: AOAM531P5PqcbFyzXfpW48MZHUKcSI+p0On9H83aTRnqvOCZaADIHd3z SmJC8YUbH0PNWEbbTuQ02Hv4OtjLzUwzvA== X-Google-Smtp-Source: ABdhPJyPBzu9mMTMwhtdWj1wAGzF1R9Qg0GYAdh1j9ux9Ngujk4RCGHNlXJub2s5jFebEjpSWBFTdw== X-Received: by 2002:adf:80c2:: with SMTP id 60mr26296014wrl.388.1596015120448; Wed, 29 Jul 2020 02:32:00 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id c15sm3709921wme.23.2020.07.29.02.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2020 02:31:59 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 29 Jul 2020 10:31:49 +0100 Message-Id: <20200729093154.12296-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/5] Transform implementation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi everyone This patch set isn't complete, however, I thought it was worth giving people the chance to have a look, and this also allows me to ask a few more questions! There are 5 patches. 1. The first one merely adds the Transform class and inserts a Transform field into the CameraConfiguration. This is the only non-Raspberry Pi code. 2. Handles the transform in the RPi pipeline handler so that the correct flips are applied to the camera. Also passes the transform to the IPA. 3. Plumbs the transform through to all the separate control algorithms via the SwitchMode method (but does nothing further to handle the transform). 4. Handles the transform correctly in ALSC. 5. As part of patch 4, I noticed it wasn't dealing correctly with the luminance tables, irrespective of the transform. This fixes that and actually improves the handling of camera mode switches in general. Comments/Questions: * In patch #1, transform.h is labelled as "Copyright Google". Or should I put Raspberry Pi? Does it matter? * Patch #1 needs documentation. It looks like I need to write a transform.cpp file in the manner of (for example) geometry.cpp. Is that right, or is there anything else? (Do we mind if this file has nothing but comments?) How would I test the generated documentation is correct? * Patch #2 has an ugly cast... I think that's everything for now. Suggestions welcome as ever...! Best regards David David Plowman (5): libcamera: Add Transform class libcamera: raspberrypi: Apply transform and pass through to IPA libcamera: raspberrypi: Plumb user transform through to individual IPAs libcamera: raspberrypi: ALSC: Handle transform in colour tables libcamera: raspberrypi: ALSC: Fix crop/transform of luminance table include/libcamera/camera.h | 3 + include/libcamera/ipa/raspberrypi.h | 1 + include/libcamera/meson.build | 1 + include/libcamera/transform.h | 193 ++++++++++++++++++ src/ipa/raspberrypi/controller/algorithm.cpp | 4 +- src/ipa/raspberrypi/controller/algorithm.hpp | 3 +- src/ipa/raspberrypi/controller/controller.cpp | 5 +- src/ipa/raspberrypi/controller/controller.hpp | 5 +- src/ipa/raspberrypi/controller/rpi/agc.cpp | 3 +- src/ipa/raspberrypi/controller/rpi/agc.hpp | 3 +- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 108 +++++++--- src/ipa/raspberrypi/controller/rpi/alsc.hpp | 9 +- src/ipa/raspberrypi/controller/rpi/noise.cpp | 4 +- src/ipa/raspberrypi/controller/rpi/noise.hpp | 3 +- .../raspberrypi/controller/rpi/sharpen.cpp | 3 +- .../raspberrypi/controller/rpi/sharpen.hpp | 3 +- src/ipa/raspberrypi/raspberrypi.cpp | 44 ++-- .../pipeline/raspberrypi/raspberrypi.cpp | 27 ++- 18 files changed, 356 insertions(+), 66 deletions(-) create mode 100644 include/libcamera/transform.h