mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
fix endian problem on PowerPC
not super-elegant, but should work without having to go into deeper hacking (like: creating an endian.h file, etc.) Change-Id: I43100ec67a22393c87e11357078efffc750060f5
This commit is contained in:
parent
beb0a1badb
commit
ea27d7c6a8
@ -403,8 +403,13 @@ static const uint8_t kUnpackTab[16][4] = {
|
||||
{0, 0, 1, 1}, {1, 0, 1, 1}, {0, 1, 1, 1}, {1, 1, 1, 1} };
|
||||
|
||||
// Macro to pack four LSB of four bytes into four bits.
|
||||
#define PACK(X, S) \
|
||||
((((*(uint32_t*)(X)) * 0x01020408U) & 0xff000000) >> (S))
|
||||
#if defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || \
|
||||
defined(__BIG_ENDIAN__)
|
||||
#define PACK_CST 0x08040201U
|
||||
#else
|
||||
#define PACK_CST 0x01020408U
|
||||
#endif
|
||||
#define PACK(X, S) ((((*(uint32_t*)(X)) * PACK_CST) & 0xff000000) >> (S))
|
||||
|
||||
typedef const uint8_t (*Proba_t)[NUM_CTX][NUM_PROBAS]; // for const-casting
|
||||
static int ParseResiduals(VP8Decoder* const dec,
|
||||
|
Loading…
Reference in New Issue
Block a user