[ibc] Change internal MV storage to INTERNAL_MV_PREC and code it as full-pel

This commit is contained in:
Marko Viitanen 2022-07-03 09:41:05 +03:00
parent cc4c757695
commit 0fdf96fab2
4 changed files with 8 additions and 8 deletions

View file

@ -906,7 +906,7 @@ int uvg_encode_inter_prediction_unit(encoder_state_t * const state,
mv_t mvd_hor = cur_cu->inter.mv[ref_list_idx][0] - mv_cand[cu_mv_cand][0];
mv_t mvd_ver = cur_cu->inter.mv[ref_list_idx][1] - mv_cand[cu_mv_cand][1];
uvg_change_precision(INTERNAL_MV_PREC, uvg_g_imv_to_prec[UVG_IMV_OFF], &mvd_hor, &mvd_ver);
uvg_change_precision(INTERNAL_MV_PREC, uvg_g_imv_to_prec[(cur_cu->type == CU_IBC)?UVG_IMV_FPEL:UVG_IMV_OFF], &mvd_hor, &mvd_ver);
uvg_encode_mvd(state, cabac, mvd_hor, mvd_ver, bits_out);
non_zero_mvd |= (mvd_hor != 0) || (mvd_ver != 0);

View file

@ -128,9 +128,9 @@ typedef int16_t coeff_t;
typedef int32_t mv_t;
#define VERBOSE 1
#define UVG_DEBUG_PRINT_CABAC 1
#define UVG_DEBUG 1
//#define VERBOSE 1
//#define UVG_DEBUG_PRINT_CABAC 1
//#define UVG_DEBUG 1
//#define UVG_DEBUG_PRINT_YUVIEW_CSV 1
//#define UVG_DEBUG_PRINT_MV_INFO 1

View file

@ -608,8 +608,8 @@ static void ibc_recon_cu(const encoder_state_t * const state,
uint32_t offset_c = x_scu / 2 + y_scu / 2 * LCU_WIDTH_C;
cu_info_t *cu = LCU_GET_CU_AT_PX(lcu, x_scu, y_scu);
int32_t mv_x = cu->inter.mv[0][0] >> UVG_IMV_4PEL;
int32_t mv_y = cu->inter.mv[0][1] >> UVG_IMV_4PEL;
int32_t mv_x = cu->inter.mv[0][0] >> INTERNAL_MV_PREC;
int32_t mv_y = cu->inter.mv[0][1] >> INTERNAL_MV_PREC;
uint32_t ibc_row = y / LCU_WIDTH;
int32_t buffer_x = ((x - x_scu) + LCU_WIDTH <= IBC_BUFFER_WIDTH ?
@ -1599,7 +1599,7 @@ void uvg_inter_get_mv_cand(const encoder_state_t * const state,
mv_t ibc_mv_cand[IBC_MRG_MAX_NUM_CANDS][2];
get_ibc_merge_candidates(state, cur_cu,lcu,NULL, x, y, width, height,ibc_mv_cand);
memcpy(mv_cand[0], ibc_mv_cand[0], sizeof(mv_t) * 2);
memcpy(mv_cand[1], ibc_mv_cand[1], sizeof(mv_t) * 2);
memcpy(mv_cand[1], ibc_mv_cand[1], sizeof(mv_t) * 2);
} else {
get_spatial_merge_candidates(x, y, width, height,
state->tile->frame->width,

View file

@ -1056,7 +1056,7 @@ static double search_cu(
}
for(int i = 0; i < 8; i++) {
cur_cu->inter.mv[0][0] = (-cu_width - i) << UVG_IMV_4PEL;
cur_cu->inter.mv[0][0] = (-cu_width - i) * (1 << INTERNAL_MV_PREC);
cur_cu->inter.mv[0][1] = 0;
if (x -cu_width - i < 0) break;