mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
[LMCS] Fix casting of the chroma scaled residual
This commit is contained in:
parent
b22fd61c7f
commit
c004735821
|
@ -677,7 +677,7 @@ int kvz_quantize_residual_avx2(encoder_state_t *const state,
|
|||
for (x = 0; x < width; ++x) {
|
||||
sign = residual[x + y * width] >= 0 ? 1 : -1;
|
||||
absval = sign * residual[x + y * width];
|
||||
residual[x + y * width] = (int8_t)CLIP(-maxAbsclipBD, maxAbsclipBD, sign * (((absval << CSCALE_FP_PREC) + (lmcs_chroma_adj >> 1)) / lmcs_chroma_adj));
|
||||
residual[x + y * width] = (int16_t)CLIP(-maxAbsclipBD, maxAbsclipBD, sign * (((absval << CSCALE_FP_PREC) + (lmcs_chroma_adj >> 1)) / lmcs_chroma_adj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ int kvz_quantize_residual_generic(encoder_state_t *const state,
|
|||
for (x = 0; x < width; ++x) {
|
||||
sign = residual[x + y * width] >= 0 ? 1 : -1;
|
||||
absval = sign * residual[x + y * width];
|
||||
residual[x + y * width] = (int8_t)CLIP(-maxAbsclipBD, maxAbsclipBD, sign * (((absval << CSCALE_FP_PREC) + (lmcs_chroma_adj >> 1)) / lmcs_chroma_adj));
|
||||
residual[x + y * width] = (int16_t)CLIP(-maxAbsclipBD, maxAbsclipBD, sign * (((absval << CSCALE_FP_PREC) + (lmcs_chroma_adj >> 1)) / lmcs_chroma_adj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue