[libcamera-devel,RFC,1/1] ipa: ipu3: awb: Correct the coefficient factor
diff mbox series

Message ID 20220616091148.67870-2-jeanmichel.hautbois@ideasonboard.com
State New
Headers show
Series
  • IPU3 AWB gains correction
Related show

Commit Message

Jean-Michel Hautbois June 16, 2022, 9:11 a.m. UTC
The factor used right now in the IPU3 is 8192, as stated in the
documentation : "Precision u3.13, range [0, 8)".

Testing it in more depth made this assumption debatable, as it seems
that the gain is 1.0 when the value is 4096.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 src/ipa/ipu3/algorithms/awb.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp
index 5c232d92..2a7d30ab 100644
--- a/src/ipa/ipu3/algorithms/awb.cpp
+++ b/src/ipa/ipu3/algorithms/awb.cpp
@@ -451,10 +451,10 @@  void Awb::prepare(IPAContext &context, ipu3_uapi_params *params)
 	params->acc_param.bnr.opt_center_sqr.y_sqr_reset = params->acc_param.bnr.opt_center.y_reset
 							* params->acc_param.bnr.opt_center.y_reset;
 	/* Convert to u3.13 fixed point values */
-	params->acc_param.bnr.wb_gains.gr = 8192 * context.activeState.awb.gains.green;
-	params->acc_param.bnr.wb_gains.r  = 8192 * context.activeState.awb.gains.red;
-	params->acc_param.bnr.wb_gains.b  = 8192 * context.activeState.awb.gains.blue;
-	params->acc_param.bnr.wb_gains.gb = 8192 * context.activeState.awb.gains.green;
+	params->acc_param.bnr.wb_gains.gr = 0 * context.activeState.awb.gains.green;
+	params->acc_param.bnr.wb_gains.r  = 4096 * context.activeState.awb.gains.red;
+	params->acc_param.bnr.wb_gains.b  = 4096 * context.activeState.awb.gains.blue;
+	params->acc_param.bnr.wb_gains.gb = 0 * context.activeState.awb.gains.green;
 
 	LOG(IPU3Awb, Debug) << "Color temperature estimated: " << asyncResults_.temperatureK;