]> granicus.if.org Git - libvpx/commitdiff
Modify the name of vp9cx_set_ref example
authorYunqing Wang <yunqingwang@google.com>
Wed, 6 Jul 2016 17:01:16 +0000 (10:01 -0700)
committerYunqing Wang <yunqingwang@google.com>
Wed, 6 Jul 2016 17:05:51 +0000 (10:05 -0700)
Modified the name of vp9cx_set_ref example so that the test script
ran correctly.

Change-Id: I0ab2de66220b0a88b7af7ea1633a088ab78dd9ff

examples.mk
examples/vp9cx_set_ref.c [moved from examples/vpx_cx_set_ref.c with 96% similarity]

index 78f8fa85b80b56380e6e8be0c2e89de670b36f7f..cc7fb1ddcf3ed21c34e9708682f50935ef42b7a1 100644 (file)
@@ -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
 
similarity index 96%
rename from examples/vpx_cx_set_ref.c
rename to examples/vp9cx_set_ref.c
index f97217fc856c4536c0b24b0c30552beb08f69c35..acf79dbca1b022031ffee6d9f8f0d910ef39d080 100644 (file)
@@ -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 <codec> <width> <height> <infile> <outfile> "
+  fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile> "
           "<frame> <limit(optional)>\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.");
   }