[inter] Fix inter reconstruction, correct function was in wrong branch

This commit is contained in:
Marko Viitanen 2021-10-08 14:48:49 +03:00
parent 78363ccab0
commit cb9f9381c3
2 changed files with 17 additions and 16 deletions

View file

@ -1246,7 +1246,7 @@ void kvz_encode_coding_tree(encoder_state_t * const state,
}
// Encode skip flag
if (state->frame->slicetype != KVZ_SLICE_I) {
if (state->frame->slicetype != KVZ_SLICE_I && cu_width != 4) {
int8_t ctx_skip = 0;

View file

@ -393,22 +393,23 @@ static void inter_recon_unipred(const encoder_state_t * const state,
width, height,
mv_param, lcu);
}
}
} else {
// With an integer MV, copy pixels directly from the reference.
const int lcu_pu_index = pu_in_lcu.y * LCU_WIDTH + pu_in_lcu.x;
if (mv_is_outside_frame) {
inter_cp_with_ext_border(ref->y, ref->stride,
ref->width, ref->height,
&lcu->rec.y[lcu_pu_index], LCU_WIDTH,
width, height,
&mv_in_frame);
} else {
const int frame_mv_index = mv_in_frame.y * ref->stride + mv_in_frame.x;
kvz_pixels_blit(&ref->y[frame_mv_index],
&lcu->rec.y[lcu_pu_index],
width, height,
ref->stride, LCU_WIDTH);
// With an integer MV, copy pixels directly from the reference.
const int lcu_pu_index = pu_in_lcu.y * LCU_WIDTH + pu_in_lcu.x;
if (mv_is_outside_frame) {
inter_cp_with_ext_border(ref->y, ref->stride,
ref->width, ref->height,
&lcu->rec.y[lcu_pu_index], LCU_WIDTH,
width, height,
&mv_in_frame);
}
else {
const int frame_mv_index = mv_in_frame.y * ref->stride + mv_in_frame.x;
kvz_pixels_blit(&ref->y[frame_mv_index],
&lcu->rec.y[lcu_pu_index],
width, height,
ref->stride, LCU_WIDTH);
}
}
}