[mtt] Fix trying to get split data from depth -1

This commit is contained in:
Joose Sainio 2022-12-14 10:16:51 +02:00
parent 3d236153e3
commit 01023c8a34
2 changed files with 2 additions and 2 deletions

View file

@ -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 = (split_tree.split_tree >> (split_tree.current_depth * 3 - 3)) & 7;
const enum split_type last_split = GET_SPLITDATA(&split_tree, 0);
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

View file

@ -613,7 +613,7 @@ static INLINE void cbf_copy(uint16_t *cbf, uint16_t src, color_t plane)
*cbf |= src & (1 << plane);
}
#define GET_SPLITDATA(CU,curDepth) (((CU)->split_tree >> ((curDepth) * 3)) & 7)
#define GET_SPLITDATA(CU,curDepth) ((CU)->split_tree >> ((MAX((curDepth), 0) * 3)) & 7)
#define PU_IS_TU(cu) ((cu)->log2_width <= TR_MAX_LOG2_SIZE && (cu)->log2_height <= TR_MAX_LOG2_SIZE)
#endif