mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 01:06:46 +08:00
Make 565 use big endian consistent read/write word for s390.
BUG=171 TESTED=unittests on x86 not impacted. Review URL: https://webrtc-codereview.appspot.com/1022006 git-svn-id: http://libyuv.googlecode.com/svn/trunk@524 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
be560615bb
commit
3ae19cb834
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 522
|
Version: 524
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -96,4 +96,30 @@ typedef signed char int8;
|
|||||||
#endif // __GNUC__
|
#endif // __GNUC__
|
||||||
#endif // LIBYUV_API
|
#endif // LIBYUV_API
|
||||||
|
|
||||||
|
// Visual C x86 or GCC little endian.
|
||||||
|
#if defined(__x86_64__) || defined(_M_X64) || \
|
||||||
|
defined(__i386__) || defined(_M_IX86) || \
|
||||||
|
defined(__arm__) || defined(_M_ARM) || \
|
||||||
|
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||||
|
#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
|
#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT
|
||||||
|
|||||||
@ -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 522
|
#define LIBYUV_VERSION 524
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -692,25 +692,6 @@ int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Visual C x86 or GCC little endian.
|
|
||||||
#if defined(__x86_64__) || defined(_M_X64) || \
|
|
||||||
defined(__i386__) || defined(_M_IX86) || \
|
|
||||||
defined(__arm__) || defined(_M_ARM) || \
|
|
||||||
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
|
||||||
#define LIBYUV_LITTLE_ENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LIBYUV_LITTLE_ENDIAN
|
|
||||||
#define READWORD(p) (*reinterpret_cast<const uint32*>(p))
|
|
||||||
#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);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Must be multiple of 6 pixels. Will over convert to handle remainder.
|
// Must be multiple of 6 pixels. Will over convert to handle remainder.
|
||||||
// https://developer.apple.com/quicktime/icefloe/dispatch019.html#v210
|
// https://developer.apple.com/quicktime/icefloe/dispatch019.html#v210
|
||||||
static void V210ToUYVYRow_C(const uint8* src_v210, uint8* dst_uyvy, int width) {
|
static void V210ToUYVYRow_C(const uint8* src_v210, uint8* dst_uyvy, int width) {
|
||||||
|
|||||||
@ -210,25 +210,6 @@ int I400Copy(const uint8* src_y, int src_stride_y,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Visual C x86 or GCC little endian.
|
|
||||||
#if defined(__x86_64__) || defined(_M_X64) || \
|
|
||||||
defined(__i386__) || defined(_M_IX86) || \
|
|
||||||
defined(__arm__) || defined(_M_ARM) || \
|
|
||||||
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
|
||||||
#define LIBYUV_LITTLE_ENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LIBYUV_LITTLE_ENDIAN
|
|
||||||
#define WRITEWORD(p, v) *reinterpret_cast<uint32*>(p) = v
|
|
||||||
#else
|
|
||||||
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
|
|
||||||
|
|
||||||
#define EIGHTTOTEN(x) (x << 2 | x >> 6)
|
#define EIGHTTOTEN(x) (x << 2 | x >> 6)
|
||||||
static void UYVYToV210Row_C(const uint8* src_uyvy, uint8* dst_v210, int width) {
|
static void UYVYToV210Row_C(const uint8* src_uyvy, uint8* dst_v210, int width) {
|
||||||
for (int x = 0; x < width; x += 6) {
|
for (int x = 0; x < width; x += 6) {
|
||||||
|
|||||||
@ -182,7 +182,6 @@ void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int width) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(fbarchard): support big endian CPU
|
|
||||||
void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width) {
|
void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width) {
|
||||||
for (int x = 0; x < width - 1; x += 2) {
|
for (int x = 0; x < width - 1; x += 2) {
|
||||||
uint8 b0 = src_argb[0] >> 3;
|
uint8 b0 = src_argb[0] >> 3;
|
||||||
@ -191,8 +190,8 @@ void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width) {
|
|||||||
uint8 b1 = src_argb[4] >> 3;
|
uint8 b1 = src_argb[4] >> 3;
|
||||||
uint8 g1 = src_argb[5] >> 2;
|
uint8 g1 = src_argb[5] >> 2;
|
||||||
uint8 r1 = src_argb[6] >> 3;
|
uint8 r1 = src_argb[6] >> 3;
|
||||||
*reinterpret_cast<uint32*>(dst_rgb) = b0 | (g0 << 5) | (r0 << 11) |
|
WRITEWORD(dst_rgb, b0 | (g0 << 5) | (r0 << 11) |
|
||||||
(b1 << 16) | (g1 << 21) | (r1 << 27);
|
(b1 << 16) | (g1 << 21) | (r1 << 27));
|
||||||
dst_rgb += 4;
|
dst_rgb += 4;
|
||||||
src_argb += 8;
|
src_argb += 8;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user