mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
ipa: rpi: alsc: Do not re-read the alsc.status metadata
This was being re-read in order to determine what LSC gains had been applied. We can just retrieve these numbers from the prevAsyncResults_ instead. This will also enable other future algorithms to manipulate the LSC tables in the alsc.status, without it breaking the core ALSC algorithm here. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
5f2ef63e7a
commit
0923d50b15
1 changed files with 7 additions and 15 deletions
|
@ -338,14 +338,14 @@ double getCt(Metadata *metadata, double defaultCt)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copyStats(RgbyRegions ®ions, StatisticsPtr &stats,
|
static void copyStats(RgbyRegions ®ions, StatisticsPtr &stats,
|
||||||
AlscStatus const &status)
|
std::array<Array2D<double>, 3> &prevSyncResults)
|
||||||
{
|
{
|
||||||
if (!regions.numRegions())
|
if (!regions.numRegions())
|
||||||
regions.init(stats->awbRegions.size());
|
regions.init(stats->awbRegions.size());
|
||||||
|
|
||||||
const std::vector<double> &rTable = status.r;
|
const std::vector<double> &rTable = prevSyncResults[0].data(); //status.r;
|
||||||
const std::vector<double> &gTable = status.g;
|
const std::vector<double> &gTable = prevSyncResults[1].data(); //status.g;
|
||||||
const std::vector<double> &bTable = status.b;
|
const std::vector<double> &bTable = prevSyncResults[2].data(); //status.b;
|
||||||
for (unsigned int i = 0; i < stats->awbRegions.numRegions(); i++) {
|
for (unsigned int i = 0; i < stats->awbRegions.numRegions(); i++) {
|
||||||
auto r = stats->awbRegions.get(i);
|
auto r = stats->awbRegions.get(i);
|
||||||
if (stats->colourStatsPos == Statistics::ColourStatsPos::PostLsc) {
|
if (stats->colourStatsPos == Statistics::ColourStatsPos::PostLsc) {
|
||||||
|
@ -367,18 +367,10 @@ void Alsc::restartAsync(StatisticsPtr &stats, Metadata *imageMetadata)
|
||||||
ct_ = getCt(imageMetadata, ct_);
|
ct_ = getCt(imageMetadata, ct_);
|
||||||
/*
|
/*
|
||||||
* We have to copy the statistics here, dividing out our best guess of
|
* We have to copy the statistics here, dividing out our best guess of
|
||||||
* the LSC table that the pipeline applied to them.
|
* the LSC table that the pipeline applied to them which we get from
|
||||||
|
* prevSyncResults_.
|
||||||
*/
|
*/
|
||||||
AlscStatus alscStatus;
|
copyStats(statistics_, stats, prevSyncResults_);
|
||||||
if (stats->colourStatsPos == Statistics::ColourStatsPos::PostLsc &&
|
|
||||||
imageMetadata->get("alsc.status", alscStatus) != 0) {
|
|
||||||
LOG(RPiAlsc, Warning)
|
|
||||||
<< "No ALSC status found for applied gains!";
|
|
||||||
alscStatus.r.resize(config_.tableSize.width * config_.tableSize.height, 1.0);
|
|
||||||
alscStatus.g.resize(config_.tableSize.width * config_.tableSize.height, 1.0);
|
|
||||||
alscStatus.b.resize(config_.tableSize.width * config_.tableSize.height, 1.0);
|
|
||||||
}
|
|
||||||
copyStats(statistics_, stats, alscStatus);
|
|
||||||
framePhase_ = 0;
|
framePhase_ = 0;
|
||||||
asyncStarted_ = true;
|
asyncStarted_ = true;
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue