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

@ -199,7 +199,7 @@ void VP8LDoFillBitWindow(VP8LBitReader* const br) {
br->bit_pos_ -= VP8L_WBITS;
// The expression below needs a little-endian arch to work correctly.
// This gives a large speedup for decoding speed.
br->val_ |= (vp8l_val_t)*(const uint32_t*)(br->buf_ + br->pos_) <<
br->val_ |= (vp8l_val_t)WebPMemToUint32(br->buf_ + br->pos_) <<
(VP8L_LBITS - VP8L_WBITS);
br->pos_ += VP8L_LOG8_WBITS;
return;