From patchwork Tue May 17 19:18:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15939 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 1C32CC0F2A for ; Tue, 17 May 2022 19:18:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6750B6150E; Tue, 17 May 2022 21:18:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652815121; bh=TnfVGAgID0+RUrxADHIagNAENA1D7MkJUkQSJTHaQuQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=GLAiDHW4PlASnDdG7z+6HuK956R17fHPj4wV/lmUZe9T3amaniM3DHw0BRAdaPiJT iY+B5X+JArDk3eShUyM3nOJMvLl+OboXi5LtvyGZDsJShHyqH/+CGaxoUQ6h2065L7 88m94q3+WrSGXMECg9sqsMyfMelncrug+xn88f1pCF6JR7IFoGDVar8VhUOOgigLMb WwwwEhXhhNbxZZ20K/u+6poZX1BWOdHhLLXoeGU6jVeeNSkvBImLgauLEb+yoFXx1y S+n7TjiuE1SKrjrvJzwcRYmJqOBa94ve4VkOLCFcg5HxYdi8XTKPaOTl9N48qjCl05 DY3GeWe6smNlw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F8EB6041E for ; Tue, 17 May 2022 21:18:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EmCqDUyg"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [45.131.31.124]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 712F38E6; Tue, 17 May 2022 21:18:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1652815119; bh=TnfVGAgID0+RUrxADHIagNAENA1D7MkJUkQSJTHaQuQ=; h=From:To:Cc:Subject:Date:From; b=EmCqDUygM+dbV+TNL/Y+/BC5q9Ji2oBZB3HwEfnvSdc1YmbhdyaV3ZyUmi5HPQKLI ZRCQLuShRo8NUEHd9c0sGAucEjDKmZUuFZZ/27XZ57J+tKsYMl9XHtOOt5B1+mVHqK oqoXC0kHFVv9o+ZezU5SSmISQ+eb//BsG0M9024s= To: libcamera-devel@lists.libcamera.org Date: Tue, 17 May 2022 21:18:30 +0200 Message-Id: <20220517191833.333122-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/3] IPAFrameContext Ring buffer 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: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Changes in v3: - IMP: Moving away from queue to a Ring Buffer - Patch 1/3 is largely unchanged - Patch 2/3 is a advance preparatory patch for 3/3. Since we'll have a ring-buffer i.e. multiple IPAFrameContexts - Algorithm::process() will need to know which IPAFrameContext to use for processing. - In 3/3, we now use a Ring buffer instead of a queue for frame-contexts. Also extend the IPAFrameContext structure to contain a ControlList (copying incoming request controls). Changes in v2: - Majorly change the interpretation of Frame context Currently, everything is stored in a single struct i.e. IPAFrameContext. It reflects the current state of the algorithms and also stores values required to prepare frame metadata. Split these two things in separate containters IPAActiveState and IPAFrameContext. - The above design helps to rid of prevFrameContext and nextFrameContext concepts as they can get error=prone easily. - Have a queue of IPAFrameContexts which is holding members per-frame related /only/. All algorithm current (or active) state values go in IPAActiveState which is independently updated by the algorithms. Umang Jain (3): ipa: ipu3: Rework IPAFrameContext ipa: libipa: Add frame context pointer in process() ipa: ipu3: Put IPAFrameContext(s) in a ring buffer src/ipa/ipu3/algorithms/af.cpp | 46 +++++----- src/ipa/ipu3/algorithms/af.h | 3 +- src/ipa/ipu3/algorithms/agc.cpp | 36 ++++---- src/ipa/ipu3/algorithms/agc.h | 9 +- src/ipa/ipu3/algorithms/algorithm.h | 4 +- src/ipa/ipu3/algorithms/awb.cpp | 19 ++-- src/ipa/ipu3/algorithms/awb.h | 3 +- src/ipa/ipu3/algorithms/tone_mapping.cpp | 13 +-- src/ipa/ipu3/algorithms/tone_mapping.h | 3 +- src/ipa/ipu3/ipa_context.cpp | 108 +++++++++++++++-------- src/ipa/ipu3/ipa_context.h | 28 ++++-- src/ipa/ipu3/ipu3.cpp | 33 ++++--- src/ipa/libipa/algorithm.cpp | 1 + src/ipa/libipa/algorithm.h | 4 +- src/ipa/rkisp1/algorithms/agc.cpp | 4 +- src/ipa/rkisp1/algorithms/agc.h | 3 +- src/ipa/rkisp1/algorithms/algorithm.h | 4 +- src/ipa/rkisp1/algorithms/awb.cpp | 4 +- src/ipa/rkisp1/algorithms/awb.h | 3 +- src/ipa/rkisp1/rkisp1.cpp | 2 +- 20 files changed, 203 insertions(+), 127 deletions(-)