Commit d66bd225 authored by Alex Converse's avatar Alex Converse

Require an --experimental-bitstream flag at runtime for encoding profile 1.

Change-Id: I73865bbbf6ea74434f15b73783ae97b4d273be80
parent 1d3ca088
......@@ -231,6 +231,10 @@ static const arg_def_t disable_warnings =
static const arg_def_t disable_warning_prompt =
ARG_DEF("y", "disable-warning-prompt", 0,
"Display warnings, but do not prompt user to continue.");
static const arg_def_t experimental_bitstream =
ARG_DEF(NULL, "experimental-bitstream", 0,
"Allow experimental bitstream features.");
static const arg_def_t *main_args[] = {
&debugmode,
......@@ -713,6 +717,8 @@ static void parse_global_config(struct VpxEncoderConfig *global, char **argv) {
global->disable_warnings = 1;
else if (arg_match(&arg, &disable_warning_prompt, argi))
global->disable_warning_prompt = 1;
else if (arg_match(&arg, &experimental_bitstream, argi))
global->experimental_bitstream = 1;
else
argj++;
}
......@@ -1002,13 +1008,20 @@ static int parse_stream_params(struct VpxEncoderConfig *global,
} while (0)
static void validate_stream_config(struct stream_state *stream) {
struct stream_state *streami;
static void validate_stream_config(const struct stream_state *stream,
const struct VpxEncoderConfig *global) {
const struct stream_state *streami;
if (!stream->config.cfg.g_w || !stream->config.cfg.g_h)
fatal("Stream %d: Specify stream dimensions with --width (-w) "
" and --height (-h)", stream->index);
if (stream->config.cfg.g_profile != 0 && !global->experimental_bitstream) {
fatal("Stream %d: profile %d is experimental and requires the --%s flag",
stream->index, stream->config.cfg.g_profile,
experimental_bitstream.long_name);
}
for (streami = stream; streami; streami = streami->next) {
/* All streams require output files */
if (!streami->config.out_fn)
......@@ -1571,7 +1584,7 @@ int main(int argc, const char **argv_) {
fatal("Specify stream dimensions with --width (-w) "
" and --height (-h)");
FOREACH_STREAM(set_stream_dimensions(stream, input.width, input.height));
FOREACH_STREAM(validate_stream_config(stream));
FOREACH_STREAM(validate_stream_config(stream, &global));
/* Ensure that --passes and --pass are consistent. If --pass is set and
* --passes=2, ensure --fpf was set.
......
......@@ -46,6 +46,7 @@ struct VpxEncoderConfig {
int show_rate_hist_buckets;
int disable_warnings;
int disable_warning_prompt;
int experimental_bitstream;
};
#ifdef __cplusplus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment