Disable inaccurate integer variance calculation for now
@@ -1137,6 +1137,8 @@ static double pixel_var_avx2_largebuf(const kvz_pixel *buf, const uint32_t len)
return var_sum / len_f;
}
+#ifdef INACCURATE_VARIANCE_CALCULATION
+
// Assumes that u is a power of two
static INLINE uint32_t ilog2(uint32_t u)
{
@@ -1220,6 +1222,15 @@ static double pixel_var_avx2(const kvz_pixel *buf, const uint32_t len)
return (float)vars * varsum_to_f;
}
+#else // INACCURATE_VARIANCE_CALCULATION
+
+static double pixel_var_avx2(const kvz_pixel *buf, const uint32_t len)
+{
+ return pixel_var_avx2_largebuf(buf, len);
+}
+
+#endif // !INACCURATE_VARIANCE_CALCULATION
+
#endif //COMPILE_INTEL_AVX2
int kvz_strategy_register_picture_avx2(void* opaque, uint8_t bitdepth)
