From 0f9e16add75e5d5de0463241120cf4584194b7e6 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 16 Apr 2026 03:18:10 +0200 Subject: Makes event array compression multi-threaded --- core/render.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'core/render.c') diff --git a/core/render.c b/core/render.c index f9da65d..f42e821 100644 --- a/core/render.c +++ b/core/render.c @@ -8,8 +8,6 @@ SQLITE_EXTENSION_INIT1 #include "compress.c" -#define EVA_SIZE (sizeof(uint64_t) * MVEC_SIZE) - void eva_render(sqlite3_context *context, int argc, sqlite3_value **argv) { assert(context); assert(argc == 4); @@ -40,9 +38,16 @@ void eva_render(sqlite3_context *context, int argc, sqlite3_value **argv) { size_t out_size = sizeof(uint64_t) * px_count; uint64_t *eva = sqlite3_malloc(EVA_SIZE); uint64_t *out = sqlite3_malloc(out_size); - z_stream strm = { 0 }; - salis_inflate(&strm, blob_size, EVA_SIZE, (Bytef *)blob, (Bytef *)eva); - salis_inflate_end(&strm); + + struct InflateParams params = { + .avail_in = blob_size, + .size = EVA_SIZE, + .in = (Bytef *)blob, + .out = (Bytef *)eva, + }; + + salis_inflate(¶ms); + salis_inflate_end(¶ms); // Render image for (size_t i = 0; i < px_count; i++) { -- cgit v1.3