Commit 9a74bb68 authored by Tom Finegan's avatar Tom Finegan

Update aomenc shell tests.

- Make them faster by setting cpu-used to 1.
- Drop unused cruft and redundant args to aomenc.
- Add some shell util functions for producing "fast" encode
  settings and frame count limits while ensuring lag-in-frames
  is sane for the given limit.

Change-Id: I61288f9f120201decb25fdfe9516b75d84cfb2ee
parent 8a3d9cf8
......@@ -15,8 +15,6 @@
##
. $(dirname $0)/tools_common.sh
readonly TEST_FRAMES=5
# Environment check: Make sure input is available.
aomenc_verify_environment() {
if [ ! -e "${YUV_RAW_INPUT}" ]; then
......@@ -57,32 +55,6 @@ y4m_input_720p() {
echo ""${Y4M_720P_INPUT}""
}
# Echo default aomenc real time encoding params. $1 is the codec, which defaults
# to av1 if unspecified.
aomenc_rt_params() {
local readonly codec="${1:-av1}"
echo "--codec=${codec}
--buf-initial-sz=500
--buf-optimal-sz=600
--buf-sz=1000
--cpu-used=-6
--end-usage=cbr
--error-resilient=1
--kf-max-dist=90000
--lag-in-frames=0
--max-intra-rate=300
--max-q=56
--min-q=2
--noise-sensitivity=0
--overshoot-pct=50
--passes=1
--profile=0
--resize-allowed=0
--rt
--static-thresh=0
--undershoot-pct=50"
}
# Wrapper function for running aomenc with pipe input. Requires that
# LIBAOM_BIN_PATH points to the directory containing aomenc. $1 is used as the
# input file path and shifted away. All remaining parameters are passed through
......@@ -112,8 +84,8 @@ aomenc_av1_ivf() {
if [ "$(aomenc_can_encode_av1)" = "yes" ]; then
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1.ivf"
aomenc $(yuv_raw_input) \
--codec=av1 \
--limit="${TEST_FRAMES}" \
$(aomenc_encode_test_fast_params) \
--passes=1 \
--ivf \
--output="${output}"
......@@ -130,7 +102,8 @@ aomenc_av1_webm() {
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1.webm"
aomenc $(yuv_raw_input) \
--codec=av1 \
--limit="${TEST_FRAMES}" \
$(aomenc_encode_test_fast_params) \
--passes=1 \
--output="${output}"
if [ ! -e "${output}" ]; then
......@@ -145,10 +118,9 @@ aomenc_av1_webm_2pass() {
[ "$(webm_io_available)" = "yes" ]; then
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1.webm"
aomenc $(yuv_raw_input) \
--codec=av1 \
--limit="${TEST_FRAMES}" \
--output="${output}" \
--passes=2
$(aomenc_encode_test_fast_params) \
--passes=2 \
--output="${output}"
if [ ! -e "${output}" ]; then
elog "Output file does not exist."
......@@ -161,8 +133,7 @@ aomenc_av1_ivf_lossless() {
if [ "$(aomenc_can_encode_av1)" = "yes" ]; then
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1_lossless.ivf"
aomenc $(yuv_raw_input) \
--codec=av1 \
--limit="${TEST_FRAMES}" \
$(aomenc_encode_test_fast_params) \
--ivf \
--output="${output}" \
--lossless=1
......@@ -178,8 +149,7 @@ aomenc_av1_ivf_minq0_maxq0() {
if [ "$(aomenc_can_encode_av1)" = "yes" ]; then
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1_lossless_minq0_maxq0.ivf"
aomenc $(yuv_raw_input) \
--codec=av1 \
--limit="${TEST_FRAMES}" \
$(aomenc_encode_test_fast_params) \
--ivf \
--output="${output}" \
--min-q=0 \
......@@ -199,12 +169,11 @@ aomenc_av1_webm_lag5_frames10() {
local readonly lag_frames=5
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1_lag5_frames10.webm"
aomenc $(yuv_raw_input) \
--codec=av1 \
--limit="${lag_total_frames}" \
--lag-in-frames="${lag_frames}" \
$(aomenc_encode_test_fast_params) \
--limit=${lag_total_frames} \
--lag-in-frames=${lag_frames} \
--output="${output}" \
--passes=2 \
--auto-alt-ref=1
--passes=2
if [ ! -e "${output}" ]; then
elog "Output file does not exist."
......@@ -219,8 +188,7 @@ aomenc_av1_webm_non_square_par() {
[ "$(webm_io_available)" = "yes" ]; then
local readonly output="${AOM_TEST_OUTPUT_DIR}/av1_non_square_par.webm"
aomenc $(y4m_input_non_square_par) \
--codec=av1 \
--limit="${TEST_FRAMES}" \
$(aomenc_encode_test_fast_params) \
--output="${output}"
if [ ! -e "${output}" ]; then
......
......@@ -17,6 +17,7 @@ AOM_TEST_TOOLS_COMMON_SH=included
set -e
devnull='> /dev/null 2>&1'
AOM_TEST_PREFIX=""
readonly AOM_ENCODE_TEST_FRAME_LIMIT=5
elog() {
echo "$@" 1>&2
......@@ -212,6 +213,14 @@ av1_encode_available() {
[ "$(aom_config_option_enabled CONFIG_AV1_ENCODER)" = "yes" ] && echo yes
}
# Echoes "fast" encode params for use with aomenc.
aomenc_encode_test_fast_params() {
echo "--cpu-used=1
--limit=${AOM_ENCODE_TEST_FRAME_LIMIT}
--lag-in-frames=0
--test-decode=fatal"
}
# Echoes yes to stdout when aom_config_option_enabled() reports yes for
# CONFIG_WEBM_IO.
webm_io_available() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment