Commit 54ce26fc authored by fbarchard@google.com's avatar fbarchard@google.com

Move WRITEWORD to row.h

BUG=171
TEST=none
Review URL: https://webrtc-codereview.appspot.com/1025004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@525 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 3ae19cb8
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 524 Version: 525
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -104,22 +104,4 @@ typedef signed char int8; ...@@ -104,22 +104,4 @@ typedef signed char int8;
#define LIBYUV_LITTLE_ENDIAN #define LIBYUV_LITTLE_ENDIAN
#endif #endif
#ifdef LIBYUV_LITTLE_ENDIAN
#define READWORD(p) (*reinterpret_cast<const uint32*>(p))
#define WRITEWORD(p, v) *reinterpret_cast<uint32*>(p) = v
#else
static inline uint32 READWORD(const uint8* p) {
return static_cast<uint32>(p[0]) |
(static_cast<uint32>(p[1]) << 8) |
(static_cast<uint32>(p[2]) << 16) |
(static_cast<uint32>(p[3]) << 24);
}
static inline void WRITEWORD(uint8* p, uint32 v) {
p[0] = (uint8)(v & 255);
p[1] = (uint8)((v >> 8) & 255);
p[2] = (uint8)((v >> 16) & 255);
p[3] = (uint8)((v >> 24) & 255);
}
#endif
#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT #endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT
...@@ -22,6 +22,24 @@ extern "C" { ...@@ -22,6 +22,24 @@ extern "C" {
#define kMaxStride (2880 * 4) #define kMaxStride (2880 * 4)
#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) #define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
#ifdef LIBYUV_LITTLE_ENDIAN
#define READWORD(p) (*reinterpret_cast<const uint32*>(p))
#define WRITEWORD(p, v) *reinterpret_cast<uint32*>(p) = v
#else
static inline uint32 READWORD(const uint8* p) {
return static_cast<uint32>(p[0]) |
(static_cast<uint32>(p[1]) << 8) |
(static_cast<uint32>(p[2]) << 16) |
(static_cast<uint32>(p[3]) << 24);
}
static inline void WRITEWORD(uint8* p, uint32 v) {
p[0] = (uint8)(v & 255);
p[1] = (uint8)((v >> 8) & 255);
p[2] = (uint8)((v >> 16) & 255);
p[3] = (uint8)((v >> 24) & 255);
}
#endif
#if defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ #if defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \
defined(TARGET_IPHONE_SIMULATOR) defined(TARGET_IPHONE_SIMULATOR)
#define YUV_DISABLE_ASM #define YUV_DISABLE_ASM
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 524 #define LIBYUV_VERSION 525
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment