[FFmpeg-devel] tests/checkasm/aacpsdsp: Increase EPS for interpolate so that the test passes on kfreebsd

Submitted by Michael Niedermayer on April 15, 2018, 8:51 p.m.

Details

Message ID 20180415205102.32095-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer April 15, 2018, 8:51 p.m.
The value is minimal, 0.11 fails

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tests/checkasm/aacpsdsp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

James Almer April 15, 2018, 9:16 p.m.
On 4/15/2018 5:51 PM, Michael Niedermayer wrote:
> The value is minimal, 0.11 fails
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  tests/checkasm/aacpsdsp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/checkasm/aacpsdsp.c b/tests/checkasm/aacpsdsp.c
> index ea68b39fa9..9e30eaa497 100644
> --- a/tests/checkasm/aacpsdsp.c
> +++ b/tests/checkasm/aacpsdsp.c
> @@ -33,6 +33,7 @@
>  } while (0)
>  
>  #define EPS 0.005
> +#define EPS2 0.12

That's kind of like a lot, but to be fair 0.005 was already a lot as
well, considering other tests succeed with just FLT_EPSILON or values
like 0.0000007.

Should be ok if that's really the smallest value that succeeds.

>  
>  static void test_add_squares(void)
>  {
> @@ -201,8 +202,8 @@ static void test_stereo_interpolate(PSDSPContext *psdsp)
>  
>              call_ref(l0, r0, h, h_step, BUF_SIZE);
>              call_new(l1, r1, h, h_step, BUF_SIZE);
> -            if (!float_near_abs_eps_array((float *)l0, (float *)l1, EPS, BUF_SIZE * 2) ||
> -                !float_near_abs_eps_array((float *)r0, (float *)r1, EPS, BUF_SIZE * 2))
> +            if (!float_near_abs_eps_array((float *)l0, (float *)l1, EPS2, BUF_SIZE * 2) ||
> +                !float_near_abs_eps_array((float *)r0, (float *)r1, EPS2, BUF_SIZE * 2))
>                  fail();
>  
>              memcpy(l1, l, BUF_SIZE * 2 * sizeof(INTFLOAT));
>
Michael Niedermayer April 15, 2018, 10:07 p.m.
On Sun, Apr 15, 2018 at 06:16:52PM -0300, James Almer wrote:
> On 4/15/2018 5:51 PM, Michael Niedermayer wrote:
> > The value is minimal, 0.11 fails
> > 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  tests/checkasm/aacpsdsp.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/checkasm/aacpsdsp.c b/tests/checkasm/aacpsdsp.c
> > index ea68b39fa9..9e30eaa497 100644
> > --- a/tests/checkasm/aacpsdsp.c
> > +++ b/tests/checkasm/aacpsdsp.c
> > @@ -33,6 +33,7 @@
> >  } while (0)
> >  
> >  #define EPS 0.005
> > +#define EPS2 0.12
> 
> That's kind of like a lot, but to be fair 0.005 was already a lot as
> well, considering other tests succeed with just FLT_EPSILON or values
> like 0.0000007.
> 
> Should be ok if that's really the smallest value that succeeds.

its worse, 0.4 would be needed at least it seems. I withdraw this
patch for now. It would be more ideal if the implementation could be
made more precisse.

If this doesnt happen we can still go back to this and apply it with 0.4


[...]

Patch hide | download patch | download mbox

diff --git a/tests/checkasm/aacpsdsp.c b/tests/checkasm/aacpsdsp.c
index ea68b39fa9..9e30eaa497 100644
--- a/tests/checkasm/aacpsdsp.c
+++ b/tests/checkasm/aacpsdsp.c
@@ -33,6 +33,7 @@ 
 } while (0)
 
 #define EPS 0.005
+#define EPS2 0.12
 
 static void test_add_squares(void)
 {
@@ -201,8 +202,8 @@  static void test_stereo_interpolate(PSDSPContext *psdsp)
 
             call_ref(l0, r0, h, h_step, BUF_SIZE);
             call_new(l1, r1, h, h_step, BUF_SIZE);
-            if (!float_near_abs_eps_array((float *)l0, (float *)l1, EPS, BUF_SIZE * 2) ||
-                !float_near_abs_eps_array((float *)r0, (float *)r1, EPS, BUF_SIZE * 2))
+            if (!float_near_abs_eps_array((float *)l0, (float *)l1, EPS2, BUF_SIZE * 2) ||
+                !float_near_abs_eps_array((float *)r0, (float *)r1, EPS2, BUF_SIZE * 2))
                 fail();
 
             memcpy(l1, l, BUF_SIZE * 2 * sizeof(INTFLOAT));