vpxenc.sh: Add real time tests.
authorTom Finegan <tomfinegan@google.com>
Fri, 22 Aug 2014 23:40:46 +0000 (16:40 -0700)
committerTom Finegan <tomfinegan@google.com>
Fri, 22 Aug 2014 23:40:46 +0000 (16:40 -0700)
Add --rt tests for VP8 and VP9.

Change-Id: I401d2962bf27e8a775ee5d71784d63ba4c014dfd

test/vpxenc.sh

index b6482c6..f02449a 100755 (executable)
@@ -59,9 +59,9 @@ vpxenc_pipe() {
 # shifted away. All remaining parameters are passed through to vpxenc.
 vpxenc() {
   local readonly encoder="$(vpx_tool_path vpxenc)"
-  local readonly input="${1}"
+  local readonly input="$1"
   shift
-  eval "${VPX_TEST_PREFIX}" "${encoder}" "$input" \
+  eval "${VPX_TEST_PREFIX}" "${encoder}" "${input}" \
     --test-decode=fatal \
     "$@" ${devnull}
 }
@@ -102,6 +102,42 @@ vpxenc_vp8_webm() {
   fi
 }
 
+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"
+    vpxenc "${YUV_RAW_INPUT}" \
+      --codec=vp8 \
+      --width="${YUV_RAW_INPUT_WIDTH}" \
+      --height="${YUV_RAW_INPUT_HEIGHT}" \
+      --output="${output}" \
+      --buf-initial-sz=500 \
+      --buf-optimal-sz=600 \
+      --buf-sz=1000 \
+      --cpu-used=-5 \
+      --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
+
+    if [ ! -e "${output}" ]; then
+      elog "Output file does not exist."
+      return 1
+    fi
+  fi
+}
+
 vpxenc_vp8_webm_2pass() {
   if [ "$(vpxenc_can_encode_vp8)" = "yes" ] && \
      [ "$(webm_io_available)" = "yes" ]; then
@@ -199,6 +235,42 @@ vpxenc_vp9_webm() {
   fi
 }
 
+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"
+    vpxenc "${YUV_RAW_INPUT}" \
+      --codec=vp9 \
+      --width="${YUV_RAW_INPUT_WIDTH}" \
+      --height="${YUV_RAW_INPUT_HEIGHT}" \
+      --output="${output}" \
+      --buf-initial-sz=500 \
+      --buf-optimal-sz=600 \
+      --buf-sz=1000 \
+      --cpu-used=-5 \
+      --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
+
+    if [ ! -e "${output}" ]; then
+      elog "Output file does not exist."
+      return 1
+    fi
+  fi
+}
+
 vpxenc_vp9_webm_2pass() {
   if [ "$(vpxenc_can_encode_vp9)" = "yes" ] && \
      [ "$(webm_io_available)" = "yes" ]; then
@@ -207,7 +279,6 @@ vpxenc_vp9_webm_2pass() {
       --width="${YUV_RAW_INPUT_WIDTH}" \
       --height="${YUV_RAW_INPUT_HEIGHT}" \
       --limit="${TEST_FRAMES}" \
-      --test-decode=fatal \
       --output="${output}" \
       --passes=2 \
       "${YUV_RAW_INPUT}"
@@ -270,7 +341,6 @@ vpxenc_vp9_webm_lag10_frames20() {
       --limit="${lag_total_frames}" \
       --lag-in-frames="${lag_frames}" \
       --output="${output}" \
-      --test-decode=fatal \
       --passes=2 \
       --auto-alt-ref=1 \
       "${YUV_RAW_INPUT}"
@@ -284,11 +354,13 @@ vpxenc_vp9_webm_lag10_frames20() {
 
 vpxenc_tests="vpxenc_vp8_ivf
               vpxenc_vp8_webm
+              vpxenc_vp8_webm_rt
               vpxenc_vp8_webm_2pass
               vpxenc_vp8_webm_lag10_frames20
               vpxenc_vp8_ivf_piped_input
               vpxenc_vp9_ivf
               vpxenc_vp9_webm
+              vpxenc_vp9_webm_rt
               vpxenc_vp9_webm_2pass
               vpxenc_vp9_ivf_lossless
               vpxenc_vp9_ivf_minq0_maxq0