Commit 3ab64bdc authored by Imdad Sardharwalla's avatar Imdad Sardharwalla Committed by Debargha Mukherjee

Fix test_decode for monochrome video

Setting --test_decode=fatal no longer checks
U and V planes for monochrome video.

Change-Id: I4ff9f083855223d30bc1cd5d605d866cd5bd1cd7
parent 960e7003
......@@ -1005,6 +1005,22 @@ static struct stream_state *new_stream(struct AvxEncoderConfig *global,
return stream;
}
static void set_config_arg_ctrls(struct stream_config *config, int key,
const struct arg *arg) {
int j;
/* Point either to the next free element or the first instance of this
* control.
*/
for (j = 0; j < config->arg_ctrl_cnt; j++)
if (config->arg_ctrls[j][0] == key) break;
/* Update/insert */
assert(j < (int)ARG_CTRL_CNT_MAX);
config->arg_ctrls[j][0] = key;
config->arg_ctrls[j][1] = arg_parse_enum_or_int(arg);
if (j == config->arg_ctrl_cnt) config->arg_ctrl_cnt++;
}
static int parse_stream_params(struct AvxEncoderConfig *global,
struct stream_state *stream, char **argv) {
char **argi, **argj;
......@@ -1176,28 +1192,20 @@ static int parse_stream_params(struct AvxEncoderConfig *global,
} else if (arg_match(&arg, &tile_height, argi)) {
config->cfg.tile_height_count =
arg_parse_list(&arg, config->cfg.tile_heights, MAX_TILE_HEIGHTS);
#endif
#if CONFIG_MONO_VIDEO
} else if (arg_match(&arg, &input_color_space, argi)) {
aom_color_space_t color_space = arg_parse_enum_or_int(&arg);
config->cfg.monochrome = (color_space == AOM_CS_MONOCHROME);
set_config_arg_ctrls(config, AV1E_SET_COLOR_SPACE, &arg);
#endif
} else {
int i, match = 0;
for (i = 0; ctrl_args[i]; i++) {
if (arg_match(&arg, ctrl_args[i], argi)) {
int j;
match = 1;
/* Point either to the next free element or the first
* instance of this control.
*/
for (j = 0; j < config->arg_ctrl_cnt; j++)
if (ctrl_args_map != NULL &&
config->arg_ctrls[j][0] == ctrl_args_map[i])
break;
/* Update/insert */
assert(j < (int)ARG_CTRL_CNT_MAX);
if (ctrl_args_map != NULL && j < (int)ARG_CTRL_CNT_MAX) {
config->arg_ctrls[j][0] = ctrl_args_map[i];
config->arg_ctrls[j][1] = arg_parse_enum_or_int(&arg);
if (j == config->arg_ctrl_cnt) config->arg_ctrl_cnt++;
if (ctrl_args_map) {
set_config_arg_ctrls(config, ctrl_args_map[i], &arg);
}
}
}
......
......@@ -1518,6 +1518,9 @@ static aom_codec_err_t ctrl_set_color_space(aom_codec_alg_priv_t *ctx,
va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.color_space = CAST(AV1E_SET_COLOR_SPACE, args);
#if CONFIG_MONO_VIDEO
ctx->cfg.monochrome = (extra_cfg.color_space == AOM_CS_MONOCHROME);
#endif
return update_extra_cfg(ctx, &extra_cfg);
}
......
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