-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libcamera: software_isp: Move color mappings out of debayering
Constructing the color mapping tables is related to stats rather than debayering, where they are applied. Let's move the corresponding code to stats processing. The same applies to the auxiliary gamma table. As the gamma value is currently fixed and used in a single place, with the temporary exception mentioned below, there is no need to share it anywhere anymore. It's necessary to initialize SoftwareIsp::debayerParams_ to default values. These initial values are used for the first two frames, before they are changed based on determined stats. To avoid sharing the gamma value constant in artificial ways, we use 0.5 directly in the initialization. This all is not a particularly elegant thing to do, such a code belongs conceptually to the similar code in stats processing, but doing better is left for larger refactoring. This is a preliminary step towards building this functionality on top of libipa/algorithm.h, which should follow. Signed-off-by: Milan Zamazal <[email protected]> Reviewed-by: Andrei Konovalov <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
- Loading branch information
Showing
6 changed files
with
96 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
/* | ||
* Copyright (C) 2023, Red Hat Inc. | ||
* Copyright (C) 2023, 2024 Red Hat Inc. | ||
* | ||
* Authors: | ||
* Hans de Goede <[email protected]> | ||
|
@@ -10,20 +10,20 @@ | |
|
||
#pragma once | ||
|
||
#include <array> | ||
#include <stdint.h> | ||
|
||
namespace libcamera { | ||
|
||
struct DebayerParams { | ||
static constexpr unsigned int kGain10 = 256; | ||
static constexpr unsigned int kRGBLookupSize = 256; | ||
|
||
unsigned int gainR; | ||
unsigned int gainG; | ||
unsigned int gainB; | ||
using ColorLookupTable = std::array<uint8_t, kRGBLookupSize>; | ||
|
||
float gamma; | ||
/** | ||
* \brief Level of the black point, 0..255, 0 is no correction. | ||
*/ | ||
unsigned int blackLevel; | ||
ColorLookupTable red; | ||
ColorLookupTable green; | ||
ColorLookupTable blue; | ||
}; | ||
|
||
} /* namespace libcamera */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
/* | ||
* Copyright (C) 2023, Linaro Ltd | ||
* Copyright (C) 2023, Red Hat Inc. | ||
* Copyright (C) 2023, 2024 Red Hat Inc. | ||
* | ||
* Authors: | ||
* Hans de Goede <[email protected]> | ||
|
@@ -24,29 +24,28 @@ namespace libcamera { | |
*/ | ||
|
||
/** | ||
* \var DebayerParams::gainR | ||
* \brief Red gain | ||
* | ||
* 128 = 0.5, 256 = 1.0, 512 = 2.0, etc. | ||
* \var DebayerParams::kRGBLookupSize | ||
* \brief Size of a color lookup table | ||
*/ | ||
|
||
/** | ||
* \var DebayerParams::gainG | ||
* \brief Green gain | ||
* | ||
* 128 = 0.5, 256 = 1.0, 512 = 2.0, etc. | ||
* \typedef DebayerParams::ColorLookupTable | ||
* \brief Type of the lookup tables for red, green, blue values | ||
*/ | ||
|
||
/** | ||
* \var DebayerParams::gainB | ||
* \brief Blue gain | ||
* | ||
* 128 = 0.5, 256 = 1.0, 512 = 2.0, etc. | ||
* \var DebayerParams::red | ||
* \brief Lookup table for red color, mapping input values to output values | ||
*/ | ||
|
||
/** | ||
* \var DebayerParams::green | ||
* \brief Lookup table for green color, mapping input values to output values | ||
*/ | ||
|
||
/** | ||
* \var DebayerParams::gamma | ||
* \brief Gamma correction, 1.0 is no correction | ||
* \var DebayerParams::blue | ||
* \brief Lookup table for blue color, mapping input values to output values | ||
*/ | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters