Fix Clang -Wshorten-64-to-32 warnings
aom/aom_dsp/arm/highbd_quantize_neon.c:131:24: warning: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
int non_zero_count = n_coeffs;
~~~~~~~~~~~~~~ ^~~~~~~~
aom/aom_dsp/arm/highbd_quantize_neon.c:136:11: warning: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
int i = n_coeffs;
~ ^~~~~~~~
aom/aom_dsp/arm/highbd_quantize_neon.c:153:42: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
const int remaining_zcoeffs = n_coeffs - non_zero_count;
~~~~~~~~~~~~~~~~~ ~~~~~~~~~^~~~~~~~~~~~~~~~
Bug: b/217282899
Change-Id: I7df0786bd8266e8e4226dc1e570f3e2002a6c73c
diff --git a/aom_dsp/arm/highbd_quantize_neon.c b/aom_dsp/arm/highbd_quantize_neon.c
index 7ab5663..bf218e9 100644
--- a/aom_dsp/arm/highbd_quantize_neon.c
+++ b/aom_dsp/arm/highbd_quantize_neon.c
@@ -128,12 +128,12 @@
uint16x4_t v_mask_lo, v_mask_hi;
int16x8_t v_eobmax = vdupq_n_s16(-1);
- int non_zero_count = n_coeffs;
+ intptr_t non_zero_count = n_coeffs;
assert(n_coeffs > 8);
// Pre-scan pass
const int32x4_t v_zbin_s32x = vdupq_lane_s32(vget_low_s32(v_zbin_s32), 1);
- int i = n_coeffs;
+ intptr_t i = n_coeffs;
do {
const int32x4_t v_coeff_a = vld1q_s32(coeff_ptr + i - 4);
const int32x4_t v_coeff_b = vld1q_s32(coeff_ptr + i - 8);
@@ -150,7 +150,7 @@
i -= 8;
} while (i > 0);
- const int remaining_zcoeffs = n_coeffs - non_zero_count;
+ const intptr_t remaining_zcoeffs = n_coeffs - non_zero_count;
memset(qcoeff_ptr + non_zero_count, 0,
remaining_zcoeffs * sizeof(*qcoeff_ptr));
memset(dqcoeff_ptr + non_zero_count, 0,
@@ -176,7 +176,7 @@
v_eobmax =
get_max_lane_eob(iscan, v_eobmax, vcombine_u16(v_mask_lo, v_mask_hi));
- int count = non_zero_count - 8;
+ intptr_t count = non_zero_count - 8;
for (; count > 0; count -= 8) {
coeff_ptr += 8;
qcoeff_ptr += 8;