From: Hien Ho Date: Mon, 12 Aug 2019 21:20:22 +0000 (-0700) Subject: vpx_dsp/loopfilter.c: fix int sanitizer warnings X-Git-Tag: v1.8.2~130^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6aa05171efeb405780475624b8a7eb30ac24858;p=libvpx vpx_dsp/loopfilter.c: fix int sanitizer warnings implicit conversion from type 'int' of value -139 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 117 (8-bit, signed) BUG=webm:1615 Change-Id: Ic64959759f4a188087aa24bedbae5f9fa60674ad --- diff --git a/vpx_dsp/loopfilter.c b/vpx_dsp/loopfilter.c index 47f30c96a..995602831 100644 --- a/vpx_dsp/loopfilter.c +++ b/vpx_dsp/loopfilter.c @@ -81,11 +81,11 @@ static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, uint8_t *op0, uint8_t *oq0, uint8_t *oq1) { int8_t filter1, filter2; - const int8_t ps1 = (int8_t)*op1 ^ 0x80; - const int8_t ps0 = (int8_t)*op0 ^ 0x80; - const int8_t qs0 = (int8_t)*oq0 ^ 0x80; - const int8_t qs1 = (int8_t)*oq1 ^ 0x80; - const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); + const int8_t ps1 = (int8_t)(*op1 ^ 0x80); + const int8_t ps0 = (int8_t)(*op0 ^ 0x80); + const int8_t qs0 = (int8_t)(*oq0 ^ 0x80); + const int8_t qs1 = (int8_t)(*oq1 ^ 0x80); + const int8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); // add outer taps if we have high edge variance int8_t filter = signed_char_clamp(ps1 - qs1) & hev; @@ -99,14 +99,14 @@ static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1, filter1 = signed_char_clamp(filter + 4) >> 3; filter2 = signed_char_clamp(filter + 3) >> 3; - *oq0 = signed_char_clamp(qs0 - filter1) ^ 0x80; - *op0 = signed_char_clamp(ps0 + filter2) ^ 0x80; + *oq0 = (uint8_t)(signed_char_clamp(qs0 - filter1) ^ 0x80); + *op0 = (uint8_t)(signed_char_clamp(ps0 + filter2) ^ 0x80); // outer tap adjustments filter = ROUND_POWER_OF_TWO(filter1, 1) & ~hev; - *oq1 = signed_char_clamp(qs1 - filter) ^ 0x80; - *op1 = signed_char_clamp(ps1 + filter) ^ 0x80; + *oq1 = (uint8_t)(signed_char_clamp(qs1 - filter) ^ 0x80); + *op1 = (uint8_t)(signed_char_clamp(ps1 + filter) ^ 0x80); } void vpx_lpf_horizontal_4_c(uint8_t *s, int pitch, const uint8_t *blimit, @@ -423,7 +423,7 @@ static INLINE void highbd_filter4(int8_t mask, uint8_t thresh, uint16_t *op1, const int16_t ps0 = (int16_t)*op0 - (0x80 << shift); const int16_t qs0 = (int16_t)*oq0 - (0x80 << shift); const int16_t qs1 = (int16_t)*oq1 - (0x80 << shift); - const uint16_t hev = highbd_hev_mask(thresh, *op1, *op0, *oq0, *oq1, bd); + const int16_t hev = highbd_hev_mask(thresh, *op1, *op0, *oq0, *oq1, bd); // Add outer taps if we have high edge variance. int16_t filter = signed_char_clamp_high(ps1 - qs1, bd) & hev;