introduce WebPMemToUint32 and WebPUint32ToMem for memory access

it uses memcpy() when unaligned memory write is tricky

Change-Id: I5d966ca9d19e9b43ac90140fa487824116982874
This commit is contained in:
Pascal Massimino
2015-12-02 12:09:06 +01:00
parent 010ca3d10d
commit 2c08aac81a
11 changed files with 112 additions and 108 deletions

View File

@ -490,7 +490,7 @@ static void CopyOrSwap(const uint32_t* src, int num_pixels, uint8_t* dst,
#if !defined(WORDS_BIGENDIAN)
#if !defined(WEBP_REFERENCE_IMPLEMENTATION)
*(uint32_t*)dst = BSwap32(argb);
WebPUint32ToMem(dst, BSwap32(argb));
#else // WEBP_REFERENCE_IMPLEMENTATION
dst[0] = (argb >> 24) & 0xff;
dst[1] = (argb >> 16) & 0xff;