Unify the many definitions of NELEMENTS

Change-Id: Ie52ce24ca9eca272dfacfb17483ec7b7f2c126d4
diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc
index 14e43c8..80c42fe 100644
--- a/test/encode_api_test.cc
+++ b/test/encode_api_test.cc
@@ -12,13 +12,12 @@
 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
 
 #include "./aom_config.h"
+#include "test/util.h"
 #include "aom/aomcx.h"
 #include "aom/aom_encoder.h"
 
 namespace {
 
-#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
-
 TEST(EncodeAPI, InvalidParams) {
   static const aom_codec_iface_t *kCodecs[] = {
 #if CONFIG_AV1_ENCODER