/** * Compress a block of blockSize integers using Simple16 algorithm * @param outCompBlock the compressed block which is the output * @param outStartOffsetInBits the start offset in bits of the compressed block * @param inBlock the block to be compressed * @param blockSize the block size * @return the compressed size in bits */ private int compressBlockByS16(int[] outCompBlock, int outStartOffsetInBits, int[] inBlock, int blockSize) { int outOffset = (outStartOffsetInBits+31)>>>5; int num, inOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Compress(outCompBlock, outOffset, inBlock, inOffset, numLeft, blockSize); outOffset++; inOffset += num; } int compressedBitSize = (outOffset<<5)-outStartOffsetInBits; return compressedBitSize; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * @param outDecompBlock the decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param inStartOffsetInBits the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been decompressed */ public int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits+31)>>>5; int num, outOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset<<5)-inStartOffsetInBits; return compressedBitSize; }
/** * Decompress an integer array using Simple16 * * @param out the decompressed output * @param outOffset the offset of the output in the number of integers * @param in the compressed input array * @param inOffset the offset of the input in the number of integers * @param n the number of elements to be compressed * @return the number of processed integers */ public static final int s16Decompress(int[] out, int outOffset, int[] in, int inOffset, int n) { int numIdx, j=0, bits=0; numIdx = in[inOffset]>>>S16_BITSSIZE; int num = S16_NUM[numIdx] < n ? S16_NUM[numIdx] : n; for(j=0, bits=0; j<num; j++) { out[outOffset+j] = readBitsForS16(in, inOffset, bits, S16_BITS[numIdx][j]); bits += S16_BITS[numIdx][j]; } return num; }
/** * Decompress an integer array using Simple16 * * @param out the decompressed output * @param outOffset the offset of the output in the number of integers * @param in the compressed input array * @param inOffset the offset of the input in the number of integers * @param n the number of elements to be compressed * @return the number of processed integers */ public static final int s16Decompress(int[] out, int outOffset, int[] in, int inOffset, int n) { int numIdx, j=0, bits=0; numIdx = in[inOffset]>>>S16_BITSSIZE; int num = S16_NUM[numIdx] < n ? S16_NUM[numIdx] : n; for(j=0, bits=0; j<num; j++) { out[outOffset+j] = readBitsForS16(in, inOffset, bits, S16_BITS[numIdx][j]); bits += S16_BITS[numIdx][j]; } return num; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * * @param outDecompBlock * the decompressed block which is the output * @param inCompBlock * the compressed block which is the input * @param blockSize * the block size * @param inStartOffsetInBits * the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been * decompressed */ public static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits + 31) >>> 5; int num, outOffset = 0, numLeft; for (numLeft = blockSize; numLeft > 0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset << 5) - inStartOffsetInBits; return compressedBitSize; }
/** * Compress a block of blockSize integers using Simple16 algorithm * * @param outCompBlock * the compressed block which is the output * @param outStartOffsetInBits * the start offset in bits of the compressed block * @param inBlock * the block to be compressed * @param blockSize * the block size * @return the compressed size in bits */ private static int compressBlockByS16(int[] outCompBlock, int outStartOffsetInBits, int[] inBlock, int blockSize) { int outOffset = (outStartOffsetInBits + 31) >>> 5; int num, inOffset = 0, numLeft; for (numLeft = blockSize; numLeft > 0; numLeft -= num) { num = Simple16.s16Compress(outCompBlock, outOffset, inBlock, inOffset, numLeft, blockSize); outOffset++; inOffset += num; } int compressedBitSize = (outOffset << 5) - outStartOffsetInBits; return compressedBitSize; }
/** * Decompress an integer array using Simple16 * * @param out the decompressed output * @param outOffset the offset of the output in the number of integers * @param in the compressed input array * @param inOffset the offset of the input in the number of integers * @param n the number of elements to be compressed * @return the number of processed integers */ public static final int s16Decompress(int[] out, int outOffset, int[] in, int inOffset, int n) { int numIdx, j=0, bits=0; numIdx = in[inOffset]>>>S16_BITSSIZE; int num = S16_NUM[numIdx] < n ? S16_NUM[numIdx] : n; for(j=0, bits=0; j<num; j++) { out[outOffset+j] = readBitsForS16(in, inOffset, bits, S16_BITS[numIdx][j]); bits += S16_BITS[numIdx][j]; } return num; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * @param outDecompBlock the decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param inStartOffsetInBits the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been decompressed */ public static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits+31)>>>5; int num, outOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset<<5)-inStartOffsetInBits; return compressedBitSize; }
/** * Compress a block of blockSize integers using Simple16 algorithm * @param outCompBlock the compressed block which is the output * @param outStartOffsetInBits the start offset in bits of the compressed block * @param inBlock the block to be compressed * @param blockSize the block size * @return the compressed size in bits */ private static int compressBlockByS16(int[] outCompBlock, int outStartOffsetInBits, int[] inBlock, int blockSize) { int outOffset = (outStartOffsetInBits+31)>>>5; int num, inOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Compress(outCompBlock, outOffset, inBlock, inOffset, numLeft, blockSize); outOffset++; inOffset += num; } int compressedBitSize = (outOffset<<5)-outStartOffsetInBits; return compressedBitSize; }
/** * Decompress an integer array using Simple16 * * @param out * the decompressed output * @param outOffset * the offset of the output in the number of integers * @param in * the compressed input array * @param inOffset * the offset of the input in the number of integers * @param n * the number of elements to be compressed * @return the number of processed integers */ public static final int s16Decompress(int[] out, int outOffset, int[] in, int inOffset, int n) { int numIdx, j = 0, bits = 0; numIdx = in[inOffset] >>> S16_BITSSIZE; int num = S16_NUM[numIdx] < n ? S16_NUM[numIdx] : n; for (j = 0, bits = 0; j < num; j++) { out[outOffset + j] = readBitsForS16(in, inOffset, bits, S16_BITS[numIdx][j]); bits += S16_BITS[numIdx][j]; } return num; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * @param outDecompBlock the decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param inStartOffsetInBits the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been decompressed */ public int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits+31)>>>5; int num, outOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset<<5)-inStartOffsetInBits; return compressedBitSize; }
/** * Compress a block of blockSize integers using Simple16 algorithm * @param outCompBlock the compressed block which is the output * @param outStartOffsetInBits the start offset in bits of the compressed block * @param inBlock the block to be compressed * @param blockSize the block size * @return the compressed size in bits */ private static int compressBlockByS16(int[] outCompBlock, int outStartOffsetInBits, int[] inBlock, int blockSize) { int outOffset = (outStartOffsetInBits+31)>>>5; int num, inOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Compress(outCompBlock, outOffset, inBlock, inOffset, numLeft, blockSize); outOffset++; inOffset += num; } int compressedBitSize = (outOffset<<5)-outStartOffsetInBits; return compressedBitSize; }
/** * Decompress an integer array using Simple16 * * @param out * the decompressed output * @param outOffset * the offset of the output in the number of integers * @param in * the compressed input array * @param inOffset * the offset of the input in the number of integers * @param n * the number of elements to be compressed * @return the number of processed integers */ public static final int s16Decompress(int[] out, int outOffset, int[] in, int inOffset, int n) { int numIdx, j = 0, bits = 0; numIdx = in[inOffset] >>> S16_BITSSIZE; int num = S16_NUM[numIdx] < n ? S16_NUM[numIdx] : n; for (j = 0, bits = 0; j < num; j++) { out[outOffset + j] = readBitsForS16(in, inOffset, bits, S16_BITS[numIdx][j]); bits += S16_BITS[numIdx][j]; } return num; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * @param outDecompBlock the decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param inStartOffsetInBits the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been decompressed */ public static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits+31)>>>5; int num, outOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset<<5)-inStartOffsetInBits; return compressedBitSize; }
/** * Compress a block of blockSize integers using Simple16 algorithm * @param outCompBlock the compressed block which is the output * @param outStartOffsetInBits the start offset in bits of the compressed block * @param inBlock the block to be compressed * @param blockSize the block size * @return the compressed size in bits */ private static int compressBlockByS16(int[] outCompBlock, int outStartOffsetInBits, int[] inBlock, int blockSize) { int outOffset = (outStartOffsetInBits+31)>>>5; int num, inOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Compress(outCompBlock, outOffset, inBlock, inOffset, numLeft, blockSize); outOffset++; inOffset += num; } int compressedBitSize = (outOffset<<5)-outStartOffsetInBits; return compressedBitSize; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * @param outDecompBlock the decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param inStartOffsetInBits the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been decompressed */ public int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits+31)>>>5; int num, outOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset<<5)-inStartOffsetInBits; return compressedBitSize; }
/** * Compress a block of blockSize integers using Simple16 algorithm * * @param outCompBlock * the compressed block which is the output * @param outStartOffsetInBits * the start offset in bits of the compressed block * @param inBlock * the block to be compressed * @param blockSize * the block size * @return the compressed size in bits */ private static int compressBlockByS16(int[] outCompBlock, int outStartOffsetInBits, int[] inBlock, int blockSize) { int outOffset = (outStartOffsetInBits + 31) >>> 5; int num, inOffset = 0, numLeft; for (numLeft = blockSize; numLeft > 0; numLeft -= num) { num = Simple16.s16Compress(outCompBlock, outOffset, inBlock, inOffset, numLeft, blockSize); outOffset++; inOffset += num; } int compressedBitSize = (outOffset << 5) - outStartOffsetInBits; return compressedBitSize; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * @param outDecompBlock the decompressed block which is the output * @param inCompBlock the compressed block which is the input * @param blockSize the block size * @param inStartOffsetInBits the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been decompressed */ public static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits+31)>>>5; int num, outOffset=0, numLeft; for(numLeft=blockSize; numLeft>0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset<<5)-inStartOffsetInBits; return compressedBitSize; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * * @param outDecompBlock * the decompressed block which is the output * @param inCompBlock * the compressed block which is the input * @param blockSize * the block size * @param inStartOffsetInBits * the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been * decompressed */ public static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits + 31) >>> 5; int num, outOffset = 0, numLeft; for (numLeft = blockSize; numLeft > 0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset << 5) - inStartOffsetInBits; return compressedBitSize; }
/** * Decompress a block of blockSize integers using Simple16 algorithm * * @param outDecompBlock * the decompressed block which is the output * @param inCompBlock * the compressed block which is the input * @param blockSize * the block size * @param inStartOffsetInBits * the start offset in bits of the compressed block * @return the compressed size in bits of the data that has been * decompressed */ public static int decompressBlockByS16(int[] outDecompBlock, int[] inCompBlock, int inStartOffsetInBits, int blockSize) { int inOffset = (inStartOffsetInBits + 31) >>> 5; int num, outOffset = 0, numLeft; for (numLeft = blockSize; numLeft > 0; numLeft -= num) { num = Simple16.s16Decompress(outDecompBlock, outOffset, inCompBlock, inOffset, numLeft); outOffset += num; inOffset++; } int compressedBitSize = (inOffset << 5) - inStartOffsetInBits; return compressedBitSize; }