Ignore:
Timestamp:
09/28/18 16:32:55 (6 years ago)
Author:
Hal Finkel <hfinkel@…>
Branches:
master, pympi
Children:
e6aa0eb
Parents:
abca157
git-author:
Hal Finkel <hfinkel@…> (09/28/18 16:32:55)
git-committer:
Hal Finkel <hfinkel@…> (09/28/18 16:32:55)
Message:

importing new SZ files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • thirdparty/SZ/sz/src/szd_float_pwr.c

    r2c47b73 r9ee2ce3  
    1717#include "Huffman.h" 
    1818#include "sz_float_pwr.h" 
     19#include "utility.h" 
    1920//#include "rw.h" 
    2021// 
     
    13501351        free(groupID); 
    13511352} 
     1353 
     1354void decompressDataSeries_float_1D_pwr_pre_log(float** data, size_t dataSeriesLength, TightDataPointStorageF* tdps) { 
     1355 
     1356        decompressDataSeries_float_1D(data, dataSeriesLength, tdps); 
     1357        float threshold = tdps->minLogValue; 
     1358        if(tdps->pwrErrBoundBytes_size > 0){ 
     1359                unsigned char * signs; 
     1360                sz_lossless_decompress(confparams_dec->losslessCompressor, tdps->pwrErrBoundBytes, tdps->pwrErrBoundBytes_size, &signs, dataSeriesLength); 
     1361                for(size_t i=0; i<dataSeriesLength; i++){ 
     1362                        if((*data)[i] < threshold) (*data)[i] = 0; 
     1363                        else (*data)[i] = exp2((*data)[i]); 
     1364                        if(signs[i]) (*data)[i] = -((*data)[i]); 
     1365                } 
     1366                free(signs); 
     1367        } 
     1368        else{ 
     1369                for(size_t i=0; i<dataSeriesLength; i++){ 
     1370                        if((*data)[i] < threshold) (*data)[i] = 0; 
     1371                        else (*data)[i] = exp2((*data)[i]); 
     1372                } 
     1373        } 
     1374 
     1375} 
     1376 
     1377void decompressDataSeries_float_2D_pwr_pre_log(float** data, size_t r1, size_t r2, TightDataPointStorageF* tdps) { 
     1378 
     1379        size_t dataSeriesLength = r1 * r2; 
     1380        decompressDataSeries_float_2D(data, r1, r2, tdps); 
     1381        float threshold = tdps->minLogValue; 
     1382        if(tdps->pwrErrBoundBytes_size > 0){ 
     1383                unsigned char * signs; 
     1384                sz_lossless_decompress(confparams_dec->losslessCompressor, tdps->pwrErrBoundBytes, tdps->pwrErrBoundBytes_size, &signs, dataSeriesLength); 
     1385                for(size_t i=0; i<dataSeriesLength; i++){ 
     1386                        if((*data)[i] < threshold) (*data)[i] = 0; 
     1387                        else (*data)[i] = exp2((*data)[i]); 
     1388                        if(signs[i]) (*data)[i] = -((*data)[i]); 
     1389                } 
     1390                free(signs); 
     1391        } 
     1392        else{ 
     1393                for(size_t i=0; i<dataSeriesLength; i++){ 
     1394                        if((*data)[i] < threshold) (*data)[i] = 0; 
     1395                        else (*data)[i] = exp2((*data)[i]); 
     1396                } 
     1397        } 
     1398 
     1399} 
     1400 
     1401void decompressDataSeries_float_3D_pwr_pre_log(float** data, size_t r1, size_t r2, size_t r3, TightDataPointStorageF* tdps) { 
     1402 
     1403        size_t dataSeriesLength = r1 * r2 * r3; 
     1404        decompressDataSeries_float_3D(data, r1, r2, r3, tdps); 
     1405        float threshold = tdps->minLogValue; 
     1406        if(tdps->pwrErrBoundBytes_size > 0){ 
     1407                unsigned char * signs; 
     1408                sz_lossless_decompress(confparams_dec->losslessCompressor, tdps->pwrErrBoundBytes, tdps->pwrErrBoundBytes_size, &signs, dataSeriesLength); 
     1409                for(size_t i=0; i<dataSeriesLength; i++){ 
     1410                        if((*data)[i] < threshold) (*data)[i] = 0; 
     1411                        else (*data)[i] = exp2((*data)[i]); 
     1412                        if(signs[i]) (*data)[i] = -((*data)[i]); 
     1413                } 
     1414                free(signs); 
     1415        } 
     1416        else{ 
     1417                for(size_t i=0; i<dataSeriesLength; i++){ 
     1418                        if((*data)[i] < threshold) (*data)[i] = 0; 
     1419                        else (*data)[i] = exp2((*data)[i]); 
     1420                } 
     1421        } 
     1422} 
    13521423#pragma GCC diagnostic pop 
Note: See TracChangeset for help on using the changeset viewer.