[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_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]; 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); uvg_encode_mvd(state, cabac, mvd_hor, mvd_ver, bits_out);
non_zero_mvd |= (mvd_hor != 0) || (mvd_ver != 0); 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; typedef int32_t mv_t;
#define VERBOSE 1 //#define VERBOSE 1
#define UVG_DEBUG_PRINT_CABAC 1 //#define UVG_DEBUG_PRINT_CABAC 1
#define UVG_DEBUG 1 //#define UVG_DEBUG 1
//#define UVG_DEBUG_PRINT_YUVIEW_CSV 1 //#define UVG_DEBUG_PRINT_YUVIEW_CSV 1
//#define UVG_DEBUG_PRINT_MV_INFO 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; 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); 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_x = cu->inter.mv[0][0] >> INTERNAL_MV_PREC;
int32_t mv_y = cu->inter.mv[0][1] >> UVG_IMV_4PEL; int32_t mv_y = cu->inter.mv[0][1] >> INTERNAL_MV_PREC;
uint32_t ibc_row = y / LCU_WIDTH; uint32_t ibc_row = y / LCU_WIDTH;
int32_t buffer_x = ((x - x_scu) + LCU_WIDTH <= IBC_BUFFER_WIDTH ? int32_t buffer_x = ((x - x_scu) + LCU_WIDTH <= IBC_BUFFER_WIDTH ?

View file

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