mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
[mtt] Fix trying to get split data from depth -1
This commit is contained in:
parent
567fa7b2bd
commit
facbc794bf
2
src/cu.c
2
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;
|
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;
|
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;
|
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
|
// don't allow QT-splitting below a BT split
|
||||||
|
|
2
src/cu.h
2
src/cu.h
|
@ -614,7 +614,7 @@ static INLINE void cbf_copy(uint16_t *cbf, uint16_t src, color_t plane)
|
||||||
*cbf |= src & (1 << 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)
|
#define PU_IS_TU(cu) ((cu)->log2_width <= TR_MAX_LOG2_SIZE && (cu)->log2_height <= TR_MAX_LOG2_SIZE)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue