aboutsummaryrefslogtreecommitdiff
path: root/core/render.c
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2026-04-16 03:18:10 +0200
committerPaul Oliver <contact@pauloliver.dev>2026-04-16 03:18:10 +0200
commit0f9e16add75e5d5de0463241120cf4584194b7e6 (patch)
treeab8625b7c0194788c6a749a43424cdea6981558b /core/render.c
parentd36b3f200dbaf19afd3b5e33f6a575961c471b72 (diff)
Makes event array compression multi-threaded
Diffstat (limited to 'core/render.c')
-rw-r--r--core/render.c15
1 files changed, 10 insertions, 5 deletions
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(&params);
+ salis_inflate_end(&params);
// Render image
for (size_t i = 0; i < px_count; i++) {