| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 ## | 2 ## |
| 3 ## Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 3 ## Copyright (c) 2014 The WebM project authors. All Rights Reserved. |
| 4 ## | 4 ## |
| 5 ## Use of this source code is governed by a BSD-style license | 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 | 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 | 7 ## tree. An additional intellectual property rights grant can be found |
| 8 ## in the file PATENTS. All contributing project authors may | 8 ## in the file PATENTS. All contributing project authors may |
| 9 ## be found in the AUTHORS file in the root of the source tree. | 9 ## be found in the AUTHORS file in the root of the source tree. |
| 10 ## | 10 ## |
| 11 ## This file tests vpxenc using hantro_collage_w352h288.yuv as input. To add | 11 ## This file tests vpxenc using hantro_collage_w352h288.yuv as input. To add |
| 12 ## new tests to this file, do the following: | 12 ## new tests to this file, do the following: |
| 13 ## 1. Write a shell function (this is your test). | 13 ## 1. Write a shell function (this is your test). |
| 14 ## 2. Add the function to vpxenc_tests (on a new line). | 14 ## 2. Add the function to vpxenc_tests (on a new line). |
| 15 ## | 15 ## |
| 16 . $(dirname $0)/tools_common.sh | 16 . $(dirname $0)/tools_common.sh |
| 17 | 17 |
| 18 readonly TEST_FRAMES=10 | 18 readonly TEST_FRAMES=10 |
| 19 | 19 |
| 20 # Environment check: Make sure input is available. | 20 # Environment check: Make sure input is available. |
| 21 vpxenc_verify_environment() { | 21 vpxenc_verify_environment() { |
| 22 if [ ! -e "${YUV_RAW_INPUT}" ]; then | 22 if [ ! -e "${YUV_RAW_INPUT}" ]; then |
| 23 elog "The file ${YUV_RAW_INPUT##*/} must exist in LIBVPX_TEST_DATA_PATH." | 23 elog "The file ${YUV_RAW_INPUT##*/} must exist in LIBVPX_TEST_DATA_PATH." |
| 24 return 1 | 24 return 1 |
| 25 fi | 25 fi |
| 26 if [ "$(vpxenc_can_encode_vp9)" = "yes" ]; then |
| 27 if [ ! -e "${Y4M_NOSQ_PAR_INPUT}" ]; then |
| 28 elog "The file ${Y4M_NOSQ_PAR_INPUT##*/} must exist in" |
| 29 elog "LIBVPX_TEST_DATA_PATH." |
| 30 return 1 |
| 31 fi |
| 32 fi |
| 26 if [ -z "$(vpx_tool_path vpxenc)" ]; then | 33 if [ -z "$(vpx_tool_path vpxenc)" ]; then |
| 27 elog "vpxenc not found. It must exist in LIBVPX_BIN_PATH or its parent." | 34 elog "vpxenc not found. It must exist in LIBVPX_BIN_PATH or its parent." |
| 28 return 1 | 35 return 1 |
| 29 fi | 36 fi |
| 30 } | 37 } |
| 31 | 38 |
| 32 vpxenc_can_encode_vp8() { | 39 vpxenc_can_encode_vp8() { |
| 33 if [ "$(vp8_encode_available)" = "yes" ]; then | 40 if [ "$(vp8_encode_available)" = "yes" ]; then |
| 34 echo yes | 41 echo yes |
| 35 fi | 42 fi |
| 36 } | 43 } |
| 37 | 44 |
| 38 vpxenc_can_encode_vp9() { | 45 vpxenc_can_encode_vp9() { |
| 39 if [ "$(vp9_encode_available)" = "yes" ]; then | 46 if [ "$(vp9_encode_available)" = "yes" ]; then |
| 40 echo yes | 47 echo yes |
| 41 fi | 48 fi |
| 42 } | 49 } |
| 43 | 50 |
| 44 # Echo vpxenc command line parameters allowing use of | 51 # Echo vpxenc command line parameters allowing use of |
| 45 # hantro_collage_w352h288.yuv as input. | 52 # hantro_collage_w352h288.yuv as input. |
| 46 yuv_input_hantro_collage() { | 53 yuv_input_hantro_collage() { |
| 47 echo ""${YUV_RAW_INPUT}" | 54 echo ""${YUV_RAW_INPUT}" |
| 48 --width="${YUV_RAW_INPUT_WIDTH}" | 55 --width="${YUV_RAW_INPUT_WIDTH}" |
| 49 --height="${YUV_RAW_INPUT_HEIGHT}"" | 56 --height="${YUV_RAW_INPUT_HEIGHT}"" |
| 50 } | 57 } |
| 51 | 58 |
| 59 y4m_input_non_square_par() { |
| 60 echo ""${Y4M_NOSQ_PAR_INPUT}"" |
| 61 } |
| 62 |
| 52 # Echo default vpxenc real time encoding params. $1 is the codec, which defaults | 63 # Echo default vpxenc real time encoding params. $1 is the codec, which defaults |
| 53 # to vp8 if unspecified. | 64 # to vp8 if unspecified. |
| 54 vpxenc_rt_params() { | 65 vpxenc_rt_params() { |
| 55 local readonly codec="${1:-vp8}" | 66 local readonly codec="${1:-vp8}" |
| 56 echo "--codec=${codec} | 67 echo "--codec=${codec} |
| 57 --buf-initial-sz=500 | 68 --buf-initial-sz=500 |
| 58 --buf-optimal-sz=600 | 69 --buf-optimal-sz=600 |
| 59 --buf-sz=1000 | 70 --buf-sz=1000 |
| 60 --cpu-used=-5 | 71 --cpu-used=-5 |
| 61 --end-usage=cbr | 72 --end-usage=cbr |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 --passes=2 \ | 324 --passes=2 \ |
| 314 --auto-alt-ref=1 | 325 --auto-alt-ref=1 |
| 315 | 326 |
| 316 if [ ! -e "${output}" ]; then | 327 if [ ! -e "${output}" ]; then |
| 317 elog "Output file does not exist." | 328 elog "Output file does not exist." |
| 318 return 1 | 329 return 1 |
| 319 fi | 330 fi |
| 320 fi | 331 fi |
| 321 } | 332 } |
| 322 | 333 |
| 334 # TODO(fgalligan): Test that DisplayWidth is different than video width. |
| 335 vpxenc_vp9_webm_non_square_par() { |
| 336 if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ |
| 337 [ "$(webm_io_available)" = "yes" ]; then |
| 338 local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_non_square_par.webm" |
| 339 vpxenc $(y4m_input_non_square_par) \ |
| 340 --codec=vp9 \ |
| 341 --limit="${TEST_FRAMES}" \ |
| 342 --output="${output}" |
| 343 |
| 344 if [ ! -e "${output}" ]; then |
| 345 elog "Output file does not exist." |
| 346 return 1 |
| 347 fi |
| 348 fi |
| 349 } |
| 350 |
| 323 vpxenc_tests="vpxenc_vp8_ivf | 351 vpxenc_tests="vpxenc_vp8_ivf |
| 324 vpxenc_vp8_webm | 352 vpxenc_vp8_webm |
| 325 vpxenc_vp8_webm_rt | 353 vpxenc_vp8_webm_rt |
| 326 vpxenc_vp8_webm_2pass | 354 vpxenc_vp8_webm_2pass |
| 327 vpxenc_vp8_webm_lag10_frames20 | 355 vpxenc_vp8_webm_lag10_frames20 |
| 328 vpxenc_vp8_ivf_piped_input | 356 vpxenc_vp8_ivf_piped_input |
| 329 vpxenc_vp9_ivf | 357 vpxenc_vp9_ivf |
| 330 vpxenc_vp9_webm | 358 vpxenc_vp9_webm |
| 331 vpxenc_vp9_webm_rt | 359 vpxenc_vp9_webm_rt |
| 332 vpxenc_vp9_webm_2pass | 360 vpxenc_vp9_webm_2pass |
| 333 vpxenc_vp9_ivf_lossless | 361 vpxenc_vp9_ivf_lossless |
| 334 vpxenc_vp9_ivf_minq0_maxq0 | 362 vpxenc_vp9_ivf_minq0_maxq0 |
| 335 vpxenc_vp9_webm_lag10_frames20" | 363 vpxenc_vp9_webm_lag10_frames20 |
| 364 vpxenc_vp9_webm_non_square_par" |
| 336 | 365 |
| 337 run_tests vpxenc_verify_environment "${vpxenc_tests}" | 366 run_tests vpxenc_verify_environment "${vpxenc_tests}" |
| OLD | NEW |