src/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 
00021   typedef unsigned char       uint8_t;
00022   typedef unsigned short      uint16_t;
00023   typedef unsigned int        uint32_t;
00024   typedef   signed int        int32_t;
00025   typedef unsigned long long  uint64_t;
00026   
00027         
00028 #endif
00029 
00030 #include <stdlib.h>
00031 #include "iochain.h"
00032 
00033 
00034 
00035 #ifndef BSHUF_MIN_RECOMMEND_BLOCK
00036 #define BSHUF_MIN_RECOMMEND_BLOCK 128
00037 #define BSHUF_BLOCKED_MULT 8    // Block sizes must be multiple of this.
00038 #define BSHUF_TARGET_BLOCK_SIZE_B 8192
00039 #endif
00040 
00041 
00042 
00043 #define CHECK_ERR_FREE(count, buf) if (count < 0) { free(buf); return count; }
00044 
00045 
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 
00051 
00052 int64_t bshuf_trans_bit_elem(const void* in, void* out, const size_t size,
00053         const size_t elem_size);
00054 
00055 
00056 uint32_t bshuf_read_uint32_BE(const void* buf);
00057 
00058 
00059 void bshuf_write_uint32_BE(void* buf, uint32_t num);
00060 
00061 int64_t bshuf_untrans_bit_elem(const void* in, void* out, const size_t size,
00062         const size_t elem_size);
00063 
00064 
00065 typedef int64_t (*bshufBlockFunDef)(ioc_chain* C_ptr,
00066         const size_t size, const size_t elem_size);
00067 
00068 
00069 
00070 int64_t bshuf_blocked_wrap_fun(bshufBlockFunDef fun, const void* in, void* out,
00071         const size_t size, const size_t elem_size, size_t block_size);
00072 
00073 #ifdef __cplusplus
00074 } 
00075 #endif
00076 
00077 #endif  // BITSHUFFLE_INTERNALS_H