Skip to content

Commit 0526184

Browse files
Merge pull request #466 from g-maxime/vulkan-ci
Check for HW accelerated encoding and decoding
2 parents 8da53b3 + c47b6d8 commit 0526184

File tree

4 files changed

+123
-8
lines changed

4 files changed

+123
-8
lines changed

.github/workflows/RAWcoocked_Checks.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ jobs:
1616
with:
1717
fetch-depth: 1
1818
- name: OS packets
19-
run: |
19+
run: |
2020
if [ "$RUNNER_OS" == "Linux" ]; then
2121
echo "deb https://mediaarea.net/repo/deb/ubuntu $(lsb_release --codename --short)-snapshots main" | sudo tee /etc/apt/sources.list.d/mediaarea-snapshots.list
2222
sudo curl https://repo.mediaarea.net/deb/ubuntu/keyring.gpg -o /etc/apt/trusted.gpg.d/mediaarea-snapshots.gpg
2323
sudo apt-get update
24-
sudo apt-get install -y valgrind ffmpeg-ma
24+
sudo apt-get install -y nasm valgrind ffmpeg-ma mesa-vulkan-drivers libvulkan1 vulkan-tools vulkan-validationlayers
2525
fi
2626
if [ "$RUNNER_OS" == "macOS" ]; then
2727
brew update
2828
brew install coreutils automake
2929
fi
3030
- name: FFmpeg
31-
run: |
31+
run: |
3232
cd Project/GNU/CLI
3333
if [ "$RUNNER_OS" == "Linux" ]; then
3434
cp /usr/bin/ffmpeg-ma ffmpeg
@@ -38,19 +38,19 @@ jobs:
3838
7za e FFmpeg_Bin_Latest_Mac_Static_x64.zip bin/ffmpeg
3939
fi
4040
- name: Configure
41-
run: |
41+
run: |
4242
cd Project/GNU/CLI
4343
sh autogen.sh
4444
./configure
4545
- name: Compile
46-
run: |
46+
run: |
4747
cd Project/GNU/CLI
4848
make
4949
- name: Check files
50-
run: |
50+
run: |
5151
cd Project/GNU/CLI
5252
make clone_testing_files
5353
- name: Check
54-
run: |
54+
run: |
5555
cd Project/GNU/CLI
5656
make check

Project/GNU/CLI/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ man1_MANS = ../../../Source/CLI/rawcooked.1
7676

7777
AM_TESTS_FD_REDIRECT = 9>&2
7878

79-
TESTS = test/test1.sh test/test1b.sh test/test2.sh test/test3.sh test/avi.sh test/pcm.sh test/reversibilityfile.sh test/paddingbits.sh test/check.sh test/legacy.sh test/multiple.sh test/valgrind.sh test/overwrite.sh test/increasingdigitcount.sh test/gaps.sh test/slices.sh test/framerate.sh test/hash.sh test/notfound.sh test/version.sh
79+
TESTS = test/test1.sh test/test1b.sh test/test2.sh test/test3.sh test/vulkan.sh test/avi.sh test/pcm.sh test/reversibilityfile.sh test/paddingbits.sh test/check.sh test/legacy.sh test/multiple.sh test/valgrind.sh test/overwrite.sh test/increasingdigitcount.sh test/gaps.sh test/slices.sh test/framerate.sh test/hash.sh test/notfound.sh test/version.sh
8080

8181
TESTING_DIR = test/TestingFiles
8282

Project/GNU/CLI/test/vulkan.sh

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/usr/bin/env bash
2+
3+
script_path="${PWD}/test"
4+
. ${script_path}/helpers.sh
5+
6+
# test disabled on macOS and Windows
7+
if [[ "${OSTYPE}" == "darwin"* ]] || [ -n "${WSL}" ] ; then
8+
exit 77
9+
fi
10+
11+
while read line ; do
12+
file="$(basename "$(echo "${line}" | cut -d' ' -f1)")"
13+
path="$(dirname "$(echo "${line}" | cut -d' ' -f1)")"
14+
want="$(echo "${line}" | cut -d' ' -f2)"
15+
test=$(basename "${path}")
16+
17+
if [ ! -e "${files_path}/${path}/${file}" ] ; then
18+
echo "NOK: ${test}/${file}, file not found" >&${fd}
19+
status=1
20+
continue
21+
fi
22+
23+
pushd "${files_path}/${path}" >/dev/null 2>&1
24+
if [[ ${file} == *".exr" ]]; then
25+
encode_extra="--check"
26+
fi
27+
run_rawcooked -y --conch --encode --file ${encode_extra} -d "${file}"
28+
29+
# check expected result
30+
if [ "${want}" == "fail" ] ; then
31+
if check_failure "file rejected at input" "file accepted at input" ; then
32+
echo "OK: ${test}/${file}, file rejected at input" >&${fd}
33+
fi
34+
continue
35+
else
36+
check_success "file rejected at input" "file accepted at input" || continue
37+
fi
38+
39+
if [ ! -e "${file}.rawcooked_reversibility_data" ] ; then
40+
echo "NOK: ${test}/${file}, reversibility_data is missing" >&${fd}
41+
status=1
42+
clean
43+
continue
44+
fi
45+
source_warnings=$(echo "${cmd_stderr}" | grep "Warning: ")
46+
47+
# check result file generation
48+
for variant in swdpx hwdpx ; do
49+
test="$(basename "${path}") (${variant})"
50+
51+
cmd_stdout="${cmd_stdout/-xerror/-xerror -init_hw_device vulkan=vk:0,debug=0}"
52+
if [ "${variant}" == "hwdpx" ] ; then
53+
cmd_stdout="${cmd_stdout/-xerror/-xerror -hwaccel vulkan -hwaccel_output_format vulkan}"
54+
fi
55+
cmd_stdout="${cmd_stdout/-c:v ffv1/-vf hwupload -c:v ffv1_vulkan}"
56+
cmd_stdout="${cmd_stdout/-context 1/}"
57+
run_ffmpeg "${cmd_stdout}"
58+
59+
if [ ! -e "${file}.mkv" ] ; then
60+
echo "NOK: ${test}/${file}, mkv not generated" >&${fd}
61+
status=1
62+
continue
63+
fi
64+
65+
# check decoding
66+
run_rawcooked -y --conch --decode "${file}.mkv"
67+
if ! check_success "mkv decoding failed" "mkv decoded" ; then
68+
rm -f "${file}.mkv"
69+
continue
70+
fi
71+
72+
decoded_warnings=$(echo "${cmd_stderr}" | grep "Warning: ")
73+
if [ "${source_warnings}" != "${decoded_warnings}" ] ; then
74+
echo "NOK: ${test}/${file}, warnings differs between the source and the decoded files" >&${fd}
75+
status=1
76+
rm -fr "${file}.mkv" "${file}.mkv.RAWcooked"
77+
continue
78+
fi
79+
check_files "${file}" "${file}.mkv.RAWcooked/${file}"
80+
done
81+
clean
82+
popd >/dev/null 2>&1
83+
done < "${script_path}/vulkan.txt"
84+
85+
exit ${status}

