From patchwork Tue Dec 8 20:44:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10612 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 9475EBDB20 for ; Tue, 8 Dec 2020 20:44:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0150667F07; Tue, 8 Dec 2020 21:44:45 +0100 (CET) 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="SjQ2g2fh"; dkim-atps=neutral Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B7286600FF for ; Tue, 8 Dec 2020 21:44:44 +0100 (CET) Received: by mail-ed1-x52d.google.com with SMTP id p22so6957431edu.11 for ; Tue, 08 Dec 2020 12:44:44 -0800 (PST) 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=Oy3y0oI/LefNt2zuXvefULVdEtlRSXx9n66JYsw1e74=; b=SjQ2g2fhnm6ryelLUD8CUuPF51Z/bSflKGuj1iPSHdZrbZisVVTEPxUZf/hu33YAWV quWPR0VIQSwc8qcmN8Xrf4Omq6a+bBfhKIA4pEqGQvp/HV+l/oS8TjGRhEkInTng3oaL 9lhbA7VDjWBclPFn99jd4RTu84lliSgDML5G1m8BNcp6zYziNhfwtUuSv1yH8tlWB0U4 T4ncGfV5BfhRrAc5qwAgtNAfaO/wOOtrasrlYeypM/hHffX82BtCHfGChDbDWkA2OiFI RqeuWhh/CCXn5miAJJdV+3AqCChVnVi+25bfo16sUZM+8BHT/471goSdGNdRNJZ49d/2 OY8Q== 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=Oy3y0oI/LefNt2zuXvefULVdEtlRSXx9n66JYsw1e74=; b=T/vQXsfeiAIx+Nx+SuDy3zzh0YSwF2ns4Db+6bObYvgGk4by+8OVcNy3Irf447ZEwJ nubvkJDquzul4YaS1wVIuCE/E0tCNjRZxkevf/HdGDWKzhw84unLVSP4x4ObRU41n/Aq Lcu6XNEv8qujs1wvWmTK33wybvzGByE7ecDfosxKRISSIkslz5xKxuNFdTkcya4CR1qh mIe3wQgp6zAbcboIK0AseU1/JDpP0+tSxvIja0vHEYhkdlY2S1nn09gBR3/5hk3M97O0 cvkhV81s1ZdtaIjVhc2gJ8EVYCHx/P7YS5wMD64nmZ+MNtiHxY2asBolxO1tCLFc6B9R W/eQ== X-Gm-Message-State: AOAM533EkphZqG+caFFtoUuX0e+DNHcg9k3BhhG0+xk5I8A7LZ5XlXVv ycVZT+zrpLhdtLo/iT1PqiSembTvn9SoTj6M X-Google-Smtp-Source: ABdhPJyqNZghpToPOJuyQVWQ00rxqyRrj7Km7pMRG+wmJvLjPe4B5lgnPaRLYkFMoFnP+5iSvhZbKg== X-Received: by 2002:a05:6402:4cf:: with SMTP id n15mr26347476edw.241.1607460283782; Tue, 08 Dec 2020 12:44:43 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id be6sm18441471edb.29.2020.12.08.12.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 12:44:43 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 8 Dec 2020 20:44:35 +0000 Message-Id: <20201208204441.9356-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/6] Raspberry Pi AGC: initial frame drop count 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 Thanks for all the reviews, comments and discussion! I've lost track a little bit of which comments were in which thread, so perhaps I can address a few of the remaining issues here. 1. Hide/Mistrust frames at Startup/ModeSwitch Yes, I see that some of these are the same now. I'm slightly inclined to keep all 4 variants for the moment as it seems to me they might be different, however, if it transpires that new cameras that come along still don't need them maybe we do some simplification then? 2. Should GetConvergenceFrames be in the Algorithm class? Again, I'm slightly inclined to avoid it just because there are only 2 implementations of this, yet there are actually over a dozen "algorithms". But like all things, we keep an eye on it! 3. "Hiding" vs. "Mistrusting" Just to clarify the distinction here, "hiding" means "do not show this to the user because it will look unexpected in some way". "Mistrusting" means "do not allow algorithms to process this frame because it will cause them to wobble or do something bad". "Mistrusting" includes both statistics and metadata from the device. I suppose if the ISP statistics are bad then the frame may be bad too, so it would feature in the "hide" number already. It is possible that you could get frames that look OK but where the device is lying about its metadata, so there is a distinction between the two. Yet perhaps this distinction never really happens in practice - so this should go on this list of things we keep an eye on with a view to simplification. As regards the patches themselves, they are structured exactly as before. The main differences are: 1. No change. 2. and 3. GetConvergenceFrames has dropped the parameter (that's handled back in the IPA now, patch 6). 4. Pwl::Inverse is a bit more careful about adding to its existing end points as it goes. 5. No more std::move. 6. The adding of the "mistrusted" frames is handled here now. And I think that's it, please remind me if anything has slipped through the cracks! Thanks and best regards David David Plowman (6): src: raspberrypi: Pass the drop frame count in start, not configure src: ipa: raspberrypi: agc: Add GetConvergenceFrames method to AGC base class src: ipa: raspberrypi: awb: Add GetConvergenceFrames method to AWB base class src: ipa: raspberrypi: Compute inverse of piecewise linear function src: ipa: raspberrypi: Estimate the colour temerature if starting with fixed colour gains src: ipa: raspberrypi: Move initial frame drop decision to AGC/AWB src/ipa/raspberrypi/cam_helper.cpp | 6 +- src/ipa/raspberrypi/cam_helper_ov5647.cpp | 10 +++ .../raspberrypi/controller/agc_algorithm.hpp | 1 + .../raspberrypi/controller/awb_algorithm.hpp | 1 + src/ipa/raspberrypi/controller/pwl.cpp | 30 ++++++++ src/ipa/raspberrypi/controller/pwl.hpp | 3 + src/ipa/raspberrypi/controller/rpi/agc.cpp | 11 +++ src/ipa/raspberrypi/controller/rpi/agc.hpp | 2 + src/ipa/raspberrypi/controller/rpi/alsc.cpp | 6 +- src/ipa/raspberrypi/controller/rpi/awb.cpp | 25 +++++++ src/ipa/raspberrypi/controller/rpi/awb.hpp | 3 + src/ipa/raspberrypi/raspberrypi.cpp | 73 ++++++++++++++----- .../pipeline/raspberrypi/raspberrypi.cpp | 25 ++++--- 13 files changed, 160 insertions(+), 36 deletions(-)