From fba5c354adf95bb7af3e2262b332ff1c85cd3829 Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Wed, 6 Jul 2016 10:01:16 -0700 Subject: [PATCH] Modify the name of vp9cx_set_ref example Modified the name of vp9cx_set_ref example so that the test script ran correctly. Change-Id: I0ab2de66220b0a88b7af7ea1633a088ab78dd9ff --- examples.mk | 14 ++++----- .../{vpx_cx_set_ref.c => vp9cx_set_ref.c} | 30 +++++++++---------- 2 files changed, 21 insertions(+), 23 deletions(-) rename examples/{vpx_cx_set_ref.c => vp9cx_set_ref.c} (96%) diff --git a/examples.mk b/examples.mk index 78f8fa85b..cc7fb1ddc 100644 --- a/examples.mk +++ b/examples.mk @@ -217,13 +217,13 @@ vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame ifeq ($(CONFIG_VP9_ENCODER),yes) 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 set encoder reference frame +EXAMPLES-yes += vp9cx_set_ref.c +vp9cx_set_ref.SRCS += ivfenc.h ivfenc.c +vp9cx_set_ref.SRCS += tools_common.h tools_common.c +vp9cx_set_ref.SRCS += video_common.h +vp9cx_set_ref.SRCS += video_writer.h video_writer.c +vp9cx_set_ref.GUID = 65D7F14A-2EE6-4293-B958-AB5107A03B55 +vp9cx_set_ref.DESCRIPTION = VP9 set encoder reference frame endif endif diff --git a/examples/vpx_cx_set_ref.c b/examples/vp9cx_set_ref.c similarity index 96% rename from examples/vpx_cx_set_ref.c rename to examples/vp9cx_set_ref.c index f97217fc8..acf79dbca 100644 --- a/examples/vpx_cx_set_ref.c +++ b/examples/vp9cx_set_ref.c @@ -25,7 +25,7 @@ // ----- // This example encodes a raw video. And the last argument passed in specifies // the frame number to update the reference frame on. For example, run -// examples/vpx_cx_set_ref vp9 352 288 in.yuv out.ivf 4 30 +// examples/vp9cx_set_ref 352 288 in.yuv out.ivf 4 30 // The parameter is parsed as follows: // // @@ -61,7 +61,7 @@ static const char *exec_name; void usage_exit() { - fprintf(stderr, "Usage: %s " + fprintf(stderr, "Usage: %s " " \n", exec_name); exit(EXIT_FAILURE); @@ -312,36 +312,34 @@ int main(int argc, char **argv) { const int fps = 30; const int bitrate = 500; - const char *codec_arg = NULL; const char *width_arg = NULL; 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) + if (argc < 6) die("Invalid number of arguments"); - codec_arg = argv[1]; - width_arg = argv[2]; - height_arg = argv[3]; - infile_arg = argv[4]; - outfile_arg = argv[5]; + width_arg = argv[1]; + height_arg = argv[2]; + infile_arg = argv[3]; + outfile_arg = argv[4]; - encoder = get_vpx_encoder_by_name(codec_arg); + encoder = get_vpx_encoder_by_name("vp9"); if (!encoder) die("Unsupported codec."); - update_frame_num = atoi(argv[6]); + update_frame_num = atoi(argv[5]); // In VP9, the reference buffers (cm->buffer_pool->frame_bufs[i].buf) are // allocated while calling vpx_codec_encode(), thus, setting reference for // 1st frame isn't supported. if (update_frame_num <= 1) - die("Couldn't parse frame number '%s'\n", argv[6]); + die("Couldn't parse frame number '%s'\n", argv[5]); - if (argc > 7) { - limit = atoi(argv[7]); + if (argc > 6) { + limit = atoi(argv[6]); if (update_frame_num > limit) die("Update frame number couldn't larger than limit\n"); } @@ -392,7 +390,7 @@ int main(int argc, char **argv) { die_codec(&ecodec, "Failed to set enable auto alt ref"); if (test_decode) { - const VpxInterface *decoder = get_vpx_decoder_by_name(codec_arg); + const VpxInterface *decoder = get_vpx_decoder_by_name("vp9"); if (vpx_codec_dec_init(&dcodec, decoder->codec_interface(), NULL, 0)) die_codec(&dcodec, "Failed to initialize decoder."); } -- 2.40.0