From patchwork Wed Nov 25 11:36:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10495 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 39AF7BE08A for ; Wed, 25 Nov 2020 11:36:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 127C56340E; Wed, 25 Nov 2020 12:36:46 +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="GUygUYkn"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BED31633E5 for ; Wed, 25 Nov 2020 12:36:44 +0100 (CET) Received: by mail-wm1-x333.google.com with SMTP id p22so1709580wmg.3 for ; Wed, 25 Nov 2020 03:36: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=1xhsu7HrWSngEnUv4/MVRgNPdbfcwpnU4q9jZTtkWVE=; b=GUygUYkngH3ght4L5X4deW+lpzQMRwfcEUG3UBwc4CrFHysYYWU2MqHNJ8BmDO/YeN 5Yc6xgF4ppy9Zj3HaKb94RCpOUDquoaw63SqRi9izQfcPDScCvDUZ/Ecx2rnE69lIlE6 BoRvhf/tXh6BFOeKaFOwvPrYsezPARCzrd8LbhbeIRXBl2rXuYSJbXaAfK3aDxad58pb S645xz3kxcaTt0Y44+Q2LG6pYIsU6PDWqtRcMHcgek4kz3re4+fl213EGePMc1lxaYYk rNev9JzD79qVJZiDT0nKPkup+6QZZFZya7S6KSpkdq0E5naDsQGFQq4phgagxk3ZMbU0 Z6sA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=1xhsu7HrWSngEnUv4/MVRgNPdbfcwpnU4q9jZTtkWVE=; b=GDs8wDBP5yPITCLqaZi7VbVfa5MuXOBn5pFY3aVcN93rQsBofpzOC3yD7TvNYm42J/ xxqwI9+JbrvEkELeWRIEyeGmIGO64THAUuCqtO+8xBrjlovVGAqZb+0oV+muXKF7J2VT U7DUGkEGRaFqHYPlohpCp76WbL7mq9+IgSLhoM8QjbuFwxdGm1GIQU0jQvR4H2vXTSN4 yQzA2ftjMt22FSrk3d+zcgeczMGziCCmDLe9MlJ7nUHGYyo9Hcgt28JE/78KFMpY+7CR QwuZFHhu1ayDjCX8q8f8LasmiI/nagcoPfqqYi9NoVcc3xM2+btSRh3NEGxEN0anwZy9 A00g== X-Gm-Message-State: AOAM532Y2I2iJsud2PDFGL2PUrOHfNwv5mbe8GAYZBMJ89v78Ix/tq2C n5B9QhBWdZiaLDJN8xPlsHwEs141/jJyTgDo X-Google-Smtp-Source: ABdhPJweoT2od3sUHar8wPqOc+Yfv9xhUVIO2Ia3pLWwIm8KfN5mxiZOa/K4jbxLYbxrkDEgLKufWQ== X-Received: by 2002:a1c:2b05:: with SMTP id r5mr3350705wmr.179.1606304204270; Wed, 25 Nov 2020 03:36:44 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id b14sm4232371wrq.47.2020.11.25.03.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 03:36:43 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 25 Nov 2020 11:36:38 +0000 Message-Id: <20201125113640.20246-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201125113640.20246-1-david.plowman@raspberrypi.com> References: <20201125113640.20246-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] src: ipa: raspberrypi: Avoid AGC filtering when both gain and shutter specified 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" When both gain and shutter have been directly specified, do not filter slowly towards those target values, but adopt them immediately. This should match user expectations better. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 4c56bdc9..30a1c1c1 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -588,7 +588,12 @@ bool Agc::applyDigitalGain(double gain, double target_Y) void Agc::filterExposure(bool desaturate) { - double speed = frame_count_ <= config_.startup_frames ? 1.0 : config_.speed; + double speed = config_.speed; + // AGC adapts instantly if both shutter and gain are directly specified + // or we're in the startup phase. + if ((status_.fixed_shutter && status_.fixed_analogue_gain) || + frame_count_ <= config_.startup_frames) + speed = 1.0; if (filtered_.total_exposure == 0.0) { filtered_.total_exposure = target_.total_exposure; filtered_.total_exposure_no_dg = target_.total_exposure_no_dg;