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 <mzamazal@redhat.com> Reviewed-by: Andrei Konovalov <andrey.konovalov.ynk@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
4e13c6f55b
commit
539c62ff8e
@@ -122,15 +122,12 @@ private:
|
||||
void process2(const uint8_t *src, uint8_t *dst);
|
||||
void process4(const uint8_t *src, uint8_t *dst);
|
||||
|
||||
static constexpr unsigned int kGammaLookupSize = 1024;
|
||||
static constexpr unsigned int kRGBLookupSize = 256;
|
||||
/* Max. supported Bayer pattern height is 4, debayering this requires 5 lines */
|
||||
static constexpr unsigned int kMaxLineBuffers = 5;
|
||||
|
||||
std::array<uint8_t, kGammaLookupSize> gamma_;
|
||||
std::array<uint8_t, kRGBLookupSize> red_;
|
||||
std::array<uint8_t, kRGBLookupSize> green_;
|
||||
std::array<uint8_t, kRGBLookupSize> blue_;
|
||||
DebayerParams::ColorLookupTable red_;
|
||||
DebayerParams::ColorLookupTable green_;
|
||||
DebayerParams::ColorLookupTable blue_;
|
||||
debayerFn debayer0_;
|
||||
debayerFn debayer1_;
|
||||
debayerFn debayer2_;
|
||||
@@ -146,8 +143,6 @@ private:
|
||||
unsigned int xShift_; /* Offset of 0/1 applied to window_.x */
|
||||
bool enableInputMemcpy_;
|
||||
bool swapRedBlueGains_;
|
||||
float gammaCorrection_;
|
||||
unsigned int blackLevel_;
|
||||
unsigned int measuredFrames_;
|
||||
int64_t frameProcessTime_;
|
||||
/* Skip 30 frames for things to stabilize then measure 30 frames */
|
||||
|
||||
Reference in New Issue
Block a user