mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 14:18:21 +01:00
Merge "configure: add --enable-aligned"
This commit is contained in:
commit
6fbf5345e3
13
configure.ac
13
configure.ac
@ -411,6 +411,19 @@ if test \( "$target_os" = "mingw32" -o "$target_os" = "mingw64" \) \
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl === If --enable-aligned is defined, define WEBP_FORCE_ALIGNED
|
||||
|
||||
AC_MSG_CHECKING(if --enable-aligned option is specified)
|
||||
AC_ARG_ENABLE([aligned],
|
||||
AS_HELP_STRING([--enable-aligned],
|
||||
[Force aligned memory operations in non-dsp code
|
||||
(may be slower)]))
|
||||
if test "$enable_aligned" = "yes"; then
|
||||
AC_DEFINE(WEBP_FORCE_ALIGNED, [1],
|
||||
[Define to 1 to force aligned memory operations])
|
||||
fi
|
||||
AC_MSG_RESULT(${enable_aligned-no})
|
||||
|
||||
dnl === If --enable-swap-16bit-csp is defined, add -DWEBP_SWAP_16BIT_CSP
|
||||
|
||||
USE_SWAP_16BIT_CSP=""
|
||||
|
@ -16,6 +16,14 @@
|
||||
#ifndef WEBP_UTILS_BIT_READER_INL_H_
|
||||
#define WEBP_UTILS_BIT_READER_INL_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../webp/config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WEBP_FORCE_ALIGNED
|
||||
#include <string.h> // memcpy
|
||||
#endif
|
||||
|
||||
#include "./bit_reader.h"
|
||||
#include "./endian_inl.h"
|
||||
|
||||
@ -52,7 +60,10 @@ static WEBP_INLINE void VP8LoadNewBytes(VP8BitReader* const br) {
|
||||
if (br->buf_ + sizeof(lbit_t) <= br->buf_end_) {
|
||||
// convert memory type to register type (with some zero'ing!)
|
||||
bit_t bits;
|
||||
#if defined(__mips__) // MIPS
|
||||
#if defined(WEBP_FORCE_ALIGNED)
|
||||
lbit_t in_bits;
|
||||
memcpy(&in_bits, br->buf_, sizeof(in_bits));
|
||||
#elif defined(__mips__) // MIPS
|
||||
// This is needed because of un-aligned read.
|
||||
lbit_t in_bits;
|
||||
lbit_t* p_buf_ = (lbit_t*)br->buf_;
|
||||
|
Loading…
Reference in New Issue
Block a user