simple_decoder.sh: Support encoding in decode test scripts.
Adding AV1 input files to the test set is not feasible because the
bitstream is in constant flux. Add test input encoding and hook
it up in simple_decoder.sh to start.
cherry-picked #b591df89 from aom/master
Change-Id: Ie4c06a7c458cdc2ab003d27fb92418c77c87fc88
diff --git a/test/simple_decoder.sh b/test/simple_decoder.sh
index 4aa55da..27b3a0e 100755
--- a/test/simple_decoder.sh
+++ b/test/simple_decoder.sh
@@ -16,10 +16,8 @@
. $(dirname $0)/tools_common.sh
# Environment check: Make sure input is available:
-# $AOM_IVF_FILE and $AV1_IVF_FILE are required.
simple_decoder_verify_environment() {
- if [ ! -e "${AOM_IVF_FILE}" ] || [ ! -e "${AV1_IVF_FILE}" ]; then
- echo "Libaom test data must exist in LIBVPX_TEST_DATA_PATH."
+ if [ ! "$(av1_encode_available)" = "yes" ] && [ ! -e "${AV1_IVF_FILE}" ]; then
return 1
fi
}
@@ -43,19 +41,18 @@
[ -e "${output_file}" ] || return 1
}
-simple_decoder_aom() {
- if [ "$(aom_decode_available)" = "yes" ]; then
- simple_decoder "${AOM_IVF_FILE}" aom || return 1
- fi
-}
-
simple_decoder_av1() {
if [ "$(av1_decode_available)" = "yes" ]; then
- simple_decoder "${AV1_IVF_FILE}" av1 || return 1
+ if [ ! -e "${AV1_IVF_FILE}" ]; then
+ local file="${AOM_TEST_OUTPUT_DIR}/test_encode.ivf"
+ encode_yuv_raw_input_av1 "${file}"
+ simple_decoder "${file}" av1 || return 1
+ else
+ simple_decoder "${AV1_IVF_FILE}" av1 || return 1
+ fi
fi
}
-simple_decoder_tests="simple_decoder_aom
- simple_decoder_av1"
+simple_decoder_tests="simple_decoder_av1"
run_tests simple_decoder_verify_environment "${simple_decoder_tests}"