| Message ID | 20260114113016.25162-5-mzamazal@redhat.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
2026. 01. 14. 12:30 keltezéssel, Milan Zamazal írta: > Let's rename the identifiers that are related to general colour > corrections applied by matrix operations, rather than directly to the > sensor colour correction matrix. > > Signed-off-by: Milan Zamazal <mzamazal@redhat.com> > --- Looks ok to me. Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > src/ipa/simple/algorithms/lut.cpp | 32 +++++++++++++++---------------- > src/ipa/simple/algorithms/lut.h | 2 +- > 2 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp > index c19b34482..5c4683fd8 100644 > --- a/src/ipa/simple/algorithms/lut.cpp > +++ b/src/ipa/simple/algorithms/lut.cpp > @@ -1,6 +1,6 @@ > /* SPDX-License-Identifier: LGPL-2.1-or-later */ > /* > - * Copyright (C) 2024-2025, Red Hat Inc. > + * Copyright (C) 2024-2026, Red Hat Inc. > * > * Color lookup tables construction > */ > @@ -89,7 +89,7 @@ void Lut::updateGammaTable(IPAContext &context) > context.activeState.gamma.contrastExp = contrastExp; > } > > -int16_t Lut::ccmValue(unsigned int i, float ccm) const > +int16_t Lut::matrixValue(unsigned int i, float ccm) const > { > return std::round(i * ccm); > } > @@ -128,25 +128,25 @@ void Lut::prepare(IPAContext &context, > params->blue[i] = gammaTable[static_cast<unsigned int>(lutGains.b())]; > } > } else if (context.activeState.matrixChanged || gammaUpdateNeeded) { > - Matrix<float, 3, 3> gainCcm = { { gains.r(), 0, 0, > - 0, gains.g(), 0, > - 0, 0, gains.b() } }; > - auto ccm = context.activeState.ccm * gainCcm; > + Matrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0, > + 0, gains.g(), 0, > + 0, 0, gains.b() } }; > + auto matrix = context.activeState.ccm * gainMatrix; > auto &red = params->redCcm; > auto &green = params->greenCcm; > auto &blue = params->blueCcm; > - params->ccm = ccm; > + params->ccm = matrix; > if (!context.gpuIspEnabled) { > for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) { > - red[i].r = ccmValue(i, ccm[0][0]); > - red[i].g = ccmValue(i, ccm[1][0]); > - red[i].b = ccmValue(i, ccm[2][0]); > - green[i].r = ccmValue(i, ccm[0][1]); > - green[i].g = ccmValue(i, ccm[1][1]); > - green[i].b = ccmValue(i, ccm[2][1]); > - blue[i].r = ccmValue(i, ccm[0][2]); > - blue[i].g = ccmValue(i, ccm[1][2]); > - blue[i].b = ccmValue(i, ccm[2][2]); > + red[i].r = matrixValue(i, matrix[0][0]); > + red[i].g = matrixValue(i, matrix[1][0]); > + red[i].b = matrixValue(i, matrix[2][0]); > + green[i].r = matrixValue(i, matrix[0][1]); > + green[i].g = matrixValue(i, matrix[1][1]); > + green[i].b = matrixValue(i, matrix[2][1]); > + blue[i].r = matrixValue(i, matrix[0][2]); > + blue[i].g = matrixValue(i, matrix[1][2]); > + blue[i].b = matrixValue(i, matrix[2][2]); > params->gammaLut[i] = gammaTable[i / div]; > } > } > diff --git a/src/ipa/simple/algorithms/lut.h b/src/ipa/simple/algorithms/lut.h > index ba8b9021b..0eafd0695 100644 > --- a/src/ipa/simple/algorithms/lut.h > +++ b/src/ipa/simple/algorithms/lut.h > @@ -38,7 +38,7 @@ public: > > private: > void updateGammaTable(IPAContext &context); > - int16_t ccmValue(unsigned int i, float ccm) const; > + int16_t matrixValue(unsigned int i, float ccm) const; > }; > > } /* namespace ipa::soft::algorithms */
diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp index c19b34482..5c4683fd8 100644 --- a/src/ipa/simple/algorithms/lut.cpp +++ b/src/ipa/simple/algorithms/lut.cpp @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ /* - * Copyright (C) 2024-2025, Red Hat Inc. + * Copyright (C) 2024-2026, Red Hat Inc. * * Color lookup tables construction */ @@ -89,7 +89,7 @@ void Lut::updateGammaTable(IPAContext &context) context.activeState.gamma.contrastExp = contrastExp; } -int16_t Lut::ccmValue(unsigned int i, float ccm) const +int16_t Lut::matrixValue(unsigned int i, float ccm) const { return std::round(i * ccm); } @@ -128,25 +128,25 @@ void Lut::prepare(IPAContext &context, params->blue[i] = gammaTable[static_cast<unsigned int>(lutGains.b())]; } } else if (context.activeState.matrixChanged || gammaUpdateNeeded) { - Matrix<float, 3, 3> gainCcm = { { gains.r(), 0, 0, - 0, gains.g(), 0, - 0, 0, gains.b() } }; - auto ccm = context.activeState.ccm * gainCcm; + Matrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0, + 0, gains.g(), 0, + 0, 0, gains.b() } }; + auto matrix = context.activeState.ccm * gainMatrix; auto &red = params->redCcm; auto &green = params->greenCcm; auto &blue = params->blueCcm; - params->ccm = ccm; + params->ccm = matrix; if (!context.gpuIspEnabled) { for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) { - red[i].r = ccmValue(i, ccm[0][0]); - red[i].g = ccmValue(i, ccm[1][0]); - red[i].b = ccmValue(i, ccm[2][0]); - green[i].r = ccmValue(i, ccm[0][1]); - green[i].g = ccmValue(i, ccm[1][1]); - green[i].b = ccmValue(i, ccm[2][1]); - blue[i].r = ccmValue(i, ccm[0][2]); - blue[i].g = ccmValue(i, ccm[1][2]); - blue[i].b = ccmValue(i, ccm[2][2]); + red[i].r = matrixValue(i, matrix[0][0]); + red[i].g = matrixValue(i, matrix[1][0]); + red[i].b = matrixValue(i, matrix[2][0]); + green[i].r = matrixValue(i, matrix[0][1]); + green[i].g = matrixValue(i, matrix[1][1]); + green[i].b = matrixValue(i, matrix[2][1]); + blue[i].r = matrixValue(i, matrix[0][2]); + blue[i].g = matrixValue(i, matrix[1][2]); + blue[i].b = matrixValue(i, matrix[2][2]); params->gammaLut[i] = gammaTable[i / div]; } } diff --git a/src/ipa/simple/algorithms/lut.h b/src/ipa/simple/algorithms/lut.h index ba8b9021b..0eafd0695 100644 --- a/src/ipa/simple/algorithms/lut.h +++ b/src/ipa/simple/algorithms/lut.h @@ -38,7 +38,7 @@ public: private: void updateGammaTable(IPAContext &context); - int16_t ccmValue(unsigned int i, float ccm) const; + int16_t matrixValue(unsigned int i, float ccm) const; }; } /* namespace ipa::soft::algorithms */
Let's rename the identifiers that are related to general colour corrections applied by matrix operations, rather than directly to the sensor colour correction matrix. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- src/ipa/simple/algorithms/lut.cpp | 32 +++++++++++++++---------------- src/ipa/simple/algorithms/lut.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-)