Skip to content

Commit

Permalink
Fix transform skip for inter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aryla committed Mar 20, 2018
1 parent 982e60c commit fb462b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/encode_coding_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fb462b2

Please sign in to comment.