Fixed slice_temporal_mvp_enabled_flag and disabled TMVP with tiles

- slice_temporal_mvp_enabled_flag should be signalled also with non-IDR I-slices
This commit is contained in:
Marko Viitanen 2016-08-10 14:51:41 +03:00
parent 5326519182
commit 5ae1c595f2
2 changed files with 30 additions and 7 deletions

View file

@ -604,10 +604,22 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
cfg->aud_enable = atobool(value);
else if OPT("cqmfile")
cfg->cqmfile = strdup(value);
else if OPT("tiles-width-split")
return parse_tiles_specification(value, &cfg->tiles_width_count, &cfg->tiles_width_split);
else if OPT("tiles-height-split")
return parse_tiles_specification(value, &cfg->tiles_height_count, &cfg->tiles_height_split);
else if OPT("tiles-width-split") {
int retval = parse_tiles_specification(value, &cfg->tiles_width_count, &cfg->tiles_width_split);
if (cfg->tiles_width_count > 1 && cfg->tmvp_enable) {
cfg->tmvp_enable = false;
fprintf(stderr, "Disabling TMVP because tiles are used.\n");
}
return retval;
}
else if OPT("tiles-height-split") {
int retval = parse_tiles_specification(value, &cfg->tiles_height_count, &cfg->tiles_height_split);
if (cfg->tiles_height_count > 1 && cfg->tmvp_enable) {
cfg->tmvp_enable = false;
fprintf(stderr, "Disabling TMVP because tiles are used.\n");
}
return retval;
}
else if OPT("tiles")
{
// A simpler interface for setting tiles, accepting only uniform split.
@ -632,6 +644,12 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
FREE_POINTER(cfg->tiles_height_split);
cfg->tiles_width_count = width;
cfg->tiles_height_count = height;
if (cfg->tmvp_enable) {
cfg->tmvp_enable = false;
fprintf(stderr, "Disabling TMVP because tiles are used.\n");
}
return 1;
}
else if OPT("wpp")
@ -921,6 +939,10 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
fprintf(stderr, "Cannot enable TMVP because GOP is used.\n");
cfg->tmvp_enable = false;
}
if (cfg->tiles_width_count > 1 || cfg->tiles_height_count > 1) {
fprintf(stderr, "Cannot enable TMVP because tiles are used.\n");
cfg->tmvp_enable = false;
}
}
else
return 0;

View file

@ -747,14 +747,15 @@ void kvz_encoder_state_write_bitstream_slice_header(encoder_state_t * const stat
WRITE_U(stream, 1, 1, "used_by_curr_pic_s1_flag");
}
//WRITE_UE(stream, 0, "short_term_ref_pic_set_idx");
if (state->encoder_control->cfg->tmvp_enable) {
WRITE_U(stream, 1, 1, "slice_temporal_mvp_enabled_flag");
}
}
//end if
//end if
if (state->encoder_control->cfg->tmvp_enable && state->frame->slicetype != KVZ_SLICE_I) {
WRITE_U(stream, 1, 1, "slice_temporal_mvp_enabled_flag");
}
if (encoder->sao_enable) {
WRITE_U(stream, 1, 1, "slice_sao_luma_flag");