Commit b91155a9 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Deduplicate code between HBD and LBD

Change-Id: I2e83419aecf6464fa76f091015597207a12bd478
parent f71808c7
......@@ -1787,7 +1787,6 @@ int main(int argc, const char **argv_) {
{ stream->config.cfg.g_input_bit_depth = input.bit_depth; });
}
#if CONFIG_HIGHBITDEPTH
FOREACH_STREAM({
if (input.fmt != AOM_IMG_FMT_I420 && input.fmt != AOM_IMG_FMT_I42016) {
/* Automatically upgrade if input is non-4:2:0 but a 4:2:0 profile
......@@ -1824,31 +1823,11 @@ int main(int argc, const char **argv_) {
}
}
if (stream->config.cfg.g_profile > 1) {
#if CONFIG_HIGHBITDEPTH
stream->config.use_16bit_internal = 1;
}
if (profile_updated && !global.quiet) {
fprintf(stderr,
"Warning: automatically upgrading to profile %d to "
"match input format.\n",
stream->config.cfg.g_profile);
}
});
#else
FOREACH_STREAM({
if (input.fmt != AOM_IMG_FMT_I420 && input.fmt != AOM_IMG_FMT_I42016) {
/* Automatically upgrade if input is non-4:2:0 but a 4:2:0 profile
was selected. */
switch (stream->config.cfg.g_profile) {
case 0:
stream->config.cfg.g_profile = 1;
profile_updated = 1;
break;
case 2:
stream->config.cfg.g_profile = 3;
profile_updated = 1;
break;
default: break;
}
fatal("Unsupported profile.");
#endif
}
if (profile_updated && !global.quiet) {
fprintf(stderr,
......@@ -1857,7 +1836,6 @@ int main(int argc, const char **argv_) {
stream->config.cfg.g_profile);
}
});
#endif
FOREACH_STREAM(set_stream_dimensions(stream, input.width, input.height));
FOREACH_STREAM(validate_stream_config(stream, &global));
......
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