ipa: rkisp1: Introduce AGC
Now that we have IPAContext and Algorithm, we can implement a simple AGC based on the IPU3 one. It is very similar, except that there is no histogram used for an inter quantile mean. The RkISP1 is returning a 5x5 array (for V10) of luminance means. Estimating the relative luminance is thus a simple mean of all the blocks already calculated by the ISP. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
af7f70b69a
commit
fea85f84c2
6 changed files with 443 additions and 44 deletions
46
src/ipa/rkisp1/algorithms/agc.h
Normal file
46
src/ipa/rkisp1/algorithms/agc.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2021, Ideas On Board
|
||||
*
|
||||
* agc.h - RkISP1 AGC/AEC mean-based control algorithm
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <linux/rkisp1-config.h>
|
||||
|
||||
#include <libcamera/base/utils.h>
|
||||
|
||||
#include <libcamera/geometry.h>
|
||||
|
||||
#include "algorithm.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
struct IPACameraSensorInfo;
|
||||
|
||||
namespace ipa::rkisp1::algorithms {
|
||||
|
||||
class Agc : public Algorithm
|
||||
{
|
||||
public:
|
||||
Agc();
|
||||
~Agc() = default;
|
||||
|
||||
int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
|
||||
void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;
|
||||
|
||||
private:
|
||||
void computeExposure(IPAContext &Context, double yGain);
|
||||
utils::Duration filterExposure(utils::Duration exposureValue);
|
||||
double estimateLuminance(const rkisp1_cif_isp_ae_stat *ae, double gain);
|
||||
|
||||
uint64_t frameCount_;
|
||||
|
||||
uint32_t numCells_;
|
||||
|
||||
utils::Duration filteredExposure_;
|
||||
};
|
||||
|
||||
} /* namespace ipa::rkisp1::algorithms */
|
||||
} /* namespace libcamera */
|
Loading…
Add table
Add a link
Reference in a new issue