Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 1 | #!/bin/sh |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | ## Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 3 | ## |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 4 | ## This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | ## was not distributed with this source code in the LICENSE file, you can |
| 7 | ## obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | ## Media Patent License 1.0 was not distributed with this source code in the |
| 9 | ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 10 | ## |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 11 | ## This file tests the libaom set_maps example. To add new tests to this file, |
| 12 | ## do the following: |
| 13 | ## 1. Write a shell function (this is your test). |
| 14 | ## 2. Add the function to set_maps_tests (on a new line). |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 15 | ## |
| 16 | . $(dirname $0)/tools_common.sh |
| 17 | |
| 18 | # Environment check: $YUV_RAW_INPUT is required, and set_maps must exist in |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 19 | # $LIBAOM_BIN_PATH. |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 20 | set_maps_verify_environment() { |
| 21 | if [ ! -e "${YUV_RAW_INPUT}" ]; then |
Yaowu Xu | 97aa09f | 2016-10-12 08:25:39 -0700 | [diff] [blame] | 22 | echo "Libaom test data must exist in LIBAOM_TEST_DATA_PATH." |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 23 | return 1 |
| 24 | fi |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 25 | if [ -z "$(aom_tool_path set_maps)" ]; then |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 26 | elog "set_maps not found. It must exist in LIBAOM_BIN_PATH or its parent." |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 27 | return 1 |
| 28 | fi |
| 29 | } |
| 30 | |
| 31 | # Runs set_maps using the codec specified by $1. |
| 32 | set_maps() { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 33 | local encoder="$(aom_tool_path set_maps)" |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 34 | local codec="$1" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 35 | local output_file="${AOM_TEST_OUTPUT_DIR}/set_maps_${codec}.ivf" |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 36 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 37 | eval "${AOM_TEST_PREFIX}" "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \ |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 38 | "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \ |
James Zern | bb98789 | 2020-04-28 18:33:02 -0700 | [diff] [blame] | 39 | ${devnull} || return 1 |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 40 | |
| 41 | [ -e "${output_file}" ] || return 1 |
| 42 | } |
| 43 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 44 | set_maps_av1() { |
| 45 | if [ "$(av1_encode_available)" = "yes" ]; then |
| 46 | set_maps av1 || return 1 |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 47 | fi |
| 48 | } |
| 49 | |
Jim Bankoski | a7a3909 | 2016-05-20 06:25:40 -0700 | [diff] [blame] | 50 | set_maps_tests="set_maps_av1" |
Tom Finegan | 9598aae | 2014-08-18 15:40:46 -0700 | [diff] [blame] | 51 | |
| 52 | run_tests set_maps_verify_environment "${set_maps_tests}" |