Changeset 9ee2ce3 for thirdparty/SZ/sz/src/szd_float_pwr.c
- Timestamp:
- 09/28/18 16:32:55 (6 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
thirdparty/SZ/sz/src/szd_float_pwr.c
r2c47b73 r9ee2ce3 17 17 #include "Huffman.h" 18 18 #include "sz_float_pwr.h" 19 #include "utility.h" 19 20 //#include "rw.h" 20 21 // … … 1350 1351 free(groupID); 1351 1352 } 1353 1354 void 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 1377 void 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 1401 void 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 } 1352 1423 #pragma GCC diagnostic pop
Note: See TracChangeset
for help on using the changeset viewer.