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:
Pascal Massimino 2010-11-08 15:44:37 -08:00
parent beb0a1badb
commit ea27d7c6a8

View File

@ -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} }; {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. // Macro to pack four LSB of four bytes into four bits.
#define PACK(X, S) \ #if defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || \
((((*(uint32_t*)(X)) * 0x01020408U) & 0xff000000) >> (S)) 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 typedef const uint8_t (*Proba_t)[NUM_CTX][NUM_PROBAS]; // for const-casting
static int ParseResiduals(VP8Decoder* const dec, static int ParseResiduals(VP8Decoder* const dec,