diff --git a/src/cu.c b/src/cu.c index df89642b..6b4f483d 100644 --- a/src/cu.c +++ b/src/cu.c @@ -413,7 +413,7 @@ int uvg_get_possible_splits(const encoder_state_t * const state, splits[NO_SPLIT] = splits[QT_SPLIT] = splits[BT_HOR_SPLIT] = splits[TT_HOR_SPLIT] = splits[BT_VER_SPLIT] = splits[TT_VER_SPLIT] = true; bool can_btt = split_tree.mtt_depth < max_btd; - const enum split_type last_split = GET_SPLITDATA(&split_tree, 0); + const enum split_type last_split = GET_SPLITDATA(&split_tree, split_tree.current_depth - 1); const enum split_type parl_split = last_split == TT_HOR_SPLIT ? BT_HOR_SPLIT : BT_VER_SPLIT; // don't allow QT-splitting below a BT split diff --git a/src/search.c b/src/search.c index b8040666..5a8ef639 100644 --- a/src/search.c +++ b/src/search.c @@ -1572,7 +1572,7 @@ static double search_cu( default: assert(0 && "Incorrect_slice_type"); } - if(minimum_split_amount > max_btd && !is_implicit) { + if(minimum_split_amount > max_btd && !is_implicit && can_split[1]) { // If search should not be performed at depths that cannot be reached after a maximum mtt split amount // we are in trouble, therefore prevent mtt splits in such situation can_split[2] = can_split[3] = can_split[4] = can_split[5] = false;