mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
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:
parent
982e60c695
commit
fb462b25ef
2
src/cu.h
2
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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue