diff --git a/src/cu.h b/src/cu.h index 6f0a9d25..c7776fcd 100644 --- a/src/cu.h +++ b/src/cu.h @@ -123,6 +123,7 @@ typedef struct uint8_t skipped : 1; //!< \brief flag to indicate this block is skipped uint8_t merged : 1; //!< \brief flag to indicate this block is merged uint8_t merge_idx : 3; //!< \brief merge index + uint8_t tr_skip : 1; //!< \brief transform skip flag uint16_t cbf; @@ -137,7 +138,6 @@ typedef struct struct { int8_t mode; int8_t mode_chroma; - int8_t tr_skip; //!< \brief transform skip flag #if KVZ_SEL_ENCRYPTION int8_t mode_encry; #endif diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index 1d251a2e..1ad4aa50 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -372,7 +372,7 @@ static void encode_transform_unit(encoder_state_t * const state, width, 0, scan_idx, - cur_pu->intra.tr_skip); + cur_pu->tr_skip); } if (depth == MAX_DEPTH + 1) { diff --git a/src/transform.c b/src/transform.c index 160a7345..92f4c88e 100644 --- a/src/transform.c +++ b/src/transform.c @@ -369,19 +369,22 @@ static void quantize_tr_residual(encoder_state_t * const state, } } else if (can_use_trskip) { + int8_t tr_skip = 0; + // Try quantization with trskip and use it if it's better. has_coeffs = kvz_quantize_residual_trskip(state, cur_pu, tr_width, color, scan_idx, - &cur_pu->intra.tr_skip, + &tr_skip, lcu_width, lcu_width, ref, pred, pred, coeff); + cur_pu->tr_skip = tr_skip; } else { has_coeffs = kvz_quantize_residual(state, cur_pu,