summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-11-18 23:41:40 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-11-26 19:05:20 +0200
commitf5db8497327963854fce63e9200e7ffc95ef238b (patch)
treeb7a43c00510eb4c83388d98e7c7a9959148b2b33 /src/ipa/rkisp1/algorithms
parentbe22d4aa77befb8b60ceb3607c2555959ac126ee (diff)
ipa: rkisp1: awb: Expand comment
The RGB to YCbCr conversion matrix mentioned in a comment, coming from the hardware documentation, does not match any of the canonical matrices specified by any standard. While researching where the values came from, it became apparent they are likely Bt.601 limited range coefficients rounded to 6 bits of decimal precision. Record this in comments. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms')
-rw-r--r--src/ipa/rkisp1/algorithms/awb.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp
index 26d7b813..4bb4f5b8 100644
--- a/src/ipa/rkisp1/algorithms/awb.cpp
+++ b/src/ipa/rkisp1/algorithms/awb.cpp
@@ -210,13 +210,18 @@ void Awb::process(IPAContext &context,
});
/*
- * Convert from YCbCr to RGB.
- * The hardware uses the following formulas:
- * Y = 16 + 0.2500 R + 0.5000 G + 0.1094 B
+ * Convert from YCbCr to RGB. The hardware uses the following
+ * formulas:
+ *
+ * Y = 16 + 0.2500 R + 0.5000 G + 0.1094 B
* Cb = 128 - 0.1406 R - 0.2969 G + 0.4375 B
* Cr = 128 + 0.4375 R - 0.3750 G - 0.0625 B
*
- * The inverse matrix is thus:
+ * This seems to be based on limited range BT.601 with Q1.6
+ * precision.
+ *
+ * The inverse matrix is:
+ *
* [[1,1636, -0,0623, 1,6008]
* [1,1636, -0,4045, -0,7949]
* [1,1636, 1,9912, -0,0250]]