diff options
-rwxr-xr-x | build/make/iosbuild.sh | 2 | ||||
-rwxr-xr-x | test/stress.sh | 16 | ||||
-rwxr-xr-x | test/tools_common.sh | 2 | ||||
-rwxr-xr-x | test/vp8_multi_resolution_encoder.sh | 18 | ||||
-rwxr-xr-x | test/vpx_temporal_svc_encoder.sh | 48 | ||||
-rwxr-xr-x | test/vpxdec.sh | 22 | ||||
-rwxr-xr-x | test/vpxenc.sh | 78 | ||||
-rw-r--r-- | vp9/encoder/vp9_aq_cyclicrefresh.c | 7 | ||||
-rw-r--r-- | vp9/encoder/vp9_aq_cyclicrefresh.h | 1 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 21 | ||||
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 15 | ||||
-rw-r--r-- | vp9/encoder/vp9_ratectrl.c | 1 | ||||
-rw-r--r-- | vp9/encoder/vp9_speed_features.c | 4 | ||||
-rw-r--r-- | vpx_dsp/arm/sum_squares_neon.c | 2 |
14 files changed, 135 insertions, 102 deletions
diff --git a/build/make/iosbuild.sh b/build/make/iosbuild.sh index 2442a282d..978ffbbb9 100755 --- a/build/make/iosbuild.sh +++ b/build/make/iosbuild.sh @@ -245,7 +245,7 @@ build_framework() { # Trap function. Cleans up the subtree used to build all targets contained in # $TARGETS. cleanup() { - local readonly res=$? + local res=$? cd "${ORIG_PWD}" if [ $res -ne 0 ]; then diff --git a/test/stress.sh b/test/stress.sh index a899c800c..ced9d3f98 100755 --- a/test/stress.sh +++ b/test/stress.sh @@ -30,7 +30,7 @@ SHA1_FILE="$(dirname $0)/test-data.sha1" # Download a file from the url and check its sha1sum. download_and_check_file() { # Get the file from the file path. - local readonly root="${1#${LIBVPX_TEST_DATA_PATH}/}" + local root="${1#${LIBVPX_TEST_DATA_PATH}/}" # Download the file using curl. Trap to insure non partial file. (trap "rm -f $1" INT TERM \ @@ -72,13 +72,13 @@ stress_verify_environment() { # This function runs tests on libvpx that run multiple encodes and decodes # in parallel in hopes of catching synchronization and/or threading issues. stress() { - local readonly decoder="$(vpx_tool_path vpxdec)" - local readonly encoder="$(vpx_tool_path vpxenc)" - local readonly codec="$1" - local readonly webm="$2" - local readonly decode_count="$3" - local readonly threads="$4" - local readonly enc_args="$5" + local decoder="$(vpx_tool_path vpxdec)" + local encoder="$(vpx_tool_path vpxenc)" + local codec="$1" + local webm="$2" + local decode_count="$3" + local threads="$4" + local enc_args="$5" local pids="" local rt_max_jobs=${STRESS_RT_MAX_JOBS:-5} local onepass_max_jobs=${STRESS_ONEPASS_MAX_JOBS:-5} diff --git a/test/tools_common.sh b/test/tools_common.sh index d39fa214a..7caad9f06 100755 --- a/test/tools_common.sh +++ b/test/tools_common.sh @@ -150,7 +150,7 @@ is_windows_target() { # empty string. Caller is responsible for testing the string once the function # returns. vpx_tool_path() { - local readonly tool_name="$1" + local tool_name="$1" local tool_path="${LIBVPX_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}" if [ ! -x "${tool_path}" ]; then # Try one directory up: when running via examples.sh the tool could be in diff --git a/test/vp8_multi_resolution_encoder.sh b/test/vp8_multi_resolution_encoder.sh index 33fd5b0d8..bd45b5381 100755 --- a/test/vp8_multi_resolution_encoder.sh +++ b/test/vp8_multi_resolution_encoder.sh @@ -22,7 +22,7 @@ vp8_multi_resolution_encoder_verify_environment() { elog "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH." return 1 fi - local readonly app="vp8_multi_resolution_encoder" + local app="vp8_multi_resolution_encoder" if [ -z "$(vpx_tool_path "${app}")" ]; then elog "${app} not found. It must exist in LIBVPX_BIN_PATH or its parent." return 1 @@ -33,7 +33,7 @@ vp8_multi_resolution_encoder_verify_environment() { # Runs vp8_multi_resolution_encoder. Simply forwards all arguments to # vp8_multi_resolution_encoder after building path to the executable. vp8_mre() { - local readonly encoder="$(vpx_tool_path vp8_multi_resolution_encoder)" + local encoder="$(vpx_tool_path vp8_multi_resolution_encoder)" if [ ! -x "${encoder}" ]; then elog "${encoder} does not exist or is not executable." return 1 @@ -43,13 +43,13 @@ vp8_mre() { } vp8_multi_resolution_encoder_three_formats() { - local readonly output_files="${VPX_TEST_OUTPUT_DIR}/vp8_mre_0.ivf - ${VPX_TEST_OUTPUT_DIR}/vp8_mre_1.ivf - ${VPX_TEST_OUTPUT_DIR}/vp8_mre_2.ivf" - local readonly layer_bitrates="150 80 50" - local readonly keyframe_insert="200" - local readonly temporal_layers="3 3 3" - local readonly framerate="30" + local output_files="${VPX_TEST_OUTPUT_DIR}/vp8_mre_0.ivf + ${VPX_TEST_OUTPUT_DIR}/vp8_mre_1.ivf + ${VPX_TEST_OUTPUT_DIR}/vp8_mre_2.ivf" + local layer_bitrates="150 80 50" + local keyframe_insert="200" + local temporal_layers="3 3 3" + local framerate="30" if [ "$(vpx_config_option_enabled CONFIG_MULTI_RES_ENCODING)" = "yes" ]; then if [ "$(vp8_encode_available)" = "yes" ]; then diff --git a/test/vpx_temporal_svc_encoder.sh b/test/vpx_temporal_svc_encoder.sh index 56a7902f4..fd1045e7f 100755 --- a/test/vpx_temporal_svc_encoder.sh +++ b/test/vpx_temporal_svc_encoder.sh @@ -85,7 +85,7 @@ files_exist() { vpx_tsvc_encoder_vp8_mode_0() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_0" + local output_basename="vpx_tsvc_encoder_vp8_mode_0" vpx_tsvc_encoder vp8 "${output_basename}" 0 200 || return 1 # Mode 0 produces 1 stream files_exist "${output_basename}" 1 || return 1 @@ -94,7 +94,7 @@ vpx_tsvc_encoder_vp8_mode_0() { vpx_tsvc_encoder_vp8_mode_1() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_1" + local output_basename="vpx_tsvc_encoder_vp8_mode_1" vpx_tsvc_encoder vp8 "${output_basename}" 1 200 400 || return 1 # Mode 1 produces 2 streams files_exist "${output_basename}" 2 || return 1 @@ -103,7 +103,7 @@ vpx_tsvc_encoder_vp8_mode_1() { vpx_tsvc_encoder_vp8_mode_2() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_2" + local output_basename="vpx_tsvc_encoder_vp8_mode_2" vpx_tsvc_encoder vp8 "${output_basename}" 2 200 400 || return 1 # Mode 2 produces 2 streams files_exist "${output_basename}" 2 || return 1 @@ -112,7 +112,7 @@ vpx_tsvc_encoder_vp8_mode_2() { vpx_tsvc_encoder_vp8_mode_3() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_3" + local output_basename="vpx_tsvc_encoder_vp8_mode_3" vpx_tsvc_encoder vp8 "${output_basename}" 3 200 400 600 || return 1 # Mode 3 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -121,7 +121,7 @@ vpx_tsvc_encoder_vp8_mode_3() { vpx_tsvc_encoder_vp8_mode_4() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_4" + local output_basename="vpx_tsvc_encoder_vp8_mode_4" vpx_tsvc_encoder vp8 "${output_basename}" 4 200 400 600 || return 1 # Mode 4 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -130,7 +130,7 @@ vpx_tsvc_encoder_vp8_mode_4() { vpx_tsvc_encoder_vp8_mode_5() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_5" + local output_basename="vpx_tsvc_encoder_vp8_mode_5" vpx_tsvc_encoder vp8 "${output_basename}" 5 200 400 600 || return 1 # Mode 5 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -139,7 +139,7 @@ vpx_tsvc_encoder_vp8_mode_5() { vpx_tsvc_encoder_vp8_mode_6() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_6" + local output_basename="vpx_tsvc_encoder_vp8_mode_6" vpx_tsvc_encoder vp8 "${output_basename}" 6 200 400 600 || return 1 # Mode 6 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -148,7 +148,7 @@ vpx_tsvc_encoder_vp8_mode_6() { vpx_tsvc_encoder_vp8_mode_7() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_7" + local output_basename="vpx_tsvc_encoder_vp8_mode_7" vpx_tsvc_encoder vp8 "${output_basename}" 7 200 400 600 800 1000 || return 1 # Mode 7 produces 5 streams files_exist "${output_basename}" 5 || return 1 @@ -157,7 +157,7 @@ vpx_tsvc_encoder_vp8_mode_7() { vpx_tsvc_encoder_vp8_mode_8() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_8" + local output_basename="vpx_tsvc_encoder_vp8_mode_8" vpx_tsvc_encoder vp8 "${output_basename}" 8 200 400 || return 1 # Mode 8 produces 2 streams files_exist "${output_basename}" 2 || return 1 @@ -166,7 +166,7 @@ vpx_tsvc_encoder_vp8_mode_8() { vpx_tsvc_encoder_vp8_mode_9() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_9" + local output_basename="vpx_tsvc_encoder_vp8_mode_9" vpx_tsvc_encoder vp8 "${output_basename}" 9 200 400 600 || return 1 # Mode 9 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -175,7 +175,7 @@ vpx_tsvc_encoder_vp8_mode_9() { vpx_tsvc_encoder_vp8_mode_10() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_10" + local output_basename="vpx_tsvc_encoder_vp8_mode_10" vpx_tsvc_encoder vp8 "${output_basename}" 10 200 400 600 || return 1 # Mode 10 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -184,7 +184,7 @@ vpx_tsvc_encoder_vp8_mode_10() { vpx_tsvc_encoder_vp8_mode_11() { if [ "$(vp8_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp8_mode_11" + local output_basename="vpx_tsvc_encoder_vp8_mode_11" vpx_tsvc_encoder vp8 "${output_basename}" 11 200 400 600 || return 1 # Mode 11 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -193,7 +193,7 @@ vpx_tsvc_encoder_vp8_mode_11() { vpx_tsvc_encoder_vp9_mode_0() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_0" + local output_basename="vpx_tsvc_encoder_vp9_mode_0" vpx_tsvc_encoder vp9 "${output_basename}" 0 200 || return 1 # Mode 0 produces 1 stream files_exist "${output_basename}" 1 || return 1 @@ -202,7 +202,7 @@ vpx_tsvc_encoder_vp9_mode_0() { vpx_tsvc_encoder_vp9_mode_1() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_1" + local output_basename="vpx_tsvc_encoder_vp9_mode_1" vpx_tsvc_encoder vp9 "${output_basename}" 1 200 400 || return 1 # Mode 1 produces 2 streams files_exist "${output_basename}" 2 || return 1 @@ -211,7 +211,7 @@ vpx_tsvc_encoder_vp9_mode_1() { vpx_tsvc_encoder_vp9_mode_2() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_2" + local output_basename="vpx_tsvc_encoder_vp9_mode_2" vpx_tsvc_encoder vp9 "${output_basename}" 2 200 400 || return 1 # Mode 2 produces 2 streams files_exist "${output_basename}" 2 || return 1 @@ -220,7 +220,7 @@ vpx_tsvc_encoder_vp9_mode_2() { vpx_tsvc_encoder_vp9_mode_3() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_3" + local output_basename="vpx_tsvc_encoder_vp9_mode_3" vpx_tsvc_encoder vp9 "${output_basename}" 3 200 400 600 || return 1 # Mode 3 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -229,7 +229,7 @@ vpx_tsvc_encoder_vp9_mode_3() { vpx_tsvc_encoder_vp9_mode_4() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_4" + local output_basename="vpx_tsvc_encoder_vp9_mode_4" vpx_tsvc_encoder vp9 "${output_basename}" 4 200 400 600 || return 1 # Mode 4 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -238,7 +238,7 @@ vpx_tsvc_encoder_vp9_mode_4() { vpx_tsvc_encoder_vp9_mode_5() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_5" + local output_basename="vpx_tsvc_encoder_vp9_mode_5" vpx_tsvc_encoder vp9 "${output_basename}" 5 200 400 600 || return 1 # Mode 5 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -247,7 +247,7 @@ vpx_tsvc_encoder_vp9_mode_5() { vpx_tsvc_encoder_vp9_mode_6() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_6" + local output_basename="vpx_tsvc_encoder_vp9_mode_6" vpx_tsvc_encoder vp9 "${output_basename}" 6 200 400 600 || return 1 # Mode 6 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -256,7 +256,7 @@ vpx_tsvc_encoder_vp9_mode_6() { vpx_tsvc_encoder_vp9_mode_7() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_7" + local output_basename="vpx_tsvc_encoder_vp9_mode_7" vpx_tsvc_encoder vp9 "${output_basename}" 7 200 400 600 800 1000 || return 1 # Mode 7 produces 5 streams files_exist "${output_basename}" 5 || return 1 @@ -265,7 +265,7 @@ vpx_tsvc_encoder_vp9_mode_7() { vpx_tsvc_encoder_vp9_mode_8() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_8" + local output_basename="vpx_tsvc_encoder_vp9_mode_8" vpx_tsvc_encoder vp9 "${output_basename}" 8 200 400 || return 1 # Mode 8 produces 2 streams files_exist "${output_basename}" 2 || return 1 @@ -274,7 +274,7 @@ vpx_tsvc_encoder_vp9_mode_8() { vpx_tsvc_encoder_vp9_mode_9() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_9" + local output_basename="vpx_tsvc_encoder_vp9_mode_9" vpx_tsvc_encoder vp9 "${output_basename}" 9 200 400 600 || return 1 # Mode 9 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -283,7 +283,7 @@ vpx_tsvc_encoder_vp9_mode_9() { vpx_tsvc_encoder_vp9_mode_10() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_10" + local output_basename="vpx_tsvc_encoder_vp9_mode_10" vpx_tsvc_encoder vp9 "${output_basename}" 10 200 400 600 || return 1 # Mode 10 produces 3 streams files_exist "${output_basename}" 3 || return 1 @@ -292,7 +292,7 @@ vpx_tsvc_encoder_vp9_mode_10() { vpx_tsvc_encoder_vp9_mode_11() { if [ "$(vp9_encode_available)" = "yes" ]; then - local readonly output_basename="vpx_tsvc_encoder_vp9_mode_11" + local output_basename="vpx_tsvc_encoder_vp9_mode_11" vpx_tsvc_encoder vp9 "${output_basename}" 11 200 400 600 || return 1 # Mode 11 produces 3 streams files_exist "${output_basename}" 3 || return 1 diff --git a/test/vpxdec.sh b/test/vpxdec.sh index bdb9d12c9..044aa7e16 100755 --- a/test/vpxdec.sh +++ b/test/vpxdec.sh @@ -34,8 +34,8 @@ vpxdec_verify_environment() { # input file path and shifted away. All remaining parameters are passed through # to vpxdec. vpxdec_pipe() { - local readonly decoder="$(vpx_tool_path vpxdec)" - local readonly input="$1" + local decoder="$(vpx_tool_path vpxdec)" + local input="$1" shift cat "${input}" | eval "${VPX_TEST_PREFIX}" "${decoder}" - "$@" ${devnull} } @@ -44,8 +44,8 @@ vpxdec_pipe() { # the directory containing vpxdec. $1 one is used as the input file path and # shifted away. All remaining parameters are passed through to vpxdec. vpxdec() { - local readonly decoder="$(vpx_tool_path vpxdec)" - local readonly input="$1" + local decoder="$(vpx_tool_path vpxdec)" + local input="$1" shift eval "${VPX_TEST_PREFIX}" "${decoder}" "$input" "$@" ${devnull} } @@ -96,9 +96,9 @@ vpxdec_vp9_webm_less_than_50_frames() { # frames in actual webm_read_frame calls. if [ "$(vpxdec_can_decode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly decoder="$(vpx_tool_path vpxdec)" - local readonly expected=10 - local readonly num_frames=$(${VPX_TEST_PREFIX} "${decoder}" \ + local decoder="$(vpx_tool_path vpxdec)" + local expected=10 + local num_frames=$(${VPX_TEST_PREFIX} "${decoder}" \ "${VP9_LT_50_FRAMES_WEBM_FILE}" --summary --noblit 2>&1 \ | awk '/^[0-9]+ decoded frames/ { print $1 }') if [ "$num_frames" -ne "$expected" ]; then @@ -112,10 +112,10 @@ vpxdec_vp9_webm_less_than_50_frames() { vpxdec_vp9_raw_file() { # Ensure a raw file properly reports eof and doesn't cause a hang. if [ "$(vpxdec_can_decode_vp9)" = "yes" ]; then - local readonly decoder="$(vpx_tool_path vpxdec)" - local readonly expected=1 - [ -x /usr/bin/timeout ] && local readonly TIMEOUT="/usr/bin/timeout 30s" - local readonly num_frames=$(${TIMEOUT} ${VPX_TEST_PREFIX} "${decoder}" \ + local decoder="$(vpx_tool_path vpxdec)" + local expected=1 + [ -x /usr/bin/timeout ] && local TIMEOUT="/usr/bin/timeout 30s" + local num_frames=$(${TIMEOUT} ${VPX_TEST_PREFIX} "${decoder}" \ "${VP9_RAW_FILE}" --summary --noblit 2>&1 \ | awk '/^[0-9]+ decoded frames/ { print $1 }') if [ -z "$num_frames" ] || [ "$num_frames" -ne "$expected" ]; then diff --git a/test/vpxenc.sh b/test/vpxenc.sh index 0c160dafc..45104d7ea 100755 --- a/test/vpxenc.sh +++ b/test/vpxenc.sh @@ -67,7 +67,7 @@ y4m_input_720p() { # Echo default vpxenc real time encoding params. $1 is the codec, which defaults # to vp8 if unspecified. vpxenc_rt_params() { - local readonly codec="${1:-vp8}" + local codec="${1:-vp8}" echo "--codec=${codec} --buf-initial-sz=500 --buf-optimal-sz=600 @@ -104,8 +104,8 @@ vpxenc_passes_param() { # input file path and shifted away. All remaining parameters are passed through # to vpxenc. vpxenc_pipe() { - local readonly encoder="$(vpx_tool_path vpxenc)" - local readonly input="$1" + local encoder="$(vpx_tool_path vpxenc)" + local input="$1" shift cat "${input}" | eval "${VPX_TEST_PREFIX}" "${encoder}" - \ --test-decode=fatal \ @@ -116,8 +116,8 @@ vpxenc_pipe() { # the directory containing vpxenc. $1 one is used as the input file path and # shifted away. All remaining parameters are passed through to vpxenc. vpxenc() { - local readonly encoder="$(vpx_tool_path vpxenc)" - local readonly input="$1" + local encoder="$(vpx_tool_path vpxenc)" + local input="$1" shift eval "${VPX_TEST_PREFIX}" "${encoder}" "${input}" \ --test-decode=fatal \ @@ -126,7 +126,7 @@ vpxenc() { vpxenc_vp8_ivf() { if [ "$(vpxenc_can_encode_vp8)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp8.ivf" + local output="${VPX_TEST_OUTPUT_DIR}/vp8.ivf" vpxenc $(yuv_input_hantro_collage) \ --codec=vp8 \ --limit="${TEST_FRAMES}" \ @@ -143,7 +143,7 @@ vpxenc_vp8_ivf() { vpxenc_vp8_webm() { if [ "$(vpxenc_can_encode_vp8)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp8.webm" + local output="${VPX_TEST_OUTPUT_DIR}/vp8.webm" vpxenc $(yuv_input_hantro_collage) \ --codec=vp8 \ --limit="${TEST_FRAMES}" \ @@ -159,7 +159,7 @@ vpxenc_vp8_webm() { vpxenc_vp8_webm_rt() { if [ "$(vpxenc_can_encode_vp8)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp8_rt.webm" + local output="${VPX_TEST_OUTPUT_DIR}/vp8_rt.webm" vpxenc $(yuv_input_hantro_collage) \ $(vpxenc_rt_params vp8) \ --output="${output}" @@ -173,7 +173,7 @@ vpxenc_vp8_webm_rt() { vpxenc_vp8_webm_2pass() { if [ "$(vpxenc_can_encode_vp8)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp8.webm" + local output="${VPX_TEST_OUTPUT_DIR}/vp8.webm" vpxenc $(yuv_input_hantro_collage) \ --codec=vp8 \ --limit="${TEST_FRAMES}" \ @@ -190,9 +190,9 @@ vpxenc_vp8_webm_2pass() { vpxenc_vp8_webm_lag10_frames20() { if [ "$(vpxenc_can_encode_vp8)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly lag_total_frames=20 - local readonly lag_frames=10 - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp8_lag10_frames20.webm" + local lag_total_frames=20 + local lag_frames=10 + local output="${VPX_TEST_OUTPUT_DIR}/vp8_lag10_frames20.webm" vpxenc $(yuv_input_hantro_collage) \ --codec=vp8 \ --limit="${lag_total_frames}" \ @@ -210,7 +210,7 @@ vpxenc_vp8_webm_lag10_frames20() { vpxenc_vp8_ivf_piped_input() { if [ "$(vpxenc_can_encode_vp8)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp8_piped_input.ivf" + local output="${VPX_TEST_OUTPUT_DIR}/vp8_piped_input.ivf" vpxenc_pipe $(yuv_input_hantro_collage) \ --codec=vp8 \ --limit="${TEST_FRAMES}" \ @@ -226,8 +226,8 @@ vpxenc_vp8_ivf_piped_input() { vpxenc_vp9_ivf() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9.ivf" - local readonly passes=$(vpxenc_passes_param) + local output="${VPX_TEST_OUTPUT_DIR}/vp9.ivf" + local passes=$(vpxenc_passes_param) vpxenc $(yuv_input_hantro_collage) \ --codec=vp9 \ --limit="${TEST_FRAMES}" \ @@ -245,8 +245,8 @@ vpxenc_vp9_ivf() { vpxenc_vp9_webm() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9.webm" - local readonly passes=$(vpxenc_passes_param) + local output="${VPX_TEST_OUTPUT_DIR}/vp9.webm" + local passes=$(vpxenc_passes_param) vpxenc $(yuv_input_hantro_collage) \ --codec=vp9 \ --limit="${TEST_FRAMES}" \ @@ -263,7 +263,7 @@ vpxenc_vp9_webm() { vpxenc_vp9_webm_rt() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_rt.webm" + local output="${VPX_TEST_OUTPUT_DIR}/vp9_rt.webm" vpxenc $(yuv_input_hantro_collage) \ $(vpxenc_rt_params vp9) \ --output="${output}" @@ -278,11 +278,11 @@ vpxenc_vp9_webm_rt() { vpxenc_vp9_webm_rt_multithread_tiled() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_rt_multithread_tiled.webm" - local readonly tilethread_min=2 - local readonly tilethread_max=4 - local readonly num_threads="$(seq ${tilethread_min} ${tilethread_max})" - local readonly num_tile_cols="$(seq ${tilethread_min} ${tilethread_max})" + local output="${VPX_TEST_OUTPUT_DIR}/vp9_rt_multithread_tiled.webm" + local tilethread_min=2 + local tilethread_max=4 + local num_threads="$(seq ${tilethread_min} ${tilethread_max})" + local num_tile_cols="$(seq ${tilethread_min} ${tilethread_max})" for threads in ${num_threads}; do for tile_cols in ${num_tile_cols}; do @@ -306,11 +306,11 @@ vpxenc_vp9_webm_rt_multithread_tiled() { vpxenc_vp9_webm_rt_multithread_tiled_frameparallel() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_rt_mt_t_fp.webm" - local readonly tilethread_min=2 - local readonly tilethread_max=4 - local readonly num_threads="$(seq ${tilethread_min} ${tilethread_max})" - local readonly num_tile_cols="$(seq ${tilethread_min} ${tilethread_max})" + local output="${VPX_TEST_OUTPUT_DIR}/vp9_rt_mt_t_fp.webm" + local tilethread_min=2 + local tilethread_max=4 + local num_threads="$(seq ${tilethread_min} ${tilethread_max})" + local num_tile_cols="$(seq ${tilethread_min} ${tilethread_max})" for threads in ${num_threads}; do for tile_cols in ${num_tile_cols}; do @@ -335,7 +335,7 @@ vpxenc_vp9_webm_rt_multithread_tiled_frameparallel() { vpxenc_vp9_webm_2pass() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9.webm" + local output="${VPX_TEST_OUTPUT_DIR}/vp9.webm" vpxenc $(yuv_input_hantro_collage) \ --codec=vp9 \ --limit="${TEST_FRAMES}" \ @@ -351,8 +351,8 @@ vpxenc_vp9_webm_2pass() { vpxenc_vp9_ivf_lossless() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_lossless.ivf" - local readonly passes=$(vpxenc_passes_param) + local output="${VPX_TEST_OUTPUT_DIR}/vp9_lossless.ivf" + local passes=$(vpxenc_passes_param) vpxenc $(yuv_input_hantro_collage) \ --codec=vp9 \ --limit="${TEST_FRAMES}" \ @@ -370,8 +370,8 @@ vpxenc_vp9_ivf_lossless() { vpxenc_vp9_ivf_minq0_maxq0() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_lossless_minq0_maxq0.ivf" - local readonly passes=$(vpxenc_passes_param) + local output="${VPX_TEST_OUTPUT_DIR}/vp9_lossless_minq0_maxq0.ivf" + local passes=$(vpxenc_passes_param) vpxenc $(yuv_input_hantro_collage) \ --codec=vp9 \ --limit="${TEST_FRAMES}" \ @@ -391,10 +391,10 @@ vpxenc_vp9_ivf_minq0_maxq0() { vpxenc_vp9_webm_lag10_frames20() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly lag_total_frames=20 - local readonly lag_frames=10 - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_lag10_frames20.webm" - local readonly passes=$(vpxenc_passes_param) + local lag_total_frames=20 + local lag_frames=10 + local output="${VPX_TEST_OUTPUT_DIR}/vp9_lag10_frames20.webm" + local passes=$(vpxenc_passes_param) vpxenc $(yuv_input_hantro_collage) \ --codec=vp9 \ --limit="${lag_total_frames}" \ @@ -414,8 +414,8 @@ vpxenc_vp9_webm_lag10_frames20() { vpxenc_vp9_webm_non_square_par() { if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \ [ "$(webm_io_available)" = "yes" ]; then - local readonly output="${VPX_TEST_OUTPUT_DIR}/vp9_non_square_par.webm" - local readonly passes=$(vpxenc_passes_param) + local output="${VPX_TEST_OUTPUT_DIR}/vp9_non_square_par.webm" + local passes=$(vpxenc_passes_param) vpxenc $(y4m_input_non_square_par) \ --codec=vp9 \ --limit="${TEST_FRAMES}" \ diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c index 6fcc782c4..f291a0dd5 100644 --- a/vp9/encoder/vp9_aq_cyclicrefresh.c +++ b/vp9/encoder/vp9_aq_cyclicrefresh.c @@ -39,6 +39,7 @@ CYCLIC_REFRESH *vp9_cyclic_refresh_alloc(int mi_rows, int mi_cols) { } assert(MAXQ <= 255); memset(cr->last_coded_q_map, MAXQ, last_coded_q_map_size); + cr->counter_encode_maxq_scene_change = 0; return cr; } @@ -466,6 +467,9 @@ void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) { // TODO(marpan): Consider increasing refresh rate after slide change. if (cpi->oxcf.content == VP9E_CONTENT_SCREEN) { cr->percent_refresh = 10; + // Increase the amount of refresh on scene change that is encoded at max Q, + // increase for a few cycles of the refresh period (~30 frames). + if (cr->counter_encode_maxq_scene_change < 30) cr->percent_refresh = 15; cr->rate_ratio_qdelta = 2.0; cr->rate_boost_fac = 10; } @@ -533,12 +537,14 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) { cm->mi_rows * cm->mi_cols * sizeof(*cr->last_coded_q_map)); cr->sb_index = 0; cr->reduce_refresh = 0; + cr->counter_encode_maxq_scene_change = 0; } return; } else { int qindex_delta = 0; int qindex2; const double q = vp9_convert_qindex_to_q(cm->base_qindex, cm->bit_depth); + cr->counter_encode_maxq_scene_change++; vpx_clear_system_state(); // Set rate threshold to some multiple (set to 2 for now) of the target // rate (target is given by sb64_target_rate and scaled by 256). @@ -606,6 +612,7 @@ void vp9_cyclic_refresh_reset_resize(VP9_COMP *const cpi) { cr->sb_index = 0; cpi->refresh_golden_frame = 1; cpi->refresh_alt_ref_frame = 1; + cr->counter_encode_maxq_scene_change = 0; } void vp9_cyclic_refresh_limit_q(const VP9_COMP *cpi, int *q) { diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.h b/vp9/encoder/vp9_aq_cyclicrefresh.h index f59f193f6..50789e87c 100644 --- a/vp9/encoder/vp9_aq_cyclicrefresh.h +++ b/vp9/encoder/vp9_aq_cyclicrefresh.h @@ -68,6 +68,7 @@ struct CYCLIC_REFRESH { int reduce_refresh; double weight_segment; int apply_cyclic_refresh; + int counter_encode_maxq_scene_change; }; struct VP9_COMP; diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index d8f628aa2..8f622d0ed 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1958,10 +1958,10 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data, if (cyclic_refresh_segment_id_boosted( get_segment_id(cm, map, bsize, mi_row, mi_col))) x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); + } else { + if (cpi->sf.enable_tpl_model) x->rdmult = x->cb_rdmult; } - if (cpi->sf.enable_tpl_model) x->rdmult = x->cb_rdmult; - // Find best coding mode & reconstruct the MB so it is available // as a predictor for MBs that follow in the SB if (frame_is_intra_only(cm)) { @@ -2122,7 +2122,10 @@ static void encode_b(VP9_COMP *cpi, const TileInfo *const tile, ThreadData *td, PICK_MODE_CONTEXT *ctx) { MACROBLOCK *const x = &td->mb; set_offsets(cpi, tile, x, mi_row, mi_col, bsize); - if (cpi->sf.enable_tpl_model) x->rdmult = x->cb_rdmult; + + if (cpi->sf.enable_tpl_model && cpi->oxcf.aq_mode == NO_AQ) + x->rdmult = x->cb_rdmult; + update_state(cpi, td, ctx, mi_row, mi_col, bsize, output_enabled); encode_superblock(cpi, td, tp, output_enabled, mi_row, mi_col, bsize, ctx); @@ -3633,8 +3636,6 @@ int get_rdmult_delta(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row, int mi_col, if (cpi->common.show_frame) return orig_rdmult; - r0 = cpi->rd.r0; - for (row = mi_row; row < mi_row + mi_high; ++row) { for (col = mi_col; col < mi_col + mi_wide; ++col) { TplDepStats *this_stats = &tpl_stats[row * tpl_stride + col]; @@ -3648,6 +3649,9 @@ int get_rdmult_delta(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row, int mi_col, } } + vpx_clear_system_state(); + + r0 = cpi->rd.r0; rk = (double)intra_cost / mc_dep_cost; beta = r0 / rk; dr = vp9_get_adaptive_rdmult(cpi, beta); @@ -3656,6 +3660,7 @@ int get_rdmult_delta(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row, int mi_col, dr = VPXMAX(dr, orig_rdmult * 1 / 2); dr = VPXMAX(1, dr); + return dr; } @@ -3708,7 +3713,9 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, int rate_breakout_thr = cpi->sf.partition_search_breakout_thr.rate; int must_split = 0; - int partition_mul = cpi->sf.enable_tpl_model ? x->cb_rdmult : cpi->rd.RDMULT; + int partition_mul = cpi->sf.enable_tpl_model && cpi->oxcf.aq_mode == NO_AQ + ? x->cb_rdmult + : cpi->rd.RDMULT; (void)*tp_orig; @@ -5477,6 +5484,8 @@ static void encode_frame_internal(VP9_COMP *cpi) { } } + vpx_clear_system_state(); + if (tpl_frame->is_valid) cpi->rd.r0 = (double)intra_cost_base / mc_dep_cost_base; } diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index a0555edb5..5b8dae4a1 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -5731,6 +5731,16 @@ void get_quantize_error(MACROBLOCK *x, int plane, tran_low_t *coeff, *sse = VPXMAX(*sse, 1); } +void wht_fwd_txfm(int16_t *src_diff, int bw, tran_low_t *coeff, + TX_SIZE tx_size) { + switch (tx_size) { + case TX_8X8: vpx_hadamard_8x8(src_diff, bw, coeff); break; + case TX_16X16: vpx_hadamard_16x16(src_diff, bw, coeff); break; + case TX_32X32: vpx_hadamard_32x32(src_diff, bw, coeff); break; + default: assert(0); + } +} + void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture, int frame_idx) { TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx]; YV12_BUFFER_CONFIG *this_frame = gf_picture[frame_idx].frame; @@ -5760,6 +5770,7 @@ void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture, int frame_idx) { MODE_INFO mi_above, mi_left; const BLOCK_SIZE bsize = BLOCK_32X32; + const TX_SIZE tx_size = TX_32X32; const int bw = 4 << b_width_log2_lookup[bsize]; const int bh = 4 << b_height_log2_lookup[bsize]; const int mi_height = num_8x8_blocks_high_lookup[bsize]; @@ -5856,7 +5867,7 @@ void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture, int frame_idx) { vpx_subtract_block(bh, bw, src_diff, bw, src, src_stride, dst, dst_stride); - vpx_hadamard_32x32(src_diff, bw, coeff); + wht_fwd_txfm(src_diff, bw, coeff, tx_size); intra_cost = vpx_satd(coeff, pix_num); @@ -5913,7 +5924,7 @@ void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture, int frame_idx) { this_frame->y_buffer + mb_y_offset, this_frame->y_stride, &predictor[0], bw); #endif - vpx_hadamard_32x32(src_diff, bw, coeff); + wht_fwd_txfm(src_diff, bw, coeff, tx_size); inter_cost = vpx_satd(coeff, pix_num); diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 5b4ca6427..f5a06415d 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -2809,6 +2809,7 @@ int vp9_encodedframe_overshoot(VP9_COMP *cpi, int frame_size, int *q) { int enumerator; // Force a re-encode, and for now use max-QP. *q = cpi->rc.worst_quality; + cpi->cyclic_refresh->counter_encode_maxq_scene_change = 0; // If the frame_size is much larger than the threshold (big content change) // and the encoded frame used alot of Intra modes, then force hybrid_intra // encoding for the re-encode on this scene change. hybrid_intra will diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 31c416a71..80adf845e 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -843,7 +843,11 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) { sf->allow_quant_coeff_opt = sf->optimize_coefficients; sf->quant_opt_thresh = 99.0; sf->allow_acl = 1; +#if CONFIG_VP9_HIGHBITDEPTH sf->enable_tpl_model = 0; +#else + sf->enable_tpl_model = 1; +#endif for (i = 0; i < TX_SIZES; i++) { sf->intra_y_mode_mask[i] = INTRA_ALL; diff --git a/vpx_dsp/arm/sum_squares_neon.c b/vpx_dsp/arm/sum_squares_neon.c index 8942ba83b..cfefad993 100644 --- a/vpx_dsp/arm/sum_squares_neon.c +++ b/vpx_dsp/arm/sum_squares_neon.c @@ -14,7 +14,7 @@ #include "./vpx_dsp_rtcd.h" uint64_t vpx_sum_squares_2d_i16_neon(const int16_t *src, int stride, int size) { - int64x1_t s2; + uint64x1_t s2; if (size == 4) { int16x4_t s[4]; |