Commit 5181f491 authored by Martin Storsjö's avatar Martin Storsjö

checkasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon for sum_square

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 3750e36a
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
*/ */
#include "libavcodec/sbrdsp.h" #include "libavcodec/sbrdsp.h"
#include <float.h>
#include "checkasm.h" #include "checkasm.h"
...@@ -51,13 +52,14 @@ static void test_sum_square(void) ...@@ -51,13 +52,14 @@ static void test_sum_square(void)
INTFLOAT res0; INTFLOAT res0;
INTFLOAT res1; INTFLOAT res1;
LOCAL_ALIGNED_16(INTFLOAT, src, [256], [2]); LOCAL_ALIGNED_16(INTFLOAT, src, [256], [2]);
double t = 4 * 256;
declare_func_float(INTFLOAT, INTFLOAT (*x)[2], int n); declare_func_float(INTFLOAT, INTFLOAT (*x)[2], int n);
randomize((INTFLOAT *)src, 256 * 2); randomize((INTFLOAT *)src, 256 * 2);
res0 = call_ref(src, 256); res0 = call_ref(src, 256);
res1 = call_new(src, 256); res1 = call_new(src, 256);
if (!float_near_abs_eps(res0, res1, EPS)) if (!float_near_abs_eps(res0, res1, t * 2 * FLT_EPSILON))
fail(); fail();
bench_new(src, 256); bench_new(src, 256);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment