From 9dfa76f94877db19e70ae846eef4a20bfb2481e8 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 8 Sep 2017 18:57:08 -0700 Subject: [PATCH] vpx_mem: make vpx_memset16 inline Change-Id: Ibb2cab930c95836e6d6e66300c33e7d08e4474d4 --- vpx_mem/vpx_mem.c | 9 --------- vpx_mem/vpx_mem.h | 9 ++++++++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/vpx_mem/vpx_mem.c b/vpx_mem/vpx_mem.c index a9be08680..eeba34c37 100644 --- a/vpx_mem/vpx_mem.c +++ b/vpx_mem/vpx_mem.c @@ -82,12 +82,3 @@ void vpx_free(void *memblk) { free(addr); } } - -#if CONFIG_VP9_HIGHBITDEPTH -void *vpx_memset16(void *dest, int val, size_t length) { - size_t i; - uint16_t *dest16 = (uint16_t *)dest; - for (i = 0; i < length; i++) *dest16++ = val; - return dest; -} -#endif // CONFIG_VP9_HIGHBITDEPTH diff --git a/vpx_mem/vpx_mem.h b/vpx_mem/vpx_mem.h index 733aff488..a4274b885 100644 --- a/vpx_mem/vpx_mem.h +++ b/vpx_mem/vpx_mem.h @@ -19,6 +19,8 @@ #include #include +#include "vpx/vpx_integer.h" + #if defined(__cplusplus) extern "C" { #endif @@ -29,7 +31,12 @@ void *vpx_calloc(size_t num, size_t size); void vpx_free(void *memblk); #if CONFIG_VP9_HIGHBITDEPTH -void *vpx_memset16(void *dest, int val, size_t length); +static INLINE void *vpx_memset16(void *dest, int val, size_t length) { + size_t i; + uint16_t *dest16 = (uint16_t *)dest; + for (i = 0; i < length; i++) *dest16++ = val; + return dest; +} #endif #include