From: Yunqing Wang Date: Sat, 23 Jul 2016 00:14:22 +0000 (-0700) Subject: Combine vpxcx_set_ref example for VP9 and VP10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a5a3f6bed92f75848dc46b23bd6e8faed2dff42;p=libvpx Combine vpxcx_set_ref example for VP9 and VP10 Modified the example so that the test script worked correctly. Also included minor fixes. Change-Id: If97525dd9b85004a07e91c384132eadae35cdbf8 --- diff --git a/examples.mk b/examples.mk index 593c8ddd0..cf98b9988 100644 --- a/examples.mk +++ b/examples.mk @@ -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 diff --git a/examples/vpx_cx_set_ref.c b/examples/vpxcx_set_ref.c similarity index 99% rename from examples/vpx_cx_set_ref.c rename to examples/vpxcx_set_ref.c index 61d81b8d6..1039362ca 100644 --- a/examples/vpx_cx_set_ref.c +++ b/examples/vpxcx_set_ref.c @@ -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) diff --git a/test/cx_set_ref.sh b/test/cx_set_ref.sh index b319bbffb..678399ee8 100755 --- a/test/cx_set_ref.sh +++ b/test/cx_set_ref.sh @@ -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 }