From c353babe626cf6dfa0166ffb891f4fb6e57097a7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 26 Sep 2017 12:43:07 +0300 Subject: tests: Add FCNL test Signed-off-by: Laurent Pinchart --- tests/vsp-unit-test-0026.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 tests/vsp-unit-test-0026.sh diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh new file mode 100755 index 0000000..3fcd6b4 --- /dev/null +++ b/tests/vsp-unit-test-0026.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +# +# Test FCNL compression on the WPF. Use a RPF -> WPF pipeline with the same +# format at the input and output, and capture output frames in all FCNL-enabled +# formats supported by the WPF. +# + +. ./vsp-lib.sh + +features="rpf.0 wpf.0 rpf.0[control:'Near-Lossless+Compression'] wpf.0[control:'Near-Lossless+Compression']" +formats="ARGB32 YUYV YUV420M YUV422M YUV444M" + +test_wpf_packing() { + local file + local frame + + test_start "WPF packing in $format with FCNL compression" + + pipe_configure rpf-wpf 0 0 + format_configure rpf-wpf 0 0 $format 1024x768 $format + + # Step 1: compress the frame with FCNL + vsp1_set_control rpf.0 "Near-Lossless Compression" 0 + vsp1_set_control wpf.0 "Near-Lossless Compression" 1 + vsp_runner rpf.0 & + vsp_runner wpf.0 + + cp ${frames_dir}frame-000007.bin ${frames_dir}frame-fcnl.bin + cp ${frames_dir}frame-000007.bin ./${format}-frame-fcnl.bin + + # Step 2: use the output of step 1 and decompress it + vsp1_set_control rpf.0 "Near-Lossless Compression" 1 + vsp1_set_control wpf.0 "Near-Lossless Compression" 0 + vsp_runner rpf.0 --file=${frames_dir}frame-fcnl.bin & + vsp_runner wpf.0 + + for frame in ${frames_dir}frame-*.bin ; do + cp ${frame} ./$format-$(basename ${frame}) + done + + rm ${frames_dir}frame-fcnl.bin + + test_complete pass +} + +test_main() { + local format + + for format in $formats ; do + test_wpf_packing $format + done +} + +test_init $0 "$features" +test_run -- cgit v1.2.3