Changeset 9ee2ce3 for thirdparty/SZ/sz/src/TightDataPointStorageD.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/TightDataPointStorageD.c
r2c47b73 r9ee2ce3 47 47 (*this)->pwrErrBoundBytes = NULL; 48 48 (*this)->pwrErrBoundBytes_size = 0; 49 50 (*this)->raBytes = NULL; 51 (*this)->raBytes_size = 0; 52 49 53 } 50 54 … … 84 88 int mode = confparams_dec->szMode; 85 89 int predictionMode = confparams_dec->predictionMode; 90 int losslessCompressor = confparams_dec->losslessCompressor; 86 91 if(confparams_dec!=NULL) 87 92 free(confparams_dec); 88 93 confparams_dec = params; 89 94 confparams_dec->szMode = mode; 95 confparams_dec->losslessCompressor = losslessCompressor; 96 90 97 if(mode==SZ_TEMPORAL_COMPRESSION) 91 98 { … … 94 101 } 95 102 index += MetaDataByteLength; 103 104 int isRandomAccess = (sameRByte >> 7) & 0x01; 96 105 97 106 unsigned char dsLengthBytes[8]; … … 122 131 (*this)->allSameData = 0; 123 132 133 if(isRandomAccess == 1) 134 { 135 (*this)->raBytes_size = flatBytesLength - 3 - 1 - MetaDataByteLength - exe_params->SZ_SIZE_TYPE; 136 (*this)->raBytes = &(flatBytes[index]); 137 return errorBoundMode; 138 } 139 124 140 int rtype_ = sameRByte & 0x08; //1000 125 141 … … 205 221 (*this)->leadNumArray_size = (logicLeadNumBitsNum >> 3) + 1; 206 222 } 223 224 int minLogValueSize = 0; 225 if(errorBoundMode>=PW_REL) 226 minLogValueSize = 8; 207 227 208 228 if ((*this)->rtypeArray != NULL) … … 210 230 (*this)->residualMidBits_size = flatBytesLength - 3 - 1 - MetaDataByteLength - exe_params->SZ_SIZE_TYPE - 4 - radExpoL - segmentL - pwrErrBoundBytesL - 4 - 8 - 1 - 8 211 231 - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - 8 - (*this)->rtypeArray_size 212 - (*this)->typeArray_size - (*this)->leadNumArray_size232 - minLogValueSize - (*this)->typeArray_size - (*this)->leadNumArray_size 213 233 - (*this)->exactMidBytes_size - pwrErrBoundBytes_size; 214 234 for (i = 0; i < (*this)->rtypeArray_size; i++) … … 218 238 { 219 239 (*this)->residualMidBits_size = flatBytesLength - 3 - 1 - MetaDataByteLength - exe_params->SZ_SIZE_TYPE - 4 - radExpoL - segmentL - pwrErrBoundBytesL - 4 - 8 - 1 - 8 220 - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - (*this)->typeArray_size240 - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - exe_params->SZ_SIZE_TYPE - minLogValueSize - (*this)->typeArray_size 221 241 - (*this)->leadNumArray_size - (*this)->exactMidBytes_size - pwrErrBoundBytes_size; 222 242 } 243 244 if(errorBoundMode >= PW_REL){ 245 (*this)->minLogValue = bytesToDouble(&flatBytes[index]); 246 index+=8; 247 } 223 248 224 249 (*this)->typeArray = &flatBytes[index]; … … 423 448 bytes[k++] = exactMidBytesLength[i]; 424 449 450 if(confparams_cpr->errorBoundMode>=PW_REL) 451 { 452 doubleToBytes(exactMidBytesLength, tdps->minLogValue); 453 for(i = 0;i < 8; i++) 454 bytes[k++] = exactMidBytesLength[i]; 455 } 456 425 457 memcpy(&(bytes[k]), tdps->typeArray, tdps->typeArray_size); 426 458 k += tdps->typeArray_size; … … 522 554 memcpy(&(bytes[k]), tdps->rtypeArray, tdps->rtypeArray_size); 523 555 k += tdps->rtypeArray_size; 556 557 if(confparams_cpr->errorBoundMode>=PW_REL) 558 { 559 doubleToBytes(exactMidBytesLength, tdps->minLogValue); 560 for(i = 0;i < 8; i++) 561 bytes[k++] = exactMidBytesLength[i]; 562 } 563 524 564 memcpy(&(bytes[k]), tdps->typeArray, tdps->typeArray_size); 525 565 k += tdps->typeArray_size; … … 584 624 size_t residualMidBitsLength = tdps->residualMidBits == NULL ? 0 : tdps->residualMidBits_size; 585 625 size_t segmentL = 0, radExpoL = 0, pwrBoundArrayL = 0; 626 627 int minLogValueSize = 0; 586 628 if(confparams_cpr->errorBoundMode>=PW_REL) 587 629 { … … 589 631 radExpoL = 1; 590 632 pwrBoundArrayL = 4; 633 minLogValueSize = 8; 591 634 } 592 635 593 636 size_t totalByteLength = 3 + 1 + MetaDataByteLength + exe_params->SZ_SIZE_TYPE + 4 + radExpoL + segmentL + pwrBoundArrayL + 4 + 8 + 1 + 8 594 637 + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE 638 + minLogValueSize /*max absolute log value*/ 595 639 + tdps->typeArray_size + tdps->leadNumArray_size 596 640 + tdps->exactMidBytes_size + residualMidBitsLength + tdps->pwrErrBoundBytes_size; … … 606 650 size_t residualMidBitsLength = tdps->residualMidBits == NULL ? 0 : tdps->residualMidBits_size; 607 651 size_t segmentL = 0, radExpoL = 0, pwrBoundArrayL = 0; 652 int minLogValueSize = 0; 608 653 if(confparams_cpr->errorBoundMode>=PW_REL) 609 654 { … … 611 656 radExpoL = 1; 612 657 pwrBoundArrayL = 4; 658 minLogValueSize = 8; 613 659 } 614 660 615 661 size_t totalByteLength = 3 + 1 + MetaDataByteLength + exe_params->SZ_SIZE_TYPE + 4 + radExpoL + segmentL + pwrBoundArrayL + 4 + 8 + 1 + 8 616 662 + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + exe_params->SZ_SIZE_TYPE + 8 + tdps->rtypeArray_size 617 + tdps->typeArray_size + tdps->leadNumArray_size663 + minLogValueSize + tdps->typeArray_size + tdps->leadNumArray_size 618 664 + tdps->exactMidBytes_size + residualMidBitsLength + tdps->pwrErrBoundBytes_size; 619 665
Note: See TracChangeset
for help on using the changeset viewer.