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
This commit is contained in:
fbarchard@google.com 2013-01-07 09:44:45 +00:00
parent 3ae19cb834
commit 54ce26fca4
4 changed files with 20 additions and 20 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 524
Version: 525
License: BSD
License File: LICENSE

View File

@ -104,22 +104,4 @@ typedef signed char int8;
#define LIBYUV_LITTLE_ENDIAN
#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

View File

@ -22,6 +22,24 @@ extern "C" {
#define kMaxStride (2880 * 4)
#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) || \
defined(TARGET_IPHONE_SIMULATOR)
#define YUV_DISABLE_ASM

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 524
#define LIBYUV_VERSION 525
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT