From aa22236dfd3737f4d3c44b6b06a61493cd0095e5 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 18 May 2020 17:01:24 +0200 Subject: [PATCH] Moved bitshuffle LZ4 property to writer header --- core-buffer/include/WriterH5Writer.hpp | 3 +++ core-buffer/include/buffer_config.hpp | 3 --- core-buffer/test/test_WriterH5Writer.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core-buffer/include/WriterH5Writer.hpp b/core-buffer/include/WriterH5Writer.hpp index 37827df..8e8d670 100644 --- a/core-buffer/include/WriterH5Writer.hpp +++ b/core-buffer/include/WriterH5Writer.hpp @@ -6,6 +6,9 @@ #include #include "buffer_config.hpp" +// Size of compression header in bytes. +const int BSHUF_LZ4_HEADER_BYTES = 12; + struct ImageMetadata { uint64_t pulse_id; diff --git a/core-buffer/include/buffer_config.hpp b/core-buffer/include/buffer_config.hpp index 43a71d7..a743b2f 100644 --- a/core-buffer/include/buffer_config.hpp +++ b/core-buffer/include/buffer_config.hpp @@ -64,9 +64,6 @@ namespace core_buffer { // Size of buffer between the receiving and sending part. const int STREAM_FASTQUEUE_SLOTS = 5; - // Size of compression header in bytes. - const int WRITER_COMPRESSION_HEADER_BYTES = 12; - // Writer RECV queue on ZMQ. const int WRITER_RCVHWM = 100; diff --git a/core-buffer/test/test_WriterH5Writer.cpp b/core-buffer/test/test_WriterH5Writer.cpp index c3b98f5..a688180 100644 --- a/core-buffer/test/test_WriterH5Writer.cpp +++ b/core-buffer/test/test_WriterH5Writer.cpp @@ -34,7 +34,7 @@ TEST(WriterH5Writer, test_compression) auto f_comp_buffer = make_unique(comp_buffer_size); auto i_comp_buffer = make_unique( - (comp_buffer_size * n_modules) + WRITER_COMPRESSION_HEADER_BYTES); + (comp_buffer_size * n_modules) + BSHUF_LZ4_HEADER_BYTES); auto i_raw_buffer = make_unique( MODULE_N_PIXELS * n_modules * n_frames); @@ -43,7 +43,7 @@ TEST(WriterH5Writer, test_compression) bshuf_write_uint32_BE(&i_comp_buffer[8], MODULE_N_PIXELS * PIXEL_N_BYTES); - size_t total_compressed_size = WRITER_COMPRESSION_HEADER_BYTES; + size_t total_compressed_size = BSHUF_LZ4_HEADER_BYTES; for (int i_module=0; i_module