Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kriegsman <kriegsman@tr.org>2014-11-06 07:58:22 +0300
committerMark Kriegsman <kriegsman@tr.org>2014-11-06 07:58:22 +0300
commit38e08de1dc039f2bd402787113672e7b537619c0 (patch)
tree9f018ecd05fe4e453e7a317fb4fb5cfde97a889e /noise.cpp
parent1944051c42c6607b23e846d2993d07f052fffdbb (diff)
Speedup for 8-bit noise (~5%) by using avg7(u,v)
Diffstat (limited to 'noise.cpp')
-rw-r--r--noise.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noise.cpp b/noise.cpp
index d64e536d..a54e9ce4 100644
--- a/noise.cpp
+++ b/noise.cpp
@@ -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);
}