Merge "remove mmx variance functions"
[aom.git] / test / postproc.sh
blob939a3e7620a36397ecd8937a57be0e7881385ec8
1 #!/bin/sh
2 ##
3 ## Copyright (c) 2014 The WebM project authors. All Rights Reserved.
4 ##
5 ## Use of this source code is governed by a BSD-style license
6 ## that can be found in the LICENSE file in the root of the source
7 ## tree. An additional intellectual property rights grant can be found
8 ## in the file PATENTS. All contributing project authors may
9 ## be found in the AUTHORS file in the root of the source tree.
11 ## This file tests the libvpx postproc example code. To add new tests to this
12 ## file, do the following:
13 ## 1. Write a shell function (this is your test).
14 ## 2. Add the function to postproc_tests (on a new line).
16 . $(dirname $0)/tools_common.sh
18 # Environment check: Make sure input is available:
19 # $VP8_IVF_FILE and $VP9_IVF_FILE are required.
20 postproc_verify_environment() {
21 if [ ! -e "${VP8_IVF_FILE}" ] || [ ! -e "${VP9_IVF_FILE}" ]; then
22 echo "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH."
23 return 1
27 # Runs postproc using $1 as input file. $2 is the codec name, and is used
28 # solely to name the output file.
29 postproc() {
30 local decoder="${LIBVPX_BIN_PATH}/postproc${VPX_TEST_EXE_SUFFIX}"
31 local input_file="$1"
32 local codec="$2"
33 local output_file="${VPX_TEST_OUTPUT_DIR}/postproc_${codec}.raw"
35 if [ ! -x "${decoder}" ]; then
36 elog "${decoder} does not exist or is not executable."
37 return 1
40 eval "${VPX_TEST_PREFIX}" "${decoder}" "${input_file}" "${output_file}" \
41 ${devnull}
43 [ -e "${output_file}" ] || return 1
46 postproc_vp8() {
47 if [ "$(vp8_decode_available)" = "yes" ]; then
48 postproc "${VP8_IVF_FILE}" vp8 || return 1
52 postproc_vp9() {
53 if [ "$(vpx_config_option_enabled CONFIG_VP9_POSTPROC)" = "yes" ]; then
54 if [ "$(vp9_decode_available)" = "yes" ]; then
55 postproc "${VP9_IVF_FILE}" vp9 || return 1
60 postproc_tests="postproc_vp8
61 postproc_vp9"
63 run_tests postproc_verify_environment "${postproc_tests}"