From patchwork Thu Nov 26 12:32:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10502 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 E0BC4BE176 for ; Thu, 26 Nov 2020 12:32:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B055163461; Thu, 26 Nov 2020 13:32:13 +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="qnpoYI0e"; dkim-atps=neutral Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B846063449 for ; Thu, 26 Nov 2020 13:32:11 +0100 (CET) Received: by mail-ej1-x62b.google.com with SMTP id oq3so2679552ejb.7 for ; Thu, 26 Nov 2020 04:32:11 -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=/pSU3BOgrEJ51O03wWUnGTA4E3xeSmlleW7QcokDXz8=; b=qnpoYI0eU6GB23VHHSqjhGwmkO9CyUqH+bU9c3D4DCEMzJXkJATrIt5+a2tWVB2mqx Nmz3xfg1clF/OlWqYNjkgNek5hq0Rc0bPrQekptMIZGN+4tVHQ6ZZAixC0urLyJIeXiV 1kJp2qXFuqU5e/rSbKj5m8vKrPQJvu/EocQlBpfQpzHCJyfnVRJg+gjRK7A9VtOYXflS zG5u0gd4RmXPkg2Bdi6BWKTlQk6XV52kWXYybFOuN1FPpeJwwGnGFnK/7LMHMT1Ae0DC ZD7DkN+nH4FH1LIdsPe4Nz6KuoJ74kAqqrt7Yn29S/NRp0/aALnsZHoTIu0xos0UDI1q qIrA== 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=/pSU3BOgrEJ51O03wWUnGTA4E3xeSmlleW7QcokDXz8=; b=HQPUIk5TCItOl4hUgEjWNWa31zpYDGHUumlqXJ6V2SiYJ5NmrDq8+Dt804fGtd9ZyB zacP3EosKZYLvEKzsW/regPJOhRFFA7sY4upIu+uIFD+RFPVtAwUx93goNJABAHoc04v mFX+fnElhto2+FYqvBSk40qWajkRaC+8nFKmx6tbAzYqajiHQ1sLq86ank6OfxO1mdtI 8jIMbcYaFa8hDEjUtC5wbD/DZFATjYeRyfgWMzWUJsGsyW/wt0tw8bD3GvLT33p5Q6cC 83IYGoX7l2i1qwRDSmYeqDCfJjzanod9Ko0UlhHCWucmF5IScoYHa2yMjxN8ltw8tDEZ IqJw== X-Gm-Message-State: AOAM532Xtx0q2H/SyKYaU6+Si+L4e7KrMdxJVB/axYqaUkmI/YDifAFQ fspMHacncIaOCexHvCkfhaiDYrcv1KF1fhNB X-Google-Smtp-Source: ABdhPJx2f/acB7vp9e99tVvxaFdQk+vFpVB35RiuxrgtjUMY8NbCLf3YO07atHf/Z78bUkxGlMJ7HA== X-Received: by 2002:a17:906:5243:: with SMTP id y3mr2466874ejm.273.1606393930277; Thu, 26 Nov 2020 04:32:10 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id u5sm3064354edp.5.2020.11.26.04.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 04:32:09 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 12:32:00 +0000 Message-Id: <20201126123203.19105-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126123203.19105-1-david.plowman@raspberrypi.com> References: <20201126123203.19105-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/4] 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 Reviewed-by: Kieran Bingham --- 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;