summaryrefslogtreecommitdiff
path: root/tests/vsp-unit-test-0026.sh
blob: 3fcd6b40f79c717f09588e674fb85c678d09db44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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