include/bitshuffle/bitshuffle_internals.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef BITSHUFFLE_INTERNALS_H
00014 #define BITSHUFFLE_INTERNALS_H
00015
00016
00017 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199900L) || defined(__cplusplus)
00018 #include <stdint.h>
00019 #else
00020 typedef unsigned char uint8_t;
00021 typedef unsigned short uint16_t;
00022 typedef unsigned int uint32_t;
00023 typedef signed int int32_t;
00024 typedef unsigned long long uint64_t;
00025 typedef long long int64_t;
00026 #endif
00027
00028 #include <stdlib.h>
00029 #include "iochain.h"
00030
00031
00032
00033 #ifndef BSHUF_MIN_RECOMMEND_BLOCK
00034 #define BSHUF_MIN_RECOMMEND_BLOCK 128
00035 #define BSHUF_BLOCKED_MULT 8 // Block sizes must be multiple of this.
00036 #define BSHUF_TARGET_BLOCK_SIZE_B 8192
00037 #endif
00038
00039
00040
00041 #define CHECK_ERR_FREE(count, buf) if (count < 0) { free(buf); return count; }
00042
00043
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048
00049
00050 int64_t bshuf_trans_bit_elem(const void* in, void* out, const size_t size,
00051 const size_t elem_size);
00052
00053
00054 uint32_t bshuf_read_uint32_BE(const void* buf);
00055
00056
00057 void bshuf_write_uint32_BE(void* buf, uint32_t num);
00058
00059 int64_t bshuf_untrans_bit_elem(const void* in, void* out, const size_t size,
00060 const size_t elem_size);
00061
00062
00063 typedef int64_t (*bshufBlockFunDef)(ioc_chain* C_ptr,
00064 const size_t size, const size_t elem_size);
00065
00066
00067
00068 int64_t bshuf_blocked_wrap_fun(bshufBlockFunDef fun, const void* in, void* out,
00069 const size_t size, const size_t elem_size, size_t block_size);
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074
00075 #endif // BITSHUFFLE_INTERNALS_H