VP8LFillBitWindow: respect WEBP_FORCE_ALIGNED

Change-Id: I23eddf01590de002efc21d8c7acc545a08fc3e48
This commit is contained in:
James Zern 2014-07-04 13:30:32 -07:00
parent e458badcc3
commit 4f7f52b2a1

View File

@ -11,6 +11,10 @@
//
// Author: Skal (pascal.massimino@gmail.com)
#ifdef HAVE_CONFIG_H
#include "../webp/config.h"
#endif
#include "./bit_reader_inl.h"
//------------------------------------------------------------------------------
@ -172,7 +176,11 @@ static void ShiftBytes(VP8LBitReader* const br) {
void VP8LFillBitWindow(VP8LBitReader* const br) {
if (br->bit_pos_ >= WBITS) {
#if (defined(__x86_64__) || defined(_M_X64))
// TODO(jzern): 1) this might be of benefit in 32-bit builds too, along with
// reducing the load size.
// 2) given the fixed read size it may be possible to force
// alignment in this block.
#if !defined(WEBP_FORCE_ALIGNED) && (defined(__x86_64__) || defined(_M_X64))
if (br->pos_ + sizeof(br->val_) < br->len_) {
br->val_ >>= WBITS;
br->bit_pos_ -= WBITS;