]> granicus.if.org Git - libvpx/commitdiff
Combine vpxcx_set_ref example for VP9 and VP10
authorYunqing Wang <yunqingwang@google.com>
Sat, 23 Jul 2016 00:14:22 +0000 (17:14 -0700)
committerYunqing Wang <yunqingwang@google.com>
Mon, 25 Jul 2016 22:09:13 +0000 (15:09 -0700)
Modified the example so that the test script worked correctly. Also
included minor fixes.

Change-Id: If97525dd9b85004a07e91c384132eadae35cdbf8

examples.mk
examples/vpxcx_set_ref.c [moved from examples/vpx_cx_set_ref.c with 99% similarity]
test/cx_set_ref.sh

index 593c8ddd0a4f6ec90e2743fb1d36b17eb13ed7e6..cf98b99885e0baf8d1cf5e47bb4f3bb0a582aa0e 100644 (file)
@@ -218,13 +218,13 @@ vp8cx_set_ref.DESCRIPTION           = VP8 set encoder reference frame
 # If vp9 is enabled, $(CONFIG_VP9_ENCODER) is yes, otherwise, it is blank.
 ifneq (,$(filter yes,$(CONFIG_VP9_ENCODER) $(CONFIG_VP10_ENCODER)))
 ifeq ($(CONFIG_DECODERS),yes)
-EXAMPLES-yes                       += vpx_cx_set_ref.c
-vpx_cx_set_ref.SRCS                += ivfenc.h ivfenc.c
-vpx_cx_set_ref.SRCS                += tools_common.h tools_common.c
-vpx_cx_set_ref.SRCS                += video_common.h
-vpx_cx_set_ref.SRCS                += video_writer.h video_writer.c
-vpx_cx_set_ref.GUID                 = 65D7F14A-2EE6-4293-B958-AB5107A03B55
-vpx_cx_set_ref.DESCRIPTION          = VP9/VP10 set encoder reference frame
+EXAMPLES-yes                       += vpxcx_set_ref.c
+vpxcx_set_ref.SRCS                 += ivfenc.h ivfenc.c
+vpxcx_set_ref.SRCS                 += tools_common.h tools_common.c
+vpxcx_set_ref.SRCS                 += video_common.h
+vpxcx_set_ref.SRCS                 += video_writer.h video_writer.c
+vpxcx_set_ref.GUID                  = 65D7F14A-2EE6-4293-B958-AB5107A03B55
+vpxcx_set_ref.DESCRIPTION           = VP9/VP10 set encoder reference frame
 endif
 endif
 
similarity index 99%
rename from examples/vpx_cx_set_ref.c
rename to examples/vpxcx_set_ref.c
index 61d81b8d62b164dd5c9b8a99436f49fbd8a8fef9..1039362cae1b0593a1209afdc62d7967f7ddf957 100644 (file)
@@ -306,7 +306,7 @@ int main(int argc, char **argv) {
   unsigned int frame_out = 0;
 
   // The frame number to set reference frame on
-  int update_frame_num = 0;
+  unsigned int update_frame_num = 0;
   int mismatch_seen = 0;
 
   const int fps = 30;
@@ -317,7 +317,7 @@ int main(int argc, char **argv) {
   const char *height_arg = NULL;
   const char *infile_arg = NULL;
   const char *outfile_arg = NULL;
-  int limit = 0;
+  unsigned int limit = 0;
   exec_name = argv[0];
 
   if (argc < 7)
index b319bbffbb0781981f80ee734d42b85acc4e0713..678399ee87d469013921a4bb1d596d1bb6fa10e0 100755 (executable)
@@ -27,7 +27,12 @@ cx_set_ref_verify_environment() {
 # $1 is the codec name.
 vpx_set_ref() {
   local codec="$1"
-  local encoder="${LIBVPX_BIN_PATH}/${codec}cx_set_ref${VPX_TEST_EXE_SUFFIX}"
+  local encoder="${LIBVPX_BIN_PATH}/vpxcx_set_ref${VPX_TEST_EXE_SUFFIX}"
+
+  if [ "$codec" = "vp8" ]; then
+    encoder="${LIBVPX_BIN_PATH}/vp8cx_set_ref${VPX_TEST_EXE_SUFFIX}"
+  fi
+
   local output_file="${VPX_TEST_OUTPUT_DIR}/${codec}cx_set_ref_${codec}.ivf"
   local ref_frame_num=90
 
@@ -36,9 +41,15 @@ vpx_set_ref() {
     return 1
   fi
 
-  eval "${VPX_TEST_PREFIX}" "${encoder}" "${YUV_RAW_INPUT_WIDTH}" \
-      "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
-      "${ref_frame_num}" ${devnull}
+  if [ "$codec" = "vp8" ]; then
+    eval "${VPX_TEST_PREFIX}" "${encoder}" "${YUV_RAW_INPUT_WIDTH}" \
+        "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
+        "${ref_frame_num}" ${devnull}
+  else
+    eval "${VPX_TEST_PREFIX}" "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \
+        "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
+        "${ref_frame_num}" ${devnull}
+  fi
 
   [ -e "${output_file}" ] || return 1
 }