[2/2] checkasm: vp9dsp: benchmark all sub-IDCTs (but not WHT or ADST).

Message ID 1479470225-28455-2-git-send-email-martin@martin.st
State Committed
Commit 06fec74cacbb0ef7f3e5ea0e6c9ced1b6fd7565d
Headers show

Commit Message

Martin Storsjö Nov. 18, 2016, 11:57 a.m.
From: "Ronald S. Bultje" <rsbultje@gmail.com>

---
 tests/checkasm/vp9dsp.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Comments

Janne Grunau Nov. 23, 2016, 9:36 p.m. | #1
On 2016-11-18 13:57:05 +0200, Martin Storsjö wrote:
> From: "Ronald S. Bultje" <rsbultje@gmail.com>
> 
> ---
>  tests/checkasm/vp9dsp.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
> index 690e0cf..25f9dd1 100644
> --- a/tests/checkasm/vp9dsp.c
> +++ b/tests/checkasm/vp9dsp.c
> @@ -269,14 +269,20 @@ static void check_itxfm(void)
>          int n_txtps = tx < TX_32X32 ? N_TXFM_TYPES : 1;
>  
>          for (txtp = 0; txtp < n_txtps; txtp++) {
> -            if (check_func(dsp.itxfm_add[tx][txtp], "vp9_inv_%s_%dx%d_add",
> -                           tx == 4 ? "wht_wht" : txtp_types[txtp], sz, sz)) {
> -                randomize_buffers();
> -                ftx(coef, tx, txtp, sz, BIT_DEPTH);
> -
> -                for (sub = (txtp == 0) ? 1 : 2; sub <= sz; sub <<= 1) {
> +            // skip testing sub-IDCTs for WHT or ADST since they don't
> +            // implement it in any of the SIMD functions. If they do,
> +            // consider changing this to ensure we have complete test
> +            // coverage
> +            for (sub = (txtp == 0 && tx < 4) ? 1 : sz; sub <= sz; sub <<= 1) {
> +                if (check_func(dsp.itxfm_add[tx][txtp],
> +                               "vp9_inv_%s_%dx%d_sub%d_add",
> +                               tx == 4 ? "wht_wht" : txtp_types[txtp],
> +                               sz, sz, sub)) {
>                      int eob;
>  
> +                    randomize_buffers();
> +                    ftx(coef, tx, txtp, sz, BIT_DEPTH);
> +
>                      if (sub < sz) {
>                          eob = copy_subcoefs(subcoef0, coef, tx, txtp,
>                                              sz, sub, BIT_DEPTH);
> @@ -294,8 +300,9 @@ static void check_itxfm(void)
>                          !iszero(subcoef0, sz * sz * SIZEOF_COEF) ||
>                          !iszero(subcoef1, sz * sz * SIZEOF_COEF))
>                          fail();
> +
> +                    bench_new(dst, sz * SIZEOF_PIXEL, coef, eob);
>                  }
> -                bench_new(dst, sz * SIZEOF_PIXEL, coef, sz * sz);
>              }
>          }
>      }

ok

Janne

Patch

diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
index 690e0cf..25f9dd1 100644
--- a/tests/checkasm/vp9dsp.c
+++ b/tests/checkasm/vp9dsp.c
@@ -269,14 +269,20 @@  static void check_itxfm(void)
         int n_txtps = tx < TX_32X32 ? N_TXFM_TYPES : 1;
 
         for (txtp = 0; txtp < n_txtps; txtp++) {
-            if (check_func(dsp.itxfm_add[tx][txtp], "vp9_inv_%s_%dx%d_add",
-                           tx == 4 ? "wht_wht" : txtp_types[txtp], sz, sz)) {
-                randomize_buffers();
-                ftx(coef, tx, txtp, sz, BIT_DEPTH);
-
-                for (sub = (txtp == 0) ? 1 : 2; sub <= sz; sub <<= 1) {
+            // skip testing sub-IDCTs for WHT or ADST since they don't
+            // implement it in any of the SIMD functions. If they do,
+            // consider changing this to ensure we have complete test
+            // coverage
+            for (sub = (txtp == 0 && tx < 4) ? 1 : sz; sub <= sz; sub <<= 1) {
+                if (check_func(dsp.itxfm_add[tx][txtp],
+                               "vp9_inv_%s_%dx%d_sub%d_add",
+                               tx == 4 ? "wht_wht" : txtp_types[txtp],
+                               sz, sz, sub)) {
                     int eob;
 
+                    randomize_buffers();
+                    ftx(coef, tx, txtp, sz, BIT_DEPTH);
+
                     if (sub < sz) {
                         eob = copy_subcoefs(subcoef0, coef, tx, txtp,
                                             sz, sub, BIT_DEPTH);
@@ -294,8 +300,9 @@  static void check_itxfm(void)
                         !iszero(subcoef0, sz * sz * SIZEOF_COEF) ||
                         !iszero(subcoef1, sz * sz * SIZEOF_COEF))
                         fail();
+
+                    bench_new(dst, sz * SIZEOF_PIXEL, coef, eob);
                 }
-                bench_new(dst, sz * SIZEOF_PIXEL, coef, sz * sz);
             }
         }
     }