mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 10:34:05 +00:00
correct MV sign encryption
This commit is contained in:
parent
15abdc6e81
commit
35634b5596
|
@ -1205,22 +1205,20 @@ static void encode_inter_prediction_unit(encoder_state_t * const state,
|
||||||
if (mvd_hor_abs > 1) {
|
if (mvd_hor_abs > 1) {
|
||||||
kvz_cabac_write_ep_ex_golomb(state, cabac, mvd_hor_abs-2, 1);
|
kvz_cabac_write_ep_ex_golomb(state, cabac, mvd_hor_abs-2, 1);
|
||||||
}
|
}
|
||||||
uint8_t mvd_hor_sign = (mvd_hor>0)?0:1;
|
uint32_t mvd_hor_sign = (mvd_hor>0)?0:1;
|
||||||
#if !EncryptMVDiffSign
|
|
||||||
if(!state->cabac.only_count)
|
if(!state->cabac.only_count)
|
||||||
if (state->encoder_control->cfg->crypto_features & KVZ_CRYPTO_MV_SIGNS)
|
if (state->encoder_control->cfg->crypto_features & KVZ_CRYPTO_MV_SIGNS)
|
||||||
mvd_hor_sign = mvd_hor^ff_get_key(&state->tile->dbs_g, 1);
|
mvd_hor_sign = mvd_hor_sign^ff_get_key(&state->tile->dbs_g, 1);
|
||||||
#endif
|
|
||||||
CABAC_BIN_EP(cabac, mvd_hor_sign, "mvd_sign_flag_hor");
|
CABAC_BIN_EP(cabac, mvd_hor_sign, "mvd_sign_flag_hor");
|
||||||
}
|
}
|
||||||
if (ver_abs_gr0) {
|
if (ver_abs_gr0) {
|
||||||
if (mvd_ver_abs > 1) {
|
if (mvd_ver_abs > 1) {
|
||||||
kvz_cabac_write_ep_ex_golomb(state, cabac, mvd_ver_abs-2, 1);
|
kvz_cabac_write_ep_ex_golomb(state, cabac, mvd_ver_abs-2, 1);
|
||||||
}
|
}
|
||||||
uint8_t mvd_ver_sign = (mvd_ver>0)?0:1;
|
uint32_t mvd_ver_sign = (mvd_ver>0)?0:1;
|
||||||
if(!state->cabac.only_count)
|
if(!state->cabac.only_count)
|
||||||
if (state->encoder_control->cfg->crypto_features & KVZ_CRYPTO_MV_SIGNS)
|
if (state->encoder_control->cfg->crypto_features & KVZ_CRYPTO_MV_SIGNS)
|
||||||
mvd_ver_sign = mvd_ver^ff_get_key(&state->tile->dbs_g, 1);
|
mvd_ver_sign = mvd_ver_sign^ff_get_key(&state->tile->dbs_g, 1);
|
||||||
CABAC_BIN_EP(cabac, mvd_ver_sign, "mvd_sign_flag_ver");
|
CABAC_BIN_EP(cabac, mvd_ver_sign, "mvd_sign_flag_ver");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue