summaryrefslogtreecommitdiff
path: root/flam3.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-02-14 14:46:44 +0100
committerLars-Dominik Braun <lars@6xq.net>2015-05-02 21:36:45 +0200
commitf92a757aae2bd379a60b8b17c7fec673a917701a (patch)
treef94cc2867f4a686daee370b8acaf08b96bb10da5 /flam3.c
parent6a7d86ec73c5212c52d76d9ddcb2023fc535b814 (diff)
downloadpucket-f92a757aae2bd379a60b8b17c7fec673a917701a.tar.gz
pucket-f92a757aae2bd379a60b8b17c7fec673a917701a.tar.bz2
pucket-f92a757aae2bd379a60b8b17c7fec673a917701a.zip
Vectorize accumulation
Also vectorizes some color functions and switches to double accumulation buffer. Does not seem to be slower.
Diffstat (limited to 'flam3.c')
-rw-r--r--flam3.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/flam3.c b/flam3.c
index 2380c6f..4564b3f 100644
--- a/flam3.c
+++ b/flam3.c
@@ -3312,41 +3312,6 @@ int flam3_estimate_bounding_box(flam3_genome *cp, double eps, int nsamples,
return(bv);
}
-
-typedef double bucket_double[5];
-typedef double abucket_double[4];
-typedef unsigned int bucket_int[5];
-typedef unsigned int abucket_int[4];
-typedef float bucket_float[5];
-typedef float abucket_float[4];
-
-/* experimental 32-bit datatypes (called 33) */
-#define bucket bucket_int
-#define abucket abucket_float
-#define abump_no_overflow(dest, delta) do {dest += delta;} while (0)
-#define add_c_to_accum(acc,i,ii,j,jj,wid,hgt,c) do { \
- if ( (j) + (jj) >=0 && (j) + (jj) < (hgt) && (i) + (ii) >=0 && (i) + (ii) < (wid)) { \
- abucket *a = (acc) + ( (i) + (ii) ) + ( (j) + (jj) ) * (wid); \
- abump_no_overflow(a[0][0],(c)[0]); \
- abump_no_overflow(a[0][1],(c)[1]); \
- abump_no_overflow(a[0][2],(c)[2]); \
- abump_no_overflow(a[0][3],(c)[3]); \
- } \
-} while (0)
-/* single-threaded */
-#define bump_no_overflow(dest, delta) do { \
- if (UINT_MAX - dest > delta) dest += delta; else dest = UINT_MAX; \
-} while (0)
-#define iter_thread iter_thread_float
-#include "rect.c"
-#undef iter_thread
-#undef render_rectangle
-#undef add_c_to_accum
-#undef bucket
-#undef abucket
-#undef bump_no_overflow
-#undef abump_no_overflow
-
int flam3_render(flam3_frame *spec, void *out,
int field, int nchan, int trans, stat_struct *stats) {