Add WEBP_RESTRICT & use it in VP8BitReader

Marking the `VP8BitReader` as `__restrict__` helps the compiler generate
better code avoiding issues related to aliasing (re-loads/stores).

Change-Id: Ib7178f57e27e5f40572efc3e567cdf994ea6d928
This commit is contained in:
Clement Courbet
2021-06-18 13:21:37 +00:00
committed by James Zern
parent f6d2924757
commit 3e26513656
2 changed files with 11 additions and 1 deletions

View File

@@ -25,6 +25,16 @@
#include "src/dsp/dsp.h"
#include "src/webp/types.h"
//------------------------------------------------------------------------------
// restrict
#if defined(__GNUC__) || defined(__clang__)
#define WEBP_RESTRICT __restrict
#else
#define WEBP_RESTRICT
#endif
#ifdef __cplusplus
extern "C" {
#endif