mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-28 18:07:12 +08:00
Don't require exact float matches in TestSsimAnyWidth
Float computations can get different rounding depending on
the implementation. In particular, if the C code is built with
a compiler that uses x87 for float math, it is common that
there is a small variance in the results.
This fixes test failures on GCC i686 mingw targets, where it
previously failed like this:
unit_test/compare_test.cc:725: Failure
Expected equality of these values:
c_ssim
Which is: -0.076010095487114751
opt_ssim
Which is: -0.076010095487114751
width 17 offset 1
[...]
Change-Id: Id109058a89da78e38a8a7224a071a5c2075c66d6
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8615658
Reviewed-by: Frank Barchard <fbarchard@google.com>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
This commit is contained in:
parent
f249eaa72f
commit
94d970860e
@ -722,7 +722,8 @@ TEST_F(LibYUVCompareTest, TestSsimAnyWidth) {
|
|||||||
double c_ssim = CalcFrameSsim(a, width, b, width, width, kHeight);
|
double c_ssim = CalcFrameSsim(a, width, b, width, width, kHeight);
|
||||||
MaskCpuFlags(benchmark_cpu_info_);
|
MaskCpuFlags(benchmark_cpu_info_);
|
||||||
double opt_ssim = CalcFrameSsim(a, width, b, width, width, kHeight);
|
double opt_ssim = CalcFrameSsim(a, width, b, width, width, kHeight);
|
||||||
EXPECT_EQ(c_ssim, opt_ssim) << "width " << width << " offset " << offset;
|
double ssim_diff = c_ssim - opt_ssim;
|
||||||
|
EXPECT_LT(ssim_diff, 0.0001) << "width " << width << " offset " << offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user