[v4,4/4] utils: tuning: Support variable softisp LSC size
diff mbox series

Message ID 20261202151305.132644-5-mzamazal@redhat.com
State New
Headers show
Series
  • softisp tuning script for LSC
Related show

Commit Message

Milan Zamazal Dec. 2, 2026, 3:13 p.m. UTC
Software ISP supports arbitrary lens shading correction table sizes.
Let's adjust the softisp tuning script to produce tables of any size
too.  The size can be specified in the tuning script configuration file.
If unspecified, the default size of 17x17 cells is still used for
compatibility with the last released libcamera.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
---
 utils/tuning/config-example.yaml              | 5 ++++-
 utils/tuning/libtuning/modules/lsc/softisp.py | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/utils/tuning/config-example.yaml b/utils/tuning/config-example.yaml
index 238069a6f..c829ee937 100644
--- a/utils/tuning/config-example.yaml
+++ b/utils/tuning/config-example.yaml
@@ -52,4 +52,7 @@  general:
   macbeth:
     small: 1
     show: 0
-#  blacklevel: 32
\ No newline at end of file
+  lsc:
+    grid_width: 17
+    grid_height: 17
+#  blacklevel: 32
diff --git a/utils/tuning/libtuning/modules/lsc/softisp.py b/utils/tuning/libtuning/modules/lsc/softisp.py
index 798553542..99c41427d 100644
--- a/utils/tuning/libtuning/modules/lsc/softisp.py
+++ b/utils/tuning/libtuning/modules/lsc/softisp.py
@@ -95,7 +95,11 @@  class LSCSoftisp(LSC):
         return output_list
 
     def process(self, config: dict, images: list, outputs: dict) -> dict:
-        output = {}
+        if 'lsc' in config['general']:
+            lsc_config = config['general']['lsc']
+            self.sector_shape = (lsc_config['grid_width'], lsc_config['grid_height'])
+
+        output = dict(gridSize=dict(width=self.sector_shape[0], height=self.sector_shape[1]))
 
         output['sets'] = self._do_all_lsc(images)