Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/common/aarch64/loopfilter-prim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ namespace

static inline int8x8_t sign_diff_neon(const uint8x8_t in0, const uint8x8_t in1)
{
int16x8_t in = vreinterpretq_s16_u16(vsubl_u8(in0, in1));
uint8x8_t lt = vclt_u8(in0, in1);
uint8x8_t gt = vcgt_u8(in0, in1);

return vmovn_s16(vmaxq_s16(vminq_s16(in, vdupq_n_s16(1)), vdupq_n_s16(-1)));
return vreinterpret_s8_u8(vsub_u8(lt, gt));
}

static void calSign_neon(int8_t *dst, const pixel *src1, const pixel *src2, const int endX)
Expand Down
6 changes: 3 additions & 3 deletions source/common/aarch64/sao-prim.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static inline int8x16_t signOf_neon(const pixel *a, const pixel *b)
uint16x8_t s1_lo = vld1q_u16(b);
uint16x8_t s1_hi = vld1q_u16(b + 8);

// signOf(a - b) = -(a > b ? -1 : 0) | (a < b ? -1 : 0)
// signOf(a - b) = (a < b ? -1 : 0) - (a > b ? -1 : 0)
int16x8_t cmp0_lo = vreinterpretq_s16_u16(vcgtq_u16(s0_lo, s1_lo));
int16x8_t cmp0_hi = vreinterpretq_s16_u16(vcgtq_u16(s0_hi, s1_hi));
int16x8_t cmp1_lo = vreinterpretq_s16_u16(vcgtq_u16(s1_lo, s0_lo));
Expand All @@ -47,11 +47,11 @@ static inline int8x16_t signOf_neon(const pixel *a, const pixel *b)
uint8x16_t s0 = vld1q_u8(a);
uint8x16_t s1 = vld1q_u8(b);

// signOf(a - b) = -(a > b ? -1 : 0) | (a < b ? -1 : 0)
// signOf(a - b) = (a < b ? -1 : 0) - (a > b ? -1 : 0)
int8x16_t cmp0 = vreinterpretq_s8_u8(vcgtq_u8(s0, s1));
int8x16_t cmp1 = vreinterpretq_s8_u8(vcgtq_u8(s1, s0));
#endif // HIGH_BIT_DEPTH
return vorrq_s8(vnegq_s8(cmp0), cmp1);
return vsubq_s8(cmp1, cmp0);
}

namespace X265_NS {
Expand Down