Improve high bitdepth CLPF SIMD

The high bitdepth was a direct translation of the low bit code, but
the tricks to keep 9 bit differences saturated within 8 bit are
redundant in high bitdepth, so the these were replaced with simpler
and more readable code.

Change-Id: I0710a1f1b9dcde8039d3dfa0f74cd2ea2b3bae27
This commit is contained in:
Steinar Midtskogen 2017-03-31 20:55:19 +02:00
Родитель 9cf0c9cde7
Коммит 6501122f1a
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -209,8 +209,9 @@ void SIMD_FUNC(aom_clpf_hblock)(uint8_t *dst, const uint16_t *src, int dstride,
// strength + (abs(a - b) >> (dmp - log2(s)))))
SIMD_INLINE v128 constrain_hbd(v128 a, v128 b, unsigned int strength,
unsigned int dmp) {
const v128 diff = v128_sub_16(v128_max_s16(a, b), v128_min_s16(a, b));
const v128 sign = v128_cmpeq_16(v128_min_s16(a, b), a); // -(a <= b)
v128 diff = v128_sub_16(a, b);
const v128 sign = v128_shr_n_s16(diff, 15);
diff = v128_abs_s16(diff);
const v128 zero = v128_zero();
const v128 s = v128_max_s16(
zero, v128_sub_16(v128_dup_16(strength),