mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
Round the fast coeff result instead of flooring
This commit is contained in:
parent
0fb09c9920
commit
4712ce5f59
|
@ -850,7 +850,7 @@ static uint32_t fast_coeff_cost_avx2(const coeff_t *coeff, int32_t width, int32_
|
|||
__m256i sum4 = _mm256_add_epi64 (sum2, sum3);
|
||||
|
||||
__m128i sum128 = _mm256_castsi256_si128 (sum4);
|
||||
return _mm_cvtsi128_si32(sum128) >> 8;
|
||||
return (_mm_cvtsi128_si32(sum128) + (1 << 7)) >> 8;
|
||||
}
|
||||
|
||||
#endif //COMPILE_INTEL_AVX2 && defined X86_64
|
||||
|
|
|
@ -359,7 +359,7 @@ static uint32_t fast_coeff_cost_generic(const coeff_t *coeff, int32_t width, int
|
|||
}
|
||||
sum += weights[curr_abs];
|
||||
}
|
||||
return sum >> 8;
|
||||
return (sum + (1 << 7)) >> 8;
|
||||
}
|
||||
|
||||
int kvz_strategy_register_quant_generic(void* opaque, uint8_t bitdepth)
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
)
|
||||
|
||||
// Weights for 4 buckets (coeff 0, coeff 1, coeff 2, coeff >= 3), for QPs from
|
||||
// 0 to 50 with ultrafast encoding
|
||||
// MIN_FAST_COEFF_COST_QP to MAX_FAST_COEFF_COST_QP with ultrafast encoding
|
||||
static const uint64_t fast_coeff_cost_wts[FAST_COEFF_QP_COUNT] = {
|
||||
TO_4XQ88(0.134012, 4.207784, 3.431633, 6.556149),
|
||||
TO_4XQ88(0.122972, 4.278606, 3.398710, 6.527168),
|
||||
|
|
Loading…
Reference in a new issue