Fix transform skip for inter

The transform skip flag in cu_info_t was stored under the intra
substruct even though transform skip can be used for inter as well. This
caused bitstream errors. Fixed by moving the flag out of the substruct.
This commit is contained in:
Arttu Ylä-Outinen 2018-03-19 13:01:47 +02:00
parent 982e60c695
commit fb462b25ef
3 changed files with 6 additions and 3 deletions

View file

@ -123,6 +123,7 @@ typedef struct
uint8_t skipped : 1; //!< \brief flag to indicate this block is skipped 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 merged : 1; //!< \brief flag to indicate this block is merged
uint8_t merge_idx : 3; //!< \brief merge index uint8_t merge_idx : 3; //!< \brief merge index
uint8_t tr_skip : 1; //!< \brief transform skip flag
uint16_t cbf; uint16_t cbf;
@ -137,7 +138,6 @@ typedef struct
struct { struct {
int8_t mode; int8_t mode;
int8_t mode_chroma; int8_t mode_chroma;
int8_t tr_skip; //!< \brief transform skip flag
#if KVZ_SEL_ENCRYPTION #if KVZ_SEL_ENCRYPTION
int8_t mode_encry; int8_t mode_encry;
#endif #endif

View file

@ -372,7 +372,7 @@ static void encode_transform_unit(encoder_state_t * const state,
width, width,
0, 0,
scan_idx, scan_idx,
cur_pu->intra.tr_skip); cur_pu->tr_skip);
} }
if (depth == MAX_DEPTH + 1) { if (depth == MAX_DEPTH + 1) {

View file

@ -369,19 +369,22 @@ static void quantize_tr_residual(encoder_state_t * const state,
} }
} else if (can_use_trskip) { } else if (can_use_trskip) {
int8_t tr_skip = 0;
// Try quantization with trskip and use it if it's better. // Try quantization with trskip and use it if it's better.
has_coeffs = kvz_quantize_residual_trskip(state, has_coeffs = kvz_quantize_residual_trskip(state,
cur_pu, cur_pu,
tr_width, tr_width,
color, color,
scan_idx, scan_idx,
&cur_pu->intra.tr_skip, &tr_skip,
lcu_width, lcu_width,
lcu_width, lcu_width,
ref, ref,
pred, pred,
pred, pred,
coeff); coeff);
cur_pu->tr_skip = tr_skip;
} else { } else {
has_coeffs = kvz_quantize_residual(state, has_coeffs = kvz_quantize_residual(state,
cur_pu, cur_pu,