From patchwork Thu Oct 14 07:05:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 14132 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 117F9BDC71 for ; Thu, 14 Oct 2021 07:05:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D3DF868F54; Thu, 14 Oct 2021 09:05:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="LU/IuFT8"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A63168F54 for ; Thu, 14 Oct 2021 09:05:48 +0200 (CEST) Received: by mail-pg1-x541.google.com with SMTP id r2so4635480pgl.10 for ; Thu, 14 Oct 2021 00:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CpFwya8vFkhHzBzR4WOewPCe3sJl5KgyNve3eOrJDAo=; b=LU/IuFT8nfB93avDYmQNj5ZisVZ+87+IzC3SC+Bhqju9TlsXkPIgXSwAJTBIP8iHz/ klwhC9x+gVKpQ7ERhf0wyu4AhyR0gPVKSmbV29UIXsYhslnYw/ntCR0KkDKm6EaEUiM7 mbhHmvS0960L+YAxL5qKP3JP2FXmM8jJ/qGWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CpFwya8vFkhHzBzR4WOewPCe3sJl5KgyNve3eOrJDAo=; b=rrDuCDK+G/+hA5RIJtKY8VIeVF2WKVJya2e6+yejokx48PhfrMgtiahVSA7B5EgpAx K/0pjsZ9KBP0vTQufk9Rr7VjV5Qg1RMHp7vsNxWlCfNsZPcLIHArnHtabRyghR5SVPo/ pb/dE3SHo67+f7fY0r21BuIwZWPuutFUuJxWjEXVbUGl9ofh7Qsphi7S71chkQ3f7GDY nBAurHbPx9EFMGCIAK1nUDNW1XwWn8rheGjEe8lLR2AUbfJ+C3adlAekb6s91nex7pJw 0biPodjQOgnRvzfm/5VWBypgHOB8BCB4Z/yhErMu/qOS8k/eTYrFxxxM+OteId8cQm9L XpBg== X-Gm-Message-State: AOAM530+eyQPLid9cRtZ8dgJASwdt8MstiS5aInoEAnn41gtSkvQnA83 ELxY/iPxSEkv/xGKQE0Up9sxEOKtPl4FghNh X-Google-Smtp-Source: ABdhPJwUhPPyZZaPerXpDPCkYATWr1jN7Cuil68m4BFxf+f97rTYLVxiK0AX/yh6kCvT7eCpALFUow== X-Received: by 2002:a63:cf41:: with SMTP id b1mr2976484pgj.407.1634195145184; Thu, 14 Oct 2021 00:05:45 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:4dac:fd0c:fba7:b5ae]) by smtp.gmail.com with UTF8SMTPSA id y3sm1399766pfo.188.2021.10.14.00.05.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 00:05:44 -0700 (PDT) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Thu, 14 Oct 2021 15:05:33 +0800 Message-Id: <20211014070533.3720964-3-hanlinchen@chromium.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211014070533.3720964-1-hanlinchen@chromium.org> References: <20211014070533.3720964-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 3/3] ipu3: Apply shading adapter as part of AIQ::run2a() 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" Populate shading adapter input parameters and run it as a part of run2a() to correct lens shading for the camera. Signed-off-by: Han-Lin Chen --- aiq/aiq.cpp | 3 +++ aiq/aiq_input_parameters.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/aiq/aiq.cpp b/aiq/aiq.cpp index 708e9d6..24c61cb 100644 --- a/aiq/aiq.cpp +++ b/aiq/aiq.cpp @@ -154,6 +154,9 @@ int AIQ::run2a(unsigned int frame, AiqInputParameters ¶ms, params.paParams.exposure_params = results.ae()->exposures[0].exposure; parameterAdapterRun(params.paParams, results); + params.saParams.awb_results = results.awb(); + shadingAdapterRun(params.saParams, results); + afRun(params.afParams, results); return 0; diff --git a/aiq/aiq_input_parameters.cpp b/aiq/aiq_input_parameters.cpp index 8a53849..36e2b07 100644 --- a/aiq/aiq_input_parameters.cpp +++ b/aiq/aiq_input_parameters.cpp @@ -89,6 +89,15 @@ int AiqInputParameters::configure(const IPAConfigInfo &configInfo) /* Guess from hal-configs-nautilus/files/camera3_profiles.xml#263 */ sensorDescriptor.coarse_integration_time_max_margin = 10; + sensorFrameParams.horizontal_crop_offset = 0; + sensorFrameParams.vertical_crop_offset = 0; + sensorFrameParams.cropped_image_width = configInfo.sensorInfo.analogCrop.width; + sensorFrameParams.cropped_image_height = configInfo.sensorInfo.analogCrop.height; + sensorFrameParams.horizontal_scaling_numerator = 1; + sensorFrameParams.horizontal_scaling_denominator = 1; + sensorFrameParams.vertical_scaling_numerator = 1; + sensorFrameParams.vertical_scaling_denominator = 1; + return 0; } @@ -165,6 +174,9 @@ void AiqInputParameters::setAeAwbAfDefaults() gbceParams.tone_map_level = ia_aiq_tone_map_level_default; gbceParams.frame_use = ia_aiq_frame_use_still; gbceParams.ev_shift = 0; + + /* SA Params */ + saParams.frame_use = ia_aiq_frame_use_still; } } /* namespace ipa::ipu3::aiq */