summaryrefslogtreecommitdiff
path: root/vpx_ports
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2015-05-11 19:09:22 -0700
committerJohann <johannkoenig@google.com>2015-05-13 11:41:15 -0700
commit1d7ccd5325ec34244074419f6802640c8afafd31 (patch)
tree225192c4725a2596cbf7904d8edf0e420ce8aa25 /vpx_ports
parent465ce0e42067ad85019fe1f2f98bf5b081c89880 (diff)
downloadlibvpx-1d7ccd5325ec34244074419f6802640c8afafd31.tar
libvpx-1d7ccd5325ec34244074419f6802640c8afafd31.tar.gz
libvpx-1d7ccd5325ec34244074419f6802640c8afafd31.tar.bz2
libvpx-1d7ccd5325ec34244074419f6802640c8afafd31.zip
Relocate memory operations for common code
With the sad functions, and hopefully the variance functions soon, moving to the vpx_dsp location, place the defines used in the reference C code in a common location. Change-Id: I4c8ce7778eb38a0a3ee674d2f1c488eda01cfeca
Diffstat (limited to 'vpx_ports')
-rw-r--r--vpx_ports/mem.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/vpx_ports/mem.h b/vpx_ports/mem.h
index 0106a45d6..7502f9063 100644
--- a/vpx_ports/mem.h
+++ b/vpx_ports/mem.h
@@ -38,4 +38,16 @@
#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_