mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Fix inter search being used for 4x4 blocks
When 4x4 intra blocks are enabled and inter search is limited to 16x16 and larger blocks, it is possible that inter search is accidentally done for 4x4 blocks. Fixed by checking that block size is at least 8x8 before doing inter search.
This commit is contained in:
parent
4e13608b01
commit
649113a821
19
src/search.c
19
src/search.c
|
@ -419,14 +419,17 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth,
|
|||
y + cu_width <= frame->height)
|
||||
{
|
||||
int cu_width_inter_min = LCU_WIDTH >> ctrl->cfg.pu_depth_inter.max;
|
||||
bool can_use_inter = state->frame->slicetype != KVZ_SLICE_I && (
|
||||
WITHIN(depth, ctrl->cfg.pu_depth_inter.min, ctrl->cfg.pu_depth_inter.max) ||
|
||||
// When the split was forced because the CTU is partially outside the
|
||||
// frame, we permit inter coding even if pu_depth_inter would
|
||||
// otherwise forbid it.
|
||||
(x & ~(cu_width_inter_min - 1)) + cu_width_inter_min > frame->width ||
|
||||
(y & ~(cu_width_inter_min - 1)) + cu_width_inter_min > frame->height
|
||||
);
|
||||
bool can_use_inter =
|
||||
state->frame->slicetype != KVZ_SLICE_I &&
|
||||
depth <= MAX_DEPTH &&
|
||||
(
|
||||
WITHIN(depth, ctrl->cfg.pu_depth_inter.min, ctrl->cfg.pu_depth_inter.max) ||
|
||||
// When the split was forced because the CTU is partially outside the
|
||||
// frame, we permit inter coding even if pu_depth_inter would
|
||||
// otherwise forbid it.
|
||||
(x & ~(cu_width_inter_min - 1)) + cu_width_inter_min > frame->width ||
|
||||
(y & ~(cu_width_inter_min - 1)) + cu_width_inter_min > frame->height
|
||||
);
|
||||
|
||||
if (can_use_inter) {
|
||||
double mode_cost;
|
||||
|
|
Loading…
Reference in a new issue