source: thirdparty/SZ/sz/include/utility.h @ 9ee2ce3

Revision 9ee2ce3, 1.8 KB checked in by Hal Finkel <hfinkel@…>, 6 years ago (diff)

importing new SZ files

  • Property mode set to 100644
Line 
1/**
2 *  @file utility.h
3 *  @author Sheng Di, Sihuan Li
4 *  @date July, 2018
5 *  @brief Header file for the utility.c.
6 *  (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
7 *      See COPYRIGHT in top-level directory.
8 */
9
10#ifndef _UTILITY_H
11#define _UTILITY_H
12
13#include "sz.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19//sihuan added: use a assistant struct to do sorting and swap that are easy to implement: should
20//consider optimizing the performance later.
21typedef struct sort_ast_particle{
22        int64_t id;
23        float var[6];
24} sort_ast_particle;
25
26int compare_struct(const void* obj1, const void* obj2);//sihuan added: the compare function in the qsort parameter for 2 structures
27void reorder_vars(SZ_VarSet* vset);//sihuan added: reorder the variables increasingly by their index
28size_t intersectAndsort(int64_t* preIndex, size_t preLen, SZ_VarSet* curVar, size_t dataLen, unsigned char* bitarray);
29//sihuan added: find intersection and keep new var sorted by id
30void write_reordered_tofile(SZ_VarSet* curVar, size_t dataLen);
31//sihuan added: write the reordered input to files for further decompression validation
32float calculate_delta_t(size_t size);//sihuan added
33
34int is_lossless_compressed_data(unsigned char* compressedBytes, size_t cmpSize);
35unsigned long sz_lossless_compress(int losslessCompressor, int level, unsigned char* data, unsigned long dataLength, unsigned char** compressBytes);
36unsigned long sz_lossless_decompress(int losslessCompressor, unsigned char* compressBytes, unsigned long cmpSize, unsigned char** oriData, unsigned long targetOriSize);
37unsigned long sz_lossless_decompress65536bytes(int losslessCompressor, unsigned char* compressBytes, unsigned long cmpSize, unsigned char** oriData);
38
39#ifdef __cplusplus
40}
41#endif
42
43#endif /* ----- #ifndef _UTILITY_H  ----- */
Note: See TracBrowser for help on using the repository browser.