mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-15 21:39:59 +02:00
use WEBP_INLINE for inline function declarations
removes a #define inline, objectionable in certain projects Change-Id: Iebe0ce0b25a030756304d402679ef769e5f854d1
This commit is contained in:
@ -49,7 +49,7 @@ static void InitTables(void) {
|
||||
// Edge filtering functions
|
||||
|
||||
// 4 pixels in, 2 pixels out
|
||||
static inline void do_filter2(uint8_t* p, int step) {
|
||||
static WEBP_INLINE void do_filter2(uint8_t* p, int step) {
|
||||
const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];
|
||||
const int a = 3 * (q0 - p0) + sclip1[1020 + p1 - q1];
|
||||
const int a1 = sclip2[112 + ((a + 4) >> 3)];
|
||||
@ -59,7 +59,7 @@ static inline void do_filter2(uint8_t* p, int step) {
|
||||
}
|
||||
|
||||
// 4 pixels in, 4 pixels out
|
||||
static inline void do_filter4(uint8_t* p, int step) {
|
||||
static WEBP_INLINE void do_filter4(uint8_t* p, int step) {
|
||||
const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];
|
||||
const int a = 3 * (q0 - p0);
|
||||
const int a1 = sclip2[112 + ((a + 4) >> 3)];
|
||||
@ -72,17 +72,18 @@ static inline void do_filter4(uint8_t* p, int step) {
|
||||
}
|
||||
|
||||
// high edge-variance
|
||||
static inline int hev(const uint8_t* p, int step, int thresh) {
|
||||
static WEBP_INLINE int hev(const uint8_t* p, int step, int thresh) {
|
||||
const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];
|
||||
return (abs0[255 + p1 - p0] > thresh) || (abs0[255 + q1 - q0] > thresh);
|
||||
}
|
||||
|
||||
static inline int needs_filter(const uint8_t* p, int step, int thresh) {
|
||||
static WEBP_INLINE int needs_filter(const uint8_t* p, int step, int thresh) {
|
||||
const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];
|
||||
return (2 * abs0[255 + p0 - q0] + abs1[255 + p1 - q1]) <= thresh;
|
||||
}
|
||||
|
||||
static inline int needs_filter2(const uint8_t* p, int step, int t, int it) {
|
||||
static WEBP_INLINE int needs_filter2(const uint8_t* p,
|
||||
int step, int t, int it) {
|
||||
const int p3 = p[-4*step], p2 = p[-3*step], p1 = p[-2*step], p0 = p[-step];
|
||||
const int q0 = p[0], q1 = p[step], q2 = p[2*step], q3 = p[3*step];
|
||||
if ((2 * abs0[255 + p0 - q0] + abs1[255 + p1 - q1]) > t)
|
||||
@ -132,8 +133,9 @@ static void SimpleHFilter16i(uint8_t* p, int stride, int thresh) {
|
||||
//------------------------------------------------------------------------------
|
||||
// Complex In-loop filtering (Paragraph 15.3)
|
||||
|
||||
static inline void FilterLoop24(uint8_t* p, int hstride, int vstride, int size,
|
||||
int thresh, int ithresh, int hev_thresh) {
|
||||
static WEBP_INLINE void FilterLoop24(uint8_t* p,
|
||||
int hstride, int vstride, int size,
|
||||
int thresh, int ithresh, int hev_thresh) {
|
||||
while (size-- > 0) {
|
||||
if (needs_filter2(p, hstride, thresh, ithresh)) {
|
||||
if (hev(p, hstride, hev_thresh)) {
|
||||
|
Reference in New Issue
Block a user