diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-06-17 00:31:10 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-06-19 15:30:48 +0300 |
commit | 5b4c47d86bb887ead31419e54a55cec216c5bae3 (patch) | |
tree | ae07cec57357063a7b39286c48720c0e572b7054 /scripts/vsp-lib.sh | |
parent | 8f715bbaa867f0928bad6cf1b8595444134afc8f (diff) |
vsp-lib: Add support for passing parameters to reference frame generator
The parameters currently supported are horizontal and vertical flipping,
rotation, LUT and CLU.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'scripts/vsp-lib.sh')
-rwxr-xr-x | scripts/vsp-lib.sh | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 9cf4c39..b9ca402 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -88,6 +88,7 @@ reference_frame() { local file=$1 local format=$2 local size=$3 + shift 3 local alpha= local options= @@ -112,6 +113,30 @@ reference_frame() { ;; esac + local arg + for arg in $* ; do + local name=$(echo $arg | cut -d '=' -f 1) + local value=$(echo $arg | cut -d '=' -f 2) + + case $name in + clu) + options="$options --clu $value" + ;; + hflip) + [ x$value = x1 ] && options="$options --hflip" + ;; + lut) + options="$options --lut $value" + ;; + rotate) + [ x$value = x90 ] && options="$options --rotate" + ;; + vflip) + [ x$value = x1 ] && options="$options --vflip" + ;; + esac + done + [ x$__vsp_bru_inputs != x ] && options="$options -c $__vsp_bru_inputs" $(format_v4l2_is_yuv $format) && options="$options -y" @@ -193,6 +218,7 @@ compare_frame_fuzzy() { } compare_frames() { + local args=$* local format=$__vsp_wpf_format local wpf=$__vsp_wpf_index @@ -204,18 +230,23 @@ compare_frames() { method=fuzzy fi - reference_frame ref-frame.bin $format $size + reference_frame ref-frame.bin $format $size $args local result="pass" + local params=${args// /-} + params=${params:+-$params} + params=${params//\//_} + params=$fmt-$size$params + for frame in frame-*.bin ; do (compare_frame_$method $format $size $frame ref-frame.bin) || { - mv $frame ${0/.sh/}-${frame/.bin/-$fmt-$size.bin} ; + mv $frame ${0/.sh/}-${frame/.bin/-$params.bin} ; result="fail" } done if [ $result = "fail" ] ; then - mv ref-frame.bin ${0/.sh/}-ref-frame-$fmt-$size.bin + mv ref-frame.bin ${0/.sh/}-ref-frame-$params.bin else rm -f ref-frame.bin fi |