Skip to content

Commit

Permalink
utils: tuning: Add alsc-only libtuning raspberrypi tuning script
Browse files Browse the repository at this point in the history
Add a tuning script for raspberrypi for alsc only, that uses libtuning.
Since there will also be a tuning script for raspberrypi that has more
modules, put the libtuning alsc module definition in a separate file so
that it can be reused later.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  • Loading branch information
Rahi374 committed Nov 25, 2022
1 parent d62f2ac commit 4af9f81
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/tuning/raspberrypi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>
19 changes: 19 additions & 0 deletions utils/tuning/raspberrypi/alsc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>
#
# alsc.py - ALSC module instance for Raspberry Pi tuning scripts

import libtuning as lt
from libtuning.modules.lsc import ALSCRaspberryPi

ALSC = \
ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', lt.Param.Mode.Optional, True),
luminance_strength=lt.Param('luminance_strength', lt.Param.Mode.Optional, 0.5),
debug=[lt.Debug.Plot],
sector_shape=(16, 12),
sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront),
sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront),
sector_average_function=lt.average.Mean(),
smoothing_function=lt.smoothing.MedianBlur(3),
)
23 changes: 23 additions & 0 deletions utils/tuning/raspberrypi_alsc_only.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>
#
# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only

import sys

import libtuning as lt
from libtuning.parsers import RaspberryPiParser
from libtuning.generators import RaspberryPiOutput

from raspberrypi.alsc import ALSC

tuner = lt.Tuner('Raspberry Pi (ALSC only)')
tuner.add(ALSC)
tuner.set_input_parser(RaspberryPiParser())
tuner.set_output_formatter(RaspberryPiOutput())
tuner.set_output_order([ALSC])

if __name__ == '__main__':
sys.exit(tuner.run(sys.argv))

0 comments on commit 4af9f81

Please sign in to comment.