diff options
author | Mark Kriegsman <kriegsman@tr.org> | 2014-11-06 07:58:22 +0300 |
---|---|---|
committer | Mark Kriegsman <kriegsman@tr.org> | 2014-11-06 07:58:22 +0300 |
commit | 38e08de1dc039f2bd402787113672e7b537619c0 (patch) | |
tree | 9f018ecd05fe4e453e7a317fb4fb5cfde97a889e /noise.cpp | |
parent | 1944051c42c6607b23e846d2993d07f052fffdbb (diff) |
Speedup for 8-bit noise (~5%) by using avg7(u,v)
Diffstat (limited to 'noise.cpp')
-rw-r--r-- | noise.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -127,7 +127,7 @@ static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t if(hash&1) { u = -u; } if(hash&2) { v = -v; } - return (u+v)>>1; + return avg7(u,v); #endif } @@ -138,7 +138,7 @@ static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x if(hash&1) { u = -u; } if(hash&2) { v = -v; } - return (u+v)>>1; + return avg7(u,v); } static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x) { @@ -150,7 +150,7 @@ static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x if(hash&1) { u = -u; } if(hash&2) { v = -v; } - return (u+v)>>1; + return avg7(u,v); } |