speed up for ARM using 8bit for boolean decoder
SBITS=8 is reported 20-30% faster on ARM (where 64bit ops are expensive). Also use 32bits for i32. Change-Id: Id6a7197d805061aeb8832f20432512d0d930ebfa
This commit is contained in:
parent
5725cabac0
commit
2afee60a7c
@ -24,7 +24,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BITS 32 // can be 32, 16 or 8
|
||||
//------------------------------------------------------------------------------
|
||||
// BITS can be either 32, 16 or 8. Pick values that fit natural register size.
|
||||
|
||||
#if defined(__i386__) || defined(_M_IX86) // x86 32bit
|
||||
#define BITS 16
|
||||
#elif defined(__arm__) || defined(_M_ARM) // ARM
|
||||
#define BITS 8
|
||||
#else // reasonable default
|
||||
#define BITS 32
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Derived types and constants
|
||||
|
||||
#define MASK ((((bit_t)1) << (BITS)) - 1)
|
||||
#if (BITS == 32)
|
||||
typedef uint64_t bit_t; // natural register type
|
||||
@ -38,7 +51,7 @@ typedef uint8_t lbit_t;
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Bitreader and code-tree reader
|
||||
// Bitreader
|
||||
|
||||
typedef struct VP8BitReader VP8BitReader;
|
||||
struct VP8BitReader {
|
||||
@ -151,7 +164,7 @@ static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) {
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Bitreader
|
||||
// Bitreader for lossless format
|
||||
|
||||
typedef struct {
|
||||
uint64_t val_;
|
||||
|
Loading…
Reference in New Issue
Block a user