From patchwork Tue Dec 1 17:55:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10536 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 3B8CBBE176 for ; Tue, 1 Dec 2020 17:55:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 49DBD63509; Tue, 1 Dec 2020 18:55:44 +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="BgTgEuso"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A59D63460 for ; Tue, 1 Dec 2020 18:55:43 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id z7so4043208wrn.3 for ; Tue, 01 Dec 2020 09:55:43 -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=Hu6oCAEIXM/Sa7+sottEdwvBv2khQQQ8N6nhPKg8HIM=; b=BgTgEusoHDfSxcuyizwK1eub+HdAH7JJFTS2TNenFLWEygX8HKklLKl7oCIVOMYkeu YZaK/ryVmACczCJF2lQ1QL2pEaKxzb5f+z23RaFdNln/YTxT9J8c5wWg3UeZ28/xJZ6d o+moa4LaeFoEJ+G6lbhrFmClgE5Z56VlmBGWQ4/3YELFoIcbPsgL4Wdvdx/77htIJCq0 TWRCZXGICA/OiPNWf5ygk4yie8XwZLUguUsnkRNl5ARQgmu60DdgCcQkGK9kTRvteyOh FDz/z7myxuoMJ7NNKuCS8LSJOGGeowqAq9iks6Tz/avAbLE8ozGt7sCnS31GauXNQuNw jbuw== 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=Hu6oCAEIXM/Sa7+sottEdwvBv2khQQQ8N6nhPKg8HIM=; b=D2vxqeDapW6iyra808t3sXsfQLE8htNmO9rX41VOcUre0iZp/32sUAzozp56DssCN9 /J4X6hkc4RH11qlCgQST9fT9DXsS9G1+iDRTidq5b0wVWYkIDuZbzlORM7SWOWvxb9z8 OaF6dFtCPqQHyqzPmzkGgdTOUmc2MbZ1y0+QoVxP52hnfHFSewJym4zv4FX0sToZ93ZD WytUdIGAJPLlxRol02jQiA55+nNQlIjTHYb0hVgEHN+0paHzCHu3NZV4U7Swh8FshnNR YO3k+rjMn5PZ2NUfyuMMgwG+x1TF+JZHGo5Mf9xDFSRl9BG8EuTet4nUdDd+70gJGtf+ BmEg== X-Gm-Message-State: AOAM532AaYXg/5jPlqVZg92n14yo71tH9Ss5/dvs0ffakf1BR9sHvG9m 8/fH78Jupx2enNnr+PpY0l9/20ZPzB1C1TwD X-Google-Smtp-Source: ABdhPJwMmxMcxpoMmZePa0HNHk6pirStJgZ4QeQeCyJtSqZW4oK56cEj0WcC0yt8zZff+7xZPR19AQ== X-Received: by 2002:adf:e5d0:: with SMTP id a16mr5549049wrn.340.1606845342947; Tue, 01 Dec 2020 09:55:42 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l3sm438561wrr.89.2020.12.01.09.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:55:41 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 1 Dec 2020 17:55:32 +0000 Message-Id: <20201201175536.11093-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201201175536.11093-1-david.plowman@raspberrypi.com> References: <20201201175536.11093-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/5] 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;