summaryrefslogtreecommitdiff
path: root/vpxenc.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-03-21 07:50:42 -0400
committerJohn Koleszar <jkoleszar@google.com>2011-03-21 07:50:42 -0400
commit500fec2d5f84cae100d934efde858e3320365493 (patch)
tree9dd7e1c025953f214adb9d6c2aa121f7de71cdd0 /vpxenc.c
parent185557344ae79890d4acbbf5972972d20af1dd05 (diff)
downloadlibvpx-500fec2d5f84cae100d934efde858e3320365493.tar
libvpx-500fec2d5f84cae100d934efde858e3320365493.tar.gz
libvpx-500fec2d5f84cae100d934efde858e3320365493.tar.bz2
libvpx-500fec2d5f84cae100d934efde858e3320365493.zip
Allow specifying --end-usage by enum name
Map an enum to the --end-usage values, so you can specify --end-usage=cq instead of --end-usage=2. The numerical values still work for historical scripts, etc, but this is more user friendly. Change-Id: I445ecd9638f801f5924a71eabf449bee293cdd34
Diffstat (limited to 'vpxenc.c')
-rwxr-xr-xvpxenc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/vpxenc.c b/vpxenc.c
index 7b8de1171..6c13cd1bd 100755
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -924,8 +924,14 @@ static const arg_def_t resize_up_thresh = ARG_DEF(NULL, "resize-up", 1,
"Upscale threshold (buf %)");
static const arg_def_t resize_down_thresh = ARG_DEF(NULL, "resize-down", 1,
"Downscale threshold (buf %)");
-static const arg_def_t end_usage = ARG_DEF(NULL, "end-usage", 1,
- "VBR=0 | CBR=1 | CQ=2");
+static const struct arg_enum_list end_usage_enum[] = {
+ {"vbr", VPX_VBR},
+ {"cbr", VPX_CBR},
+ {"cq", VPX_CQ},
+ {NULL, 0}
+};
+static const arg_def_t end_usage = ARG_DEF_ENUM(NULL, "end-usage", 1,
+ "Rate control mode", end_usage_enum);
static const arg_def_t target_bitrate = ARG_DEF(NULL, "target-bitrate", 1,
"Bitrate (kbps)");
static const arg_def_t min_quantizer = ARG_DEF(NULL, "min-q", 1,
@@ -1256,7 +1262,7 @@ int main(int argc, const char **argv_)
else if (arg_match(&arg, &resize_down_thresh, argi))
cfg.rc_resize_down_thresh = arg_parse_uint(&arg);
else if (arg_match(&arg, &end_usage, argi))
- cfg.rc_end_usage = arg_parse_uint(&arg);
+ cfg.rc_end_usage = arg_parse_enum_or_int(&arg);
else if (arg_match(&arg, &target_bitrate, argi))
cfg.rc_target_bitrate = arg_parse_uint(&arg);
else if (arg_match(&arg, &min_quantizer, argi))