remove int type file

This commit is contained in:
tickduan 2021-06-29 13:07:56 +08:00
parent f3834b676a
commit 0f616288de
36 changed files with 163 additions and 49812 deletions

View File

@ -21,37 +21,18 @@ void computeReqLength_double(double realPrecision, short radExpo, int* reqLength
short computeReqLength_double_MSST19(double realPrecision);
unsigned int optimize_intervals_double_1D(double *oriData, size_t dataLength, double realPrecision);
unsigned int optimize_intervals_double_2D(double *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_double_3D(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
unsigned int optimize_intervals_double_4D(double *oriData, size_t r1, size_t r2, size_t r3, size_t r4, double realPrecision);
unsigned int optimize_intervals_double_3D_opt(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
unsigned int optimize_intervals_double_2D_opt(double *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_double_1D_opt(double *oriData, size_t dataLength, double realPrecision);
size_t SZ_compress_double_3D_MDQ_RA_block(double * block_ori_data, double * mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, double * P0, double * P1, int * type, double * unpredictable_data);
unsigned int optimize_intervals_double_1D_opt_MSST19(double *oriData, size_t dataLength, double realPrecision);
unsigned int optimize_intervals_double_2D_opt_MSST19(double *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_double_3D_opt_MSST19(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
TightDataPointStorageD* SZ_compress_double_1D_MDQ(double *oriData,
size_t dataLength, double realPrecision, double valueRangeSize, double medianValue_d);
void SZ_compress_args_double_StoreOriData(double* oriData, size_t dataLength, unsigned char** newByteData, size_t *outSize);
char SZ_compress_args_double_NoCkRngeNoGzip_1D(int cmprType, unsigned char** newByteData, double *oriData, size_t dataLength, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d);
TightDataPointStorageD* SZ_compress_double_2D_MDQ(double *oriData, size_t r1, size_t r2, double realPrecision, double valueRangeSize, double medianValue_d);
char SZ_compress_args_double_NoCkRngeNoGzip_2D(int cmprType, unsigned char** newByteData, double *oriData, size_t r1, size_t r2, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d);
TightDataPointStorageD* SZ_compress_double_3D_MDQ(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, double valueRangeSize, double medianValue_d);
char SZ_compress_args_double_NoCkRngeNoGzip_3D(int cmprType, unsigned char** newByteData, double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d);
TightDataPointStorageD* SZ_compress_double_4D_MDQ(double *oriData, size_t r1, size_t r2, size_t r3, size_t r4, double realPrecision, double valueRangeSize, double medianValue_d);
char SZ_compress_args_double_NoCkRngeNoGzip_4D(unsigned char** newByteData, double *oriData, size_t r1, size_t r2, size_t r3, size_t r4, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d);
TightDataPointStorageD* SZ_compress_double_1D_MDQ_MSST19(double *oriData, size_t dataLength, double realPrecision, double valueRangeSize, double medianValue_f);
TightDataPointStorageD* SZ_compress_double_2D_MDQ_MSST19(double *oriData, size_t r1, size_t r2, double realPrecision, double valueRangeSize, double medianValue_f);
TightDataPointStorageD* SZ_compress_double_3D_MDQ_MSST19(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, double valueRangeSize, double medianValue_f);
void SZ_compress_args_double_withinRange(unsigned char** newByteData, double *oriData, size_t dataLength, size_t *outSize);
@ -65,31 +46,11 @@ int errBoundMode, double absErr_Bound, double relBoundRatio, double pwRelBoundRa
void SZ_compress_args_double_NoCkRnge_1D_subblock(unsigned char* compressedBytes, double *oriData, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d,
size_t r1, size_t s1, size_t e1);
void SZ_compress_args_double_NoCkRnge_2D_subblock(unsigned char* compressedBytes, double *oriData, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d,
size_t r2, size_t r1, size_t s2, size_t s1, size_t e2, size_t e1);
void SZ_compress_args_double_NoCkRnge_3D_subblock(unsigned char* compressedBytes, double *oriData, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d,
size_t r3, size_t r2, size_t r1, size_t s3, size_t s2, size_t s1, size_t e3, size_t e2, size_t e1);
void SZ_compress_args_double_NoCkRnge_4D_subblock(unsigned char* compressedBytes, double *oriData, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d,
size_t r4, size_t r3, size_t r2, size_t r1, size_t s4, size_t s3, size_t s2, size_t s1, size_t e4, size_t e3, size_t e2, size_t e1);
unsigned int optimize_intervals_double_1D_subblock(double *oriData, double realPrecision, size_t r1, size_t s1, size_t e1);
unsigned int optimize_intervals_double_2D_subblock(double *oriData, double realPrecision, size_t r1, size_t r2, size_t s1, size_t s2, size_t e1, size_t e2);
unsigned int optimize_intervals_double_3D_subblock(double *oriData, double realPrecision, size_t r1, size_t r2, size_t r3, size_t s1, size_t s2, size_t s3, size_t e1, size_t e2, size_t e3);
unsigned int optimize_intervals_double_4D_subblock(double *oriData, double realPrecision, size_t r1, size_t r2, size_t r3, size_t r4, size_t s1, size_t s2, size_t s3, size_t s4, size_t e1, size_t e2, size_t e3, size_t e4);
TightDataPointStorageD* SZ_compress_double_1D_MDQ_subblock(double *oriData, double realPrecision, double valueRangeSize, double medianValue_d,
size_t r1, size_t s1, size_t e1);
TightDataPointStorageD* SZ_compress_double_2D_MDQ_subblock(double *oriData, double realPrecision, double valueRangeSize, double medianValue_d,
size_t r1, size_t r2, size_t s1, size_t s2, size_t e1, size_t e2);
TightDataPointStorageD* SZ_compress_double_3D_MDQ_subblock(double *oriData, double realPrecision, double valueRangeSize, double medianValue_d,
size_t r1, size_t r2, size_t r3, size_t s1, size_t s2, size_t s3, size_t e1, size_t e2, size_t e3);
TightDataPointStorageD* SZ_compress_double_4D_MDQ_subblock(double *oriData, double realPrecision, double valueRangeSize, double medianValue_d,
size_t r1, size_t r2, size_t r3, size_t r4, size_t s1, size_t s2, size_t s3, size_t s4, size_t e1, size_t e2, size_t e3, size_t e4);
unsigned int optimize_intervals_double_2D_with_freq_and_dense_pos(double *oriData, size_t r1, size_t r2, double realPrecision, double * dense_pos, double * max_freq, double * mean_freq);
unsigned int optimize_intervals_double_3D_with_freq_and_dense_pos(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, double * dense_pos, double * max_freq, double * mean_freq);
unsigned char * SZ_compress_double_2D_MDQ_nonblocked_with_blocked_regression(double *oriData, size_t r1, size_t r2, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_double_3D_MDQ_nonblocked_with_blocked_regression(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
#ifdef __cplusplus

View File

@ -19,18 +19,7 @@ extern "C" {
void compute_segment_precisions_double_1D(double *oriData, size_t dataLength, double* pwrErrBound, unsigned char* pwrErrBoundBytes, double globalPrecision);
unsigned int optimize_intervals_double_1D_pwr(double *oriData, size_t dataLength, double* pwrErrBound);
void compute_segment_precisions_double_2D(double *oriData, double* pwrErrBound,
size_t r1, size_t r2, size_t R2, size_t edgeSize, unsigned char* pwrErrBoundBytes, double Min, double Max, double globalPrecision);
unsigned int optimize_intervals_double_2D_pwr(double *oriData, size_t r1, size_t r2, size_t R2, size_t edgeSize, double* pwrErrBound);
void compute_segment_precisions_double_3D(double *oriData, double* pwrErrBound,
size_t r1, size_t r2, size_t r3, size_t R2, size_t R3, size_t edgeSize, unsigned char* pwrErrBoundBytes, double Min, double Max, double globalPrecision);
unsigned int optimize_intervals_double_3D_pwr(double *oriData, size_t r1, size_t r2, size_t r3, size_t R2, size_t R3, size_t edgeSize, double* pwrErrBound);
void SZ_compress_args_double_NoCkRngeNoGzip_1D_pwr(unsigned char** newByteData, double *oriData, double globalPrecision, size_t dataLength, size_t *outSize, double min, double max);
void SZ_compress_args_double_NoCkRngeNoGzip_2D_pwr(unsigned char** newByteData, double *oriData, double globalPrecision, size_t r1, size_t r2,
size_t *outSize, double min, double max);
void SZ_compress_args_double_NoCkRngeNoGzip_3D_pwr(unsigned char** newByteData, double *oriData, double globalPrecision,
size_t r1, size_t r2, size_t r3, size_t *outSize, double min, double max);
void createRangeGroups_double(double** posGroups, double** negGroups, int** posFlags, int** negFlags);
void compressGroupIDArray_double(char* groupID, TightDataPointStorageD* tdps);
TightDataPointStorageD* SZ_compress_double_1D_MDQ_pwrGroup(double* oriData, size_t dataLength, int errBoundMode,
@ -39,15 +28,9 @@ void SZ_compress_args_double_NoCkRngeNoGzip_1D_pwrgroup(unsigned char** newByteD
size_t dataLength, double absErrBound, double relBoundRatio, double pwrErrRatio, double valueRangeSize, double medianValue_f, size_t *outSize);
void SZ_compress_args_double_NoCkRngeNoGzip_1D_pwr_pre_log(unsigned char** newByteData, double *oriData, double globalPrecision, size_t dataLength, size_t *outSize, double min, double max);
void SZ_compress_args_double_NoCkRngeNoGzip_2D_pwr_pre_log(unsigned char** newByteData, double *oriData, double globalPrecision, size_t r1, size_t r2, size_t *outSize, double min, double max);
void SZ_compress_args_double_NoCkRngeNoGzip_3D_pwr_pre_log(unsigned char** newByteData, double *oriData, double globalPrecision, size_t r1, size_t r2, size_t r3, size_t *outSize, double min, double max);
void SZ_compress_args_double_NoCkRngeNoGzip_1D_pwr_pre_log_MSST19(unsigned char** newByteData, double *oriData, double pwrErrRatio, size_t dataLength, size_t *outSize, double valueRangeSize, double medianValue_f,
unsigned char* signs, bool* positive, double min, double max, double nearZero);
void SZ_compress_args_double_NoCkRngeNoGzip_2D_pwr_pre_log_MSST19(unsigned char** newByteData, double *oriData, double pwrErrRatio, size_t r1, size_t r2, size_t *outSize, double valueRangeSize,
unsigned char* signs, bool* positive, double min, double max, double nearZero);
void SZ_compress_args_double_NoCkRngeNoGzip_3D_pwr_pre_log_MSST19(unsigned char** newByteData, double *oriData, double pwrErrRatio, size_t r1, size_t r2, size_t r3, size_t *outSize, double valueRangeSize,
unsigned char* signs, bool* positive, double min, double max, double nearZero);
#ifdef __cplusplus
}

View File

@ -20,20 +20,11 @@ void computeReqLength_float(double realPrecision, short radExpo, int* reqLength,
short computeReqLength_float_MSST19(double realPrecision);
unsigned int optimize_intervals_float_1D(float *oriData, size_t dataLength, double realPrecision);
unsigned int optimize_intervals_float_2D(float *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_float_3D(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
unsigned int optimize_intervals_float_4D(float *oriData, size_t r1, size_t r2, size_t r3, size_t r4, double realPrecision);
unsigned int optimize_intervals_and_compute_dense_position_float_1D(float *oriData, size_t dataLength, double realPrecision, float * dense_pos);
unsigned int optimize_intervals_and_compute_dense_position_float_3D(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, float * dense_pos);
unsigned int optimize_intervals_float_3D_with_freq_and_dense_pos(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, float * dense_pos, float * max_freq, float * mean_freq);
unsigned int optimize_intervals_float_3D_opt(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
unsigned int optimize_intervals_float_2D_opt(float *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_float_1D_opt(float *oriData, size_t dataLength, double realPrecision);
unsigned int optimize_intervals_float_1D_opt_MSST19(float *oriData, size_t dataLength, double realPrecision);
unsigned int optimize_intervals_float_2D_opt_MSST19(float *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_float_3D_opt_MSST19(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
TightDataPointStorageF* SZ_compress_float_1D_MDQ(float *oriData,
size_t dataLength, float realPrecision, float valueRangeSize, float medianValue_f);
@ -43,54 +34,17 @@ void SZ_compress_args_float_StoreOriData(float* oriData, size_t dataLength, unsi
char SZ_compress_args_float_NoCkRngeNoGzip_1D(int cmprType, unsigned char** newByteData, float *oriData,
size_t dataLength, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f);
TightDataPointStorageF* SZ_compress_float_2D_MDQ(float *oriData, size_t r1, size_t r2, float realPrecision, float valueRangeSize, float medianValue_f);
char SZ_compress_args_float_NoCkRngeNoGzip_2D(int cmprType, unsigned char** newByteData, float *oriData, size_t r1, size_t r2, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f);
TightDataPointStorageF* SZ_compress_float_3D_MDQ(float *oriData, size_t r1, size_t r2, size_t r3, float realPrecision, float valueRangeSize, float medianValue_f);
char SZ_compress_args_float_NoCkRngeNoGzip_3D(int cmprType, unsigned char** newByteData, float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f);
size_t SZ_compress_float_1D_MDQ_RA_block(float * block_ori_data, float * mean, size_t dim_0, size_t block_dim_0, double realPrecision, int * type, float * unpredictable_data);
size_t SZ_compress_float_2D_MDQ_RA_block(float * block_ori_data, float * mean, size_t dim_0, size_t dim_1, size_t block_dim_0, size_t block_dim_1, double realPrecision, float * P0, float * P1, int * type, float * unpredictable_data);
size_t SZ_compress_float_1D_MDQ_RA_block_1D_pred(float * block_ori_data, float * mean, float dense_pos, size_t dim_0, size_t block_dim_0, double realPrecision, int * type, DynamicFloatArray * unpredictable_data);
size_t SZ_compress_float_2D_MDQ_RA_block_2D_pred(float * block_ori_data, float * mean, float dense_pos, size_t dim_0, size_t dim_1, size_t block_dim_0, size_t block_dim_1, double realPrecision, float * P0, float * P1, int * type, float * unpredictable_data);
size_t SZ_compress_float_3D_MDQ_RA_block(float * block_ori_data, float * mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, float realPrecision, float * P0, float * P1, int * type, float * unpredictable_data);
size_t SZ_compress_float_3D_MDQ_RA_block_3D_pred(float * block_ori_data, float * mean, float dense_pos, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * P0, float * P1, int * type, float * unpredictable_data);
size_t SZ_compress_float_3D_MDQ_RA_block_adaptive(float * block_ori_data, float * mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * P0, float * P1, int * type, float * unpredictable_data);
//unsigned short SZ_compress_float_3D_MDQ_RA_block_1D_pred(float * block_ori_data, float * mean, float dense_pos, size_t dim_0, size_t dim_1, size_t dim_2, int block_dim_0, int block_dim_1, int block_dim_2, double realPrecision, int * type, float * unpredictable_data);
size_t SZ_compress_float_3D_MDQ_RA_block_3D_pred_flush_after_compare(float * block_ori_data, float * mean, float dense_pos, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * P0, float * P1, int * type, float * unpredictable_data);
size_t SZ_compress_float_3D_MDQ_RA_block_2_layers(float * block_ori_data, float * mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * P0, float * P1, float * P_, int * type, float * unpredictable_data);
size_t SZ_compress_float_3D_MDQ_pred_by_regression(float * block_ori_data, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * reg_params, int * type, float * unpredictable_data);
void SZ_blocked_regression(float * block_ori_data, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, float *params);
unsigned char * SZ_compress_float_3D_MDQ_RA_all_by_regression(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
float SZ_compress_float_3D_MDQ_RA_block_no_mean(float * block_ori_data, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * P0, float * P1, int * type, unsigned short * unpred_count, float * unpredictable_data);
float SZ_compress_float_3D_MDQ_pred_by_regression_with_err(float * block_ori_data, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, float * reg_params, int * type, unsigned short * unpred_count, float * unpredictable_data);
unsigned char * SZ_compress_float_3D_MDQ_RA_blocked_with_regression(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
void decompressDataSeries_float_3D_RA_blocked_with_regression(float** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data);
unsigned char * SZ_compress_float_1D_MDQ_RA(float *oriData, size_t r1, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_2D_MDQ_RA(float *oriData, size_t r1, size_t r2, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_2D_MDQ_nonblocked(float *oriData, size_t r1, size_t r2, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_RA(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_nonblocked(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_nonblocked_ori(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_nonblocked_multi_means(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_RA_multi_means(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_nonblocked_adaptive(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_2D_MDQ_decompression_random_access_with_blocked_regression(float *oriData, size_t r1, size_t r2, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_1D_MDQ_decompression_random_access_with_blocked_regression(float *oriData, size_t r1, double realPrecision, size_t * comp_size);
TightDataPointStorageF* SZ_compress_float_4D_MDQ(float *oriData, size_t r1, size_t r2, size_t r3, size_t r4, double realPrecision, float valueRangeSize, float medianValue_f);
char SZ_compress_args_float_NoCkRngeNoGzip_4D(unsigned char** newByteData, float *oriData, size_t r1, size_t r2, size_t r3, size_t r4, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f);
TightDataPointStorageF* SZ_compress_float_1D_MDQ_MSST19(float *oriData,
size_t dataLength, double realPrecision, float valueRangeSize, float medianValue_f);
TightDataPointStorageF* SZ_compress_float_2D_MDQ_MSST19(float *oriData, size_t r1, size_t r2, double realPrecision, float valueRangeSize, float medianValue_f);
TightDataPointStorageF* SZ_compress_float_3D_MDQ_MSST19(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, float valueRangeSize, float medianValue_f);
void SZ_compress_args_float_withinRange(unsigned char** newByteData, float *oriData, size_t dataLength, size_t *outSize);
@ -111,40 +65,12 @@ size_t *outSize, int errBoundMode, double absErr_Bound, double relBoundRatio);
void SZ_compress_args_float_NoCkRnge_1D_subblock(unsigned char* compressedBytes, float *oriData, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f,
size_t r1, size_t s1, size_t e1);
void SZ_compress_args_float_NoCkRnge_2D_subblock(unsigned char* compressedBytes, float *oriData, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f,
size_t r2, size_t r1, size_t s2, size_t s1, size_t e2, size_t e1);
void SZ_compress_args_float_NoCkRnge_3D_subblock(unsigned char* compressedBytes, float *oriData, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f,
size_t r3, size_t r2, size_t r1, size_t s3, size_t s2, size_t s1, size_t e3, size_t e2, size_t e1);
void SZ_compress_args_float_NoCkRnge_4D_subblock(unsigned char* compressedBytes, float *oriData, double realPrecision, size_t *outSize, float valueRangeSize, float medianValue_f,
size_t r4, size_t r3, size_t r2, size_t r1, size_t s4, size_t s3, size_t s2, size_t s1, size_t e4, size_t e3, size_t e2, size_t e1);
unsigned int optimize_intervals_float_1D_subblock(float *oriData, double realPrecision, size_t r1, size_t s1, size_t e1);
unsigned int optimize_intervals_float_2D_subblock(float *oriData, double realPrecision, size_t r1, size_t r2, size_t s1, size_t s2, size_t e1, size_t e2);
unsigned int optimize_intervals_float_3D_subblock(float *oriData, double realPrecision, size_t r1, size_t r2, size_t r3, size_t s1, size_t s2, size_t s3, size_t e1, size_t e2, size_t e3);
unsigned int optimize_intervals_float_4D_subblock(float *oriData, double realPrecision, size_t r1, size_t r2, size_t r3, size_t r4, size_t s1, size_t s2, size_t s3, size_t s4, size_t e1, size_t e2, size_t e3, size_t e4);
TightDataPointStorageF* SZ_compress_float_1D_MDQ_subblock(float *oriData, double realPrecision, float valueRangeSize, float medianValue_f,
size_t r1, size_t s1, size_t e1);
TightDataPointStorageF* SZ_compress_float_2D_MDQ_subblock(float *oriData, double realPrecision, float valueRangeSize, float medianValue_f,
size_t r1, size_t r2, size_t s1, size_t s2, size_t e1, size_t e2);
TightDataPointStorageF* SZ_compress_float_3D_MDQ_subblock(float *oriData, double realPrecision, float valueRangeSize, float medianValue_f,
size_t r1, size_t r2, size_t r3, size_t s1, size_t s2, size_t s3, size_t e1, size_t e2, size_t e3);
TightDataPointStorageF* SZ_compress_float_4D_MDQ_subblock(float *oriData, double realPrecision, float valueRangeSize, float medianValue_f,
size_t r1, size_t r2, size_t r3, size_t r4, size_t s1, size_t s2, size_t s3, size_t s4, size_t e1, size_t e2, size_t e3, size_t e4);
unsigned int optimize_intervals_float_2D_with_freq_and_dense_pos(float *oriData, size_t r1, size_t r2, double realPrecision, float * dense_pos, float * max_freq, float * mean_freq);
unsigned int optimize_intervals_float_3D_with_freq_and_dense_pos(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, float * dense_pos, float * max_freq, float * mean_freq);
unsigned char * SZ_compress_float_2D_MDQ_nonblocked_with_blocked_regression(float *oriData, size_t r1, size_t r2, float realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_nonblocked_with_blocked_regression(float *oriData, size_t r1, size_t r2, size_t r3, float realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_random_access_with_blocked_regression(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_float_3D_MDQ_decompression_random_access_with_blocked_regression(float *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);
#ifdef __cplusplus
}
#endif

View File

@ -19,24 +19,8 @@ extern "C" {
void compute_segment_precisions_float_1D(float *oriData, size_t dataLength, float* pwrErrBound, unsigned char* pwrErrBoundBytes, double globalPrecision);
unsigned int optimize_intervals_float_1D_pwr(float *oriData, size_t dataLength, float* pwrErrBound);
void compute_segment_precisions_float_2D(float *oriData, float* pwrErrBound,
size_t r1, size_t r2, size_t R2, size_t edgeSize, unsigned char* pwrErrBoundBytes, float Min, float Max, double globalPrecision);
unsigned int optimize_intervals_float_2D_pwr(float *oriData, size_t r1, size_t r2, size_t R2, size_t edgeSize, float* pwrErrBound);
void compute_segment_precisions_float_3D(float *oriData, float* pwrErrBound,
size_t r1, size_t r2, size_t r3, size_t R2, size_t R3, size_t edgeSize, unsigned char* pwrErrBoundBytes, float Min, float Max, double globalPrecision);
unsigned int optimize_intervals_float_3D_pwr(float *oriData, size_t r1, size_t r2, size_t r3, size_t R2, size_t R3, size_t edgeSize, float* pwrErrBound);
void SZ_compress_args_float_NoCkRngeNoGzip_1D_pwr(unsigned char** newByteData, float *oriData, double globalPrecision, size_t dataLength, size_t *outSize, float min, float max);
void SZ_compress_args_float_NoCkRngeNoGzip_2D_pwr(unsigned char** newByteData, float *oriData, double globalPrecision, size_t r1, size_t r2,
size_t *outSize, float min, float max);
void SZ_compress_args_float_NoCkRngeNoGzip_3D_pwr(unsigned char** newByteData, float *oriData, double globalPrecision, size_t r1, size_t r2,
size_t r3, size_t *outSize, float min, float max);
void createRangeGroups_float(float** posGroups, float** negGroups, int** posFlags, int** negFlags);
void compressGroupIDArray_float(char* groupID, TightDataPointStorageF* tdps);
@ -48,15 +32,8 @@ void SZ_compress_args_float_NoCkRngeNoGzip_1D_pwrgroup(unsigned char** newByteDa
size_t dataLength, double absErrBound, double relBoundRatio, double pwrErrRatio, float valueRangeSize, float medianValue_f, size_t *outSize);
void SZ_compress_args_float_NoCkRngeNoGzip_1D_pwr_pre_log(unsigned char** newByteData, float *oriData, double pwrErrRatio, size_t dataLength, size_t *outSize, float min, float max);
void SZ_compress_args_float_NoCkRngeNoGzip_2D_pwr_pre_log(unsigned char** newByteData, float *oriData, double pwrErrRatio, size_t r1, size_t r2, size_t *outSize, float min, float max);
void SZ_compress_args_float_NoCkRngeNoGzip_3D_pwr_pre_log(unsigned char** newByteData, float *oriData, double pwrErrRatio, size_t r1, size_t r2, size_t r3, size_t *outSize, float min, float max);
void SZ_compress_args_float_NoCkRngeNoGzip_1D_pwr_pre_log_MSST19(unsigned char** newByteData, float *oriData, double pwrErrRatio, size_t dataLength, size_t *outSize, float valueRangeSize, float medianValue_f,
unsigned char* signs, bool* positive, float min, float max, float nearZero);
void SZ_compress_args_float_NoCkRngeNoGzip_2D_pwr_pre_log_MSST19(unsigned char** newByteData, float *oriData, double pwrErrRatio, size_t r1, size_t r2, size_t *outSize, float valueRangeSize,
unsigned char* signs, bool* positive, float min, float max, float nearZero);
void SZ_compress_args_float_NoCkRngeNoGzip_3D_pwr_pre_log_MSST19(unsigned char** newByteData, float *oriData, double pwrErrRatio, size_t r1, size_t r2, size_t r3, size_t *outSize, float valueRangeSize,
unsigned char* signs, bool* positive, float min, float max, float nearZero);
#ifdef __cplusplus
}

View File

@ -17,22 +17,10 @@ extern "C" {
#include "TightDataPointStorageD.h"
void decompressDataSeries_double_1D(double** data, size_t dataSeriesLength, double* hist_data, TightDataPointStorageD* tdps);
void decompressDataSeries_double_2D(double** data, size_t r1, size_t r2, double* hist_data, TightDataPointStorageD* tdps);
void decompressDataSeries_double_3D(double** data, size_t r1, size_t r2, size_t r3, double* hist_data, TightDataPointStorageD* tdps);
void decompressDataSeries_double_4D(double** data, size_t r1, size_t r2, size_t r3, size_t r4, double* hist_data, TightDataPointStorageD* tdps);
void decompressDataSeries_double_1D_MSST19(double** data, size_t dataSeriesLength, TightDataPointStorageD* tdps);
void decompressDataSeries_double_2D_MSST19(double** data, size_t r1, size_t r2, TightDataPointStorageD* tdps);
void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageD* tdps);
void getSnapshotData_double_1D(double** data, size_t dataSeriesLength, TightDataPointStorageD* tdps, int errBoundMode, int compressionType, double* hist_data, sz_params* pde_params);
void getSnapshotData_double_2D(double** data, size_t r1, size_t r2, TightDataPointStorageD* tdps, int errBoundMode, int compressionType, double* hist_data);
void getSnapshotData_double_3D(double** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageD* tdps, int errBoundMode, int compressionType, double* hist_data);
void getSnapshotData_double_4D(double** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageD* tdps, int errBoundMode, int compressionType, double* hist_data);
void decompressDataSeries_double_2D_nonblocked_with_blocked_regression(double** data, size_t r1, size_t r2, unsigned char* comp_data, double* hist_data);
void decompressDataSeries_double_3D_nonblocked_with_blocked_regression(double** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data, double* hist_data);
size_t decompressDataSeries_double_3D_RA_block(double * data, double mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, int * type, double * unpredictable_data);
int SZ_decompress_args_double(double** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize, int compressionType, double* hist_data, sz_exedata* pde_exe, sz_params* pde_params);

View File

@ -15,19 +15,11 @@ extern "C" {
#endif
void decompressDataSeries_double_1D_pwr(double** data, size_t dataSeriesLength, TightDataPointStorageD* tdps);
double* extractRealPrecision_2D_double(size_t R1, size_t R2, int blockSize, TightDataPointStorageD* tdps);
void decompressDataSeries_double_2D_pwr(double** data, size_t r1, size_t r2, TightDataPointStorageD* tdps);
double* extractRealPrecision_3D_double(size_t R1, size_t R2, size_t R3, int blockSize, TightDataPointStorageD* tdps);
void decompressDataSeries_double_3D_pwr(double** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageD* tdps);
void decompressDataSeries_double_1D_pwrgroup(double** data, size_t dataSeriesLength, TightDataPointStorageD* tdps);
void decompressDataSeries_double_1D_pwr_pre_log(double** data, size_t dataSeriesLength, TightDataPointStorageD* tdps);
void decompressDataSeries_double_2D_pwr_pre_log(double** data, size_t r1, size_t r2, TightDataPointStorageD* tdps);
void decompressDataSeries_double_3D_pwr_pre_log(double** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageD* tdps);
void decompressDataSeries_double_1D_pwr_pre_log_MSST19(double** data, size_t dataSeriesLength, TightDataPointStorageD* tdps);
void decompressDataSeries_double_2D_pwr_pre_log_MSST19(double** data, size_t r1, size_t r2, TightDataPointStorageD* tdps);
void decompressDataSeries_double_3D_pwr_pre_log_MSST19(double** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageD* tdps);
#ifdef __cplusplus
}

View File

@ -17,34 +17,18 @@ extern "C" {
#include "TightDataPointStorageF.h"
void decompressDataSeries_float_1D(float** data, size_t dataSeriesLength, float* hist_data, TightDataPointStorageF* tdps);
void decompressDataSeries_float_2D(float** data, size_t r1, size_t r2, float* hist_data, TightDataPointStorageF* tdps);
void decompressDataSeries_float_3D(float** data, size_t r1, size_t r2, size_t r3, float* hist_data, TightDataPointStorageF* tdps);
void decompressDataSeries_float_4D(float** data, size_t r1, size_t r2, size_t r3, size_t r4, float* hist_data, TightDataPointStorageF* tdps);
void decompressDataSeries_float_1D_MSST19(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps);
void decompressDataSeries_float_2D_MSST19(float** data, size_t r1, size_t r2, TightDataPointStorageF* tdps);
void decompressDataSeries_float_3D_MSST19(float** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageF* tdps);
void getSnapshotData_float_1D(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps, int errBoundMode, int compressionType, float* hist_data, sz_params* pde_params);
void getSnapshotData_float_2D(float** data, size_t r1, size_t r2, TightDataPointStorageF* tdps, int errBoundMode, int compressionType, float* hist_data);
void getSnapshotData_float_3D(float** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageF* tdps, int errBoundMode, int compressionType, float* hist_data);
void getSnapshotData_float_4D(float** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageF* tdps, int errBoundMode, int compressionType, float* hist_data);
size_t decompressDataSeries_float_1D_RA_block(float * data, float mean, size_t dim_0, size_t block_dim_0, double realPrecision, int * type, float * unpredictable_data);
size_t decompressDataSeries_float_2D_RA_block(float * data, float mean, size_t dim_0, size_t dim_1, size_t block_dim_0, size_t block_dim_1, double realPrecision, int * type, float * unpredictable_data);
int SZ_decompress_args_float(float** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize, int compressionType, float* hist_data, sz_exedata* pde_exe, sz_params* pde_params);
size_t decompressDataSeries_float_3D_RA_block(float * data, float mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, int * type, float * unpredictable_data);
void decompressDataSeries_float_1D_decompression_given_areas_with_blocked_regression(float** data, size_t r1, size_t s1, size_t e1, unsigned char* comp_data);
void decompressDataSeries_float_2D_nonblocked_with_blocked_regression(float** data, size_t r1, size_t r2, unsigned char* comp_data, float* hist_data);
void decompressDataSeries_float_2D_decompression_given_areas_with_blocked_regression(float** data, size_t r1, size_t r2, size_t s1, size_t s2, size_t e1, size_t e2, unsigned char* comp_data);
void decompressDataSeries_float_3D_nonblocked_with_blocked_regression(float** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data, float* hist_data);
void decompressDataSeries_float_3D_random_access_with_blocked_regression(float** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data);
void decompressDataSeries_float_3D_decompression_random_access_with_blocked_regression(float** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data);
void decompressDataSeries_float_3D_decompression_given_areas_with_blocked_regression(float** data, size_t r1, size_t r2, size_t r3, size_t s1, size_t s2, size_t s3, size_t e1, size_t e2, size_t e3, unsigned char* comp_data);
int SZ_decompress_args_randomaccess_float(float** newData,
size_t r5, size_t r4, size_t r3, size_t r2, size_t r1,
size_t s5, size_t s4, size_t s3, size_t s2, size_t s1, // start point

View File

@ -15,20 +15,12 @@ extern "C" {
#endif
void decompressDataSeries_float_1D_pwr(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps);
float* extractRealPrecision_2D_float(size_t R1, size_t R2, int blockSize, TightDataPointStorageF* tdps);
void decompressDataSeries_float_2D_pwr(float** data, size_t r1, size_t r2, TightDataPointStorageF* tdps);
float* extractRealPrecision_3D_float(size_t R1, size_t R2, size_t R3, int blockSize, TightDataPointStorageF* tdps);
void decompressDataSeries_float_3D_pwr(float** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageF* tdps);
char* decompressGroupIDArray(unsigned char* bytes, size_t dataLength);
void decompressDataSeries_float_1D_pwrgroup(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps);
void decompressDataSeries_float_1D_pwr_pre_log(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps);
void decompressDataSeries_float_2D_pwr_pre_log(float** data, size_t r1, size_t r2, TightDataPointStorageF* tdps);
void decompressDataSeries_float_3D_pwr_pre_log(float** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageF* tdps);
void decompressDataSeries_float_1D_pwr_pre_log_MSST19(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps);
void decompressDataSeries_float_2D_pwr_pre_log_MSST19(float** data, size_t r1, size_t r2, TightDataPointStorageF* tdps);
void decompressDataSeries_float_3D_pwr_pre_log_MSST19(float** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageF* tdps);
#ifdef __cplusplus
}

View File

@ -71,14 +71,11 @@ int new_TightDataPointStorageD_fromFlatBytes(TightDataPointStorageD **this, unsi
}
int same = sameRByte & 0x01;
//confparams_dec->szMode = (sameRByte & 0x06)>>1;
(*this)->isLossless = (sameRByte & 0x10)>>4;
int isPW_REL = (sameRByte & 0x20)>>5;
exe_params->SZ_SIZE_TYPE = ((sameRByte & 0x40)>>6)==1?8:4;
//confparams_dec->randomAccess = (sameRByte & 0x02) >> 1;
//confparams_dec->szMode = (sameRByte & 0x06) >> 1; //this 0000,0110 are not used for szMode any more
confparams_dec->protectValueRange = (sameRByte & 0x04)>>2;
confparams_dec->accelerate_pw_rel_compression = (sameRByte & 0x08) >> 3;
pde_params->protectValueRange = (sameRByte & 0x04)>>2;
pde_params->accelerate_pw_rel_compression = (sameRByte & 0x08) >> 3;
int errorBoundMode = ABS;
if(isPW_REL)
{
@ -87,12 +84,7 @@ int new_TightDataPointStorageD_fromFlatBytes(TightDataPointStorageD **this, unsi
pwrErrBoundBytesL = 4;
}
if(confparams_dec==NULL)
{
confparams_dec = (sz_params*)malloc(sizeof(sz_params));
memset(confparams_dec, 0, sizeof(sz_params));
}
convertBytesToSZParams(&(flatBytes[index]), confparams_dec, pde_exe);
convertBytesToSZParams(&(flatBytes[index]), pde_params, pde_exe);
index += MetaDataByteLength_double;
@ -103,8 +95,6 @@ int new_TightDataPointStorageD_fromFlatBytes(TightDataPointStorageD **this, unsi
dsLengthBytes[i] = flatBytes[index++];
(*this)->dataSeriesLength = bytesToSize(dsLengthBytes);
//printf("confparams_dec->szMode=%d\n",confparams_dec->szMode);
if((*this)->isLossless==1)
{
//(*this)->exactMidBytes = flatBytes+8;
@ -135,7 +125,7 @@ int new_TightDataPointStorageD_fromFlatBytes(TightDataPointStorageD **this, unsi
byteBuf[i] = flatBytes[index++];
int max_quant_intervals = bytesToInt_bigEndian(byteBuf);// 4
confparams_dec->maxRangeRadius = max_quant_intervals/2;
pde_params->maxRangeRadius = max_quant_intervals/2;
if(errorBoundMode>=PW_REL)
{
@ -143,7 +133,7 @@ int new_TightDataPointStorageD_fromFlatBytes(TightDataPointStorageD **this, unsi
radExpoL = 1;
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)
byteBuf[i] = flatBytes[index++];
confparams_dec->segment_size = (*this)->segment_size = bytesToSize(byteBuf);// exe_params->SZ_SIZE_TYPE
pde_params->segment_size = (*this)->segment_size = bytesToSize(byteBuf);// exe_params->SZ_SIZE_TYPE
for (i = 0; i < 4; i++)
byteBuf[i] = flatBytes[index++];
@ -165,7 +155,7 @@ int new_TightDataPointStorageD_fromFlatBytes(TightDataPointStorageD **this, unsi
(*this)->reqLength = flatBytes[index++]; //1
if(isPW_REL && confparams_dec->accelerate_pw_rel_compression)
if(isPW_REL && pde_params->accelerate_pw_rel_compression)
{
(*this)->plus_bits = flatBytes[index++];
(*this)->max_bits = flatBytes[index++];

View File

@ -1,463 +0,0 @@
/**
* @file TightPointDataStorageI.c
* @author Sheng Di and Dingwen Tao
* @date Aug, 2016
* @brief The functions used to construct the tightPointDataStorage element for storing compressed bytes.
* (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "Huffman.h"
//#include "rw.h"
int computeRightShiftBits(int exactByteSize, int dataType)
{
int rightShift = 0;
switch(dataType)
{
case SZ_INT8:
case SZ_UINT8:
rightShift = 8 - exactByteSize*8;
break;
case SZ_INT16:
case SZ_UINT16:
rightShift = 16 - exactByteSize*8;
break;
case SZ_INT32:
case SZ_UINT32:
rightShift = 32 - exactByteSize*8;
break;
case SZ_INT64:
case SZ_UINT64:
rightShift = 64 - exactByteSize*8;
break;
}
return rightShift;
}
int convertDataTypeSizeCode(int dataTypeSizeCode)
{
int result = 0;
switch(dataTypeSizeCode)
{
case 0:
result = 1;
break;
case 1:
result = 2;
break;
case 2:
result = 4;
break;
case 3:
result = 8;
break;
}
return result;
}
int convertDataTypeSize(int dataTypeSize)
{
int result = 0;
switch(dataTypeSize)
{
case 1:
result = 0; //0000
break;
case 2:
result = 4; //0100
break;
case 4:
result = 8; //1000
break;
case 8:
result = 12; //1100
break;
}
return result;
}
void new_TightDataPointStorageI_Empty(TightDataPointStorageI **this)
{
*this = (TightDataPointStorageI*)malloc(sizeof(TightDataPointStorageI));
(*this)->dataSeriesLength = 0;
(*this)->allSameData = 0;
(*this)->exactDataNum = 0;
(*this)->realPrecision = 0;
(*this)->minValue = 0;
(*this)->exactByteSize = 0;
(*this)->typeArray = NULL; //its size is dataSeriesLength/4 (or xxx/4+1)
(*this)->typeArray_size = 0;
(*this)->exactDataBytes = NULL;
(*this)->exactDataBytes_size = 0;
(*this)->intervals = 0;
(*this)->isLossless = 0;
}
int new_TightDataPointStorageI_fromFlatBytes(TightDataPointStorageI **this, unsigned char* flatBytes, size_t flatBytesLength)
{
new_TightDataPointStorageI_Empty(this);
size_t i, index = 0;
char version[3];
for (i = 0; i < 3; i++)
version[i] = flatBytes[index++]; //3
unsigned char sameRByte = flatBytes[index++]; //1
if(checkVersion2(version)!=1)
{
//wrong version
printf("Wrong version: \nCompressed-data version (%d.%d.%d)\n",version[0], version[1], version[2]);
printf("Current sz version: (%d.%d.%d)\n", versionNumber[0], versionNumber[1], versionNumber[2]);
printf("Please double-check if the compressed data (or file) is correct.\n");
exit(0);
}
int same = sameRByte & 0x01;
//conf_params->szMode = (sameRByte & 0x06)>>1;
int dataByteSizeCode = (sameRByte & 0x0C)>>2;
convertDataTypeSizeCode(dataByteSizeCode); //in bytes
(*this)->isLossless = (sameRByte & 0x10)>>4;
exe_params->SZ_SIZE_TYPE = ((sameRByte & 0x40)>>6)==1?8:4;
int errorBoundMode = ABS;
if(confparams_dec==NULL)
{
confparams_dec = (sz_params*)malloc(sizeof(sz_params));
memset(confparams_dec, 0, sizeof(sz_params));
}
convertBytesToSZParams(&(flatBytes[index]), confparams_dec, exe_params);
/*sz_params* params = convertBytesToSZParams(&(flatBytes[index]));
int mode = confparams_dec->szMode;
int losslessCompressor = confparams_dec->losslessCompressor;
if(confparams_dec!=NULL)
free(confparams_dec);
confparams_dec = params;
confparams_dec->szMode = mode;
confparams_dec->losslessCompressor = losslessCompressor;*/
index += MetaDataByteLength; //20
if(same==0)
(*this)->exactByteSize = flatBytes[index++]; //1
unsigned char dsLengthBytes[8];
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)
dsLengthBytes[i] = flatBytes[index++];
(*this)->dataSeriesLength = bytesToSize(dsLengthBytes);// ST
if((*this)->isLossless==1)
{
//(*this)->exactMidBytes = flatBytes+8;
return errorBoundMode;
}
else if(same==1)
{
(*this)->allSameData = 1;
(*this)->exactDataBytes = &(flatBytes[index]);
return errorBoundMode;
}
else
(*this)->allSameData = 0;
unsigned char byteBuf[8];
for (i = 0; i < 4; i++)
byteBuf[i] = flatBytes[index++];
int max_quant_intervals = bytesToInt_bigEndian(byteBuf);// 4
confparams_dec->maxRangeRadius = max_quant_intervals/2;
if(errorBoundMode>=PW_REL)
{
printf("Error: errorBoundMode>=PW_REL in new_TightDataPointStorageI_fromFlatBytes!! Wrong...\n");
exit(0);
}
for (i = 0; i < 4; i++)
byteBuf[i] = flatBytes[index++];
(*this)->intervals = bytesToInt_bigEndian(byteBuf);// 4
for (i = 0; i < 8; i++)
byteBuf[i] = flatBytes[index++];
(*this)->minValue = bytesToLong_bigEndian(byteBuf); //8
for (i = 0; i < 8; i++)
byteBuf[i] = flatBytes[index++];
(*this)->realPrecision = bytesToDouble(byteBuf);//8
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)
byteBuf[i] = flatBytes[index++];
(*this)->typeArray_size = bytesToSize(byteBuf);// ST
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)
byteBuf[i] = flatBytes[index++];
(*this)->exactDataNum = bytesToSize(byteBuf);// ST
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)
byteBuf[i] = flatBytes[index++];
(*this)->exactDataBytes_size = bytesToSize(byteBuf);// ST
(*this)->typeArray = &flatBytes[index];
//retrieve the number of states (i.e., stateNum)
(*this)->allNodes = bytesToInt_bigEndian((*this)->typeArray); //the first 4 bytes store the stateNum
(*this)->stateNum = ((*this)->allNodes+1)/2;
index+=(*this)->typeArray_size;
if((*this)->exactDataBytes_size > 0)
{
(*this)->exactDataBytes = &flatBytes[index];
index+=(*this)->exactDataBytes_size*sizeof(char);
}
else
(*this)->exactDataBytes = NULL;
return errorBoundMode;
}
/**
*
* type's length == dataSeriesLength
* exactDataBytes's length == exactDataBytes_size
* */
void new_TightDataPointStorageI(TightDataPointStorageI **this,
size_t dataSeriesLength, size_t exactDataNum, int byteSize,
int* type, unsigned char* exactDataBytes, size_t exactDataBytes_size,
double realPrecision, long minValue, int intervals, int dataType)
{
//int i = 0;
*this = (TightDataPointStorageI *)malloc(sizeof(TightDataPointStorageI));
(*this)->allSameData = 0;
(*this)->realPrecision = realPrecision;
(*this)->minValue = minValue;
switch(dataType)
{
case SZ_INT8:
case SZ_UINT8:
(*this)->dataTypeSize = 1;
break;
case SZ_INT16:
case SZ_UINT16:
(*this)->dataTypeSize = 2;
break;
case SZ_INT32:
case SZ_UINT32:
(*this)->dataTypeSize = 4;
break;
case SZ_INT64:
case SZ_UINT64:
(*this)->dataTypeSize = 8;
break;
}
(*this)->dataSeriesLength = dataSeriesLength;
(*this)->exactDataNum = exactDataNum;
(*this)->exactByteSize = byteSize;
int stateNum = 2*intervals;
HuffmanTree* huffmanTree = createHuffmanTree(stateNum);
encode_withTree(huffmanTree, type, dataSeriesLength, &(*this)->typeArray, &(*this)->typeArray_size);
SZ_ReleaseHuffman(huffmanTree);
(*this)->exactDataBytes = exactDataBytes;
(*this)->exactDataBytes_size = exactDataBytes_size;
(*this)->intervals = intervals;
(*this)->isLossless = 0;
}
void convertTDPStoBytes_int(TightDataPointStorageI* tdps, unsigned char* bytes, unsigned char sameByte)
{
size_t i, k = 0;
unsigned char byteBuffer[8] = {0,0,0,0,0,0,0,0};
for(i = 0;i<3;i++)//3 bytes
bytes[k++] = versionNumber[i];
bytes[k++] = sameByte; //1 byte
convertSZParamsToBytes(confparams_cpr, &(bytes[k]));
k = k + MetaDataByteLength;
bytes[k++] = tdps->exactByteSize; //1 byte
sizeToBytes(byteBuffer, tdps->dataSeriesLength);
for(i = 0;i<exe_params->SZ_SIZE_TYPE;i++)//ST: 4 or 8 bytes
bytes[k++] = byteBuffer[i];
intToBytes_bigEndian(byteBuffer, confparams_cpr->max_quant_intervals);
for(i = 0;i<4;i++)//4
bytes[k++] = byteBuffer[i];
intToBytes_bigEndian(byteBuffer, tdps->intervals);
for(i = 0;i<4;i++)//4
bytes[k++] = byteBuffer[i];
longToBytes_bigEndian(byteBuffer, tdps->minValue);
for (i = 0; i < 8; i++)// 8
bytes[k++] = byteBuffer[i];
doubleToBytes(byteBuffer, tdps->realPrecision);
for (i = 0; i < 8; i++)// 8
bytes[k++] = byteBuffer[i];
sizeToBytes(byteBuffer, tdps->typeArray_size);
for(i = 0;i<exe_params->SZ_SIZE_TYPE;i++)//ST
bytes[k++] = byteBuffer[i];
sizeToBytes(byteBuffer, tdps->exactDataNum);
for(i = 0;i<exe_params->SZ_SIZE_TYPE;i++)//ST
bytes[k++] = byteBuffer[i];
sizeToBytes(byteBuffer, tdps->exactDataBytes_size);
for(i = 0;i<exe_params->SZ_SIZE_TYPE;i++)//ST
bytes[k++] = byteBuffer[i];
memcpy(&(bytes[k]), tdps->typeArray, tdps->typeArray_size);
k += tdps->typeArray_size;
memcpy(&(bytes[k]), tdps->exactDataBytes, tdps->exactDataBytes_size);
k += tdps->exactDataBytes_size;
}
//convert TightDataPointStorageI to bytes...
void convertTDPStoFlatBytes_int(TightDataPointStorageI *tdps, unsigned char** bytes, size_t *size)
{
size_t i, k = 0;
unsigned char dsLengthBytes[8];
if(exe_params->SZ_SIZE_TYPE==4)
intToBytes_bigEndian(dsLengthBytes, tdps->dataSeriesLength);//4
else
longToBytes_bigEndian(dsLengthBytes, tdps->dataSeriesLength);//8
unsigned char sameByte = tdps->allSameData==1?(unsigned char)1:(unsigned char)0;
sameByte = sameByte | (confparams_cpr->szMode << 1);
if(tdps->isLossless)
sameByte = (unsigned char) (sameByte | 0x10);
int dataTypeSizeCode = convertDataTypeSize(tdps->dataTypeSize);
sameByte = (unsigned char) (sameByte | dataTypeSizeCode);
if(exe_params->SZ_SIZE_TYPE==8)
sameByte = (unsigned char) (sameByte | 0x40); // 01000000, the 6th bit
if(tdps->allSameData==1)
{
size_t totalByteLength = 3 + 1 + MetaDataByteLength + exe_params->SZ_SIZE_TYPE + tdps->exactDataBytes_size;
*bytes = (unsigned char *)malloc(sizeof(unsigned char)*totalByteLength);
for (i = 0; i < 3; i++)//3
(*bytes)[k++] = versionNumber[i];
(*bytes)[k++] = sameByte;//1
convertSZParamsToBytes(confparams_cpr, &((*bytes)[k]));
k = k + MetaDataByteLength;
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)
(*bytes)[k++] = dsLengthBytes[i];
for (i = 0; i < tdps->exactDataBytes_size; i++)
(*bytes)[k++] = tdps->exactDataBytes[i];
*size = totalByteLength;
}
else
{
if(confparams_cpr->errorBoundMode>=PW_REL)
{
printf("Error: errorBoundMode >= PW_REL!! can't be...\n");
exit(0);
}
size_t totalByteLength = 3 + 1 + MetaDataByteLength + 1 + exe_params->SZ_SIZE_TYPE + 4 + 4 + 8 + 8
+ exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE
+ tdps->typeArray_size + tdps->exactDataBytes_size;
*bytes = (unsigned char *)malloc(sizeof(unsigned char)*totalByteLength);
convertTDPStoBytes_int(tdps, *bytes, sameByte);
*size = totalByteLength;
}
}
void convertTDPStoFlatBytes_int_args(TightDataPointStorageI *tdps, unsigned char* bytes, size_t *size)
{
size_t i, k = 0;
unsigned char dsLengthBytes[8];
if(exe_params->SZ_SIZE_TYPE==4)
intToBytes_bigEndian(dsLengthBytes, tdps->dataSeriesLength);//4
else
longToBytes_bigEndian(dsLengthBytes, tdps->dataSeriesLength);//8
unsigned char sameByte = tdps->allSameData==1?(unsigned char)1:(unsigned char)0;
sameByte = sameByte | (confparams_cpr->szMode << 1);
if(tdps->isLossless)
sameByte = (unsigned char) (sameByte | 0x10);
if(exe_params->SZ_SIZE_TYPE==8)
sameByte = (unsigned char) (sameByte | 0x40); // 01000000, the 6th bit
if(tdps->allSameData==1)
{
size_t totalByteLength = 3 + 1 + MetaDataByteLength + exe_params->SZ_SIZE_TYPE + tdps->exactDataBytes_size;
//*bytes = (unsigned char *)malloc(sizeof(unsigned char)*totalByteLength);
for (i = 0; i < 3; i++)//3
bytes[k++] = versionNumber[i];
bytes[k++] = sameByte;//1
convertSZParamsToBytes(confparams_cpr, &(bytes[k]));
k = k + MetaDataByteLength;
for (i = 0; i < exe_params->SZ_SIZE_TYPE; i++)//ST
bytes[k++] = dsLengthBytes[i];
for (i = 0; i < tdps->exactDataBytes_size; i++)
bytes[k++] = tdps->exactDataBytes[i];
*size = totalByteLength;
}
else
{
if(confparams_cpr->errorBoundMode>=PW_REL)
{
printf("Error: errorBoundMode>=PW_REL!! can't be....\n");
exit(0);
}
size_t totalByteLength = 3 + 1 + MetaDataByteLength + exe_params->SZ_SIZE_TYPE + 1 + 4 + 4 + 8 + 8
+ exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE
+ tdps->typeArray_size + tdps->exactDataBytes_size;
convertTDPStoBytes_int(tdps, bytes, sameByte);
*size = totalByteLength;
}
}
void free_TightDataPointStorageI(TightDataPointStorageI *tdps)
{
if(tdps->typeArray!=NULL)
free(tdps->typeArray);
if(tdps->exactDataBytes!=NULL)
free(tdps->exactDataBytes);
free(tdps);
}
void free_TightDataPointStorageI2(TightDataPointStorageI *tdps)
{
free(tdps);
}

732
deps/SZ/sz/src/sz.c vendored
View File

@ -202,48 +202,7 @@ double relBoundRatio, double pwrBoundRatio, size_t r5, size_t r4, size_t r3, siz
}
}
int SZ_compress_args2(int dataType, void *data, unsigned char* compressed_bytes, size_t *outSize,
int errBoundMode, double absErrBound, double relBoundRatio, double pwrBoundRatio,
size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
unsigned char* bytes = SZ_compress_args(dataType, data, outSize, errBoundMode, absErrBound, relBoundRatio, pwrBoundRatio, r5, r4, r3, r2, r1);
memcpy(compressed_bytes, bytes, *outSize);
free(bytes);
return SZ_SCES;
}
int SZ_compress_args3(int dataType, void *data, unsigned char* compressed_bytes, size_t *outSize, int errBoundMode, double absErrBound, double relBoundRatio,
size_t r5, size_t r4, size_t r3, size_t r2, size_t r1,
size_t s5, size_t s4, size_t s3, size_t s2, size_t s1,
size_t e5, size_t e4, size_t e3, size_t e2, size_t e1)
{
confparams_cpr->dataType = dataType;
if(dataType==SZ_FLOAT)
{
SZ_compress_args_float_subblock(compressed_bytes, (float *)data,
r5, r4, r3, r2, r1,
s5, s4, s3, s2, s1,
e5, e4, e3, e2, e1,
outSize, errBoundMode, absErrBound, relBoundRatio);
return SZ_SCES;
}
else if(dataType==SZ_DOUBLE)
{
SZ_compress_args_double_subblock(compressed_bytes, (double *)data,
r5, r4, r3, r2, r1,
s5, s4, s3, s2, s1,
e5, e4, e3, e2, e1,
outSize, errBoundMode, absErrBound, relBoundRatio);
return SZ_SCES;
}
else
{
printf("Error (in SZ_compress_args3): dataType can only be SZ_FLOAT or SZ_DOUBLE.\n");
return SZ_NSCS;
}
}
unsigned char *SZ_compress(int dataType, void *data, size_t *outSize, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
@ -264,36 +223,7 @@ unsigned char *SZ_compress(int dataType, void *data, size_t *outSize, size_t r5,
**/
/*-------------------------------------------------------------------------*/
unsigned char *SZ_compress_rev_args(int dataType, void *data, void *reservedValue, size_t *outSize, int errBoundMode, double absErrBound, double relBoundRatio,
size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
unsigned char *newByteData;
//TODO
printf("SZ compression with reserved data is TO BE DONE LATER.\n");
exit(0);
return newByteData;
}
int SZ_compress_rev_args2(int dataType, void *data, void *reservedValue, unsigned char* compressed_bytes, size_t *outSize, int errBoundMode, double absErrBound, double relBoundRatio,
size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
confparams_cpr->dataType = dataType;
unsigned char* bytes = SZ_compress_rev_args(dataType, data, reservedValue, outSize, errBoundMode, absErrBound, relBoundRatio, r5, r4, r3, r2, r1);
memcpy(compressed_bytes, bytes, *outSize);
free(bytes); //free(bytes) is removed , because of dump error at MIRA system (PPC architecture), fixed?
return 0;
}
unsigned char *SZ_compress_rev(int dataType, void *data, void *reservedValue, size_t *outSize, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
unsigned char *newByteData;
//TODO
printf("SZ compression with reserved data is TO BE DONE LATER.\n");
exit(0);
return newByteData;
}
void *SZ_decompress(int dataType, unsigned char *bytes, size_t byteLength, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
@ -357,63 +287,7 @@ size_t SZ_decompress_args(int dataType, unsigned char *bytes, size_t byteLength,
memcpy(data_array, data, nbEle*sizeof(double));
//for(i=0;i<nbEle;i++)
// data_array[i] = data[i];
free(data); //this free operation seems to not work with BlueG/Q system.
}
else if(dataType == SZ_INT8)
{
int8_t* data = (int8_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
int8_t* data_array = (int8_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(int8_t));
free(data);
}
else if(dataType == SZ_INT16)
{
int16_t* data = (int16_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
int16_t* data_array = (int16_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(int16_t));
free(data);
}
else if(dataType == SZ_INT32)
{
int32_t* data = (int32_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
int32_t* data_array = (int32_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(int32_t));
free(data);
}
else if(dataType == SZ_INT64)
{
int64_t* data = (int64_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
int64_t* data_array = (int64_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(int64_t));
free(data);
}
else if(dataType == SZ_UINT8)
{
uint8_t* data = (uint8_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
uint8_t* data_array = (uint8_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(uint8_t));
free(data);
}
else if(dataType == SZ_UINT16)
{
uint16_t* data = (uint16_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
uint16_t* data_array = (uint16_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(uint16_t));
free(data);
}
else if(dataType == SZ_UINT32)
{
uint32_t* data = (uint32_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
uint32_t* data_array = (uint32_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(uint32_t));
free(data);
}
else if(dataType == SZ_UINT64)
{
uint64_t* data = (uint64_t*)SZ_decompress(dataType, bytes, byteLength, r5, r4, r3, r2, r1);
uint64_t* data_array = (uint64_t *)decompressed_array;
memcpy(data_array, data, nbEle*sizeof(uint64_t));
free(data);
free(data); //this free operation seems to not work with BlueG/Q system.
}
else
{
@ -425,610 +299,6 @@ size_t SZ_decompress_args(int dataType, unsigned char *bytes, size_t byteLength,
}
sz_metadata* SZ_getMetadata(unsigned char* bytes, sz_exedata* pde_exe)
{
int index = 0, i, isConstant, isLossless;
size_t dataSeriesLength = 0;
int versions[3] = {0,0,0};
for (i = 0; i < 3; i++)
versions[i] = bytes[index++]; //3
unsigned char sameRByte = bytes[index++]; //1
isConstant = sameRByte & 0x01;
//confparams_dec->szMode = (sameRByte & 0x06)>>1;
isLossless = (sameRByte & 0x10)>>4;
int isRegressionBased = (sameRByte >> 7) & 0x01;
pde_exe->SZ_SIZE_TYPE = ((sameRByte & 0x40)>>6)==1?8:4;
if(confparams_dec==NULL)
{
confparams_dec = (sz_params*)malloc(sizeof(sz_params));
memset(confparams_dec, 0, sizeof(sz_params));
}
convertBytesToSZParams(&(bytes[index]), confparams_dec, pde_exe);
/*sz_params* params = convertBytesToSZParams(&(bytes[index]));
if(confparams_dec!=NULL)
free(confparams_dec);
confparams_dec = params;*/
if(confparams_dec->dataType==SZ_FLOAT)
index += MetaDataByteLength;
else if(confparams_dec->dataType==SZ_DOUBLE)
index += MetaDataByteLength_double;
if(confparams_dec->dataType!=SZ_FLOAT && confparams_dec->dataType!= SZ_DOUBLE) //if this type is an Int type
index++; //jump to the dataLength info byte address
dataSeriesLength = bytesToSize(&(bytes[index]));// 4 or 8
index += exe_params->SZ_SIZE_TYPE;
//index += 4; //max_quant_intervals
sz_metadata* metadata = (sz_metadata*)malloc(sizeof(struct sz_metadata));
metadata->versionNumber[0] = versions[0];
metadata->versionNumber[1] = versions[1];
metadata->versionNumber[2] = versions[2];
metadata->isConstant = isConstant;
metadata->isLossless = isLossless;
metadata->sizeType = exe_params->SZ_SIZE_TYPE;
metadata->dataSeriesLength = dataSeriesLength;
metadata->conf_params = confparams_dec;
int defactoNBBins = 0; //real # bins
if(isConstant==0 && isLossless==0)
{
if(isRegressionBased==1)
{
unsigned char* raBytes = &(bytes[index]);
defactoNBBins = bytesToInt_bigEndian(raBytes + sizeof(int) + sizeof(double));
}
else
{
int radExpoL = 0, segmentL = 0, pwrErrBoundBytesL = 0;
if(metadata->conf_params->errorBoundMode >= PW_REL)
{
radExpoL = 1;
segmentL = exe_params->SZ_SIZE_TYPE;
pwrErrBoundBytesL = 4;
}
int mdbl = confparams_dec->dataType==SZ_FLOAT?MetaDataByteLength:MetaDataByteLength_double;
int offset_typearray = 3 + 1 + mdbl + exe_params->SZ_SIZE_TYPE + 4 + radExpoL + segmentL + pwrErrBoundBytesL + 4 + (4 + confparams_dec->dataType*4) + 1 + 8
+ exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + 4;
defactoNBBins = bytesToInt_bigEndian(bytes+offset_typearray);
}
}
metadata->defactoNBBins = defactoNBBins;
return metadata;
}
void SZ_printMetadata(sz_metadata* metadata)
{
printf("=================SZ Compression Meta Data=================\n");
printf("Version: \t %d.%d.%d\n", metadata->versionNumber[0], metadata->versionNumber[1], metadata->versionNumber[2]);
printf("Constant data?: \t %s\n", metadata->isConstant==1?"YES":"NO");
printf("Lossless?: \t %s\n", metadata->isLossless==1?"YES":"NO");
printf("Size type (size of # elements): \t %d bytes\n", metadata->sizeType);
printf("Num of elements: \t %zu\n", metadata->dataSeriesLength);
sz_params* params = metadata->conf_params;
if(params->sol_ID == SZ)
printf("compressor Name: \t SZ\n");
else if(params->sol_ID == SZ_Transpose)
printf("compressor Name: \t SZ_Transpose\n");
else
printf("compressor Name: \t Other compressor\n");
switch(params->dataType)
{
case SZ_FLOAT:
printf("Data type: \t FLOAT\n");
printf("min value of raw data: \t %f\n", params->fmin);
printf("max value of raw data: \t %f\n", params->fmax);
break;
case SZ_DOUBLE:
printf("Data type: \t DOUBLE\n");
printf("min value of raw data: \t %f\n", params->dmin);
printf("max value of raw data: \t %f\n", params->dmax);
break;
case SZ_INT8:
printf("Data type: \t INT8\n");
break;
case SZ_INT16:
printf("Data type: \t INT16\n");
break;
case SZ_INT32:
printf("Data type: \t INT32\n");
break;
case SZ_INT64:
printf("Data type: \t INT64\n");
break;
case SZ_UINT8:
printf("Data type: \t UINT8\n");
break;
case SZ_UINT16:
printf("Data type: \t UINT16\n");
break;
case SZ_UINT32:
printf("Data type: \t UINT32\n");
break;
case SZ_UINT64:
printf("Data type: \t UINT64\n");
break;
}
if(exe_params->optQuantMode==1)
{
printf("quantization_intervals: \t 0\n");
printf("max_quant_intervals: \t %d\n", params->max_quant_intervals);
printf("actual used # intervals: \t %d\n", metadata->defactoNBBins);
}
else
{
printf("quantization_intervals: \t %d\n", params->quantization_intervals);
printf("max_quant_intervals: \t - %d\n", params->max_quant_intervals);
}
printf("dataEndianType (prior raw data):\t %s\n", dataEndianType==BIG_ENDIAN_DATA?"BIG_ENDIAN":"LITTLE_ENDIAN");
printf("sysEndianType (at compression): \t %s\n", sysEndianType==1?"BIG_ENDIAN":"LITTLE_ENDIAN");
printf("sampleDistance: \t %d\n", params->sampleDistance);
printf("predThreshold: \t %f\n", params->predThreshold);
switch(params->szMode)
{
case SZ_BEST_SPEED:
printf("szMode: \t SZ_BEST_SPEED (without Gzip)\n");
break;
case SZ_BEST_COMPRESSION:
printf("szMode: \t SZ_BEST_COMPRESSION (with Zstd or Gzip)\n");
break;
}
switch(params->gzipMode)
{
case Z_BEST_SPEED:
printf("gzipMode: \t Z_BEST_SPEED\n");
break;
case Z_DEFAULT_COMPRESSION:
printf("gzipMode: \t Z_BEST_SPEED\n");
break;
case Z_BEST_COMPRESSION:
printf("gzipMode: \t Z_BEST_COMPRESSION\n");
break;
}
switch(params->errorBoundMode)
{
case ABS:
printf("errBoundMode: \t ABS\n");
printf("absErrBound: \t %f\n", params->absErrBound);
break;
case REL:
printf("errBoundMode: \t REL (based on value_range extent)\n");
printf("relBoundRatio: \t %f\n", params->relBoundRatio);
break;
case ABS_AND_REL:
printf("errBoundMode: \t ABS_AND_REL\n");
printf("absErrBound: \t %f\n", params->absErrBound);
printf("relBoundRatio: \t %f\n", params->relBoundRatio);
break;
case ABS_OR_REL:
printf("errBoundMode: \t ABS_OR_REL\n");
printf("absErrBound: \t %f\n", params->absErrBound);
printf("relBoundRatio: \t %f\n", params->relBoundRatio);
break;
case PSNR:
printf("errBoundMode: \t PSNR\n");
printf("psnr: \t %f\n", params->psnr);
break;
case PW_REL:
printf("errBoundMode: \t PW_REL\n");
break;
case ABS_AND_PW_REL:
printf("errBoundMode: \t ABS_AND_PW_REL\n");
printf("absErrBound: \t %f\n", params->absErrBound);
break;
case ABS_OR_PW_REL:
printf("errBoundMode: \t ABS_OR_PW_REL\n");
printf("absErrBound: \t %f\n", params->absErrBound);
break;
case REL_AND_PW_REL:
printf("errBoundMode: \t REL_AND_PW_REL\n");
printf("range_relBoundRatio: \t %f\n", params->relBoundRatio);
break;
case REL_OR_PW_REL:
printf("errBoundMode: \t REL_OR_PW_REL\n");
printf("range_relBoundRatio: \t %f\n", params->relBoundRatio);
break;
}
if(params->errorBoundMode>=PW_REL && params->errorBoundMode<=REL_OR_PW_REL)
{
printf("pw_relBoundRatio: \t %f\n", params->pw_relBoundRatio);
//printf("segment_size: \t %d\n", params->segment_size);
switch(params->pwr_type)
{
case SZ_PWR_MIN_TYPE:
printf("pwrType: \t SZ_PWR_MIN_TYPE\n");
break;
case SZ_PWR_AVG_TYPE:
printf("pwrType: \t SZ_PWR_AVG_TYPE\n");
break;
case SZ_PWR_MAX_TYPE:
printf("pwrType: \t SZ_PWR_MAX_TYPE\n");
break;
}
}
}
/*-----------------------------------batch data compression--------------------------------------*/
void filloutDimArray(size_t* dim, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
if(r2==0)
dim[0] = r1;
else if(r3==0)
{
dim[0] = r2;
dim[1] = r1;
}
else if(r4==0)
{
dim[0] = r3;
dim[1] = r2;
dim[2] = r1;
}
else if(r5==0)
{
dim[0] = r4;
dim[1] = r3;
dim[2] = r2;
dim[3] = r1;
}
else
{
dim[0] = r5;
dim[1] = r4;
dim[2] = r3;
dim[3] = r2;
dim[4] = r1;
}
}
size_t compute_total_batch_size()
{
size_t eleNum = 0, totalSize = 0;
SZ_Variable* p = sz_varset->header;
while(p->next!=NULL)
{
eleNum = computeDataLength(p->next->r5, p->next->r4, p->next->r3, p->next->r2, p->next->r1);
if(p->next->dataType==SZ_FLOAT)
totalSize += (eleNum*4);
else
totalSize += (eleNum*8);
p=p->next;
}
return totalSize;
}
void SZ_registerVar(int var_id, char* varName, int dataType, void* data,
int errBoundMode, double absErrBound, double relBoundRatio, double pwRelBoundRatio,
size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
if(sz_tsc==NULL)
initSZ_TSC();
//char str[256];
SZ_batchAddVar(var_id, varName, dataType, data,
errBoundMode, absErrBound, relBoundRatio, pwRelBoundRatio, r5, r4, r3, r2, r1);
//sprintf(str, "%d: %s : %zuX%zuX%zuX%zu%zu : %d : %f : %f : %f\n", sz_varset->count - 1, varName, r5, r4, r3, r2, r1, errBoundMode, absErrBound, relBoundRatio, pwRelBoundRatio);
//fputs(str, sz_tsc->metadata_file);
}
int SZ_deregisterVar_ID(int var_id)
{
int state = SZ_batchDelVar_ID(var_id);
return state;
}
int SZ_deregisterVar(char* varName)
{
int state = SZ_batchDelVar(varName);
return state;
}
#ifdef HAVE_TIMECMPR
/**
* process multiple variables
* */
int SZ_compress_ts_select_var(int cmprType, unsigned char* var_ids, unsigned char var_count, unsigned char** newByteData, size_t *outSize)
{
confparams_cpr->szMode = SZ_TEMPORAL_COMPRESSION;
confparams_cpr->predictionMode = SZ_PREVIOUS_VALUE_ESTIMATE;
SZ_VarSet* vset = sz_varset;
int i = 0, j = 0, totalSize = 0;
SZ_Variable* vp[256];
SZ_Variable* v = vset->header->next;
for(i = 0;i<vset->count;i++)
{
int found = checkVarID(v->var_id, var_ids, var_count);
if (found)
{
multisteps = v->multisteps;
if(v->dataType==SZ_FLOAT)
{
SZ_compress_args_float(cmprType, confparams_cpr->withRegression, &(v->compressedBytes), (float*)v->data, v->r5, v->r4, v->r3, v->r2, v->r1, &(v->compressedSize), v->errBoundMode, v->absErrBound, v->relBoundRatio, v->pwRelBoundRatio);
}
else if(v->dataType==SZ_DOUBLE)
{
SZ_compress_args_double(cmprType, confparams_cpr->withRegression, &(v->compressedBytes), (double*)v->data, v->r5, v->r4, v->r3, v->r2, v->r1, &(v->compressedSize), v->errBoundMode, v->absErrBound, v->relBoundRatio, v->pwRelBoundRatio);
}
totalSize += v->compressedSize;
v->compressType = multisteps->compressionType;
vp[j] = v;
j++;
}
v = v->next;
}
*outSize = sizeof(int) + sizeof(unsigned short) + totalSize + var_count*(3*sizeof(unsigned char)+sizeof(size_t));
*newByteData = (unsigned char*)malloc(*outSize);
unsigned char* p = *newByteData;
intToBytes_bigEndian(p, sz_tsc->currentStep);
p+=4;
shortToBytes(p, var_count);
p+=2;
for(i=0;i<var_count;i++)
{
v = vp[i];
*p = v->var_id; //1 byte
p++;
*p = (unsigned char)v->compressType; //1 byte
p++;
*p = (unsigned char)v->dataType; //1 byte
p++;
sizeToBytes(p, v->compressedSize); //size_t
p += sizeof(size_t);
memcpy(p, v->compressedBytes, v->compressedSize); //outSize_[i]
p += v->compressedSize;
}
sz_tsc->currentStep ++;
return SZ_SCES;
}
/**
* process all variables
* */
int SZ_compress_ts(int cmprType, unsigned char** newByteData, size_t *outSize)
{
confparams_cpr->szMode = SZ_TEMPORAL_COMPRESSION;
confparams_cpr->predictionMode = SZ_PREVIOUS_VALUE_ESTIMATE;
SZ_VarSet* vset = sz_varset;
//char *metadata_str = (char*)malloc(vset->count*256);
//memset(metadata_str, 0, vset->count*256);
//sprintf(metadata_str, "step %d", sz_tsc->currentStep);
int i = 0, totalSize = 0;
SZ_Variable* v = vset->header->next;
for(i=0;i<vset->count;i++)
{
multisteps = v->multisteps; //assign the v's multisteps to the global variable 'multisteps', which will be used in the following compression.
if(v->dataType==SZ_FLOAT)
{
SZ_compress_args_float(cmprType, confparams_cpr->withRegression, &(v->compressedBytes), (float*)v->data, v->r5, v->r4, v->r3, v->r2, v->r1, &(v->compressedSize), v->errBoundMode, v->absErrBound, v->relBoundRatio, v->pwRelBoundRatio);
}
else if(v->dataType==SZ_DOUBLE)
{
SZ_compress_args_double(cmprType, confparams_cpr->withRegression, &(v->compressedBytes), (double*)v->data, v->r5, v->r4, v->r3, v->r2, v->r1, &(v->compressedSize), v->errBoundMode, v->absErrBound, v->relBoundRatio, v->pwRelBoundRatio);
}
//sprintf(metadata_str, "%s:%d,%d,%zu", metadata_str, i, multisteps->lastSnapshotStep, outSize_[i]);
totalSize += v->compressedSize;
v->compressType = multisteps->compressionType;
v = v->next;
}
//sprintf(metadata_str, "%s\n", metadata_str);
//fputs(metadata_str, sz_tsc->metadata_file);
//free(metadata_str);
//sizeof(int)==current time step; 2*sizeof(char)+sizeof(size_t)=={compressionType + datatype + compression_data_size};
//sizeof(char)==# variables
*outSize = sizeof(int) + sizeof(unsigned short) + totalSize + vset->count*(3*sizeof(unsigned char)+sizeof(size_t));
*newByteData = (unsigned char*)malloc(*outSize);
unsigned char* p = *newByteData;
intToBytes_bigEndian(p, sz_tsc->currentStep);
p+=4;
shortToBytes(p, vset->count);
p+=2;
v = vset->header->next;
for(i=0;i<vset->count;i++)
{
*p = v->var_id; //1 byte
p++;
*p = (unsigned char)v->compressType; //1 byte
p++;
*p = (unsigned char)v->dataType; //1 byte
p++;
sizeToBytes(p, v->compressedSize); //size_t
p += sizeof(size_t);
memcpy(p, v->compressedBytes, v->compressedSize); //outSize_[i]
p += v->compressedSize;
v = v->next;
}
sz_tsc->currentStep ++;
//free(outSize_);
return SZ_SCES;
}
void SZ_decompress_ts(unsigned char *bytes, size_t bytesLength)
{
sz_params de_params;
memset(&de_params, 0, sizeof(sz_params));
de_params.szMode = SZ_TEMPORAL_COMPRESSION;
de_params.predictionMode = SZ_PREVIOUS_VALUE_ESTIMATE;
sz_exedata de_exe;
memset(&de_exe, 0, sizeof(sz_exedata));
int x = 1;
char *y = (char*)&x;
if(*y==1)
sysEndianType = LITTLE_ENDIAN_SYSTEM;
else //=0
sysEndianType = BIG_ENDIAN_SYSTEM;
int i = 0;
size_t r5 = 0, r4 = 0, r3 = 0, r2 = 0, r1 = 0;
unsigned char* q = bytes;
sz_tsc->currentStep = bytesToInt_bigEndian(q);
q += 4;
unsigned short nbVars = (unsigned short)bytesToShort(q);
q += 2;
float *newFloatData = NULL;
double *newDoubleData = NULL;
for(i=0;i<nbVars;i++)
{
unsigned char var_id = *(q++);
SZ_Variable* p = SZ_getVariable(var_id);
sz_multisteps* multisteps = p->multisteps;
multisteps->compressionType = *(q++);
unsigned char dataType = *(q++);
size_t cmpSize = bytesToSize(q);
q += sizeof(size_t);
if(p==NULL)
q += cmpSize;
else
{
sz_multisteps* multisteps = p->multisteps;
r5 = p->r5;
r4 = p->r4;
r3 = p->r3;
r2 = p->r2;
r1 = p->r1;
size_t dataLen = computeDataLength(r5, r4, r3, r2, r1);
unsigned char* cmpBytes = q;
switch(dataType)
{
case SZ_FLOAT:
SZ_decompress_args_float(&newFloatData, r5, r4, r3, r2, r1, cmpBytes, cmpSize, multisteps->compressionType, multisteps->hist_data, &de_exe, &de_params);
memcpy(p->data, newFloatData, dataLen*sizeof(float));
free(newFloatData);
break;
case SZ_DOUBLE:
SZ_decompress_args_double(&newDoubleData, r5, r4, r3, r2, r1, cmpBytes, cmpSize, multisteps->compressionType, multisteps->hist_data, &de_exe, &de_params);
memcpy(p->data, newDoubleData, dataLen*sizeof(double));
free(newDoubleData);
break;
default:
printf("Error: data type cannot be the types other than SZ_FLOAT or SZ_DOUBLE\n");
return;
}
q += cmpSize;
}
}
}
void SZ_decompress_ts_select_var(unsigned char* var_ids, unsigned char var_count, unsigned char *bytes, size_t bytesLength)
{
sz_params de_params;
memset(&de_params, 0, sizeof(sz_params));
de_params.szMode = SZ_TEMPORAL_COMPRESSION;
de_params.predictionMode = SZ_PREVIOUS_VALUE_ESTIMATE;
sz_exedata de_exe;
memset(&de_exe, 0, sizeof(sz_exedata));
int x = 1;
char *y = (char*)&x;
if(*y==1)
sysEndianType = LITTLE_ENDIAN_SYSTEM;
else //=0
sysEndianType = BIG_ENDIAN_SYSTEM;
int i = 0;
size_t r5 = 0, r4 = 0, r3 = 0, r2 = 0, r1 = 0;
unsigned char* q = bytes;
sz_tsc->currentStep = bytesToInt_bigEndian(q);
q += 4;
unsigned short nbVars = (unsigned short)bytesToShort(q);
q += 2;
float *newFloatData = NULL;
double *newDoubleData = NULL;
for(i=0;i<nbVars;i++)
{
unsigned char var_id = *(q++);
int selected = checkVarID(var_id, var_ids, var_count);
SZ_Variable* p = SZ_getVariable(var_id);
sz_multisteps* multisteps = p->multisteps;
multisteps->compressionType = *(q++);
unsigned char dataType = *(q++);
size_t cmpSize = bytesToSize(q);
q += sizeof(size_t);
if(p==NULL || selected == 0) //p==NULL means the variable was not registered during compression ; selected==0 means that the variable is not selected
q += cmpSize;
else // p!=NULL && selected == 1
{
sz_multisteps* multisteps = p->multisteps;
r5 = p->r5;
r4 = p->r4;
r3 = p->r3;
r2 = p->r2;
r1 = p->r1;
size_t dataLen = computeDataLength(r5, r4, r3, r2, r1);
unsigned char* cmpBytes = q;
switch(dataType)
{
case SZ_FLOAT:
SZ_decompress_args_float(&newFloatData, r5, r4, r3, r2, r1, cmpBytes, cmpSize, multisteps->compressionType, multisteps->hist_data, &de_exe, &de_params);
memcpy(p->data, newFloatData, dataLen*sizeof(float));
free(newFloatData);
break;
case SZ_DOUBLE:
SZ_decompress_args_double(&newDoubleData, r5, r4, r3, r2, r1, cmpBytes, cmpSize, multisteps->compressionType, multisteps->hist_data, &de_exe, &de_params);
memcpy(p->data, newDoubleData, dataLen*sizeof(double));
free(newDoubleData);
break;
default:
printf("Error: data type cannot be the types other than SZ_FLOAT or SZ_DOUBLE\n");
return;
}
q += cmpSize;
}
}
}
#endif
void SZ_Finalize()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1385
deps/SZ/sz/src/sz_int8.c vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,924 +0,0 @@
/**
* @file szd_int16.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2017 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_int16.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_int16(int16_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(int16_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+2+4+MetaDataByteLength && cmpSize!=4+2+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(int16_t);
if(tdps->isLossless)
{
*newData = (int16_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = bytesToInt16_bigEndian(p);
}
}
else if(confparams_dec->sol_ID==SZ_Transpose)
{
getSnapshotData_int16_1D(newData,dataLength,tdps, errBoundMode);
}
else //confparams_dec->sol_ID==SZ
{
if (dim == 1)
getSnapshotData_int16_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_int16_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_int16_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_int16_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(int16_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_int16_1D(int16_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t i;
double interval = tdps->realPrecision*2;
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
long predValue, tmp;
int16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT16);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
tmp = predValue + (type_-exe_params->intvRadius)*interval;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[i] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[i] = SZ_INT16_MIN;
else
(*data)[i] = SZ_INT16_MAX;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_int16_2D(int16_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT16);
long pred1D, pred2D, tmp;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[1] = SZ_INT16_MIN;
else
(*data)[1] = SZ_INT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[jj] = SZ_INT16_MIN;
else
(*data)[jj] = SZ_INT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_int16_3D(int16_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT16);
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[1] = SZ_INT16_MIN;
else
(*data)[1] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[jj] = SZ_INT16_MIN;
else
(*data)[jj] = SZ_INT16_MAX; }
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_int16_4D(int16_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT16);
int type_;
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT16_MIN&&tmp<SZ_INT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT16_MIN)
(*data)[index] = SZ_INT16_MIN;
else
(*data)[index] = SZ_INT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_int16_1D(int16_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
int16_t value = bytesToInt16_bigEndian(tdps->exactDataBytes);
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int16_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_int16_2D(int16_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
int16_t value = bytesToInt16_bigEndian(tdps->exactDataBytes);
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int16_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_int16_3D(int16_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
int16_t value = bytesToInt16_bigEndian(tdps->exactDataBytes);
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int16_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_int16_4D(int16_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
int16_t value = bytesToInt16_bigEndian(tdps->exactDataBytes);
*data = (int16_t*)malloc(sizeof(int16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int16_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,789 +0,0 @@
/**
* @file szd_int32.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_int32.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_int32(int32_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(int32_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+4+4+MetaDataByteLength && cmpSize!=4+4+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(int32_t);
if(tdps->isLossless)
{
*newData = (int32_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = bytesToInt32_bigEndian(p);
}
}
else if (dim == 1)
getSnapshotData_int32_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_int32_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_int32_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_int32_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(int32_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_int32_1D(int32_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t i;
double interval = tdps->realPrecision*2;
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
int32_t minValue, exactData, predValue;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT32);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
(*data)[i] = predValue + (type_-exe_params->intvRadius)*interval;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_int32_2D(int32_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int32_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT32);
int32_t pred1D, pred2D;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_int32_3D(int32_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int32_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT32);
int32_t pred1D, pred2D, pred3D;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_int32_4D(int32_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int32_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT32);
int type_;
int32_t pred1D, pred2D, pred3D;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_int32_1D(int32_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
int32_t value = bytesToInt32_bigEndian(tdps->exactDataBytes);
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int32_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_int32_2D(int32_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
int32_t value = bytesToInt32_bigEndian(tdps->exactDataBytes);
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int32_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_int32_3D(int32_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
int32_t value = bytesToInt32_bigEndian(tdps->exactDataBytes);
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int32_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_int32_4D(int32_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
int32_t value = bytesToInt32_bigEndian(tdps->exactDataBytes);
*data = (int32_t*)malloc(sizeof(int32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int32_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,789 +0,0 @@
/**
* @file szd_int64.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2017 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_int64.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_int64(int64_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(int64_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+8+4+MetaDataByteLength && cmpSize!=4+8+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(int64_t);
if(tdps->isLossless)
{
*newData = (int64_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = bytesToInt64_bigEndian(p);
}
}
else if (dim == 1)
getSnapshotData_int64_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_int64_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_int64_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_int64_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(int64_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_int64_1D(int64_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t i;
double interval = tdps->realPrecision*2;
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
int64_t minValue, exactData, predValue;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT64);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
(*data)[i] = predValue + (type_-exe_params->intvRadius)*interval;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_int64_2D(int64_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int64_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT64);
int64_t pred1D, pred2D;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_int64_3D(int64_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int64_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT64);
int64_t pred1D, pred2D, pred3D;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_int64_4D(int64_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int64_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT64);
int type_;
int64_t pred1D, pred2D, pred3D;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_int64_1D(int64_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
int64_t value = bytesToInt64_bigEndian(tdps->exactDataBytes);
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int64_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_int64_2D(int64_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
int64_t value = bytesToInt64_bigEndian(tdps->exactDataBytes);
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int64_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_int64_3D(int64_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
int64_t value = bytesToInt64_bigEndian(tdps->exactDataBytes);
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int64_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_int64_4D(int64_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
int64_t value = bytesToInt64_bigEndian(tdps->exactDataBytes);
*data = (int64_t*)malloc(sizeof(int64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int64_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,913 +0,0 @@
/**
* @file szd_int8.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2017 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_int8.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_int8(int8_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(int8_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+1+4+MetaDataByteLength && cmpSize!=4+1+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(int8_t);
if(tdps->isLossless)
{
*newData = (int8_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = *p;
}
}
else if (dim == 1)
getSnapshotData_int8_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_int8_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_int8_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_int8_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(int8_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_int8_1D(int8_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
double interval = tdps->realPrecision*2;
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
long predValue, tmp;
int8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT8);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (size_t i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
tmp = predValue + (type_-exe_params->intvRadius)*interval;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[i] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[i] = SZ_INT8_MIN;
else
(*data)[i] = SZ_INT8_MAX;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_int8_2D(int8_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT8);
long pred1D, pred2D, tmp;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[1] = SZ_INT8_MIN;
else
(*data)[1] = SZ_INT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[jj] = SZ_INT8_MIN;
else
(*data)[jj] = SZ_INT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_int8_3D(int8_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT8);
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[1] = SZ_INT8_MIN;
else
(*data)[1] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[jj] = SZ_INT8_MIN;
else
(*data)[jj] = SZ_INT8_MAX; }
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_int8_4D(int8_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
int8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_INT8);
int type_;
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_INT8_MIN&&tmp<SZ_INT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_INT8_MIN)
(*data)[index] = SZ_INT8_MIN;
else
(*data)[index] = SZ_INT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_int8_1D(int8_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
int8_t value = tdps->exactDataBytes[0];
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int8_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_int8_2D(int8_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
int8_t value = tdps->exactDataBytes[0];
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int8_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_int8_3D(int8_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
int8_t value = tdps->exactDataBytes[0];
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int8_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_int8_4D(int8_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
int8_t value = tdps->exactDataBytes[0];
*data = (int8_t*)malloc(sizeof(int8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_int8_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,922 +0,0 @@
/**
* @file szd_uint16.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2017 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_uint16.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_uint16(uint16_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(uint16_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+2+4+MetaDataByteLength && cmpSize!=4+2+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(uint16_t);
if(tdps->isLossless)
{
*newData = (uint16_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = bytesToUInt16_bigEndian(p);
}
}
else if(confparams_dec->sol_ID==SZ_Transpose)
{
getSnapshotData_uint16_1D(newData,dataLength,tdps, errBoundMode);
}
else //confparams_dec->sol_ID==SZ
{
if (dim == 1)
getSnapshotData_uint16_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_uint16_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_uint16_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_uint16_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(uint16_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_uint16_1D(uint16_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
double interval = tdps->realPrecision*2;
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
long predValue, tmp;
uint16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT16);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (size_t i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
tmp = predValue + (type_-exe_params->intvRadius)*interval;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[i] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[i] = SZ_UINT16_MIN;
else
(*data)[i] = SZ_UINT16_MAX;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_uint16_2D(uint16_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT16);
long pred1D, pred2D, tmp;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[1] = SZ_UINT16_MIN;
else
(*data)[1] = SZ_UINT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[jj] = SZ_UINT16_MIN;
else
(*data)[jj] = SZ_UINT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_uint16_3D(uint16_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT16);
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[1] = SZ_UINT16_MIN;
else
(*data)[1] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[jj] = SZ_UINT16_MIN;
else
(*data)[jj] = SZ_UINT16_MAX; }
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_uint16_4D(uint16_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint16_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT16);
int type_;
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT16_MIN&&tmp<SZ_UINT16_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT16_MIN)
(*data)[index] = SZ_UINT16_MIN;
else
(*data)[index] = SZ_UINT16_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt16_bigEndian(curBytes);
exactData = (uint16_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_uint16_1D(uint16_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
uint16_t value = bytesToUInt16_bigEndian(tdps->exactDataBytes);
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint16_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_uint16_2D(uint16_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
uint16_t value = bytesToUInt16_bigEndian(tdps->exactDataBytes);
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint16_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_uint16_3D(uint16_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
uint16_t value = bytesToUInt16_bigEndian(tdps->exactDataBytes);
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint16_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_uint16_4D(uint16_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
uint16_t value = bytesToUInt16_bigEndian(tdps->exactDataBytes);
*data = (uint16_t*)malloc(sizeof(uint16_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint16_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,789 +0,0 @@
/**
* @file szd_uint32.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_uint32.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_uint32(uint32_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(uint32_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+4+4+MetaDataByteLength && cmpSize!=4+4+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(uint32_t);
if(tdps->isLossless)
{
*newData = (uint32_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = bytesToUInt32_bigEndian(p);
}
}
else if (dim == 1)
getSnapshotData_uint32_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_uint32_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_uint32_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_uint32_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(uint32_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_uint32_1D(uint32_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t i;
double interval = tdps->realPrecision*2;
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
uint32_t minValue, exactData, predValue;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT32);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
(*data)[i] = predValue + (type_-exe_params->intvRadius)*interval;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_uint32_2D(uint32_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint32_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT32);
uint32_t pred1D, pred2D;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_uint32_3D(uint32_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint32_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT32);
uint32_t pred1D, pred2D, pred3D;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_uint32_4D(uint32_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint32_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT32);
int type_;
uint32_t pred1D, pred2D, pred3D;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt32_bigEndian(curBytes);
exactData = (uint32_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_uint32_1D(uint32_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
uint32_t value = bytesToUInt32_bigEndian(tdps->exactDataBytes);
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint32_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_uint32_2D(uint32_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
uint32_t value = bytesToUInt32_bigEndian(tdps->exactDataBytes);
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint32_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_uint32_3D(uint32_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
uint32_t value = bytesToUInt32_bigEndian(tdps->exactDataBytes);
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint32_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_uint32_4D(uint32_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
uint32_t value = bytesToUInt32_bigEndian(tdps->exactDataBytes);
*data = (uint32_t*)malloc(sizeof(uint32_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint32_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,789 +0,0 @@
/**
* @file szd_uint64.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_uint64.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_uint64(uint64_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(uint64_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+8+4+MetaDataByteLength && cmpSize!=4+8+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(uint64_t);
if(tdps->isLossless)
{
*newData = (uint64_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = bytesToUInt64_bigEndian(p);
}
}
else if (dim == 1)
getSnapshotData_uint64_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_uint64_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_uint64_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_uint64_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(uint64_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_uint64_1D(uint64_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t i;
double interval = tdps->realPrecision*2;
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
uint64_t minValue, exactData, predValue;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT64);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
(*data)[i] = predValue + (type_-exe_params->intvRadius)*interval;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_uint64_2D(uint64_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint64_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT64);
uint64_t pred1D, pred2D;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_uint64_3D(uint64_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint64_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT64);
uint64_t pred1D, pred2D, pred3D;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
(*data)[1] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
(*data)[jj] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_uint64_4D(uint64_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint64_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT64);
int type_;
uint64_t pred1D, pred2D, pred3D;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
(*data)[index] = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = bytesToUInt64_bigEndian(curBytes);
exactData = (uint64_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_uint64_1D(uint64_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
uint64_t value = bytesToUInt64_bigEndian(tdps->exactDataBytes);
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint64_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_uint64_2D(uint64_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
uint64_t value = bytesToUInt64_bigEndian(tdps->exactDataBytes);
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint64_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_uint64_3D(uint64_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
uint64_t value = bytesToUInt64_bigEndian(tdps->exactDataBytes);
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint64_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_uint64_4D(uint64_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
uint64_t value = bytesToUInt64_bigEndian(tdps->exactDataBytes);
*data = (uint64_t*)malloc(sizeof(uint64_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint64_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -1,914 +0,0 @@
/**
* @file szd_uint8.c
* @author Sheng Di
* @date Aug, 2017
* @brief
* (C) 2017 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "TightDataPointStorageI.h"
#include "sz.h"
#include "szd_uint8.h"
#include "Huffman.h"
#include "utility.h"
/**
*
*
* @return status SUCCESSFUL (SZ_SCES) or not (other error codes) f
* */
int SZ_decompress_args_uint8(uint8_t** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize)
{
int status = SZ_SCES;
size_t dataLength = computeDataLength(r5,r4,r3,r2,r1);
//unsigned char* tmpBytes;
size_t targetUncompressSize = dataLength <<2; //i.e., *4
//tmpSize must be "much" smaller than dataLength
size_t i, tmpSize = 3+MetaDataByteLength+1+sizeof(uint8_t)+exe_params->SZ_SIZE_TYPE;
unsigned char* szTmpBytes;
if(cmpSize!=4+1+4+MetaDataByteLength && cmpSize!=4+1+8+MetaDataByteLength)
{
confparams_dec->losslessCompressor = is_lossless_compressed_data(cmpBytes, cmpSize);
if(confparams_dec->losslessCompressor!=-1)
confparams_dec->szMode = SZ_BEST_COMPRESSION;
else
confparams_dec->szMode = SZ_BEST_SPEED;
if(confparams_dec->szMode==SZ_BEST_SPEED)
{
tmpSize = cmpSize;
szTmpBytes = cmpBytes;
}
else if(confparams_dec->szMode==SZ_BEST_COMPRESSION || confparams_dec->szMode==SZ_DEFAULT_COMPRESSION)
{
if(targetUncompressSize<MIN_ZLIB_DEC_ALLOMEM_BYTES) //Considering the minimum size
targetUncompressSize = MIN_ZLIB_DEC_ALLOMEM_BYTES;
tmpSize = sz_lossless_decompress(confparams_dec->losslessCompressor, cmpBytes, (unsigned long)cmpSize, &szTmpBytes, (unsigned long)targetUncompressSize+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE);// (unsigned long)targetUncompressSize+8: consider the total length under lossless compression mode is actually 3+4+1+targetUncompressSize
//szTmpBytes = (unsigned char*)malloc(sizeof(unsigned char)*tmpSize);
//memcpy(szTmpBytes, tmpBytes, tmpSize);
//free(tmpBytes); //release useless memory
}
else
{
printf("Wrong value of confparams_dec->szMode in the double compressed bytes.\n");
status = SZ_MERR;
return status;
}
}
else
szTmpBytes = cmpBytes;
//TODO: convert szTmpBytes to data array.
TightDataPointStorageI* tdps;
int errBoundMode = new_TightDataPointStorageI_fromFlatBytes(&tdps, szTmpBytes, tmpSize);
//writeByteData(tdps->typeArray, tdps->typeArray_size, "decompress-typebytes.tbt");
int dim = computeDimension(r5,r4,r3,r2,r1);
int intSize = sizeof(uint8_t);
if(tdps->isLossless)
{
*newData = (uint8_t*)malloc(intSize*dataLength);
if(sysEndianType==BIG_ENDIAN_SYSTEM)
{
memcpy(*newData, szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE, dataLength*intSize);
}
else
{
unsigned char* p = szTmpBytes+4+MetaDataByteLength+exe_params->SZ_SIZE_TYPE;
for(i=0;i<dataLength;i++,p+=intSize)
(*newData)[i] = *p;
}
}
else if (dim == 1)
getSnapshotData_uint8_1D(newData,r1,tdps, errBoundMode);
else
if (dim == 2)
getSnapshotData_uint8_2D(newData,r2,r1,tdps, errBoundMode);
else
if (dim == 3)
getSnapshotData_uint8_3D(newData,r3,r2,r1,tdps, errBoundMode);
else
if (dim == 4)
getSnapshotData_uint8_4D(newData,r4,r3,r2,r1,tdps, errBoundMode);
else
{
printf("Error: currently support only at most 4 dimensions!\n");
status = SZ_DERR;
}
free_TightDataPointStorageI2(tdps);
if(confparams_dec->szMode!=SZ_BEST_SPEED && cmpSize!=4+sizeof(uint8_t)+exe_params->SZ_SIZE_TYPE+MetaDataByteLength)
free(szTmpBytes);
return status;
}
void decompressDataSeries_uint8_1D(uint8_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t i;
double interval = tdps->realPrecision*2;
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
//sdi:Debug
//writeUShortData(type, dataSeriesLength, "decompressStateBytes.sb");
long predValue, tmp;
uint8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT8);
if(rightShiftBits<0)
{
printf("Error: rightShift < 0!\n");
exit(0);
}
int type_;
for (i = 0; i < dataSeriesLength; i++) {
type_ = type[i];
switch (type_) {
case 0:
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[i] = exactData + minValue;
break;
default:
//predValue = 2 * (*data)[i-1] - (*data)[i-2];
predValue = (*data)[i-1];
tmp = predValue + (type_-exe_params->intvRadius)*interval;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[i] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[i] = SZ_UINT8_MIN;
else
(*data)[i] = SZ_UINT8_MAX;
break;
}
//printf("%.30G\n",(*data)[i]);
}
free(type);
return;
}
void decompressDataSeries_uint8_2D(uint8_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
//printf("tdps->intervals=%d, exe_params->intvRadius=%d\n", tdps->intervals, exe_params->intvRadius);
size_t dataSeriesLength = r1*r2;
// printf ("%d %d\n", r1, r2);
double realPrecision = tdps->realPrecision;
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT8);
long pred1D, pred2D, tmp;
size_t ii, jj;
/* Process Row-0, data 0 */
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
int type_ = type[1];
if (type_ != 0)
{
pred1D = (*data)[0];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[1] = SZ_UINT8_MIN;
else
(*data)[1] = SZ_UINT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r2-1 */
for (jj = 2; jj < r2; jj++)
{
type_ = type[jj];
if (type_ != 0)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[jj] = SZ_UINT8_MIN;
else
(*data)[jj] = SZ_UINT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r1-1 */
for (ii = 1; ii < r1; ii++)
{
/* Process row-ii data 0 */
index = ii*r2;
type_ = type[index];
if (type_ != 0)
{
pred1D = (*data)[index-r2];
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r2-1*/
for (jj = 1; jj < r2; jj++)
{
index = ii*r2+jj;
pred2D = (*data)[index-1] + (*data)[index-r2] - (*data)[index-r2-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
free(type);
return;
}
void decompressDataSeries_uint8_3D(uint8_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3;
size_t r23 = r2*r3;
// printf ("%d %d %d\n", r1, r2, r3);
double realPrecision = tdps->realPrecision;
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT8);
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk;
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[0] = exactData + minValue;
/* Process Row-0, data 1 */
pred1D = (*data)[0];
int type_ = type[1];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[1] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[1] = SZ_UINT8_MIN;
else
(*data)[1] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[1] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r3-1 */
for (jj = 2; jj < r3; jj++)
{
pred1D = 2*(*data)[jj-1] - (*data)[jj-2];
type_ = type[jj];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[jj] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[jj] = SZ_UINT8_MIN;
else
(*data)[jj] = SZ_UINT8_MAX; }
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[jj] = exactData + minValue;
}
}
size_t index;
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process row-ii data 0 */
index = ii*r3;
pred1D = (*data)[index-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r3-1*/
for (jj = 1; jj < r3; jj++)
{
index = ii*r3+jj;
pred2D = (*data)[index-1] + (*data)[index-r3] - (*data)[index-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r1-1 ///////////////////////////
for (kk = 1; kk < r1; kk++)
{
/* Process Row-0 data 0*/
index = kk*r23;
pred1D = (*data)[index-r23];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23+jj;
pred2D = (*data)[index-1] + (*data)[index-r23] - (*data)[index-r23-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r2-1 */
for (ii = 1; ii < r2; ii++)
{
/* Process Row-i data 0 */
index = kk*r23 + ii*r3;
pred2D = (*data)[index-r3] + (*data)[index-r23] - (*data)[index-r23-r3];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r3-1 */
for (jj = 1; jj < r3; jj++)
{
index = kk*r23 + ii*r3 + jj;
pred3D = (*data)[index-1] + (*data)[index-r3] + (*data)[index-r23]
- (*data)[index-r3-1] - (*data)[index-r23-r3] - (*data)[index-r23-1] + (*data)[index-r23-r3-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
free(type);
return;
}
void decompressDataSeries_uint8_4D(uint8_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps)
{
updateQuantizationInfo(tdps->intervals);
size_t dataSeriesLength = r1*r2*r3*r4;
size_t r234 = r2*r3*r4;
size_t r34 = r3*r4;
double realPrecision = tdps->realPrecision;
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
int* type = (int*)malloc(dataSeriesLength*sizeof(int));
HuffmanTree* huffmanTree = createHuffmanTree(tdps->stateNum);
decode_withTree(huffmanTree, tdps->typeArray, dataSeriesLength, type);
SZ_ReleaseHuffman(huffmanTree);
uint8_t minValue, exactData;
minValue = tdps->minValue;
int exactByteSize = tdps->exactByteSize;
unsigned char* exactDataBytePointer = tdps->exactDataBytes;
unsigned char curBytes[8] = {0,0,0,0,0,0,0,0};
int rightShiftBits = computeRightShiftBits(exactByteSize, SZ_UINT8);
int type_;
long pred1D, pred2D, pred3D, tmp;
size_t ii, jj, kk, ll;
size_t index;
for (ll = 0; ll < r1; ll++)
{
/////////////////////////// Process layer-0 ///////////////////////////
/* Process Row-0 data 0*/
index = ll*r234;
// recover the exact data
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
/* Process Row-0, data 1 */
index = ll*r234+1;
pred1D = (*data)[index-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0, data 2 --> data r4-1 */
for (jj = 2; jj < r4; jj++)
{
index = ll*r234+jj;
pred1D = 2*(*data)[index-1] - (*data)[index-2];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process row-ii data 0 */
index = ll*r234+ii*r4;
pred1D = (*data)[index-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process row-ii data 1 --> r4-1*/
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+ii*r4+jj;
pred2D = (*data)[index-1] + (*data)[index-r4] - (*data)[index-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
/////////////////////////// Process layer-1 --> layer-r2-1 ///////////////////////////
for (kk = 1; kk < r2; kk++)
{
/* Process Row-0 data 0*/
index = ll*r234+kk*r34;
pred1D = (*data)[index-r34];
type_ = type[index];
if (type_ != 0)
{
tmp = pred1D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-0 data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+jj;
pred2D = (*data)[index-1] + (*data)[index-r34] - (*data)[index-r34-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
/* Process Row-1 --> Row-r3-1 */
for (ii = 1; ii < r3; ii++)
{
/* Process Row-i data 0 */
index = ll*r234+kk*r34+ii*r4;
pred2D = (*data)[index-r4] + (*data)[index-r34] - (*data)[index-r34-r4];
type_ = type[index];
if (type_ != 0)
{
tmp = pred2D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
/* Process Row-i data 1 --> data r4-1 */
for (jj = 1; jj < r4; jj++)
{
index = ll*r234+kk*r34+ii*r4+jj;
pred3D = (*data)[index-1] + (*data)[index-r4] + (*data)[index-r34]
- (*data)[index-r4-1] - (*data)[index-r34-r4] - (*data)[index-r34-1] + (*data)[index-r34-r4-1];
type_ = type[index];
if (type_ != 0)
{
tmp = pred3D + 2 * (type_ - exe_params->intvRadius) * realPrecision;
if(tmp >= SZ_UINT8_MIN&&tmp<SZ_UINT8_MAX)
(*data)[index] = tmp;
else if(tmp < SZ_UINT8_MIN)
(*data)[index] = SZ_UINT8_MIN;
else
(*data)[index] = SZ_UINT8_MAX;
}
else
{
memcpy(curBytes, exactDataBytePointer, exactByteSize);
exactData = curBytes[0];
exactData = (uint8_t)exactData >> rightShiftBits;
exactDataBytePointer += exactByteSize;
(*data)[index] = exactData + minValue;
}
}
}
}
}
free(type);
return;
}
void getSnapshotData_uint8_1D(uint8_t** data, size_t dataSeriesLength, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
if (tdps->allSameData) {
uint8_t value = tdps->exactDataBytes[0];
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint8_1D(data, dataSeriesLength, tdps);
}
}
void getSnapshotData_uint8_2D(uint8_t** data, size_t r1, size_t r2, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2;
if (tdps->allSameData) {
uint8_t value = tdps->exactDataBytes[0];
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint8_2D(data, r1, r2, tdps);
}
}
void getSnapshotData_uint8_3D(uint8_t** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3;
if (tdps->allSameData) {
uint8_t value = tdps->exactDataBytes[0];
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint8_3D(data, r1, r2, r3, tdps);
}
}
void getSnapshotData_uint8_4D(uint8_t** data, size_t r1, size_t r2, size_t r3, size_t r4, TightDataPointStorageI* tdps, int errBoundMode)
{
size_t i;
size_t dataSeriesLength = r1*r2*r3*r4;
if (tdps->allSameData) {
uint8_t value = tdps->exactDataBytes[0];
*data = (uint8_t*)malloc(sizeof(uint8_t)*dataSeriesLength);
for (i = 0; i < dataSeriesLength; i++)
(*data)[i] = value;
} else {
decompressDataSeries_uint8_4D(data, r1, r2, r3, r4, tdps);
}
}

View File

@ -33,6 +33,8 @@ struct timeval startTime;
struct timeval endTime; /* Start and end times */
struct timeval costStart; /*only used for recording the cost*/
double totalCost = 0;
int notsame_cnt = 0;
void cost_start()
{
@ -184,7 +186,9 @@ bool testFile(const char* inFile, char algorithm){
}
int memTest();
int memTestDouble();
void test_threadsafe(int thread_count);
void test_threadsafe_double(int thread_count);
//
// main
@ -207,11 +211,15 @@ int main(int argc, char *argv[]) {
algo = TWO_STAGE_COMP;
}
if(strcmp(argv[1], "-safe") == 0) {
if(strcmp(argv[1], "-sf") == 0) {
test_threadsafe(atoi(argv[2]));
return 0;
}
if(strcmp(argv[1], "-sd") == 0) {
test_threadsafe_double(atoi(argv[2]));
return 0;
}
if(algo == 0){
printf(" no param -tone -ttwo \n");
return 0;
@ -297,7 +305,98 @@ bool txt_to_bin(const char* inFile, const char* outFile){
return true;
}
int notsame_cnt = 0;
int memTestDouble() {
//
// compress
//
//float ft1[] = {1.2, 2.4, 3.33, 4.444, 5.555, 6.6666, 7.7777, 8.88888,1.2, 2.4, 3.33, 4.444, 5.555, 6.6666, 7.7777, 8.88888,1.2, 2.4, 3.33, 4.444, 5.555, 6.6666, 7.7777, 8.88888};
///*
double ft1[ ] = {\
3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8980000019073486, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8980000019073486, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8980000019073486, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8980000019073486, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8949999809265137, 3.8959999084472656, 3.8980000019073486, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8989999294281006, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.9010000228881836, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8980000019073486, 3.8970000743865967, 3.8989999294281006, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617\
,3.8949999809265137, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.9000000953674316, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307\
,3.8949999809265137, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.9000000953674316, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307\
,3.8949999809265137, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.9000000953674316, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307\
,3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8989999294281006, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8919999599456787, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787\
,3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.630000114440918, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422\
,3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8989999294281006, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8919999599456787, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787\
,3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8989999294281006, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8919999599456787, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787\
,3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7090001106262207, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7079999446868896, 3.7079999446868896, 3.7070000171661377, 3.7079999446868896, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7060000896453857, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7100000381469727, 3.7109999656677246, 3.7119998931884766, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7090001106262207, 3.7100000381469727, 3.7119998931884766, 3.7090001106262207, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7100000381469727, 3.7079999446868896, 3.7060000896453857, 3.7049999237060547, 3.7070000171661377, 3.7070000171661377, 3.7100000381469727, 3.7119998931884766, 3.7119998931884766, 3.7090001106262207, 3.7079999446868896, 3.7070000171661377, 3.7139999866485596, 3.7109999656677246, 3.7109999656677246, 3.7100000381469727, 3.7070000171661377, 3.7060000896453857, 3.7119998931884766, 3.7109999656677246, 3.7090001106262207, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7130000591278076, 3.7100000381469727, 3.7079999446868896, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7090001106262207, 3.7119998931884766, 3.7130000591278076, 3.7109999656677246, 3.7079999446868896, 3.7090001106262207, 3.7090001106262207, 3.7119998931884766, 3.7109999656677246, 3.7109999656677246, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7070000171661377, 3.7090001106262207, 3.7109999656677246, 3.7119998931884766, 3.7109999656677246, 3.7090001106262207, 3.7079999446868896, 3.7079999446868896, 3.7100000381469727, 3.7109999656677246, 3.7119998931884766, 3.7079999446868896, 3.7079999446868896, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7090001106262207, 3.7100000381469727, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7079999446868896, 3.7100000381469727, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7090001106262207, 3.7100000381469727, 3.7090001106262207, 3.7060000896453857, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7090001106262207, 3.7070000171661377, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7090001106262207, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7079999446868896, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7079999446868896, 3.7060000896453857, 3.7060000896453857, 3.7109999656677246, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7049999237060547, 3.7070000171661377, 3.7100000381469727, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7079999446868896, 3.7079999446868896, 3.7149999141693115, 3.7079999446868896, 3.7070000171661377, 3.7049999237060547, 3.7060000896453857, 3.7060000896453857\
,3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.634000062942505, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422
,3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8980000019073486, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8980000019073486, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8980000019073486, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8980000019073486, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8980000019073486, 3.8949999809265137, 3.8959999084472656, 3.8980000019073486, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8989999294281006, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.9010000228881836, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8980000019073486, 3.8970000743865967, 3.8989999294281006, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617\
,3.8949999809265137, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.9000000953674316, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307\
,3.8949999809265137, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.9000000953674316, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307\
,3.8949999809265137, 3.8970000743865967, 3.8980000019073486, 3.8980000019073486, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8970000743865967, 3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8959999084472656, 3.8970000743865967, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.9000000953674316, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8959999084472656, 3.8980000019073486, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307\
,3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8989999294281006, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8919999599456787, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787\
,3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.630000114440918, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422\
,3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8989999294281006, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8919999599456787, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787\
,3.8940000534057617, 3.8959999084472656, 3.8970000743865967, 3.8970000743865967, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8929998874664307, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8959999084472656, 3.8929998874664307, 3.8949999809265137, 3.8929998874664307, 3.8959999084472656, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8940000534057617, 3.8970000743865967, 3.8940000534057617, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8949999809265137, 3.8940000534057617, 3.8940000534057617, 3.8959999084472656, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8959999084472656, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787, 3.8929998874664307, 3.8940000534057617, 3.8929998874664307, 3.8940000534057617, 3.8949999809265137, 3.8929998874664307, 3.8929998874664307, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8929998874664307, 3.8940000534057617, 3.8989999294281006, 3.8929998874664307, 3.8929998874664307, 3.8929998874664307, 3.8919999599456787, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8949999809265137, 3.8970000743865967, 3.8940000534057617, 3.8940000534057617, 3.8940000534057617, 3.8929998874664307, 3.8919999599456787\
,3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7090001106262207, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7079999446868896, 3.7079999446868896, 3.7070000171661377, 3.7079999446868896, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7060000896453857, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7100000381469727, 3.7109999656677246, 3.7119998931884766, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7090001106262207, 3.7100000381469727, 3.7119998931884766, 3.7090001106262207, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7100000381469727, 3.7079999446868896, 3.7060000896453857, 3.7049999237060547, 3.7070000171661377, 3.7070000171661377, 3.7100000381469727, 3.7119998931884766, 3.7119998931884766, 3.7090001106262207, 3.7079999446868896, 3.7070000171661377, 3.7139999866485596, 3.7109999656677246, 3.7109999656677246, 3.7100000381469727, 3.7070000171661377, 3.7060000896453857, 3.7119998931884766, 3.7109999656677246, 3.7090001106262207, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7130000591278076, 3.7100000381469727, 3.7079999446868896, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7090001106262207, 3.7119998931884766, 3.7130000591278076, 3.7109999656677246, 3.7079999446868896, 3.7090001106262207, 3.7090001106262207, 3.7119998931884766, 3.7109999656677246, 3.7109999656677246, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7070000171661377, 3.7090001106262207, 3.7109999656677246, 3.7119998931884766, 3.7109999656677246, 3.7090001106262207, 3.7079999446868896, 3.7079999446868896, 3.7100000381469727, 3.7109999656677246, 3.7119998931884766, 3.7079999446868896, 3.7079999446868896, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7090001106262207, 3.7100000381469727, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7079999446868896, 3.7100000381469727, 3.7070000171661377, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7090001106262207, 3.7100000381469727, 3.7090001106262207, 3.7060000896453857, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7079999446868896, 3.7090001106262207, 3.7070000171661377, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7070000171661377, 3.7090001106262207, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7070000171661377, 3.7079999446868896, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7070000171661377, 3.7060000896453857, 3.7070000171661377, 3.7060000896453857, 3.7079999446868896, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7060000896453857, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7079999446868896, 3.7060000896453857, 3.7060000896453857, 3.7109999656677246, 3.7070000171661377, 3.7060000896453857, 3.7060000896453857, 3.7049999237060547, 3.7070000171661377, 3.7100000381469727, 3.7079999446868896, 3.7070000171661377, 3.7070000171661377, 3.7079999446868896, 3.7079999446868896, 3.7149999141693115, 3.7079999446868896, 3.7070000171661377, 3.7049999237060547, 3.7060000896453857, 3.7060000896453857\
,3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.634000062942505, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.63100004196167, 3.63100004196167, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.63100004196167, 3.63100004196167, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.63100004196167, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.631999969482422, 3.632999897003174, 3.631999969482422, 3.632999897003174, 3.631999969482422
};
//*/
const char* input = (const char*) ft1;
int input_len = sizeof(ft1);
int cnt = input_len/sizeof(double);
printf(" input input_len=%d count=%d \n", input_len, cnt);
char* output = (char*) malloc(input_len);
int output_len = input_len;
char buff[1024] ={0};
int buff_len = sizeof(buff);
cost_start();
int ret_len = tsCompressDoubleLossy(input, input_len, cnt, output, output_len, ONE_STAGE_COMP, buff, buff_len);
if(ret_len == -1) {
printf(" compress error.\n");
return 0;
}
cost_end(" tscompress");
printf(" compress return len=%d input len=%d\n", ret_len, input_len);
printf(" compress rate=%.1f an-rate=%.0f%%\n", (float)input_len/(float)ret_len, 100*(float)ret_len/(float)input_len);
//
// decompress
//
double* ft2 = (double*)malloc(input_len);
cost_start();
int code = tsDecompressDoubleLossy(output, ret_len, cnt, (char*)ft2, input_len, ONE_STAGE_COMP, buff, buff_len);
cost_end("tsde-compress double");
printf(" de-compress return code=%d \n", code);
//
// show
//
int same_cnt = 0;
int diffshow_cnt = 0;
for(int i=0; i< cnt; i++){
if(i < 10)
printf(" i=%d ft1=%.20f ft2=%.20f same=%d\n", i, ft1[i], ft2[i], ft1[i] == ft2[i]);
if(ft1[i] == ft2[i])
same_cnt ++;
else {
notsame_cnt++;
if(i >= 10 && ++diffshow_cnt < 50){
printf(" i=%d ft1=%.20f ft2=%.20f diff\n", i, ft1[i], ft2[i]);
}
}
}
printf(" ---- result doulbe : same =%d cnt=%d rate:%d%% global not same=%d---- \n", same_cnt, cnt, same_cnt*100/cnt, notsame_cnt);
free(output);
free(ft2);
return 1;
}
int memTest() {
//
@ -414,4 +513,33 @@ void test_threadsafe(int thread_count){
printf(" test thread safe end. not same count=%d\n", notsame_cnt);
}
void* memTestThreadDouble(void* lparam) {
//memTest();
printf(" enter thread ....\n");
memTestDouble();
return NULL;
}
void test_threadsafe_double(int thread_count){
printf(" test thread safe . thread count=%d \n", thread_count);
pthread_t handle[1000000];
int i=0;
for(i=0; i< thread_count; i++){
printf(" create thread %d... \n", i);
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create(&handle[i], &attr, memTestThreadDouble, NULL);
pthread_attr_destroy(&attr);
}
for(i=0; i< thread_count; i++)
{
pthread_join(handle[i], NULL);
}
printf("\n ---- double test thread safe end. not same count=%d-----\n", notsame_cnt);
}