[libcamera-devel] [PATCH 3/5] utils: ipu3: Display BNR configuration

Jean-Michel Hautbois jeanmichel.hautbois at ideasonboard.com
Thu Jun 30 12:17:00 CEST 2022


Bayer Noise Reduction is a processing block which contains optical
correction parameters for the ImgU. Display the configured parameters.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
---
 utils/ipu3/ipu3-dump-params.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/utils/ipu3/ipu3-dump-params.c b/utils/ipu3/ipu3-dump-params.c
index 37cf2e6f..257f2205 100644
--- a/utils/ipu3/ipu3-dump-params.c
+++ b/utils/ipu3/ipu3-dump-params.c
@@ -39,6 +39,27 @@ static void displayGrid(struct ipu3_uapi_grid_config *grid, const char *gridName
 	       grid->height << grid->block_height_log2);
 }
 
+static void displayBNR(struct ipu3_uapi_params *params)
+{
+	struct ipu3_uapi_bnr_static_config bnr = params->acc_param.bnr;
+	printf("WB gains: (gr: %u, r: %u, gb: %u, b: %u)\n",
+		bnr.wb_gains.gr, bnr.wb_gains.r,
+		bnr.wb_gains.gb, bnr.wb_gains.b);
+	printf("WB gains thresholds: (gr: %u, r: %u, gb: %u, b: %u)\n",
+		bnr.wb_gains_thr.gr, bnr.wb_gains_thr.r,
+		bnr.wb_gains_thr.gb, bnr.wb_gains_thr.b);
+	printf("Optical window center: (%d, %d) column size is %u\n",
+		bnr.opt_center.x_reset, bnr.opt_center.y_reset, bnr.column_size);
+	printf("Noise model coefficients that controls noise threshold:\n");
+	printf("Free coefficient (cf): %u, Gain coefficient(cg): %u\n",
+		bnr.thr_coeffs.cf, bnr.thr_coeffs.cg);
+	printf("Intensity coefficient(ci): %u, Normalization shift value for r^2 calculation(r_nf): %u\n",
+		bnr.thr_coeffs.ci, bnr.thr_coeffs.r_nf);
+	printf("Lens shading gain approximations: (gr: %u, r: %u, gb: %u, b: %u)\n",
+		bnr.thr_ctrl_shd.gr, bnr.thr_ctrl_shd.r,
+		bnr.thr_ctrl_shd.gb, bnr.thr_ctrl_shd.b);
+}
+
 int main(int argc, char *argv[])
 {
 	int in_fd;
@@ -64,6 +85,10 @@ start:
 
 	printf("Read parameters buffer of size %d\n", ret);
 
+	if (params.use.acc_bnr) {
+		printf("\n**** Bayer noise reduction parameters ****\n");
+		displayBNR(&params);
+	}
 	if (params.use.acc_awb) {
 		printf("\n**** AWB parameters ****\n");
 		displayGrid(&params.acc_param.awb.config.grid, "awb");
-- 
2.34.1



More information about the libcamera-devel mailing list