boolean hasBigNum = checkBigNumbers(inBlock, blockSize, POSSIBLE_B[POSSIBLE_B.length-1]); if(hasBigNum) int optSize = estimateCompressedSize(inBlock, blockSize, tmpB); for (int i = 1; i < POSSIBLE_B.length; ++i) int curSize = estimateCompressedSize(inBlock, blockSize, tmpB); if(curSize < optSize) int compressedSizeInInts = compressOneBlockCore(inBlock, blockSize, currentB);
compressedBits = decompressBBitSlots(decompBlock, inBlock, blockSize, bits); compressedBits = decompressBlockByS16(expPosBuffer, inBlock, offset, expNum); offset += compressedBits; compressedBits = decompressBlockByS16(expHighBitsBuffer, inBlock, offset, expNum); offset += compressedBits;
/** * Decompress b-bit slots * @param outDecompSlots decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param bits the value of the parameter b * @return the compressed size in bits of the data that has been decompressed */ public int decompressBBitSlots(int[] outDecompSlots, int[] inCompBlock, int blockSize, int bits) { int compressedBitSize = 0; int offset = HEADER_SIZE; for(int i =0; i<blockSize; i++) { outDecompSlots[i] = readBits(inCompBlock, offset, bits); offset += bits; } compressedBitSize = bits * blockSize; return compressedBitSize; }
if (value < expUpperBound) writeBits(tmpCompBuffer, value, outputOffset, bits); writeBits(tmpCompBuffer, value & MASK[bits], outputOffset, bits); compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expPosBuffer, expNum, blockSize, inputBlock); outputOffset += compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expHighBitsBuffer, expNum, blockSize, inputBlock); outputOffset += compressedBitSize;
if (value < expUpperBound) writeBits(tmpCompBuffer, value, outputOffset, bits); writeBits(tmpCompBuffer, value & MASK[bits], outputOffset, bits); int compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expPosBuffer, expNum); outputOffset += compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expHighBitsBuffer, expNum); outputOffset += compressedBitSize;
boolean hasBigNum = checkBigNumbers(inBlock, blockSize, POSSIBLE_B[POSSIBLE_B.length - 1]); if (hasBigNum) { currentB = 4; } else { int optSize = estimateCompressedSize(inBlock, blockSize, tmpB); for (int i = 1; i < POSSIBLE_B.length; ++i) { tmpB = POSSIBLE_B[i]; int curSize = estimateCompressedSize(inBlock, blockSize, tmpB); if (curSize < optSize) { int compressedSizeInInts = compressOneBlockCore(inBlock, blockSize, currentB);
compressedBits = decompressBBitSlots(decompBlock, inBlock, blockSize, bits); compressedBits = decompressBlockByS16(expPosBuffer, inBlock, offset, expNum); offset += compressedBits; compressedBits = decompressBlockByS16( expHighBitsBuffer, inBlock, offset, expNum); offset += compressedBits;
int value = inputBlock[i]; if (value < expUpperBound) { writeBits(tmpCompBuffer, value, outputOffset, bits); } else // exp writeBits(tmpCompBuffer, value & MASK[bits], outputOffset, bits); int compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expPosBuffer, expNum, blockSize, inputBlock); outputOffset += compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expHighBitsBuffer, expNum, blockSize, inputBlock);
/** * Decompress b-bit slots * @param outDecompSlots decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param bits the value of the parameter b * @return the compressed size in bits of the data that has been decompressed */ public int decompressBBitSlots(int[] outDecompSlots, int[] inCompBlock, int blockSize, int bits) { int compressedBitSize = 0; int offset = HEADER_SIZE; for(int i =0; i<blockSize; i++) { outDecompSlots[i] = readBits(inCompBlock, offset, bits); offset += bits; } compressedBitSize = bits * blockSize; return compressedBitSize; }
boolean hasBigNum = checkBigNumbers(inBlock, blockSize, POSSIBLE_B[POSSIBLE_B.length-1]); if(hasBigNum) int optSize = estimateCompressedSize(inBlock, blockSize, tmpB); for (int i = 1; i < POSSIBLE_B.length; ++i) int curSize = estimateCompressedSize(inBlock, blockSize, tmpB); if(curSize < optSize) int compressedSizeInInts = compressOneBlockCore(inBlock, blockSize, currentB);
compressedBits = decompressBBitSlots(decompBlock, inBlock, blockSize, bits); compressedBits = decompressBlockByS16(expPosBuffer, inBlock, offset, expNum); offset += compressedBits; compressedBits = decompressBlockByS16(expHighBitsBuffer, inBlock, offset, expNum); offset += compressedBits;
if (value < expUpperBound) writeBits(tmpCompBuffer, value, outputOffset, bits); writeBits(tmpCompBuffer, value & MASK[bits], outputOffset, bits); compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expPosBuffer, expNum, blockSize, inputBlock); outputOffset += compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expHighBitsBuffer, expNum, blockSize, inputBlock); outputOffset += compressedBitSize;
/** * Decompress b-bit slots * * @param outDecompSlots * decompressed block which is the output * @param inCompBlock * the compressed block which is the input * @param blockSize * the block size * @param bits * the value of the parameter b * @return the compressed size in bits of the data that has been * decompressed */ public static int decompressBBitSlots(int[] outDecompSlots, int[] inCompBlock, int blockSize, int bits) { int compressedBitSize = 0; int offset = HEADER_SIZE; for (int i = 0; i < blockSize; i++) { outDecompSlots[i] = readBits(inCompBlock, offset, bits); offset += bits; } compressedBitSize = bits * blockSize; return compressedBitSize; }
boolean hasBigNum = checkBigNumbers(inBlock, blockSize, POSSIBLE_B[POSSIBLE_B.length-1]); if(hasBigNum) int optSize = estimateCompressedSize(inBlock, blockSize, tmpB); for (int i = 1; i < POSSIBLE_B.length; ++i) int curSize = estimateCompressedSize(inBlock, blockSize, tmpB); if(curSize < optSize) int compressedSizeInInts = compressOneBlockCore(inBlock, blockSize, currentB);
Arrays.fill(decompBlock, 0); } else { compressedBits = decompressBBitSlots(decompBlock, inBlock, blockSize, bits); compressedBits = decompressBlockByS16(expPosBuffer, inBlock, offset, expNum); offset += compressedBits; compressedBits = decompressBlockByS16( expHighBitsBuffer, inBlock, offset, expNum); offset += compressedBits;
int value = inputBlock[i]; if (value < expUpperBound) { writeBits(tmpCompBuffer, value, outputOffset, bits); } else // exp writeBits(tmpCompBuffer, value & MASK[bits], outputOffset, bits); int compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expPosBuffer, expNum, blockSize, inputBlock); outputOffset += compressedBitSize; compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expHighBitsBuffer, expNum, blockSize, inputBlock);
/** * Decompress b-bit slots * @param outDecompSlots decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param bits the value of the parameter b * @return the compressed size in bits of the data that has been decompressed */ public int decompressBBitSlots(int[] outDecompSlots, int[] inCompBlock, int blockSize, int bits) { int compressedBitSize = 0; int offset = HEADER_SIZE; for(int i =0; i<blockSize; i++) { outDecompSlots[i] = readBits(inCompBlock, offset, bits); offset += bits; } compressedBitSize = bits * blockSize; return compressedBitSize; }
boolean hasBigNum = checkBigNumbers(inBlock, blockSize, POSSIBLE_B[POSSIBLE_B.length - 1]); if (hasBigNum) { currentB = 4; } else { int optSize = estimateCompressedSize(inBlock, blockSize, tmpB); for (int i = 1; i < POSSIBLE_B.length; ++i) { tmpB = POSSIBLE_B[i]; int curSize = estimateCompressedSize(inBlock, blockSize, tmpB); if (curSize < optSize) { int compressedSizeInInts = compressOneBlockCore(inBlock, blockSize, currentB);
compressedBits = decompressBBitSlots(decompBlock, inBlock, blockSize, bits); compressedBits = decompressBlockByS16(expPosBuffer, inBlock, offset, expNum); offset += compressedBits; compressedBits = decompressBlockByS16(expHighBitsBuffer, inBlock, offset, expNum); offset += compressedBits;
int value = inputBlock[i]; if (value < expUpperBound) { writeBits(tmpCompBuffer, value, outputOffset, bits); } else // exp writeBits(tmpCompBuffer, value & MASK[bits], outputOffset, bits); expNum, expNum); compressedBitSize = compressBlockByS16(tmpCompBuffer, outputOffset, expBuffer, expNum * 2, blockSize, inputBlock);