On Thu, 21 Jul 2016, Diego Biurrun wrote:

On Thu, Jul 21, 2016 at 12:57:36PM +0200, Alexandra Hájková wrote:
--- /dev/null
+++ b/tests/checkasm/hevc_idct.c
@@ -0,0 +1,75 @@
+
+#include <string.h>
+
+#include "checkasm.h"
+
+#include "libavcodec/avcodec.h"
+#include "libavcodec/hevcdsp.h"
+
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"

The order of the include blocks is reserved.

Reversed, not reserved

+#define randomize_buffers(buf, size)            \
+    do {                                        \
+        int j;                                  \
+        for (j = 0; j < size; j++) {            \
+            int16_t r = rnd();                  \
+            AV_WN16A(buf + j, r);               \
+        }                                       \
+    } while (0)
+
+static void check_idct_dc(HEVCDSPContext h, int bit_depth)
+{
+    int i;
+    LOCAL_ALIGNED(32, int16_t, coeffs0, [32 * 32]);
+    LOCAL_ALIGNED(32, int16_t, coeffs1, [32 * 32]);
+
+    for (i = 2; i <= 5; i++) {
+        int block_size = 1 << i;
+        int size = block_size * block_size;
+        declare_func_emms(AV_CPU_FLAG_MMXEXT, void, int16_t *coeffs);
+
+        randomize_buffers(coeffs0, size);
+        memcpy(coeffs1, coeffs0, sizeof(*coeffs0) * size);
+
+        if (check_func(h.idct_dc[i - 2], "idct_%dx%d_dc_%d", block_size, 
block_size, bit_depth)) {
+            call_ref(coeffs0);
+            call_new(coeffs1);
+            if (memcmp(coeffs0, coeffs1, sizeof(*coeffs0) * size))
+                fail();
+            bench_new(coeffs1);
+        }
+    }
+}

The macro is only used in one place.  It's also unclear to me why you
made it a macro and not a function.

This is the common style for all checkasm tests. So don't enforce a different style here now, rather take it up for discussion (with others who have written and read lots of checkasm tests) for the existing code first.

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to