From cb9f9381c38b13b6a5049fb135abdc6579f91939 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Fri, 8 Oct 2021 14:48:49 +0300 Subject: [PATCH] [inter] Fix inter reconstruction, correct function was in wrong branch --- src/encode_coding_tree.c | 2 +- src/inter.c | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index a25304db..68fc6fdc 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -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; diff --git a/src/inter.c b/src/inter.c index b56603ae..1d6c00d2 100644 --- a/src/inter.c +++ b/src/inter.c @@ -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); + } } }