Fix high bit-depth loop-filter sse2 compiling issue - part 1
The intrinsic statement _mm_subs_epi16() should take immediate. Feeding variable as its input argument will cause compile failure in older version gcc. Change-Id: I6a71efcc8d3b16b84715e0a9bcfa818494eea3f4
This commit is contained in:
parent
0f57d0a682
commit
2080e4b206
@ -21,10 +21,24 @@ static INLINE __m128i signed_char_clamp_bd_sse2(__m128i value, int bd) {
|
|||||||
|
|
||||||
const __m128i zero = _mm_set1_epi16(0);
|
const __m128i zero = _mm_set1_epi16(0);
|
||||||
const __m128i one = _mm_set1_epi16(1);
|
const __m128i one = _mm_set1_epi16(1);
|
||||||
const __m128i t80 = _mm_slli_epi16(_mm_set1_epi16(0x80), bd - 8);
|
__m128i t80, max, min;
|
||||||
const __m128i max = _mm_subs_epi16(
|
|
||||||
_mm_subs_epi16(_mm_slli_epi16(one, bd), one), t80);
|
if (bd == 8) {
|
||||||
const __m128i min = _mm_subs_epi16(zero, t80);
|
t80 = _mm_set1_epi16(0x80);
|
||||||
|
max = _mm_subs_epi16(
|
||||||
|
_mm_subs_epi16(_mm_slli_epi16(one, 8), one), t80);
|
||||||
|
} else if (bd == 10) {
|
||||||
|
t80 = _mm_set1_epi16(0x200);
|
||||||
|
max = _mm_subs_epi16(
|
||||||
|
_mm_subs_epi16(_mm_slli_epi16(one, 10), one), t80);
|
||||||
|
} else { // bd == 12
|
||||||
|
t80 = _mm_set1_epi16(0x800);
|
||||||
|
max = _mm_subs_epi16(
|
||||||
|
_mm_subs_epi16(_mm_slli_epi16(one, 12), one), t80);
|
||||||
|
}
|
||||||
|
|
||||||
|
min = _mm_subs_epi16(zero, t80);
|
||||||
|
|
||||||
ubounded = _mm_cmpgt_epi16(value, max);
|
ubounded = _mm_cmpgt_epi16(value, max);
|
||||||
lbounded = _mm_cmplt_epi16(value, min);
|
lbounded = _mm_cmplt_epi16(value, min);
|
||||||
retval = _mm_andnot_si128(_mm_or_si128(ubounded, lbounded), value);
|
retval = _mm_andnot_si128(_mm_or_si128(ubounded, lbounded), value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user