]> granicus.if.org Git - libvpx/blob - test/vpxenc.sh
Merge "AVX2 To VP9 Block Error Optimization"
[libvpx] / test / vpxenc.sh
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.
10 ##
11 ##  This file tests vpxenc using hantro_collage_w352h288.yuv as input. To add
12 ##  new tests to this file, do the following:
13 ##    1. Write a shell function (this is your test).
14 ##    2. Add the function to vpxenc_tests (on a new line).
15 ##
16 . $(dirname $0)/tools_common.sh
17
18 TEST_FRAMES=10
19
20 # Environment check: Make sure input is available.
21 vpxenc_verify_environment() {
22   if [ ! -e "${YUV_RAW_INPUT}" ]; then
23     echo "The file ${YUV_RAW_INPUT##*/} must exist in LIBVPX_TEST_DATA_PATH."
24     return 1
25   fi
26 }
27
28 vpxenc_can_encode_vp8() {
29   if [ "$(vpxenc_available)" = "yes" ] && \
30      [ "$(vp8_encode_available)" = "yes" ]; then
31     echo yes
32   fi
33 }
34
35 vpxenc_can_encode_vp9() {
36   if [ "$(vpxenc_available)" = "yes" ] && \
37      [ "$(vp9_encode_available)" = "yes" ]; then
38     echo yes
39   fi
40 }
41
42 vpxenc_vp8_ivf() {
43   if [ "$(vpxenc_can_encode_vp8)" = "yes" ]; then
44     vpxenc vp8 ${YUV_RAW_INPUT_WIDTH} ${YUV_RAW_INPUT_HEIGHT} ${TEST_FRAMES} \
45         "${YUV_RAW_INPUT}" vp8.ivf
46   fi
47 }
48
49 vpxenc_vp8_ivf_pipe_input() {
50   if [ "$(vpxenc_can_encode_vp8)" = "yes" ]; then
51     vpxenc vp8 ${YUV_RAW_INPUT_WIDTH} ${YUV_RAW_INPUT_HEIGHT} ${TEST_FRAMES} \
52         "${YUV_RAW_INPUT}" vp8.ivf -
53   fi
54 }
55
56 vpxenc_vp8_webm() {
57   if [ "$(vpxenc_can_encode_vp8)" = "yes" ] &&
58      [ "$(webm_io_available)" = "yes" ] ; then
59     vpxenc vp8 ${YUV_RAW_INPUT_WIDTH} ${YUV_RAW_INPUT_HEIGHT} ${TEST_FRAMES} \
60         "${YUV_RAW_INPUT}" vp8.webm
61   fi
62 }
63
64 vpxenc_vp9_ivf() {
65   if [ "$(vpxenc_can_encode_vp9)" = "yes" ]; then
66     vpxenc vp9 ${YUV_RAW_INPUT_WIDTH} ${YUV_RAW_INPUT_HEIGHT} ${TEST_FRAMES} \
67         "${YUV_RAW_INPUT}" vp9.ivf
68   fi
69 }
70
71 vpxenc_vp9_webm() {
72   if [ "$(vpxenc_can_encode_vp9)" = "yes" ] &&
73      [ "$(webm_io_available)" = "yes" ] ; then
74     vpxenc vp9 ${YUV_RAW_INPUT_WIDTH} ${YUV_RAW_INPUT_HEIGHT} ${TEST_FRAMES} \
75         "${YUV_RAW_INPUT}" vp9.webm
76   fi
77 }
78
79 DISABLED_vpxenc_vp9_ivf_lossless() {
80   if [ "$(vpxenc_can_encode_vp9)" = "yes" ]; then
81     vpxenc vp9 ${YUV_RAW_INPUT_WIDTH} ${YUV_RAW_INPUT_HEIGHT} ${TEST_FRAMES} \
82         "${YUV_RAW_INPUT}" vp9_lossless.ivf --lossless
83   fi
84 }
85
86 vpxenc_tests="vpxenc_vp8_ivf
87               vpxenc_vp8_webm
88               vpxenc_vp8_ivf_pipe_input
89               vpxenc_vp9_ivf
90               vpxenc_vp9_webm
91               DISABLED_vpxenc_vp9_ivf_lossless"
92
93 run_tests vpxenc_verify_environment "${vpxenc_tests}"