]> granicus.if.org Git - libvpx/commitdiff
Make tests work with new configurations
authorDebargha Mukherjee <debargha@google.com>
Thu, 27 Aug 2015 19:28:59 +0000 (12:28 -0700)
committerDebargha Mukherjee <debargha@google.com>
Thu, 27 Aug 2015 21:05:59 +0000 (14:05 -0700)
Disables some test vector tests when Vp8/Vp9 decoders are disabled
in configuration. Also moves some macros to the vpx level in
line with recent refactoring on the master branch.

Change-Id: Iaac8008992110398ae096c36b9726f723164c207

test/sad_test.cc
test/test_vector_test.cc
vp9/common/vp9_common.h
vpx_ports/mem.h

index 9c2629d495297db5e560ffff78d14d82f7fd9a58..c6e9ffe930eea412fc0466012766e70079dc8aac 100644 (file)
@@ -22,6 +22,7 @@
 #endif
 #include "vpx/vpx_codec.h"
 #include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/mem.h"
 
 #include "test/acm_random.h"
 #include "test/clear_system_state.h"
index 1f294f20b9fc051873020781e7a59b7dd66a41a1..449e9411cce91165d946642a0f6494fb1e8e6dac 100644 (file)
@@ -97,13 +97,18 @@ TEST_P(TestVectorTest, MD5Match) {
   delete video;
 }
 
+#if CONFIG_VP8_DECODER
 VP8_INSTANTIATE_TEST_CASE(TestVectorTest,
                           ::testing::ValuesIn(libvpx_test::kVP8TestVectors,
                                               libvpx_test::kVP8TestVectors +
                                               libvpx_test::kNumVP8TestVectors));
+#endif  // CONFIG_VP8_DECODER
+
+#if CONFIG_VP9_DECODER
 VP9_INSTANTIATE_TEST_CASE(TestVectorTest,
                           ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
                                               libvpx_test::kVP9TestVectors +
                                               libvpx_test::kNumVP9TestVectors));
+#endif  // CONFIG_VP9_DECODER
 
 }  // namespace
index cedce068a959232954c6ca977611ebc67ec9b66e..d4f6ed3ca120eeb6fb7beaa53506f71424b6038e 100644 (file)
@@ -16,8 +16,9 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx_mem/vpx_mem.h"
 #include "vpx/vpx_integer.h"
+#include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/mem.h"
 #include "vp9/common/vp9_systemdependent.h"
 
 #ifdef __cplusplus
@@ -27,12 +28,6 @@ extern "C" {
 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
 
-#define ROUND_POWER_OF_TWO(value, n) \
-    (((value) + (1 << ((n) - 1))) >> (n))
-
-#define ALIGN_POWER_OF_TWO(value, n) \
-    (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
-
 // Only need this for fixed-size arrays, for structs just assign.
 #define vp9_copy(dest, src) {            \
     assert(sizeof(dest) == sizeof(src)); \
@@ -83,9 +78,6 @@ static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
 typedef int64_t tran_high_t;
 typedef int32_t tran_low_t;
 
-#define CONVERT_TO_SHORTPTR(x) ((uint16_t*)(((uintptr_t)x) << 1))
-#define CONVERT_TO_BYTEPTR(x) ((uint8_t*)(((uintptr_t)x) >> 1 ))
-
 #else
 
 // Note:
index 1cb8c8cd9afcc43fa6c9d658394ce25d3b791c79..5021729a4ed40130fab136ec07db87dd5d6265fe 100644 (file)
 #define __builtin_prefetch(x)
 #endif
 
+/* Shift down with rounding */
+#define ROUND_POWER_OF_TWO(value, n) \
+    (((value) + (1 << ((n) - 1))) >> (n))
+#define ALIGN_POWER_OF_TWO(value, n) \
+    (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
+
+#if CONFIG_VP9_HIGHBITDEPTH
+#define CONVERT_TO_SHORTPTR(x) ((uint16_t*)(((uintptr_t)x) << 1))
+#define CONVERT_TO_BYTEPTR(x) ((uint8_t*)(((uintptr_t)x) >> 1))
+#endif  // CONFIG_VP9_HIGHBITDEPTH
+
 #endif  // VPX_PORTS_MEM_H_