Set output bit depth correctly.
Set output bit depth correctly for streams with mixed 8-bit and 10-bit
sequences.
BUG=aomedia:2238
Change-Id: I152e3ade325f413b209e46df398998d9d51a11fd
diff --git a/apps/aomdec.c b/apps/aomdec.c
index 2f5f6b0..58ac172 100644
--- a/apps/aomdec.c
+++ b/apps/aomdec.c
@@ -452,7 +452,7 @@
int opt_i420 = 0;
int opt_raw = 0;
aom_codec_dec_cfg_t cfg = { 0, 0, 0, CONFIG_LOWBITDEPTH, { 1 } };
- unsigned int output_bit_depth = 0;
+ unsigned int fixed_output_bit_depth = 0;
unsigned int is_annexb = 0;
int frames_corrupted = 0;
int dec_flags = 0;
@@ -565,7 +565,7 @@
} else if (arg_match(&arg, &continuearg, argi)) {
keep_going = 1;
} else if (arg_match(&arg, &outbitdeptharg, argi)) {
- output_bit_depth = arg_parse_uint(&arg);
+ fixed_output_bit_depth = arg_parse_uint(&arg);
} else if (arg_match(&arg, &isannexb, argi)) {
is_annexb = 1;
input.obu_ctx->is_annexb = 1;
@@ -843,8 +843,11 @@
}
}
// Default to codec bit depth if output bit depth not set
- if (!output_bit_depth && single_file && !do_md5) {
+ unsigned int output_bit_depth;
+ if (!fixed_output_bit_depth && single_file && !do_md5) {
output_bit_depth = img->bit_depth;
+ } else {
+ output_bit_depth = fixed_output_bit_depth;
}
// Shift up or down if necessary
if (output_bit_depth != 0)