Project/GNU/CLI/test/vulkan.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Formats/DPX/Flavors/RGBA_10_FilledA_BE/10bit_a.dpx pass
2+
Formats/DPX/Flavors/RGBA_10_FilledA_BE/checkerboard_1080p_nuke_bigendian_10bit_alpha.dpx pass
3+
Formats/DPX/Flavors/RGBA_10_FilledA_BE/converted_image_gets_skewed.dpx fail
4+
Formats/DPX/Flavors/RGBA_10_FilledA_LE/checkerboard_1080p_nuke_littleendian_10bit_alpha.dpx pass
5+
Formats/DPX/Flavors/RGBA_12_FilledA_BE/checkerboard_1080p_nuke_bigendian_12bit_alpha.dpx pass
6+
Formats/DPX/Flavors/RGBA_12_FilledA_LE/checkerboard_1080p_nuke_littleendian_12bit_alpha.dpx pass
7+
Formats/DPX/Flavors/RGBA_12_Packed_BE/12bit_a.dpx pass
8+
Formats/DPX/Flavors/RGBA_16_FilledA_BE/checkerboard_1080p_nuke_bigendian_16bit_alpha.dpx pass
9+
Formats/DPX/Flavors/RGBA_16_FilledA_BE/uncropped_DPX_4K_16bit_Overscan15pros.CutFrom3640to128Height.dpx pass
10+
Formats/DPX/Flavors/RGBA_16_FilledA_LE/checkerboard_1080p_nuke_littleendian_16bit_alpha.dpx pass
11+
Formats/DPX/Flavors/RGBA_16_Packed_BE/16bit_a.dpx pass
12+
Formats/DPX/Flavors/RGB_10_FilledA_BE/10bit.dpx pass
13+
Formats/DPX/Flavors/RGB_10_FilledA_BE/checkerboard_1080p_nuke_bigendian_10bit_noalpha.dpx pass
14+
Formats/DPX/Flavors/RGB_10_FilledA_LE/checkerboard_1080p_nuke_littleendian_10bit_noalpha.dpx pass
15+
Formats/DPX/Flavors/RGB_10_FilledA_LE/image090003.dpx pass
16+
Formats/DPX/Flavors/RGB_12_FilledA_BE/checkerboard_1080p_nuke_bigendian_12bit_noalpha.dpx pass
17+
Formats/DPX/Flavors/RGB_12_FilledA_LE/checkerboard_1080p_nuke_littleendian_12bit_noalpha.dpx pass
18+
Formats/DPX/Flavors/RGB_12_Packed_BE/12bit.dpx pass
19+
Formats/DPX/Flavors/RGB_12_Packed_BE/af093_ifa2006350_10000086400.dpx pass
20+
Formats/DPX/Flavors/RGB_12_Packed_BE/RGB_12_bit.dpx pass
21+
Formats/DPX/Flavors/RGB_12_Packed_BE/086449_modified_4300x64_orientation0.dpx pass
22+
Formats/DPX/Flavors/RGB_12_Packed_BE/Width_2488.dpx pass
23+
Formats/DPX/Flavors/RGB_16_FilledA_BE/checkerboard_1080p_nuke_bigendian_16bit_noalpha.dpx pass
24+
Formats/DPX/Flavors/RGB_16_FilledA_LE/checkerboard_1080p_nuke_littleendian_16bit_noalpha.dpx pass
25+
Formats/DPX/Flavors/RGB_16_Packed_BE/16bit.dpx pass
26+
Formats/DPX/Flavors/RGB_16_Packed_BE/058142ce-aeb9-4f5c-b3c7-7590f09c757d_00090000.dpx pass
27+
Formats/DPX/Flavors/RGB_16_Packed_BE/RGB_16_bit.dpx pass
28+
Formats/DPX/Flavors/RGB_16_Packed_LE/Dufay_000001.dpx pass
29+
Formats/DPX/Flavors/Y_16_FilledA_BE/0000001.dpx pass
30+
Formats/DPX/Flavors/Y_16_Packed_BE/pack3.dpx pass

0 commit comments

Comments
 (0)