mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-28 03:34:06 +00:00
encry coef transf sign
This commit is contained in:
parent
02b0712973
commit
7ad5f8bbe5
|
@ -1766,6 +1766,7 @@ void kvz_encode_coeff_nxn(encoder_state_t * const state, coeff_t *coeff, uint8_t
|
||||||
|
|
||||||
// Scan all coeff groups to find out which of them have coeffs.
|
// Scan all coeff groups to find out which of them have coeffs.
|
||||||
// Populate sig_coeffgroup_flag with that info.
|
// Populate sig_coeffgroup_flag with that info.
|
||||||
|
|
||||||
unsigned sig_cg_cnt = 0;
|
unsigned sig_cg_cnt = 0;
|
||||||
for (int cg_y = 0; cg_y < width / 4; ++cg_y) {
|
for (int cg_y = 0; cg_y < width / 4; ++cg_y) {
|
||||||
for (int cg_x = 0; cg_x < width / 4; ++cg_x) {
|
for (int cg_x = 0; cg_x < width / 4; ++cg_x) {
|
||||||
|
@ -1864,6 +1865,10 @@ void kvz_encode_coeff_nxn(encoder_state_t * const state, coeff_t *coeff, uint8_t
|
||||||
ctx_sig = kvz_context_get_sig_ctx_inc(pattern_sig_ctx, scan_mode, pos_x, pos_y,
|
ctx_sig = kvz_context_get_sig_ctx_inc(pattern_sig_ctx, scan_mode, pos_x, pos_y,
|
||||||
log2_block_size, type);
|
log2_block_size, type);
|
||||||
cabac->cur_ctx = &baseCtx[ctx_sig];
|
cabac->cur_ctx = &baseCtx[ctx_sig];
|
||||||
|
if(!state->cabac.only_count)
|
||||||
|
if (state->encoder_control->cfg->crypto_features & KVZ_CRYPTO_TRANSF_COEFF_SIGNS)
|
||||||
|
sig = sig ^ ff_get_key(&state->tile->dbs_g, 1);
|
||||||
|
|
||||||
CABAC_BIN(cabac, sig, "sig_coeff_flag");
|
CABAC_BIN(cabac, sig, "sig_coeff_flag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1927,7 +1932,9 @@ void kvz_encode_coeff_nxn(encoder_state_t * const state, coeff_t *coeff, uint8_t
|
||||||
CABAC_BIN(cabac, symbol, "coeff_abs_level_greater2_flag");
|
CABAC_BIN(cabac, symbol, "coeff_abs_level_greater2_flag");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!state->cabac.only_count)
|
||||||
|
if (state->encoder_control->cfg->crypto_features & KVZ_CRYPTO_TRANSF_COEFF_SIGNS)
|
||||||
|
coeff_signs = coeff_signs ^ ff_get_key(&state->tile->dbs_g, num_non_zero);
|
||||||
if (be_valid && sign_hidden) {
|
if (be_valid && sign_hidden) {
|
||||||
CABAC_BINS_EP(cabac, (coeff_signs >> 1), (num_non_zero - 1), "coeff_sign_flag");
|
CABAC_BINS_EP(cabac, (coeff_signs >> 1), (num_non_zero - 1), "coeff_sign_flag");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue