summaryrefslogtreecommitdiff
path: root/utils/raspberrypi/ctt/ctt_pretty_print_json.py
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2024-06-06 11:15:07 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-06-13 10:13:33 +0100
commitd13542c28f291b88e29f1142d6dff565e772a05c (patch)
tree5cc8f6b666c21bc9cebf56dbf9de36655b88dbed /utils/raspberrypi/ctt/ctt_pretty_print_json.py
parent634bc7838f879c208df1915b2259e2a7f8dcefd7 (diff)
utils: raspberrypi: ctt: Adapt tuning tool for both VC4 and PiSP
The old ctt.py and alsc_only.py scripts are removed. Instead of ctt.py use ctt_vc4.py or ctt_pisp.py, depending on your target platform. Instead of alsc_only.py use alsc_vc4.py or alsc_pisp.py, again according to your platform. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils/raspberrypi/ctt/ctt_pretty_print_json.py')
-rwxr-xr-xutils/raspberrypi/ctt/ctt_pretty_print_json.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py
index 3e3b8475..5d16b2a6 100755
--- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py
+++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py
@@ -19,6 +19,7 @@ class Encoder(json.JSONEncoder):
self.indentation_level = 0
self.hard_break = 120
self.custom_elems = {
+ 'weights': 15,
'table': 16,
'luminance_lut': 16,
'ct_curve': 3,
@@ -87,7 +88,7 @@ class Encoder(json.JSONEncoder):
return self.encode(o)
-def pretty_print(in_json: dict) -> str:
+def pretty_print(in_json: dict, custom_elems={}) -> str:
if 'version' not in in_json or \
'target' not in in_json or \
@@ -95,7 +96,9 @@ def pretty_print(in_json: dict) -> str:
in_json['version'] < 2.0:
raise RuntimeError('Incompatible JSON dictionary has been provided')
- return json.dumps(in_json, cls=Encoder, indent=4, sort_keys=False)
+ encoder = Encoder(indent=4, sort_keys=False)
+ encoder.custom_elems |= custom_elems
+ return encoder.encode(in_json) #json.dumps(in_json, cls=Encoder, indent=4, sort_keys=False)
if __name__ == "__main__":