From 98df8654e81b69f7195dbfea390f90d8a4771520 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 4 Mar 2014 10:34:18 -0500
Subject: [PATCH 001/266] Adding funding ack.
---
README.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/README.md b/README.md
index e0689c8..e0802d6 100644
--- a/README.md
+++ b/README.md
@@ -147,3 +147,9 @@ Ikhtear Sharif, Performance Evaluation of Fast Integer Compression Techniques Ov
http://hdl.handle.net/1882/45703
He also posted his slides online: http://www.slideshare.net/ikhtearSharif/ikhtear-defense
+
+
+Funding
+-----------
+
+This work was supported by NSERC grant number 26143.
From af0d1522c84c0515f4526eaca04777c458ac13c8 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 10 Apr 2014 16:17:32 -0400
Subject: [PATCH 002/266] Reference
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index e0802d6..ff647b0 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,8 @@ when using differential coding in databases and information
retrieval (e.g., in inverted indexes or column stores).
This libary is used by ClueWeb Tools (https://github.com/lintool/clueweb).
+This library inspired a compression scheme used by Apache Lucene (e.g., see
+http://lucene.apache.org/core/4_6_1/core/org/apache/lucene/util/PForDeltaDocIdSet.html ).
It is a java port of the fastpfor C++ library (https://github.com/lemire/FastPFor).
There is also a Go port (https://github.com/reducedb/encoding). The C++
From cc7343023843b55f8873c33a9607b2c6dfd68dfc Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 16 Apr 2014 14:17:40 -0400
Subject: [PATCH 003/266] Adding a reference to recent paper
---
.gitignore | 1 +
README.md | 7 ++++++-
.../integercompression/benchmarktools/Benchmark.java | 1 -
.../integercompression/benchmarktools/BenchmarkCSV.java | 3 +++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index dd87c31..83f4d77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
tags
target/
tmp/
+/bin
diff --git a/README.md b/README.md
index ff647b0..306c2cc 100644
--- a/README.md
+++ b/README.md
@@ -134,12 +134,17 @@ http://lemire.me/docs/javafastpfor/
Want to read more?
------------------
+This library was a key ingredient in the best paper at ECIR 2014 :
+
+Matteo Catena, Craig Macdonald, Iadh Ounis, On Inverted Index Compression for Search Engine Efficiency, Lecture Notes in Computer Science 8416 (ECIR 2014), 2014.
+http://dx.doi.org/10.1007/978-3-319-06028-6_30
+
+
We wrote a research paper which documents many of the CODECs implemented here:
Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second through vectorization, Software Pratice & Experience (to appear)
http://arxiv.org/abs/1209.2137
-
Daniel Lemire, Leonid Boytsov, Nathan Kurz, SIMD Compression and the Intersection of Sorted Integers, arXiv:1401.6399, 2014
http://arxiv.org/abs/1401.6399
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
index 7429892..3e60c9e 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
@@ -398,7 +398,6 @@ public static void testKamikaze(int[][] data, int repeat,
size += thiscompsize;
//
bef = System.nanoTime() / 1000;
- // buffer[0] = backupdata[0];
ArrayList datauncomp = new ArrayList(
dataout.size());
int deltaoffset = 0;
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java
index 6d0efc9..e301d8f 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java
@@ -51,6 +51,7 @@ private static ArrayList loadIntegers(final String filename, final Format
if (misparsed > 0)
System.out.println("Failed to parse "
+ misparsed + " entries");
+ br.close();
return answer;
} else if (f == Format.ONEARRAYPERFILE) {
ArrayList answer = new ArrayList();
@@ -80,6 +81,7 @@ private static ArrayList loadIntegers(final String filename, final Format
if (misparsed > 0)
System.out.println("Failed to parse "
+ misparsed + " entries");
+ br.close();
return wrap;
} else {
ArrayList answer = new ArrayList();
@@ -103,6 +105,7 @@ private static ArrayList loadIntegers(final String filename, final Format
if (misparsed > 0)
System.out.println("Failed to parse "
+ misparsed + " entries");
+ br.close();
return wrap;
}
}
From a5c358a55fa2ddd13b69a0b25dd750cb3de42ddf Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Fri, 18 Apr 2014 15:41:30 -0400
Subject: [PATCH 004/266] Clarifying
---
README.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 306c2cc..c02c539 100644
--- a/README.md
+++ b/README.md
@@ -77,11 +77,16 @@ with contributions by
How does it compare to the Kamikaze PForDelta library?
------------------------------------------------------
-In our tests, Kamikaze PForDelta does not fare well. See
+In our tests, Kamikaze PForDelta is slower than our implementations. See
the benchmarkresults directory for some results.
https://github.com/lemire/JavaFastPFOR/blob/master/benchmarkresults/benchmarkresults_icore7_10may2013.txt
+
+Reference:
+ http://sna-projects.com/kamikaze/
+
+
Requirements
------------
From 31ca70660db295f05bf850fa8a63ac6c94390f8d Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 28 May 2014 21:08:05 -0400
Subject: [PATCH 005/266] Updated readme
---
README.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c02c539..77ddd36 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,11 @@ your array use less than 32 bits. These sort of arrays often come up
when using differential coding in databases and information
retrieval (e.g., in inverted indexes or column stores).
+It can decompress integers at a rate of over 1.2 billions per second
+(4.5 GB/s). It is significantly faster than generic codecs (such
+as Snappy, LZ4 and so on) when compressing arrays of integers.
+
+Part of this library has been integrated in Parquet (http://parquet.io/).
This libary is used by ClueWeb Tools (https://github.com/lintool/clueweb).
This library inspired a compression scheme used by Apache Lucene (e.g., see
http://lucene.apache.org/core/4_6_1/core/org/apache/lucene/util/PForDeltaDocIdSet.html ).
@@ -156,7 +161,7 @@ http://arxiv.org/abs/1401.6399
Ikhtear Sharif wrote his M.Sc. thesis on this library:
Ikhtear Sharif, Performance Evaluation of Fast Integer Compression Techniques Over Tables, M.Sc. thesis, UNB 2013.
-http://hdl.handle.net/1882/45703
+http://lemire.me/fr/documents/thesis/IkhtearThesis.pdf
He also posted his slides online: http://www.slideshare.net/ikhtearSharif/ikhtear-defense
From d54d2cbfc56c37b7cff0eb867494381b38e8a372 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 09:44:54 -0400
Subject: [PATCH 006/266] Better documentation
---
.../lemire/integercompression/BitPacking.java | 5036 ++++++++--------
.../lemire/integercompression/FastPFOR.java | 8 +-
.../IntegratedBitPacking.java | 5276 +++++++++--------
.../IntegratedFastPFOR.java | 9 +-
4 files changed, 5174 insertions(+), 5155 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/BitPacking.java b/src/main/java/me/lemire/integercompression/BitPacking.java
index 490d971..e36291b 100644
--- a/src/main/java/me/lemire/integercompression/BitPacking.java
+++ b/src/main/java/me/lemire/integercompression/BitPacking.java
@@ -12,1305 +12,1453 @@
/**
* Bitpacking routines
*
+ * For details, please see
+ *
+ * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
+ * through vectorization Software: Practice & Experience
+ * http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
+ * http://arxiv.org/abs/1209.2137
+ *
+ *
* @author Daniel Lemire
*
*/
public final class BitPacking {
- protected static void fastpackwithoutmask1(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 1)
- | ((in[2 + inpos]) << 2) | ((in[3 + inpos]) << 3)
- | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 5)
- | ((in[6 + inpos]) << 6) | ((in[7 + inpos]) << 7)
- | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 9)
- | ((in[10 + inpos]) << 10) | ((in[11 + inpos]) << 11)
- | ((in[12 + inpos]) << 12) | ((in[13 + inpos]) << 13)
- | ((in[14 + inpos]) << 14) | ((in[15 + inpos]) << 15)
- | ((in[16 + inpos]) << 16) | ((in[17 + inpos]) << 17)
- | ((in[18 + inpos]) << 18) | ((in[19 + inpos]) << 19)
- | ((in[20 + inpos]) << 20) | ((in[21 + inpos]) << 21)
- | ((in[22 + inpos]) << 22) | ((in[23 + inpos]) << 23)
- | ((in[24 + inpos]) << 24) | ((in[25 + inpos]) << 25)
- | ((in[26 + inpos]) << 26) | ((in[27 + inpos]) << 27)
- | ((in[28 + inpos]) << 28) | ((in[29 + inpos]) << 29)
- | ((in[30 + inpos]) << 30) | ((in[31 + inpos]) << 31);
- }
-
- protected static void fastpackwithoutmask2(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 2)
- | ((in[2 + inpos]) << 4) | ((in[3 + inpos]) << 6)
- | ((in[4 + inpos]) << 8) | ((in[5 + inpos]) << 10)
- | ((in[6 + inpos]) << 12) | ((in[7 + inpos]) << 14)
- | ((in[8 + inpos]) << 16) | ((in[9 + inpos]) << 18)
- | ((in[10 + inpos]) << 20) | ((in[11 + inpos]) << 22)
- | ((in[12 + inpos]) << 24) | ((in[13 + inpos]) << 26)
- | ((in[14 + inpos]) << 28) | ((in[15 + inpos]) << 30);
- out[1 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 2)
- | ((in[18 + inpos]) << 4) | ((in[19 + inpos]) << 6)
- | ((in[20 + inpos]) << 8) | ((in[21 + inpos]) << 10)
- | ((in[22 + inpos]) << 12) | ((in[23 + inpos]) << 14)
- | ((in[24 + inpos]) << 16) | ((in[25 + inpos]) << 18)
- | ((in[26 + inpos]) << 20) | ((in[27 + inpos]) << 22)
- | ((in[28 + inpos]) << 24) | ((in[29 + inpos]) << 26)
- | ((in[30 + inpos]) << 28) | ((in[31 + inpos]) << 30);
+ /**
+ * Pack 32 integers
+ *
+ * @param in
+ * source array
+ * @param inpos
+ * position in source array
+ * @param out
+ * output array
+ * @param outpos
+ * position in output array
+ * @param bit
+ * number of bits to use per integer
+ */
+ public static void fastpack(final int[] in, final int inpos,
+ final int[] out, final int outpos, final int bit) {
+ switch (bit) {
+ case 0:
+ fastpack0(in, inpos, out, outpos);
+ break;
+ case 1:
+ fastpack1(in, inpos, out, outpos);
+ break;
+ case 2:
+ fastpack2(in, inpos, out, outpos);
+ break;
+ case 3:
+ fastpack3(in, inpos, out, outpos);
+ break;
+ case 4:
+ fastpack4(in, inpos, out, outpos);
+ break;
+ case 5:
+ fastpack5(in, inpos, out, outpos);
+ break;
+ case 6:
+ fastpack6(in, inpos, out, outpos);
+ break;
+ case 7:
+ fastpack7(in, inpos, out, outpos);
+ break;
+ case 8:
+ fastpack8(in, inpos, out, outpos);
+ break;
+ case 9:
+ fastpack9(in, inpos, out, outpos);
+ break;
+ case 10:
+ fastpack10(in, inpos, out, outpos);
+ break;
+ case 11:
+ fastpack11(in, inpos, out, outpos);
+ break;
+ case 12:
+ fastpack12(in, inpos, out, outpos);
+ break;
+ case 13:
+ fastpack13(in, inpos, out, outpos);
+ break;
+ case 14:
+ fastpack14(in, inpos, out, outpos);
+ break;
+ case 15:
+ fastpack15(in, inpos, out, outpos);
+ break;
+ case 16:
+ fastpack16(in, inpos, out, outpos);
+ break;
+ case 17:
+ fastpack17(in, inpos, out, outpos);
+ break;
+ case 18:
+ fastpack18(in, inpos, out, outpos);
+ break;
+ case 19:
+ fastpack19(in, inpos, out, outpos);
+ break;
+ case 20:
+ fastpack20(in, inpos, out, outpos);
+ break;
+ case 21:
+ fastpack21(in, inpos, out, outpos);
+ break;
+ case 22:
+ fastpack22(in, inpos, out, outpos);
+ break;
+ case 23:
+ fastpack23(in, inpos, out, outpos);
+ break;
+ case 24:
+ fastpack24(in, inpos, out, outpos);
+ break;
+ case 25:
+ fastpack25(in, inpos, out, outpos);
+ break;
+ case 26:
+ fastpack26(in, inpos, out, outpos);
+ break;
+ case 27:
+ fastpack27(in, inpos, out, outpos);
+ break;
+ case 28:
+ fastpack28(in, inpos, out, outpos);
+ break;
+ case 29:
+ fastpack29(in, inpos, out, outpos);
+ break;
+ case 30:
+ fastpack30(in, inpos, out, outpos);
+ break;
+ case 31:
+ fastpack31(in, inpos, out, outpos);
+ break;
+ case 32:
+ fastpack32(in, inpos, out, outpos);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unsupported bit width.");
+ /**
+ * @param in
+ * @param inpos
+ * @param out
+ * @param outpos
+ * @param bit
+ */
+ }
}
- protected static void fastpackwithoutmask3(final int[] in, int inpos,
+ protected static void fastpack0(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 3)
- | ((in[2 + inpos]) << 6) | ((in[3 + inpos]) << 9)
- | ((in[4 + inpos]) << 12) | ((in[5 + inpos]) << 15)
- | ((in[6 + inpos]) << 18) | ((in[7 + inpos]) << 21)
- | ((in[8 + inpos]) << 24) | ((in[9 + inpos]) << 27)
- | ((in[10 + inpos]) << 30);
- out[1 + outpos] = ((in[10 + inpos]) >>> (3 - 1))
- | ((in[11 + inpos]) << 1) | ((in[12 + inpos]) << 4)
- | ((in[13 + inpos]) << 7) | ((in[14 + inpos]) << 10)
- | ((in[15 + inpos]) << 13) | ((in[16 + inpos]) << 16)
- | ((in[17 + inpos]) << 19) | ((in[18 + inpos]) << 22)
- | ((in[19 + inpos]) << 25) | ((in[20 + inpos]) << 28)
- | ((in[21 + inpos]) << 31);
- out[2 + outpos] = ((in[21 + inpos]) >>> (3 - 2))
- | ((in[22 + inpos]) << 2) | ((in[23 + inpos]) << 5)
- | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 11)
- | ((in[26 + inpos]) << 14) | ((in[27 + inpos]) << 17)
- | ((in[28 + inpos]) << 20) | ((in[29 + inpos]) << 23)
- | ((in[30 + inpos]) << 26) | ((in[31 + inpos]) << 29);
+ // nothing
}
- protected static void fastpackwithoutmask4(final int[] in, int inpos,
+ protected static void fastpack1(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 4)
- | ((in[2 + inpos]) << 8) | ((in[3 + inpos]) << 12)
- | ((in[4 + inpos]) << 16) | ((in[5 + inpos]) << 20)
- | ((in[6 + inpos]) << 24) | ((in[7 + inpos]) << 28);
- out[1 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 4)
- | ((in[10 + inpos]) << 8) | ((in[11 + inpos]) << 12)
- | ((in[12 + inpos]) << 16) | ((in[13 + inpos]) << 20)
- | ((in[14 + inpos]) << 24) | ((in[15 + inpos]) << 28);
- out[2 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 4)
- | ((in[18 + inpos]) << 8) | ((in[19 + inpos]) << 12)
- | ((in[20 + inpos]) << 16) | ((in[21 + inpos]) << 20)
- | ((in[22 + inpos]) << 24) | ((in[23 + inpos]) << 28);
- out[3 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 4)
- | ((in[26 + inpos]) << 8) | ((in[27 + inpos]) << 12)
- | ((in[28 + inpos]) << 16) | ((in[29 + inpos]) << 20)
- | ((in[30 + inpos]) << 24) | ((in[31 + inpos]) << 28);
+ out[0 + outpos] = (in[0 + inpos] & 1)
+ | ((in[1 + inpos] & 1) << 1)
+ | ((in[2 + inpos] & 1) << 2)
+ | ((in[3 + inpos] & 1) << 3)
+ | ((in[4 + inpos] & 1) << 4)
+ | ((in[5 + inpos] & 1) << 5)
+ | ((in[6 + inpos] & 1) << 6)
+ | ((in[7 + inpos] & 1) << 7)
+ | ((in[8 + inpos] & 1) << 8)
+ | ((in[9 + inpos] & 1) << 9)
+ | ((in[10 + inpos] & 1) << 10)
+ | ((in[11 + inpos] & 1) << 11)
+ | ((in[12 + inpos] & 1) << 12)
+ | ((in[13 + inpos] & 1) << 13)
+ | ((in[14 + inpos] & 1) << 14)
+ | ((in[15 + inpos] & 1) << 15)
+ | ((in[16 + inpos] & 1) << 16)
+ | ((in[17 + inpos] & 1) << 17)
+ | ((in[18 + inpos] & 1) << 18)
+ | ((in[19 + inpos] & 1) << 19)
+ | ((in[20 + inpos] & 1) << 20)
+ | ((in[21 + inpos] & 1) << 21)
+ | ((in[22 + inpos] & 1) << 22)
+ | ((in[23 + inpos] & 1) << 23)
+ | ((in[24 + inpos] & 1) << 24)
+ | ((in[25 + inpos] & 1) << 25)
+ | ((in[26 + inpos] & 1) << 26)
+ | ((in[27 + inpos] & 1) << 27)
+ | ((in[28 + inpos] & 1) << 28)
+ | ((in[29 + inpos] & 1) << 29)
+ | ((in[30 + inpos] & 1) << 30)
+ | ((in[31 + inpos]) << 31);
}
- protected static void fastpackwithoutmask5(final int[] in, int inpos,
+ protected static void fastpack10(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 5)
- | ((in[2 + inpos]) << 10) | ((in[3 + inpos]) << 15)
- | ((in[4 + inpos]) << 20) | ((in[5 + inpos]) << 25)
- | ((in[6 + inpos]) << 30);
- out[1 + outpos] = ((in[6 + inpos]) >>> (5 - 3))
- | ((in[7 + inpos]) << 3) | ((in[8 + inpos]) << 8)
- | ((in[9 + inpos]) << 13) | ((in[10 + inpos]) << 18)
- | ((in[11 + inpos]) << 23) | ((in[12 + inpos]) << 28);
- out[2 + outpos] = ((in[12 + inpos]) >>> (5 - 1))
- | ((in[13 + inpos]) << 1) | ((in[14 + inpos]) << 6)
- | ((in[15 + inpos]) << 11) | ((in[16 + inpos]) << 16)
- | ((in[17 + inpos]) << 21) | ((in[18 + inpos]) << 26)
- | ((in[19 + inpos]) << 31);
- out[3 + outpos] = ((in[19 + inpos]) >>> (5 - 4))
- | ((in[20 + inpos]) << 4) | ((in[21 + inpos]) << 9)
- | ((in[22 + inpos]) << 14) | ((in[23 + inpos]) << 19)
- | ((in[24 + inpos]) << 24) | ((in[25 + inpos]) << 29);
- out[4 + outpos] = ((in[25 + inpos]) >>> (5 - 2))
- | ((in[26 + inpos]) << 2) | ((in[27 + inpos]) << 7)
- | ((in[28 + inpos]) << 12) | ((in[29 + inpos]) << 17)
- | ((in[30 + inpos]) << 22) | ((in[31 + inpos]) << 27);
- }
-
- protected static void fastpackwithoutmask6(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 6)
- | ((in[2 + inpos]) << 12) | ((in[3 + inpos]) << 18)
- | ((in[4 + inpos]) << 24) | ((in[5 + inpos]) << 30);
- out[1 + outpos] = ((in[5 + inpos]) >>> (6 - 4))
- | ((in[6 + inpos]) << 4) | ((in[7 + inpos]) << 10)
- | ((in[8 + inpos]) << 16) | ((in[9 + inpos]) << 22)
- | ((in[10 + inpos]) << 28);
- out[2 + outpos] = ((in[10 + inpos]) >>> (6 - 2))
- | ((in[11 + inpos]) << 2) | ((in[12 + inpos]) << 8)
- | ((in[13 + inpos]) << 14) | ((in[14 + inpos]) << 20)
- | ((in[15 + inpos]) << 26);
- out[3 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 6)
- | ((in[18 + inpos]) << 12) | ((in[19 + inpos]) << 18)
- | ((in[20 + inpos]) << 24) | ((in[21 + inpos]) << 30);
- out[4 + outpos] = ((in[21 + inpos]) >>> (6 - 4))
- | ((in[22 + inpos]) << 4) | ((in[23 + inpos]) << 10)
- | ((in[24 + inpos]) << 16) | ((in[25 + inpos]) << 22)
- | ((in[26 + inpos]) << 28);
- out[5 + outpos] = ((in[26 + inpos]) >>> (6 - 2))
- | ((in[27 + inpos]) << 2) | ((in[28 + inpos]) << 8)
- | ((in[29 + inpos]) << 14) | ((in[30 + inpos]) << 20)
- | ((in[31 + inpos]) << 26);
- }
-
- protected static void fastpackwithoutmask7(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 7)
- | ((in[2 + inpos]) << 14) | ((in[3 + inpos]) << 21)
- | ((in[4 + inpos]) << 28);
- out[1 + outpos] = ((in[4 + inpos]) >>> (7 - 3))
- | ((in[5 + inpos]) << 3) | ((in[6 + inpos]) << 10)
- | ((in[7 + inpos]) << 17) | ((in[8 + inpos]) << 24)
- | ((in[9 + inpos]) << 31);
- out[2 + outpos] = ((in[9 + inpos]) >>> (7 - 6))
- | ((in[10 + inpos]) << 6) | ((in[11 + inpos]) << 13)
- | ((in[12 + inpos]) << 20) | ((in[13 + inpos]) << 27);
- out[3 + outpos] = ((in[13 + inpos]) >>> (7 - 2))
- | ((in[14 + inpos]) << 2) | ((in[15 + inpos]) << 9)
- | ((in[16 + inpos]) << 16) | ((in[17 + inpos]) << 23)
- | ((in[18 + inpos]) << 30);
- out[4 + outpos] = ((in[18 + inpos]) >>> (7 - 5))
- | ((in[19 + inpos]) << 5) | ((in[20 + inpos]) << 12)
- | ((in[21 + inpos]) << 19) | ((in[22 + inpos]) << 26);
- out[5 + outpos] = ((in[22 + inpos]) >>> (7 - 1))
- | ((in[23 + inpos]) << 1) | ((in[24 + inpos]) << 8)
- | ((in[25 + inpos]) << 15) | ((in[26 + inpos]) << 22)
- | ((in[27 + inpos]) << 29);
- out[6 + outpos] = ((in[27 + inpos]) >>> (7 - 4))
- | ((in[28 + inpos]) << 4) | ((in[29 + inpos]) << 11)
- | ((in[30 + inpos]) << 18) | ((in[31 + inpos]) << 25);
- }
-
- protected static void fastpackwithoutmask8(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 8)
- | ((in[2 + inpos]) << 16) | ((in[3 + inpos]) << 24);
- out[1 + outpos] = in[4 + inpos] | ((in[5 + inpos]) << 8)
- | ((in[6 + inpos]) << 16) | ((in[7 + inpos]) << 24);
- out[2 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 8)
- | ((in[10 + inpos]) << 16) | ((in[11 + inpos]) << 24);
- out[3 + outpos] = in[12 + inpos] | ((in[13 + inpos]) << 8)
- | ((in[14 + inpos]) << 16) | ((in[15 + inpos]) << 24);
- out[4 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 8)
- | ((in[18 + inpos]) << 16) | ((in[19 + inpos]) << 24);
- out[5 + outpos] = in[20 + inpos] | ((in[21 + inpos]) << 8)
- | ((in[22 + inpos]) << 16) | ((in[23 + inpos]) << 24);
- out[6 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 8)
- | ((in[26 + inpos]) << 16) | ((in[27 + inpos]) << 24);
- out[7 + outpos] = in[28 + inpos] | ((in[29 + inpos]) << 8)
- | ((in[30 + inpos]) << 16) | ((in[31 + inpos]) << 24);
- }
-
- protected static void fastpackwithoutmask9(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 9)
- | ((in[2 + inpos]) << 18) | ((in[3 + inpos]) << 27);
- out[1 + outpos] = ((in[3 + inpos]) >>> (9 - 4))
- | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 13)
- | ((in[6 + inpos]) << 22) | ((in[7 + inpos]) << 31);
- out[2 + outpos] = ((in[7 + inpos]) >>> (9 - 8))
- | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 17)
- | ((in[10 + inpos]) << 26);
- out[3 + outpos] = ((in[10 + inpos]) >>> (9 - 3))
- | ((in[11 + inpos]) << 3) | ((in[12 + inpos]) << 12)
- | ((in[13 + inpos]) << 21) | ((in[14 + inpos]) << 30);
- out[4 + outpos] = ((in[14 + inpos]) >>> (9 - 7))
- | ((in[15 + inpos]) << 7) | ((in[16 + inpos]) << 16)
- | ((in[17 + inpos]) << 25);
- out[5 + outpos] = ((in[17 + inpos]) >>> (9 - 2))
- | ((in[18 + inpos]) << 2) | ((in[19 + inpos]) << 11)
- | ((in[20 + inpos]) << 20) | ((in[21 + inpos]) << 29);
- out[6 + outpos] = ((in[21 + inpos]) >>> (9 - 6))
- | ((in[22 + inpos]) << 6) | ((in[23 + inpos]) << 15)
- | ((in[24 + inpos]) << 24);
- out[7 + outpos] = ((in[24 + inpos]) >>> (9 - 1))
- | ((in[25 + inpos]) << 1) | ((in[26 + inpos]) << 10)
- | ((in[27 + inpos]) << 19) | ((in[28 + inpos]) << 28);
- out[8 + outpos] = ((in[28 + inpos]) >>> (9 - 5))
- | ((in[29 + inpos]) << 5) | ((in[30 + inpos]) << 14)
- | ((in[31 + inpos]) << 23);
- }
-
- protected static void fastpackwithoutmask10(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 10)
- | ((in[2 + inpos]) << 20) | ((in[3 + inpos]) << 30);
- out[1 + outpos] = ((in[3 + inpos]) >>> (10 - 8))
- | ((in[4 + inpos]) << 8) | ((in[5 + inpos]) << 18)
+ out[0 + outpos] = (in[0 + inpos] & 1023)
+ | ((in[1 + inpos] & 1023) << 10)
+ | ((in[2 + inpos] & 1023) << 20)
+ | ((in[3 + inpos]) << 30);
+ out[1 + outpos] = ((in[3 + inpos] & 1023) >>> (10 - 8))
+ | ((in[4 + inpos] & 1023) << 8)
+ | ((in[5 + inpos] & 1023) << 18)
| ((in[6 + inpos]) << 28);
- out[2 + outpos] = ((in[6 + inpos]) >>> (10 - 6))
- | ((in[7 + inpos]) << 6) | ((in[8 + inpos]) << 16)
+ out[2 + outpos] = ((in[6 + inpos] & 1023) >>> (10 - 6))
+ | ((in[7 + inpos] & 1023) << 6)
+ | ((in[8 + inpos] & 1023) << 16)
| ((in[9 + inpos]) << 26);
- out[3 + outpos] = ((in[9 + inpos]) >>> (10 - 4))
- | ((in[10 + inpos]) << 4) | ((in[11 + inpos]) << 14)
+ out[3 + outpos] = ((in[9 + inpos] & 1023) >>> (10 - 4))
+ | ((in[10 + inpos] & 1023) << 4)
+ | ((in[11 + inpos] & 1023) << 14)
| ((in[12 + inpos]) << 24);
- out[4 + outpos] = ((in[12 + inpos]) >>> (10 - 2))
- | ((in[13 + inpos]) << 2) | ((in[14 + inpos]) << 12)
+ out[4 + outpos] = ((in[12 + inpos] & 1023) >>> (10 - 2))
+ | ((in[13 + inpos] & 1023) << 2)
+ | ((in[14 + inpos] & 1023) << 12)
| ((in[15 + inpos]) << 22);
- out[5 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 10)
- | ((in[18 + inpos]) << 20) | ((in[19 + inpos]) << 30);
- out[6 + outpos] = ((in[19 + inpos]) >>> (10 - 8))
- | ((in[20 + inpos]) << 8) | ((in[21 + inpos]) << 18)
+ out[5 + outpos] = (in[16 + inpos] & 1023)
+ | ((in[17 + inpos] & 1023) << 10)
+ | ((in[18 + inpos] & 1023) << 20)
+ | ((in[19 + inpos]) << 30);
+ out[6 + outpos] = ((in[19 + inpos] & 1023) >>> (10 - 8))
+ | ((in[20 + inpos] & 1023) << 8)
+ | ((in[21 + inpos] & 1023) << 18)
| ((in[22 + inpos]) << 28);
- out[7 + outpos] = ((in[22 + inpos]) >>> (10 - 6))
- | ((in[23 + inpos]) << 6) | ((in[24 + inpos]) << 16)
+ out[7 + outpos] = ((in[22 + inpos] & 1023) >>> (10 - 6))
+ | ((in[23 + inpos] & 1023) << 6)
+ | ((in[24 + inpos] & 1023) << 16)
| ((in[25 + inpos]) << 26);
- out[8 + outpos] = ((in[25 + inpos]) >>> (10 - 4))
- | ((in[26 + inpos]) << 4) | ((in[27 + inpos]) << 14)
+ out[8 + outpos] = ((in[25 + inpos] & 1023) >>> (10 - 4))
+ | ((in[26 + inpos] & 1023) << 4)
+ | ((in[27 + inpos] & 1023) << 14)
| ((in[28 + inpos]) << 24);
- out[9 + outpos] = ((in[28 + inpos]) >>> (10 - 2))
- | ((in[29 + inpos]) << 2) | ((in[30 + inpos]) << 12)
+ out[9 + outpos] = ((in[28 + inpos] & 1023) >>> (10 - 2))
+ | ((in[29 + inpos] & 1023) << 2)
+ | ((in[30 + inpos] & 1023) << 12)
| ((in[31 + inpos]) << 22);
}
- protected static void fastpackwithoutmask11(final int[] in, int inpos,
+ protected static void fastpack11(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 11)
+ out[0 + outpos] = (in[0 + inpos] & 2047)
+ | ((in[1 + inpos] & 2047) << 11)
| ((in[2 + inpos]) << 22);
- out[1 + outpos] = ((in[2 + inpos]) >>> (11 - 1))
- | ((in[3 + inpos]) << 1) | ((in[4 + inpos]) << 12)
+ out[1 + outpos] = ((in[2 + inpos] & 2047) >>> (11 - 1))
+ | ((in[3 + inpos] & 2047) << 1)
+ | ((in[4 + inpos] & 2047) << 12)
| ((in[5 + inpos]) << 23);
- out[2 + outpos] = ((in[5 + inpos]) >>> (11 - 2))
- | ((in[6 + inpos]) << 2) | ((in[7 + inpos]) << 13)
+ out[2 + outpos] = ((in[5 + inpos] & 2047) >>> (11 - 2))
+ | ((in[6 + inpos] & 2047) << 2)
+ | ((in[7 + inpos] & 2047) << 13)
| ((in[8 + inpos]) << 24);
- out[3 + outpos] = ((in[8 + inpos]) >>> (11 - 3))
- | ((in[9 + inpos]) << 3) | ((in[10 + inpos]) << 14)
+ out[3 + outpos] = ((in[8 + inpos] & 2047) >>> (11 - 3))
+ | ((in[9 + inpos] & 2047) << 3)
+ | ((in[10 + inpos] & 2047) << 14)
| ((in[11 + inpos]) << 25);
- out[4 + outpos] = ((in[11 + inpos]) >>> (11 - 4))
- | ((in[12 + inpos]) << 4) | ((in[13 + inpos]) << 15)
+ out[4 + outpos] = ((in[11 + inpos] & 2047) >>> (11 - 4))
+ | ((in[12 + inpos] & 2047) << 4)
+ | ((in[13 + inpos] & 2047) << 15)
| ((in[14 + inpos]) << 26);
- out[5 + outpos] = ((in[14 + inpos]) >>> (11 - 5))
- | ((in[15 + inpos]) << 5) | ((in[16 + inpos]) << 16)
+ out[5 + outpos] = ((in[14 + inpos] & 2047) >>> (11 - 5))
+ | ((in[15 + inpos] & 2047) << 5)
+ | ((in[16 + inpos] & 2047) << 16)
| ((in[17 + inpos]) << 27);
- out[6 + outpos] = ((in[17 + inpos]) >>> (11 - 6))
- | ((in[18 + inpos]) << 6) | ((in[19 + inpos]) << 17)
+ out[6 + outpos] = ((in[17 + inpos] & 2047) >>> (11 - 6))
+ | ((in[18 + inpos] & 2047) << 6)
+ | ((in[19 + inpos] & 2047) << 17)
| ((in[20 + inpos]) << 28);
- out[7 + outpos] = ((in[20 + inpos]) >>> (11 - 7))
- | ((in[21 + inpos]) << 7) | ((in[22 + inpos]) << 18)
+ out[7 + outpos] = ((in[20 + inpos] & 2047) >>> (11 - 7))
+ | ((in[21 + inpos] & 2047) << 7)
+ | ((in[22 + inpos] & 2047) << 18)
| ((in[23 + inpos]) << 29);
- out[8 + outpos] = ((in[23 + inpos]) >>> (11 - 8))
- | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 19)
+ out[8 + outpos] = ((in[23 + inpos] & 2047) >>> (11 - 8))
+ | ((in[24 + inpos] & 2047) << 8)
+ | ((in[25 + inpos] & 2047) << 19)
| ((in[26 + inpos]) << 30);
- out[9 + outpos] = ((in[26 + inpos]) >>> (11 - 9))
- | ((in[27 + inpos]) << 9) | ((in[28 + inpos]) << 20)
+ out[9 + outpos] = ((in[26 + inpos] & 2047) >>> (11 - 9))
+ | ((in[27 + inpos] & 2047) << 9)
+ | ((in[28 + inpos] & 2047) << 20)
| ((in[29 + inpos]) << 31);
- out[10 + outpos] = ((in[29 + inpos]) >>> (11 - 10))
- | ((in[30 + inpos]) << 10) | ((in[31 + inpos]) << 21);
+ out[10 + outpos] = ((in[29 + inpos] & 2047) >>> (11 - 10))
+ | ((in[30 + inpos] & 2047) << 10)
+ | ((in[31 + inpos]) << 21);
}
- protected static void fastpackwithoutmask12(final int[] in, int inpos,
+ protected static void fastpack12(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 12)
+ out[0 + outpos] = (in[0 + inpos] & 4095)
+ | ((in[1 + inpos] & 4095) << 12)
| ((in[2 + inpos]) << 24);
- out[1 + outpos] = ((in[2 + inpos]) >>> (12 - 4))
- | ((in[3 + inpos]) << 4) | ((in[4 + inpos]) << 16)
+ out[1 + outpos] = ((in[2 + inpos] & 4095) >>> (12 - 4))
+ | ((in[3 + inpos] & 4095) << 4)
+ | ((in[4 + inpos] & 4095) << 16)
| ((in[5 + inpos]) << 28);
- out[2 + outpos] = ((in[5 + inpos]) >>> (12 - 8))
- | ((in[6 + inpos]) << 8) | ((in[7 + inpos]) << 20);
- out[3 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 12)
+ out[2 + outpos] = ((in[5 + inpos] & 4095) >>> (12 - 8))
+ | ((in[6 + inpos] & 4095) << 8)
+ | ((in[7 + inpos]) << 20);
+ out[3 + outpos] = (in[8 + inpos] & 4095)
+ | ((in[9 + inpos] & 4095) << 12)
| ((in[10 + inpos]) << 24);
- out[4 + outpos] = ((in[10 + inpos]) >>> (12 - 4))
- | ((in[11 + inpos]) << 4) | ((in[12 + inpos]) << 16)
+ out[4 + outpos] = ((in[10 + inpos] & 4095) >>> (12 - 4))
+ | ((in[11 + inpos] & 4095) << 4)
+ | ((in[12 + inpos] & 4095) << 16)
| ((in[13 + inpos]) << 28);
- out[5 + outpos] = ((in[13 + inpos]) >>> (12 - 8))
- | ((in[14 + inpos]) << 8) | ((in[15 + inpos]) << 20);
- out[6 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 12)
+ out[5 + outpos] = ((in[13 + inpos] & 4095) >>> (12 - 8))
+ | ((in[14 + inpos] & 4095) << 8)
+ | ((in[15 + inpos]) << 20);
+ out[6 + outpos] = (in[16 + inpos] & 4095)
+ | ((in[17 + inpos] & 4095) << 12)
| ((in[18 + inpos]) << 24);
- out[7 + outpos] = ((in[18 + inpos]) >>> (12 - 4))
- | ((in[19 + inpos]) << 4) | ((in[20 + inpos]) << 16)
+ out[7 + outpos] = ((in[18 + inpos] & 4095) >>> (12 - 4))
+ | ((in[19 + inpos] & 4095) << 4)
+ | ((in[20 + inpos] & 4095) << 16)
| ((in[21 + inpos]) << 28);
- out[8 + outpos] = ((in[21 + inpos]) >>> (12 - 8))
- | ((in[22 + inpos]) << 8) | ((in[23 + inpos]) << 20);
- out[9 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 12)
+ out[8 + outpos] = ((in[21 + inpos] & 4095) >>> (12 - 8))
+ | ((in[22 + inpos] & 4095) << 8)
+ | ((in[23 + inpos]) << 20);
+ out[9 + outpos] = (in[24 + inpos] & 4095)
+ | ((in[25 + inpos] & 4095) << 12)
| ((in[26 + inpos]) << 24);
- out[10 + outpos] = ((in[26 + inpos]) >>> (12 - 4))
- | ((in[27 + inpos]) << 4) | ((in[28 + inpos]) << 16)
+ out[10 + outpos] = ((in[26 + inpos] & 4095) >>> (12 - 4))
+ | ((in[27 + inpos] & 4095) << 4)
+ | ((in[28 + inpos] & 4095) << 16)
| ((in[29 + inpos]) << 28);
- out[11 + outpos] = ((in[29 + inpos]) >>> (12 - 8))
- | ((in[30 + inpos]) << 8) | ((in[31 + inpos]) << 20);
+ out[11 + outpos] = ((in[29 + inpos] & 4095) >>> (12 - 8))
+ | ((in[30 + inpos] & 4095) << 8)
+ | ((in[31 + inpos]) << 20);
}
- protected static void fastpackwithoutmask13(final int[] in, int inpos,
+ protected static void fastpack13(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 13)
+ out[0 + outpos] = (in[0 + inpos] & 8191)
+ | ((in[1 + inpos] & 8191) << 13)
| ((in[2 + inpos]) << 26);
- out[1 + outpos] = ((in[2 + inpos]) >>> (13 - 7))
- | ((in[3 + inpos]) << 7) | ((in[4 + inpos]) << 20);
- out[2 + outpos] = ((in[4 + inpos]) >>> (13 - 1))
- | ((in[5 + inpos]) << 1) | ((in[6 + inpos]) << 14)
+ out[1 + outpos] = ((in[2 + inpos] & 8191) >>> (13 - 7))
+ | ((in[3 + inpos] & 8191) << 7)
+ | ((in[4 + inpos]) << 20);
+ out[2 + outpos] = ((in[4 + inpos] & 8191) >>> (13 - 1))
+ | ((in[5 + inpos] & 8191) << 1)
+ | ((in[6 + inpos] & 8191) << 14)
| ((in[7 + inpos]) << 27);
- out[3 + outpos] = ((in[7 + inpos]) >>> (13 - 8))
- | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 21);
- out[4 + outpos] = ((in[9 + inpos]) >>> (13 - 2))
- | ((in[10 + inpos]) << 2) | ((in[11 + inpos]) << 15)
+ out[3 + outpos] = ((in[7 + inpos] & 8191) >>> (13 - 8))
+ | ((in[8 + inpos] & 8191) << 8)
+ | ((in[9 + inpos]) << 21);
+ out[4 + outpos] = ((in[9 + inpos] & 8191) >>> (13 - 2))
+ | ((in[10 + inpos] & 8191) << 2)
+ | ((in[11 + inpos] & 8191) << 15)
| ((in[12 + inpos]) << 28);
- out[5 + outpos] = ((in[12 + inpos]) >>> (13 - 9))
- | ((in[13 + inpos]) << 9) | ((in[14 + inpos]) << 22);
- out[6 + outpos] = ((in[14 + inpos]) >>> (13 - 3))
- | ((in[15 + inpos]) << 3) | ((in[16 + inpos]) << 16)
+ out[5 + outpos] = ((in[12 + inpos] & 8191) >>> (13 - 9))
+ | ((in[13 + inpos] & 8191) << 9)
+ | ((in[14 + inpos]) << 22);
+ out[6 + outpos] = ((in[14 + inpos] & 8191) >>> (13 - 3))
+ | ((in[15 + inpos] & 8191) << 3)
+ | ((in[16 + inpos] & 8191) << 16)
| ((in[17 + inpos]) << 29);
- out[7 + outpos] = ((in[17 + inpos]) >>> (13 - 10))
- | ((in[18 + inpos]) << 10) | ((in[19 + inpos]) << 23);
- out[8 + outpos] = ((in[19 + inpos]) >>> (13 - 4))
- | ((in[20 + inpos]) << 4) | ((in[21 + inpos]) << 17)
+ out[7 + outpos] = ((in[17 + inpos] & 8191) >>> (13 - 10))
+ | ((in[18 + inpos] & 8191) << 10)
+ | ((in[19 + inpos]) << 23);
+ out[8 + outpos] = ((in[19 + inpos] & 8191) >>> (13 - 4))
+ | ((in[20 + inpos] & 8191) << 4)
+ | ((in[21 + inpos] & 8191) << 17)
| ((in[22 + inpos]) << 30);
- out[9 + outpos] = ((in[22 + inpos]) >>> (13 - 11))
- | ((in[23 + inpos]) << 11) | ((in[24 + inpos]) << 24);
- out[10 + outpos] = ((in[24 + inpos]) >>> (13 - 5))
- | ((in[25 + inpos]) << 5) | ((in[26 + inpos]) << 18)
+ out[9 + outpos] = ((in[22 + inpos] & 8191) >>> (13 - 11))
+ | ((in[23 + inpos] & 8191) << 11)
+ | ((in[24 + inpos]) << 24);
+ out[10 + outpos] = ((in[24 + inpos] & 8191) >>> (13 - 5))
+ | ((in[25 + inpos] & 8191) << 5)
+ | ((in[26 + inpos] & 8191) << 18)
| ((in[27 + inpos]) << 31);
- out[11 + outpos] = ((in[27 + inpos]) >>> (13 - 12))
- | ((in[28 + inpos]) << 12) | ((in[29 + inpos]) << 25);
- out[12 + outpos] = ((in[29 + inpos]) >>> (13 - 6))
- | ((in[30 + inpos]) << 6) | ((in[31 + inpos]) << 19);
+ out[11 + outpos] = ((in[27 + inpos] & 8191) >>> (13 - 12))
+ | ((in[28 + inpos] & 8191) << 12)
+ | ((in[29 + inpos]) << 25);
+ out[12 + outpos] = ((in[29 + inpos] & 8191) >>> (13 - 6))
+ | ((in[30 + inpos] & 8191) << 6)
+ | ((in[31 + inpos]) << 19);
}
- protected static void fastpackwithoutmask14(final int[] in, int inpos,
+ protected static void fastpack14(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 14)
+ out[0 + outpos] = (in[0 + inpos] & 16383)
+ | ((in[1 + inpos] & 16383) << 14)
| ((in[2 + inpos]) << 28);
- out[1 + outpos] = ((in[2 + inpos]) >>> (14 - 10))
- | ((in[3 + inpos]) << 10) | ((in[4 + inpos]) << 24);
- out[2 + outpos] = ((in[4 + inpos]) >>> (14 - 6))
- | ((in[5 + inpos]) << 6) | ((in[6 + inpos]) << 20);
- out[3 + outpos] = ((in[6 + inpos]) >>> (14 - 2))
- | ((in[7 + inpos]) << 2) | ((in[8 + inpos]) << 16)
+ out[1 + outpos] = ((in[2 + inpos] & 16383) >>> (14 - 10))
+ | ((in[3 + inpos] & 16383) << 10)
+ | ((in[4 + inpos]) << 24);
+ out[2 + outpos] = ((in[4 + inpos] & 16383) >>> (14 - 6))
+ | ((in[5 + inpos] & 16383) << 6)
+ | ((in[6 + inpos]) << 20);
+ out[3 + outpos] = ((in[6 + inpos] & 16383) >>> (14 - 2))
+ | ((in[7 + inpos] & 16383) << 2)
+ | ((in[8 + inpos] & 16383) << 16)
| ((in[9 + inpos]) << 30);
- out[4 + outpos] = ((in[9 + inpos]) >>> (14 - 12))
- | ((in[10 + inpos]) << 12) | ((in[11 + inpos]) << 26);
- out[5 + outpos] = ((in[11 + inpos]) >>> (14 - 8))
- | ((in[12 + inpos]) << 8) | ((in[13 + inpos]) << 22);
- out[6 + outpos] = ((in[13 + inpos]) >>> (14 - 4))
- | ((in[14 + inpos]) << 4) | ((in[15 + inpos]) << 18);
- out[7 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 14)
+ out[4 + outpos] = ((in[9 + inpos] & 16383) >>> (14 - 12))
+ | ((in[10 + inpos] & 16383) << 12)
+ | ((in[11 + inpos]) << 26);
+ out[5 + outpos] = ((in[11 + inpos] & 16383) >>> (14 - 8))
+ | ((in[12 + inpos] & 16383) << 8)
+ | ((in[13 + inpos]) << 22);
+ out[6 + outpos] = ((in[13 + inpos] & 16383) >>> (14 - 4))
+ | ((in[14 + inpos] & 16383) << 4)
+ | ((in[15 + inpos]) << 18);
+ out[7 + outpos] = (in[16 + inpos] & 16383)
+ | ((in[17 + inpos] & 16383) << 14)
| ((in[18 + inpos]) << 28);
- out[8 + outpos] = ((in[18 + inpos]) >>> (14 - 10))
- | ((in[19 + inpos]) << 10) | ((in[20 + inpos]) << 24);
- out[9 + outpos] = ((in[20 + inpos]) >>> (14 - 6))
- | ((in[21 + inpos]) << 6) | ((in[22 + inpos]) << 20);
- out[10 + outpos] = ((in[22 + inpos]) >>> (14 - 2))
- | ((in[23 + inpos]) << 2) | ((in[24 + inpos]) << 16)
+ out[8 + outpos] = ((in[18 + inpos] & 16383) >>> (14 - 10))
+ | ((in[19 + inpos] & 16383) << 10)
+ | ((in[20 + inpos]) << 24);
+ out[9 + outpos] = ((in[20 + inpos] & 16383) >>> (14 - 6))
+ | ((in[21 + inpos] & 16383) << 6)
+ | ((in[22 + inpos]) << 20);
+ out[10 + outpos] = ((in[22 + inpos] & 16383) >>> (14 - 2))
+ | ((in[23 + inpos] & 16383) << 2)
+ | ((in[24 + inpos] & 16383) << 16)
| ((in[25 + inpos]) << 30);
- out[11 + outpos] = ((in[25 + inpos]) >>> (14 - 12))
- | ((in[26 + inpos]) << 12) | ((in[27 + inpos]) << 26);
- out[12 + outpos] = ((in[27 + inpos]) >>> (14 - 8))
- | ((in[28 + inpos]) << 8) | ((in[29 + inpos]) << 22);
- out[13 + outpos] = ((in[29 + inpos]) >>> (14 - 4))
- | ((in[30 + inpos]) << 4) | ((in[31 + inpos]) << 18);
+ out[11 + outpos] = ((in[25 + inpos] & 16383) >>> (14 - 12))
+ | ((in[26 + inpos] & 16383) << 12)
+ | ((in[27 + inpos]) << 26);
+ out[12 + outpos] = ((in[27 + inpos] & 16383) >>> (14 - 8))
+ | ((in[28 + inpos] & 16383) << 8)
+ | ((in[29 + inpos]) << 22);
+ out[13 + outpos] = ((in[29 + inpos] & 16383) >>> (14 - 4))
+ | ((in[30 + inpos] & 16383) << 4)
+ | ((in[31 + inpos]) << 18);
}
- protected static void fastpackwithoutmask15(final int[] in, int inpos,
+ protected static void fastpack15(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 15)
+ out[0 + outpos] = (in[0 + inpos] & 32767)
+ | ((in[1 + inpos] & 32767) << 15)
| ((in[2 + inpos]) << 30);
- out[1 + outpos] = ((in[2 + inpos]) >>> (15 - 13))
- | ((in[3 + inpos]) << 13) | ((in[4 + inpos]) << 28);
- out[2 + outpos] = ((in[4 + inpos]) >>> (15 - 11))
- | ((in[5 + inpos]) << 11) | ((in[6 + inpos]) << 26);
- out[3 + outpos] = ((in[6 + inpos]) >>> (15 - 9))
- | ((in[7 + inpos]) << 9) | ((in[8 + inpos]) << 24);
- out[4 + outpos] = ((in[8 + inpos]) >>> (15 - 7))
- | ((in[9 + inpos]) << 7) | ((in[10 + inpos]) << 22);
- out[5 + outpos] = ((in[10 + inpos]) >>> (15 - 5))
- | ((in[11 + inpos]) << 5) | ((in[12 + inpos]) << 20);
- out[6 + outpos] = ((in[12 + inpos]) >>> (15 - 3))
- | ((in[13 + inpos]) << 3) | ((in[14 + inpos]) << 18);
- out[7 + outpos] = ((in[14 + inpos]) >>> (15 - 1))
- | ((in[15 + inpos]) << 1) | ((in[16 + inpos]) << 16)
+ out[1 + outpos] = ((in[2 + inpos] & 32767) >>> (15 - 13))
+ | ((in[3 + inpos] & 32767) << 13)
+ | ((in[4 + inpos]) << 28);
+ out[2 + outpos] = ((in[4 + inpos] & 32767) >>> (15 - 11))
+ | ((in[5 + inpos] & 32767) << 11)
+ | ((in[6 + inpos]) << 26);
+ out[3 + outpos] = ((in[6 + inpos] & 32767) >>> (15 - 9))
+ | ((in[7 + inpos] & 32767) << 9)
+ | ((in[8 + inpos]) << 24);
+ out[4 + outpos] = ((in[8 + inpos] & 32767) >>> (15 - 7))
+ | ((in[9 + inpos] & 32767) << 7)
+ | ((in[10 + inpos]) << 22);
+ out[5 + outpos] = ((in[10 + inpos] & 32767) >>> (15 - 5))
+ | ((in[11 + inpos] & 32767) << 5)
+ | ((in[12 + inpos]) << 20);
+ out[6 + outpos] = ((in[12 + inpos] & 32767) >>> (15 - 3))
+ | ((in[13 + inpos] & 32767) << 3)
+ | ((in[14 + inpos]) << 18);
+ out[7 + outpos] = ((in[14 + inpos] & 32767) >>> (15 - 1))
+ | ((in[15 + inpos] & 32767) << 1)
+ | ((in[16 + inpos] & 32767) << 16)
| ((in[17 + inpos]) << 31);
- out[8 + outpos] = ((in[17 + inpos]) >>> (15 - 14))
- | ((in[18 + inpos]) << 14) | ((in[19 + inpos]) << 29);
- out[9 + outpos] = ((in[19 + inpos]) >>> (15 - 12))
- | ((in[20 + inpos]) << 12) | ((in[21 + inpos]) << 27);
- out[10 + outpos] = ((in[21 + inpos]) >>> (15 - 10))
- | ((in[22 + inpos]) << 10) | ((in[23 + inpos]) << 25);
- out[11 + outpos] = ((in[23 + inpos]) >>> (15 - 8))
- | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 23);
- out[12 + outpos] = ((in[25 + inpos]) >>> (15 - 6))
- | ((in[26 + inpos]) << 6) | ((in[27 + inpos]) << 21);
- out[13 + outpos] = ((in[27 + inpos]) >>> (15 - 4))
- | ((in[28 + inpos]) << 4) | ((in[29 + inpos]) << 19);
- out[14 + outpos] = ((in[29 + inpos]) >>> (15 - 2))
- | ((in[30 + inpos]) << 2) | ((in[31 + inpos]) << 17);
- }
-
- protected static void fastpackwithoutmask16(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 16);
- out[1 + outpos] = in[2 + inpos] | ((in[3 + inpos]) << 16);
- out[2 + outpos] = in[4 + inpos] | ((in[5 + inpos]) << 16);
- out[3 + outpos] = in[6 + inpos] | ((in[7 + inpos]) << 16);
- out[4 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 16);
- out[5 + outpos] = in[10 + inpos] | ((in[11 + inpos]) << 16);
- out[6 + outpos] = in[12 + inpos] | ((in[13 + inpos]) << 16);
- out[7 + outpos] = in[14 + inpos] | ((in[15 + inpos]) << 16);
- out[8 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 16);
- out[9 + outpos] = in[18 + inpos] | ((in[19 + inpos]) << 16);
- out[10 + outpos] = in[20 + inpos] | ((in[21 + inpos]) << 16);
- out[11 + outpos] = in[22 + inpos] | ((in[23 + inpos]) << 16);
- out[12 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 16);
- out[13 + outpos] = in[26 + inpos] | ((in[27 + inpos]) << 16);
- out[14 + outpos] = in[28 + inpos] | ((in[29 + inpos]) << 16);
- out[15 + outpos] = in[30 + inpos] | ((in[31 + inpos]) << 16);
+ out[8 + outpos] = ((in[17 + inpos] & 32767) >>> (15 - 14))
+ | ((in[18 + inpos] & 32767) << 14)
+ | ((in[19 + inpos]) << 29);
+ out[9 + outpos] = ((in[19 + inpos] & 32767) >>> (15 - 12))
+ | ((in[20 + inpos] & 32767) << 12)
+ | ((in[21 + inpos]) << 27);
+ out[10 + outpos] = ((in[21 + inpos] & 32767) >>> (15 - 10))
+ | ((in[22 + inpos] & 32767) << 10)
+ | ((in[23 + inpos]) << 25);
+ out[11 + outpos] = ((in[23 + inpos] & 32767) >>> (15 - 8))
+ | ((in[24 + inpos] & 32767) << 8)
+ | ((in[25 + inpos]) << 23);
+ out[12 + outpos] = ((in[25 + inpos] & 32767) >>> (15 - 6))
+ | ((in[26 + inpos] & 32767) << 6)
+ | ((in[27 + inpos]) << 21);
+ out[13 + outpos] = ((in[27 + inpos] & 32767) >>> (15 - 4))
+ | ((in[28 + inpos] & 32767) << 4)
+ | ((in[29 + inpos]) << 19);
+ out[14 + outpos] = ((in[29 + inpos] & 32767) >>> (15 - 2))
+ | ((in[30 + inpos] & 32767) << 2)
+ | ((in[31 + inpos]) << 17);
}
- protected static void fastpackwithoutmask17(final int[] in, int inpos,
+ protected static void fastpack16(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 17);
- out[1 + outpos] = ((in[1 + inpos]) >>> (17 - 2))
- | ((in[2 + inpos]) << 2) | ((in[3 + inpos]) << 19);
- out[2 + outpos] = ((in[3 + inpos]) >>> (17 - 4))
- | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 21);
- out[3 + outpos] = ((in[5 + inpos]) >>> (17 - 6))
- | ((in[6 + inpos]) << 6) | ((in[7 + inpos]) << 23);
- out[4 + outpos] = ((in[7 + inpos]) >>> (17 - 8))
- | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 25);
- out[5 + outpos] = ((in[9 + inpos]) >>> (17 - 10))
- | ((in[10 + inpos]) << 10) | ((in[11 + inpos]) << 27);
- out[6 + outpos] = ((in[11 + inpos]) >>> (17 - 12))
- | ((in[12 + inpos]) << 12) | ((in[13 + inpos]) << 29);
- out[7 + outpos] = ((in[13 + inpos]) >>> (17 - 14))
- | ((in[14 + inpos]) << 14) | ((in[15 + inpos]) << 31);
- out[8 + outpos] = ((in[15 + inpos]) >>> (17 - 16))
+ out[0 + outpos] = (in[0 + inpos] & 65535)
+ | ((in[1 + inpos]) << 16);
+ out[1 + outpos] = (in[2 + inpos] & 65535)
+ | ((in[3 + inpos]) << 16);
+ out[2 + outpos] = (in[4 + inpos] & 65535)
+ | ((in[5 + inpos]) << 16);
+ out[3 + outpos] = (in[6 + inpos] & 65535)
+ | ((in[7 + inpos]) << 16);
+ out[4 + outpos] = (in[8 + inpos] & 65535)
+ | ((in[9 + inpos]) << 16);
+ out[5 + outpos] = (in[10 + inpos] & 65535)
+ | ((in[11 + inpos]) << 16);
+ out[6 + outpos] = (in[12 + inpos] & 65535)
+ | ((in[13 + inpos]) << 16);
+ out[7 + outpos] = (in[14 + inpos] & 65535)
+ | ((in[15 + inpos]) << 16);
+ out[8 + outpos] = (in[16 + inpos] & 65535)
+ | ((in[17 + inpos]) << 16);
+ out[9 + outpos] = (in[18 + inpos] & 65535)
+ | ((in[19 + inpos]) << 16);
+ out[10 + outpos] = (in[20 + inpos] & 65535)
+ | ((in[21 + inpos]) << 16);
+ out[11 + outpos] = (in[22 + inpos] & 65535)
+ | ((in[23 + inpos]) << 16);
+ out[12 + outpos] = (in[24 + inpos] & 65535)
+ | ((in[25 + inpos]) << 16);
+ out[13 + outpos] = (in[26 + inpos] & 65535)
+ | ((in[27 + inpos]) << 16);
+ out[14 + outpos] = (in[28 + inpos] & 65535)
+ | ((in[29 + inpos]) << 16);
+ out[15 + outpos] = (in[30 + inpos] & 65535)
+ | ((in[31 + inpos]) << 16);
+ }
+
+ protected static void fastpack17(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] & 131071)
+ | ((in[1 + inpos]) << 17);
+ out[1 + outpos] = ((in[1 + inpos] & 131071) >>> (17 - 2))
+ | ((in[2 + inpos] & 131071) << 2)
+ | ((in[3 + inpos]) << 19);
+ out[2 + outpos] = ((in[3 + inpos] & 131071) >>> (17 - 4))
+ | ((in[4 + inpos] & 131071) << 4)
+ | ((in[5 + inpos]) << 21);
+ out[3 + outpos] = ((in[5 + inpos] & 131071) >>> (17 - 6))
+ | ((in[6 + inpos] & 131071) << 6)
+ | ((in[7 + inpos]) << 23);
+ out[4 + outpos] = ((in[7 + inpos] & 131071) >>> (17 - 8))
+ | ((in[8 + inpos] & 131071) << 8)
+ | ((in[9 + inpos]) << 25);
+ out[5 + outpos] = ((in[9 + inpos] & 131071) >>> (17 - 10))
+ | ((in[10 + inpos] & 131071) << 10)
+ | ((in[11 + inpos]) << 27);
+ out[6 + outpos] = ((in[11 + inpos] & 131071) >>> (17 - 12))
+ | ((in[12 + inpos] & 131071) << 12)
+ | ((in[13 + inpos]) << 29);
+ out[7 + outpos] = ((in[13 + inpos] & 131071) >>> (17 - 14))
+ | ((in[14 + inpos] & 131071) << 14)
+ | ((in[15 + inpos]) << 31);
+ out[8 + outpos] = ((in[15 + inpos] & 131071) >>> (17 - 16))
| ((in[16 + inpos]) << 16);
- out[9 + outpos] = ((in[16 + inpos]) >>> (17 - 1))
- | ((in[17 + inpos]) << 1) | ((in[18 + inpos]) << 18);
- out[10 + outpos] = ((in[18 + inpos]) >>> (17 - 3))
- | ((in[19 + inpos]) << 3) | ((in[20 + inpos]) << 20);
- out[11 + outpos] = ((in[20 + inpos]) >>> (17 - 5))
- | ((in[21 + inpos]) << 5) | ((in[22 + inpos]) << 22);
- out[12 + outpos] = ((in[22 + inpos]) >>> (17 - 7))
- | ((in[23 + inpos]) << 7) | ((in[24 + inpos]) << 24);
- out[13 + outpos] = ((in[24 + inpos]) >>> (17 - 9))
- | ((in[25 + inpos]) << 9) | ((in[26 + inpos]) << 26);
- out[14 + outpos] = ((in[26 + inpos]) >>> (17 - 11))
- | ((in[27 + inpos]) << 11) | ((in[28 + inpos]) << 28);
- out[15 + outpos] = ((in[28 + inpos]) >>> (17 - 13))
- | ((in[29 + inpos]) << 13) | ((in[30 + inpos]) << 30);
- out[16 + outpos] = ((in[30 + inpos]) >>> (17 - 15))
+ out[9 + outpos] = ((in[16 + inpos] & 131071) >>> (17 - 1))
+ | ((in[17 + inpos] & 131071) << 1)
+ | ((in[18 + inpos]) << 18);
+ out[10 + outpos] = ((in[18 + inpos] & 131071) >>> (17 - 3))
+ | ((in[19 + inpos] & 131071) << 3)
+ | ((in[20 + inpos]) << 20);
+ out[11 + outpos] = ((in[20 + inpos] & 131071) >>> (17 - 5))
+ | ((in[21 + inpos] & 131071) << 5)
+ | ((in[22 + inpos]) << 22);
+ out[12 + outpos] = ((in[22 + inpos] & 131071) >>> (17 - 7))
+ | ((in[23 + inpos] & 131071) << 7)
+ | ((in[24 + inpos]) << 24);
+ out[13 + outpos] = ((in[24 + inpos] & 131071) >>> (17 - 9))
+ | ((in[25 + inpos] & 131071) << 9)
+ | ((in[26 + inpos]) << 26);
+ out[14 + outpos] = ((in[26 + inpos] & 131071) >>> (17 - 11))
+ | ((in[27 + inpos] & 131071) << 11)
+ | ((in[28 + inpos]) << 28);
+ out[15 + outpos] = ((in[28 + inpos] & 131071) >>> (17 - 13))
+ | ((in[29 + inpos] & 131071) << 13)
+ | ((in[30 + inpos]) << 30);
+ out[16 + outpos] = ((in[30 + inpos] & 131071) >>> (17 - 15))
| ((in[31 + inpos]) << 15);
}
- protected static void fastpackwithoutmask18(final int[] in, int inpos,
+ protected static void fastpack18(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 18);
- out[1 + outpos] = ((in[1 + inpos]) >>> (18 - 4))
- | ((in[2 + inpos]) << 4) | ((in[3 + inpos]) << 22);
- out[2 + outpos] = ((in[3 + inpos]) >>> (18 - 8))
- | ((in[4 + inpos]) << 8) | ((in[5 + inpos]) << 26);
- out[3 + outpos] = ((in[5 + inpos]) >>> (18 - 12))
- | ((in[6 + inpos]) << 12) | ((in[7 + inpos]) << 30);
- out[4 + outpos] = ((in[7 + inpos]) >>> (18 - 16))
+ out[0 + outpos] = (in[0 + inpos] & 262143)
+ | ((in[1 + inpos]) << 18);
+ out[1 + outpos] = ((in[1 + inpos] & 262143) >>> (18 - 4))
+ | ((in[2 + inpos] & 262143) << 4)
+ | ((in[3 + inpos]) << 22);
+ out[2 + outpos] = ((in[3 + inpos] & 262143) >>> (18 - 8))
+ | ((in[4 + inpos] & 262143) << 8)
+ | ((in[5 + inpos]) << 26);
+ out[3 + outpos] = ((in[5 + inpos] & 262143) >>> (18 - 12))
+ | ((in[6 + inpos] & 262143) << 12)
+ | ((in[7 + inpos]) << 30);
+ out[4 + outpos] = ((in[7 + inpos] & 262143) >>> (18 - 16))
| ((in[8 + inpos]) << 16);
- out[5 + outpos] = ((in[8 + inpos]) >>> (18 - 2))
- | ((in[9 + inpos]) << 2) | ((in[10 + inpos]) << 20);
- out[6 + outpos] = ((in[10 + inpos]) >>> (18 - 6))
- | ((in[11 + inpos]) << 6) | ((in[12 + inpos]) << 24);
- out[7 + outpos] = ((in[12 + inpos]) >>> (18 - 10))
- | ((in[13 + inpos]) << 10) | ((in[14 + inpos]) << 28);
- out[8 + outpos] = ((in[14 + inpos]) >>> (18 - 14))
+ out[5 + outpos] = ((in[8 + inpos] & 262143) >>> (18 - 2))
+ | ((in[9 + inpos] & 262143) << 2)
+ | ((in[10 + inpos]) << 20);
+ out[6 + outpos] = ((in[10 + inpos] & 262143) >>> (18 - 6))
+ | ((in[11 + inpos] & 262143) << 6)
+ | ((in[12 + inpos]) << 24);
+ out[7 + outpos] = ((in[12 + inpos] & 262143) >>> (18 - 10))
+ | ((in[13 + inpos] & 262143) << 10)
+ | ((in[14 + inpos]) << 28);
+ out[8 + outpos] = ((in[14 + inpos] & 262143) >>> (18 - 14))
| ((in[15 + inpos]) << 14);
- out[9 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 18);
- out[10 + outpos] = ((in[17 + inpos]) >>> (18 - 4))
- | ((in[18 + inpos]) << 4) | ((in[19 + inpos]) << 22);
- out[11 + outpos] = ((in[19 + inpos]) >>> (18 - 8))
- | ((in[20 + inpos]) << 8) | ((in[21 + inpos]) << 26);
- out[12 + outpos] = ((in[21 + inpos]) >>> (18 - 12))
- | ((in[22 + inpos]) << 12) | ((in[23 + inpos]) << 30);
- out[13 + outpos] = ((in[23 + inpos]) >>> (18 - 16))
+ out[9 + outpos] = (in[16 + inpos] & 262143)
+ | ((in[17 + inpos]) << 18);
+ out[10 + outpos] = ((in[17 + inpos] & 262143) >>> (18 - 4))
+ | ((in[18 + inpos] & 262143) << 4)
+ | ((in[19 + inpos]) << 22);
+ out[11 + outpos] = ((in[19 + inpos] & 262143) >>> (18 - 8))
+ | ((in[20 + inpos] & 262143) << 8)
+ | ((in[21 + inpos]) << 26);
+ out[12 + outpos] = ((in[21 + inpos] & 262143) >>> (18 - 12))
+ | ((in[22 + inpos] & 262143) << 12)
+ | ((in[23 + inpos]) << 30);
+ out[13 + outpos] = ((in[23 + inpos] & 262143) >>> (18 - 16))
| ((in[24 + inpos]) << 16);
- out[14 + outpos] = ((in[24 + inpos]) >>> (18 - 2))
- | ((in[25 + inpos]) << 2) | ((in[26 + inpos]) << 20);
- out[15 + outpos] = ((in[26 + inpos]) >>> (18 - 6))
- | ((in[27 + inpos]) << 6) | ((in[28 + inpos]) << 24);
- out[16 + outpos] = ((in[28 + inpos]) >>> (18 - 10))
- | ((in[29 + inpos]) << 10) | ((in[30 + inpos]) << 28);
- out[17 + outpos] = ((in[30 + inpos]) >>> (18 - 14))
+ out[14 + outpos] = ((in[24 + inpos] & 262143) >>> (18 - 2))
+ | ((in[25 + inpos] & 262143) << 2)
+ | ((in[26 + inpos]) << 20);
+ out[15 + outpos] = ((in[26 + inpos] & 262143) >>> (18 - 6))
+ | ((in[27 + inpos] & 262143) << 6)
+ | ((in[28 + inpos]) << 24);
+ out[16 + outpos] = ((in[28 + inpos] & 262143) >>> (18 - 10))
+ | ((in[29 + inpos] & 262143) << 10)
+ | ((in[30 + inpos]) << 28);
+ out[17 + outpos] = ((in[30 + inpos] & 262143) >>> (18 - 14))
| ((in[31 + inpos]) << 14);
}
- protected static void fastpackwithoutmask19(final int[] in, int inpos,
+ protected static void fastpack19(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 19);
- out[1 + outpos] = ((in[1 + inpos]) >>> (19 - 6))
- | ((in[2 + inpos]) << 6) | ((in[3 + inpos]) << 25);
- out[2 + outpos] = ((in[3 + inpos]) >>> (19 - 12))
- | ((in[4 + inpos]) << 12) | ((in[5 + inpos]) << 31);
- out[3 + outpos] = ((in[5 + inpos]) >>> (19 - 18))
+ out[0 + outpos] = (in[0 + inpos] & 524287)
+ | ((in[1 + inpos]) << 19);
+ out[1 + outpos] = ((in[1 + inpos] & 524287) >>> (19 - 6))
+ | ((in[2 + inpos] & 524287) << 6)
+ | ((in[3 + inpos]) << 25);
+ out[2 + outpos] = ((in[3 + inpos] & 524287) >>> (19 - 12))
+ | ((in[4 + inpos] & 524287) << 12)
+ | ((in[5 + inpos]) << 31);
+ out[3 + outpos] = ((in[5 + inpos] & 524287) >>> (19 - 18))
| ((in[6 + inpos]) << 18);
- out[4 + outpos] = ((in[6 + inpos]) >>> (19 - 5))
- | ((in[7 + inpos]) << 5) | ((in[8 + inpos]) << 24);
- out[5 + outpos] = ((in[8 + inpos]) >>> (19 - 11))
- | ((in[9 + inpos]) << 11) | ((in[10 + inpos]) << 30);
- out[6 + outpos] = ((in[10 + inpos]) >>> (19 - 17))
+ out[4 + outpos] = ((in[6 + inpos] & 524287) >>> (19 - 5))
+ | ((in[7 + inpos] & 524287) << 5)
+ | ((in[8 + inpos]) << 24);
+ out[5 + outpos] = ((in[8 + inpos] & 524287) >>> (19 - 11))
+ | ((in[9 + inpos] & 524287) << 11)
+ | ((in[10 + inpos]) << 30);
+ out[6 + outpos] = ((in[10 + inpos] & 524287) >>> (19 - 17))
| ((in[11 + inpos]) << 17);
- out[7 + outpos] = ((in[11 + inpos]) >>> (19 - 4))
- | ((in[12 + inpos]) << 4) | ((in[13 + inpos]) << 23);
- out[8 + outpos] = ((in[13 + inpos]) >>> (19 - 10))
- | ((in[14 + inpos]) << 10) | ((in[15 + inpos]) << 29);
- out[9 + outpos] = ((in[15 + inpos]) >>> (19 - 16))
+ out[7 + outpos] = ((in[11 + inpos] & 524287) >>> (19 - 4))
+ | ((in[12 + inpos] & 524287) << 4)
+ | ((in[13 + inpos]) << 23);
+ out[8 + outpos] = ((in[13 + inpos] & 524287) >>> (19 - 10))
+ | ((in[14 + inpos] & 524287) << 10)
+ | ((in[15 + inpos]) << 29);
+ out[9 + outpos] = ((in[15 + inpos] & 524287) >>> (19 - 16))
| ((in[16 + inpos]) << 16);
- out[10 + outpos] = ((in[16 + inpos]) >>> (19 - 3))
- | ((in[17 + inpos]) << 3) | ((in[18 + inpos]) << 22);
- out[11 + outpos] = ((in[18 + inpos]) >>> (19 - 9))
- | ((in[19 + inpos]) << 9) | ((in[20 + inpos]) << 28);
- out[12 + outpos] = ((in[20 + inpos]) >>> (19 - 15))
+ out[10 + outpos] = ((in[16 + inpos] & 524287) >>> (19 - 3))
+ | ((in[17 + inpos] & 524287) << 3)
+ | ((in[18 + inpos]) << 22);
+ out[11 + outpos] = ((in[18 + inpos] & 524287) >>> (19 - 9))
+ | ((in[19 + inpos] & 524287) << 9)
+ | ((in[20 + inpos]) << 28);
+ out[12 + outpos] = ((in[20 + inpos] & 524287) >>> (19 - 15))
| ((in[21 + inpos]) << 15);
- out[13 + outpos] = ((in[21 + inpos]) >>> (19 - 2))
- | ((in[22 + inpos]) << 2) | ((in[23 + inpos]) << 21);
- out[14 + outpos] = ((in[23 + inpos]) >>> (19 - 8))
- | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 27);
- out[15 + outpos] = ((in[25 + inpos]) >>> (19 - 14))
+ out[13 + outpos] = ((in[21 + inpos] & 524287) >>> (19 - 2))
+ | ((in[22 + inpos] & 524287) << 2)
+ | ((in[23 + inpos]) << 21);
+ out[14 + outpos] = ((in[23 + inpos] & 524287) >>> (19 - 8))
+ | ((in[24 + inpos] & 524287) << 8)
+ | ((in[25 + inpos]) << 27);
+ out[15 + outpos] = ((in[25 + inpos] & 524287) >>> (19 - 14))
| ((in[26 + inpos]) << 14);
- out[16 + outpos] = ((in[26 + inpos]) >>> (19 - 1))
- | ((in[27 + inpos]) << 1) | ((in[28 + inpos]) << 20);
- out[17 + outpos] = ((in[28 + inpos]) >>> (19 - 7))
- | ((in[29 + inpos]) << 7) | ((in[30 + inpos]) << 26);
- out[18 + outpos] = ((in[30 + inpos]) >>> (19 - 13))
- | ((in[31 + inpos]) << 13);
- }
-
- protected static void fastpackwithoutmask20(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 20);
- out[1 + outpos] = ((in[1 + inpos]) >>> (20 - 8))
- | ((in[2 + inpos]) << 8) | ((in[3 + inpos]) << 28);
- out[2 + outpos] = ((in[3 + inpos]) >>> (20 - 16))
+ out[16 + outpos] = ((in[26 + inpos] & 524287) >>> (19 - 1))
+ | ((in[27 + inpos] & 524287) << 1)
+ | ((in[28 + inpos]) << 20);
+ out[17 + outpos] = ((in[28 + inpos] & 524287) >>> (19 - 7))
+ | ((in[29 + inpos] & 524287) << 7)
+ | ((in[30 + inpos]) << 26);
+ out[18 + outpos] = ((in[30 + inpos] & 524287) >>> (19 - 13))
+ | ((in[31 + inpos]) << 13);
+ }
+
+ protected static void fastpack2(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] & 3)
+ | ((in[1 + inpos] & 3) << 2)
+ | ((in[2 + inpos] & 3) << 4)
+ | ((in[3 + inpos] & 3) << 6)
+ | ((in[4 + inpos] & 3) << 8)
+ | ((in[5 + inpos] & 3) << 10)
+ | ((in[6 + inpos] & 3) << 12)
+ | ((in[7 + inpos] & 3) << 14)
+ | ((in[8 + inpos] & 3) << 16)
+ | ((in[9 + inpos] & 3) << 18)
+ | ((in[10 + inpos] & 3) << 20)
+ | ((in[11 + inpos] & 3) << 22)
+ | ((in[12 + inpos] & 3) << 24)
+ | ((in[13 + inpos] & 3) << 26)
+ | ((in[14 + inpos] & 3) << 28)
+ | ((in[15 + inpos]) << 30);
+ out[1 + outpos] = (in[16 + inpos] & 3)
+ | ((in[17 + inpos] & 3) << 2)
+ | ((in[18 + inpos] & 3) << 4)
+ | ((in[19 + inpos] & 3) << 6)
+ | ((in[20 + inpos] & 3) << 8)
+ | ((in[21 + inpos] & 3) << 10)
+ | ((in[22 + inpos] & 3) << 12)
+ | ((in[23 + inpos] & 3) << 14)
+ | ((in[24 + inpos] & 3) << 16)
+ | ((in[25 + inpos] & 3) << 18)
+ | ((in[26 + inpos] & 3) << 20)
+ | ((in[27 + inpos] & 3) << 22)
+ | ((in[28 + inpos] & 3) << 24)
+ | ((in[29 + inpos] & 3) << 26)
+ | ((in[30 + inpos] & 3) << 28)
+ | ((in[31 + inpos]) << 30);
+ }
+
+ protected static void fastpack20(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] & 1048575)
+ | ((in[1 + inpos]) << 20);
+ out[1 + outpos] = ((in[1 + inpos] & 1048575) >>> (20 - 8))
+ | ((in[2 + inpos] & 1048575) << 8)
+ | ((in[3 + inpos]) << 28);
+ out[2 + outpos] = ((in[3 + inpos] & 1048575) >>> (20 - 16))
| ((in[4 + inpos]) << 16);
- out[3 + outpos] = ((in[4 + inpos]) >>> (20 - 4))
- | ((in[5 + inpos]) << 4) | ((in[6 + inpos]) << 24);
- out[4 + outpos] = ((in[6 + inpos]) >>> (20 - 12))
+ out[3 + outpos] = ((in[4 + inpos] & 1048575) >>> (20 - 4))
+ | ((in[5 + inpos] & 1048575) << 4)
+ | ((in[6 + inpos]) << 24);
+ out[4 + outpos] = ((in[6 + inpos] & 1048575) >>> (20 - 12))
| ((in[7 + inpos]) << 12);
- out[5 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 20);
- out[6 + outpos] = ((in[9 + inpos]) >>> (20 - 8))
- | ((in[10 + inpos]) << 8) | ((in[11 + inpos]) << 28);
- out[7 + outpos] = ((in[11 + inpos]) >>> (20 - 16))
+ out[5 + outpos] = (in[8 + inpos] & 1048575)
+ | ((in[9 + inpos]) << 20);
+ out[6 + outpos] = ((in[9 + inpos] & 1048575) >>> (20 - 8))
+ | ((in[10 + inpos] & 1048575) << 8)
+ | ((in[11 + inpos]) << 28);
+ out[7 + outpos] = ((in[11 + inpos] & 1048575) >>> (20 - 16))
| ((in[12 + inpos]) << 16);
- out[8 + outpos] = ((in[12 + inpos]) >>> (20 - 4))
- | ((in[13 + inpos]) << 4) | ((in[14 + inpos]) << 24);
- out[9 + outpos] = ((in[14 + inpos]) >>> (20 - 12))
+ out[8 + outpos] = ((in[12 + inpos] & 1048575) >>> (20 - 4))
+ | ((in[13 + inpos] & 1048575) << 4)
+ | ((in[14 + inpos]) << 24);
+ out[9 + outpos] = ((in[14 + inpos] & 1048575) >>> (20 - 12))
| ((in[15 + inpos]) << 12);
- out[10 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 20);
- out[11 + outpos] = ((in[17 + inpos]) >>> (20 - 8))
- | ((in[18 + inpos]) << 8) | ((in[19 + inpos]) << 28);
- out[12 + outpos] = ((in[19 + inpos]) >>> (20 - 16))
+ out[10 + outpos] = (in[16 + inpos] & 1048575)
+ | ((in[17 + inpos]) << 20);
+ out[11 + outpos] = ((in[17 + inpos] & 1048575) >>> (20 - 8))
+ | ((in[18 + inpos] & 1048575) << 8)
+ | ((in[19 + inpos]) << 28);
+ out[12 + outpos] = ((in[19 + inpos] & 1048575) >>> (20 - 16))
| ((in[20 + inpos]) << 16);
- out[13 + outpos] = ((in[20 + inpos]) >>> (20 - 4))
- | ((in[21 + inpos]) << 4) | ((in[22 + inpos]) << 24);
- out[14 + outpos] = ((in[22 + inpos]) >>> (20 - 12))
+ out[13 + outpos] = ((in[20 + inpos] & 1048575) >>> (20 - 4))
+ | ((in[21 + inpos] & 1048575) << 4)
+ | ((in[22 + inpos]) << 24);
+ out[14 + outpos] = ((in[22 + inpos] & 1048575) >>> (20 - 12))
| ((in[23 + inpos]) << 12);
- out[15 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 20);
- out[16 + outpos] = ((in[25 + inpos]) >>> (20 - 8))
- | ((in[26 + inpos]) << 8) | ((in[27 + inpos]) << 28);
- out[17 + outpos] = ((in[27 + inpos]) >>> (20 - 16))
+ out[15 + outpos] = (in[24 + inpos] & 1048575)
+ | ((in[25 + inpos]) << 20);
+ out[16 + outpos] = ((in[25 + inpos] & 1048575) >>> (20 - 8))
+ | ((in[26 + inpos] & 1048575) << 8)
+ | ((in[27 + inpos]) << 28);
+ out[17 + outpos] = ((in[27 + inpos] & 1048575) >>> (20 - 16))
| ((in[28 + inpos]) << 16);
- out[18 + outpos] = ((in[28 + inpos]) >>> (20 - 4))
- | ((in[29 + inpos]) << 4) | ((in[30 + inpos]) << 24);
- out[19 + outpos] = ((in[30 + inpos]) >>> (20 - 12))
+ out[18 + outpos] = ((in[28 + inpos] & 1048575) >>> (20 - 4))
+ | ((in[29 + inpos] & 1048575) << 4)
+ | ((in[30 + inpos]) << 24);
+ out[19 + outpos] = ((in[30 + inpos] & 1048575) >>> (20 - 12))
| ((in[31 + inpos]) << 12);
}
- protected static void fastpackwithoutmask21(final int[] in, int inpos,
+ protected static void fastpack21(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 21);
- out[1 + outpos] = ((in[1 + inpos]) >>> (21 - 10))
- | ((in[2 + inpos]) << 10) | ((in[3 + inpos]) << 31);
- out[2 + outpos] = ((in[3 + inpos]) >>> (21 - 20))
+ out[0 + outpos] = (in[0 + inpos] & 2097151)
+ | ((in[1 + inpos]) << 21);
+ out[1 + outpos] = ((in[1 + inpos] & 2097151) >>> (21 - 10))
+ | ((in[2 + inpos] & 2097151) << 10)
+ | ((in[3 + inpos]) << 31);
+ out[2 + outpos] = ((in[3 + inpos] & 2097151) >>> (21 - 20))
| ((in[4 + inpos]) << 20);
- out[3 + outpos] = ((in[4 + inpos]) >>> (21 - 9))
- | ((in[5 + inpos]) << 9) | ((in[6 + inpos]) << 30);
- out[4 + outpos] = ((in[6 + inpos]) >>> (21 - 19))
+ out[3 + outpos] = ((in[4 + inpos] & 2097151) >>> (21 - 9))
+ | ((in[5 + inpos] & 2097151) << 9)
+ | ((in[6 + inpos]) << 30);
+ out[4 + outpos] = ((in[6 + inpos] & 2097151) >>> (21 - 19))
| ((in[7 + inpos]) << 19);
- out[5 + outpos] = ((in[7 + inpos]) >>> (21 - 8))
- | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 29);
- out[6 + outpos] = ((in[9 + inpos]) >>> (21 - 18))
+ out[5 + outpos] = ((in[7 + inpos] & 2097151) >>> (21 - 8))
+ | ((in[8 + inpos] & 2097151) << 8)
+ | ((in[9 + inpos]) << 29);
+ out[6 + outpos] = ((in[9 + inpos] & 2097151) >>> (21 - 18))
| ((in[10 + inpos]) << 18);
- out[7 + outpos] = ((in[10 + inpos]) >>> (21 - 7))
- | ((in[11 + inpos]) << 7) | ((in[12 + inpos]) << 28);
- out[8 + outpos] = ((in[12 + inpos]) >>> (21 - 17))
+ out[7 + outpos] = ((in[10 + inpos] & 2097151) >>> (21 - 7))
+ | ((in[11 + inpos] & 2097151) << 7)
+ | ((in[12 + inpos]) << 28);
+ out[8 + outpos] = ((in[12 + inpos] & 2097151) >>> (21 - 17))
| ((in[13 + inpos]) << 17);
- out[9 + outpos] = ((in[13 + inpos]) >>> (21 - 6))
- | ((in[14 + inpos]) << 6) | ((in[15 + inpos]) << 27);
- out[10 + outpos] = ((in[15 + inpos]) >>> (21 - 16))
+ out[9 + outpos] = ((in[13 + inpos] & 2097151) >>> (21 - 6))
+ | ((in[14 + inpos] & 2097151) << 6)
+ | ((in[15 + inpos]) << 27);
+ out[10 + outpos] = ((in[15 + inpos] & 2097151) >>> (21 - 16))
| ((in[16 + inpos]) << 16);
- out[11 + outpos] = ((in[16 + inpos]) >>> (21 - 5))
- | ((in[17 + inpos]) << 5) | ((in[18 + inpos]) << 26);
- out[12 + outpos] = ((in[18 + inpos]) >>> (21 - 15))
+ out[11 + outpos] = ((in[16 + inpos] & 2097151) >>> (21 - 5))
+ | ((in[17 + inpos] & 2097151) << 5)
+ | ((in[18 + inpos]) << 26);
+ out[12 + outpos] = ((in[18 + inpos] & 2097151) >>> (21 - 15))
| ((in[19 + inpos]) << 15);
- out[13 + outpos] = ((in[19 + inpos]) >>> (21 - 4))
- | ((in[20 + inpos]) << 4) | ((in[21 + inpos]) << 25);
- out[14 + outpos] = ((in[21 + inpos]) >>> (21 - 14))
+ out[13 + outpos] = ((in[19 + inpos] & 2097151) >>> (21 - 4))
+ | ((in[20 + inpos] & 2097151) << 4)
+ | ((in[21 + inpos]) << 25);
+ out[14 + outpos] = ((in[21 + inpos] & 2097151) >>> (21 - 14))
| ((in[22 + inpos]) << 14);
- out[15 + outpos] = ((in[22 + inpos]) >>> (21 - 3))
- | ((in[23 + inpos]) << 3) | ((in[24 + inpos]) << 24);
- out[16 + outpos] = ((in[24 + inpos]) >>> (21 - 13))
+ out[15 + outpos] = ((in[22 + inpos] & 2097151) >>> (21 - 3))
+ | ((in[23 + inpos] & 2097151) << 3)
+ | ((in[24 + inpos]) << 24);
+ out[16 + outpos] = ((in[24 + inpos] & 2097151) >>> (21 - 13))
| ((in[25 + inpos]) << 13);
- out[17 + outpos] = ((in[25 + inpos]) >>> (21 - 2))
- | ((in[26 + inpos]) << 2) | ((in[27 + inpos]) << 23);
- out[18 + outpos] = ((in[27 + inpos]) >>> (21 - 12))
+ out[17 + outpos] = ((in[25 + inpos] & 2097151) >>> (21 - 2))
+ | ((in[26 + inpos] & 2097151) << 2)
+ | ((in[27 + inpos]) << 23);
+ out[18 + outpos] = ((in[27 + inpos] & 2097151) >>> (21 - 12))
| ((in[28 + inpos]) << 12);
- out[19 + outpos] = ((in[28 + inpos]) >>> (21 - 1))
- | ((in[29 + inpos]) << 1) | ((in[30 + inpos]) << 22);
- out[20 + outpos] = ((in[30 + inpos]) >>> (21 - 11))
+ out[19 + outpos] = ((in[28 + inpos] & 2097151) >>> (21 - 1))
+ | ((in[29 + inpos] & 2097151) << 1)
+ | ((in[30 + inpos]) << 22);
+ out[20 + outpos] = ((in[30 + inpos] & 2097151) >>> (21 - 11))
| ((in[31 + inpos]) << 11);
}
- protected static void fastpackwithoutmask22(final int[] in, int inpos,
+ protected static void fastpack22(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 22);
- out[1 + outpos] = ((in[1 + inpos]) >>> (22 - 12))
+ out[0 + outpos] = (in[0 + inpos] & 4194303)
+ | ((in[1 + inpos]) << 22);
+ out[1 + outpos] = ((in[1 + inpos] & 4194303) >>> (22 - 12))
| ((in[2 + inpos]) << 12);
- out[2 + outpos] = ((in[2 + inpos]) >>> (22 - 2))
- | ((in[3 + inpos]) << 2) | ((in[4 + inpos]) << 24);
- out[3 + outpos] = ((in[4 + inpos]) >>> (22 - 14))
+ out[2 + outpos] = ((in[2 + inpos] & 4194303) >>> (22 - 2))
+ | ((in[3 + inpos] & 4194303) << 2)
+ | ((in[4 + inpos]) << 24);
+ out[3 + outpos] = ((in[4 + inpos] & 4194303) >>> (22 - 14))
| ((in[5 + inpos]) << 14);
- out[4 + outpos] = ((in[5 + inpos]) >>> (22 - 4))
- | ((in[6 + inpos]) << 4) | ((in[7 + inpos]) << 26);
- out[5 + outpos] = ((in[7 + inpos]) >>> (22 - 16))
+ out[4 + outpos] = ((in[5 + inpos] & 4194303) >>> (22 - 4))
+ | ((in[6 + inpos] & 4194303) << 4)
+ | ((in[7 + inpos]) << 26);
+ out[5 + outpos] = ((in[7 + inpos] & 4194303) >>> (22 - 16))
| ((in[8 + inpos]) << 16);
- out[6 + outpos] = ((in[8 + inpos]) >>> (22 - 6))
- | ((in[9 + inpos]) << 6) | ((in[10 + inpos]) << 28);
- out[7 + outpos] = ((in[10 + inpos]) >>> (22 - 18))
+ out[6 + outpos] = ((in[8 + inpos] & 4194303) >>> (22 - 6))
+ | ((in[9 + inpos] & 4194303) << 6)
+ | ((in[10 + inpos]) << 28);
+ out[7 + outpos] = ((in[10 + inpos] & 4194303) >>> (22 - 18))
| ((in[11 + inpos]) << 18);
- out[8 + outpos] = ((in[11 + inpos]) >>> (22 - 8))
- | ((in[12 + inpos]) << 8) | ((in[13 + inpos]) << 30);
- out[9 + outpos] = ((in[13 + inpos]) >>> (22 - 20))
+ out[8 + outpos] = ((in[11 + inpos] & 4194303) >>> (22 - 8))
+ | ((in[12 + inpos] & 4194303) << 8)
+ | ((in[13 + inpos]) << 30);
+ out[9 + outpos] = ((in[13 + inpos] & 4194303) >>> (22 - 20))
| ((in[14 + inpos]) << 20);
- out[10 + outpos] = ((in[14 + inpos]) >>> (22 - 10))
+ out[10 + outpos] = ((in[14 + inpos] & 4194303) >>> (22 - 10))
| ((in[15 + inpos]) << 10);
- out[11 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 22);
- out[12 + outpos] = ((in[17 + inpos]) >>> (22 - 12))
+ out[11 + outpos] = (in[16 + inpos] & 4194303)
+ | ((in[17 + inpos]) << 22);
+ out[12 + outpos] = ((in[17 + inpos] & 4194303) >>> (22 - 12))
| ((in[18 + inpos]) << 12);
- out[13 + outpos] = ((in[18 + inpos]) >>> (22 - 2))
- | ((in[19 + inpos]) << 2) | ((in[20 + inpos]) << 24);
- out[14 + outpos] = ((in[20 + inpos]) >>> (22 - 14))
+ out[13 + outpos] = ((in[18 + inpos] & 4194303) >>> (22 - 2))
+ | ((in[19 + inpos] & 4194303) << 2)
+ | ((in[20 + inpos]) << 24);
+ out[14 + outpos] = ((in[20 + inpos] & 4194303) >>> (22 - 14))
| ((in[21 + inpos]) << 14);
- out[15 + outpos] = ((in[21 + inpos]) >>> (22 - 4))
- | ((in[22 + inpos]) << 4) | ((in[23 + inpos]) << 26);
- out[16 + outpos] = ((in[23 + inpos]) >>> (22 - 16))
+ out[15 + outpos] = ((in[21 + inpos] & 4194303) >>> (22 - 4))
+ | ((in[22 + inpos] & 4194303) << 4)
+ | ((in[23 + inpos]) << 26);
+ out[16 + outpos] = ((in[23 + inpos] & 4194303) >>> (22 - 16))
| ((in[24 + inpos]) << 16);
- out[17 + outpos] = ((in[24 + inpos]) >>> (22 - 6))
- | ((in[25 + inpos]) << 6) | ((in[26 + inpos]) << 28);
- out[18 + outpos] = ((in[26 + inpos]) >>> (22 - 18))
+ out[17 + outpos] = ((in[24 + inpos] & 4194303) >>> (22 - 6))
+ | ((in[25 + inpos] & 4194303) << 6)
+ | ((in[26 + inpos]) << 28);
+ out[18 + outpos] = ((in[26 + inpos] & 4194303) >>> (22 - 18))
| ((in[27 + inpos]) << 18);
- out[19 + outpos] = ((in[27 + inpos]) >>> (22 - 8))
- | ((in[28 + inpos]) << 8) | ((in[29 + inpos]) << 30);
- out[20 + outpos] = ((in[29 + inpos]) >>> (22 - 20))
+ out[19 + outpos] = ((in[27 + inpos] & 4194303) >>> (22 - 8))
+ | ((in[28 + inpos] & 4194303) << 8)
+ | ((in[29 + inpos]) << 30);
+ out[20 + outpos] = ((in[29 + inpos] & 4194303) >>> (22 - 20))
| ((in[30 + inpos]) << 20);
- out[21 + outpos] = ((in[30 + inpos]) >>> (22 - 10))
+ out[21 + outpos] = ((in[30 + inpos] & 4194303) >>> (22 - 10))
| ((in[31 + inpos]) << 10);
}
- protected static void fastpackwithoutmask23(final int[] in, int inpos,
+ protected static void fastpack23(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 23);
- out[1 + outpos] = ((in[1 + inpos]) >>> (23 - 14))
+ out[0 + outpos] = (in[0 + inpos] & 8388607)
+ | ((in[1 + inpos]) << 23);
+ out[1 + outpos] = ((in[1 + inpos] & 8388607) >>> (23 - 14))
| ((in[2 + inpos]) << 14);
- out[2 + outpos] = ((in[2 + inpos]) >>> (23 - 5))
- | ((in[3 + inpos]) << 5) | ((in[4 + inpos]) << 28);
- out[3 + outpos] = ((in[4 + inpos]) >>> (23 - 19))
+ out[2 + outpos] = ((in[2 + inpos] & 8388607) >>> (23 - 5))
+ | ((in[3 + inpos] & 8388607) << 5)
+ | ((in[4 + inpos]) << 28);
+ out[3 + outpos] = ((in[4 + inpos] & 8388607) >>> (23 - 19))
| ((in[5 + inpos]) << 19);
- out[4 + outpos] = ((in[5 + inpos]) >>> (23 - 10))
+ out[4 + outpos] = ((in[5 + inpos] & 8388607) >>> (23 - 10))
| ((in[6 + inpos]) << 10);
- out[5 + outpos] = ((in[6 + inpos]) >>> (23 - 1))
- | ((in[7 + inpos]) << 1) | ((in[8 + inpos]) << 24);
- out[6 + outpos] = ((in[8 + inpos]) >>> (23 - 15))
+ out[5 + outpos] = ((in[6 + inpos] & 8388607) >>> (23 - 1))
+ | ((in[7 + inpos] & 8388607) << 1)
+ | ((in[8 + inpos]) << 24);
+ out[6 + outpos] = ((in[8 + inpos] & 8388607) >>> (23 - 15))
| ((in[9 + inpos]) << 15);
- out[7 + outpos] = ((in[9 + inpos]) >>> (23 - 6))
- | ((in[10 + inpos]) << 6) | ((in[11 + inpos]) << 29);
- out[8 + outpos] = ((in[11 + inpos]) >>> (23 - 20))
+ out[7 + outpos] = ((in[9 + inpos] & 8388607) >>> (23 - 6))
+ | ((in[10 + inpos] & 8388607) << 6)
+ | ((in[11 + inpos]) << 29);
+ out[8 + outpos] = ((in[11 + inpos] & 8388607) >>> (23 - 20))
| ((in[12 + inpos]) << 20);
- out[9 + outpos] = ((in[12 + inpos]) >>> (23 - 11))
+ out[9 + outpos] = ((in[12 + inpos] & 8388607) >>> (23 - 11))
| ((in[13 + inpos]) << 11);
- out[10 + outpos] = ((in[13 + inpos]) >>> (23 - 2))
- | ((in[14 + inpos]) << 2) | ((in[15 + inpos]) << 25);
- out[11 + outpos] = ((in[15 + inpos]) >>> (23 - 16))
+ out[10 + outpos] = ((in[13 + inpos] & 8388607) >>> (23 - 2))
+ | ((in[14 + inpos] & 8388607) << 2)
+ | ((in[15 + inpos]) << 25);
+ out[11 + outpos] = ((in[15 + inpos] & 8388607) >>> (23 - 16))
| ((in[16 + inpos]) << 16);
- out[12 + outpos] = ((in[16 + inpos]) >>> (23 - 7))
- | ((in[17 + inpos]) << 7) | ((in[18 + inpos]) << 30);
- out[13 + outpos] = ((in[18 + inpos]) >>> (23 - 21))
+ out[12 + outpos] = ((in[16 + inpos] & 8388607) >>> (23 - 7))
+ | ((in[17 + inpos] & 8388607) << 7)
+ | ((in[18 + inpos]) << 30);
+ out[13 + outpos] = ((in[18 + inpos] & 8388607) >>> (23 - 21))
| ((in[19 + inpos]) << 21);
- out[14 + outpos] = ((in[19 + inpos]) >>> (23 - 12))
+ out[14 + outpos] = ((in[19 + inpos] & 8388607) >>> (23 - 12))
| ((in[20 + inpos]) << 12);
- out[15 + outpos] = ((in[20 + inpos]) >>> (23 - 3))
- | ((in[21 + inpos]) << 3) | ((in[22 + inpos]) << 26);
- out[16 + outpos] = ((in[22 + inpos]) >>> (23 - 17))
+ out[15 + outpos] = ((in[20 + inpos] & 8388607) >>> (23 - 3))
+ | ((in[21 + inpos] & 8388607) << 3)
+ | ((in[22 + inpos]) << 26);
+ out[16 + outpos] = ((in[22 + inpos] & 8388607) >>> (23 - 17))
| ((in[23 + inpos]) << 17);
- out[17 + outpos] = ((in[23 + inpos]) >>> (23 - 8))
- | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 31);
- out[18 + outpos] = ((in[25 + inpos]) >>> (23 - 22))
+ out[17 + outpos] = ((in[23 + inpos] & 8388607) >>> (23 - 8))
+ | ((in[24 + inpos] & 8388607) << 8)
+ | ((in[25 + inpos]) << 31);
+ out[18 + outpos] = ((in[25 + inpos] & 8388607) >>> (23 - 22))
| ((in[26 + inpos]) << 22);
- out[19 + outpos] = ((in[26 + inpos]) >>> (23 - 13))
+ out[19 + outpos] = ((in[26 + inpos] & 8388607) >>> (23 - 13))
| ((in[27 + inpos]) << 13);
- out[20 + outpos] = ((in[27 + inpos]) >>> (23 - 4))
- | ((in[28 + inpos]) << 4) | ((in[29 + inpos]) << 27);
- out[21 + outpos] = ((in[29 + inpos]) >>> (23 - 18))
+ out[20 + outpos] = ((in[27 + inpos] & 8388607) >>> (23 - 4))
+ | ((in[28 + inpos] & 8388607) << 4)
+ | ((in[29 + inpos]) << 27);
+ out[21 + outpos] = ((in[29 + inpos] & 8388607) >>> (23 - 18))
| ((in[30 + inpos]) << 18);
- out[22 + outpos] = ((in[30 + inpos]) >>> (23 - 9))
+ out[22 + outpos] = ((in[30 + inpos] & 8388607) >>> (23 - 9))
| ((in[31 + inpos]) << 9);
}
- protected static void fastpackwithoutmask24(final int[] in, int inpos,
+ protected static void fastpack24(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 24);
- out[1 + outpos] = ((in[1 + inpos]) >>> (24 - 16))
+ out[0 + outpos] = (in[0 + inpos] & 16777215)
+ | ((in[1 + inpos]) << 24);
+ out[1 + outpos] = ((in[1 + inpos] & 16777215) >>> (24 - 16))
| ((in[2 + inpos]) << 16);
- out[2 + outpos] = ((in[2 + inpos]) >>> (24 - 8))
+ out[2 + outpos] = ((in[2 + inpos] & 16777215) >>> (24 - 8))
| ((in[3 + inpos]) << 8);
- out[3 + outpos] = in[4 + inpos] | ((in[5 + inpos]) << 24);
- out[4 + outpos] = ((in[5 + inpos]) >>> (24 - 16))
+ out[3 + outpos] = (in[4 + inpos] & 16777215)
+ | ((in[5 + inpos]) << 24);
+ out[4 + outpos] = ((in[5 + inpos] & 16777215) >>> (24 - 16))
| ((in[6 + inpos]) << 16);
- out[5 + outpos] = ((in[6 + inpos]) >>> (24 - 8))
+ out[5 + outpos] = ((in[6 + inpos] & 16777215) >>> (24 - 8))
| ((in[7 + inpos]) << 8);
- out[6 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 24);
- out[7 + outpos] = ((in[9 + inpos]) >>> (24 - 16))
+ out[6 + outpos] = (in[8 + inpos] & 16777215)
+ | ((in[9 + inpos]) << 24);
+ out[7 + outpos] = ((in[9 + inpos] & 16777215) >>> (24 - 16))
| ((in[10 + inpos]) << 16);
- out[8 + outpos] = ((in[10 + inpos]) >>> (24 - 8))
+ out[8 + outpos] = ((in[10 + inpos] & 16777215) >>> (24 - 8))
| ((in[11 + inpos]) << 8);
- out[9 + outpos] = in[12 + inpos] | ((in[13 + inpos]) << 24);
- out[10 + outpos] = ((in[13 + inpos]) >>> (24 - 16))
+ out[9 + outpos] = (in[12 + inpos] & 16777215)
+ | ((in[13 + inpos]) << 24);
+ out[10 + outpos] = ((in[13 + inpos] & 16777215) >>> (24 - 16))
| ((in[14 + inpos]) << 16);
- out[11 + outpos] = ((in[14 + inpos]) >>> (24 - 8))
+ out[11 + outpos] = ((in[14 + inpos] & 16777215) >>> (24 - 8))
| ((in[15 + inpos]) << 8);
- out[12 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 24);
- out[13 + outpos] = ((in[17 + inpos]) >>> (24 - 16))
+ out[12 + outpos] = (in[16 + inpos] & 16777215)
+ | ((in[17 + inpos]) << 24);
+ out[13 + outpos] = ((in[17 + inpos] & 16777215) >>> (24 - 16))
| ((in[18 + inpos]) << 16);
- out[14 + outpos] = ((in[18 + inpos]) >>> (24 - 8))
+ out[14 + outpos] = ((in[18 + inpos] & 16777215) >>> (24 - 8))
| ((in[19 + inpos]) << 8);
- out[15 + outpos] = in[20 + inpos] | ((in[21 + inpos]) << 24);
- out[16 + outpos] = ((in[21 + inpos]) >>> (24 - 16))
+ out[15 + outpos] = (in[20 + inpos] & 16777215)
+ | ((in[21 + inpos]) << 24);
+ out[16 + outpos] = ((in[21 + inpos] & 16777215) >>> (24 - 16))
| ((in[22 + inpos]) << 16);
- out[17 + outpos] = ((in[22 + inpos]) >>> (24 - 8))
+ out[17 + outpos] = ((in[22 + inpos] & 16777215) >>> (24 - 8))
| ((in[23 + inpos]) << 8);
- out[18 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 24);
- out[19 + outpos] = ((in[25 + inpos]) >>> (24 - 16))
+ out[18 + outpos] = (in[24 + inpos] & 16777215)
+ | ((in[25 + inpos]) << 24);
+ out[19 + outpos] = ((in[25 + inpos] & 16777215) >>> (24 - 16))
| ((in[26 + inpos]) << 16);
- out[20 + outpos] = ((in[26 + inpos]) >>> (24 - 8))
+ out[20 + outpos] = ((in[26 + inpos] & 16777215) >>> (24 - 8))
| ((in[27 + inpos]) << 8);
- out[21 + outpos] = in[28 + inpos] | ((in[29 + inpos]) << 24);
- out[22 + outpos] = ((in[29 + inpos]) >>> (24 - 16))
+ out[21 + outpos] = (in[28 + inpos] & 16777215)
+ | ((in[29 + inpos]) << 24);
+ out[22 + outpos] = ((in[29 + inpos] & 16777215) >>> (24 - 16))
| ((in[30 + inpos]) << 16);
- out[23 + outpos] = ((in[30 + inpos]) >>> (24 - 8))
+ out[23 + outpos] = ((in[30 + inpos] & 16777215) >>> (24 - 8))
| ((in[31 + inpos]) << 8);
}
- protected static void fastpackwithoutmask25(final int[] in, int inpos,
+ protected static void fastpack25(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 25);
- out[1 + outpos] = ((in[1 + inpos]) >>> (25 - 18))
+ out[0 + outpos] = (in[0 + inpos] & 33554431)
+ | ((in[1 + inpos]) << 25);
+ out[1 + outpos] = ((in[1 + inpos] & 33554431) >>> (25 - 18))
| ((in[2 + inpos]) << 18);
- out[2 + outpos] = ((in[2 + inpos]) >>> (25 - 11))
+ out[2 + outpos] = ((in[2 + inpos] & 33554431) >>> (25 - 11))
| ((in[3 + inpos]) << 11);
- out[3 + outpos] = ((in[3 + inpos]) >>> (25 - 4))
- | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 29);
- out[4 + outpos] = ((in[5 + inpos]) >>> (25 - 22))
+ out[3 + outpos] = ((in[3 + inpos] & 33554431) >>> (25 - 4))
+ | ((in[4 + inpos] & 33554431) << 4)
+ | ((in[5 + inpos]) << 29);
+ out[4 + outpos] = ((in[5 + inpos] & 33554431) >>> (25 - 22))
| ((in[6 + inpos]) << 22);
- out[5 + outpos] = ((in[6 + inpos]) >>> (25 - 15))
+ out[5 + outpos] = ((in[6 + inpos] & 33554431) >>> (25 - 15))
| ((in[7 + inpos]) << 15);
- out[6 + outpos] = ((in[7 + inpos]) >>> (25 - 8))
+ out[6 + outpos] = ((in[7 + inpos] & 33554431) >>> (25 - 8))
| ((in[8 + inpos]) << 8);
- out[7 + outpos] = ((in[8 + inpos]) >>> (25 - 1))
- | ((in[9 + inpos]) << 1) | ((in[10 + inpos]) << 26);
- out[8 + outpos] = ((in[10 + inpos]) >>> (25 - 19))
+ out[7 + outpos] = ((in[8 + inpos] & 33554431) >>> (25 - 1))
+ | ((in[9 + inpos] & 33554431) << 1)
+ | ((in[10 + inpos]) << 26);
+ out[8 + outpos] = ((in[10 + inpos] & 33554431) >>> (25 - 19))
| ((in[11 + inpos]) << 19);
- out[9 + outpos] = ((in[11 + inpos]) >>> (25 - 12))
+ out[9 + outpos] = ((in[11 + inpos] & 33554431) >>> (25 - 12))
| ((in[12 + inpos]) << 12);
- out[10 + outpos] = ((in[12 + inpos]) >>> (25 - 5))
- | ((in[13 + inpos]) << 5) | ((in[14 + inpos]) << 30);
- out[11 + outpos] = ((in[14 + inpos]) >>> (25 - 23))
+ out[10 + outpos] = ((in[12 + inpos] & 33554431) >>> (25 - 5))
+ | ((in[13 + inpos] & 33554431) << 5)
+ | ((in[14 + inpos]) << 30);
+ out[11 + outpos] = ((in[14 + inpos] & 33554431) >>> (25 - 23))
| ((in[15 + inpos]) << 23);
- out[12 + outpos] = ((in[15 + inpos]) >>> (25 - 16))
+ out[12 + outpos] = ((in[15 + inpos] & 33554431) >>> (25 - 16))
| ((in[16 + inpos]) << 16);
- out[13 + outpos] = ((in[16 + inpos]) >>> (25 - 9))
+ out[13 + outpos] = ((in[16 + inpos] & 33554431) >>> (25 - 9))
| ((in[17 + inpos]) << 9);
- out[14 + outpos] = ((in[17 + inpos]) >>> (25 - 2))
- | ((in[18 + inpos]) << 2) | ((in[19 + inpos]) << 27);
- out[15 + outpos] = ((in[19 + inpos]) >>> (25 - 20))
+ out[14 + outpos] = ((in[17 + inpos] & 33554431) >>> (25 - 2))
+ | ((in[18 + inpos] & 33554431) << 2)
+ | ((in[19 + inpos]) << 27);
+ out[15 + outpos] = ((in[19 + inpos] & 33554431) >>> (25 - 20))
| ((in[20 + inpos]) << 20);
- out[16 + outpos] = ((in[20 + inpos]) >>> (25 - 13))
+ out[16 + outpos] = ((in[20 + inpos] & 33554431) >>> (25 - 13))
| ((in[21 + inpos]) << 13);
- out[17 + outpos] = ((in[21 + inpos]) >>> (25 - 6))
- | ((in[22 + inpos]) << 6) | ((in[23 + inpos]) << 31);
- out[18 + outpos] = ((in[23 + inpos]) >>> (25 - 24))
+ out[17 + outpos] = ((in[21 + inpos] & 33554431) >>> (25 - 6))
+ | ((in[22 + inpos] & 33554431) << 6)
+ | ((in[23 + inpos]) << 31);
+ out[18 + outpos] = ((in[23 + inpos] & 33554431) >>> (25 - 24))
| ((in[24 + inpos]) << 24);
- out[19 + outpos] = ((in[24 + inpos]) >>> (25 - 17))
+ out[19 + outpos] = ((in[24 + inpos] & 33554431) >>> (25 - 17))
| ((in[25 + inpos]) << 17);
- out[20 + outpos] = ((in[25 + inpos]) >>> (25 - 10))
+ out[20 + outpos] = ((in[25 + inpos] & 33554431) >>> (25 - 10))
| ((in[26 + inpos]) << 10);
- out[21 + outpos] = ((in[26 + inpos]) >>> (25 - 3))
- | ((in[27 + inpos]) << 3) | ((in[28 + inpos]) << 28);
- out[22 + outpos] = ((in[28 + inpos]) >>> (25 - 21))
+ out[21 + outpos] = ((in[26 + inpos] & 33554431) >>> (25 - 3))
+ | ((in[27 + inpos] & 33554431) << 3)
+ | ((in[28 + inpos]) << 28);
+ out[22 + outpos] = ((in[28 + inpos] & 33554431) >>> (25 - 21))
| ((in[29 + inpos]) << 21);
- out[23 + outpos] = ((in[29 + inpos]) >>> (25 - 14))
+ out[23 + outpos] = ((in[29 + inpos] & 33554431) >>> (25 - 14))
| ((in[30 + inpos]) << 14);
- out[24 + outpos] = ((in[30 + inpos]) >>> (25 - 7))
+ out[24 + outpos] = ((in[30 + inpos] & 33554431) >>> (25 - 7))
| ((in[31 + inpos]) << 7);
}
- protected static void fastpackwithoutmask26(final int[] in, int inpos,
+ protected static void fastpack26(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 26);
- out[1 + outpos] = ((in[1 + inpos]) >>> (26 - 20))
+ out[0 + outpos] = (in[0 + inpos] & 67108863)
+ | ((in[1 + inpos]) << 26);
+ out[1 + outpos] = ((in[1 + inpos] & 67108863) >>> (26 - 20))
| ((in[2 + inpos]) << 20);
- out[2 + outpos] = ((in[2 + inpos]) >>> (26 - 14))
+ out[2 + outpos] = ((in[2 + inpos] & 67108863) >>> (26 - 14))
| ((in[3 + inpos]) << 14);
- out[3 + outpos] = ((in[3 + inpos]) >>> (26 - 8))
+ out[3 + outpos] = ((in[3 + inpos] & 67108863) >>> (26 - 8))
| ((in[4 + inpos]) << 8);
- out[4 + outpos] = ((in[4 + inpos]) >>> (26 - 2))
- | ((in[5 + inpos]) << 2) | ((in[6 + inpos]) << 28);
- out[5 + outpos] = ((in[6 + inpos]) >>> (26 - 22))
+ out[4 + outpos] = ((in[4 + inpos] & 67108863) >>> (26 - 2))
+ | ((in[5 + inpos] & 67108863) << 2)
+ | ((in[6 + inpos]) << 28);
+ out[5 + outpos] = ((in[6 + inpos] & 67108863) >>> (26 - 22))
| ((in[7 + inpos]) << 22);
- out[6 + outpos] = ((in[7 + inpos]) >>> (26 - 16))
+ out[6 + outpos] = ((in[7 + inpos] & 67108863) >>> (26 - 16))
| ((in[8 + inpos]) << 16);
- out[7 + outpos] = ((in[8 + inpos]) >>> (26 - 10))
+ out[7 + outpos] = ((in[8 + inpos] & 67108863) >>> (26 - 10))
| ((in[9 + inpos]) << 10);
- out[8 + outpos] = ((in[9 + inpos]) >>> (26 - 4))
- | ((in[10 + inpos]) << 4) | ((in[11 + inpos]) << 30);
- out[9 + outpos] = ((in[11 + inpos]) >>> (26 - 24))
+ out[8 + outpos] = ((in[9 + inpos] & 67108863) >>> (26 - 4))
+ | ((in[10 + inpos] & 67108863) << 4)
+ | ((in[11 + inpos]) << 30);
+ out[9 + outpos] = ((in[11 + inpos] & 67108863) >>> (26 - 24))
| ((in[12 + inpos]) << 24);
- out[10 + outpos] = ((in[12 + inpos]) >>> (26 - 18))
+ out[10 + outpos] = ((in[12 + inpos] & 67108863) >>> (26 - 18))
| ((in[13 + inpos]) << 18);
- out[11 + outpos] = ((in[13 + inpos]) >>> (26 - 12))
+ out[11 + outpos] = ((in[13 + inpos] & 67108863) >>> (26 - 12))
| ((in[14 + inpos]) << 12);
- out[12 + outpos] = ((in[14 + inpos]) >>> (26 - 6))
+ out[12 + outpos] = ((in[14 + inpos] & 67108863) >>> (26 - 6))
| ((in[15 + inpos]) << 6);
- out[13 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 26);
- out[14 + outpos] = ((in[17 + inpos]) >>> (26 - 20))
+ out[13 + outpos] = (in[16 + inpos] & 67108863)
+ | ((in[17 + inpos]) << 26);
+ out[14 + outpos] = ((in[17 + inpos] & 67108863) >>> (26 - 20))
| ((in[18 + inpos]) << 20);
- out[15 + outpos] = ((in[18 + inpos]) >>> (26 - 14))
+ out[15 + outpos] = ((in[18 + inpos] & 67108863) >>> (26 - 14))
| ((in[19 + inpos]) << 14);
- out[16 + outpos] = ((in[19 + inpos]) >>> (26 - 8))
+ out[16 + outpos] = ((in[19 + inpos] & 67108863) >>> (26 - 8))
| ((in[20 + inpos]) << 8);
- out[17 + outpos] = ((in[20 + inpos]) >>> (26 - 2))
- | ((in[21 + inpos]) << 2) | ((in[22 + inpos]) << 28);
- out[18 + outpos] = ((in[22 + inpos]) >>> (26 - 22))
+ out[17 + outpos] = ((in[20 + inpos] & 67108863) >>> (26 - 2))
+ | ((in[21 + inpos] & 67108863) << 2)
+ | ((in[22 + inpos]) << 28);
+ out[18 + outpos] = ((in[22 + inpos] & 67108863) >>> (26 - 22))
| ((in[23 + inpos]) << 22);
- out[19 + outpos] = ((in[23 + inpos]) >>> (26 - 16))
+ out[19 + outpos] = ((in[23 + inpos] & 67108863) >>> (26 - 16))
| ((in[24 + inpos]) << 16);
- out[20 + outpos] = ((in[24 + inpos]) >>> (26 - 10))
+ out[20 + outpos] = ((in[24 + inpos] & 67108863) >>> (26 - 10))
| ((in[25 + inpos]) << 10);
- out[21 + outpos] = ((in[25 + inpos]) >>> (26 - 4))
- | ((in[26 + inpos]) << 4) | ((in[27 + inpos]) << 30);
- out[22 + outpos] = ((in[27 + inpos]) >>> (26 - 24))
+ out[21 + outpos] = ((in[25 + inpos] & 67108863) >>> (26 - 4))
+ | ((in[26 + inpos] & 67108863) << 4)
+ | ((in[27 + inpos]) << 30);
+ out[22 + outpos] = ((in[27 + inpos] & 67108863) >>> (26 - 24))
| ((in[28 + inpos]) << 24);
- out[23 + outpos] = ((in[28 + inpos]) >>> (26 - 18))
+ out[23 + outpos] = ((in[28 + inpos] & 67108863) >>> (26 - 18))
| ((in[29 + inpos]) << 18);
- out[24 + outpos] = ((in[29 + inpos]) >>> (26 - 12))
+ out[24 + outpos] = ((in[29 + inpos] & 67108863) >>> (26 - 12))
| ((in[30 + inpos]) << 12);
- out[25 + outpos] = ((in[30 + inpos]) >>> (26 - 6))
+ out[25 + outpos] = ((in[30 + inpos] & 67108863) >>> (26 - 6))
| ((in[31 + inpos]) << 6);
}
- protected static void fastpackwithoutmask27(final int[] in, int inpos,
+ protected static void fastpack27(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 27);
- out[1 + outpos] = ((in[1 + inpos]) >>> (27 - 22))
+ out[0 + outpos] = (in[0 + inpos] & 134217727)
+ | ((in[1 + inpos]) << 27);
+ out[1 + outpos] = ((in[1 + inpos] & 134217727) >>> (27 - 22))
| ((in[2 + inpos]) << 22);
- out[2 + outpos] = ((in[2 + inpos]) >>> (27 - 17))
+ out[2 + outpos] = ((in[2 + inpos] & 134217727) >>> (27 - 17))
| ((in[3 + inpos]) << 17);
- out[3 + outpos] = ((in[3 + inpos]) >>> (27 - 12))
+ out[3 + outpos] = ((in[3 + inpos] & 134217727) >>> (27 - 12))
| ((in[4 + inpos]) << 12);
- out[4 + outpos] = ((in[4 + inpos]) >>> (27 - 7))
+ out[4 + outpos] = ((in[4 + inpos] & 134217727) >>> (27 - 7))
| ((in[5 + inpos]) << 7);
- out[5 + outpos] = ((in[5 + inpos]) >>> (27 - 2))
- | ((in[6 + inpos]) << 2) | ((in[7 + inpos]) << 29);
- out[6 + outpos] = ((in[7 + inpos]) >>> (27 - 24))
+ out[5 + outpos] = ((in[5 + inpos] & 134217727) >>> (27 - 2))
+ | ((in[6 + inpos] & 134217727) << 2)
+ | ((in[7 + inpos]) << 29);
+ out[6 + outpos] = ((in[7 + inpos] & 134217727) >>> (27 - 24))
| ((in[8 + inpos]) << 24);
- out[7 + outpos] = ((in[8 + inpos]) >>> (27 - 19))
+ out[7 + outpos] = ((in[8 + inpos] & 134217727) >>> (27 - 19))
| ((in[9 + inpos]) << 19);
- out[8 + outpos] = ((in[9 + inpos]) >>> (27 - 14))
+ out[8 + outpos] = ((in[9 + inpos] & 134217727) >>> (27 - 14))
| ((in[10 + inpos]) << 14);
- out[9 + outpos] = ((in[10 + inpos]) >>> (27 - 9))
+ out[9 + outpos] = ((in[10 + inpos] & 134217727) >>> (27 - 9))
| ((in[11 + inpos]) << 9);
- out[10 + outpos] = ((in[11 + inpos]) >>> (27 - 4))
- | ((in[12 + inpos]) << 4) | ((in[13 + inpos]) << 31);
- out[11 + outpos] = ((in[13 + inpos]) >>> (27 - 26))
+ out[10 + outpos] = ((in[11 + inpos] & 134217727) >>> (27 - 4))
+ | ((in[12 + inpos] & 134217727) << 4)
+ | ((in[13 + inpos]) << 31);
+ out[11 + outpos] = ((in[13 + inpos] & 134217727) >>> (27 - 26))
| ((in[14 + inpos]) << 26);
- out[12 + outpos] = ((in[14 + inpos]) >>> (27 - 21))
+ out[12 + outpos] = ((in[14 + inpos] & 134217727) >>> (27 - 21))
| ((in[15 + inpos]) << 21);
- out[13 + outpos] = ((in[15 + inpos]) >>> (27 - 16))
+ out[13 + outpos] = ((in[15 + inpos] & 134217727) >>> (27 - 16))
| ((in[16 + inpos]) << 16);
- out[14 + outpos] = ((in[16 + inpos]) >>> (27 - 11))
+ out[14 + outpos] = ((in[16 + inpos] & 134217727) >>> (27 - 11))
| ((in[17 + inpos]) << 11);
- out[15 + outpos] = ((in[17 + inpos]) >>> (27 - 6))
+ out[15 + outpos] = ((in[17 + inpos] & 134217727) >>> (27 - 6))
| ((in[18 + inpos]) << 6);
- out[16 + outpos] = ((in[18 + inpos]) >>> (27 - 1))
- | ((in[19 + inpos]) << 1) | ((in[20 + inpos]) << 28);
- out[17 + outpos] = ((in[20 + inpos]) >>> (27 - 23))
+ out[16 + outpos] = ((in[18 + inpos] & 134217727) >>> (27 - 1))
+ | ((in[19 + inpos] & 134217727) << 1)
+ | ((in[20 + inpos]) << 28);
+ out[17 + outpos] = ((in[20 + inpos] & 134217727) >>> (27 - 23))
| ((in[21 + inpos]) << 23);
- out[18 + outpos] = ((in[21 + inpos]) >>> (27 - 18))
+ out[18 + outpos] = ((in[21 + inpos] & 134217727) >>> (27 - 18))
| ((in[22 + inpos]) << 18);
- out[19 + outpos] = ((in[22 + inpos]) >>> (27 - 13))
+ out[19 + outpos] = ((in[22 + inpos] & 134217727) >>> (27 - 13))
| ((in[23 + inpos]) << 13);
- out[20 + outpos] = ((in[23 + inpos]) >>> (27 - 8))
+ out[20 + outpos] = ((in[23 + inpos] & 134217727) >>> (27 - 8))
| ((in[24 + inpos]) << 8);
- out[21 + outpos] = ((in[24 + inpos]) >>> (27 - 3))
- | ((in[25 + inpos]) << 3) | ((in[26 + inpos]) << 30);
- out[22 + outpos] = ((in[26 + inpos]) >>> (27 - 25))
+ out[21 + outpos] = ((in[24 + inpos] & 134217727) >>> (27 - 3))
+ | ((in[25 + inpos] & 134217727) << 3)
+ | ((in[26 + inpos]) << 30);
+ out[22 + outpos] = ((in[26 + inpos] & 134217727) >>> (27 - 25))
| ((in[27 + inpos]) << 25);
- out[23 + outpos] = ((in[27 + inpos]) >>> (27 - 20))
+ out[23 + outpos] = ((in[27 + inpos] & 134217727) >>> (27 - 20))
| ((in[28 + inpos]) << 20);
- out[24 + outpos] = ((in[28 + inpos]) >>> (27 - 15))
+ out[24 + outpos] = ((in[28 + inpos] & 134217727) >>> (27 - 15))
| ((in[29 + inpos]) << 15);
- out[25 + outpos] = ((in[29 + inpos]) >>> (27 - 10))
+ out[25 + outpos] = ((in[29 + inpos] & 134217727) >>> (27 - 10))
| ((in[30 + inpos]) << 10);
- out[26 + outpos] = ((in[30 + inpos]) >>> (27 - 5))
+ out[26 + outpos] = ((in[30 + inpos] & 134217727) >>> (27 - 5))
| ((in[31 + inpos]) << 5);
}
- protected static void fastpackwithoutmask28(final int[] in, int inpos,
+ protected static void fastpack28(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 28);
- out[1 + outpos] = ((in[1 + inpos]) >>> (28 - 24))
+ out[0 + outpos] = (in[0 + inpos] & 268435455)
+ | ((in[1 + inpos]) << 28);
+ out[1 + outpos] = ((in[1 + inpos] & 268435455) >>> (28 - 24))
| ((in[2 + inpos]) << 24);
- out[2 + outpos] = ((in[2 + inpos]) >>> (28 - 20))
+ out[2 + outpos] = ((in[2 + inpos] & 268435455) >>> (28 - 20))
| ((in[3 + inpos]) << 20);
- out[3 + outpos] = ((in[3 + inpos]) >>> (28 - 16))
+ out[3 + outpos] = ((in[3 + inpos] & 268435455) >>> (28 - 16))
| ((in[4 + inpos]) << 16);
- out[4 + outpos] = ((in[4 + inpos]) >>> (28 - 12))
+ out[4 + outpos] = ((in[4 + inpos] & 268435455) >>> (28 - 12))
| ((in[5 + inpos]) << 12);
- out[5 + outpos] = ((in[5 + inpos]) >>> (28 - 8))
+ out[5 + outpos] = ((in[5 + inpos] & 268435455) >>> (28 - 8))
| ((in[6 + inpos]) << 8);
- out[6 + outpos] = ((in[6 + inpos]) >>> (28 - 4))
+ out[6 + outpos] = ((in[6 + inpos] & 268435455) >>> (28 - 4))
| ((in[7 + inpos]) << 4);
- out[7 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 28);
- out[8 + outpos] = ((in[9 + inpos]) >>> (28 - 24))
+ out[7 + outpos] = (in[8 + inpos] & 268435455)
+ | ((in[9 + inpos]) << 28);
+ out[8 + outpos] = ((in[9 + inpos] & 268435455) >>> (28 - 24))
| ((in[10 + inpos]) << 24);
- out[9 + outpos] = ((in[10 + inpos]) >>> (28 - 20))
+ out[9 + outpos] = ((in[10 + inpos] & 268435455) >>> (28 - 20))
| ((in[11 + inpos]) << 20);
- out[10 + outpos] = ((in[11 + inpos]) >>> (28 - 16))
+ out[10 + outpos] = ((in[11 + inpos] & 268435455) >>> (28 - 16))
| ((in[12 + inpos]) << 16);
- out[11 + outpos] = ((in[12 + inpos]) >>> (28 - 12))
+ out[11 + outpos] = ((in[12 + inpos] & 268435455) >>> (28 - 12))
| ((in[13 + inpos]) << 12);
- out[12 + outpos] = ((in[13 + inpos]) >>> (28 - 8))
+ out[12 + outpos] = ((in[13 + inpos] & 268435455) >>> (28 - 8))
| ((in[14 + inpos]) << 8);
- out[13 + outpos] = ((in[14 + inpos]) >>> (28 - 4))
+ out[13 + outpos] = ((in[14 + inpos] & 268435455) >>> (28 - 4))
| ((in[15 + inpos]) << 4);
- out[14 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 28);
- out[15 + outpos] = ((in[17 + inpos]) >>> (28 - 24))
+ out[14 + outpos] = (in[16 + inpos] & 268435455)
+ | ((in[17 + inpos]) << 28);
+ out[15 + outpos] = ((in[17 + inpos] & 268435455) >>> (28 - 24))
| ((in[18 + inpos]) << 24);
- out[16 + outpos] = ((in[18 + inpos]) >>> (28 - 20))
+ out[16 + outpos] = ((in[18 + inpos] & 268435455) >>> (28 - 20))
| ((in[19 + inpos]) << 20);
- out[17 + outpos] = ((in[19 + inpos]) >>> (28 - 16))
+ out[17 + outpos] = ((in[19 + inpos] & 268435455) >>> (28 - 16))
| ((in[20 + inpos]) << 16);
- out[18 + outpos] = ((in[20 + inpos]) >>> (28 - 12))
+ out[18 + outpos] = ((in[20 + inpos] & 268435455) >>> (28 - 12))
| ((in[21 + inpos]) << 12);
- out[19 + outpos] = ((in[21 + inpos]) >>> (28 - 8))
+ out[19 + outpos] = ((in[21 + inpos] & 268435455) >>> (28 - 8))
| ((in[22 + inpos]) << 8);
- out[20 + outpos] = ((in[22 + inpos]) >>> (28 - 4))
+ out[20 + outpos] = ((in[22 + inpos] & 268435455) >>> (28 - 4))
| ((in[23 + inpos]) << 4);
- out[21 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 28);
- out[22 + outpos] = ((in[25 + inpos]) >>> (28 - 24))
+ out[21 + outpos] = (in[24 + inpos] & 268435455)
+ | ((in[25 + inpos]) << 28);
+ out[22 + outpos] = ((in[25 + inpos] & 268435455) >>> (28 - 24))
| ((in[26 + inpos]) << 24);
- out[23 + outpos] = ((in[26 + inpos]) >>> (28 - 20))
+ out[23 + outpos] = ((in[26 + inpos] & 268435455) >>> (28 - 20))
| ((in[27 + inpos]) << 20);
- out[24 + outpos] = ((in[27 + inpos]) >>> (28 - 16))
+ out[24 + outpos] = ((in[27 + inpos] & 268435455) >>> (28 - 16))
| ((in[28 + inpos]) << 16);
- out[25 + outpos] = ((in[28 + inpos]) >>> (28 - 12))
+ out[25 + outpos] = ((in[28 + inpos] & 268435455) >>> (28 - 12))
| ((in[29 + inpos]) << 12);
- out[26 + outpos] = ((in[29 + inpos]) >>> (28 - 8))
+ out[26 + outpos] = ((in[29 + inpos] & 268435455) >>> (28 - 8))
| ((in[30 + inpos]) << 8);
- out[27 + outpos] = ((in[30 + inpos]) >>> (28 - 4))
+ out[27 + outpos] = ((in[30 + inpos] & 268435455) >>> (28 - 4))
| ((in[31 + inpos]) << 4);
}
- protected static void fastpackwithoutmask29(final int[] in, int inpos,
+ protected static void fastpack29(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 29);
- out[1 + outpos] = ((in[1 + inpos]) >>> (29 - 26))
+ out[0 + outpos] = (in[0 + inpos] & 536870911)
+ | ((in[1 + inpos]) << 29);
+ out[1 + outpos] = ((in[1 + inpos] & 536870911) >>> (29 - 26))
| ((in[2 + inpos]) << 26);
- out[2 + outpos] = ((in[2 + inpos]) >>> (29 - 23))
+ out[2 + outpos] = ((in[2 + inpos] & 536870911) >>> (29 - 23))
| ((in[3 + inpos]) << 23);
- out[3 + outpos] = ((in[3 + inpos]) >>> (29 - 20))
+ out[3 + outpos] = ((in[3 + inpos] & 536870911) >>> (29 - 20))
| ((in[4 + inpos]) << 20);
- out[4 + outpos] = ((in[4 + inpos]) >>> (29 - 17))
+ out[4 + outpos] = ((in[4 + inpos] & 536870911) >>> (29 - 17))
| ((in[5 + inpos]) << 17);
- out[5 + outpos] = ((in[5 + inpos]) >>> (29 - 14))
+ out[5 + outpos] = ((in[5 + inpos] & 536870911) >>> (29 - 14))
| ((in[6 + inpos]) << 14);
- out[6 + outpos] = ((in[6 + inpos]) >>> (29 - 11))
+ out[6 + outpos] = ((in[6 + inpos] & 536870911) >>> (29 - 11))
| ((in[7 + inpos]) << 11);
- out[7 + outpos] = ((in[7 + inpos]) >>> (29 - 8))
+ out[7 + outpos] = ((in[7 + inpos] & 536870911) >>> (29 - 8))
| ((in[8 + inpos]) << 8);
- out[8 + outpos] = ((in[8 + inpos]) >>> (29 - 5))
+ out[8 + outpos] = ((in[8 + inpos] & 536870911) >>> (29 - 5))
| ((in[9 + inpos]) << 5);
- out[9 + outpos] = ((in[9 + inpos]) >>> (29 - 2))
- | ((in[10 + inpos]) << 2) | ((in[11 + inpos]) << 31);
- out[10 + outpos] = ((in[11 + inpos]) >>> (29 - 28))
+ out[9 + outpos] = ((in[9 + inpos] & 536870911) >>> (29 - 2))
+ | ((in[10 + inpos] & 536870911) << 2)
+ | ((in[11 + inpos]) << 31);
+ out[10 + outpos] = ((in[11 + inpos] & 536870911) >>> (29 - 28))
| ((in[12 + inpos]) << 28);
- out[11 + outpos] = ((in[12 + inpos]) >>> (29 - 25))
+ out[11 + outpos] = ((in[12 + inpos] & 536870911) >>> (29 - 25))
| ((in[13 + inpos]) << 25);
- out[12 + outpos] = ((in[13 + inpos]) >>> (29 - 22))
+ out[12 + outpos] = ((in[13 + inpos] & 536870911) >>> (29 - 22))
| ((in[14 + inpos]) << 22);
- out[13 + outpos] = ((in[14 + inpos]) >>> (29 - 19))
+ out[13 + outpos] = ((in[14 + inpos] & 536870911) >>> (29 - 19))
| ((in[15 + inpos]) << 19);
- out[14 + outpos] = ((in[15 + inpos]) >>> (29 - 16))
+ out[14 + outpos] = ((in[15 + inpos] & 536870911) >>> (29 - 16))
| ((in[16 + inpos]) << 16);
- out[15 + outpos] = ((in[16 + inpos]) >>> (29 - 13))
+ out[15 + outpos] = ((in[16 + inpos] & 536870911) >>> (29 - 13))
| ((in[17 + inpos]) << 13);
- out[16 + outpos] = ((in[17 + inpos]) >>> (29 - 10))
+ out[16 + outpos] = ((in[17 + inpos] & 536870911) >>> (29 - 10))
| ((in[18 + inpos]) << 10);
- out[17 + outpos] = ((in[18 + inpos]) >>> (29 - 7))
+ out[17 + outpos] = ((in[18 + inpos] & 536870911) >>> (29 - 7))
| ((in[19 + inpos]) << 7);
- out[18 + outpos] = ((in[19 + inpos]) >>> (29 - 4))
+ out[18 + outpos] = ((in[19 + inpos] & 536870911) >>> (29 - 4))
| ((in[20 + inpos]) << 4);
- out[19 + outpos] = ((in[20 + inpos]) >>> (29 - 1))
- | ((in[21 + inpos]) << 1) | ((in[22 + inpos]) << 30);
- out[20 + outpos] = ((in[22 + inpos]) >>> (29 - 27))
+ out[19 + outpos] = ((in[20 + inpos] & 536870911) >>> (29 - 1))
+ | ((in[21 + inpos] & 536870911) << 1)
+ | ((in[22 + inpos]) << 30);
+ out[20 + outpos] = ((in[22 + inpos] & 536870911) >>> (29 - 27))
| ((in[23 + inpos]) << 27);
- out[21 + outpos] = ((in[23 + inpos]) >>> (29 - 24))
+ out[21 + outpos] = ((in[23 + inpos] & 536870911) >>> (29 - 24))
| ((in[24 + inpos]) << 24);
- out[22 + outpos] = ((in[24 + inpos]) >>> (29 - 21))
+ out[22 + outpos] = ((in[24 + inpos] & 536870911) >>> (29 - 21))
| ((in[25 + inpos]) << 21);
- out[23 + outpos] = ((in[25 + inpos]) >>> (29 - 18))
+ out[23 + outpos] = ((in[25 + inpos] & 536870911) >>> (29 - 18))
| ((in[26 + inpos]) << 18);
- out[24 + outpos] = ((in[26 + inpos]) >>> (29 - 15))
+ out[24 + outpos] = ((in[26 + inpos] & 536870911) >>> (29 - 15))
| ((in[27 + inpos]) << 15);
- out[25 + outpos] = ((in[27 + inpos]) >>> (29 - 12))
+ out[25 + outpos] = ((in[27 + inpos] & 536870911) >>> (29 - 12))
| ((in[28 + inpos]) << 12);
- out[26 + outpos] = ((in[28 + inpos]) >>> (29 - 9))
+ out[26 + outpos] = ((in[28 + inpos] & 536870911) >>> (29 - 9))
| ((in[29 + inpos]) << 9);
- out[27 + outpos] = ((in[29 + inpos]) >>> (29 - 6))
+ out[27 + outpos] = ((in[29 + inpos] & 536870911) >>> (29 - 6))
| ((in[30 + inpos]) << 6);
- out[28 + outpos] = ((in[30 + inpos]) >>> (29 - 3))
+ out[28 + outpos] = ((in[30 + inpos] & 536870911) >>> (29 - 3))
| ((in[31 + inpos]) << 3);
}
- protected static void fastpackwithoutmask30(final int[] in, int inpos,
+ protected static void fastpack3(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 30);
- out[1 + outpos] = ((in[1 + inpos]) >>> (30 - 28))
- | ((in[2 + inpos]) << 28);
- out[2 + outpos] = ((in[2 + inpos]) >>> (30 - 26))
- | ((in[3 + inpos]) << 26);
- out[3 + outpos] = ((in[3 + inpos]) >>> (30 - 24))
- | ((in[4 + inpos]) << 24);
- out[4 + outpos] = ((in[4 + inpos]) >>> (30 - 22))
- | ((in[5 + inpos]) << 22);
- out[5 + outpos] = ((in[5 + inpos]) >>> (30 - 20))
- | ((in[6 + inpos]) << 20);
- out[6 + outpos] = ((in[6 + inpos]) >>> (30 - 18))
- | ((in[7 + inpos]) << 18);
- out[7 + outpos] = ((in[7 + inpos]) >>> (30 - 16))
- | ((in[8 + inpos]) << 16);
- out[8 + outpos] = ((in[8 + inpos]) >>> (30 - 14))
- | ((in[9 + inpos]) << 14);
- out[9 + outpos] = ((in[9 + inpos]) >>> (30 - 12))
- | ((in[10 + inpos]) << 12);
- out[10 + outpos] = ((in[10 + inpos]) >>> (30 - 10))
- | ((in[11 + inpos]) << 10);
- out[11 + outpos] = ((in[11 + inpos]) >>> (30 - 8))
- | ((in[12 + inpos]) << 8);
- out[12 + outpos] = ((in[12 + inpos]) >>> (30 - 6))
- | ((in[13 + inpos]) << 6);
- out[13 + outpos] = ((in[13 + inpos]) >>> (30 - 4))
- | ((in[14 + inpos]) << 4);
- out[14 + outpos] = ((in[14 + inpos]) >>> (30 - 2))
- | ((in[15 + inpos]) << 2);
- out[15 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 30);
- out[16 + outpos] = ((in[17 + inpos]) >>> (30 - 28))
- | ((in[18 + inpos]) << 28);
- out[17 + outpos] = ((in[18 + inpos]) >>> (30 - 26))
- | ((in[19 + inpos]) << 26);
- out[18 + outpos] = ((in[19 + inpos]) >>> (30 - 24))
+ out[0 + outpos] = (in[0 + inpos] & 7)
+ | ((in[1 + inpos] & 7) << 3)
+ | ((in[2 + inpos] & 7) << 6)
+ | ((in[3 + inpos] & 7) << 9)
+ | ((in[4 + inpos] & 7) << 12)
+ | ((in[5 + inpos] & 7) << 15)
+ | ((in[6 + inpos] & 7) << 18)
+ | ((in[7 + inpos] & 7) << 21)
+ | ((in[8 + inpos] & 7) << 24)
+ | ((in[9 + inpos] & 7) << 27)
+ | ((in[10 + inpos]) << 30);
+ out[1 + outpos] = ((in[10 + inpos] & 7) >>> (3 - 1))
+ | ((in[11 + inpos] & 7) << 1)
+ | ((in[12 + inpos] & 7) << 4)
+ | ((in[13 + inpos] & 7) << 7)
+ | ((in[14 + inpos] & 7) << 10)
+ | ((in[15 + inpos] & 7) << 13)
+ | ((in[16 + inpos] & 7) << 16)
+ | ((in[17 + inpos] & 7) << 19)
+ | ((in[18 + inpos] & 7) << 22)
+ | ((in[19 + inpos] & 7) << 25)
+ | ((in[20 + inpos] & 7) << 28)
+ | ((in[21 + inpos]) << 31);
+ out[2 + outpos] = ((in[21 + inpos] & 7) >>> (3 - 2))
+ | ((in[22 + inpos] & 7) << 2)
+ | ((in[23 + inpos] & 7) << 5)
+ | ((in[24 + inpos] & 7) << 8)
+ | ((in[25 + inpos] & 7) << 11)
+ | ((in[26 + inpos] & 7) << 14)
+ | ((in[27 + inpos] & 7) << 17)
+ | ((in[28 + inpos] & 7) << 20)
+ | ((in[29 + inpos] & 7) << 23)
+ | ((in[30 + inpos] & 7) << 26)
+ | ((in[31 + inpos]) << 29);
+ }
+
+ protected static void fastpack30(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] & 1073741823)
+ | ((in[1 + inpos]) << 30);
+ out[1 + outpos] = ((in[1 + inpos] & 1073741823) >>> (30 - 28))
+ | ((in[2 + inpos]) << 28);
+ out[2 + outpos] = ((in[2 + inpos] & 1073741823) >>> (30 - 26))
+ | ((in[3 + inpos]) << 26);
+ out[3 + outpos] = ((in[3 + inpos] & 1073741823) >>> (30 - 24))
+ | ((in[4 + inpos]) << 24);
+ out[4 + outpos] = ((in[4 + inpos] & 1073741823) >>> (30 - 22))
+ | ((in[5 + inpos]) << 22);
+ out[5 + outpos] = ((in[5 + inpos] & 1073741823) >>> (30 - 20))
+ | ((in[6 + inpos]) << 20);
+ out[6 + outpos] = ((in[6 + inpos] & 1073741823) >>> (30 - 18))
+ | ((in[7 + inpos]) << 18);
+ out[7 + outpos] = ((in[7 + inpos] & 1073741823) >>> (30 - 16))
+ | ((in[8 + inpos]) << 16);
+ out[8 + outpos] = ((in[8 + inpos] & 1073741823) >>> (30 - 14))
+ | ((in[9 + inpos]) << 14);
+ out[9 + outpos] = ((in[9 + inpos] & 1073741823) >>> (30 - 12))
+ | ((in[10 + inpos]) << 12);
+ out[10 + outpos] = ((in[10 + inpos] & 1073741823) >>> (30 - 10))
+ | ((in[11 + inpos]) << 10);
+ out[11 + outpos] = ((in[11 + inpos] & 1073741823) >>> (30 - 8))
+ | ((in[12 + inpos]) << 8);
+ out[12 + outpos] = ((in[12 + inpos] & 1073741823) >>> (30 - 6))
+ | ((in[13 + inpos]) << 6);
+ out[13 + outpos] = ((in[13 + inpos] & 1073741823) >>> (30 - 4))
+ | ((in[14 + inpos]) << 4);
+ out[14 + outpos] = ((in[14 + inpos] & 1073741823) >>> (30 - 2))
+ | ((in[15 + inpos]) << 2);
+ out[15 + outpos] = (in[16 + inpos] & 1073741823)
+ | ((in[17 + inpos]) << 30);
+ out[16 + outpos] = ((in[17 + inpos] & 1073741823) >>> (30 - 28))
+ | ((in[18 + inpos]) << 28);
+ out[17 + outpos] = ((in[18 + inpos] & 1073741823) >>> (30 - 26))
+ | ((in[19 + inpos]) << 26);
+ out[18 + outpos] = ((in[19 + inpos] & 1073741823) >>> (30 - 24))
| ((in[20 + inpos]) << 24);
- out[19 + outpos] = ((in[20 + inpos]) >>> (30 - 22))
+ out[19 + outpos] = ((in[20 + inpos] & 1073741823) >>> (30 - 22))
| ((in[21 + inpos]) << 22);
- out[20 + outpos] = ((in[21 + inpos]) >>> (30 - 20))
+ out[20 + outpos] = ((in[21 + inpos] & 1073741823) >>> (30 - 20))
| ((in[22 + inpos]) << 20);
- out[21 + outpos] = ((in[22 + inpos]) >>> (30 - 18))
+ out[21 + outpos] = ((in[22 + inpos] & 1073741823) >>> (30 - 18))
| ((in[23 + inpos]) << 18);
- out[22 + outpos] = ((in[23 + inpos]) >>> (30 - 16))
+ out[22 + outpos] = ((in[23 + inpos] & 1073741823) >>> (30 - 16))
| ((in[24 + inpos]) << 16);
- out[23 + outpos] = ((in[24 + inpos]) >>> (30 - 14))
+ out[23 + outpos] = ((in[24 + inpos] & 1073741823) >>> (30 - 14))
| ((in[25 + inpos]) << 14);
- out[24 + outpos] = ((in[25 + inpos]) >>> (30 - 12))
+ out[24 + outpos] = ((in[25 + inpos] & 1073741823) >>> (30 - 12))
| ((in[26 + inpos]) << 12);
- out[25 + outpos] = ((in[26 + inpos]) >>> (30 - 10))
+ out[25 + outpos] = ((in[26 + inpos] & 1073741823) >>> (30 - 10))
| ((in[27 + inpos]) << 10);
- out[26 + outpos] = ((in[27 + inpos]) >>> (30 - 8))
+ out[26 + outpos] = ((in[27 + inpos] & 1073741823) >>> (30 - 8))
| ((in[28 + inpos]) << 8);
- out[27 + outpos] = ((in[28 + inpos]) >>> (30 - 6))
+ out[27 + outpos] = ((in[28 + inpos] & 1073741823) >>> (30 - 6))
| ((in[29 + inpos]) << 6);
- out[28 + outpos] = ((in[29 + inpos]) >>> (30 - 4))
+ out[28 + outpos] = ((in[29 + inpos] & 1073741823) >>> (30 - 4))
| ((in[30 + inpos]) << 4);
- out[29 + outpos] = ((in[30 + inpos]) >>> (30 - 2))
+ out[29 + outpos] = ((in[30 + inpos] & 1073741823) >>> (30 - 2))
| ((in[31 + inpos]) << 2);
}
- protected static void fastpackwithoutmask31(final int[] in, int inpos,
+ protected static void fastpack31(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 31);
- out[1 + outpos] = ((in[1 + inpos]) >>> (31 - 30))
+ out[0 + outpos] = (in[0 + inpos] & 2147483647)
+ | ((in[1 + inpos]) << 31);
+ out[1 + outpos] = ((in[1 + inpos] & 2147483647) >>> (31 - 30))
| ((in[2 + inpos]) << 30);
- out[2 + outpos] = ((in[2 + inpos]) >>> (31 - 29))
+ out[2 + outpos] = ((in[2 + inpos] & 2147483647) >>> (31 - 29))
| ((in[3 + inpos]) << 29);
- out[3 + outpos] = ((in[3 + inpos]) >>> (31 - 28))
+ out[3 + outpos] = ((in[3 + inpos] & 2147483647) >>> (31 - 28))
| ((in[4 + inpos]) << 28);
- out[4 + outpos] = ((in[4 + inpos]) >>> (31 - 27))
+ out[4 + outpos] = ((in[4 + inpos] & 2147483647) >>> (31 - 27))
| ((in[5 + inpos]) << 27);
- out[5 + outpos] = ((in[5 + inpos]) >>> (31 - 26))
+ out[5 + outpos] = ((in[5 + inpos] & 2147483647) >>> (31 - 26))
| ((in[6 + inpos]) << 26);
- out[6 + outpos] = ((in[6 + inpos]) >>> (31 - 25))
+ out[6 + outpos] = ((in[6 + inpos] & 2147483647) >>> (31 - 25))
| ((in[7 + inpos]) << 25);
- out[7 + outpos] = ((in[7 + inpos]) >>> (31 - 24))
+ out[7 + outpos] = ((in[7 + inpos] & 2147483647) >>> (31 - 24))
| ((in[8 + inpos]) << 24);
- out[8 + outpos] = ((in[8 + inpos]) >>> (31 - 23))
+ out[8 + outpos] = ((in[8 + inpos] & 2147483647) >>> (31 - 23))
| ((in[9 + inpos]) << 23);
- out[9 + outpos] = ((in[9 + inpos]) >>> (31 - 22))
+ out[9 + outpos] = ((in[9 + inpos] & 2147483647) >>> (31 - 22))
| ((in[10 + inpos]) << 22);
- out[10 + outpos] = ((in[10 + inpos]) >>> (31 - 21))
+ out[10 + outpos] = ((in[10 + inpos] & 2147483647) >>> (31 - 21))
| ((in[11 + inpos]) << 21);
- out[11 + outpos] = ((in[11 + inpos]) >>> (31 - 20))
+ out[11 + outpos] = ((in[11 + inpos] & 2147483647) >>> (31 - 20))
| ((in[12 + inpos]) << 20);
- out[12 + outpos] = ((in[12 + inpos]) >>> (31 - 19))
+ out[12 + outpos] = ((in[12 + inpos] & 2147483647) >>> (31 - 19))
| ((in[13 + inpos]) << 19);
- out[13 + outpos] = ((in[13 + inpos]) >>> (31 - 18))
+ out[13 + outpos] = ((in[13 + inpos] & 2147483647) >>> (31 - 18))
| ((in[14 + inpos]) << 18);
- out[14 + outpos] = ((in[14 + inpos]) >>> (31 - 17))
+ out[14 + outpos] = ((in[14 + inpos] & 2147483647) >>> (31 - 17))
| ((in[15 + inpos]) << 17);
- out[15 + outpos] = ((in[15 + inpos]) >>> (31 - 16))
+ out[15 + outpos] = ((in[15 + inpos] & 2147483647) >>> (31 - 16))
| ((in[16 + inpos]) << 16);
- out[16 + outpos] = ((in[16 + inpos]) >>> (31 - 15))
+ out[16 + outpos] = ((in[16 + inpos] & 2147483647) >>> (31 - 15))
| ((in[17 + inpos]) << 15);
- out[17 + outpos] = ((in[17 + inpos]) >>> (31 - 14))
+ out[17 + outpos] = ((in[17 + inpos] & 2147483647) >>> (31 - 14))
| ((in[18 + inpos]) << 14);
- out[18 + outpos] = ((in[18 + inpos]) >>> (31 - 13))
+ out[18 + outpos] = ((in[18 + inpos] & 2147483647) >>> (31 - 13))
| ((in[19 + inpos]) << 13);
- out[19 + outpos] = ((in[19 + inpos]) >>> (31 - 12))
+ out[19 + outpos] = ((in[19 + inpos] & 2147483647) >>> (31 - 12))
| ((in[20 + inpos]) << 12);
- out[20 + outpos] = ((in[20 + inpos]) >>> (31 - 11))
+ out[20 + outpos] = ((in[20 + inpos] & 2147483647) >>> (31 - 11))
| ((in[21 + inpos]) << 11);
- out[21 + outpos] = ((in[21 + inpos]) >>> (31 - 10))
+ out[21 + outpos] = ((in[21 + inpos] & 2147483647) >>> (31 - 10))
| ((in[22 + inpos]) << 10);
- out[22 + outpos] = ((in[22 + inpos]) >>> (31 - 9))
+ out[22 + outpos] = ((in[22 + inpos] & 2147483647) >>> (31 - 9))
| ((in[23 + inpos]) << 9);
- out[23 + outpos] = ((in[23 + inpos]) >>> (31 - 8))
+ out[23 + outpos] = ((in[23 + inpos] & 2147483647) >>> (31 - 8))
| ((in[24 + inpos]) << 8);
- out[24 + outpos] = ((in[24 + inpos]) >>> (31 - 7))
+ out[24 + outpos] = ((in[24 + inpos] & 2147483647) >>> (31 - 7))
| ((in[25 + inpos]) << 7);
- out[25 + outpos] = ((in[25 + inpos]) >>> (31 - 6))
+ out[25 + outpos] = ((in[25 + inpos] & 2147483647) >>> (31 - 6))
| ((in[26 + inpos]) << 6);
- out[26 + outpos] = ((in[26 + inpos]) >>> (31 - 5))
+ out[26 + outpos] = ((in[26 + inpos] & 2147483647) >>> (31 - 5))
| ((in[27 + inpos]) << 5);
- out[27 + outpos] = ((in[27 + inpos]) >>> (31 - 4))
+ out[27 + outpos] = ((in[27 + inpos] & 2147483647) >>> (31 - 4))
| ((in[28 + inpos]) << 4);
- out[28 + outpos] = ((in[28 + inpos]) >>> (31 - 3))
+ out[28 + outpos] = ((in[28 + inpos] & 2147483647) >>> (31 - 3))
| ((in[29 + inpos]) << 3);
- out[29 + outpos] = ((in[29 + inpos]) >>> (31 - 2))
+ out[29 + outpos] = ((in[29 + inpos] & 2147483647) >>> (31 - 2))
| ((in[30 + inpos]) << 2);
- out[30 + outpos] = ((in[30 + inpos]) >>> (31 - 1))
+ out[30 + outpos] = ((in[30 + inpos] & 2147483647) >>> (31 - 1))
| ((in[31 + inpos]) << 1);
}
- protected static void fastpack1(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 1)
- | ((in[1 + inpos] & 1) << 1)
- | ((in[2 + inpos] & 1) << 2)
- | ((in[3 + inpos] & 1) << 3)
- | ((in[4 + inpos] & 1) << 4)
- | ((in[5 + inpos] & 1) << 5)
- | ((in[6 + inpos] & 1) << 6)
- | ((in[7 + inpos] & 1) << 7)
- | ((in[8 + inpos] & 1) << 8)
- | ((in[9 + inpos] & 1) << 9)
- | ((in[10 + inpos] & 1) << 10)
- | ((in[11 + inpos] & 1) << 11)
- | ((in[12 + inpos] & 1) << 12)
- | ((in[13 + inpos] & 1) << 13)
- | ((in[14 + inpos] & 1) << 14)
- | ((in[15 + inpos] & 1) << 15)
- | ((in[16 + inpos] & 1) << 16)
- | ((in[17 + inpos] & 1) << 17)
- | ((in[18 + inpos] & 1) << 18)
- | ((in[19 + inpos] & 1) << 19)
- | ((in[20 + inpos] & 1) << 20)
- | ((in[21 + inpos] & 1) << 21)
- | ((in[22 + inpos] & 1) << 22)
- | ((in[23 + inpos] & 1) << 23)
- | ((in[24 + inpos] & 1) << 24)
- | ((in[25 + inpos] & 1) << 25)
- | ((in[26 + inpos] & 1) << 26)
- | ((in[27 + inpos] & 1) << 27)
- | ((in[28 + inpos] & 1) << 28)
- | ((in[29 + inpos] & 1) << 29)
- | ((in[30 + inpos] & 1) << 30)
- | ((in[31 + inpos]) << 31);
- }
-
- protected static void fastpack2(final int[] in, int inpos,
+ protected static void fastpack32(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 3)
- | ((in[1 + inpos] & 3) << 2)
- | ((in[2 + inpos] & 3) << 4)
- | ((in[3 + inpos] & 3) << 6)
- | ((in[4 + inpos] & 3) << 8)
- | ((in[5 + inpos] & 3) << 10)
- | ((in[6 + inpos] & 3) << 12)
- | ((in[7 + inpos] & 3) << 14)
- | ((in[8 + inpos] & 3) << 16)
- | ((in[9 + inpos] & 3) << 18)
- | ((in[10 + inpos] & 3) << 20)
- | ((in[11 + inpos] & 3) << 22)
- | ((in[12 + inpos] & 3) << 24)
- | ((in[13 + inpos] & 3) << 26)
- | ((in[14 + inpos] & 3) << 28)
- | ((in[15 + inpos]) << 30);
- out[1 + outpos] = (in[16 + inpos] & 3)
- | ((in[17 + inpos] & 3) << 2)
- | ((in[18 + inpos] & 3) << 4)
- | ((in[19 + inpos] & 3) << 6)
- | ((in[20 + inpos] & 3) << 8)
- | ((in[21 + inpos] & 3) << 10)
- | ((in[22 + inpos] & 3) << 12)
- | ((in[23 + inpos] & 3) << 14)
- | ((in[24 + inpos] & 3) << 16)
- | ((in[25 + inpos] & 3) << 18)
- | ((in[26 + inpos] & 3) << 20)
- | ((in[27 + inpos] & 3) << 22)
- | ((in[28 + inpos] & 3) << 24)
- | ((in[29 + inpos] & 3) << 26)
- | ((in[30 + inpos] & 3) << 28)
- | ((in[31 + inpos]) << 30);
+ System.arraycopy(in, inpos, out, outpos, 32);
}
- protected static void fastpack3(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 7)
- | ((in[1 + inpos] & 7) << 3)
- | ((in[2 + inpos] & 7) << 6)
- | ((in[3 + inpos] & 7) << 9)
- | ((in[4 + inpos] & 7) << 12)
- | ((in[5 + inpos] & 7) << 15)
- | ((in[6 + inpos] & 7) << 18)
- | ((in[7 + inpos] & 7) << 21)
- | ((in[8 + inpos] & 7) << 24)
- | ((in[9 + inpos] & 7) << 27)
- | ((in[10 + inpos]) << 30);
- out[1 + outpos] = ((in[10 + inpos] & 7) >>> (3 - 1))
- | ((in[11 + inpos] & 7) << 1)
- | ((in[12 + inpos] & 7) << 4)
- | ((in[13 + inpos] & 7) << 7)
- | ((in[14 + inpos] & 7) << 10)
- | ((in[15 + inpos] & 7) << 13)
- | ((in[16 + inpos] & 7) << 16)
- | ((in[17 + inpos] & 7) << 19)
- | ((in[18 + inpos] & 7) << 22)
- | ((in[19 + inpos] & 7) << 25)
- | ((in[20 + inpos] & 7) << 28)
- | ((in[21 + inpos]) << 31);
- out[2 + outpos] = ((in[21 + inpos] & 7) >>> (3 - 2))
- | ((in[22 + inpos] & 7) << 2)
- | ((in[23 + inpos] & 7) << 5)
- | ((in[24 + inpos] & 7) << 8)
- | ((in[25 + inpos] & 7) << 11)
- | ((in[26 + inpos] & 7) << 14)
- | ((in[27 + inpos] & 7) << 17)
- | ((in[28 + inpos] & 7) << 20)
- | ((in[29 + inpos] & 7) << 23)
- | ((in[30 + inpos] & 7) << 26)
- | ((in[31 + inpos]) << 29);
- }
-
- protected static void fastpack4(final int[] in, int inpos,
+ protected static void fastpack4(final int[] in, int inpos,
final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] & 15)
| ((in[1 + inpos] & 15) << 4)
@@ -1548,1536 +1696,1482 @@ protected static void fastpack9(final int[] in, int inpos,
| ((in[31 + inpos]) << 23);
}
- protected static void fastpack10(final int[] in, int inpos,
+ /**
+ * Unpack 32 integers
+ *
+ * @param in
+ * source array
+ * @param inpos
+ * position in source array
+ * @param out
+ * output array
+ * @param outpos
+ * position in output array
+ * @param bit
+ * number of bits to use per integer
+ */
+ public static void fastpackwithoutmask(final int[] in, final int inpos,
+ final int[] out, final int outpos, final int bit) {
+ switch (bit) {
+ case 0:
+ fastpackwithoutmask0(in, inpos, out, outpos);
+ break;
+ case 1:
+ fastpackwithoutmask1(in, inpos, out, outpos);
+ break;
+ case 2:
+ fastpackwithoutmask2(in, inpos, out, outpos);
+ break;
+ case 3:
+ fastpackwithoutmask3(in, inpos, out, outpos);
+ break;
+ case 4:
+ fastpackwithoutmask4(in, inpos, out, outpos);
+ break;
+ case 5:
+ fastpackwithoutmask5(in, inpos, out, outpos);
+ break;
+ case 6:
+ fastpackwithoutmask6(in, inpos, out, outpos);
+ break;
+ case 7:
+ fastpackwithoutmask7(in, inpos, out, outpos);
+ break;
+ case 8:
+ fastpackwithoutmask8(in, inpos, out, outpos);
+ break;
+ case 9:
+ fastpackwithoutmask9(in, inpos, out, outpos);
+ break;
+ case 10:
+ fastpackwithoutmask10(in, inpos, out, outpos);
+ break;
+ case 11:
+ fastpackwithoutmask11(in, inpos, out, outpos);
+ break;
+ case 12:
+ fastpackwithoutmask12(in, inpos, out, outpos);
+ break;
+ case 13:
+ fastpackwithoutmask13(in, inpos, out, outpos);
+ break;
+ case 14:
+ fastpackwithoutmask14(in, inpos, out, outpos);
+ break;
+ case 15:
+ fastpackwithoutmask15(in, inpos, out, outpos);
+ break;
+ case 16:
+ fastpackwithoutmask16(in, inpos, out, outpos);
+ break;
+ case 17:
+ fastpackwithoutmask17(in, inpos, out, outpos);
+ break;
+ case 18:
+ fastpackwithoutmask18(in, inpos, out, outpos);
+ break;
+ case 19:
+ fastpackwithoutmask19(in, inpos, out, outpos);
+ break;
+ case 20:
+ fastpackwithoutmask20(in, inpos, out, outpos);
+ break;
+ case 21:
+ fastpackwithoutmask21(in, inpos, out, outpos);
+ break;
+ case 22:
+ fastpackwithoutmask22(in, inpos, out, outpos);
+ break;
+ case 23:
+ fastpackwithoutmask23(in, inpos, out, outpos);
+ break;
+ case 24:
+ fastpackwithoutmask24(in, inpos, out, outpos);
+ break;
+ case 25:
+ fastpackwithoutmask25(in, inpos, out, outpos);
+ break;
+ case 26:
+ fastpackwithoutmask26(in, inpos, out, outpos);
+ break;
+ case 27:
+ fastpackwithoutmask27(in, inpos, out, outpos);
+ break;
+ case 28:
+ fastpackwithoutmask28(in, inpos, out, outpos);
+ break;
+ case 29:
+ fastpackwithoutmask29(in, inpos, out, outpos);
+ break;
+ case 30:
+ fastpackwithoutmask30(in, inpos, out, outpos);
+ break;
+ case 31:
+ fastpackwithoutmask31(in, inpos, out, outpos);
+ break;
+ case 32:
+ fastpackwithoutmask32(in, inpos, out, outpos);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unsupported bit width.");
+ }
+ }
+
+ protected static void fastpackwithoutmask0(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 1023)
- | ((in[1 + inpos] & 1023) << 10)
- | ((in[2 + inpos] & 1023) << 20)
- | ((in[3 + inpos]) << 30);
- out[1 + outpos] = ((in[3 + inpos] & 1023) >>> (10 - 8))
- | ((in[4 + inpos] & 1023) << 8)
- | ((in[5 + inpos] & 1023) << 18)
+ // nothing
+ }
+
+ protected static void fastpackwithoutmask1(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 1)
+ | ((in[2 + inpos]) << 2) | ((in[3 + inpos]) << 3)
+ | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 5)
+ | ((in[6 + inpos]) << 6) | ((in[7 + inpos]) << 7)
+ | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 9)
+ | ((in[10 + inpos]) << 10) | ((in[11 + inpos]) << 11)
+ | ((in[12 + inpos]) << 12) | ((in[13 + inpos]) << 13)
+ | ((in[14 + inpos]) << 14) | ((in[15 + inpos]) << 15)
+ | ((in[16 + inpos]) << 16) | ((in[17 + inpos]) << 17)
+ | ((in[18 + inpos]) << 18) | ((in[19 + inpos]) << 19)
+ | ((in[20 + inpos]) << 20) | ((in[21 + inpos]) << 21)
+ | ((in[22 + inpos]) << 22) | ((in[23 + inpos]) << 23)
+ | ((in[24 + inpos]) << 24) | ((in[25 + inpos]) << 25)
+ | ((in[26 + inpos]) << 26) | ((in[27 + inpos]) << 27)
+ | ((in[28 + inpos]) << 28) | ((in[29 + inpos]) << 29)
+ | ((in[30 + inpos]) << 30) | ((in[31 + inpos]) << 31);
+ }
+
+ protected static void fastpackwithoutmask10(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 10)
+ | ((in[2 + inpos]) << 20) | ((in[3 + inpos]) << 30);
+ out[1 + outpos] = ((in[3 + inpos]) >>> (10 - 8))
+ | ((in[4 + inpos]) << 8) | ((in[5 + inpos]) << 18)
| ((in[6 + inpos]) << 28);
- out[2 + outpos] = ((in[6 + inpos] & 1023) >>> (10 - 6))
- | ((in[7 + inpos] & 1023) << 6)
- | ((in[8 + inpos] & 1023) << 16)
+ out[2 + outpos] = ((in[6 + inpos]) >>> (10 - 6))
+ | ((in[7 + inpos]) << 6) | ((in[8 + inpos]) << 16)
| ((in[9 + inpos]) << 26);
- out[3 + outpos] = ((in[9 + inpos] & 1023) >>> (10 - 4))
- | ((in[10 + inpos] & 1023) << 4)
- | ((in[11 + inpos] & 1023) << 14)
+ out[3 + outpos] = ((in[9 + inpos]) >>> (10 - 4))
+ | ((in[10 + inpos]) << 4) | ((in[11 + inpos]) << 14)
| ((in[12 + inpos]) << 24);
- out[4 + outpos] = ((in[12 + inpos] & 1023) >>> (10 - 2))
- | ((in[13 + inpos] & 1023) << 2)
- | ((in[14 + inpos] & 1023) << 12)
+ out[4 + outpos] = ((in[12 + inpos]) >>> (10 - 2))
+ | ((in[13 + inpos]) << 2) | ((in[14 + inpos]) << 12)
| ((in[15 + inpos]) << 22);
- out[5 + outpos] = (in[16 + inpos] & 1023)
- | ((in[17 + inpos] & 1023) << 10)
- | ((in[18 + inpos] & 1023) << 20)
- | ((in[19 + inpos]) << 30);
- out[6 + outpos] = ((in[19 + inpos] & 1023) >>> (10 - 8))
- | ((in[20 + inpos] & 1023) << 8)
- | ((in[21 + inpos] & 1023) << 18)
+ out[5 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 10)
+ | ((in[18 + inpos]) << 20) | ((in[19 + inpos]) << 30);
+ out[6 + outpos] = ((in[19 + inpos]) >>> (10 - 8))
+ | ((in[20 + inpos]) << 8) | ((in[21 + inpos]) << 18)
| ((in[22 + inpos]) << 28);
- out[7 + outpos] = ((in[22 + inpos] & 1023) >>> (10 - 6))
- | ((in[23 + inpos] & 1023) << 6)
- | ((in[24 + inpos] & 1023) << 16)
+ out[7 + outpos] = ((in[22 + inpos]) >>> (10 - 6))
+ | ((in[23 + inpos]) << 6) | ((in[24 + inpos]) << 16)
| ((in[25 + inpos]) << 26);
- out[8 + outpos] = ((in[25 + inpos] & 1023) >>> (10 - 4))
- | ((in[26 + inpos] & 1023) << 4)
- | ((in[27 + inpos] & 1023) << 14)
+ out[8 + outpos] = ((in[25 + inpos]) >>> (10 - 4))
+ | ((in[26 + inpos]) << 4) | ((in[27 + inpos]) << 14)
| ((in[28 + inpos]) << 24);
- out[9 + outpos] = ((in[28 + inpos] & 1023) >>> (10 - 2))
- | ((in[29 + inpos] & 1023) << 2)
- | ((in[30 + inpos] & 1023) << 12)
+ out[9 + outpos] = ((in[28 + inpos]) >>> (10 - 2))
+ | ((in[29 + inpos]) << 2) | ((in[30 + inpos]) << 12)
| ((in[31 + inpos]) << 22);
}
- protected static void fastpack11(final int[] in, int inpos,
+ protected static void fastpackwithoutmask11(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 2047)
- | ((in[1 + inpos] & 2047) << 11)
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 11)
| ((in[2 + inpos]) << 22);
- out[1 + outpos] = ((in[2 + inpos] & 2047) >>> (11 - 1))
- | ((in[3 + inpos] & 2047) << 1)
- | ((in[4 + inpos] & 2047) << 12)
+ out[1 + outpos] = ((in[2 + inpos]) >>> (11 - 1))
+ | ((in[3 + inpos]) << 1) | ((in[4 + inpos]) << 12)
| ((in[5 + inpos]) << 23);
- out[2 + outpos] = ((in[5 + inpos] & 2047) >>> (11 - 2))
- | ((in[6 + inpos] & 2047) << 2)
- | ((in[7 + inpos] & 2047) << 13)
+ out[2 + outpos] = ((in[5 + inpos]) >>> (11 - 2))
+ | ((in[6 + inpos]) << 2) | ((in[7 + inpos]) << 13)
| ((in[8 + inpos]) << 24);
- out[3 + outpos] = ((in[8 + inpos] & 2047) >>> (11 - 3))
- | ((in[9 + inpos] & 2047) << 3)
- | ((in[10 + inpos] & 2047) << 14)
+ out[3 + outpos] = ((in[8 + inpos]) >>> (11 - 3))
+ | ((in[9 + inpos]) << 3) | ((in[10 + inpos]) << 14)
| ((in[11 + inpos]) << 25);
- out[4 + outpos] = ((in[11 + inpos] & 2047) >>> (11 - 4))
- | ((in[12 + inpos] & 2047) << 4)
- | ((in[13 + inpos] & 2047) << 15)
+ out[4 + outpos] = ((in[11 + inpos]) >>> (11 - 4))
+ | ((in[12 + inpos]) << 4) | ((in[13 + inpos]) << 15)
| ((in[14 + inpos]) << 26);
- out[5 + outpos] = ((in[14 + inpos] & 2047) >>> (11 - 5))
- | ((in[15 + inpos] & 2047) << 5)
- | ((in[16 + inpos] & 2047) << 16)
+ out[5 + outpos] = ((in[14 + inpos]) >>> (11 - 5))
+ | ((in[15 + inpos]) << 5) | ((in[16 + inpos]) << 16)
| ((in[17 + inpos]) << 27);
- out[6 + outpos] = ((in[17 + inpos] & 2047) >>> (11 - 6))
- | ((in[18 + inpos] & 2047) << 6)
- | ((in[19 + inpos] & 2047) << 17)
+ out[6 + outpos] = ((in[17 + inpos]) >>> (11 - 6))
+ | ((in[18 + inpos]) << 6) | ((in[19 + inpos]) << 17)
| ((in[20 + inpos]) << 28);
- out[7 + outpos] = ((in[20 + inpos] & 2047) >>> (11 - 7))
- | ((in[21 + inpos] & 2047) << 7)
- | ((in[22 + inpos] & 2047) << 18)
+ out[7 + outpos] = ((in[20 + inpos]) >>> (11 - 7))
+ | ((in[21 + inpos]) << 7) | ((in[22 + inpos]) << 18)
| ((in[23 + inpos]) << 29);
- out[8 + outpos] = ((in[23 + inpos] & 2047) >>> (11 - 8))
- | ((in[24 + inpos] & 2047) << 8)
- | ((in[25 + inpos] & 2047) << 19)
+ out[8 + outpos] = ((in[23 + inpos]) >>> (11 - 8))
+ | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 19)
| ((in[26 + inpos]) << 30);
- out[9 + outpos] = ((in[26 + inpos] & 2047) >>> (11 - 9))
- | ((in[27 + inpos] & 2047) << 9)
- | ((in[28 + inpos] & 2047) << 20)
+ out[9 + outpos] = ((in[26 + inpos]) >>> (11 - 9))
+ | ((in[27 + inpos]) << 9) | ((in[28 + inpos]) << 20)
| ((in[29 + inpos]) << 31);
- out[10 + outpos] = ((in[29 + inpos] & 2047) >>> (11 - 10))
- | ((in[30 + inpos] & 2047) << 10)
- | ((in[31 + inpos]) << 21);
+ out[10 + outpos] = ((in[29 + inpos]) >>> (11 - 10))
+ | ((in[30 + inpos]) << 10) | ((in[31 + inpos]) << 21);
}
- protected static void fastpack12(final int[] in, int inpos,
+ protected static void fastpackwithoutmask12(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 4095)
- | ((in[1 + inpos] & 4095) << 12)
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 12)
| ((in[2 + inpos]) << 24);
- out[1 + outpos] = ((in[2 + inpos] & 4095) >>> (12 - 4))
- | ((in[3 + inpos] & 4095) << 4)
- | ((in[4 + inpos] & 4095) << 16)
+ out[1 + outpos] = ((in[2 + inpos]) >>> (12 - 4))
+ | ((in[3 + inpos]) << 4) | ((in[4 + inpos]) << 16)
| ((in[5 + inpos]) << 28);
- out[2 + outpos] = ((in[5 + inpos] & 4095) >>> (12 - 8))
- | ((in[6 + inpos] & 4095) << 8)
- | ((in[7 + inpos]) << 20);
- out[3 + outpos] = (in[8 + inpos] & 4095)
- | ((in[9 + inpos] & 4095) << 12)
+ out[2 + outpos] = ((in[5 + inpos]) >>> (12 - 8))
+ | ((in[6 + inpos]) << 8) | ((in[7 + inpos]) << 20);
+ out[3 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 12)
| ((in[10 + inpos]) << 24);
- out[4 + outpos] = ((in[10 + inpos] & 4095) >>> (12 - 4))
- | ((in[11 + inpos] & 4095) << 4)
- | ((in[12 + inpos] & 4095) << 16)
+ out[4 + outpos] = ((in[10 + inpos]) >>> (12 - 4))
+ | ((in[11 + inpos]) << 4) | ((in[12 + inpos]) << 16)
| ((in[13 + inpos]) << 28);
- out[5 + outpos] = ((in[13 + inpos] & 4095) >>> (12 - 8))
- | ((in[14 + inpos] & 4095) << 8)
- | ((in[15 + inpos]) << 20);
- out[6 + outpos] = (in[16 + inpos] & 4095)
- | ((in[17 + inpos] & 4095) << 12)
+ out[5 + outpos] = ((in[13 + inpos]) >>> (12 - 8))
+ | ((in[14 + inpos]) << 8) | ((in[15 + inpos]) << 20);
+ out[6 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 12)
| ((in[18 + inpos]) << 24);
- out[7 + outpos] = ((in[18 + inpos] & 4095) >>> (12 - 4))
- | ((in[19 + inpos] & 4095) << 4)
- | ((in[20 + inpos] & 4095) << 16)
+ out[7 + outpos] = ((in[18 + inpos]) >>> (12 - 4))
+ | ((in[19 + inpos]) << 4) | ((in[20 + inpos]) << 16)
| ((in[21 + inpos]) << 28);
- out[8 + outpos] = ((in[21 + inpos] & 4095) >>> (12 - 8))
- | ((in[22 + inpos] & 4095) << 8)
- | ((in[23 + inpos]) << 20);
- out[9 + outpos] = (in[24 + inpos] & 4095)
- | ((in[25 + inpos] & 4095) << 12)
+ out[8 + outpos] = ((in[21 + inpos]) >>> (12 - 8))
+ | ((in[22 + inpos]) << 8) | ((in[23 + inpos]) << 20);
+ out[9 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 12)
| ((in[26 + inpos]) << 24);
- out[10 + outpos] = ((in[26 + inpos] & 4095) >>> (12 - 4))
- | ((in[27 + inpos] & 4095) << 4)
- | ((in[28 + inpos] & 4095) << 16)
+ out[10 + outpos] = ((in[26 + inpos]) >>> (12 - 4))
+ | ((in[27 + inpos]) << 4) | ((in[28 + inpos]) << 16)
| ((in[29 + inpos]) << 28);
- out[11 + outpos] = ((in[29 + inpos] & 4095) >>> (12 - 8))
- | ((in[30 + inpos] & 4095) << 8)
- | ((in[31 + inpos]) << 20);
+ out[11 + outpos] = ((in[29 + inpos]) >>> (12 - 8))
+ | ((in[30 + inpos]) << 8) | ((in[31 + inpos]) << 20);
}
- protected static void fastpack13(final int[] in, int inpos,
+ protected static void fastpackwithoutmask13(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 8191)
- | ((in[1 + inpos] & 8191) << 13)
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 13)
| ((in[2 + inpos]) << 26);
- out[1 + outpos] = ((in[2 + inpos] & 8191) >>> (13 - 7))
- | ((in[3 + inpos] & 8191) << 7)
- | ((in[4 + inpos]) << 20);
- out[2 + outpos] = ((in[4 + inpos] & 8191) >>> (13 - 1))
- | ((in[5 + inpos] & 8191) << 1)
- | ((in[6 + inpos] & 8191) << 14)
+ out[1 + outpos] = ((in[2 + inpos]) >>> (13 - 7))
+ | ((in[3 + inpos]) << 7) | ((in[4 + inpos]) << 20);
+ out[2 + outpos] = ((in[4 + inpos]) >>> (13 - 1))
+ | ((in[5 + inpos]) << 1) | ((in[6 + inpos]) << 14)
| ((in[7 + inpos]) << 27);
- out[3 + outpos] = ((in[7 + inpos] & 8191) >>> (13 - 8))
- | ((in[8 + inpos] & 8191) << 8)
- | ((in[9 + inpos]) << 21);
- out[4 + outpos] = ((in[9 + inpos] & 8191) >>> (13 - 2))
- | ((in[10 + inpos] & 8191) << 2)
- | ((in[11 + inpos] & 8191) << 15)
+ out[3 + outpos] = ((in[7 + inpos]) >>> (13 - 8))
+ | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 21);
+ out[4 + outpos] = ((in[9 + inpos]) >>> (13 - 2))
+ | ((in[10 + inpos]) << 2) | ((in[11 + inpos]) << 15)
| ((in[12 + inpos]) << 28);
- out[5 + outpos] = ((in[12 + inpos] & 8191) >>> (13 - 9))
- | ((in[13 + inpos] & 8191) << 9)
- | ((in[14 + inpos]) << 22);
- out[6 + outpos] = ((in[14 + inpos] & 8191) >>> (13 - 3))
- | ((in[15 + inpos] & 8191) << 3)
- | ((in[16 + inpos] & 8191) << 16)
+ out[5 + outpos] = ((in[12 + inpos]) >>> (13 - 9))
+ | ((in[13 + inpos]) << 9) | ((in[14 + inpos]) << 22);
+ out[6 + outpos] = ((in[14 + inpos]) >>> (13 - 3))
+ | ((in[15 + inpos]) << 3) | ((in[16 + inpos]) << 16)
| ((in[17 + inpos]) << 29);
- out[7 + outpos] = ((in[17 + inpos] & 8191) >>> (13 - 10))
- | ((in[18 + inpos] & 8191) << 10)
- | ((in[19 + inpos]) << 23);
- out[8 + outpos] = ((in[19 + inpos] & 8191) >>> (13 - 4))
- | ((in[20 + inpos] & 8191) << 4)
- | ((in[21 + inpos] & 8191) << 17)
+ out[7 + outpos] = ((in[17 + inpos]) >>> (13 - 10))
+ | ((in[18 + inpos]) << 10) | ((in[19 + inpos]) << 23);
+ out[8 + outpos] = ((in[19 + inpos]) >>> (13 - 4))
+ | ((in[20 + inpos]) << 4) | ((in[21 + inpos]) << 17)
| ((in[22 + inpos]) << 30);
- out[9 + outpos] = ((in[22 + inpos] & 8191) >>> (13 - 11))
- | ((in[23 + inpos] & 8191) << 11)
- | ((in[24 + inpos]) << 24);
- out[10 + outpos] = ((in[24 + inpos] & 8191) >>> (13 - 5))
- | ((in[25 + inpos] & 8191) << 5)
- | ((in[26 + inpos] & 8191) << 18)
+ out[9 + outpos] = ((in[22 + inpos]) >>> (13 - 11))
+ | ((in[23 + inpos]) << 11) | ((in[24 + inpos]) << 24);
+ out[10 + outpos] = ((in[24 + inpos]) >>> (13 - 5))
+ | ((in[25 + inpos]) << 5) | ((in[26 + inpos]) << 18)
| ((in[27 + inpos]) << 31);
- out[11 + outpos] = ((in[27 + inpos] & 8191) >>> (13 - 12))
- | ((in[28 + inpos] & 8191) << 12)
- | ((in[29 + inpos]) << 25);
- out[12 + outpos] = ((in[29 + inpos] & 8191) >>> (13 - 6))
- | ((in[30 + inpos] & 8191) << 6)
- | ((in[31 + inpos]) << 19);
+ out[11 + outpos] = ((in[27 + inpos]) >>> (13 - 12))
+ | ((in[28 + inpos]) << 12) | ((in[29 + inpos]) << 25);
+ out[12 + outpos] = ((in[29 + inpos]) >>> (13 - 6))
+ | ((in[30 + inpos]) << 6) | ((in[31 + inpos]) << 19);
}
- protected static void fastpack14(final int[] in, int inpos,
+ protected static void fastpackwithoutmask14(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 16383)
- | ((in[1 + inpos] & 16383) << 14)
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 14)
| ((in[2 + inpos]) << 28);
- out[1 + outpos] = ((in[2 + inpos] & 16383) >>> (14 - 10))
- | ((in[3 + inpos] & 16383) << 10)
- | ((in[4 + inpos]) << 24);
- out[2 + outpos] = ((in[4 + inpos] & 16383) >>> (14 - 6))
- | ((in[5 + inpos] & 16383) << 6)
- | ((in[6 + inpos]) << 20);
- out[3 + outpos] = ((in[6 + inpos] & 16383) >>> (14 - 2))
- | ((in[7 + inpos] & 16383) << 2)
- | ((in[8 + inpos] & 16383) << 16)
+ out[1 + outpos] = ((in[2 + inpos]) >>> (14 - 10))
+ | ((in[3 + inpos]) << 10) | ((in[4 + inpos]) << 24);
+ out[2 + outpos] = ((in[4 + inpos]) >>> (14 - 6))
+ | ((in[5 + inpos]) << 6) | ((in[6 + inpos]) << 20);
+ out[3 + outpos] = ((in[6 + inpos]) >>> (14 - 2))
+ | ((in[7 + inpos]) << 2) | ((in[8 + inpos]) << 16)
| ((in[9 + inpos]) << 30);
- out[4 + outpos] = ((in[9 + inpos] & 16383) >>> (14 - 12))
- | ((in[10 + inpos] & 16383) << 12)
- | ((in[11 + inpos]) << 26);
- out[5 + outpos] = ((in[11 + inpos] & 16383) >>> (14 - 8))
- | ((in[12 + inpos] & 16383) << 8)
- | ((in[13 + inpos]) << 22);
- out[6 + outpos] = ((in[13 + inpos] & 16383) >>> (14 - 4))
- | ((in[14 + inpos] & 16383) << 4)
- | ((in[15 + inpos]) << 18);
- out[7 + outpos] = (in[16 + inpos] & 16383)
- | ((in[17 + inpos] & 16383) << 14)
+ out[4 + outpos] = ((in[9 + inpos]) >>> (14 - 12))
+ | ((in[10 + inpos]) << 12) | ((in[11 + inpos]) << 26);
+ out[5 + outpos] = ((in[11 + inpos]) >>> (14 - 8))
+ | ((in[12 + inpos]) << 8) | ((in[13 + inpos]) << 22);
+ out[6 + outpos] = ((in[13 + inpos]) >>> (14 - 4))
+ | ((in[14 + inpos]) << 4) | ((in[15 + inpos]) << 18);
+ out[7 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 14)
| ((in[18 + inpos]) << 28);
- out[8 + outpos] = ((in[18 + inpos] & 16383) >>> (14 - 10))
- | ((in[19 + inpos] & 16383) << 10)
- | ((in[20 + inpos]) << 24);
- out[9 + outpos] = ((in[20 + inpos] & 16383) >>> (14 - 6))
- | ((in[21 + inpos] & 16383) << 6)
- | ((in[22 + inpos]) << 20);
- out[10 + outpos] = ((in[22 + inpos] & 16383) >>> (14 - 2))
- | ((in[23 + inpos] & 16383) << 2)
- | ((in[24 + inpos] & 16383) << 16)
+ out[8 + outpos] = ((in[18 + inpos]) >>> (14 - 10))
+ | ((in[19 + inpos]) << 10) | ((in[20 + inpos]) << 24);
+ out[9 + outpos] = ((in[20 + inpos]) >>> (14 - 6))
+ | ((in[21 + inpos]) << 6) | ((in[22 + inpos]) << 20);
+ out[10 + outpos] = ((in[22 + inpos]) >>> (14 - 2))
+ | ((in[23 + inpos]) << 2) | ((in[24 + inpos]) << 16)
| ((in[25 + inpos]) << 30);
- out[11 + outpos] = ((in[25 + inpos] & 16383) >>> (14 - 12))
- | ((in[26 + inpos] & 16383) << 12)
- | ((in[27 + inpos]) << 26);
- out[12 + outpos] = ((in[27 + inpos] & 16383) >>> (14 - 8))
- | ((in[28 + inpos] & 16383) << 8)
- | ((in[29 + inpos]) << 22);
- out[13 + outpos] = ((in[29 + inpos] & 16383) >>> (14 - 4))
- | ((in[30 + inpos] & 16383) << 4)
- | ((in[31 + inpos]) << 18);
+ out[11 + outpos] = ((in[25 + inpos]) >>> (14 - 12))
+ | ((in[26 + inpos]) << 12) | ((in[27 + inpos]) << 26);
+ out[12 + outpos] = ((in[27 + inpos]) >>> (14 - 8))
+ | ((in[28 + inpos]) << 8) | ((in[29 + inpos]) << 22);
+ out[13 + outpos] = ((in[29 + inpos]) >>> (14 - 4))
+ | ((in[30 + inpos]) << 4) | ((in[31 + inpos]) << 18);
}
- protected static void fastpack15(final int[] in, int inpos,
+ protected static void fastpackwithoutmask15(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 32767)
- | ((in[1 + inpos] & 32767) << 15)
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 15)
| ((in[2 + inpos]) << 30);
- out[1 + outpos] = ((in[2 + inpos] & 32767) >>> (15 - 13))
- | ((in[3 + inpos] & 32767) << 13)
- | ((in[4 + inpos]) << 28);
- out[2 + outpos] = ((in[4 + inpos] & 32767) >>> (15 - 11))
- | ((in[5 + inpos] & 32767) << 11)
- | ((in[6 + inpos]) << 26);
- out[3 + outpos] = ((in[6 + inpos] & 32767) >>> (15 - 9))
- | ((in[7 + inpos] & 32767) << 9)
- | ((in[8 + inpos]) << 24);
- out[4 + outpos] = ((in[8 + inpos] & 32767) >>> (15 - 7))
- | ((in[9 + inpos] & 32767) << 7)
- | ((in[10 + inpos]) << 22);
- out[5 + outpos] = ((in[10 + inpos] & 32767) >>> (15 - 5))
- | ((in[11 + inpos] & 32767) << 5)
- | ((in[12 + inpos]) << 20);
- out[6 + outpos] = ((in[12 + inpos] & 32767) >>> (15 - 3))
- | ((in[13 + inpos] & 32767) << 3)
- | ((in[14 + inpos]) << 18);
- out[7 + outpos] = ((in[14 + inpos] & 32767) >>> (15 - 1))
- | ((in[15 + inpos] & 32767) << 1)
- | ((in[16 + inpos] & 32767) << 16)
+ out[1 + outpos] = ((in[2 + inpos]) >>> (15 - 13))
+ | ((in[3 + inpos]) << 13) | ((in[4 + inpos]) << 28);
+ out[2 + outpos] = ((in[4 + inpos]) >>> (15 - 11))
+ | ((in[5 + inpos]) << 11) | ((in[6 + inpos]) << 26);
+ out[3 + outpos] = ((in[6 + inpos]) >>> (15 - 9))
+ | ((in[7 + inpos]) << 9) | ((in[8 + inpos]) << 24);
+ out[4 + outpos] = ((in[8 + inpos]) >>> (15 - 7))
+ | ((in[9 + inpos]) << 7) | ((in[10 + inpos]) << 22);
+ out[5 + outpos] = ((in[10 + inpos]) >>> (15 - 5))
+ | ((in[11 + inpos]) << 5) | ((in[12 + inpos]) << 20);
+ out[6 + outpos] = ((in[12 + inpos]) >>> (15 - 3))
+ | ((in[13 + inpos]) << 3) | ((in[14 + inpos]) << 18);
+ out[7 + outpos] = ((in[14 + inpos]) >>> (15 - 1))
+ | ((in[15 + inpos]) << 1) | ((in[16 + inpos]) << 16)
| ((in[17 + inpos]) << 31);
- out[8 + outpos] = ((in[17 + inpos] & 32767) >>> (15 - 14))
- | ((in[18 + inpos] & 32767) << 14)
- | ((in[19 + inpos]) << 29);
- out[9 + outpos] = ((in[19 + inpos] & 32767) >>> (15 - 12))
- | ((in[20 + inpos] & 32767) << 12)
- | ((in[21 + inpos]) << 27);
- out[10 + outpos] = ((in[21 + inpos] & 32767) >>> (15 - 10))
- | ((in[22 + inpos] & 32767) << 10)
- | ((in[23 + inpos]) << 25);
- out[11 + outpos] = ((in[23 + inpos] & 32767) >>> (15 - 8))
- | ((in[24 + inpos] & 32767) << 8)
- | ((in[25 + inpos]) << 23);
- out[12 + outpos] = ((in[25 + inpos] & 32767) >>> (15 - 6))
- | ((in[26 + inpos] & 32767) << 6)
- | ((in[27 + inpos]) << 21);
- out[13 + outpos] = ((in[27 + inpos] & 32767) >>> (15 - 4))
- | ((in[28 + inpos] & 32767) << 4)
- | ((in[29 + inpos]) << 19);
- out[14 + outpos] = ((in[29 + inpos] & 32767) >>> (15 - 2))
- | ((in[30 + inpos] & 32767) << 2)
- | ((in[31 + inpos]) << 17);
+ out[8 + outpos] = ((in[17 + inpos]) >>> (15 - 14))
+ | ((in[18 + inpos]) << 14) | ((in[19 + inpos]) << 29);
+ out[9 + outpos] = ((in[19 + inpos]) >>> (15 - 12))
+ | ((in[20 + inpos]) << 12) | ((in[21 + inpos]) << 27);
+ out[10 + outpos] = ((in[21 + inpos]) >>> (15 - 10))
+ | ((in[22 + inpos]) << 10) | ((in[23 + inpos]) << 25);
+ out[11 + outpos] = ((in[23 + inpos]) >>> (15 - 8))
+ | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 23);
+ out[12 + outpos] = ((in[25 + inpos]) >>> (15 - 6))
+ | ((in[26 + inpos]) << 6) | ((in[27 + inpos]) << 21);
+ out[13 + outpos] = ((in[27 + inpos]) >>> (15 - 4))
+ | ((in[28 + inpos]) << 4) | ((in[29 + inpos]) << 19);
+ out[14 + outpos] = ((in[29 + inpos]) >>> (15 - 2))
+ | ((in[30 + inpos]) << 2) | ((in[31 + inpos]) << 17);
}
- protected static void fastpack16(final int[] in, int inpos,
+ protected static void fastpackwithoutmask16(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 65535)
- | ((in[1 + inpos]) << 16);
- out[1 + outpos] = (in[2 + inpos] & 65535)
- | ((in[3 + inpos]) << 16);
- out[2 + outpos] = (in[4 + inpos] & 65535)
- | ((in[5 + inpos]) << 16);
- out[3 + outpos] = (in[6 + inpos] & 65535)
- | ((in[7 + inpos]) << 16);
- out[4 + outpos] = (in[8 + inpos] & 65535)
- | ((in[9 + inpos]) << 16);
- out[5 + outpos] = (in[10 + inpos] & 65535)
- | ((in[11 + inpos]) << 16);
- out[6 + outpos] = (in[12 + inpos] & 65535)
- | ((in[13 + inpos]) << 16);
- out[7 + outpos] = (in[14 + inpos] & 65535)
- | ((in[15 + inpos]) << 16);
- out[8 + outpos] = (in[16 + inpos] & 65535)
- | ((in[17 + inpos]) << 16);
- out[9 + outpos] = (in[18 + inpos] & 65535)
- | ((in[19 + inpos]) << 16);
- out[10 + outpos] = (in[20 + inpos] & 65535)
- | ((in[21 + inpos]) << 16);
- out[11 + outpos] = (in[22 + inpos] & 65535)
- | ((in[23 + inpos]) << 16);
- out[12 + outpos] = (in[24 + inpos] & 65535)
- | ((in[25 + inpos]) << 16);
- out[13 + outpos] = (in[26 + inpos] & 65535)
- | ((in[27 + inpos]) << 16);
- out[14 + outpos] = (in[28 + inpos] & 65535)
- | ((in[29 + inpos]) << 16);
- out[15 + outpos] = (in[30 + inpos] & 65535)
- | ((in[31 + inpos]) << 16);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 16);
+ out[1 + outpos] = in[2 + inpos] | ((in[3 + inpos]) << 16);
+ out[2 + outpos] = in[4 + inpos] | ((in[5 + inpos]) << 16);
+ out[3 + outpos] = in[6 + inpos] | ((in[7 + inpos]) << 16);
+ out[4 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 16);
+ out[5 + outpos] = in[10 + inpos] | ((in[11 + inpos]) << 16);
+ out[6 + outpos] = in[12 + inpos] | ((in[13 + inpos]) << 16);
+ out[7 + outpos] = in[14 + inpos] | ((in[15 + inpos]) << 16);
+ out[8 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 16);
+ out[9 + outpos] = in[18 + inpos] | ((in[19 + inpos]) << 16);
+ out[10 + outpos] = in[20 + inpos] | ((in[21 + inpos]) << 16);
+ out[11 + outpos] = in[22 + inpos] | ((in[23 + inpos]) << 16);
+ out[12 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 16);
+ out[13 + outpos] = in[26 + inpos] | ((in[27 + inpos]) << 16);
+ out[14 + outpos] = in[28 + inpos] | ((in[29 + inpos]) << 16);
+ out[15 + outpos] = in[30 + inpos] | ((in[31 + inpos]) << 16);
}
- protected static void fastpack17(final int[] in, int inpos,
+ protected static void fastpackwithoutmask17(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 131071)
- | ((in[1 + inpos]) << 17);
- out[1 + outpos] = ((in[1 + inpos] & 131071) >>> (17 - 2))
- | ((in[2 + inpos] & 131071) << 2)
- | ((in[3 + inpos]) << 19);
- out[2 + outpos] = ((in[3 + inpos] & 131071) >>> (17 - 4))
- | ((in[4 + inpos] & 131071) << 4)
- | ((in[5 + inpos]) << 21);
- out[3 + outpos] = ((in[5 + inpos] & 131071) >>> (17 - 6))
- | ((in[6 + inpos] & 131071) << 6)
- | ((in[7 + inpos]) << 23);
- out[4 + outpos] = ((in[7 + inpos] & 131071) >>> (17 - 8))
- | ((in[8 + inpos] & 131071) << 8)
- | ((in[9 + inpos]) << 25);
- out[5 + outpos] = ((in[9 + inpos] & 131071) >>> (17 - 10))
- | ((in[10 + inpos] & 131071) << 10)
- | ((in[11 + inpos]) << 27);
- out[6 + outpos] = ((in[11 + inpos] & 131071) >>> (17 - 12))
- | ((in[12 + inpos] & 131071) << 12)
- | ((in[13 + inpos]) << 29);
- out[7 + outpos] = ((in[13 + inpos] & 131071) >>> (17 - 14))
- | ((in[14 + inpos] & 131071) << 14)
- | ((in[15 + inpos]) << 31);
- out[8 + outpos] = ((in[15 + inpos] & 131071) >>> (17 - 16))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 17);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (17 - 2))
+ | ((in[2 + inpos]) << 2) | ((in[3 + inpos]) << 19);
+ out[2 + outpos] = ((in[3 + inpos]) >>> (17 - 4))
+ | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 21);
+ out[3 + outpos] = ((in[5 + inpos]) >>> (17 - 6))
+ | ((in[6 + inpos]) << 6) | ((in[7 + inpos]) << 23);
+ out[4 + outpos] = ((in[7 + inpos]) >>> (17 - 8))
+ | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 25);
+ out[5 + outpos] = ((in[9 + inpos]) >>> (17 - 10))
+ | ((in[10 + inpos]) << 10) | ((in[11 + inpos]) << 27);
+ out[6 + outpos] = ((in[11 + inpos]) >>> (17 - 12))
+ | ((in[12 + inpos]) << 12) | ((in[13 + inpos]) << 29);
+ out[7 + outpos] = ((in[13 + inpos]) >>> (17 - 14))
+ | ((in[14 + inpos]) << 14) | ((in[15 + inpos]) << 31);
+ out[8 + outpos] = ((in[15 + inpos]) >>> (17 - 16))
| ((in[16 + inpos]) << 16);
- out[9 + outpos] = ((in[16 + inpos] & 131071) >>> (17 - 1))
- | ((in[17 + inpos] & 131071) << 1)
- | ((in[18 + inpos]) << 18);
- out[10 + outpos] = ((in[18 + inpos] & 131071) >>> (17 - 3))
- | ((in[19 + inpos] & 131071) << 3)
- | ((in[20 + inpos]) << 20);
- out[11 + outpos] = ((in[20 + inpos] & 131071) >>> (17 - 5))
- | ((in[21 + inpos] & 131071) << 5)
- | ((in[22 + inpos]) << 22);
- out[12 + outpos] = ((in[22 + inpos] & 131071) >>> (17 - 7))
- | ((in[23 + inpos] & 131071) << 7)
- | ((in[24 + inpos]) << 24);
- out[13 + outpos] = ((in[24 + inpos] & 131071) >>> (17 - 9))
- | ((in[25 + inpos] & 131071) << 9)
- | ((in[26 + inpos]) << 26);
- out[14 + outpos] = ((in[26 + inpos] & 131071) >>> (17 - 11))
- | ((in[27 + inpos] & 131071) << 11)
- | ((in[28 + inpos]) << 28);
- out[15 + outpos] = ((in[28 + inpos] & 131071) >>> (17 - 13))
- | ((in[29 + inpos] & 131071) << 13)
- | ((in[30 + inpos]) << 30);
- out[16 + outpos] = ((in[30 + inpos] & 131071) >>> (17 - 15))
+ out[9 + outpos] = ((in[16 + inpos]) >>> (17 - 1))
+ | ((in[17 + inpos]) << 1) | ((in[18 + inpos]) << 18);
+ out[10 + outpos] = ((in[18 + inpos]) >>> (17 - 3))
+ | ((in[19 + inpos]) << 3) | ((in[20 + inpos]) << 20);
+ out[11 + outpos] = ((in[20 + inpos]) >>> (17 - 5))
+ | ((in[21 + inpos]) << 5) | ((in[22 + inpos]) << 22);
+ out[12 + outpos] = ((in[22 + inpos]) >>> (17 - 7))
+ | ((in[23 + inpos]) << 7) | ((in[24 + inpos]) << 24);
+ out[13 + outpos] = ((in[24 + inpos]) >>> (17 - 9))
+ | ((in[25 + inpos]) << 9) | ((in[26 + inpos]) << 26);
+ out[14 + outpos] = ((in[26 + inpos]) >>> (17 - 11))
+ | ((in[27 + inpos]) << 11) | ((in[28 + inpos]) << 28);
+ out[15 + outpos] = ((in[28 + inpos]) >>> (17 - 13))
+ | ((in[29 + inpos]) << 13) | ((in[30 + inpos]) << 30);
+ out[16 + outpos] = ((in[30 + inpos]) >>> (17 - 15))
| ((in[31 + inpos]) << 15);
}
- protected static void fastpack18(final int[] in, int inpos,
+ protected static void fastpackwithoutmask18(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 262143)
- | ((in[1 + inpos]) << 18);
- out[1 + outpos] = ((in[1 + inpos] & 262143) >>> (18 - 4))
- | ((in[2 + inpos] & 262143) << 4)
- | ((in[3 + inpos]) << 22);
- out[2 + outpos] = ((in[3 + inpos] & 262143) >>> (18 - 8))
- | ((in[4 + inpos] & 262143) << 8)
- | ((in[5 + inpos]) << 26);
- out[3 + outpos] = ((in[5 + inpos] & 262143) >>> (18 - 12))
- | ((in[6 + inpos] & 262143) << 12)
- | ((in[7 + inpos]) << 30);
- out[4 + outpos] = ((in[7 + inpos] & 262143) >>> (18 - 16))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 18);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (18 - 4))
+ | ((in[2 + inpos]) << 4) | ((in[3 + inpos]) << 22);
+ out[2 + outpos] = ((in[3 + inpos]) >>> (18 - 8))
+ | ((in[4 + inpos]) << 8) | ((in[5 + inpos]) << 26);
+ out[3 + outpos] = ((in[5 + inpos]) >>> (18 - 12))
+ | ((in[6 + inpos]) << 12) | ((in[7 + inpos]) << 30);
+ out[4 + outpos] = ((in[7 + inpos]) >>> (18 - 16))
| ((in[8 + inpos]) << 16);
- out[5 + outpos] = ((in[8 + inpos] & 262143) >>> (18 - 2))
- | ((in[9 + inpos] & 262143) << 2)
- | ((in[10 + inpos]) << 20);
- out[6 + outpos] = ((in[10 + inpos] & 262143) >>> (18 - 6))
- | ((in[11 + inpos] & 262143) << 6)
- | ((in[12 + inpos]) << 24);
- out[7 + outpos] = ((in[12 + inpos] & 262143) >>> (18 - 10))
- | ((in[13 + inpos] & 262143) << 10)
- | ((in[14 + inpos]) << 28);
- out[8 + outpos] = ((in[14 + inpos] & 262143) >>> (18 - 14))
+ out[5 + outpos] = ((in[8 + inpos]) >>> (18 - 2))
+ | ((in[9 + inpos]) << 2) | ((in[10 + inpos]) << 20);
+ out[6 + outpos] = ((in[10 + inpos]) >>> (18 - 6))
+ | ((in[11 + inpos]) << 6) | ((in[12 + inpos]) << 24);
+ out[7 + outpos] = ((in[12 + inpos]) >>> (18 - 10))
+ | ((in[13 + inpos]) << 10) | ((in[14 + inpos]) << 28);
+ out[8 + outpos] = ((in[14 + inpos]) >>> (18 - 14))
| ((in[15 + inpos]) << 14);
- out[9 + outpos] = (in[16 + inpos] & 262143)
- | ((in[17 + inpos]) << 18);
- out[10 + outpos] = ((in[17 + inpos] & 262143) >>> (18 - 4))
- | ((in[18 + inpos] & 262143) << 4)
- | ((in[19 + inpos]) << 22);
- out[11 + outpos] = ((in[19 + inpos] & 262143) >>> (18 - 8))
- | ((in[20 + inpos] & 262143) << 8)
- | ((in[21 + inpos]) << 26);
- out[12 + outpos] = ((in[21 + inpos] & 262143) >>> (18 - 12))
- | ((in[22 + inpos] & 262143) << 12)
- | ((in[23 + inpos]) << 30);
- out[13 + outpos] = ((in[23 + inpos] & 262143) >>> (18 - 16))
+ out[9 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 18);
+ out[10 + outpos] = ((in[17 + inpos]) >>> (18 - 4))
+ | ((in[18 + inpos]) << 4) | ((in[19 + inpos]) << 22);
+ out[11 + outpos] = ((in[19 + inpos]) >>> (18 - 8))
+ | ((in[20 + inpos]) << 8) | ((in[21 + inpos]) << 26);
+ out[12 + outpos] = ((in[21 + inpos]) >>> (18 - 12))
+ | ((in[22 + inpos]) << 12) | ((in[23 + inpos]) << 30);
+ out[13 + outpos] = ((in[23 + inpos]) >>> (18 - 16))
| ((in[24 + inpos]) << 16);
- out[14 + outpos] = ((in[24 + inpos] & 262143) >>> (18 - 2))
- | ((in[25 + inpos] & 262143) << 2)
- | ((in[26 + inpos]) << 20);
- out[15 + outpos] = ((in[26 + inpos] & 262143) >>> (18 - 6))
- | ((in[27 + inpos] & 262143) << 6)
- | ((in[28 + inpos]) << 24);
- out[16 + outpos] = ((in[28 + inpos] & 262143) >>> (18 - 10))
- | ((in[29 + inpos] & 262143) << 10)
- | ((in[30 + inpos]) << 28);
- out[17 + outpos] = ((in[30 + inpos] & 262143) >>> (18 - 14))
+ out[14 + outpos] = ((in[24 + inpos]) >>> (18 - 2))
+ | ((in[25 + inpos]) << 2) | ((in[26 + inpos]) << 20);
+ out[15 + outpos] = ((in[26 + inpos]) >>> (18 - 6))
+ | ((in[27 + inpos]) << 6) | ((in[28 + inpos]) << 24);
+ out[16 + outpos] = ((in[28 + inpos]) >>> (18 - 10))
+ | ((in[29 + inpos]) << 10) | ((in[30 + inpos]) << 28);
+ out[17 + outpos] = ((in[30 + inpos]) >>> (18 - 14))
| ((in[31 + inpos]) << 14);
}
- protected static void fastpack19(final int[] in, int inpos,
+ protected static void fastpackwithoutmask19(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 524287)
- | ((in[1 + inpos]) << 19);
- out[1 + outpos] = ((in[1 + inpos] & 524287) >>> (19 - 6))
- | ((in[2 + inpos] & 524287) << 6)
- | ((in[3 + inpos]) << 25);
- out[2 + outpos] = ((in[3 + inpos] & 524287) >>> (19 - 12))
- | ((in[4 + inpos] & 524287) << 12)
- | ((in[5 + inpos]) << 31);
- out[3 + outpos] = ((in[5 + inpos] & 524287) >>> (19 - 18))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 19);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (19 - 6))
+ | ((in[2 + inpos]) << 6) | ((in[3 + inpos]) << 25);
+ out[2 + outpos] = ((in[3 + inpos]) >>> (19 - 12))
+ | ((in[4 + inpos]) << 12) | ((in[5 + inpos]) << 31);
+ out[3 + outpos] = ((in[5 + inpos]) >>> (19 - 18))
| ((in[6 + inpos]) << 18);
- out[4 + outpos] = ((in[6 + inpos] & 524287) >>> (19 - 5))
- | ((in[7 + inpos] & 524287) << 5)
- | ((in[8 + inpos]) << 24);
- out[5 + outpos] = ((in[8 + inpos] & 524287) >>> (19 - 11))
- | ((in[9 + inpos] & 524287) << 11)
- | ((in[10 + inpos]) << 30);
- out[6 + outpos] = ((in[10 + inpos] & 524287) >>> (19 - 17))
- | ((in[11 + inpos]) << 17);
- out[7 + outpos] = ((in[11 + inpos] & 524287) >>> (19 - 4))
- | ((in[12 + inpos] & 524287) << 4)
- | ((in[13 + inpos]) << 23);
- out[8 + outpos] = ((in[13 + inpos] & 524287) >>> (19 - 10))
- | ((in[14 + inpos] & 524287) << 10)
- | ((in[15 + inpos]) << 29);
- out[9 + outpos] = ((in[15 + inpos] & 524287) >>> (19 - 16))
+ out[4 + outpos] = ((in[6 + inpos]) >>> (19 - 5))
+ | ((in[7 + inpos]) << 5) | ((in[8 + inpos]) << 24);
+ out[5 + outpos] = ((in[8 + inpos]) >>> (19 - 11))
+ | ((in[9 + inpos]) << 11) | ((in[10 + inpos]) << 30);
+ out[6 + outpos] = ((in[10 + inpos]) >>> (19 - 17))
+ | ((in[11 + inpos]) << 17);
+ out[7 + outpos] = ((in[11 + inpos]) >>> (19 - 4))
+ | ((in[12 + inpos]) << 4) | ((in[13 + inpos]) << 23);
+ out[8 + outpos] = ((in[13 + inpos]) >>> (19 - 10))
+ | ((in[14 + inpos]) << 10) | ((in[15 + inpos]) << 29);
+ out[9 + outpos] = ((in[15 + inpos]) >>> (19 - 16))
| ((in[16 + inpos]) << 16);
- out[10 + outpos] = ((in[16 + inpos] & 524287) >>> (19 - 3))
- | ((in[17 + inpos] & 524287) << 3)
- | ((in[18 + inpos]) << 22);
- out[11 + outpos] = ((in[18 + inpos] & 524287) >>> (19 - 9))
- | ((in[19 + inpos] & 524287) << 9)
- | ((in[20 + inpos]) << 28);
- out[12 + outpos] = ((in[20 + inpos] & 524287) >>> (19 - 15))
+ out[10 + outpos] = ((in[16 + inpos]) >>> (19 - 3))
+ | ((in[17 + inpos]) << 3) | ((in[18 + inpos]) << 22);
+ out[11 + outpos] = ((in[18 + inpos]) >>> (19 - 9))
+ | ((in[19 + inpos]) << 9) | ((in[20 + inpos]) << 28);
+ out[12 + outpos] = ((in[20 + inpos]) >>> (19 - 15))
| ((in[21 + inpos]) << 15);
- out[13 + outpos] = ((in[21 + inpos] & 524287) >>> (19 - 2))
- | ((in[22 + inpos] & 524287) << 2)
- | ((in[23 + inpos]) << 21);
- out[14 + outpos] = ((in[23 + inpos] & 524287) >>> (19 - 8))
- | ((in[24 + inpos] & 524287) << 8)
- | ((in[25 + inpos]) << 27);
- out[15 + outpos] = ((in[25 + inpos] & 524287) >>> (19 - 14))
+ out[13 + outpos] = ((in[21 + inpos]) >>> (19 - 2))
+ | ((in[22 + inpos]) << 2) | ((in[23 + inpos]) << 21);
+ out[14 + outpos] = ((in[23 + inpos]) >>> (19 - 8))
+ | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 27);
+ out[15 + outpos] = ((in[25 + inpos]) >>> (19 - 14))
| ((in[26 + inpos]) << 14);
- out[16 + outpos] = ((in[26 + inpos] & 524287) >>> (19 - 1))
- | ((in[27 + inpos] & 524287) << 1)
- | ((in[28 + inpos]) << 20);
- out[17 + outpos] = ((in[28 + inpos] & 524287) >>> (19 - 7))
- | ((in[29 + inpos] & 524287) << 7)
- | ((in[30 + inpos]) << 26);
- out[18 + outpos] = ((in[30 + inpos] & 524287) >>> (19 - 13))
+ out[16 + outpos] = ((in[26 + inpos]) >>> (19 - 1))
+ | ((in[27 + inpos]) << 1) | ((in[28 + inpos]) << 20);
+ out[17 + outpos] = ((in[28 + inpos]) >>> (19 - 7))
+ | ((in[29 + inpos]) << 7) | ((in[30 + inpos]) << 26);
+ out[18 + outpos] = ((in[30 + inpos]) >>> (19 - 13))
| ((in[31 + inpos]) << 13);
}
- protected static void fastpack20(final int[] in, int inpos,
+ protected static void fastpackwithoutmask2(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 1048575)
- | ((in[1 + inpos]) << 20);
- out[1 + outpos] = ((in[1 + inpos] & 1048575) >>> (20 - 8))
- | ((in[2 + inpos] & 1048575) << 8)
- | ((in[3 + inpos]) << 28);
- out[2 + outpos] = ((in[3 + inpos] & 1048575) >>> (20 - 16))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 2)
+ | ((in[2 + inpos]) << 4) | ((in[3 + inpos]) << 6)
+ | ((in[4 + inpos]) << 8) | ((in[5 + inpos]) << 10)
+ | ((in[6 + inpos]) << 12) | ((in[7 + inpos]) << 14)
+ | ((in[8 + inpos]) << 16) | ((in[9 + inpos]) << 18)
+ | ((in[10 + inpos]) << 20) | ((in[11 + inpos]) << 22)
+ | ((in[12 + inpos]) << 24) | ((in[13 + inpos]) << 26)
+ | ((in[14 + inpos]) << 28) | ((in[15 + inpos]) << 30);
+ out[1 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 2)
+ | ((in[18 + inpos]) << 4) | ((in[19 + inpos]) << 6)
+ | ((in[20 + inpos]) << 8) | ((in[21 + inpos]) << 10)
+ | ((in[22 + inpos]) << 12) | ((in[23 + inpos]) << 14)
+ | ((in[24 + inpos]) << 16) | ((in[25 + inpos]) << 18)
+ | ((in[26 + inpos]) << 20) | ((in[27 + inpos]) << 22)
+ | ((in[28 + inpos]) << 24) | ((in[29 + inpos]) << 26)
+ | ((in[30 + inpos]) << 28) | ((in[31 + inpos]) << 30);
+ }
+
+ protected static void fastpackwithoutmask20(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 20);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (20 - 8))
+ | ((in[2 + inpos]) << 8) | ((in[3 + inpos]) << 28);
+ out[2 + outpos] = ((in[3 + inpos]) >>> (20 - 16))
| ((in[4 + inpos]) << 16);
- out[3 + outpos] = ((in[4 + inpos] & 1048575) >>> (20 - 4))
- | ((in[5 + inpos] & 1048575) << 4)
- | ((in[6 + inpos]) << 24);
- out[4 + outpos] = ((in[6 + inpos] & 1048575) >>> (20 - 12))
+ out[3 + outpos] = ((in[4 + inpos]) >>> (20 - 4))
+ | ((in[5 + inpos]) << 4) | ((in[6 + inpos]) << 24);
+ out[4 + outpos] = ((in[6 + inpos]) >>> (20 - 12))
| ((in[7 + inpos]) << 12);
- out[5 + outpos] = (in[8 + inpos] & 1048575)
- | ((in[9 + inpos]) << 20);
- out[6 + outpos] = ((in[9 + inpos] & 1048575) >>> (20 - 8))
- | ((in[10 + inpos] & 1048575) << 8)
- | ((in[11 + inpos]) << 28);
- out[7 + outpos] = ((in[11 + inpos] & 1048575) >>> (20 - 16))
+ out[5 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 20);
+ out[6 + outpos] = ((in[9 + inpos]) >>> (20 - 8))
+ | ((in[10 + inpos]) << 8) | ((in[11 + inpos]) << 28);
+ out[7 + outpos] = ((in[11 + inpos]) >>> (20 - 16))
| ((in[12 + inpos]) << 16);
- out[8 + outpos] = ((in[12 + inpos] & 1048575) >>> (20 - 4))
- | ((in[13 + inpos] & 1048575) << 4)
- | ((in[14 + inpos]) << 24);
- out[9 + outpos] = ((in[14 + inpos] & 1048575) >>> (20 - 12))
+ out[8 + outpos] = ((in[12 + inpos]) >>> (20 - 4))
+ | ((in[13 + inpos]) << 4) | ((in[14 + inpos]) << 24);
+ out[9 + outpos] = ((in[14 + inpos]) >>> (20 - 12))
| ((in[15 + inpos]) << 12);
- out[10 + outpos] = (in[16 + inpos] & 1048575)
- | ((in[17 + inpos]) << 20);
- out[11 + outpos] = ((in[17 + inpos] & 1048575) >>> (20 - 8))
- | ((in[18 + inpos] & 1048575) << 8)
- | ((in[19 + inpos]) << 28);
- out[12 + outpos] = ((in[19 + inpos] & 1048575) >>> (20 - 16))
+ out[10 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 20);
+ out[11 + outpos] = ((in[17 + inpos]) >>> (20 - 8))
+ | ((in[18 + inpos]) << 8) | ((in[19 + inpos]) << 28);
+ out[12 + outpos] = ((in[19 + inpos]) >>> (20 - 16))
| ((in[20 + inpos]) << 16);
- out[13 + outpos] = ((in[20 + inpos] & 1048575) >>> (20 - 4))
- | ((in[21 + inpos] & 1048575) << 4)
- | ((in[22 + inpos]) << 24);
- out[14 + outpos] = ((in[22 + inpos] & 1048575) >>> (20 - 12))
+ out[13 + outpos] = ((in[20 + inpos]) >>> (20 - 4))
+ | ((in[21 + inpos]) << 4) | ((in[22 + inpos]) << 24);
+ out[14 + outpos] = ((in[22 + inpos]) >>> (20 - 12))
| ((in[23 + inpos]) << 12);
- out[15 + outpos] = (in[24 + inpos] & 1048575)
- | ((in[25 + inpos]) << 20);
- out[16 + outpos] = ((in[25 + inpos] & 1048575) >>> (20 - 8))
- | ((in[26 + inpos] & 1048575) << 8)
- | ((in[27 + inpos]) << 28);
- out[17 + outpos] = ((in[27 + inpos] & 1048575) >>> (20 - 16))
+ out[15 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 20);
+ out[16 + outpos] = ((in[25 + inpos]) >>> (20 - 8))
+ | ((in[26 + inpos]) << 8) | ((in[27 + inpos]) << 28);
+ out[17 + outpos] = ((in[27 + inpos]) >>> (20 - 16))
| ((in[28 + inpos]) << 16);
- out[18 + outpos] = ((in[28 + inpos] & 1048575) >>> (20 - 4))
- | ((in[29 + inpos] & 1048575) << 4)
- | ((in[30 + inpos]) << 24);
- out[19 + outpos] = ((in[30 + inpos] & 1048575) >>> (20 - 12))
+ out[18 + outpos] = ((in[28 + inpos]) >>> (20 - 4))
+ | ((in[29 + inpos]) << 4) | ((in[30 + inpos]) << 24);
+ out[19 + outpos] = ((in[30 + inpos]) >>> (20 - 12))
| ((in[31 + inpos]) << 12);
}
- protected static void fastpack21(final int[] in, int inpos,
+ protected static void fastpackwithoutmask21(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 2097151)
- | ((in[1 + inpos]) << 21);
- out[1 + outpos] = ((in[1 + inpos] & 2097151) >>> (21 - 10))
- | ((in[2 + inpos] & 2097151) << 10)
- | ((in[3 + inpos]) << 31);
- out[2 + outpos] = ((in[3 + inpos] & 2097151) >>> (21 - 20))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 21);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (21 - 10))
+ | ((in[2 + inpos]) << 10) | ((in[3 + inpos]) << 31);
+ out[2 + outpos] = ((in[3 + inpos]) >>> (21 - 20))
| ((in[4 + inpos]) << 20);
- out[3 + outpos] = ((in[4 + inpos] & 2097151) >>> (21 - 9))
- | ((in[5 + inpos] & 2097151) << 9)
- | ((in[6 + inpos]) << 30);
- out[4 + outpos] = ((in[6 + inpos] & 2097151) >>> (21 - 19))
+ out[3 + outpos] = ((in[4 + inpos]) >>> (21 - 9))
+ | ((in[5 + inpos]) << 9) | ((in[6 + inpos]) << 30);
+ out[4 + outpos] = ((in[6 + inpos]) >>> (21 - 19))
| ((in[7 + inpos]) << 19);
- out[5 + outpos] = ((in[7 + inpos] & 2097151) >>> (21 - 8))
- | ((in[8 + inpos] & 2097151) << 8)
- | ((in[9 + inpos]) << 29);
- out[6 + outpos] = ((in[9 + inpos] & 2097151) >>> (21 - 18))
+ out[5 + outpos] = ((in[7 + inpos]) >>> (21 - 8))
+ | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 29);
+ out[6 + outpos] = ((in[9 + inpos]) >>> (21 - 18))
| ((in[10 + inpos]) << 18);
- out[7 + outpos] = ((in[10 + inpos] & 2097151) >>> (21 - 7))
- | ((in[11 + inpos] & 2097151) << 7)
- | ((in[12 + inpos]) << 28);
- out[8 + outpos] = ((in[12 + inpos] & 2097151) >>> (21 - 17))
+ out[7 + outpos] = ((in[10 + inpos]) >>> (21 - 7))
+ | ((in[11 + inpos]) << 7) | ((in[12 + inpos]) << 28);
+ out[8 + outpos] = ((in[12 + inpos]) >>> (21 - 17))
| ((in[13 + inpos]) << 17);
- out[9 + outpos] = ((in[13 + inpos] & 2097151) >>> (21 - 6))
- | ((in[14 + inpos] & 2097151) << 6)
- | ((in[15 + inpos]) << 27);
- out[10 + outpos] = ((in[15 + inpos] & 2097151) >>> (21 - 16))
+ out[9 + outpos] = ((in[13 + inpos]) >>> (21 - 6))
+ | ((in[14 + inpos]) << 6) | ((in[15 + inpos]) << 27);
+ out[10 + outpos] = ((in[15 + inpos]) >>> (21 - 16))
| ((in[16 + inpos]) << 16);
- out[11 + outpos] = ((in[16 + inpos] & 2097151) >>> (21 - 5))
- | ((in[17 + inpos] & 2097151) << 5)
- | ((in[18 + inpos]) << 26);
- out[12 + outpos] = ((in[18 + inpos] & 2097151) >>> (21 - 15))
+ out[11 + outpos] = ((in[16 + inpos]) >>> (21 - 5))
+ | ((in[17 + inpos]) << 5) | ((in[18 + inpos]) << 26);
+ out[12 + outpos] = ((in[18 + inpos]) >>> (21 - 15))
| ((in[19 + inpos]) << 15);
- out[13 + outpos] = ((in[19 + inpos] & 2097151) >>> (21 - 4))
- | ((in[20 + inpos] & 2097151) << 4)
- | ((in[21 + inpos]) << 25);
- out[14 + outpos] = ((in[21 + inpos] & 2097151) >>> (21 - 14))
+ out[13 + outpos] = ((in[19 + inpos]) >>> (21 - 4))
+ | ((in[20 + inpos]) << 4) | ((in[21 + inpos]) << 25);
+ out[14 + outpos] = ((in[21 + inpos]) >>> (21 - 14))
| ((in[22 + inpos]) << 14);
- out[15 + outpos] = ((in[22 + inpos] & 2097151) >>> (21 - 3))
- | ((in[23 + inpos] & 2097151) << 3)
- | ((in[24 + inpos]) << 24);
- out[16 + outpos] = ((in[24 + inpos] & 2097151) >>> (21 - 13))
+ out[15 + outpos] = ((in[22 + inpos]) >>> (21 - 3))
+ | ((in[23 + inpos]) << 3) | ((in[24 + inpos]) << 24);
+ out[16 + outpos] = ((in[24 + inpos]) >>> (21 - 13))
| ((in[25 + inpos]) << 13);
- out[17 + outpos] = ((in[25 + inpos] & 2097151) >>> (21 - 2))
- | ((in[26 + inpos] & 2097151) << 2)
- | ((in[27 + inpos]) << 23);
- out[18 + outpos] = ((in[27 + inpos] & 2097151) >>> (21 - 12))
+ out[17 + outpos] = ((in[25 + inpos]) >>> (21 - 2))
+ | ((in[26 + inpos]) << 2) | ((in[27 + inpos]) << 23);
+ out[18 + outpos] = ((in[27 + inpos]) >>> (21 - 12))
| ((in[28 + inpos]) << 12);
- out[19 + outpos] = ((in[28 + inpos] & 2097151) >>> (21 - 1))
- | ((in[29 + inpos] & 2097151) << 1)
- | ((in[30 + inpos]) << 22);
- out[20 + outpos] = ((in[30 + inpos] & 2097151) >>> (21 - 11))
+ out[19 + outpos] = ((in[28 + inpos]) >>> (21 - 1))
+ | ((in[29 + inpos]) << 1) | ((in[30 + inpos]) << 22);
+ out[20 + outpos] = ((in[30 + inpos]) >>> (21 - 11))
| ((in[31 + inpos]) << 11);
}
- protected static void fastpack22(final int[] in, int inpos,
+ protected static void fastpackwithoutmask22(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 4194303)
- | ((in[1 + inpos]) << 22);
- out[1 + outpos] = ((in[1 + inpos] & 4194303) >>> (22 - 12))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 22);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (22 - 12))
| ((in[2 + inpos]) << 12);
- out[2 + outpos] = ((in[2 + inpos] & 4194303) >>> (22 - 2))
- | ((in[3 + inpos] & 4194303) << 2)
- | ((in[4 + inpos]) << 24);
- out[3 + outpos] = ((in[4 + inpos] & 4194303) >>> (22 - 14))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (22 - 2))
+ | ((in[3 + inpos]) << 2) | ((in[4 + inpos]) << 24);
+ out[3 + outpos] = ((in[4 + inpos]) >>> (22 - 14))
| ((in[5 + inpos]) << 14);
- out[4 + outpos] = ((in[5 + inpos] & 4194303) >>> (22 - 4))
- | ((in[6 + inpos] & 4194303) << 4)
- | ((in[7 + inpos]) << 26);
- out[5 + outpos] = ((in[7 + inpos] & 4194303) >>> (22 - 16))
+ out[4 + outpos] = ((in[5 + inpos]) >>> (22 - 4))
+ | ((in[6 + inpos]) << 4) | ((in[7 + inpos]) << 26);
+ out[5 + outpos] = ((in[7 + inpos]) >>> (22 - 16))
| ((in[8 + inpos]) << 16);
- out[6 + outpos] = ((in[8 + inpos] & 4194303) >>> (22 - 6))
- | ((in[9 + inpos] & 4194303) << 6)
- | ((in[10 + inpos]) << 28);
- out[7 + outpos] = ((in[10 + inpos] & 4194303) >>> (22 - 18))
+ out[6 + outpos] = ((in[8 + inpos]) >>> (22 - 6))
+ | ((in[9 + inpos]) << 6) | ((in[10 + inpos]) << 28);
+ out[7 + outpos] = ((in[10 + inpos]) >>> (22 - 18))
| ((in[11 + inpos]) << 18);
- out[8 + outpos] = ((in[11 + inpos] & 4194303) >>> (22 - 8))
- | ((in[12 + inpos] & 4194303) << 8)
- | ((in[13 + inpos]) << 30);
- out[9 + outpos] = ((in[13 + inpos] & 4194303) >>> (22 - 20))
+ out[8 + outpos] = ((in[11 + inpos]) >>> (22 - 8))
+ | ((in[12 + inpos]) << 8) | ((in[13 + inpos]) << 30);
+ out[9 + outpos] = ((in[13 + inpos]) >>> (22 - 20))
| ((in[14 + inpos]) << 20);
- out[10 + outpos] = ((in[14 + inpos] & 4194303) >>> (22 - 10))
+ out[10 + outpos] = ((in[14 + inpos]) >>> (22 - 10))
| ((in[15 + inpos]) << 10);
- out[11 + outpos] = (in[16 + inpos] & 4194303)
- | ((in[17 + inpos]) << 22);
- out[12 + outpos] = ((in[17 + inpos] & 4194303) >>> (22 - 12))
+ out[11 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 22);
+ out[12 + outpos] = ((in[17 + inpos]) >>> (22 - 12))
| ((in[18 + inpos]) << 12);
- out[13 + outpos] = ((in[18 + inpos] & 4194303) >>> (22 - 2))
- | ((in[19 + inpos] & 4194303) << 2)
- | ((in[20 + inpos]) << 24);
- out[14 + outpos] = ((in[20 + inpos] & 4194303) >>> (22 - 14))
+ out[13 + outpos] = ((in[18 + inpos]) >>> (22 - 2))
+ | ((in[19 + inpos]) << 2) | ((in[20 + inpos]) << 24);
+ out[14 + outpos] = ((in[20 + inpos]) >>> (22 - 14))
| ((in[21 + inpos]) << 14);
- out[15 + outpos] = ((in[21 + inpos] & 4194303) >>> (22 - 4))
- | ((in[22 + inpos] & 4194303) << 4)
- | ((in[23 + inpos]) << 26);
- out[16 + outpos] = ((in[23 + inpos] & 4194303) >>> (22 - 16))
+ out[15 + outpos] = ((in[21 + inpos]) >>> (22 - 4))
+ | ((in[22 + inpos]) << 4) | ((in[23 + inpos]) << 26);
+ out[16 + outpos] = ((in[23 + inpos]) >>> (22 - 16))
| ((in[24 + inpos]) << 16);
- out[17 + outpos] = ((in[24 + inpos] & 4194303) >>> (22 - 6))
- | ((in[25 + inpos] & 4194303) << 6)
- | ((in[26 + inpos]) << 28);
- out[18 + outpos] = ((in[26 + inpos] & 4194303) >>> (22 - 18))
+ out[17 + outpos] = ((in[24 + inpos]) >>> (22 - 6))
+ | ((in[25 + inpos]) << 6) | ((in[26 + inpos]) << 28);
+ out[18 + outpos] = ((in[26 + inpos]) >>> (22 - 18))
| ((in[27 + inpos]) << 18);
- out[19 + outpos] = ((in[27 + inpos] & 4194303) >>> (22 - 8))
- | ((in[28 + inpos] & 4194303) << 8)
- | ((in[29 + inpos]) << 30);
- out[20 + outpos] = ((in[29 + inpos] & 4194303) >>> (22 - 20))
+ out[19 + outpos] = ((in[27 + inpos]) >>> (22 - 8))
+ | ((in[28 + inpos]) << 8) | ((in[29 + inpos]) << 30);
+ out[20 + outpos] = ((in[29 + inpos]) >>> (22 - 20))
| ((in[30 + inpos]) << 20);
- out[21 + outpos] = ((in[30 + inpos] & 4194303) >>> (22 - 10))
+ out[21 + outpos] = ((in[30 + inpos]) >>> (22 - 10))
| ((in[31 + inpos]) << 10);
}
- protected static void fastpack23(final int[] in, int inpos,
+ protected static void fastpackwithoutmask23(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 8388607)
- | ((in[1 + inpos]) << 23);
- out[1 + outpos] = ((in[1 + inpos] & 8388607) >>> (23 - 14))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 23);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (23 - 14))
| ((in[2 + inpos]) << 14);
- out[2 + outpos] = ((in[2 + inpos] & 8388607) >>> (23 - 5))
- | ((in[3 + inpos] & 8388607) << 5)
- | ((in[4 + inpos]) << 28);
- out[3 + outpos] = ((in[4 + inpos] & 8388607) >>> (23 - 19))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (23 - 5))
+ | ((in[3 + inpos]) << 5) | ((in[4 + inpos]) << 28);
+ out[3 + outpos] = ((in[4 + inpos]) >>> (23 - 19))
| ((in[5 + inpos]) << 19);
- out[4 + outpos] = ((in[5 + inpos] & 8388607) >>> (23 - 10))
+ out[4 + outpos] = ((in[5 + inpos]) >>> (23 - 10))
| ((in[6 + inpos]) << 10);
- out[5 + outpos] = ((in[6 + inpos] & 8388607) >>> (23 - 1))
- | ((in[7 + inpos] & 8388607) << 1)
- | ((in[8 + inpos]) << 24);
- out[6 + outpos] = ((in[8 + inpos] & 8388607) >>> (23 - 15))
+ out[5 + outpos] = ((in[6 + inpos]) >>> (23 - 1))
+ | ((in[7 + inpos]) << 1) | ((in[8 + inpos]) << 24);
+ out[6 + outpos] = ((in[8 + inpos]) >>> (23 - 15))
| ((in[9 + inpos]) << 15);
- out[7 + outpos] = ((in[9 + inpos] & 8388607) >>> (23 - 6))
- | ((in[10 + inpos] & 8388607) << 6)
- | ((in[11 + inpos]) << 29);
- out[8 + outpos] = ((in[11 + inpos] & 8388607) >>> (23 - 20))
+ out[7 + outpos] = ((in[9 + inpos]) >>> (23 - 6))
+ | ((in[10 + inpos]) << 6) | ((in[11 + inpos]) << 29);
+ out[8 + outpos] = ((in[11 + inpos]) >>> (23 - 20))
| ((in[12 + inpos]) << 20);
- out[9 + outpos] = ((in[12 + inpos] & 8388607) >>> (23 - 11))
+ out[9 + outpos] = ((in[12 + inpos]) >>> (23 - 11))
| ((in[13 + inpos]) << 11);
- out[10 + outpos] = ((in[13 + inpos] & 8388607) >>> (23 - 2))
- | ((in[14 + inpos] & 8388607) << 2)
- | ((in[15 + inpos]) << 25);
- out[11 + outpos] = ((in[15 + inpos] & 8388607) >>> (23 - 16))
+ out[10 + outpos] = ((in[13 + inpos]) >>> (23 - 2))
+ | ((in[14 + inpos]) << 2) | ((in[15 + inpos]) << 25);
+ out[11 + outpos] = ((in[15 + inpos]) >>> (23 - 16))
| ((in[16 + inpos]) << 16);
- out[12 + outpos] = ((in[16 + inpos] & 8388607) >>> (23 - 7))
- | ((in[17 + inpos] & 8388607) << 7)
- | ((in[18 + inpos]) << 30);
- out[13 + outpos] = ((in[18 + inpos] & 8388607) >>> (23 - 21))
+ out[12 + outpos] = ((in[16 + inpos]) >>> (23 - 7))
+ | ((in[17 + inpos]) << 7) | ((in[18 + inpos]) << 30);
+ out[13 + outpos] = ((in[18 + inpos]) >>> (23 - 21))
| ((in[19 + inpos]) << 21);
- out[14 + outpos] = ((in[19 + inpos] & 8388607) >>> (23 - 12))
+ out[14 + outpos] = ((in[19 + inpos]) >>> (23 - 12))
| ((in[20 + inpos]) << 12);
- out[15 + outpos] = ((in[20 + inpos] & 8388607) >>> (23 - 3))
- | ((in[21 + inpos] & 8388607) << 3)
- | ((in[22 + inpos]) << 26);
- out[16 + outpos] = ((in[22 + inpos] & 8388607) >>> (23 - 17))
+ out[15 + outpos] = ((in[20 + inpos]) >>> (23 - 3))
+ | ((in[21 + inpos]) << 3) | ((in[22 + inpos]) << 26);
+ out[16 + outpos] = ((in[22 + inpos]) >>> (23 - 17))
| ((in[23 + inpos]) << 17);
- out[17 + outpos] = ((in[23 + inpos] & 8388607) >>> (23 - 8))
- | ((in[24 + inpos] & 8388607) << 8)
- | ((in[25 + inpos]) << 31);
- out[18 + outpos] = ((in[25 + inpos] & 8388607) >>> (23 - 22))
+ out[17 + outpos] = ((in[23 + inpos]) >>> (23 - 8))
+ | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 31);
+ out[18 + outpos] = ((in[25 + inpos]) >>> (23 - 22))
| ((in[26 + inpos]) << 22);
- out[19 + outpos] = ((in[26 + inpos] & 8388607) >>> (23 - 13))
+ out[19 + outpos] = ((in[26 + inpos]) >>> (23 - 13))
| ((in[27 + inpos]) << 13);
- out[20 + outpos] = ((in[27 + inpos] & 8388607) >>> (23 - 4))
- | ((in[28 + inpos] & 8388607) << 4)
- | ((in[29 + inpos]) << 27);
- out[21 + outpos] = ((in[29 + inpos] & 8388607) >>> (23 - 18))
+ out[20 + outpos] = ((in[27 + inpos]) >>> (23 - 4))
+ | ((in[28 + inpos]) << 4) | ((in[29 + inpos]) << 27);
+ out[21 + outpos] = ((in[29 + inpos]) >>> (23 - 18))
| ((in[30 + inpos]) << 18);
- out[22 + outpos] = ((in[30 + inpos] & 8388607) >>> (23 - 9))
+ out[22 + outpos] = ((in[30 + inpos]) >>> (23 - 9))
| ((in[31 + inpos]) << 9);
}
- protected static void fastpack24(final int[] in, int inpos,
+ protected static void fastpackwithoutmask24(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 16777215)
- | ((in[1 + inpos]) << 24);
- out[1 + outpos] = ((in[1 + inpos] & 16777215) >>> (24 - 16))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 24);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (24 - 16))
| ((in[2 + inpos]) << 16);
- out[2 + outpos] = ((in[2 + inpos] & 16777215) >>> (24 - 8))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (24 - 8))
| ((in[3 + inpos]) << 8);
- out[3 + outpos] = (in[4 + inpos] & 16777215)
- | ((in[5 + inpos]) << 24);
- out[4 + outpos] = ((in[5 + inpos] & 16777215) >>> (24 - 16))
+ out[3 + outpos] = in[4 + inpos] | ((in[5 + inpos]) << 24);
+ out[4 + outpos] = ((in[5 + inpos]) >>> (24 - 16))
| ((in[6 + inpos]) << 16);
- out[5 + outpos] = ((in[6 + inpos] & 16777215) >>> (24 - 8))
+ out[5 + outpos] = ((in[6 + inpos]) >>> (24 - 8))
| ((in[7 + inpos]) << 8);
- out[6 + outpos] = (in[8 + inpos] & 16777215)
- | ((in[9 + inpos]) << 24);
- out[7 + outpos] = ((in[9 + inpos] & 16777215) >>> (24 - 16))
+ out[6 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 24);
+ out[7 + outpos] = ((in[9 + inpos]) >>> (24 - 16))
| ((in[10 + inpos]) << 16);
- out[8 + outpos] = ((in[10 + inpos] & 16777215) >>> (24 - 8))
+ out[8 + outpos] = ((in[10 + inpos]) >>> (24 - 8))
| ((in[11 + inpos]) << 8);
- out[9 + outpos] = (in[12 + inpos] & 16777215)
- | ((in[13 + inpos]) << 24);
- out[10 + outpos] = ((in[13 + inpos] & 16777215) >>> (24 - 16))
+ out[9 + outpos] = in[12 + inpos] | ((in[13 + inpos]) << 24);
+ out[10 + outpos] = ((in[13 + inpos]) >>> (24 - 16))
| ((in[14 + inpos]) << 16);
- out[11 + outpos] = ((in[14 + inpos] & 16777215) >>> (24 - 8))
+ out[11 + outpos] = ((in[14 + inpos]) >>> (24 - 8))
| ((in[15 + inpos]) << 8);
- out[12 + outpos] = (in[16 + inpos] & 16777215)
- | ((in[17 + inpos]) << 24);
- out[13 + outpos] = ((in[17 + inpos] & 16777215) >>> (24 - 16))
+ out[12 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 24);
+ out[13 + outpos] = ((in[17 + inpos]) >>> (24 - 16))
| ((in[18 + inpos]) << 16);
- out[14 + outpos] = ((in[18 + inpos] & 16777215) >>> (24 - 8))
+ out[14 + outpos] = ((in[18 + inpos]) >>> (24 - 8))
| ((in[19 + inpos]) << 8);
- out[15 + outpos] = (in[20 + inpos] & 16777215)
- | ((in[21 + inpos]) << 24);
- out[16 + outpos] = ((in[21 + inpos] & 16777215) >>> (24 - 16))
+ out[15 + outpos] = in[20 + inpos] | ((in[21 + inpos]) << 24);
+ out[16 + outpos] = ((in[21 + inpos]) >>> (24 - 16))
| ((in[22 + inpos]) << 16);
- out[17 + outpos] = ((in[22 + inpos] & 16777215) >>> (24 - 8))
+ out[17 + outpos] = ((in[22 + inpos]) >>> (24 - 8))
| ((in[23 + inpos]) << 8);
- out[18 + outpos] = (in[24 + inpos] & 16777215)
- | ((in[25 + inpos]) << 24);
- out[19 + outpos] = ((in[25 + inpos] & 16777215) >>> (24 - 16))
+ out[18 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 24);
+ out[19 + outpos] = ((in[25 + inpos]) >>> (24 - 16))
| ((in[26 + inpos]) << 16);
- out[20 + outpos] = ((in[26 + inpos] & 16777215) >>> (24 - 8))
+ out[20 + outpos] = ((in[26 + inpos]) >>> (24 - 8))
| ((in[27 + inpos]) << 8);
- out[21 + outpos] = (in[28 + inpos] & 16777215)
- | ((in[29 + inpos]) << 24);
- out[22 + outpos] = ((in[29 + inpos] & 16777215) >>> (24 - 16))
+ out[21 + outpos] = in[28 + inpos] | ((in[29 + inpos]) << 24);
+ out[22 + outpos] = ((in[29 + inpos]) >>> (24 - 16))
| ((in[30 + inpos]) << 16);
- out[23 + outpos] = ((in[30 + inpos] & 16777215) >>> (24 - 8))
+ out[23 + outpos] = ((in[30 + inpos]) >>> (24 - 8))
| ((in[31 + inpos]) << 8);
}
- protected static void fastpack25(final int[] in, int inpos,
+ protected static void fastpackwithoutmask25(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 33554431)
- | ((in[1 + inpos]) << 25);
- out[1 + outpos] = ((in[1 + inpos] & 33554431) >>> (25 - 18))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 25);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (25 - 18))
| ((in[2 + inpos]) << 18);
- out[2 + outpos] = ((in[2 + inpos] & 33554431) >>> (25 - 11))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (25 - 11))
| ((in[3 + inpos]) << 11);
- out[3 + outpos] = ((in[3 + inpos] & 33554431) >>> (25 - 4))
- | ((in[4 + inpos] & 33554431) << 4)
- | ((in[5 + inpos]) << 29);
- out[4 + outpos] = ((in[5 + inpos] & 33554431) >>> (25 - 22))
+ out[3 + outpos] = ((in[3 + inpos]) >>> (25 - 4))
+ | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 29);
+ out[4 + outpos] = ((in[5 + inpos]) >>> (25 - 22))
| ((in[6 + inpos]) << 22);
- out[5 + outpos] = ((in[6 + inpos] & 33554431) >>> (25 - 15))
+ out[5 + outpos] = ((in[6 + inpos]) >>> (25 - 15))
| ((in[7 + inpos]) << 15);
- out[6 + outpos] = ((in[7 + inpos] & 33554431) >>> (25 - 8))
+ out[6 + outpos] = ((in[7 + inpos]) >>> (25 - 8))
| ((in[8 + inpos]) << 8);
- out[7 + outpos] = ((in[8 + inpos] & 33554431) >>> (25 - 1))
- | ((in[9 + inpos] & 33554431) << 1)
- | ((in[10 + inpos]) << 26);
- out[8 + outpos] = ((in[10 + inpos] & 33554431) >>> (25 - 19))
+ out[7 + outpos] = ((in[8 + inpos]) >>> (25 - 1))
+ | ((in[9 + inpos]) << 1) | ((in[10 + inpos]) << 26);
+ out[8 + outpos] = ((in[10 + inpos]) >>> (25 - 19))
| ((in[11 + inpos]) << 19);
- out[9 + outpos] = ((in[11 + inpos] & 33554431) >>> (25 - 12))
+ out[9 + outpos] = ((in[11 + inpos]) >>> (25 - 12))
| ((in[12 + inpos]) << 12);
- out[10 + outpos] = ((in[12 + inpos] & 33554431) >>> (25 - 5))
- | ((in[13 + inpos] & 33554431) << 5)
- | ((in[14 + inpos]) << 30);
- out[11 + outpos] = ((in[14 + inpos] & 33554431) >>> (25 - 23))
+ out[10 + outpos] = ((in[12 + inpos]) >>> (25 - 5))
+ | ((in[13 + inpos]) << 5) | ((in[14 + inpos]) << 30);
+ out[11 + outpos] = ((in[14 + inpos]) >>> (25 - 23))
| ((in[15 + inpos]) << 23);
- out[12 + outpos] = ((in[15 + inpos] & 33554431) >>> (25 - 16))
+ out[12 + outpos] = ((in[15 + inpos]) >>> (25 - 16))
| ((in[16 + inpos]) << 16);
- out[13 + outpos] = ((in[16 + inpos] & 33554431) >>> (25 - 9))
+ out[13 + outpos] = ((in[16 + inpos]) >>> (25 - 9))
| ((in[17 + inpos]) << 9);
- out[14 + outpos] = ((in[17 + inpos] & 33554431) >>> (25 - 2))
- | ((in[18 + inpos] & 33554431) << 2)
- | ((in[19 + inpos]) << 27);
- out[15 + outpos] = ((in[19 + inpos] & 33554431) >>> (25 - 20))
+ out[14 + outpos] = ((in[17 + inpos]) >>> (25 - 2))
+ | ((in[18 + inpos]) << 2) | ((in[19 + inpos]) << 27);
+ out[15 + outpos] = ((in[19 + inpos]) >>> (25 - 20))
| ((in[20 + inpos]) << 20);
- out[16 + outpos] = ((in[20 + inpos] & 33554431) >>> (25 - 13))
+ out[16 + outpos] = ((in[20 + inpos]) >>> (25 - 13))
| ((in[21 + inpos]) << 13);
- out[17 + outpos] = ((in[21 + inpos] & 33554431) >>> (25 - 6))
- | ((in[22 + inpos] & 33554431) << 6)
- | ((in[23 + inpos]) << 31);
- out[18 + outpos] = ((in[23 + inpos] & 33554431) >>> (25 - 24))
+ out[17 + outpos] = ((in[21 + inpos]) >>> (25 - 6))
+ | ((in[22 + inpos]) << 6) | ((in[23 + inpos]) << 31);
+ out[18 + outpos] = ((in[23 + inpos]) >>> (25 - 24))
| ((in[24 + inpos]) << 24);
- out[19 + outpos] = ((in[24 + inpos] & 33554431) >>> (25 - 17))
+ out[19 + outpos] = ((in[24 + inpos]) >>> (25 - 17))
| ((in[25 + inpos]) << 17);
- out[20 + outpos] = ((in[25 + inpos] & 33554431) >>> (25 - 10))
+ out[20 + outpos] = ((in[25 + inpos]) >>> (25 - 10))
| ((in[26 + inpos]) << 10);
- out[21 + outpos] = ((in[26 + inpos] & 33554431) >>> (25 - 3))
- | ((in[27 + inpos] & 33554431) << 3)
- | ((in[28 + inpos]) << 28);
- out[22 + outpos] = ((in[28 + inpos] & 33554431) >>> (25 - 21))
+ out[21 + outpos] = ((in[26 + inpos]) >>> (25 - 3))
+ | ((in[27 + inpos]) << 3) | ((in[28 + inpos]) << 28);
+ out[22 + outpos] = ((in[28 + inpos]) >>> (25 - 21))
| ((in[29 + inpos]) << 21);
- out[23 + outpos] = ((in[29 + inpos] & 33554431) >>> (25 - 14))
+ out[23 + outpos] = ((in[29 + inpos]) >>> (25 - 14))
| ((in[30 + inpos]) << 14);
- out[24 + outpos] = ((in[30 + inpos] & 33554431) >>> (25 - 7))
+ out[24 + outpos] = ((in[30 + inpos]) >>> (25 - 7))
| ((in[31 + inpos]) << 7);
}
- protected static void fastpack26(final int[] in, int inpos,
+ protected static void fastpackwithoutmask26(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 67108863)
- | ((in[1 + inpos]) << 26);
- out[1 + outpos] = ((in[1 + inpos] & 67108863) >>> (26 - 20))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 26);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (26 - 20))
| ((in[2 + inpos]) << 20);
- out[2 + outpos] = ((in[2 + inpos] & 67108863) >>> (26 - 14))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (26 - 14))
| ((in[3 + inpos]) << 14);
- out[3 + outpos] = ((in[3 + inpos] & 67108863) >>> (26 - 8))
+ out[3 + outpos] = ((in[3 + inpos]) >>> (26 - 8))
| ((in[4 + inpos]) << 8);
- out[4 + outpos] = ((in[4 + inpos] & 67108863) >>> (26 - 2))
- | ((in[5 + inpos] & 67108863) << 2)
- | ((in[6 + inpos]) << 28);
- out[5 + outpos] = ((in[6 + inpos] & 67108863) >>> (26 - 22))
+ out[4 + outpos] = ((in[4 + inpos]) >>> (26 - 2))
+ | ((in[5 + inpos]) << 2) | ((in[6 + inpos]) << 28);
+ out[5 + outpos] = ((in[6 + inpos]) >>> (26 - 22))
| ((in[7 + inpos]) << 22);
- out[6 + outpos] = ((in[7 + inpos] & 67108863) >>> (26 - 16))
+ out[6 + outpos] = ((in[7 + inpos]) >>> (26 - 16))
| ((in[8 + inpos]) << 16);
- out[7 + outpos] = ((in[8 + inpos] & 67108863) >>> (26 - 10))
+ out[7 + outpos] = ((in[8 + inpos]) >>> (26 - 10))
| ((in[9 + inpos]) << 10);
- out[8 + outpos] = ((in[9 + inpos] & 67108863) >>> (26 - 4))
- | ((in[10 + inpos] & 67108863) << 4)
- | ((in[11 + inpos]) << 30);
- out[9 + outpos] = ((in[11 + inpos] & 67108863) >>> (26 - 24))
+ out[8 + outpos] = ((in[9 + inpos]) >>> (26 - 4))
+ | ((in[10 + inpos]) << 4) | ((in[11 + inpos]) << 30);
+ out[9 + outpos] = ((in[11 + inpos]) >>> (26 - 24))
| ((in[12 + inpos]) << 24);
- out[10 + outpos] = ((in[12 + inpos] & 67108863) >>> (26 - 18))
+ out[10 + outpos] = ((in[12 + inpos]) >>> (26 - 18))
| ((in[13 + inpos]) << 18);
- out[11 + outpos] = ((in[13 + inpos] & 67108863) >>> (26 - 12))
+ out[11 + outpos] = ((in[13 + inpos]) >>> (26 - 12))
| ((in[14 + inpos]) << 12);
- out[12 + outpos] = ((in[14 + inpos] & 67108863) >>> (26 - 6))
+ out[12 + outpos] = ((in[14 + inpos]) >>> (26 - 6))
| ((in[15 + inpos]) << 6);
- out[13 + outpos] = (in[16 + inpos] & 67108863)
- | ((in[17 + inpos]) << 26);
- out[14 + outpos] = ((in[17 + inpos] & 67108863) >>> (26 - 20))
+ out[13 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 26);
+ out[14 + outpos] = ((in[17 + inpos]) >>> (26 - 20))
| ((in[18 + inpos]) << 20);
- out[15 + outpos] = ((in[18 + inpos] & 67108863) >>> (26 - 14))
+ out[15 + outpos] = ((in[18 + inpos]) >>> (26 - 14))
| ((in[19 + inpos]) << 14);
- out[16 + outpos] = ((in[19 + inpos] & 67108863) >>> (26 - 8))
+ out[16 + outpos] = ((in[19 + inpos]) >>> (26 - 8))
| ((in[20 + inpos]) << 8);
- out[17 + outpos] = ((in[20 + inpos] & 67108863) >>> (26 - 2))
- | ((in[21 + inpos] & 67108863) << 2)
- | ((in[22 + inpos]) << 28);
- out[18 + outpos] = ((in[22 + inpos] & 67108863) >>> (26 - 22))
+ out[17 + outpos] = ((in[20 + inpos]) >>> (26 - 2))
+ | ((in[21 + inpos]) << 2) | ((in[22 + inpos]) << 28);
+ out[18 + outpos] = ((in[22 + inpos]) >>> (26 - 22))
| ((in[23 + inpos]) << 22);
- out[19 + outpos] = ((in[23 + inpos] & 67108863) >>> (26 - 16))
+ out[19 + outpos] = ((in[23 + inpos]) >>> (26 - 16))
| ((in[24 + inpos]) << 16);
- out[20 + outpos] = ((in[24 + inpos] & 67108863) >>> (26 - 10))
+ out[20 + outpos] = ((in[24 + inpos]) >>> (26 - 10))
| ((in[25 + inpos]) << 10);
- out[21 + outpos] = ((in[25 + inpos] & 67108863) >>> (26 - 4))
- | ((in[26 + inpos] & 67108863) << 4)
- | ((in[27 + inpos]) << 30);
- out[22 + outpos] = ((in[27 + inpos] & 67108863) >>> (26 - 24))
+ out[21 + outpos] = ((in[25 + inpos]) >>> (26 - 4))
+ | ((in[26 + inpos]) << 4) | ((in[27 + inpos]) << 30);
+ out[22 + outpos] = ((in[27 + inpos]) >>> (26 - 24))
| ((in[28 + inpos]) << 24);
- out[23 + outpos] = ((in[28 + inpos] & 67108863) >>> (26 - 18))
+ out[23 + outpos] = ((in[28 + inpos]) >>> (26 - 18))
| ((in[29 + inpos]) << 18);
- out[24 + outpos] = ((in[29 + inpos] & 67108863) >>> (26 - 12))
+ out[24 + outpos] = ((in[29 + inpos]) >>> (26 - 12))
| ((in[30 + inpos]) << 12);
- out[25 + outpos] = ((in[30 + inpos] & 67108863) >>> (26 - 6))
+ out[25 + outpos] = ((in[30 + inpos]) >>> (26 - 6))
| ((in[31 + inpos]) << 6);
}
- protected static void fastpack27(final int[] in, int inpos,
+ protected static void fastpackwithoutmask27(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 134217727)
- | ((in[1 + inpos]) << 27);
- out[1 + outpos] = ((in[1 + inpos] & 134217727) >>> (27 - 22))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 27);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (27 - 22))
| ((in[2 + inpos]) << 22);
- out[2 + outpos] = ((in[2 + inpos] & 134217727) >>> (27 - 17))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (27 - 17))
| ((in[3 + inpos]) << 17);
- out[3 + outpos] = ((in[3 + inpos] & 134217727) >>> (27 - 12))
+ out[3 + outpos] = ((in[3 + inpos]) >>> (27 - 12))
| ((in[4 + inpos]) << 12);
- out[4 + outpos] = ((in[4 + inpos] & 134217727) >>> (27 - 7))
+ out[4 + outpos] = ((in[4 + inpos]) >>> (27 - 7))
| ((in[5 + inpos]) << 7);
- out[5 + outpos] = ((in[5 + inpos] & 134217727) >>> (27 - 2))
- | ((in[6 + inpos] & 134217727) << 2)
- | ((in[7 + inpos]) << 29);
- out[6 + outpos] = ((in[7 + inpos] & 134217727) >>> (27 - 24))
+ out[5 + outpos] = ((in[5 + inpos]) >>> (27 - 2))
+ | ((in[6 + inpos]) << 2) | ((in[7 + inpos]) << 29);
+ out[6 + outpos] = ((in[7 + inpos]) >>> (27 - 24))
| ((in[8 + inpos]) << 24);
- out[7 + outpos] = ((in[8 + inpos] & 134217727) >>> (27 - 19))
+ out[7 + outpos] = ((in[8 + inpos]) >>> (27 - 19))
| ((in[9 + inpos]) << 19);
- out[8 + outpos] = ((in[9 + inpos] & 134217727) >>> (27 - 14))
+ out[8 + outpos] = ((in[9 + inpos]) >>> (27 - 14))
| ((in[10 + inpos]) << 14);
- out[9 + outpos] = ((in[10 + inpos] & 134217727) >>> (27 - 9))
+ out[9 + outpos] = ((in[10 + inpos]) >>> (27 - 9))
| ((in[11 + inpos]) << 9);
- out[10 + outpos] = ((in[11 + inpos] & 134217727) >>> (27 - 4))
- | ((in[12 + inpos] & 134217727) << 4)
- | ((in[13 + inpos]) << 31);
- out[11 + outpos] = ((in[13 + inpos] & 134217727) >>> (27 - 26))
+ out[10 + outpos] = ((in[11 + inpos]) >>> (27 - 4))
+ | ((in[12 + inpos]) << 4) | ((in[13 + inpos]) << 31);
+ out[11 + outpos] = ((in[13 + inpos]) >>> (27 - 26))
| ((in[14 + inpos]) << 26);
- out[12 + outpos] = ((in[14 + inpos] & 134217727) >>> (27 - 21))
+ out[12 + outpos] = ((in[14 + inpos]) >>> (27 - 21))
| ((in[15 + inpos]) << 21);
- out[13 + outpos] = ((in[15 + inpos] & 134217727) >>> (27 - 16))
+ out[13 + outpos] = ((in[15 + inpos]) >>> (27 - 16))
| ((in[16 + inpos]) << 16);
- out[14 + outpos] = ((in[16 + inpos] & 134217727) >>> (27 - 11))
+ out[14 + outpos] = ((in[16 + inpos]) >>> (27 - 11))
| ((in[17 + inpos]) << 11);
- out[15 + outpos] = ((in[17 + inpos] & 134217727) >>> (27 - 6))
+ out[15 + outpos] = ((in[17 + inpos]) >>> (27 - 6))
| ((in[18 + inpos]) << 6);
- out[16 + outpos] = ((in[18 + inpos] & 134217727) >>> (27 - 1))
- | ((in[19 + inpos] & 134217727) << 1)
- | ((in[20 + inpos]) << 28);
- out[17 + outpos] = ((in[20 + inpos] & 134217727) >>> (27 - 23))
+ out[16 + outpos] = ((in[18 + inpos]) >>> (27 - 1))
+ | ((in[19 + inpos]) << 1) | ((in[20 + inpos]) << 28);
+ out[17 + outpos] = ((in[20 + inpos]) >>> (27 - 23))
| ((in[21 + inpos]) << 23);
- out[18 + outpos] = ((in[21 + inpos] & 134217727) >>> (27 - 18))
+ out[18 + outpos] = ((in[21 + inpos]) >>> (27 - 18))
| ((in[22 + inpos]) << 18);
- out[19 + outpos] = ((in[22 + inpos] & 134217727) >>> (27 - 13))
+ out[19 + outpos] = ((in[22 + inpos]) >>> (27 - 13))
| ((in[23 + inpos]) << 13);
- out[20 + outpos] = ((in[23 + inpos] & 134217727) >>> (27 - 8))
+ out[20 + outpos] = ((in[23 + inpos]) >>> (27 - 8))
| ((in[24 + inpos]) << 8);
- out[21 + outpos] = ((in[24 + inpos] & 134217727) >>> (27 - 3))
- | ((in[25 + inpos] & 134217727) << 3)
- | ((in[26 + inpos]) << 30);
- out[22 + outpos] = ((in[26 + inpos] & 134217727) >>> (27 - 25))
+ out[21 + outpos] = ((in[24 + inpos]) >>> (27 - 3))
+ | ((in[25 + inpos]) << 3) | ((in[26 + inpos]) << 30);
+ out[22 + outpos] = ((in[26 + inpos]) >>> (27 - 25))
| ((in[27 + inpos]) << 25);
- out[23 + outpos] = ((in[27 + inpos] & 134217727) >>> (27 - 20))
+ out[23 + outpos] = ((in[27 + inpos]) >>> (27 - 20))
| ((in[28 + inpos]) << 20);
- out[24 + outpos] = ((in[28 + inpos] & 134217727) >>> (27 - 15))
+ out[24 + outpos] = ((in[28 + inpos]) >>> (27 - 15))
| ((in[29 + inpos]) << 15);
- out[25 + outpos] = ((in[29 + inpos] & 134217727) >>> (27 - 10))
+ out[25 + outpos] = ((in[29 + inpos]) >>> (27 - 10))
| ((in[30 + inpos]) << 10);
- out[26 + outpos] = ((in[30 + inpos] & 134217727) >>> (27 - 5))
+ out[26 + outpos] = ((in[30 + inpos]) >>> (27 - 5))
| ((in[31 + inpos]) << 5);
}
- protected static void fastpack28(final int[] in, int inpos,
+ protected static void fastpackwithoutmask28(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 268435455)
- | ((in[1 + inpos]) << 28);
- out[1 + outpos] = ((in[1 + inpos] & 268435455) >>> (28 - 24))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 28);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (28 - 24))
| ((in[2 + inpos]) << 24);
- out[2 + outpos] = ((in[2 + inpos] & 268435455) >>> (28 - 20))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (28 - 20))
| ((in[3 + inpos]) << 20);
- out[3 + outpos] = ((in[3 + inpos] & 268435455) >>> (28 - 16))
+ out[3 + outpos] = ((in[3 + inpos]) >>> (28 - 16))
| ((in[4 + inpos]) << 16);
- out[4 + outpos] = ((in[4 + inpos] & 268435455) >>> (28 - 12))
+ out[4 + outpos] = ((in[4 + inpos]) >>> (28 - 12))
| ((in[5 + inpos]) << 12);
- out[5 + outpos] = ((in[5 + inpos] & 268435455) >>> (28 - 8))
+ out[5 + outpos] = ((in[5 + inpos]) >>> (28 - 8))
| ((in[6 + inpos]) << 8);
- out[6 + outpos] = ((in[6 + inpos] & 268435455) >>> (28 - 4))
+ out[6 + outpos] = ((in[6 + inpos]) >>> (28 - 4))
| ((in[7 + inpos]) << 4);
- out[7 + outpos] = (in[8 + inpos] & 268435455)
- | ((in[9 + inpos]) << 28);
- out[8 + outpos] = ((in[9 + inpos] & 268435455) >>> (28 - 24))
+ out[7 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 28);
+ out[8 + outpos] = ((in[9 + inpos]) >>> (28 - 24))
| ((in[10 + inpos]) << 24);
- out[9 + outpos] = ((in[10 + inpos] & 268435455) >>> (28 - 20))
+ out[9 + outpos] = ((in[10 + inpos]) >>> (28 - 20))
| ((in[11 + inpos]) << 20);
- out[10 + outpos] = ((in[11 + inpos] & 268435455) >>> (28 - 16))
+ out[10 + outpos] = ((in[11 + inpos]) >>> (28 - 16))
| ((in[12 + inpos]) << 16);
- out[11 + outpos] = ((in[12 + inpos] & 268435455) >>> (28 - 12))
+ out[11 + outpos] = ((in[12 + inpos]) >>> (28 - 12))
| ((in[13 + inpos]) << 12);
- out[12 + outpos] = ((in[13 + inpos] & 268435455) >>> (28 - 8))
+ out[12 + outpos] = ((in[13 + inpos]) >>> (28 - 8))
| ((in[14 + inpos]) << 8);
- out[13 + outpos] = ((in[14 + inpos] & 268435455) >>> (28 - 4))
+ out[13 + outpos] = ((in[14 + inpos]) >>> (28 - 4))
| ((in[15 + inpos]) << 4);
- out[14 + outpos] = (in[16 + inpos] & 268435455)
- | ((in[17 + inpos]) << 28);
- out[15 + outpos] = ((in[17 + inpos] & 268435455) >>> (28 - 24))
+ out[14 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 28);
+ out[15 + outpos] = ((in[17 + inpos]) >>> (28 - 24))
| ((in[18 + inpos]) << 24);
- out[16 + outpos] = ((in[18 + inpos] & 268435455) >>> (28 - 20))
+ out[16 + outpos] = ((in[18 + inpos]) >>> (28 - 20))
| ((in[19 + inpos]) << 20);
- out[17 + outpos] = ((in[19 + inpos] & 268435455) >>> (28 - 16))
+ out[17 + outpos] = ((in[19 + inpos]) >>> (28 - 16))
| ((in[20 + inpos]) << 16);
- out[18 + outpos] = ((in[20 + inpos] & 268435455) >>> (28 - 12))
+ out[18 + outpos] = ((in[20 + inpos]) >>> (28 - 12))
| ((in[21 + inpos]) << 12);
- out[19 + outpos] = ((in[21 + inpos] & 268435455) >>> (28 - 8))
+ out[19 + outpos] = ((in[21 + inpos]) >>> (28 - 8))
| ((in[22 + inpos]) << 8);
- out[20 + outpos] = ((in[22 + inpos] & 268435455) >>> (28 - 4))
+ out[20 + outpos] = ((in[22 + inpos]) >>> (28 - 4))
| ((in[23 + inpos]) << 4);
- out[21 + outpos] = (in[24 + inpos] & 268435455)
- | ((in[25 + inpos]) << 28);
- out[22 + outpos] = ((in[25 + inpos] & 268435455) >>> (28 - 24))
+ out[21 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 28);
+ out[22 + outpos] = ((in[25 + inpos]) >>> (28 - 24))
| ((in[26 + inpos]) << 24);
- out[23 + outpos] = ((in[26 + inpos] & 268435455) >>> (28 - 20))
+ out[23 + outpos] = ((in[26 + inpos]) >>> (28 - 20))
| ((in[27 + inpos]) << 20);
- out[24 + outpos] = ((in[27 + inpos] & 268435455) >>> (28 - 16))
+ out[24 + outpos] = ((in[27 + inpos]) >>> (28 - 16))
| ((in[28 + inpos]) << 16);
- out[25 + outpos] = ((in[28 + inpos] & 268435455) >>> (28 - 12))
+ out[25 + outpos] = ((in[28 + inpos]) >>> (28 - 12))
| ((in[29 + inpos]) << 12);
- out[26 + outpos] = ((in[29 + inpos] & 268435455) >>> (28 - 8))
+ out[26 + outpos] = ((in[29 + inpos]) >>> (28 - 8))
| ((in[30 + inpos]) << 8);
- out[27 + outpos] = ((in[30 + inpos] & 268435455) >>> (28 - 4))
+ out[27 + outpos] = ((in[30 + inpos]) >>> (28 - 4))
| ((in[31 + inpos]) << 4);
}
- protected static void fastpack29(final int[] in, int inpos,
+ protected static void fastpackwithoutmask29(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 536870911)
- | ((in[1 + inpos]) << 29);
- out[1 + outpos] = ((in[1 + inpos] & 536870911) >>> (29 - 26))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 29);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (29 - 26))
| ((in[2 + inpos]) << 26);
- out[2 + outpos] = ((in[2 + inpos] & 536870911) >>> (29 - 23))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (29 - 23))
| ((in[3 + inpos]) << 23);
- out[3 + outpos] = ((in[3 + inpos] & 536870911) >>> (29 - 20))
+ out[3 + outpos] = ((in[3 + inpos]) >>> (29 - 20))
| ((in[4 + inpos]) << 20);
- out[4 + outpos] = ((in[4 + inpos] & 536870911) >>> (29 - 17))
+ out[4 + outpos] = ((in[4 + inpos]) >>> (29 - 17))
| ((in[5 + inpos]) << 17);
- out[5 + outpos] = ((in[5 + inpos] & 536870911) >>> (29 - 14))
+ out[5 + outpos] = ((in[5 + inpos]) >>> (29 - 14))
| ((in[6 + inpos]) << 14);
- out[6 + outpos] = ((in[6 + inpos] & 536870911) >>> (29 - 11))
+ out[6 + outpos] = ((in[6 + inpos]) >>> (29 - 11))
| ((in[7 + inpos]) << 11);
- out[7 + outpos] = ((in[7 + inpos] & 536870911) >>> (29 - 8))
+ out[7 + outpos] = ((in[7 + inpos]) >>> (29 - 8))
| ((in[8 + inpos]) << 8);
- out[8 + outpos] = ((in[8 + inpos] & 536870911) >>> (29 - 5))
+ out[8 + outpos] = ((in[8 + inpos]) >>> (29 - 5))
| ((in[9 + inpos]) << 5);
- out[9 + outpos] = ((in[9 + inpos] & 536870911) >>> (29 - 2))
- | ((in[10 + inpos] & 536870911) << 2)
- | ((in[11 + inpos]) << 31);
- out[10 + outpos] = ((in[11 + inpos] & 536870911) >>> (29 - 28))
+ out[9 + outpos] = ((in[9 + inpos]) >>> (29 - 2))
+ | ((in[10 + inpos]) << 2) | ((in[11 + inpos]) << 31);
+ out[10 + outpos] = ((in[11 + inpos]) >>> (29 - 28))
| ((in[12 + inpos]) << 28);
- out[11 + outpos] = ((in[12 + inpos] & 536870911) >>> (29 - 25))
+ out[11 + outpos] = ((in[12 + inpos]) >>> (29 - 25))
| ((in[13 + inpos]) << 25);
- out[12 + outpos] = ((in[13 + inpos] & 536870911) >>> (29 - 22))
+ out[12 + outpos] = ((in[13 + inpos]) >>> (29 - 22))
| ((in[14 + inpos]) << 22);
- out[13 + outpos] = ((in[14 + inpos] & 536870911) >>> (29 - 19))
+ out[13 + outpos] = ((in[14 + inpos]) >>> (29 - 19))
| ((in[15 + inpos]) << 19);
- out[14 + outpos] = ((in[15 + inpos] & 536870911) >>> (29 - 16))
+ out[14 + outpos] = ((in[15 + inpos]) >>> (29 - 16))
| ((in[16 + inpos]) << 16);
- out[15 + outpos] = ((in[16 + inpos] & 536870911) >>> (29 - 13))
+ out[15 + outpos] = ((in[16 + inpos]) >>> (29 - 13))
| ((in[17 + inpos]) << 13);
- out[16 + outpos] = ((in[17 + inpos] & 536870911) >>> (29 - 10))
+ out[16 + outpos] = ((in[17 + inpos]) >>> (29 - 10))
| ((in[18 + inpos]) << 10);
- out[17 + outpos] = ((in[18 + inpos] & 536870911) >>> (29 - 7))
+ out[17 + outpos] = ((in[18 + inpos]) >>> (29 - 7))
| ((in[19 + inpos]) << 7);
- out[18 + outpos] = ((in[19 + inpos] & 536870911) >>> (29 - 4))
+ out[18 + outpos] = ((in[19 + inpos]) >>> (29 - 4))
| ((in[20 + inpos]) << 4);
- out[19 + outpos] = ((in[20 + inpos] & 536870911) >>> (29 - 1))
- | ((in[21 + inpos] & 536870911) << 1)
- | ((in[22 + inpos]) << 30);
- out[20 + outpos] = ((in[22 + inpos] & 536870911) >>> (29 - 27))
+ out[19 + outpos] = ((in[20 + inpos]) >>> (29 - 1))
+ | ((in[21 + inpos]) << 1) | ((in[22 + inpos]) << 30);
+ out[20 + outpos] = ((in[22 + inpos]) >>> (29 - 27))
| ((in[23 + inpos]) << 27);
- out[21 + outpos] = ((in[23 + inpos] & 536870911) >>> (29 - 24))
+ out[21 + outpos] = ((in[23 + inpos]) >>> (29 - 24))
| ((in[24 + inpos]) << 24);
- out[22 + outpos] = ((in[24 + inpos] & 536870911) >>> (29 - 21))
+ out[22 + outpos] = ((in[24 + inpos]) >>> (29 - 21))
| ((in[25 + inpos]) << 21);
- out[23 + outpos] = ((in[25 + inpos] & 536870911) >>> (29 - 18))
+ out[23 + outpos] = ((in[25 + inpos]) >>> (29 - 18))
| ((in[26 + inpos]) << 18);
- out[24 + outpos] = ((in[26 + inpos] & 536870911) >>> (29 - 15))
+ out[24 + outpos] = ((in[26 + inpos]) >>> (29 - 15))
| ((in[27 + inpos]) << 15);
- out[25 + outpos] = ((in[27 + inpos] & 536870911) >>> (29 - 12))
+ out[25 + outpos] = ((in[27 + inpos]) >>> (29 - 12))
| ((in[28 + inpos]) << 12);
- out[26 + outpos] = ((in[28 + inpos] & 536870911) >>> (29 - 9))
+ out[26 + outpos] = ((in[28 + inpos]) >>> (29 - 9))
| ((in[29 + inpos]) << 9);
- out[27 + outpos] = ((in[29 + inpos] & 536870911) >>> (29 - 6))
+ out[27 + outpos] = ((in[29 + inpos]) >>> (29 - 6))
| ((in[30 + inpos]) << 6);
- out[28 + outpos] = ((in[30 + inpos] & 536870911) >>> (29 - 3))
+ out[28 + outpos] = ((in[30 + inpos]) >>> (29 - 3))
| ((in[31 + inpos]) << 3);
}
- protected static void fastpack30(final int[] in, int inpos,
+ protected static void fastpackwithoutmask3(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 1073741823)
- | ((in[1 + inpos]) << 30);
- out[1 + outpos] = ((in[1 + inpos] & 1073741823) >>> (30 - 28))
- | ((in[2 + inpos]) << 28);
- out[2 + outpos] = ((in[2 + inpos] & 1073741823) >>> (30 - 26))
- | ((in[3 + inpos]) << 26);
- out[3 + outpos] = ((in[3 + inpos] & 1073741823) >>> (30 - 24))
- | ((in[4 + inpos]) << 24);
- out[4 + outpos] = ((in[4 + inpos] & 1073741823) >>> (30 - 22))
- | ((in[5 + inpos]) << 22);
- out[5 + outpos] = ((in[5 + inpos] & 1073741823) >>> (30 - 20))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 3)
+ | ((in[2 + inpos]) << 6) | ((in[3 + inpos]) << 9)
+ | ((in[4 + inpos]) << 12) | ((in[5 + inpos]) << 15)
+ | ((in[6 + inpos]) << 18) | ((in[7 + inpos]) << 21)
+ | ((in[8 + inpos]) << 24) | ((in[9 + inpos]) << 27)
+ | ((in[10 + inpos]) << 30);
+ out[1 + outpos] = ((in[10 + inpos]) >>> (3 - 1))
+ | ((in[11 + inpos]) << 1) | ((in[12 + inpos]) << 4)
+ | ((in[13 + inpos]) << 7) | ((in[14 + inpos]) << 10)
+ | ((in[15 + inpos]) << 13) | ((in[16 + inpos]) << 16)
+ | ((in[17 + inpos]) << 19) | ((in[18 + inpos]) << 22)
+ | ((in[19 + inpos]) << 25) | ((in[20 + inpos]) << 28)
+ | ((in[21 + inpos]) << 31);
+ out[2 + outpos] = ((in[21 + inpos]) >>> (3 - 2))
+ | ((in[22 + inpos]) << 2) | ((in[23 + inpos]) << 5)
+ | ((in[24 + inpos]) << 8) | ((in[25 + inpos]) << 11)
+ | ((in[26 + inpos]) << 14) | ((in[27 + inpos]) << 17)
+ | ((in[28 + inpos]) << 20) | ((in[29 + inpos]) << 23)
+ | ((in[30 + inpos]) << 26) | ((in[31 + inpos]) << 29);
+ }
+
+ protected static void fastpackwithoutmask30(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 30);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (30 - 28))
+ | ((in[2 + inpos]) << 28);
+ out[2 + outpos] = ((in[2 + inpos]) >>> (30 - 26))
+ | ((in[3 + inpos]) << 26);
+ out[3 + outpos] = ((in[3 + inpos]) >>> (30 - 24))
+ | ((in[4 + inpos]) << 24);
+ out[4 + outpos] = ((in[4 + inpos]) >>> (30 - 22))
+ | ((in[5 + inpos]) << 22);
+ out[5 + outpos] = ((in[5 + inpos]) >>> (30 - 20))
| ((in[6 + inpos]) << 20);
- out[6 + outpos] = ((in[6 + inpos] & 1073741823) >>> (30 - 18))
+ out[6 + outpos] = ((in[6 + inpos]) >>> (30 - 18))
| ((in[7 + inpos]) << 18);
- out[7 + outpos] = ((in[7 + inpos] & 1073741823) >>> (30 - 16))
+ out[7 + outpos] = ((in[7 + inpos]) >>> (30 - 16))
| ((in[8 + inpos]) << 16);
- out[8 + outpos] = ((in[8 + inpos] & 1073741823) >>> (30 - 14))
+ out[8 + outpos] = ((in[8 + inpos]) >>> (30 - 14))
| ((in[9 + inpos]) << 14);
- out[9 + outpos] = ((in[9 + inpos] & 1073741823) >>> (30 - 12))
+ out[9 + outpos] = ((in[9 + inpos]) >>> (30 - 12))
| ((in[10 + inpos]) << 12);
- out[10 + outpos] = ((in[10 + inpos] & 1073741823) >>> (30 - 10))
+ out[10 + outpos] = ((in[10 + inpos]) >>> (30 - 10))
| ((in[11 + inpos]) << 10);
- out[11 + outpos] = ((in[11 + inpos] & 1073741823) >>> (30 - 8))
+ out[11 + outpos] = ((in[11 + inpos]) >>> (30 - 8))
| ((in[12 + inpos]) << 8);
- out[12 + outpos] = ((in[12 + inpos] & 1073741823) >>> (30 - 6))
+ out[12 + outpos] = ((in[12 + inpos]) >>> (30 - 6))
| ((in[13 + inpos]) << 6);
- out[13 + outpos] = ((in[13 + inpos] & 1073741823) >>> (30 - 4))
+ out[13 + outpos] = ((in[13 + inpos]) >>> (30 - 4))
| ((in[14 + inpos]) << 4);
- out[14 + outpos] = ((in[14 + inpos] & 1073741823) >>> (30 - 2))
+ out[14 + outpos] = ((in[14 + inpos]) >>> (30 - 2))
| ((in[15 + inpos]) << 2);
- out[15 + outpos] = (in[16 + inpos] & 1073741823)
- | ((in[17 + inpos]) << 30);
- out[16 + outpos] = ((in[17 + inpos] & 1073741823) >>> (30 - 28))
+ out[15 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 30);
+ out[16 + outpos] = ((in[17 + inpos]) >>> (30 - 28))
| ((in[18 + inpos]) << 28);
- out[17 + outpos] = ((in[18 + inpos] & 1073741823) >>> (30 - 26))
+ out[17 + outpos] = ((in[18 + inpos]) >>> (30 - 26))
| ((in[19 + inpos]) << 26);
- out[18 + outpos] = ((in[19 + inpos] & 1073741823) >>> (30 - 24))
+ out[18 + outpos] = ((in[19 + inpos]) >>> (30 - 24))
| ((in[20 + inpos]) << 24);
- out[19 + outpos] = ((in[20 + inpos] & 1073741823) >>> (30 - 22))
+ out[19 + outpos] = ((in[20 + inpos]) >>> (30 - 22))
| ((in[21 + inpos]) << 22);
- out[20 + outpos] = ((in[21 + inpos] & 1073741823) >>> (30 - 20))
+ out[20 + outpos] = ((in[21 + inpos]) >>> (30 - 20))
| ((in[22 + inpos]) << 20);
- out[21 + outpos] = ((in[22 + inpos] & 1073741823) >>> (30 - 18))
+ out[21 + outpos] = ((in[22 + inpos]) >>> (30 - 18))
| ((in[23 + inpos]) << 18);
- out[22 + outpos] = ((in[23 + inpos] & 1073741823) >>> (30 - 16))
+ out[22 + outpos] = ((in[23 + inpos]) >>> (30 - 16))
| ((in[24 + inpos]) << 16);
- out[23 + outpos] = ((in[24 + inpos] & 1073741823) >>> (30 - 14))
+ out[23 + outpos] = ((in[24 + inpos]) >>> (30 - 14))
| ((in[25 + inpos]) << 14);
- out[24 + outpos] = ((in[25 + inpos] & 1073741823) >>> (30 - 12))
+ out[24 + outpos] = ((in[25 + inpos]) >>> (30 - 12))
| ((in[26 + inpos]) << 12);
- out[25 + outpos] = ((in[26 + inpos] & 1073741823) >>> (30 - 10))
+ out[25 + outpos] = ((in[26 + inpos]) >>> (30 - 10))
| ((in[27 + inpos]) << 10);
- out[26 + outpos] = ((in[27 + inpos] & 1073741823) >>> (30 - 8))
+ out[26 + outpos] = ((in[27 + inpos]) >>> (30 - 8))
| ((in[28 + inpos]) << 8);
- out[27 + outpos] = ((in[28 + inpos] & 1073741823) >>> (30 - 6))
+ out[27 + outpos] = ((in[28 + inpos]) >>> (30 - 6))
| ((in[29 + inpos]) << 6);
- out[28 + outpos] = ((in[29 + inpos] & 1073741823) >>> (30 - 4))
+ out[28 + outpos] = ((in[29 + inpos]) >>> (30 - 4))
| ((in[30 + inpos]) << 4);
- out[29 + outpos] = ((in[30 + inpos] & 1073741823) >>> (30 - 2))
+ out[29 + outpos] = ((in[30 + inpos]) >>> (30 - 2))
| ((in[31 + inpos]) << 2);
}
- protected static void fastpack31(final int[] in, int inpos,
+ protected static void fastpackwithoutmask31(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] & 2147483647)
- | ((in[1 + inpos]) << 31);
- out[1 + outpos] = ((in[1 + inpos] & 2147483647) >>> (31 - 30))
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 31);
+ out[1 + outpos] = ((in[1 + inpos]) >>> (31 - 30))
| ((in[2 + inpos]) << 30);
- out[2 + outpos] = ((in[2 + inpos] & 2147483647) >>> (31 - 29))
+ out[2 + outpos] = ((in[2 + inpos]) >>> (31 - 29))
| ((in[3 + inpos]) << 29);
- out[3 + outpos] = ((in[3 + inpos] & 2147483647) >>> (31 - 28))
+ out[3 + outpos] = ((in[3 + inpos]) >>> (31 - 28))
| ((in[4 + inpos]) << 28);
- out[4 + outpos] = ((in[4 + inpos] & 2147483647) >>> (31 - 27))
+ out[4 + outpos] = ((in[4 + inpos]) >>> (31 - 27))
| ((in[5 + inpos]) << 27);
- out[5 + outpos] = ((in[5 + inpos] & 2147483647) >>> (31 - 26))
+ out[5 + outpos] = ((in[5 + inpos]) >>> (31 - 26))
| ((in[6 + inpos]) << 26);
- out[6 + outpos] = ((in[6 + inpos] & 2147483647) >>> (31 - 25))
+ out[6 + outpos] = ((in[6 + inpos]) >>> (31 - 25))
| ((in[7 + inpos]) << 25);
- out[7 + outpos] = ((in[7 + inpos] & 2147483647) >>> (31 - 24))
+ out[7 + outpos] = ((in[7 + inpos]) >>> (31 - 24))
| ((in[8 + inpos]) << 24);
- out[8 + outpos] = ((in[8 + inpos] & 2147483647) >>> (31 - 23))
+ out[8 + outpos] = ((in[8 + inpos]) >>> (31 - 23))
| ((in[9 + inpos]) << 23);
- out[9 + outpos] = ((in[9 + inpos] & 2147483647) >>> (31 - 22))
+ out[9 + outpos] = ((in[9 + inpos]) >>> (31 - 22))
| ((in[10 + inpos]) << 22);
- out[10 + outpos] = ((in[10 + inpos] & 2147483647) >>> (31 - 21))
+ out[10 + outpos] = ((in[10 + inpos]) >>> (31 - 21))
| ((in[11 + inpos]) << 21);
- out[11 + outpos] = ((in[11 + inpos] & 2147483647) >>> (31 - 20))
+ out[11 + outpos] = ((in[11 + inpos]) >>> (31 - 20))
| ((in[12 + inpos]) << 20);
- out[12 + outpos] = ((in[12 + inpos] & 2147483647) >>> (31 - 19))
+ out[12 + outpos] = ((in[12 + inpos]) >>> (31 - 19))
| ((in[13 + inpos]) << 19);
- out[13 + outpos] = ((in[13 + inpos] & 2147483647) >>> (31 - 18))
+ out[13 + outpos] = ((in[13 + inpos]) >>> (31 - 18))
| ((in[14 + inpos]) << 18);
- out[14 + outpos] = ((in[14 + inpos] & 2147483647) >>> (31 - 17))
+ out[14 + outpos] = ((in[14 + inpos]) >>> (31 - 17))
| ((in[15 + inpos]) << 17);
- out[15 + outpos] = ((in[15 + inpos] & 2147483647) >>> (31 - 16))
+ out[15 + outpos] = ((in[15 + inpos]) >>> (31 - 16))
| ((in[16 + inpos]) << 16);
- out[16 + outpos] = ((in[16 + inpos] & 2147483647) >>> (31 - 15))
+ out[16 + outpos] = ((in[16 + inpos]) >>> (31 - 15))
| ((in[17 + inpos]) << 15);
- out[17 + outpos] = ((in[17 + inpos] & 2147483647) >>> (31 - 14))
+ out[17 + outpos] = ((in[17 + inpos]) >>> (31 - 14))
| ((in[18 + inpos]) << 14);
- out[18 + outpos] = ((in[18 + inpos] & 2147483647) >>> (31 - 13))
+ out[18 + outpos] = ((in[18 + inpos]) >>> (31 - 13))
| ((in[19 + inpos]) << 13);
- out[19 + outpos] = ((in[19 + inpos] & 2147483647) >>> (31 - 12))
+ out[19 + outpos] = ((in[19 + inpos]) >>> (31 - 12))
| ((in[20 + inpos]) << 12);
- out[20 + outpos] = ((in[20 + inpos] & 2147483647) >>> (31 - 11))
+ out[20 + outpos] = ((in[20 + inpos]) >>> (31 - 11))
| ((in[21 + inpos]) << 11);
- out[21 + outpos] = ((in[21 + inpos] & 2147483647) >>> (31 - 10))
+ out[21 + outpos] = ((in[21 + inpos]) >>> (31 - 10))
| ((in[22 + inpos]) << 10);
- out[22 + outpos] = ((in[22 + inpos] & 2147483647) >>> (31 - 9))
+ out[22 + outpos] = ((in[22 + inpos]) >>> (31 - 9))
| ((in[23 + inpos]) << 9);
- out[23 + outpos] = ((in[23 + inpos] & 2147483647) >>> (31 - 8))
+ out[23 + outpos] = ((in[23 + inpos]) >>> (31 - 8))
| ((in[24 + inpos]) << 8);
- out[24 + outpos] = ((in[24 + inpos] & 2147483647) >>> (31 - 7))
+ out[24 + outpos] = ((in[24 + inpos]) >>> (31 - 7))
| ((in[25 + inpos]) << 7);
- out[25 + outpos] = ((in[25 + inpos] & 2147483647) >>> (31 - 6))
+ out[25 + outpos] = ((in[25 + inpos]) >>> (31 - 6))
| ((in[26 + inpos]) << 6);
- out[26 + outpos] = ((in[26 + inpos] & 2147483647) >>> (31 - 5))
+ out[26 + outpos] = ((in[26 + inpos]) >>> (31 - 5))
| ((in[27 + inpos]) << 5);
- out[27 + outpos] = ((in[27 + inpos] & 2147483647) >>> (31 - 4))
+ out[27 + outpos] = ((in[27 + inpos]) >>> (31 - 4))
| ((in[28 + inpos]) << 4);
- out[28 + outpos] = ((in[28 + inpos] & 2147483647) >>> (31 - 3))
+ out[28 + outpos] = ((in[28 + inpos]) >>> (31 - 3))
| ((in[29 + inpos]) << 3);
- out[29 + outpos] = ((in[29 + inpos] & 2147483647) >>> (31 - 2))
+ out[29 + outpos] = ((in[29 + inpos]) >>> (31 - 2))
| ((in[30 + inpos]) << 2);
- out[30 + outpos] = ((in[30 + inpos] & 2147483647) >>> (31 - 1))
+ out[30 + outpos] = ((in[30 + inpos]) >>> (31 - 1))
| ((in[31 + inpos]) << 1);
}
- protected static void fastunpack1(final int[] in, int inpos,
+ protected static void fastpackwithoutmask32(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 1);
- out[1 + outpos] = ((in[0 + inpos] >>> 1) & 1);
- out[2 + outpos] = ((in[0 + inpos] >>> 2) & 1);
- out[3 + outpos] = ((in[0 + inpos] >>> 3) & 1);
- out[4 + outpos] = ((in[0 + inpos] >>> 4) & 1);
- out[5 + outpos] = ((in[0 + inpos] >>> 5) & 1);
- out[6 + outpos] = ((in[0 + inpos] >>> 6) & 1);
- out[7 + outpos] = ((in[0 + inpos] >>> 7) & 1);
- out[8 + outpos] = ((in[0 + inpos] >>> 8) & 1);
- out[9 + outpos] = ((in[0 + inpos] >>> 9) & 1);
- out[10 + outpos] = ((in[0 + inpos] >>> 10) & 1);
- out[11 + outpos] = ((in[0 + inpos] >>> 11) & 1);
- out[12 + outpos] = ((in[0 + inpos] >>> 12) & 1);
- out[13 + outpos] = ((in[0 + inpos] >>> 13) & 1);
- out[14 + outpos] = ((in[0 + inpos] >>> 14) & 1);
- out[15 + outpos] = ((in[0 + inpos] >>> 15) & 1);
- out[16 + outpos] = ((in[0 + inpos] >>> 16) & 1);
- out[17 + outpos] = ((in[0 + inpos] >>> 17) & 1);
- out[18 + outpos] = ((in[0 + inpos] >>> 18) & 1);
- out[19 + outpos] = ((in[0 + inpos] >>> 19) & 1);
- out[20 + outpos] = ((in[0 + inpos] >>> 20) & 1);
- out[21 + outpos] = ((in[0 + inpos] >>> 21) & 1);
- out[22 + outpos] = ((in[0 + inpos] >>> 22) & 1);
- out[23 + outpos] = ((in[0 + inpos] >>> 23) & 1);
- out[24 + outpos] = ((in[0 + inpos] >>> 24) & 1);
- out[25 + outpos] = ((in[0 + inpos] >>> 25) & 1);
- out[26 + outpos] = ((in[0 + inpos] >>> 26) & 1);
- out[27 + outpos] = ((in[0 + inpos] >>> 27) & 1);
- out[28 + outpos] = ((in[0 + inpos] >>> 28) & 1);
- out[29 + outpos] = ((in[0 + inpos] >>> 29) & 1);
- out[30 + outpos] = ((in[0 + inpos] >>> 30) & 1);
- out[31 + outpos] = (in[0 + inpos] >>> 31);
+ System.arraycopy(in, inpos, out, outpos, 32);
}
- protected static void fastunpack2(final int[] in, int inpos,
+ protected static void fastpackwithoutmask4(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 3);
- out[1 + outpos] = ((in[0 + inpos] >>> 2) & 3);
- out[2 + outpos] = ((in[0 + inpos] >>> 4) & 3);
- out[3 + outpos] = ((in[0 + inpos] >>> 6) & 3);
- out[4 + outpos] = ((in[0 + inpos] >>> 8) & 3);
- out[5 + outpos] = ((in[0 + inpos] >>> 10) & 3);
- out[6 + outpos] = ((in[0 + inpos] >>> 12) & 3);
- out[7 + outpos] = ((in[0 + inpos] >>> 14) & 3);
- out[8 + outpos] = ((in[0 + inpos] >>> 16) & 3);
- out[9 + outpos] = ((in[0 + inpos] >>> 18) & 3);
- out[10 + outpos] = ((in[0 + inpos] >>> 20) & 3);
- out[11 + outpos] = ((in[0 + inpos] >>> 22) & 3);
- out[12 + outpos] = ((in[0 + inpos] >>> 24) & 3);
- out[13 + outpos] = ((in[0 + inpos] >>> 26) & 3);
- out[14 + outpos] = ((in[0 + inpos] >>> 28) & 3);
- out[15 + outpos] = (in[0 + inpos] >>> 30);
- out[16 + outpos] = ((in[1 + inpos] >>> 0) & 3);
- out[17 + outpos] = ((in[1 + inpos] >>> 2) & 3);
- out[18 + outpos] = ((in[1 + inpos] >>> 4) & 3);
- out[19 + outpos] = ((in[1 + inpos] >>> 6) & 3);
- out[20 + outpos] = ((in[1 + inpos] >>> 8) & 3);
- out[21 + outpos] = ((in[1 + inpos] >>> 10) & 3);
- out[22 + outpos] = ((in[1 + inpos] >>> 12) & 3);
- out[23 + outpos] = ((in[1 + inpos] >>> 14) & 3);
- out[24 + outpos] = ((in[1 + inpos] >>> 16) & 3);
- out[25 + outpos] = ((in[1 + inpos] >>> 18) & 3);
- out[26 + outpos] = ((in[1 + inpos] >>> 20) & 3);
- out[27 + outpos] = ((in[1 + inpos] >>> 22) & 3);
- out[28 + outpos] = ((in[1 + inpos] >>> 24) & 3);
- out[29 + outpos] = ((in[1 + inpos] >>> 26) & 3);
- out[30 + outpos] = ((in[1 + inpos] >>> 28) & 3);
- out[31 + outpos] = (in[1 + inpos] >>> 30);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 4)
+ | ((in[2 + inpos]) << 8) | ((in[3 + inpos]) << 12)
+ | ((in[4 + inpos]) << 16) | ((in[5 + inpos]) << 20)
+ | ((in[6 + inpos]) << 24) | ((in[7 + inpos]) << 28);
+ out[1 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 4)
+ | ((in[10 + inpos]) << 8) | ((in[11 + inpos]) << 12)
+ | ((in[12 + inpos]) << 16) | ((in[13 + inpos]) << 20)
+ | ((in[14 + inpos]) << 24) | ((in[15 + inpos]) << 28);
+ out[2 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 4)
+ | ((in[18 + inpos]) << 8) | ((in[19 + inpos]) << 12)
+ | ((in[20 + inpos]) << 16) | ((in[21 + inpos]) << 20)
+ | ((in[22 + inpos]) << 24) | ((in[23 + inpos]) << 28);
+ out[3 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 4)
+ | ((in[26 + inpos]) << 8) | ((in[27 + inpos]) << 12)
+ | ((in[28 + inpos]) << 16) | ((in[29 + inpos]) << 20)
+ | ((in[30 + inpos]) << 24) | ((in[31 + inpos]) << 28);
}
- protected static void fastunpack3(final int[] in, int inpos,
+ protected static void fastpackwithoutmask5(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 7);
- out[1 + outpos] = ((in[0 + inpos] >>> 3) & 7);
- out[2 + outpos] = ((in[0 + inpos] >>> 6) & 7);
- out[3 + outpos] = ((in[0 + inpos] >>> 9) & 7);
- out[4 + outpos] = ((in[0 + inpos] >>> 12) & 7);
- out[5 + outpos] = ((in[0 + inpos] >>> 15) & 7);
- out[6 + outpos] = ((in[0 + inpos] >>> 18) & 7);
- out[7 + outpos] = ((in[0 + inpos] >>> 21) & 7);
- out[8 + outpos] = ((in[0 + inpos] >>> 24) & 7);
- out[9 + outpos] = ((in[0 + inpos] >>> 27) & 7);
- out[10 + outpos] = (in[0 + inpos] >>> 30)
- | ((in[1 + inpos] & 1) << (3 - 1));
- out[11 + outpos] = ((in[1 + inpos] >>> 1) & 7);
- out[12 + outpos] = ((in[1 + inpos] >>> 4) & 7);
- out[13 + outpos] = ((in[1 + inpos] >>> 7) & 7);
- out[14 + outpos] = ((in[1 + inpos] >>> 10) & 7);
- out[15 + outpos] = ((in[1 + inpos] >>> 13) & 7);
- out[16 + outpos] = ((in[1 + inpos] >>> 16) & 7);
- out[17 + outpos] = ((in[1 + inpos] >>> 19) & 7);
- out[18 + outpos] = ((in[1 + inpos] >>> 22) & 7);
- out[19 + outpos] = ((in[1 + inpos] >>> 25) & 7);
- out[20 + outpos] = ((in[1 + inpos] >>> 28) & 7);
- out[21 + outpos] = (in[1 + inpos] >>> 31)
- | ((in[2 + inpos] & 3) << (3 - 2));
- out[22 + outpos] = ((in[2 + inpos] >>> 2) & 7);
- out[23 + outpos] = ((in[2 + inpos] >>> 5) & 7);
- out[24 + outpos] = ((in[2 + inpos] >>> 8) & 7);
- out[25 + outpos] = ((in[2 + inpos] >>> 11) & 7);
- out[26 + outpos] = ((in[2 + inpos] >>> 14) & 7);
- out[27 + outpos] = ((in[2 + inpos] >>> 17) & 7);
- out[28 + outpos] = ((in[2 + inpos] >>> 20) & 7);
- out[29 + outpos] = ((in[2 + inpos] >>> 23) & 7);
- out[30 + outpos] = ((in[2 + inpos] >>> 26) & 7);
- out[31 + outpos] = (in[2 + inpos] >>> 29);
- }
-
- protected static void fastunpack4(final int[] in, int inpos,
- final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 15);
- out[1 + outpos] = ((in[0 + inpos] >>> 4) & 15);
- out[2 + outpos] = ((in[0 + inpos] >>> 8) & 15);
- out[3 + outpos] = ((in[0 + inpos] >>> 12) & 15);
- out[4 + outpos] = ((in[0 + inpos] >>> 16) & 15);
- out[5 + outpos] = ((in[0 + inpos] >>> 20) & 15);
- out[6 + outpos] = ((in[0 + inpos] >>> 24) & 15);
- out[7 + outpos] = (in[0 + inpos] >>> 28);
- out[8 + outpos] = ((in[1 + inpos] >>> 0) & 15);
- out[9 + outpos] = ((in[1 + inpos] >>> 4) & 15);
- out[10 + outpos] = ((in[1 + inpos] >>> 8) & 15);
- out[11 + outpos] = ((in[1 + inpos] >>> 12) & 15);
- out[12 + outpos] = ((in[1 + inpos] >>> 16) & 15);
- out[13 + outpos] = ((in[1 + inpos] >>> 20) & 15);
- out[14 + outpos] = ((in[1 + inpos] >>> 24) & 15);
- out[15 + outpos] = (in[1 + inpos] >>> 28);
- out[16 + outpos] = ((in[2 + inpos] >>> 0) & 15);
- out[17 + outpos] = ((in[2 + inpos] >>> 4) & 15);
- out[18 + outpos] = ((in[2 + inpos] >>> 8) & 15);
- out[19 + outpos] = ((in[2 + inpos] >>> 12) & 15);
- out[20 + outpos] = ((in[2 + inpos] >>> 16) & 15);
- out[21 + outpos] = ((in[2 + inpos] >>> 20) & 15);
- out[22 + outpos] = ((in[2 + inpos] >>> 24) & 15);
- out[23 + outpos] = (in[2 + inpos] >>> 28);
- out[24 + outpos] = ((in[3 + inpos] >>> 0) & 15);
- out[25 + outpos] = ((in[3 + inpos] >>> 4) & 15);
- out[26 + outpos] = ((in[3 + inpos] >>> 8) & 15);
- out[27 + outpos] = ((in[3 + inpos] >>> 12) & 15);
- out[28 + outpos] = ((in[3 + inpos] >>> 16) & 15);
- out[29 + outpos] = ((in[3 + inpos] >>> 20) & 15);
- out[30 + outpos] = ((in[3 + inpos] >>> 24) & 15);
- out[31 + outpos] = (in[3 + inpos] >>> 28);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 5)
+ | ((in[2 + inpos]) << 10) | ((in[3 + inpos]) << 15)
+ | ((in[4 + inpos]) << 20) | ((in[5 + inpos]) << 25)
+ | ((in[6 + inpos]) << 30);
+ out[1 + outpos] = ((in[6 + inpos]) >>> (5 - 3))
+ | ((in[7 + inpos]) << 3) | ((in[8 + inpos]) << 8)
+ | ((in[9 + inpos]) << 13) | ((in[10 + inpos]) << 18)
+ | ((in[11 + inpos]) << 23) | ((in[12 + inpos]) << 28);
+ out[2 + outpos] = ((in[12 + inpos]) >>> (5 - 1))
+ | ((in[13 + inpos]) << 1) | ((in[14 + inpos]) << 6)
+ | ((in[15 + inpos]) << 11) | ((in[16 + inpos]) << 16)
+ | ((in[17 + inpos]) << 21) | ((in[18 + inpos]) << 26)
+ | ((in[19 + inpos]) << 31);
+ out[3 + outpos] = ((in[19 + inpos]) >>> (5 - 4))
+ | ((in[20 + inpos]) << 4) | ((in[21 + inpos]) << 9)
+ | ((in[22 + inpos]) << 14) | ((in[23 + inpos]) << 19)
+ | ((in[24 + inpos]) << 24) | ((in[25 + inpos]) << 29);
+ out[4 + outpos] = ((in[25 + inpos]) >>> (5 - 2))
+ | ((in[26 + inpos]) << 2) | ((in[27 + inpos]) << 7)
+ | ((in[28 + inpos]) << 12) | ((in[29 + inpos]) << 17)
+ | ((in[30 + inpos]) << 22) | ((in[31 + inpos]) << 27);
}
- protected static void fastunpack5(final int[] in, int inpos,
+ protected static void fastpackwithoutmask6(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 31);
- out[1 + outpos] = ((in[0 + inpos] >>> 5) & 31);
- out[2 + outpos] = ((in[0 + inpos] >>> 10) & 31);
- out[3 + outpos] = ((in[0 + inpos] >>> 15) & 31);
- out[4 + outpos] = ((in[0 + inpos] >>> 20) & 31);
- out[5 + outpos] = ((in[0 + inpos] >>> 25) & 31);
- out[6 + outpos] = (in[0 + inpos] >>> 30)
- | ((in[1 + inpos] & 7) << (5 - 3));
- out[7 + outpos] = ((in[1 + inpos] >>> 3) & 31);
- out[8 + outpos] = ((in[1 + inpos] >>> 8) & 31);
- out[9 + outpos] = ((in[1 + inpos] >>> 13) & 31);
- out[10 + outpos] = ((in[1 + inpos] >>> 18) & 31);
- out[11 + outpos] = ((in[1 + inpos] >>> 23) & 31);
- out[12 + outpos] = (in[1 + inpos] >>> 28)
- | ((in[2 + inpos] & 1) << (5 - 1));
- out[13 + outpos] = ((in[2 + inpos] >>> 1) & 31);
- out[14 + outpos] = ((in[2 + inpos] >>> 6) & 31);
- out[15 + outpos] = ((in[2 + inpos] >>> 11) & 31);
- out[16 + outpos] = ((in[2 + inpos] >>> 16) & 31);
- out[17 + outpos] = ((in[2 + inpos] >>> 21) & 31);
- out[18 + outpos] = ((in[2 + inpos] >>> 26) & 31);
- out[19 + outpos] = (in[2 + inpos] >>> 31)
- | ((in[3 + inpos] & 15) << (5 - 4));
- out[20 + outpos] = ((in[3 + inpos] >>> 4) & 31);
- out[21 + outpos] = ((in[3 + inpos] >>> 9) & 31);
- out[22 + outpos] = ((in[3 + inpos] >>> 14) & 31);
- out[23 + outpos] = ((in[3 + inpos] >>> 19) & 31);
- out[24 + outpos] = ((in[3 + inpos] >>> 24) & 31);
- out[25 + outpos] = (in[3 + inpos] >>> 29)
- | ((in[4 + inpos] & 3) << (5 - 2));
- out[26 + outpos] = ((in[4 + inpos] >>> 2) & 31);
- out[27 + outpos] = ((in[4 + inpos] >>> 7) & 31);
- out[28 + outpos] = ((in[4 + inpos] >>> 12) & 31);
- out[29 + outpos] = ((in[4 + inpos] >>> 17) & 31);
- out[30 + outpos] = ((in[4 + inpos] >>> 22) & 31);
- out[31 + outpos] = (in[4 + inpos] >>> 27);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 6)
+ | ((in[2 + inpos]) << 12) | ((in[3 + inpos]) << 18)
+ | ((in[4 + inpos]) << 24) | ((in[5 + inpos]) << 30);
+ out[1 + outpos] = ((in[5 + inpos]) >>> (6 - 4))
+ | ((in[6 + inpos]) << 4) | ((in[7 + inpos]) << 10)
+ | ((in[8 + inpos]) << 16) | ((in[9 + inpos]) << 22)
+ | ((in[10 + inpos]) << 28);
+ out[2 + outpos] = ((in[10 + inpos]) >>> (6 - 2))
+ | ((in[11 + inpos]) << 2) | ((in[12 + inpos]) << 8)
+ | ((in[13 + inpos]) << 14) | ((in[14 + inpos]) << 20)
+ | ((in[15 + inpos]) << 26);
+ out[3 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 6)
+ | ((in[18 + inpos]) << 12) | ((in[19 + inpos]) << 18)
+ | ((in[20 + inpos]) << 24) | ((in[21 + inpos]) << 30);
+ out[4 + outpos] = ((in[21 + inpos]) >>> (6 - 4))
+ | ((in[22 + inpos]) << 4) | ((in[23 + inpos]) << 10)
+ | ((in[24 + inpos]) << 16) | ((in[25 + inpos]) << 22)
+ | ((in[26 + inpos]) << 28);
+ out[5 + outpos] = ((in[26 + inpos]) >>> (6 - 2))
+ | ((in[27 + inpos]) << 2) | ((in[28 + inpos]) << 8)
+ | ((in[29 + inpos]) << 14) | ((in[30 + inpos]) << 20)
+ | ((in[31 + inpos]) << 26);
}
- protected static void fastunpack6(final int[] in, int inpos,
+ protected static void fastpackwithoutmask7(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 63);
- out[1 + outpos] = ((in[0 + inpos] >>> 6) & 63);
- out[2 + outpos] = ((in[0 + inpos] >>> 12) & 63);
- out[3 + outpos] = ((in[0 + inpos] >>> 18) & 63);
- out[4 + outpos] = ((in[0 + inpos] >>> 24) & 63);
- out[5 + outpos] = (in[0 + inpos] >>> 30)
- | ((in[1 + inpos] & 15) << (6 - 4));
- out[6 + outpos] = ((in[1 + inpos] >>> 4) & 63);
- out[7 + outpos] = ((in[1 + inpos] >>> 10) & 63);
- out[8 + outpos] = ((in[1 + inpos] >>> 16) & 63);
- out[9 + outpos] = ((in[1 + inpos] >>> 22) & 63);
- out[10 + outpos] = (in[1 + inpos] >>> 28)
- | ((in[2 + inpos] & 3) << (6 - 2));
- out[11 + outpos] = ((in[2 + inpos] >>> 2) & 63);
- out[12 + outpos] = ((in[2 + inpos] >>> 8) & 63);
- out[13 + outpos] = ((in[2 + inpos] >>> 14) & 63);
- out[14 + outpos] = ((in[2 + inpos] >>> 20) & 63);
- out[15 + outpos] = (in[2 + inpos] >>> 26);
- out[16 + outpos] = ((in[3 + inpos] >>> 0) & 63);
- out[17 + outpos] = ((in[3 + inpos] >>> 6) & 63);
- out[18 + outpos] = ((in[3 + inpos] >>> 12) & 63);
- out[19 + outpos] = ((in[3 + inpos] >>> 18) & 63);
- out[20 + outpos] = ((in[3 + inpos] >>> 24) & 63);
- out[21 + outpos] = (in[3 + inpos] >>> 30)
- | ((in[4 + inpos] & 15) << (6 - 4));
- out[22 + outpos] = ((in[4 + inpos] >>> 4) & 63);
- out[23 + outpos] = ((in[4 + inpos] >>> 10) & 63);
- out[24 + outpos] = ((in[4 + inpos] >>> 16) & 63);
- out[25 + outpos] = ((in[4 + inpos] >>> 22) & 63);
- out[26 + outpos] = (in[4 + inpos] >>> 28)
- | ((in[5 + inpos] & 3) << (6 - 2));
- out[27 + outpos] = ((in[5 + inpos] >>> 2) & 63);
- out[28 + outpos] = ((in[5 + inpos] >>> 8) & 63);
- out[29 + outpos] = ((in[5 + inpos] >>> 14) & 63);
- out[30 + outpos] = ((in[5 + inpos] >>> 20) & 63);
- out[31 + outpos] = (in[5 + inpos] >>> 26);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 7)
+ | ((in[2 + inpos]) << 14) | ((in[3 + inpos]) << 21)
+ | ((in[4 + inpos]) << 28);
+ out[1 + outpos] = ((in[4 + inpos]) >>> (7 - 3))
+ | ((in[5 + inpos]) << 3) | ((in[6 + inpos]) << 10)
+ | ((in[7 + inpos]) << 17) | ((in[8 + inpos]) << 24)
+ | ((in[9 + inpos]) << 31);
+ out[2 + outpos] = ((in[9 + inpos]) >>> (7 - 6))
+ | ((in[10 + inpos]) << 6) | ((in[11 + inpos]) << 13)
+ | ((in[12 + inpos]) << 20) | ((in[13 + inpos]) << 27);
+ out[3 + outpos] = ((in[13 + inpos]) >>> (7 - 2))
+ | ((in[14 + inpos]) << 2) | ((in[15 + inpos]) << 9)
+ | ((in[16 + inpos]) << 16) | ((in[17 + inpos]) << 23)
+ | ((in[18 + inpos]) << 30);
+ out[4 + outpos] = ((in[18 + inpos]) >>> (7 - 5))
+ | ((in[19 + inpos]) << 5) | ((in[20 + inpos]) << 12)
+ | ((in[21 + inpos]) << 19) | ((in[22 + inpos]) << 26);
+ out[5 + outpos] = ((in[22 + inpos]) >>> (7 - 1))
+ | ((in[23 + inpos]) << 1) | ((in[24 + inpos]) << 8)
+ | ((in[25 + inpos]) << 15) | ((in[26 + inpos]) << 22)
+ | ((in[27 + inpos]) << 29);
+ out[6 + outpos] = ((in[27 + inpos]) >>> (7 - 4))
+ | ((in[28 + inpos]) << 4) | ((in[29 + inpos]) << 11)
+ | ((in[30 + inpos]) << 18) | ((in[31 + inpos]) << 25);
}
- protected static void fastunpack7(final int[] in, int inpos,
+ protected static void fastpackwithoutmask8(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 127);
- out[1 + outpos] = ((in[0 + inpos] >>> 7) & 127);
- out[2 + outpos] = ((in[0 + inpos] >>> 14) & 127);
- out[3 + outpos] = ((in[0 + inpos] >>> 21) & 127);
- out[4 + outpos] = (in[0 + inpos] >>> 28)
- | ((in[1 + inpos] & 7) << (7 - 3));
- out[5 + outpos] = ((in[1 + inpos] >>> 3) & 127);
- out[6 + outpos] = ((in[1 + inpos] >>> 10) & 127);
- out[7 + outpos] = ((in[1 + inpos] >>> 17) & 127);
- out[8 + outpos] = ((in[1 + inpos] >>> 24) & 127);
- out[9 + outpos] = (in[1 + inpos] >>> 31)
- | ((in[2 + inpos] & 63) << (7 - 6));
- out[10 + outpos] = ((in[2 + inpos] >>> 6) & 127);
- out[11 + outpos] = ((in[2 + inpos] >>> 13) & 127);
- out[12 + outpos] = ((in[2 + inpos] >>> 20) & 127);
- out[13 + outpos] = (in[2 + inpos] >>> 27)
- | ((in[3 + inpos] & 3) << (7 - 2));
- out[14 + outpos] = ((in[3 + inpos] >>> 2) & 127);
- out[15 + outpos] = ((in[3 + inpos] >>> 9) & 127);
- out[16 + outpos] = ((in[3 + inpos] >>> 16) & 127);
- out[17 + outpos] = ((in[3 + inpos] >>> 23) & 127);
- out[18 + outpos] = (in[3 + inpos] >>> 30)
- | ((in[4 + inpos] & 31) << (7 - 5));
- out[19 + outpos] = ((in[4 + inpos] >>> 5) & 127);
- out[20 + outpos] = ((in[4 + inpos] >>> 12) & 127);
- out[21 + outpos] = ((in[4 + inpos] >>> 19) & 127);
- out[22 + outpos] = (in[4 + inpos] >>> 26)
- | ((in[5 + inpos] & 1) << (7 - 1));
- out[23 + outpos] = ((in[5 + inpos] >>> 1) & 127);
- out[24 + outpos] = ((in[5 + inpos] >>> 8) & 127);
- out[25 + outpos] = ((in[5 + inpos] >>> 15) & 127);
- out[26 + outpos] = ((in[5 + inpos] >>> 22) & 127);
- out[27 + outpos] = (in[5 + inpos] >>> 29)
- | ((in[6 + inpos] & 15) << (7 - 4));
- out[28 + outpos] = ((in[6 + inpos] >>> 4) & 127);
- out[29 + outpos] = ((in[6 + inpos] >>> 11) & 127);
- out[30 + outpos] = ((in[6 + inpos] >>> 18) & 127);
- out[31 + outpos] = (in[6 + inpos] >>> 25);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 8)
+ | ((in[2 + inpos]) << 16) | ((in[3 + inpos]) << 24);
+ out[1 + outpos] = in[4 + inpos] | ((in[5 + inpos]) << 8)
+ | ((in[6 + inpos]) << 16) | ((in[7 + inpos]) << 24);
+ out[2 + outpos] = in[8 + inpos] | ((in[9 + inpos]) << 8)
+ | ((in[10 + inpos]) << 16) | ((in[11 + inpos]) << 24);
+ out[3 + outpos] = in[12 + inpos] | ((in[13 + inpos]) << 8)
+ | ((in[14 + inpos]) << 16) | ((in[15 + inpos]) << 24);
+ out[4 + outpos] = in[16 + inpos] | ((in[17 + inpos]) << 8)
+ | ((in[18 + inpos]) << 16) | ((in[19 + inpos]) << 24);
+ out[5 + outpos] = in[20 + inpos] | ((in[21 + inpos]) << 8)
+ | ((in[22 + inpos]) << 16) | ((in[23 + inpos]) << 24);
+ out[6 + outpos] = in[24 + inpos] | ((in[25 + inpos]) << 8)
+ | ((in[26 + inpos]) << 16) | ((in[27 + inpos]) << 24);
+ out[7 + outpos] = in[28 + inpos] | ((in[29 + inpos]) << 8)
+ | ((in[30 + inpos]) << 16) | ((in[31 + inpos]) << 24);
}
- protected static void fastunpack8(final int[] in, int inpos,
+ protected static void fastpackwithoutmask9(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 255);
- out[1 + outpos] = ((in[0 + inpos] >>> 8) & 255);
- out[2 + outpos] = ((in[0 + inpos] >>> 16) & 255);
- out[3 + outpos] = (in[0 + inpos] >>> 24);
- out[4 + outpos] = ((in[1 + inpos] >>> 0) & 255);
- out[5 + outpos] = ((in[1 + inpos] >>> 8) & 255);
- out[6 + outpos] = ((in[1 + inpos] >>> 16) & 255);
- out[7 + outpos] = (in[1 + inpos] >>> 24);
- out[8 + outpos] = ((in[2 + inpos] >>> 0) & 255);
- out[9 + outpos] = ((in[2 + inpos] >>> 8) & 255);
- out[10 + outpos] = ((in[2 + inpos] >>> 16) & 255);
- out[11 + outpos] = (in[2 + inpos] >>> 24);
- out[12 + outpos] = ((in[3 + inpos] >>> 0) & 255);
- out[13 + outpos] = ((in[3 + inpos] >>> 8) & 255);
- out[14 + outpos] = ((in[3 + inpos] >>> 16) & 255);
- out[15 + outpos] = (in[3 + inpos] >>> 24);
- out[16 + outpos] = ((in[4 + inpos] >>> 0) & 255);
- out[17 + outpos] = ((in[4 + inpos] >>> 8) & 255);
- out[18 + outpos] = ((in[4 + inpos] >>> 16) & 255);
- out[19 + outpos] = (in[4 + inpos] >>> 24);
- out[20 + outpos] = ((in[5 + inpos] >>> 0) & 255);
- out[21 + outpos] = ((in[5 + inpos] >>> 8) & 255);
- out[22 + outpos] = ((in[5 + inpos] >>> 16) & 255);
- out[23 + outpos] = (in[5 + inpos] >>> 24);
- out[24 + outpos] = ((in[6 + inpos] >>> 0) & 255);
- out[25 + outpos] = ((in[6 + inpos] >>> 8) & 255);
- out[26 + outpos] = ((in[6 + inpos] >>> 16) & 255);
- out[27 + outpos] = (in[6 + inpos] >>> 24);
- out[28 + outpos] = ((in[7 + inpos] >>> 0) & 255);
- out[29 + outpos] = ((in[7 + inpos] >>> 8) & 255);
- out[30 + outpos] = ((in[7 + inpos] >>> 16) & 255);
- out[31 + outpos] = (in[7 + inpos] >>> 24);
+ out[0 + outpos] = in[0 + inpos] | ((in[1 + inpos]) << 9)
+ | ((in[2 + inpos]) << 18) | ((in[3 + inpos]) << 27);
+ out[1 + outpos] = ((in[3 + inpos]) >>> (9 - 4))
+ | ((in[4 + inpos]) << 4) | ((in[5 + inpos]) << 13)
+ | ((in[6 + inpos]) << 22) | ((in[7 + inpos]) << 31);
+ out[2 + outpos] = ((in[7 + inpos]) >>> (9 - 8))
+ | ((in[8 + inpos]) << 8) | ((in[9 + inpos]) << 17)
+ | ((in[10 + inpos]) << 26);
+ out[3 + outpos] = ((in[10 + inpos]) >>> (9 - 3))
+ | ((in[11 + inpos]) << 3) | ((in[12 + inpos]) << 12)
+ | ((in[13 + inpos]) << 21) | ((in[14 + inpos]) << 30);
+ out[4 + outpos] = ((in[14 + inpos]) >>> (9 - 7))
+ | ((in[15 + inpos]) << 7) | ((in[16 + inpos]) << 16)
+ | ((in[17 + inpos]) << 25);
+ out[5 + outpos] = ((in[17 + inpos]) >>> (9 - 2))
+ | ((in[18 + inpos]) << 2) | ((in[19 + inpos]) << 11)
+ | ((in[20 + inpos]) << 20) | ((in[21 + inpos]) << 29);
+ out[6 + outpos] = ((in[21 + inpos]) >>> (9 - 6))
+ | ((in[22 + inpos]) << 6) | ((in[23 + inpos]) << 15)
+ | ((in[24 + inpos]) << 24);
+ out[7 + outpos] = ((in[24 + inpos]) >>> (9 - 1))
+ | ((in[25 + inpos]) << 1) | ((in[26 + inpos]) << 10)
+ | ((in[27 + inpos]) << 19) | ((in[28 + inpos]) << 28);
+ out[8 + outpos] = ((in[28 + inpos]) >>> (9 - 5))
+ | ((in[29 + inpos]) << 5) | ((in[30 + inpos]) << 14)
+ | ((in[31 + inpos]) << 23);
}
- protected static void fastunpack9(final int[] in, int inpos,
+ /**
+ * Pack the 32 integers
+ *
+ * @param in
+ * source array
+ * @param inpos
+ * starting point in the source array
+ * @param out
+ * output array
+ * @param outpos
+ * starting point in the output array
+ * @param bit
+ * how many bits to use per integer
+ */
+ public static void fastunpack(final int[] in, final int inpos,
+ final int[] out, final int outpos, final int bit) {
+ switch (bit) {
+ case 0:
+ fastunpack0(in, inpos, out, outpos);
+ break;
+ case 1:
+ fastunpack1(in, inpos, out, outpos);
+ break;
+ case 2:
+ fastunpack2(in, inpos, out, outpos);
+ break;
+ case 3:
+ fastunpack3(in, inpos, out, outpos);
+ break;
+ case 4:
+ fastunpack4(in, inpos, out, outpos);
+ break;
+ case 5:
+ fastunpack5(in, inpos, out, outpos);
+ break;
+ case 6:
+ fastunpack6(in, inpos, out, outpos);
+ break;
+ case 7:
+ fastunpack7(in, inpos, out, outpos);
+ break;
+ case 8:
+ fastunpack8(in, inpos, out, outpos);
+ break;
+ case 9:
+ fastunpack9(in, inpos, out, outpos);
+ break;
+ case 10:
+ fastunpack10(in, inpos, out, outpos);
+ break;
+ case 11:
+ fastunpack11(in, inpos, out, outpos);
+ break;
+ case 12:
+ fastunpack12(in, inpos, out, outpos);
+ break;
+ case 13:
+ fastunpack13(in, inpos, out, outpos);
+ break;
+ case 14:
+ fastunpack14(in, inpos, out, outpos);
+ break;
+ case 15:
+ fastunpack15(in, inpos, out, outpos);
+ break;
+ case 16:
+ fastunpack16(in, inpos, out, outpos);
+ break;
+ case 17:
+ fastunpack17(in, inpos, out, outpos);
+ break;
+ case 18:
+ fastunpack18(in, inpos, out, outpos);
+ break;
+ case 19:
+ fastunpack19(in, inpos, out, outpos);
+ break;
+ case 20:
+ fastunpack20(in, inpos, out, outpos);
+ break;
+ case 21:
+ fastunpack21(in, inpos, out, outpos);
+ break;
+ case 22:
+ fastunpack22(in, inpos, out, outpos);
+ break;
+ case 23:
+ fastunpack23(in, inpos, out, outpos);
+ break;
+ case 24:
+ fastunpack24(in, inpos, out, outpos);
+ break;
+ case 25:
+ fastunpack25(in, inpos, out, outpos);
+ break;
+ case 26:
+ fastunpack26(in, inpos, out, outpos);
+ break;
+ case 27:
+ fastunpack27(in, inpos, out, outpos);
+ break;
+ case 28:
+ fastunpack28(in, inpos, out, outpos);
+ break;
+ case 29:
+ fastunpack29(in, inpos, out, outpos);
+ break;
+ case 30:
+ fastunpack30(in, inpos, out, outpos);
+ break;
+ case 31:
+ fastunpack31(in, inpos, out, outpos);
+ break;
+ case 32:
+ fastunpack32(in, inpos, out, outpos);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unsupported bit width.");
+ }
+ }
+
+ protected static void fastunpack0(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 511);
- out[1 + outpos] = ((in[0 + inpos] >>> 9) & 511);
- out[2 + outpos] = ((in[0 + inpos] >>> 18) & 511);
- out[3 + outpos] = (in[0 + inpos] >>> 27)
- | ((in[1 + inpos] & 15) << (9 - 4));
- out[4 + outpos] = ((in[1 + inpos] >>> 4) & 511);
- out[5 + outpos] = ((in[1 + inpos] >>> 13) & 511);
- out[6 + outpos] = ((in[1 + inpos] >>> 22) & 511);
- out[7 + outpos] = (in[1 + inpos] >>> 31)
- | ((in[2 + inpos] & 255) << (9 - 8));
- out[8 + outpos] = ((in[2 + inpos] >>> 8) & 511);
- out[9 + outpos] = ((in[2 + inpos] >>> 17) & 511);
- out[10 + outpos] = (in[2 + inpos] >>> 26)
- | ((in[3 + inpos] & 7) << (9 - 3));
- out[11 + outpos] = ((in[3 + inpos] >>> 3) & 511);
- out[12 + outpos] = ((in[3 + inpos] >>> 12) & 511);
- out[13 + outpos] = ((in[3 + inpos] >>> 21) & 511);
- out[14 + outpos] = (in[3 + inpos] >>> 30)
- | ((in[4 + inpos] & 127) << (9 - 7));
- out[15 + outpos] = ((in[4 + inpos] >>> 7) & 511);
- out[16 + outpos] = ((in[4 + inpos] >>> 16) & 511);
- out[17 + outpos] = (in[4 + inpos] >>> 25)
- | ((in[5 + inpos] & 3) << (9 - 2));
- out[18 + outpos] = ((in[5 + inpos] >>> 2) & 511);
- out[19 + outpos] = ((in[5 + inpos] >>> 11) & 511);
- out[20 + outpos] = ((in[5 + inpos] >>> 20) & 511);
- out[21 + outpos] = (in[5 + inpos] >>> 29)
- | ((in[6 + inpos] & 63) << (9 - 6));
- out[22 + outpos] = ((in[6 + inpos] >>> 6) & 511);
- out[23 + outpos] = ((in[6 + inpos] >>> 15) & 511);
- out[24 + outpos] = (in[6 + inpos] >>> 24)
- | ((in[7 + inpos] & 1) << (9 - 1));
- out[25 + outpos] = ((in[7 + inpos] >>> 1) & 511);
- out[26 + outpos] = ((in[7 + inpos] >>> 10) & 511);
- out[27 + outpos] = ((in[7 + inpos] >>> 19) & 511);
- out[28 + outpos] = (in[7 + inpos] >>> 28)
- | ((in[8 + inpos] & 31) << (9 - 5));
- out[29 + outpos] = ((in[8 + inpos] >>> 5) & 511);
- out[30 + outpos] = ((in[8 + inpos] >>> 14) & 511);
- out[31 + outpos] = (in[8 + inpos] >>> 23);
+ Arrays.fill(out, outpos, outpos + 32, 0);
+ }
+
+ protected static void fastunpack1(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 1);
+ out[1 + outpos] = ((in[0 + inpos] >>> 1) & 1);
+ out[2 + outpos] = ((in[0 + inpos] >>> 2) & 1);
+ out[3 + outpos] = ((in[0 + inpos] >>> 3) & 1);
+ out[4 + outpos] = ((in[0 + inpos] >>> 4) & 1);
+ out[5 + outpos] = ((in[0 + inpos] >>> 5) & 1);
+ out[6 + outpos] = ((in[0 + inpos] >>> 6) & 1);
+ out[7 + outpos] = ((in[0 + inpos] >>> 7) & 1);
+ out[8 + outpos] = ((in[0 + inpos] >>> 8) & 1);
+ out[9 + outpos] = ((in[0 + inpos] >>> 9) & 1);
+ out[10 + outpos] = ((in[0 + inpos] >>> 10) & 1);
+ out[11 + outpos] = ((in[0 + inpos] >>> 11) & 1);
+ out[12 + outpos] = ((in[0 + inpos] >>> 12) & 1);
+ out[13 + outpos] = ((in[0 + inpos] >>> 13) & 1);
+ out[14 + outpos] = ((in[0 + inpos] >>> 14) & 1);
+ out[15 + outpos] = ((in[0 + inpos] >>> 15) & 1);
+ out[16 + outpos] = ((in[0 + inpos] >>> 16) & 1);
+ out[17 + outpos] = ((in[0 + inpos] >>> 17) & 1);
+ out[18 + outpos] = ((in[0 + inpos] >>> 18) & 1);
+ out[19 + outpos] = ((in[0 + inpos] >>> 19) & 1);
+ out[20 + outpos] = ((in[0 + inpos] >>> 20) & 1);
+ out[21 + outpos] = ((in[0 + inpos] >>> 21) & 1);
+ out[22 + outpos] = ((in[0 + inpos] >>> 22) & 1);
+ out[23 + outpos] = ((in[0 + inpos] >>> 23) & 1);
+ out[24 + outpos] = ((in[0 + inpos] >>> 24) & 1);
+ out[25 + outpos] = ((in[0 + inpos] >>> 25) & 1);
+ out[26 + outpos] = ((in[0 + inpos] >>> 26) & 1);
+ out[27 + outpos] = ((in[0 + inpos] >>> 27) & 1);
+ out[28 + outpos] = ((in[0 + inpos] >>> 28) & 1);
+ out[29 + outpos] = ((in[0 + inpos] >>> 29) & 1);
+ out[30 + outpos] = ((in[0 + inpos] >>> 30) & 1);
+ out[31 + outpos] = (in[0 + inpos] >>> 31);
}
protected static void fastunpack10(final int[] in, int inpos,
@@ -3554,9 +3648,45 @@ protected static void fastunpack19(final int[] in, int inpos,
out[31 + outpos] = (in[18 + inpos] >>> 13);
}
- protected static void fastunpack20(final int[] in, int inpos,
+ protected static void fastunpack2(final int[] in, int inpos,
final int[] out, int outpos) {
- out[0 + outpos] = ((in[0 + inpos] >>> 0) & 1048575);
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 3);
+ out[1 + outpos] = ((in[0 + inpos] >>> 2) & 3);
+ out[2 + outpos] = ((in[0 + inpos] >>> 4) & 3);
+ out[3 + outpos] = ((in[0 + inpos] >>> 6) & 3);
+ out[4 + outpos] = ((in[0 + inpos] >>> 8) & 3);
+ out[5 + outpos] = ((in[0 + inpos] >>> 10) & 3);
+ out[6 + outpos] = ((in[0 + inpos] >>> 12) & 3);
+ out[7 + outpos] = ((in[0 + inpos] >>> 14) & 3);
+ out[8 + outpos] = ((in[0 + inpos] >>> 16) & 3);
+ out[9 + outpos] = ((in[0 + inpos] >>> 18) & 3);
+ out[10 + outpos] = ((in[0 + inpos] >>> 20) & 3);
+ out[11 + outpos] = ((in[0 + inpos] >>> 22) & 3);
+ out[12 + outpos] = ((in[0 + inpos] >>> 24) & 3);
+ out[13 + outpos] = ((in[0 + inpos] >>> 26) & 3);
+ out[14 + outpos] = ((in[0 + inpos] >>> 28) & 3);
+ out[15 + outpos] = (in[0 + inpos] >>> 30);
+ out[16 + outpos] = ((in[1 + inpos] >>> 0) & 3);
+ out[17 + outpos] = ((in[1 + inpos] >>> 2) & 3);
+ out[18 + outpos] = ((in[1 + inpos] >>> 4) & 3);
+ out[19 + outpos] = ((in[1 + inpos] >>> 6) & 3);
+ out[20 + outpos] = ((in[1 + inpos] >>> 8) & 3);
+ out[21 + outpos] = ((in[1 + inpos] >>> 10) & 3);
+ out[22 + outpos] = ((in[1 + inpos] >>> 12) & 3);
+ out[23 + outpos] = ((in[1 + inpos] >>> 14) & 3);
+ out[24 + outpos] = ((in[1 + inpos] >>> 16) & 3);
+ out[25 + outpos] = ((in[1 + inpos] >>> 18) & 3);
+ out[26 + outpos] = ((in[1 + inpos] >>> 20) & 3);
+ out[27 + outpos] = ((in[1 + inpos] >>> 22) & 3);
+ out[28 + outpos] = ((in[1 + inpos] >>> 24) & 3);
+ out[29 + outpos] = ((in[1 + inpos] >>> 26) & 3);
+ out[30 + outpos] = ((in[1 + inpos] >>> 28) & 3);
+ out[31 + outpos] = (in[1 + inpos] >>> 30);
+ }
+
+ protected static void fastunpack20(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 1048575);
out[1 + outpos] = (in[0 + inpos] >>> 20)
| ((in[1 + inpos] & 255) << (20 - 8));
out[2 + outpos] = ((in[1 + inpos] >>> 8) & 1048575);
@@ -4134,6 +4264,44 @@ protected static void fastunpack29(final int[] in, int inpos,
out[31 + outpos] = (in[28 + inpos] >>> 3);
}
+ protected static void fastunpack3(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 7);
+ out[1 + outpos] = ((in[0 + inpos] >>> 3) & 7);
+ out[2 + outpos] = ((in[0 + inpos] >>> 6) & 7);
+ out[3 + outpos] = ((in[0 + inpos] >>> 9) & 7);
+ out[4 + outpos] = ((in[0 + inpos] >>> 12) & 7);
+ out[5 + outpos] = ((in[0 + inpos] >>> 15) & 7);
+ out[6 + outpos] = ((in[0 + inpos] >>> 18) & 7);
+ out[7 + outpos] = ((in[0 + inpos] >>> 21) & 7);
+ out[8 + outpos] = ((in[0 + inpos] >>> 24) & 7);
+ out[9 + outpos] = ((in[0 + inpos] >>> 27) & 7);
+ out[10 + outpos] = (in[0 + inpos] >>> 30)
+ | ((in[1 + inpos] & 1) << (3 - 1));
+ out[11 + outpos] = ((in[1 + inpos] >>> 1) & 7);
+ out[12 + outpos] = ((in[1 + inpos] >>> 4) & 7);
+ out[13 + outpos] = ((in[1 + inpos] >>> 7) & 7);
+ out[14 + outpos] = ((in[1 + inpos] >>> 10) & 7);
+ out[15 + outpos] = ((in[1 + inpos] >>> 13) & 7);
+ out[16 + outpos] = ((in[1 + inpos] >>> 16) & 7);
+ out[17 + outpos] = ((in[1 + inpos] >>> 19) & 7);
+ out[18 + outpos] = ((in[1 + inpos] >>> 22) & 7);
+ out[19 + outpos] = ((in[1 + inpos] >>> 25) & 7);
+ out[20 + outpos] = ((in[1 + inpos] >>> 28) & 7);
+ out[21 + outpos] = (in[1 + inpos] >>> 31)
+ | ((in[2 + inpos] & 3) << (3 - 2));
+ out[22 + outpos] = ((in[2 + inpos] >>> 2) & 7);
+ out[23 + outpos] = ((in[2 + inpos] >>> 5) & 7);
+ out[24 + outpos] = ((in[2 + inpos] >>> 8) & 7);
+ out[25 + outpos] = ((in[2 + inpos] >>> 11) & 7);
+ out[26 + outpos] = ((in[2 + inpos] >>> 14) & 7);
+ out[27 + outpos] = ((in[2 + inpos] >>> 17) & 7);
+ out[28 + outpos] = ((in[2 + inpos] >>> 20) & 7);
+ out[29 + outpos] = ((in[2 + inpos] >>> 23) & 7);
+ out[30 + outpos] = ((in[2 + inpos] >>> 26) & 7);
+ out[31 + outpos] = (in[2 + inpos] >>> 29);
+ }
+
protected static void fastunpack30(final int[] in, int inpos,
final int[] out, int outpos) {
out[0 + outpos] = ((in[0 + inpos] >>> 0) & 1073741823);
@@ -4269,402 +4437,242 @@ protected static void fastunpack32(final int[] in, int inpos,
System.arraycopy(in, inpos, out, outpos, 32);
}
- protected static void fastpack32(final int[] in, int inpos,
+ protected static void fastunpack4(final int[] in, int inpos,
final int[] out, int outpos) {
- System.arraycopy(in, inpos, out, outpos, 32);
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 15);
+ out[1 + outpos] = ((in[0 + inpos] >>> 4) & 15);
+ out[2 + outpos] = ((in[0 + inpos] >>> 8) & 15);
+ out[3 + outpos] = ((in[0 + inpos] >>> 12) & 15);
+ out[4 + outpos] = ((in[0 + inpos] >>> 16) & 15);
+ out[5 + outpos] = ((in[0 + inpos] >>> 20) & 15);
+ out[6 + outpos] = ((in[0 + inpos] >>> 24) & 15);
+ out[7 + outpos] = (in[0 + inpos] >>> 28);
+ out[8 + outpos] = ((in[1 + inpos] >>> 0) & 15);
+ out[9 + outpos] = ((in[1 + inpos] >>> 4) & 15);
+ out[10 + outpos] = ((in[1 + inpos] >>> 8) & 15);
+ out[11 + outpos] = ((in[1 + inpos] >>> 12) & 15);
+ out[12 + outpos] = ((in[1 + inpos] >>> 16) & 15);
+ out[13 + outpos] = ((in[1 + inpos] >>> 20) & 15);
+ out[14 + outpos] = ((in[1 + inpos] >>> 24) & 15);
+ out[15 + outpos] = (in[1 + inpos] >>> 28);
+ out[16 + outpos] = ((in[2 + inpos] >>> 0) & 15);
+ out[17 + outpos] = ((in[2 + inpos] >>> 4) & 15);
+ out[18 + outpos] = ((in[2 + inpos] >>> 8) & 15);
+ out[19 + outpos] = ((in[2 + inpos] >>> 12) & 15);
+ out[20 + outpos] = ((in[2 + inpos] >>> 16) & 15);
+ out[21 + outpos] = ((in[2 + inpos] >>> 20) & 15);
+ out[22 + outpos] = ((in[2 + inpos] >>> 24) & 15);
+ out[23 + outpos] = (in[2 + inpos] >>> 28);
+ out[24 + outpos] = ((in[3 + inpos] >>> 0) & 15);
+ out[25 + outpos] = ((in[3 + inpos] >>> 4) & 15);
+ out[26 + outpos] = ((in[3 + inpos] >>> 8) & 15);
+ out[27 + outpos] = ((in[3 + inpos] >>> 12) & 15);
+ out[28 + outpos] = ((in[3 + inpos] >>> 16) & 15);
+ out[29 + outpos] = ((in[3 + inpos] >>> 20) & 15);
+ out[30 + outpos] = ((in[3 + inpos] >>> 24) & 15);
+ out[31 + outpos] = (in[3 + inpos] >>> 28);
}
- protected static void fastpackwithoutmask32(final int[] in, int inpos,
+ protected static void fastunpack5(final int[] in, int inpos,
final int[] out, int outpos) {
- System.arraycopy(in, inpos, out, outpos, 32);
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 31);
+ out[1 + outpos] = ((in[0 + inpos] >>> 5) & 31);
+ out[2 + outpos] = ((in[0 + inpos] >>> 10) & 31);
+ out[3 + outpos] = ((in[0 + inpos] >>> 15) & 31);
+ out[4 + outpos] = ((in[0 + inpos] >>> 20) & 31);
+ out[5 + outpos] = ((in[0 + inpos] >>> 25) & 31);
+ out[6 + outpos] = (in[0 + inpos] >>> 30)
+ | ((in[1 + inpos] & 7) << (5 - 3));
+ out[7 + outpos] = ((in[1 + inpos] >>> 3) & 31);
+ out[8 + outpos] = ((in[1 + inpos] >>> 8) & 31);
+ out[9 + outpos] = ((in[1 + inpos] >>> 13) & 31);
+ out[10 + outpos] = ((in[1 + inpos] >>> 18) & 31);
+ out[11 + outpos] = ((in[1 + inpos] >>> 23) & 31);
+ out[12 + outpos] = (in[1 + inpos] >>> 28)
+ | ((in[2 + inpos] & 1) << (5 - 1));
+ out[13 + outpos] = ((in[2 + inpos] >>> 1) & 31);
+ out[14 + outpos] = ((in[2 + inpos] >>> 6) & 31);
+ out[15 + outpos] = ((in[2 + inpos] >>> 11) & 31);
+ out[16 + outpos] = ((in[2 + inpos] >>> 16) & 31);
+ out[17 + outpos] = ((in[2 + inpos] >>> 21) & 31);
+ out[18 + outpos] = ((in[2 + inpos] >>> 26) & 31);
+ out[19 + outpos] = (in[2 + inpos] >>> 31)
+ | ((in[3 + inpos] & 15) << (5 - 4));
+ out[20 + outpos] = ((in[3 + inpos] >>> 4) & 31);
+ out[21 + outpos] = ((in[3 + inpos] >>> 9) & 31);
+ out[22 + outpos] = ((in[3 + inpos] >>> 14) & 31);
+ out[23 + outpos] = ((in[3 + inpos] >>> 19) & 31);
+ out[24 + outpos] = ((in[3 + inpos] >>> 24) & 31);
+ out[25 + outpos] = (in[3 + inpos] >>> 29)
+ | ((in[4 + inpos] & 3) << (5 - 2));
+ out[26 + outpos] = ((in[4 + inpos] >>> 2) & 31);
+ out[27 + outpos] = ((in[4 + inpos] >>> 7) & 31);
+ out[28 + outpos] = ((in[4 + inpos] >>> 12) & 31);
+ out[29 + outpos] = ((in[4 + inpos] >>> 17) & 31);
+ out[30 + outpos] = ((in[4 + inpos] >>> 22) & 31);
+ out[31 + outpos] = (in[4 + inpos] >>> 27);
}
- protected static void fastunpack0(final int[] in, int inpos,
+ protected static void fastunpack6(final int[] in, int inpos,
final int[] out, int outpos) {
- Arrays.fill(out, outpos, outpos + 32, 0);
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 63);
+ out[1 + outpos] = ((in[0 + inpos] >>> 6) & 63);
+ out[2 + outpos] = ((in[0 + inpos] >>> 12) & 63);
+ out[3 + outpos] = ((in[0 + inpos] >>> 18) & 63);
+ out[4 + outpos] = ((in[0 + inpos] >>> 24) & 63);
+ out[5 + outpos] = (in[0 + inpos] >>> 30)
+ | ((in[1 + inpos] & 15) << (6 - 4));
+ out[6 + outpos] = ((in[1 + inpos] >>> 4) & 63);
+ out[7 + outpos] = ((in[1 + inpos] >>> 10) & 63);
+ out[8 + outpos] = ((in[1 + inpos] >>> 16) & 63);
+ out[9 + outpos] = ((in[1 + inpos] >>> 22) & 63);
+ out[10 + outpos] = (in[1 + inpos] >>> 28)
+ | ((in[2 + inpos] & 3) << (6 - 2));
+ out[11 + outpos] = ((in[2 + inpos] >>> 2) & 63);
+ out[12 + outpos] = ((in[2 + inpos] >>> 8) & 63);
+ out[13 + outpos] = ((in[2 + inpos] >>> 14) & 63);
+ out[14 + outpos] = ((in[2 + inpos] >>> 20) & 63);
+ out[15 + outpos] = (in[2 + inpos] >>> 26);
+ out[16 + outpos] = ((in[3 + inpos] >>> 0) & 63);
+ out[17 + outpos] = ((in[3 + inpos] >>> 6) & 63);
+ out[18 + outpos] = ((in[3 + inpos] >>> 12) & 63);
+ out[19 + outpos] = ((in[3 + inpos] >>> 18) & 63);
+ out[20 + outpos] = ((in[3 + inpos] >>> 24) & 63);
+ out[21 + outpos] = (in[3 + inpos] >>> 30)
+ | ((in[4 + inpos] & 15) << (6 - 4));
+ out[22 + outpos] = ((in[4 + inpos] >>> 4) & 63);
+ out[23 + outpos] = ((in[4 + inpos] >>> 10) & 63);
+ out[24 + outpos] = ((in[4 + inpos] >>> 16) & 63);
+ out[25 + outpos] = ((in[4 + inpos] >>> 22) & 63);
+ out[26 + outpos] = (in[4 + inpos] >>> 28)
+ | ((in[5 + inpos] & 3) << (6 - 2));
+ out[27 + outpos] = ((in[5 + inpos] >>> 2) & 63);
+ out[28 + outpos] = ((in[5 + inpos] >>> 8) & 63);
+ out[29 + outpos] = ((in[5 + inpos] >>> 14) & 63);
+ out[30 + outpos] = ((in[5 + inpos] >>> 20) & 63);
+ out[31 + outpos] = (in[5 + inpos] >>> 26);
}
- protected static void fastpack0(final int[] in, int inpos,
+ protected static void fastunpack7(final int[] in, int inpos,
final int[] out, int outpos) {
- // nothing
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 127);
+ out[1 + outpos] = ((in[0 + inpos] >>> 7) & 127);
+ out[2 + outpos] = ((in[0 + inpos] >>> 14) & 127);
+ out[3 + outpos] = ((in[0 + inpos] >>> 21) & 127);
+ out[4 + outpos] = (in[0 + inpos] >>> 28)
+ | ((in[1 + inpos] & 7) << (7 - 3));
+ out[5 + outpos] = ((in[1 + inpos] >>> 3) & 127);
+ out[6 + outpos] = ((in[1 + inpos] >>> 10) & 127);
+ out[7 + outpos] = ((in[1 + inpos] >>> 17) & 127);
+ out[8 + outpos] = ((in[1 + inpos] >>> 24) & 127);
+ out[9 + outpos] = (in[1 + inpos] >>> 31)
+ | ((in[2 + inpos] & 63) << (7 - 6));
+ out[10 + outpos] = ((in[2 + inpos] >>> 6) & 127);
+ out[11 + outpos] = ((in[2 + inpos] >>> 13) & 127);
+ out[12 + outpos] = ((in[2 + inpos] >>> 20) & 127);
+ out[13 + outpos] = (in[2 + inpos] >>> 27)
+ | ((in[3 + inpos] & 3) << (7 - 2));
+ out[14 + outpos] = ((in[3 + inpos] >>> 2) & 127);
+ out[15 + outpos] = ((in[3 + inpos] >>> 9) & 127);
+ out[16 + outpos] = ((in[3 + inpos] >>> 16) & 127);
+ out[17 + outpos] = ((in[3 + inpos] >>> 23) & 127);
+ out[18 + outpos] = (in[3 + inpos] >>> 30)
+ | ((in[4 + inpos] & 31) << (7 - 5));
+ out[19 + outpos] = ((in[4 + inpos] >>> 5) & 127);
+ out[20 + outpos] = ((in[4 + inpos] >>> 12) & 127);
+ out[21 + outpos] = ((in[4 + inpos] >>> 19) & 127);
+ out[22 + outpos] = (in[4 + inpos] >>> 26)
+ | ((in[5 + inpos] & 1) << (7 - 1));
+ out[23 + outpos] = ((in[5 + inpos] >>> 1) & 127);
+ out[24 + outpos] = ((in[5 + inpos] >>> 8) & 127);
+ out[25 + outpos] = ((in[5 + inpos] >>> 15) & 127);
+ out[26 + outpos] = ((in[5 + inpos] >>> 22) & 127);
+ out[27 + outpos] = (in[5 + inpos] >>> 29)
+ | ((in[6 + inpos] & 15) << (7 - 4));
+ out[28 + outpos] = ((in[6 + inpos] >>> 4) & 127);
+ out[29 + outpos] = ((in[6 + inpos] >>> 11) & 127);
+ out[30 + outpos] = ((in[6 + inpos] >>> 18) & 127);
+ out[31 + outpos] = (in[6 + inpos] >>> 25);
}
- protected static void fastpackwithoutmask0(final int[] in, int inpos,
+ protected static void fastunpack8(final int[] in, int inpos,
final int[] out, int outpos) {
- // nothing
- }
-
- /**
- * Pack the 32 integers
- *
- * @param in
- * source array
- * @param inpos
- * starting point in the source array
- * @param out
- * output array
- * @param outpos
- * starting point in the output array
- * @param bit
- * how many bits to use per integer
- */
- public static void fastunpack(final int[] in, final int inpos,
- final int[] out, final int outpos, final int bit) {
- switch (bit) {
- case 0:
- fastunpack0(in, inpos, out, outpos);
- break;
- case 1:
- fastunpack1(in, inpos, out, outpos);
- break;
- case 2:
- fastunpack2(in, inpos, out, outpos);
- break;
- case 3:
- fastunpack3(in, inpos, out, outpos);
- break;
- case 4:
- fastunpack4(in, inpos, out, outpos);
- break;
- case 5:
- fastunpack5(in, inpos, out, outpos);
- break;
- case 6:
- fastunpack6(in, inpos, out, outpos);
- break;
- case 7:
- fastunpack7(in, inpos, out, outpos);
- break;
- case 8:
- fastunpack8(in, inpos, out, outpos);
- break;
- case 9:
- fastunpack9(in, inpos, out, outpos);
- break;
- case 10:
- fastunpack10(in, inpos, out, outpos);
- break;
- case 11:
- fastunpack11(in, inpos, out, outpos);
- break;
- case 12:
- fastunpack12(in, inpos, out, outpos);
- break;
- case 13:
- fastunpack13(in, inpos, out, outpos);
- break;
- case 14:
- fastunpack14(in, inpos, out, outpos);
- break;
- case 15:
- fastunpack15(in, inpos, out, outpos);
- break;
- case 16:
- fastunpack16(in, inpos, out, outpos);
- break;
- case 17:
- fastunpack17(in, inpos, out, outpos);
- break;
- case 18:
- fastunpack18(in, inpos, out, outpos);
- break;
- case 19:
- fastunpack19(in, inpos, out, outpos);
- break;
- case 20:
- fastunpack20(in, inpos, out, outpos);
- break;
- case 21:
- fastunpack21(in, inpos, out, outpos);
- break;
- case 22:
- fastunpack22(in, inpos, out, outpos);
- break;
- case 23:
- fastunpack23(in, inpos, out, outpos);
- break;
- case 24:
- fastunpack24(in, inpos, out, outpos);
- break;
- case 25:
- fastunpack25(in, inpos, out, outpos);
- break;
- case 26:
- fastunpack26(in, inpos, out, outpos);
- break;
- case 27:
- fastunpack27(in, inpos, out, outpos);
- break;
- case 28:
- fastunpack28(in, inpos, out, outpos);
- break;
- case 29:
- fastunpack29(in, inpos, out, outpos);
- break;
- case 30:
- fastunpack30(in, inpos, out, outpos);
- break;
- case 31:
- fastunpack31(in, inpos, out, outpos);
- break;
- case 32:
- fastunpack32(in, inpos, out, outpos);
- break;
- default:
- throw new IllegalArgumentException(
- "Unsupported bit width.");
- }
- }
-
- /**
- * Pack 32 integers
- *
- * @param in
- * source array
- * @param inpos
- * position in source array
- * @param out
- * output array
- * @param outpos
- * position in output array
- * @param bit
- * number of bits to use per integer
- */
- public static void fastpack(final int[] in, final int inpos,
- final int[] out, final int outpos, final int bit) {
- switch (bit) {
- case 0:
- fastpack0(in, inpos, out, outpos);
- break;
- case 1:
- fastpack1(in, inpos, out, outpos);
- break;
- case 2:
- fastpack2(in, inpos, out, outpos);
- break;
- case 3:
- fastpack3(in, inpos, out, outpos);
- break;
- case 4:
- fastpack4(in, inpos, out, outpos);
- break;
- case 5:
- fastpack5(in, inpos, out, outpos);
- break;
- case 6:
- fastpack6(in, inpos, out, outpos);
- break;
- case 7:
- fastpack7(in, inpos, out, outpos);
- break;
- case 8:
- fastpack8(in, inpos, out, outpos);
- break;
- case 9:
- fastpack9(in, inpos, out, outpos);
- break;
- case 10:
- fastpack10(in, inpos, out, outpos);
- break;
- case 11:
- fastpack11(in, inpos, out, outpos);
- break;
- case 12:
- fastpack12(in, inpos, out, outpos);
- break;
- case 13:
- fastpack13(in, inpos, out, outpos);
- break;
- case 14:
- fastpack14(in, inpos, out, outpos);
- break;
- case 15:
- fastpack15(in, inpos, out, outpos);
- break;
- case 16:
- fastpack16(in, inpos, out, outpos);
- break;
- case 17:
- fastpack17(in, inpos, out, outpos);
- break;
- case 18:
- fastpack18(in, inpos, out, outpos);
- break;
- case 19:
- fastpack19(in, inpos, out, outpos);
- break;
- case 20:
- fastpack20(in, inpos, out, outpos);
- break;
- case 21:
- fastpack21(in, inpos, out, outpos);
- break;
- case 22:
- fastpack22(in, inpos, out, outpos);
- break;
- case 23:
- fastpack23(in, inpos, out, outpos);
- break;
- case 24:
- fastpack24(in, inpos, out, outpos);
- break;
- case 25:
- fastpack25(in, inpos, out, outpos);
- break;
- case 26:
- fastpack26(in, inpos, out, outpos);
- break;
- case 27:
- fastpack27(in, inpos, out, outpos);
- break;
- case 28:
- fastpack28(in, inpos, out, outpos);
- break;
- case 29:
- fastpack29(in, inpos, out, outpos);
- break;
- case 30:
- fastpack30(in, inpos, out, outpos);
- break;
- case 31:
- fastpack31(in, inpos, out, outpos);
- break;
- case 32:
- fastpack32(in, inpos, out, outpos);
- break;
- default:
- throw new IllegalArgumentException(
- "Unsupported bit width.");
- /**
- * @param in
- * @param inpos
- * @param out
- * @param outpos
- * @param bit
- */
- }
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 255);
+ out[1 + outpos] = ((in[0 + inpos] >>> 8) & 255);
+ out[2 + outpos] = ((in[0 + inpos] >>> 16) & 255);
+ out[3 + outpos] = (in[0 + inpos] >>> 24);
+ out[4 + outpos] = ((in[1 + inpos] >>> 0) & 255);
+ out[5 + outpos] = ((in[1 + inpos] >>> 8) & 255);
+ out[6 + outpos] = ((in[1 + inpos] >>> 16) & 255);
+ out[7 + outpos] = (in[1 + inpos] >>> 24);
+ out[8 + outpos] = ((in[2 + inpos] >>> 0) & 255);
+ out[9 + outpos] = ((in[2 + inpos] >>> 8) & 255);
+ out[10 + outpos] = ((in[2 + inpos] >>> 16) & 255);
+ out[11 + outpos] = (in[2 + inpos] >>> 24);
+ out[12 + outpos] = ((in[3 + inpos] >>> 0) & 255);
+ out[13 + outpos] = ((in[3 + inpos] >>> 8) & 255);
+ out[14 + outpos] = ((in[3 + inpos] >>> 16) & 255);
+ out[15 + outpos] = (in[3 + inpos] >>> 24);
+ out[16 + outpos] = ((in[4 + inpos] >>> 0) & 255);
+ out[17 + outpos] = ((in[4 + inpos] >>> 8) & 255);
+ out[18 + outpos] = ((in[4 + inpos] >>> 16) & 255);
+ out[19 + outpos] = (in[4 + inpos] >>> 24);
+ out[20 + outpos] = ((in[5 + inpos] >>> 0) & 255);
+ out[21 + outpos] = ((in[5 + inpos] >>> 8) & 255);
+ out[22 + outpos] = ((in[5 + inpos] >>> 16) & 255);
+ out[23 + outpos] = (in[5 + inpos] >>> 24);
+ out[24 + outpos] = ((in[6 + inpos] >>> 0) & 255);
+ out[25 + outpos] = ((in[6 + inpos] >>> 8) & 255);
+ out[26 + outpos] = ((in[6 + inpos] >>> 16) & 255);
+ out[27 + outpos] = (in[6 + inpos] >>> 24);
+ out[28 + outpos] = ((in[7 + inpos] >>> 0) & 255);
+ out[29 + outpos] = ((in[7 + inpos] >>> 8) & 255);
+ out[30 + outpos] = ((in[7 + inpos] >>> 16) & 255);
+ out[31 + outpos] = (in[7 + inpos] >>> 24);
}
- /**
- * Unpack 32 integers
- *
- * @param in
- * source array
- * @param inpos
- * position in source array
- * @param out
- * output array
- * @param outpos
- * position in output array
- * @param bit
- * number of bits to use per integer
- */
- public static void fastpackwithoutmask(final int[] in, final int inpos,
- final int[] out, final int outpos, final int bit) {
- switch (bit) {
- case 0:
- fastpackwithoutmask0(in, inpos, out, outpos);
- break;
- case 1:
- fastpackwithoutmask1(in, inpos, out, outpos);
- break;
- case 2:
- fastpackwithoutmask2(in, inpos, out, outpos);
- break;
- case 3:
- fastpackwithoutmask3(in, inpos, out, outpos);
- break;
- case 4:
- fastpackwithoutmask4(in, inpos, out, outpos);
- break;
- case 5:
- fastpackwithoutmask5(in, inpos, out, outpos);
- break;
- case 6:
- fastpackwithoutmask6(in, inpos, out, outpos);
- break;
- case 7:
- fastpackwithoutmask7(in, inpos, out, outpos);
- break;
- case 8:
- fastpackwithoutmask8(in, inpos, out, outpos);
- break;
- case 9:
- fastpackwithoutmask9(in, inpos, out, outpos);
- break;
- case 10:
- fastpackwithoutmask10(in, inpos, out, outpos);
- break;
- case 11:
- fastpackwithoutmask11(in, inpos, out, outpos);
- break;
- case 12:
- fastpackwithoutmask12(in, inpos, out, outpos);
- break;
- case 13:
- fastpackwithoutmask13(in, inpos, out, outpos);
- break;
- case 14:
- fastpackwithoutmask14(in, inpos, out, outpos);
- break;
- case 15:
- fastpackwithoutmask15(in, inpos, out, outpos);
- break;
- case 16:
- fastpackwithoutmask16(in, inpos, out, outpos);
- break;
- case 17:
- fastpackwithoutmask17(in, inpos, out, outpos);
- break;
- case 18:
- fastpackwithoutmask18(in, inpos, out, outpos);
- break;
- case 19:
- fastpackwithoutmask19(in, inpos, out, outpos);
- break;
- case 20:
- fastpackwithoutmask20(in, inpos, out, outpos);
- break;
- case 21:
- fastpackwithoutmask21(in, inpos, out, outpos);
- break;
- case 22:
- fastpackwithoutmask22(in, inpos, out, outpos);
- break;
- case 23:
- fastpackwithoutmask23(in, inpos, out, outpos);
- break;
- case 24:
- fastpackwithoutmask24(in, inpos, out, outpos);
- break;
- case 25:
- fastpackwithoutmask25(in, inpos, out, outpos);
- break;
- case 26:
- fastpackwithoutmask26(in, inpos, out, outpos);
- break;
- case 27:
- fastpackwithoutmask27(in, inpos, out, outpos);
- break;
- case 28:
- fastpackwithoutmask28(in, inpos, out, outpos);
- break;
- case 29:
- fastpackwithoutmask29(in, inpos, out, outpos);
- break;
- case 30:
- fastpackwithoutmask30(in, inpos, out, outpos);
- break;
- case 31:
- fastpackwithoutmask31(in, inpos, out, outpos);
- break;
- case 32:
- fastpackwithoutmask32(in, inpos, out, outpos);
- break;
- default:
- throw new IllegalArgumentException(
- "Unsupported bit width.");
- }
+ protected static void fastunpack9(final int[] in, int inpos,
+ final int[] out, int outpos) {
+ out[0 + outpos] = ((in[0 + inpos] >>> 0) & 511);
+ out[1 + outpos] = ((in[0 + inpos] >>> 9) & 511);
+ out[2 + outpos] = ((in[0 + inpos] >>> 18) & 511);
+ out[3 + outpos] = (in[0 + inpos] >>> 27)
+ | ((in[1 + inpos] & 15) << (9 - 4));
+ out[4 + outpos] = ((in[1 + inpos] >>> 4) & 511);
+ out[5 + outpos] = ((in[1 + inpos] >>> 13) & 511);
+ out[6 + outpos] = ((in[1 + inpos] >>> 22) & 511);
+ out[7 + outpos] = (in[1 + inpos] >>> 31)
+ | ((in[2 + inpos] & 255) << (9 - 8));
+ out[8 + outpos] = ((in[2 + inpos] >>> 8) & 511);
+ out[9 + outpos] = ((in[2 + inpos] >>> 17) & 511);
+ out[10 + outpos] = (in[2 + inpos] >>> 26)
+ | ((in[3 + inpos] & 7) << (9 - 3));
+ out[11 + outpos] = ((in[3 + inpos] >>> 3) & 511);
+ out[12 + outpos] = ((in[3 + inpos] >>> 12) & 511);
+ out[13 + outpos] = ((in[3 + inpos] >>> 21) & 511);
+ out[14 + outpos] = (in[3 + inpos] >>> 30)
+ | ((in[4 + inpos] & 127) << (9 - 7));
+ out[15 + outpos] = ((in[4 + inpos] >>> 7) & 511);
+ out[16 + outpos] = ((in[4 + inpos] >>> 16) & 511);
+ out[17 + outpos] = (in[4 + inpos] >>> 25)
+ | ((in[5 + inpos] & 3) << (9 - 2));
+ out[18 + outpos] = ((in[5 + inpos] >>> 2) & 511);
+ out[19 + outpos] = ((in[5 + inpos] >>> 11) & 511);
+ out[20 + outpos] = ((in[5 + inpos] >>> 20) & 511);
+ out[21 + outpos] = (in[5 + inpos] >>> 29)
+ | ((in[6 + inpos] & 63) << (9 - 6));
+ out[22 + outpos] = ((in[6 + inpos] >>> 6) & 511);
+ out[23 + outpos] = ((in[6 + inpos] >>> 15) & 511);
+ out[24 + outpos] = (in[6 + inpos] >>> 24)
+ | ((in[7 + inpos] & 1) << (9 - 1));
+ out[25 + outpos] = ((in[7 + inpos] >>> 1) & 511);
+ out[26 + outpos] = ((in[7 + inpos] >>> 10) & 511);
+ out[27 + outpos] = ((in[7 + inpos] >>> 19) & 511);
+ out[28 + outpos] = (in[7 + inpos] >>> 28)
+ | ((in[8 + inpos] & 31) << (9 - 5));
+ out[29 + outpos] = ((in[8 + inpos] >>> 5) & 511);
+ out[30 + outpos] = ((in[8 + inpos] >>> 14) & 511);
+ out[31 + outpos] = (in[8 + inpos] >>> 23);
}
}
diff --git a/src/main/java/me/lemire/integercompression/FastPFOR.java b/src/main/java/me/lemire/integercompression/FastPFOR.java
index a0794df..3cd6c58 100644
--- a/src/main/java/me/lemire/integercompression/FastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/FastPFOR.java
@@ -11,9 +11,11 @@
/**
* This is a patching scheme designed for speed.
- * It encodes integers in blocks of 128 integers. For arrays containing
- * an arbitrary number of integers, you should use it in conjunction
- * with another CODEC:
+ * It encodes integers in blocks of 128 integers within pages of
+ * up to 65536 integers. Note that it is important, to get good
+ * compression and good performance, to use sizeable blocks (greater than 1024 integers).
+ * For arrays containing a number of integers that is not divisible by 128, you should use
+ * it in conjunction with another CODEC:
*
* IntegerCODEC ic = new Composition(new FastPFOR(), new VariableByte()).
*
diff --git a/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java b/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
index 5dd2335..a0fd463 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
+++ b/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
@@ -13,11 +13,142 @@
* "Integrated" bit packing routines: they include both the bit packing and the
* differential coding.
*
+ * For details, please see
+ *
+ * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
+ * through vectorization Software: Practice & Experience
+ * http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
+ * http://arxiv.org/abs/1209.2137
+ *
+ *
* @author Daniel Lemire
*
*/
public final class IntegratedBitPacking {
+ /**
+ * Pack 32 integers as deltas with an initial value
+ *
+ * @param initoffset initial value (used to compute first delta)
+ * @param in input array
+ * @param inpos initial position in input array
+ * @param out output array
+ * @param outpos initial position in output array
+ * @param bit number of bits to use per integer
+ */
+ public static void integratedpack(final int initoffset, final int[] in,
+ final int inpos, final int[] out, final int outpos, final int bit) {
+ switch (bit) {
+ case 0:
+ integratedpack0(initoffset, in, inpos, out, outpos);
+ break;
+ case 1:
+ integratedpack1(initoffset, in, inpos, out, outpos);
+ break;
+ case 2:
+ integratedpack2(initoffset, in, inpos, out, outpos);
+ break;
+ case 3:
+ integratedpack3(initoffset, in, inpos, out, outpos);
+ break;
+ case 4:
+ integratedpack4(initoffset, in, inpos, out, outpos);
+ break;
+ case 5:
+ integratedpack5(initoffset, in, inpos, out, outpos);
+ break;
+ case 6:
+ integratedpack6(initoffset, in, inpos, out, outpos);
+ break;
+ case 7:
+ integratedpack7(initoffset, in, inpos, out, outpos);
+ break;
+ case 8:
+ integratedpack8(initoffset, in, inpos, out, outpos);
+ break;
+ case 9:
+ integratedpack9(initoffset, in, inpos, out, outpos);
+ break;
+ case 10:
+ integratedpack10(initoffset, in, inpos, out, outpos);
+ break;
+ case 11:
+ integratedpack11(initoffset, in, inpos, out, outpos);
+ break;
+ case 12:
+ integratedpack12(initoffset, in, inpos, out, outpos);
+ break;
+ case 13:
+ integratedpack13(initoffset, in, inpos, out, outpos);
+ break;
+ case 14:
+ integratedpack14(initoffset, in, inpos, out, outpos);
+ break;
+ case 15:
+ integratedpack15(initoffset, in, inpos, out, outpos);
+ break;
+ case 16:
+ integratedpack16(initoffset, in, inpos, out, outpos);
+ break;
+ case 17:
+ integratedpack17(initoffset, in, inpos, out, outpos);
+ break;
+ case 18:
+ integratedpack18(initoffset, in, inpos, out, outpos);
+ break;
+ case 19:
+ integratedpack19(initoffset, in, inpos, out, outpos);
+ break;
+ case 20:
+ integratedpack20(initoffset, in, inpos, out, outpos);
+ break;
+ case 21:
+ integratedpack21(initoffset, in, inpos, out, outpos);
+ break;
+ case 22:
+ integratedpack22(initoffset, in, inpos, out, outpos);
+ break;
+ case 23:
+ integratedpack23(initoffset, in, inpos, out, outpos);
+ break;
+ case 24:
+ integratedpack24(initoffset, in, inpos, out, outpos);
+ break;
+ case 25:
+ integratedpack25(initoffset, in, inpos, out, outpos);
+ break;
+ case 26:
+ integratedpack26(initoffset, in, inpos, out, outpos);
+ break;
+ case 27:
+ integratedpack27(initoffset, in, inpos, out, outpos);
+ break;
+ case 28:
+ integratedpack28(initoffset, in, inpos, out, outpos);
+ break;
+ case 29:
+ integratedpack29(initoffset, in, inpos, out, outpos);
+ break;
+ case 30:
+ integratedpack30(initoffset, in, inpos, out, outpos);
+ break;
+ case 31:
+ integratedpack31(initoffset, in, inpos, out, outpos);
+ break;
+ case 32:
+ integratedpack32(initoffset, in, inpos, out, outpos);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unsupported bit width.");
+ }
+ }
+
+ protected static void integratedpack0(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ // nothing
+ }
+
protected static void integratedpack1(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
@@ -54,3853 +185,3730 @@ protected static void integratedpack1(final int initoffset,
| ((in[31 + inpos] - in[31 + inpos - 1]) << 31);
}
- protected static void integratedpack2(final int initoffset,
+ protected static void integratedpack10(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 2)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 4)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 6)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 10)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 20)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (10 - 8)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 8)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 10)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 12)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 14)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 18)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (10 - 6)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 6)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 16)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 18)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 20)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 22)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 24)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 26)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 28)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 30);
- out[1 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 2)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 4)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 6)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 26);
+ out[3 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (10 - 4)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 4)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 14)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 24);
+ out[4 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (10 - 2)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 2)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 12)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 22);
+ out[5 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 10)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 20)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 30);
+ out[6 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (10 - 8)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 8)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 10)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 12)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 14)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 18)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 28);
+ out[7 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (10 - 6)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 6)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 16)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 18)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 20)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 22)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 24)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 26)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 28)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 30);
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 26);
+ out[8 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (10 - 4)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 4)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 14)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 24);
+ out[9 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (10 - 2)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 2)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 12)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 22);
}
- protected static void integratedpack3(final int initoffset,
+ protected static void integratedpack11(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 3)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 6)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 9)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 11)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 22);
+ out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (11 - 1)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 1)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 12)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 15)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 18)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 21)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 24)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 27)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 30);
- out[1 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (3 - 1)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 1)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 23);
+ out[2 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (11 - 2)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 2)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 13)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
+ out[3 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (11 - 3)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 3)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 14)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 25);
+ out[4 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (11 - 4)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 4)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 7)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 10)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 13)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 15)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 26);
+ out[5 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (11 - 5)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 5)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 19)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 22)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 25)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 28)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 31);
- out[2 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (3 - 2)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 2)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 5)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 27);
+ out[6 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (11 - 6)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 6)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 17)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 28);
+ out[7 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (11 - 7)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 7)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 18)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 29);
+ out[8 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (11 - 8)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 11)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 14)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 17)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 19)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 30);
+ out[9 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (11 - 9)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 9)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 20)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 23)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 26)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 29);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 31);
+ out[10 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (11 - 10)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 10)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 21);
}
- protected static void integratedpack4(final int initoffset,
+ protected static void integratedpack12(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 4)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 8)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 12)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 12)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 24);
+ out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (12 - 4)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 4)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 16)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 20)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 24)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 28);
- out[1 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 4)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 8)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 12)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (12 - 8)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 8)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 20);
+ out[3 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 12)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 24);
+ out[4 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (12 - 4)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 4)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 16)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 20)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 24)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 28);
- out[2 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 4)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 8)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 12)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 28);
+ out[5 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (12 - 8)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 8)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 20);
+ out[6 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 12)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 24);
+ out[7 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (12 - 4)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 4)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 16)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 20)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 24)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 28);
- out[3 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 4)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 8)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 12)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 28);
+ out[8 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (12 - 8)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 8)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 20);
+ out[9 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 12)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 24);
+ out[10 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (12 - 4)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 4)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 16)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 20)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 24)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 28);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 28);
+ out[11 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (12 - 8)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 8)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 20);
}
- protected static void integratedpack5(final int initoffset,
+ protected static void integratedpack13(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 5)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 10)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 15)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 20)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 25)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 30);
- out[1 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (5 - 3)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 3)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 13)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 26);
+ out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (13 - 7)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 7)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 20);
+ out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (13 - 1)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 1)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 14)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 27);
+ out[3 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (13 - 8)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 13)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 18)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 23)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 21);
+ out[4 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (13 - 2)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 2)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 15)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 28);
- out[2 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (5 - 1)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 1)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 6)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 11)
+ out[5 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (13 - 9)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 9)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 22);
+ out[6 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (13 - 3)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 3)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 21)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 26)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 31);
- out[3 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (5 - 4)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 29);
+ out[7 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (13 - 10)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 10)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 23);
+ out[8 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (13 - 4)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 4)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 9)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 14)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 19)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 24)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 29);
- out[4 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (5 - 2)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 2)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 7)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 17)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 30);
+ out[9 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (13 - 11)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 11)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
+ out[10 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (13 - 5)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 5)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 18)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 31);
+ out[11 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (13 - 12)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 12)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 17)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 22)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 27);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 25);
+ out[12 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (13 - 6)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 6)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 19);
}
- protected static void integratedpack6(final int initoffset,
+ protected static void integratedpack14(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 6)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 12)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 18)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 24)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 30);
- out[1 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (6 - 4)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 4)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 10)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 14)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 28);
+ out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (14 - 10)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 10)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 24);
+ out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (14 - 6)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 6)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 20);
+ out[3 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (14 - 2)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 2)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 16)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 22)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 28);
- out[2 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (6 - 2)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 2)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 30);
+ out[4 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (14 - 12)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 12)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 26);
+ out[5 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (14 - 8)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 8)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 14)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 20)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 26);
- out[3 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 6)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 12)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 18)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 24)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 30);
- out[4 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (6 - 4)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 4)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 10)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 22);
+ out[6 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (14 - 4)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 4)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 18);
+ out[7 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 14)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 28);
+ out[8 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (14 - 10)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 10)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 24);
+ out[9 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (14 - 6)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 6)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 20);
+ out[10 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (14 - 2)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 2)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 16)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 22)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 28);
- out[5 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (6 - 2)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 2)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 30);
+ out[11 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (14 - 12)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 12)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 26);
+ out[12 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (14 - 8)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 8)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 14)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 20)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 26);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 22);
+ out[13 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (14 - 4)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 4)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 18);
}
- protected static void integratedpack7(final int initoffset,
+ protected static void integratedpack15(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 7)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 14)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 21)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 15)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (15 - 13)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 13)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 28);
- out[1 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (7 - 3)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 3)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 10)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 17)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 24)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 31);
- out[2 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (7 - 6)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 6)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 13)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 20)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 27);
- out[3 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (7 - 2)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 2)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 9)
+ out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (15 - 11)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 11)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 26);
+ out[3 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (15 - 9)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 9)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
+ out[4 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (15 - 7)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 7)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 22);
+ out[5 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (15 - 5)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 5)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 20);
+ out[6 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (15 - 3)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 3)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 18);
+ out[7 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (15 - 1)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 1)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 23)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 30);
- out[4 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (7 - 5)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 5)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 31);
+ out[8 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (15 - 14)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 14)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 29);
+ out[9 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (15 - 12)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 12)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 19)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 26);
- out[5 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (7 - 1)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 1)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 27);
+ out[10 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (15 - 10)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 10)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 25);
+ out[11 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (15 - 8)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 15)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 22)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 29);
- out[6 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (7 - 4)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 23);
+ out[12 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (15 - 6)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 6)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 21);
+ out[13 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (15 - 4)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 4)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 11)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 18)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 25);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 19);
+ out[14 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (15 - 2)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 2)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 17);
}
- protected static void integratedpack8(final int initoffset,
+ protected static void integratedpack16(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 8)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 16)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 24);
- out[1 + outpos] = (in[4 + inpos] - in[4 + inpos - 1])
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 8)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 16)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 24);
- out[2 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 8)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 16)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 24);
- out[3 + outpos] = (in[12 + inpos] - in[12 + inpos - 1])
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 8)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 16)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 24);
- out[4 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 8)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 16)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 24);
- out[5 + outpos] = (in[20 + inpos] - in[20 + inpos - 1])
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 8)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 16)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 24);
- out[6 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 8)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 16)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 24);
- out[7 + outpos] = (in[28 + inpos] - in[28 + inpos - 1])
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 8)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 16)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 24);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 16);
+ out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1])
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 16);
+ out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1])
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 16);
+ out[3 + outpos] = (in[6 + inpos] - in[6 + inpos - 1])
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 16);
+ out[4 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 16);
+ out[5 + outpos] = (in[10 + inpos] - in[10 + inpos - 1])
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 16);
+ out[6 + outpos] = (in[12 + inpos] - in[12 + inpos - 1])
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 16);
+ out[7 + outpos] = (in[14 + inpos] - in[14 + inpos - 1])
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 16);
+ out[8 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 16);
+ out[9 + outpos] = (in[18 + inpos] - in[18 + inpos - 1])
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 16);
+ out[10 + outpos] = (in[20 + inpos] - in[20 + inpos - 1])
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 16);
+ out[11 + outpos] = (in[22 + inpos] - in[22 + inpos - 1])
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 16);
+ out[12 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 16);
+ out[13 + outpos] = (in[26 + inpos] - in[26 + inpos - 1])
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 16);
+ out[14 + outpos] = (in[28 + inpos] - in[28 + inpos - 1])
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 16);
+ out[15 + outpos] = (in[30 + inpos] - in[30 + inpos - 1])
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 16);
}
- protected static void integratedpack9(final int initoffset,
+ protected static void integratedpack17(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 9)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 18)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 27);
- out[1 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (9 - 4)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 17);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (17 - 2)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 2)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 19);
+ out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (17 - 4)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 4)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 13)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 22)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 31);
- out[2 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (9 - 8)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 21);
+ out[3 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (17 - 6)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 6)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 23);
+ out[4 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (17 - 8)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 17)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 26);
- out[3 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (9 - 3)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 3)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 25);
+ out[5 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (17 - 10)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 10)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 27);
+ out[6 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (17 - 12)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 12)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 21)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 30);
- out[4 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (9 - 7)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 7)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 25);
- out[5 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (9 - 2)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 2)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 11)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 20)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 29);
- out[6 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (9 - 6)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 6)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 15)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 29);
+ out[7 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (17 - 14)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 14)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 31);
+ out[8 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (17 - 16)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
+ out[9 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (17 - 1)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 1)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 18);
+ out[10 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (17 - 3)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 3)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 20);
+ out[11 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (17 - 5)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 5)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 22);
+ out[12 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (17 - 7)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 7)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
- out[7 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (9 - 1)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 1)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 10)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 19)
+ out[13 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (17 - 9)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 9)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 26);
+ out[14 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (17 - 11)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 11)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 28);
- out[8 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (9 - 5)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 5)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 14)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 23);
+ out[15 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (17 - 13)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 13)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 30);
+ out[16 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (17 - 15)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 15);
}
- protected static void integratedpack10(final int initoffset,
+ protected static void integratedpack18(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 10)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 20)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 30);
- out[1 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (10 - 8)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 18);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (18 - 4)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 4)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 22);
+ out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (18 - 8)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 8)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 18)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 28);
- out[2 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (10 - 6)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 6)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 16)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 26);
- out[3 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (10 - 4)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 4)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 14)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 26);
+ out[3 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (18 - 12)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 12)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 30);
+ out[4 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (18 - 16)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 16);
+ out[5 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (18 - 2)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 2)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 20);
+ out[6 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (18 - 6)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 6)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 24);
- out[4 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (10 - 2)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 2)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 12)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 22);
- out[5 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 10)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 20)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 30);
- out[6 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (10 - 8)
+ out[7 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (18 - 10)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 10)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 28);
+ out[8 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (18 - 14)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 14);
+ out[9 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 18);
+ out[10 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (18 - 4)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 4)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 22);
+ out[11 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (18 - 8)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 8)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 18)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 28);
- out[7 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (10 - 6)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 6)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 16)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 26);
- out[8 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (10 - 4)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 4)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 14)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 26);
+ out[12 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (18 - 12)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 12)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 30);
+ out[13 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (18 - 16)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 16);
+ out[14 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (18 - 2)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 2)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 20);
+ out[15 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (18 - 6)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 6)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 24);
- out[9 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (10 - 2)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 2)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 12)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 22);
+ out[16 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (18 - 10)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 10)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 28);
+ out[17 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (18 - 14)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 14);
}
- protected static void integratedpack11(final int initoffset,
+ protected static void integratedpack19(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 11)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 22);
- out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (11 - 1)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 1)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 19);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (19 - 6)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 6)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 25);
+ out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (19 - 12)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 12)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 23);
- out[2 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (11 - 2)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 2)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 13)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 31);
+ out[3 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (19 - 18)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 18);
+ out[4 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (19 - 5)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 5)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
- out[3 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (11 - 3)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 3)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 14)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 25);
- out[4 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (11 - 4)
+ out[5 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (19 - 11)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 11)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 30);
+ out[6 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (19 - 17)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 17);
+ out[7 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (19 - 4)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 4)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 15)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 26);
- out[5 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (11 - 5)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 5)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 27);
- out[6 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (11 - 6)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 6)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 17)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 23);
+ out[8 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (19 - 10)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 10)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 29);
+ out[9 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (19 - 16)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
+ out[10 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (19 - 3)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 3)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 22);
+ out[11 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (19 - 9)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 9)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 28);
- out[7 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (11 - 7)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 7)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 18)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 29);
- out[8 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (11 - 8)
+ out[12 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (19 - 15)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 15);
+ out[13 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (19 - 2)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 2)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 21);
+ out[14 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (19 - 8)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 19)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 30);
- out[9 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (11 - 9)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 9)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 20)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 31);
- out[10 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (11 - 10)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 10)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 21);
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 27);
+ out[15 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (19 - 14)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 14);
+ out[16 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (19 - 1)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 1)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 20);
+ out[17 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (19 - 7)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 7)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 26);
+ out[18 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (19 - 13)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 13);
}
- protected static void integratedpack12(final int initoffset,
+ protected static void integratedpack2(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 12)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 24);
- out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (12 - 4)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 4)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 16)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 28);
- out[2 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (12 - 8)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 8)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 20);
- out[3 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 12)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 24);
- out[4 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (12 - 4)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 4)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 16)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 28);
- out[5 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (12 - 8)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 8)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 20);
- out[6 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 12)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 24);
- out[7 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (12 - 4)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 4)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 16)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 28);
- out[8 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (12 - 8)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 8)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 20);
- out[9 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 12)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 24);
- out[10 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (12 - 4)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 4)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 16)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 28);
- out[11 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (12 - 8)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 8)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 20);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 2)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 4)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 6)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 8)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 10)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 12)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 14)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 16)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 18)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 20)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 22)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 24)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 26)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 28)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 2)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 4)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 6)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 8)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 10)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 12)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 14)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 16)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 18)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 20)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 22)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 24)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 26)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 28)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 30);
}
- protected static void integratedpack13(final int initoffset,
+ protected static void integratedpack20(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 13)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 26);
- out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (13 - 7)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 7)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 20);
- out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (13 - 1)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 1)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 14)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 27);
- out[3 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (13 - 8)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 21);
- out[4 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (13 - 2)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 2)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 15)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 28);
- out[5 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (13 - 9)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 9)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 22);
- out[6 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (13 - 3)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 3)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 29);
- out[7 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (13 - 10)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 10)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 23);
- out[8 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (13 - 4)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 4)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 17)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 30);
- out[9 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (13 - 11)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 11)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
- out[10 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (13 - 5)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 5)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 18)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 31);
- out[11 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (13 - 12)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 12)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 25);
- out[12 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (13 - 6)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 6)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 19);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 20);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (20 - 8)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 8)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (20 - 16)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 16);
+ out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (20 - 4)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 4)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 24);
+ out[4 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (20 - 12)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 12);
+ out[5 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 20);
+ out[6 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (20 - 8)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 8)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 28);
+ out[7 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (20 - 16)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 16);
+ out[8 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (20 - 4)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 4)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 24);
+ out[9 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (20 - 12)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 12);
+ out[10 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 20);
+ out[11 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (20 - 8)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 8)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 28);
+ out[12 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (20 - 16)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 16);
+ out[13 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (20 - 4)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 4)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 24);
+ out[14 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (20 - 12)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 12);
+ out[15 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 20);
+ out[16 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (20 - 8)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 8)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 28);
+ out[17 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (20 - 16)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 16);
+ out[18 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (20 - 4)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 4)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 24);
+ out[19 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (20 - 12)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 12);
}
- protected static void integratedpack14(final int initoffset,
+ protected static void integratedpack21(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 14)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 28);
- out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (14 - 10)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 10)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 24);
- out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (14 - 6)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 6)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 20);
- out[3 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (14 - 2)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 2)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 16)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 30);
- out[4 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (14 - 12)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 12)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 26);
- out[5 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (14 - 8)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 8)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 22);
- out[6 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (14 - 4)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 4)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 18);
- out[7 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 14)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 28);
- out[8 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (14 - 10)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 10)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 21);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (21 - 10)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 10)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 31);
+ out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (21 - 20)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 20);
+ out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (21 - 9)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 9)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 30);
+ out[4 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (21 - 19)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 19);
+ out[5 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (21 - 8)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 29);
+ out[6 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (21 - 18)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 18);
+ out[7 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (21 - 7)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 7)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 28);
+ out[8 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (21 - 17)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 17);
+ out[9 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (21 - 6)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 6)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 27);
+ out[10 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (21 - 16)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
+ out[11 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (21 - 5)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 5)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 26);
+ out[12 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (21 - 15)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 15);
+ out[13 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (21 - 4)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 4)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 25);
+ out[14 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (21 - 14)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 14);
+ out[15 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (21 - 3)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 3)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
+ out[16 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (21 - 13)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 13);
+ out[17 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (21 - 2)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 2)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 23);
+ out[18 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (21 - 12)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 12);
+ out[19 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (21 - 1)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 1)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 22);
+ out[20 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (21 - 11)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 11);
+ }
+
+ protected static void integratedpack22(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] - initoffset)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 22);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (22 - 12)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 12);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (22 - 2)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 2)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 24);
+ out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (22 - 14)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 14);
+ out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (22 - 4)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 4)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 26);
+ out[5 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (22 - 16)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 16);
+ out[6 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (22 - 6)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 6)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 28);
+ out[7 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (22 - 18)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 18);
+ out[8 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (22 - 8)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 8)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 30);
+ out[9 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (22 - 20)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 20);
+ out[10 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (22 - 10)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 10);
+ out[11 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 22);
+ out[12 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (22 - 12)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 12);
+ out[13 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (22 - 2)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 2)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 24);
- out[9 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (14 - 6)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 6)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 20);
- out[10 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (14 - 2)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 2)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 16)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 30);
- out[11 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (14 - 12)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 12)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 26);
- out[12 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (14 - 8)
+ out[14 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (22 - 14)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 14);
+ out[15 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (22 - 4)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 4)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 26);
+ out[16 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (22 - 16)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 16);
+ out[17 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (22 - 6)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 6)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 28);
+ out[18 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (22 - 18)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 18);
+ out[19 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (22 - 8)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 8)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 22);
- out[13 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (14 - 4)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 4)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 18);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 30);
+ out[20 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (22 - 20)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 20);
+ out[21 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (22 - 10)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 10);
}
- protected static void integratedpack15(final int initoffset,
+ protected static void integratedpack23(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 15)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 30);
- out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (15 - 13)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 13)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 23);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (23 - 14)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 14);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (23 - 5)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 5)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 28);
- out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (15 - 11)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 11)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 26);
- out[3 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (15 - 9)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 9)
+ out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (23 - 19)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 19);
+ out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (23 - 10)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 10);
+ out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (23 - 1)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 1)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
- out[4 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (15 - 7)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 7)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 22);
- out[5 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (15 - 5)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 5)
+ out[6 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (23 - 15)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 15);
+ out[7 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (23 - 6)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 6)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 29);
+ out[8 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (23 - 20)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 20);
- out[6 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (15 - 3)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 3)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 18);
- out[7 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (15 - 1)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 1)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 31);
- out[8 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (15 - 14)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 14)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 29);
- out[9 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (15 - 12)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 12)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 27);
- out[10 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (15 - 10)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 10)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 25);
- out[11 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (15 - 8)
+ out[9 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (23 - 11)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 11);
+ out[10 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (23 - 2)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 2)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 25);
+ out[11 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (23 - 16)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
+ out[12 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (23 - 7)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 7)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 30);
+ out[13 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (23 - 21)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 21);
+ out[14 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (23 - 12)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 12);
+ out[15 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (23 - 3)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 3)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 26);
+ out[16 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (23 - 17)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 17);
+ out[17 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (23 - 8)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 23);
- out[12 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (15 - 6)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 6)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 21);
- out[13 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (15 - 4)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 31);
+ out[18 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (23 - 22)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 22);
+ out[19 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (23 - 13)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 13);
+ out[20 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (23 - 4)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 4)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 19);
- out[14 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (15 - 2)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 2)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 17);
- }
-
- protected static void integratedpack16(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 16);
- out[1 + outpos] = (in[2 + inpos] - in[2 + inpos - 1])
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 16);
- out[2 + outpos] = (in[4 + inpos] - in[4 + inpos - 1])
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 16);
- out[3 + outpos] = (in[6 + inpos] - in[6 + inpos - 1])
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 16);
- out[4 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 16);
- out[5 + outpos] = (in[10 + inpos] - in[10 + inpos - 1])
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 16);
- out[6 + outpos] = (in[12 + inpos] - in[12 + inpos - 1])
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 16);
- out[7 + outpos] = (in[14 + inpos] - in[14 + inpos - 1])
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 16);
- out[8 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 16);
- out[9 + outpos] = (in[18 + inpos] - in[18 + inpos - 1])
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 16);
- out[10 + outpos] = (in[20 + inpos] - in[20 + inpos - 1])
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 16);
- out[11 + outpos] = (in[22 + inpos] - in[22 + inpos - 1])
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 16);
- out[12 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 16);
- out[13 + outpos] = (in[26 + inpos] - in[26 + inpos - 1])
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 16);
- out[14 + outpos] = (in[28 + inpos] - in[28 + inpos - 1])
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 16);
- out[15 + outpos] = (in[30 + inpos] - in[30 + inpos - 1])
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 16);
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 27);
+ out[21 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (23 - 18)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 18);
+ out[22 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (23 - 9)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 9);
}
- protected static void integratedpack17(final int initoffset,
+ protected static void integratedpack24(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 17);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (17 - 2)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 2)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 19);
- out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (17 - 4)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 24);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (24 - 16)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 16);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (24 - 8)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 8);
+ out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1])
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 24);
+ out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (24 - 16)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 16);
+ out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (24 - 8)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 8);
+ out[6 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 24);
+ out[7 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (24 - 16)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 16);
+ out[8 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (24 - 8)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 8);
+ out[9 + outpos] = (in[12 + inpos] - in[12 + inpos - 1])
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 24);
+ out[10 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (24 - 16)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 16);
+ out[11 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (24 - 8)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 8);
+ out[12 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 24);
+ out[13 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (24 - 16)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 16);
+ out[14 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (24 - 8)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 8);
+ out[15 + outpos] = (in[20 + inpos] - in[20 + inpos - 1])
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 24);
+ out[16 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (24 - 16)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 16);
+ out[17 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (24 - 8)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 8);
+ out[18 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 24);
+ out[19 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (24 - 16)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 16);
+ out[20 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (24 - 8)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 8);
+ out[21 + outpos] = (in[28 + inpos] - in[28 + inpos - 1])
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 24);
+ out[22 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (24 - 16)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 16);
+ out[23 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (24 - 8)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 8);
+ }
+
+ protected static void integratedpack25(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] - initoffset)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 25);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (25 - 18)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 18);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (25 - 11)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 11);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (25 - 4)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 4)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 21);
- out[3 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (17 - 6)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 6)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 23);
- out[4 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (17 - 8)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 25);
- out[5 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (17 - 10)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 10)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 27);
- out[6 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (17 - 12)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 12)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 29);
- out[7 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (17 - 14)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 14)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 31);
- out[8 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (17 - 16)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 29);
+ out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (25 - 22)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 22);
+ out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (25 - 15)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 15);
+ out[6 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (25 - 8)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 8);
+ out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (25 - 1)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 1)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 26);
+ out[8 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (25 - 19)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 19);
+ out[9 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (25 - 12)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 12);
+ out[10 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (25 - 5)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 5)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 30);
+ out[11 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (25 - 23)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 23);
+ out[12 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (25 - 16)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[9 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (17 - 1)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 1)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 18);
- out[10 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (17 - 3)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 3)
+ out[13 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (25 - 9)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 9);
+ out[14 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (25 - 2)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 2)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 27);
+ out[15 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (25 - 20)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 20);
- out[11 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (17 - 5)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 5)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 22);
- out[12 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (17 - 7)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 7)
+ out[16 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (25 - 13)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 13);
+ out[17 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (25 - 6)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 6)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 31);
+ out[18 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (25 - 24)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
- out[13 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (17 - 9)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 9)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 26);
- out[14 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (17 - 11)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 11)
+ out[19 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (25 - 17)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 17);
+ out[20 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (25 - 10)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 10);
+ out[21 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (25 - 3)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 3)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 28);
- out[15 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (17 - 13)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 13)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 30);
- out[16 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (17 - 15)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 15);
+ out[22 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (25 - 21)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 21);
+ out[23 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (25 - 14)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 14);
+ out[24 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (25 - 7)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 7);
}
- protected static void integratedpack18(final int initoffset,
+ protected static void integratedpack26(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 18);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (18 - 4)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 4)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 22);
- out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (18 - 8)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 8)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 26);
- out[3 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (18 - 12)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 12)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 30);
- out[4 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (18 - 16)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 26);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (26 - 20)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 20);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (26 - 14)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 14);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (26 - 8)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 8);
+ out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (26 - 2)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 2)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 28);
+ out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (26 - 22)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 22);
+ out[6 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (26 - 16)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 16);
- out[5 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (18 - 2)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 2)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 20);
- out[6 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (18 - 6)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 6)
+ out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (26 - 10)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 10);
+ out[8 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (26 - 4)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 4)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 30);
+ out[9 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (26 - 24)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 24);
- out[7 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (18 - 10)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 10)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 28);
- out[8 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (18 - 14)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 14);
- out[9 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 18);
- out[10 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (18 - 4)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 4)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 22);
- out[11 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (18 - 8)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 8)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 26);
- out[12 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (18 - 12)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 12)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 30);
- out[13 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (18 - 16)
+ out[10 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (26 - 18)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 18);
+ out[11 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (26 - 12)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 12);
+ out[12 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (26 - 6)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 6);
+ out[13 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 26);
+ out[14 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (26 - 20)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 20);
+ out[15 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (26 - 14)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 14);
+ out[16 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (26 - 8)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 8);
+ out[17 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (26 - 2)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 2)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 28);
+ out[18 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (26 - 22)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 22);
+ out[19 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (26 - 16)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 16);
- out[14 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (18 - 2)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 2)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 20);
- out[15 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (18 - 6)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 6)
+ out[20 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (26 - 10)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 10);
+ out[21 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (26 - 4)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 4)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 30);
+ out[22 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (26 - 24)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 24);
- out[16 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (18 - 10)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 10)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 28);
- out[17 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (18 - 14)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 14);
+ out[23 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (26 - 18)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 18);
+ out[24 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (26 - 12)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 12);
+ out[25 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (26 - 6)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 6);
}
- protected static void integratedpack19(final int initoffset,
+ protected static void integratedpack27(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 19);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (19 - 6)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 6)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 25);
- out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (19 - 12)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 12)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 31);
- out[3 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (19 - 18)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 18);
- out[4 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (19 - 5)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 5)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
- out[5 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (19 - 11)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 11)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 30);
- out[6 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (19 - 17)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 17);
- out[7 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (19 - 4)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 27);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (27 - 22)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 22);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (27 - 17)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 17);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (27 - 12)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 12);
+ out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (27 - 7)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 7);
+ out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (27 - 2)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 2)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 29);
+ out[6 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (27 - 24)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
+ out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (27 - 19)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 19);
+ out[8 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (27 - 14)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 14);
+ out[9 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (27 - 9)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 9);
+ out[10 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (27 - 4)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 4)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 23);
- out[8 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (19 - 10)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 10)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 29);
- out[9 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (19 - 16)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 31);
+ out[11 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (27 - 26)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 26);
+ out[12 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (27 - 21)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 21);
+ out[13 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (27 - 16)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[10 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (19 - 3)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 3)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 22);
- out[11 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (19 - 9)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 9)
+ out[14 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (27 - 11)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 11);
+ out[15 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (27 - 6)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 6);
+ out[16 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (27 - 1)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 1)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 28);
- out[12 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (19 - 15)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 15);
- out[13 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (19 - 2)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 2)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 21);
- out[14 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (19 - 8)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 27);
- out[15 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (19 - 14)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 14);
- out[16 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (19 - 1)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 1)
+ out[17 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (27 - 23)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 23);
+ out[18 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (27 - 18)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 18);
+ out[19 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (27 - 13)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 13);
+ out[20 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (27 - 8)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 8);
+ out[21 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (27 - 3)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 3)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 30);
+ out[22 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (27 - 25)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 25);
+ out[23 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (27 - 20)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 20);
- out[17 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (19 - 7)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 7)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 26);
- out[18 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (19 - 13)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 13);
+ out[24 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (27 - 15)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 15);
+ out[25 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (27 - 10)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 10);
+ out[26 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (27 - 5)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 5);
}
- protected static void integratedpack20(final int initoffset,
+ protected static void integratedpack28(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 20);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (20 - 8)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 8)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 28);
- out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (20 - 16)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 28);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (28 - 24)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 24);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (28 - 20)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 20);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (28 - 16)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 16);
- out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (20 - 4)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 4)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 24);
- out[4 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (20 - 12)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 12);
- out[5 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 20);
- out[6 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (20 - 8)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 8)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 28);
- out[7 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (20 - 16)
+ out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (28 - 12)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 12);
+ out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (28 - 8)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 8);
+ out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (28 - 4)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 4);
+ out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 28);
+ out[8 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (28 - 24)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 24);
+ out[9 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (28 - 20)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 20);
+ out[10 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (28 - 16)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 16);
- out[8 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (20 - 4)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 4)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 24);
- out[9 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (20 - 12)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 12);
- out[10 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 20);
- out[11 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (20 - 8)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 8)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 28);
- out[12 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (20 - 16)
+ out[11 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (28 - 12)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 12);
+ out[12 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (28 - 8)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 8);
+ out[13 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (28 - 4)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 4);
+ out[14 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 28);
+ out[15 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (28 - 24)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 24);
+ out[16 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (28 - 20)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 20);
+ out[17 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (28 - 16)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 16);
- out[13 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (20 - 4)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 4)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 24);
- out[14 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (20 - 12)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 12);
- out[15 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 20);
- out[16 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (20 - 8)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 8)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 28);
- out[17 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (20 - 16)
+ out[18 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (28 - 12)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 12);
+ out[19 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (28 - 8)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 8);
+ out[20 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (28 - 4)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 4);
+ out[21 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 28);
+ out[22 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (28 - 24)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 24);
+ out[23 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (28 - 20)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 20);
+ out[24 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (28 - 16)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 16);
- out[18 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (20 - 4)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 4)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 24);
- out[19 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (20 - 12)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 12);
+ out[25 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (28 - 12)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 12);
+ out[26 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (28 - 8)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 8);
+ out[27 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (28 - 4)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 4);
}
- protected static void integratedpack21(final int initoffset,
+ protected static void integratedpack29(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 21);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (21 - 10)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 10)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 31);
- out[2 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (21 - 20)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 29);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (29 - 26)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 26);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (29 - 23)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 23);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (29 - 20)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 20);
- out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (21 - 9)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 9)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 30);
- out[4 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (21 - 19)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 19);
- out[5 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (21 - 8)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 29);
- out[6 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (21 - 18)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 18);
- out[7 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (21 - 7)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 7)
+ out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (29 - 17)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 17);
+ out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (29 - 14)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 14);
+ out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (29 - 11)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 11);
+ out[7 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (29 - 8)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 8);
+ out[8 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (29 - 5)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 5);
+ out[9 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (29 - 2)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 2)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 31);
+ out[10 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (29 - 28)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 28);
- out[8 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (21 - 17)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 17);
- out[9 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (21 - 6)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 6)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 27);
- out[10 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (21 - 16)
+ out[11 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (29 - 25)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 25);
+ out[12 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (29 - 22)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 22);
+ out[13 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (29 - 19)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 19);
+ out[14 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (29 - 16)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[11 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (21 - 5)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 5)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 26);
- out[12 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (21 - 15)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 15);
- out[13 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (21 - 4)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 4)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 25);
- out[14 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (21 - 14)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 14);
- out[15 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (21 - 3)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 3)
+ out[15 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (29 - 13)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 13);
+ out[16 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (29 - 10)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 10);
+ out[17 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (29 - 7)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 7);
+ out[18 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (29 - 4)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 4);
+ out[19 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (29 - 1)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 1)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 30);
+ out[20 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (29 - 27)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 27);
+ out[21 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (29 - 24)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
- out[16 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (21 - 13)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 13);
- out[17 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (21 - 2)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 2)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 23);
- out[18 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (21 - 12)
+ out[22 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (29 - 21)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 21);
+ out[23 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (29 - 18)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 18);
+ out[24 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (29 - 15)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 15);
+ out[25 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (29 - 12)
| ((in[28 + inpos] - in[28 + inpos - 1]) << 12);
- out[19 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (21 - 1)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 1)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 22);
- out[20 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (21 - 11)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 11);
+ out[26 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (29 - 9)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 9);
+ out[27 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (29 - 6)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 6);
+ out[28 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (29 - 3)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 3);
}
- protected static void integratedpack22(final int initoffset,
+ protected static void integratedpack3(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 22);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (22 - 12)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 12);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (22 - 2)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 2)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 3)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 6)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 9)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 12)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 15)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 18)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 21)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 24)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 27)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (3 - 1)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 1)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 4)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 7)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 10)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 13)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 19)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 22)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 25)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 28)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 31);
+ out[2 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (3 - 2)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 2)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 5)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 11)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 14)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 17)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 20)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 23)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 26)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 29);
+ }
+
+ protected static void integratedpack30(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ out[0 + outpos] = (in[0 + inpos] - initoffset)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (30 - 28)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (30 - 26)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 26);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (30 - 24)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 24);
- out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (22 - 14)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 14);
- out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (22 - 4)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 4)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 26);
- out[5 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (22 - 16)
+ out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (30 - 22)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 22);
+ out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (30 - 20)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 20);
+ out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (30 - 18)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 18);
+ out[7 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (30 - 16)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 16);
- out[6 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (22 - 6)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 6)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 28);
- out[7 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (22 - 18)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 18);
- out[8 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (22 - 8)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 8)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 30);
- out[9 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (22 - 20)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 20);
- out[10 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (22 - 10)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 10);
- out[11 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 22);
- out[12 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (22 - 12)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 12);
- out[13 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (22 - 2)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 2)
+ out[8 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (30 - 14)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 14);
+ out[9 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (30 - 12)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 12);
+ out[10 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (30 - 10)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 10);
+ out[11 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (30 - 8)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 8);
+ out[12 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (30 - 6)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 6);
+ out[13 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (30 - 4)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 4);
+ out[14 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (30 - 2)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 2);
+ out[15 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 30);
+ out[16 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (30 - 28)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 28);
+ out[17 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (30 - 26)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 26);
+ out[18 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (30 - 24)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 24);
- out[14 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (22 - 14)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 14);
- out[15 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (22 - 4)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 4)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 26);
- out[16 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (22 - 16)
+ out[19 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (30 - 22)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 22);
+ out[20 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (30 - 20)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 20);
+ out[21 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (30 - 18)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 18);
+ out[22 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (30 - 16)
| ((in[24 + inpos] - in[24 + inpos - 1]) << 16);
- out[17 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (22 - 6)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 6)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 28);
- out[18 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (22 - 18)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 18);
- out[19 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (22 - 8)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 8)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 30);
- out[20 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (22 - 20)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 20);
- out[21 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (22 - 10)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 10);
+ out[23 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (30 - 14)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 14);
+ out[24 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (30 - 12)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 12);
+ out[25 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (30 - 10)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 10);
+ out[26 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (30 - 8)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 8);
+ out[27 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (30 - 6)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 6);
+ out[28 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (30 - 4)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 4);
+ out[29 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (30 - 2)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 2);
}
- protected static void integratedpack23(final int initoffset,
+ protected static void integratedpack31(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 23);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (23 - 14)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 14);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (23 - 5)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 5)
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 31);
+ out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (31 - 30)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 30);
+ out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (31 - 29)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 29);
+ out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (31 - 28)
| ((in[4 + inpos] - in[4 + inpos - 1]) << 28);
- out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (23 - 19)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 19);
- out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (23 - 10)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 10);
- out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (23 - 1)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 1)
+ out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (31 - 27)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 27);
+ out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (31 - 26)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 26);
+ out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (31 - 25)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 25);
+ out[7 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (31 - 24)
| ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
- out[6 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (23 - 15)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 15);
- out[7 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (23 - 6)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 6)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 29);
- out[8 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (23 - 20)
+ out[8 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (31 - 23)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 23);
+ out[9 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (31 - 22)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 22);
+ out[10 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (31 - 21)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 21);
+ out[11 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (31 - 20)
| ((in[12 + inpos] - in[12 + inpos - 1]) << 20);
- out[9 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (23 - 11)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 11);
- out[10 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (23 - 2)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 2)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 25);
- out[11 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (23 - 16)
+ out[12 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (31 - 19)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 19);
+ out[13 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (31 - 18)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 18);
+ out[14 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (31 - 17)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 17);
+ out[15 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (31 - 16)
| ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[12 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (23 - 7)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 7)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 30);
- out[13 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (23 - 21)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 21);
- out[14 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (23 - 12)
+ out[16 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (31 - 15)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 15);
+ out[17 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (31 - 14)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 14);
+ out[18 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (31 - 13)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 13);
+ out[19 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (31 - 12)
| ((in[20 + inpos] - in[20 + inpos - 1]) << 12);
- out[15 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (23 - 3)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 3)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 26);
- out[16 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (23 - 17)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 17);
- out[17 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (23 - 8)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 31);
- out[18 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (23 - 22)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 22);
- out[19 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (23 - 13)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 13);
- out[20 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (23 - 4)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 4)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 27);
- out[21 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (23 - 18)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 18);
- out[22 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (23 - 9)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 9);
- }
-
- protected static void integratedpack24(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 24);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (24 - 16)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 16);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (24 - 8)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 8);
- out[3 + outpos] = (in[4 + inpos] - in[4 + inpos - 1])
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 24);
- out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (24 - 16)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 16);
- out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (24 - 8)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 8);
- out[6 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 24);
- out[7 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (24 - 16)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 16);
- out[8 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (24 - 8)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 8);
- out[9 + outpos] = (in[12 + inpos] - in[12 + inpos - 1])
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 24);
- out[10 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (24 - 16)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 16);
- out[11 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (24 - 8)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 8);
- out[12 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 24);
- out[13 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (24 - 16)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 16);
- out[14 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (24 - 8)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 8);
- out[15 + outpos] = (in[20 + inpos] - in[20 + inpos - 1])
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 24);
- out[16 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (24 - 16)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 16);
- out[17 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (24 - 8)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 8);
- out[18 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 24);
- out[19 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (24 - 16)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 16);
- out[20 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (24 - 8)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 8);
- out[21 + outpos] = (in[28 + inpos] - in[28 + inpos - 1])
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 24);
- out[22 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (24 - 16)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 16);
- out[23 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (24 - 8)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 8);
+ out[20 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (31 - 11)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 11);
+ out[21 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (31 - 10)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 10);
+ out[22 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (31 - 9)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 9);
+ out[23 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (31 - 8)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 8);
+ out[24 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (31 - 7)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 7);
+ out[25 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (31 - 6)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 6);
+ out[26 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (31 - 5)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 5);
+ out[27 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (31 - 4)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 4);
+ out[28 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (31 - 3)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 3);
+ out[29 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (31 - 2)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 2);
+ out[30 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (31 - 1)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 1);
}
- protected static void integratedpack25(final int initoffset,
+ protected static void integratedpack32(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 25);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (25 - 18)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 18);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (25 - 11)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 11);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (25 - 4)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 4)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 29);
- out[4 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (25 - 22)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 22);
- out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (25 - 15)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 15);
- out[6 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (25 - 8)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 8);
- out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (25 - 1)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 1)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 26);
- out[8 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (25 - 19)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 19);
- out[9 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (25 - 12)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 12);
- out[10 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (25 - 5)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 5)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 30);
- out[11 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (25 - 23)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 23);
- out[12 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (25 - 16)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[13 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (25 - 9)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 9);
- out[14 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (25 - 2)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 2)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 27);
- out[15 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (25 - 20)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 20);
- out[16 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (25 - 13)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 13);
- out[17 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (25 - 6)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 6)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 31);
- out[18 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (25 - 24)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
- out[19 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (25 - 17)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 17);
- out[20 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (25 - 10)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 10);
- out[21 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (25 - 3)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 3)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 28);
- out[22 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (25 - 21)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 21);
- out[23 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (25 - 14)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 14);
- out[24 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (25 - 7)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 7);
+ System.arraycopy(in, inpos, out, outpos, 32); // no sense in
+ // doing delta
+ // coding
}
- protected static void integratedpack26(final int initoffset,
+ protected static void integratedpack4(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 26);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (26 - 20)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 20);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (26 - 14)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 14);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (26 - 8)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 8);
- out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (26 - 2)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 2)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 28);
- out[5 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (26 - 22)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 22);
- out[6 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (26 - 16)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 16);
- out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (26 - 10)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 10);
- out[8 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (26 - 4)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 4)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 30);
- out[9 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (26 - 24)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 24);
- out[10 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (26 - 18)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 18);
- out[11 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (26 - 12)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 12);
- out[12 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (26 - 6)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 6);
- out[13 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 26);
- out[14 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (26 - 20)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 20);
- out[15 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (26 - 14)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 14);
- out[16 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (26 - 8)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 8);
- out[17 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (26 - 2)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 2)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 28);
- out[18 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (26 - 22)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 22);
- out[19 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (26 - 16)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 16);
- out[20 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (26 - 10)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 10);
- out[21 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (26 - 4)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 4)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 30);
- out[22 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (26 - 24)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 24);
- out[23 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (26 - 18)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 18);
- out[24 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (26 - 12)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 12);
- out[25 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (26 - 6)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 6);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 4)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 8)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 12)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 16)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 20)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 24)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 28);
+ out[1 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 4)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 8)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 12)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 16)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 20)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 24)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 4)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 8)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 12)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 16)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 20)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 24)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 28);
+ out[3 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 4)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 8)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 12)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 16)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 20)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 24)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 28);
}
- protected static void integratedpack27(final int initoffset,
+ protected static void integratedpack5(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 27);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (27 - 22)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 22);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (27 - 17)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 17);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (27 - 12)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 12);
- out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (27 - 7)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 7);
- out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (27 - 2)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 2)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 29);
- out[6 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (27 - 24)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
- out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (27 - 19)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 19);
- out[8 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (27 - 14)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 14);
- out[9 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (27 - 9)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 9);
- out[10 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (27 - 4)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 4)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 31);
- out[11 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (27 - 26)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 26);
- out[12 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (27 - 21)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 21);
- out[13 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (27 - 16)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[14 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (27 - 11)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 11);
- out[15 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (27 - 6)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 6);
- out[16 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (27 - 1)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 1)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 28);
- out[17 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (27 - 23)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 23);
- out[18 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (27 - 18)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 18);
- out[19 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (27 - 13)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 13);
- out[20 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (27 - 8)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 8);
- out[21 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (27 - 3)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 3)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 30);
- out[22 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (27 - 25)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 25);
- out[23 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (27 - 20)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 20);
- out[24 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (27 - 15)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 15);
- out[25 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (27 - 10)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 10);
- out[26 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (27 - 5)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 5);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 5)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 10)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 15)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 20)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 25)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (5 - 3)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 3)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 13)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 18)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 23)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (5 - 1)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 1)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 6)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 11)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 21)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 26)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 31);
+ out[3 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (5 - 4)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 4)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 9)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 14)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 19)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 24)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 29);
+ out[4 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (5 - 2)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 2)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 7)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 12)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 17)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 22)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 27);
}
- protected static void integratedpack28(final int initoffset,
+ protected static void integratedpack6(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 28);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (28 - 24)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 24);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (28 - 20)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 20);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (28 - 16)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 16);
- out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (28 - 12)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 12);
- out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (28 - 8)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 8);
- out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (28 - 4)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 4);
- out[7 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 28);
- out[8 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (28 - 24)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 24);
- out[9 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (28 - 20)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 20);
- out[10 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (28 - 16)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 16);
- out[11 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (28 - 12)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 12);
- out[12 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (28 - 8)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 8);
- out[13 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (28 - 4)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 4);
- out[14 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 28);
- out[15 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (28 - 24)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 24);
- out[16 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (28 - 20)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 20);
- out[17 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (28 - 16)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 16);
- out[18 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (28 - 12)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 12);
- out[19 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (28 - 8)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 8);
- out[20 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (28 - 4)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 4);
- out[21 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 28);
- out[22 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (28 - 24)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 24);
- out[23 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (28 - 20)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 20);
- out[24 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (28 - 16)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 16);
- out[25 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (28 - 12)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 12);
- out[26 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (28 - 8)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 8);
- out[27 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (28 - 4)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 4);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 6)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 12)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 18)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 24)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 30);
+ out[1 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (6 - 4)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 4)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 10)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 16)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 22)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 28);
+ out[2 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (6 - 2)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 2)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 8)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 14)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 20)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 26);
+ out[3 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 6)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 12)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 18)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 24)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 30);
+ out[4 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (6 - 4)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 4)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 10)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 16)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 22)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 28);
+ out[5 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (6 - 2)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 2)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 8)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 14)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 20)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 26);
}
- protected static void integratedpack29(final int initoffset,
+ protected static void integratedpack7(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 29);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (29 - 26)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 26);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (29 - 23)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 23);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (29 - 20)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 20);
- out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (29 - 17)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 17);
- out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (29 - 14)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 14);
- out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (29 - 11)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 11);
- out[7 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (29 - 8)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 8);
- out[8 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (29 - 5)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 5);
- out[9 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (29 - 2)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 2)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 31);
- out[10 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (29 - 28)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 28);
- out[11 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (29 - 25)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 25);
- out[12 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (29 - 22)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 22);
- out[13 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (29 - 19)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 19);
- out[14 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (29 - 16)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[15 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (29 - 13)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 13);
- out[16 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (29 - 10)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 10);
- out[17 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (29 - 7)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 7);
- out[18 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (29 - 4)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 4);
- out[19 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (29 - 1)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 1)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 30);
- out[20 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (29 - 27)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 27);
- out[21 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (29 - 24)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
- out[22 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (29 - 21)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 21);
- out[23 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (29 - 18)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 18);
- out[24 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (29 - 15)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 15);
- out[25 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (29 - 12)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 12);
- out[26 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (29 - 9)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 9);
- out[27 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (29 - 6)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 6);
- out[28 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (29 - 3)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 3);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 7)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 14)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 21)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 28);
+ out[1 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (7 - 3)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 3)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 10)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 17)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 24)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 31);
+ out[2 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (7 - 6)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 6)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 13)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 20)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 27);
+ out[3 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (7 - 2)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 2)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 9)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 23)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 30);
+ out[4 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (7 - 5)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 5)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 12)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 19)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 26);
+ out[5 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (7 - 1)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 1)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 8)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 15)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 22)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 29);
+ out[6 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (7 - 4)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 4)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 11)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 18)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 25);
}
- protected static void integratedpack30(final int initoffset,
+ protected static void integratedpack8(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 30);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (30 - 28)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 28);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (30 - 26)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 26);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (30 - 24)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 24);
- out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (30 - 22)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 22);
- out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (30 - 20)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 20);
- out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (30 - 18)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 18);
- out[7 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (30 - 16)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 16);
- out[8 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (30 - 14)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 14);
- out[9 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (30 - 12)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 12);
- out[10 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (30 - 10)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 10);
- out[11 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (30 - 8)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 8);
- out[12 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (30 - 6)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 6);
- out[13 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (30 - 4)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 4);
- out[14 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (30 - 2)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 2);
- out[15 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 30);
- out[16 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (30 - 28)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 28);
- out[17 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (30 - 26)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 26);
- out[18 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (30 - 24)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 24);
- out[19 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (30 - 22)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 22);
- out[20 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (30 - 20)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 20);
- out[21 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (30 - 18)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 18);
- out[22 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (30 - 16)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 16);
- out[23 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (30 - 14)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 14);
- out[24 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (30 - 12)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 12);
- out[25 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (30 - 10)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 10);
- out[26 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (30 - 8)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 8);
- out[27 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (30 - 6)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 6);
- out[28 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (30 - 4)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 4);
- out[29 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (30 - 2)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 2);
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 8)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 16)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 24);
+ out[1 + outpos] = (in[4 + inpos] - in[4 + inpos - 1])
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 8)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 16)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 24);
+ out[2 + outpos] = (in[8 + inpos] - in[8 + inpos - 1])
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 8)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 16)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 24);
+ out[3 + outpos] = (in[12 + inpos] - in[12 + inpos - 1])
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 8)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 16)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 24);
+ out[4 + outpos] = (in[16 + inpos] - in[16 + inpos - 1])
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 8)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 16)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 24);
+ out[5 + outpos] = (in[20 + inpos] - in[20 + inpos - 1])
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 8)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 16)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 24);
+ out[6 + outpos] = (in[24 + inpos] - in[24 + inpos - 1])
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 8)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 16)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 24);
+ out[7 + outpos] = (in[28 + inpos] - in[28 + inpos - 1])
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 8)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 16)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 24);
}
- protected static void integratedpack31(final int initoffset,
+ protected static void integratedpack9(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
out[0 + outpos] = (in[0 + inpos] - initoffset)
- | ((in[1 + inpos] - in[1 + inpos - 1]) << 31);
- out[1 + outpos] = (in[1 + inpos] - in[1 + inpos - 1]) >>> (31 - 30)
- | ((in[2 + inpos] - in[2 + inpos - 1]) << 30);
- out[2 + outpos] = (in[2 + inpos] - in[2 + inpos - 1]) >>> (31 - 29)
- | ((in[3 + inpos] - in[3 + inpos - 1]) << 29);
- out[3 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (31 - 28)
- | ((in[4 + inpos] - in[4 + inpos - 1]) << 28);
- out[4 + outpos] = (in[4 + inpos] - in[4 + inpos - 1]) >>> (31 - 27)
- | ((in[5 + inpos] - in[5 + inpos - 1]) << 27);
- out[5 + outpos] = (in[5 + inpos] - in[5 + inpos - 1]) >>> (31 - 26)
- | ((in[6 + inpos] - in[6 + inpos - 1]) << 26);
- out[6 + outpos] = (in[6 + inpos] - in[6 + inpos - 1]) >>> (31 - 25)
- | ((in[7 + inpos] - in[7 + inpos - 1]) << 25);
- out[7 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (31 - 24)
- | ((in[8 + inpos] - in[8 + inpos - 1]) << 24);
- out[8 + outpos] = (in[8 + inpos] - in[8 + inpos - 1]) >>> (31 - 23)
- | ((in[9 + inpos] - in[9 + inpos - 1]) << 23);
- out[9 + outpos] = (in[9 + inpos] - in[9 + inpos - 1]) >>> (31 - 22)
- | ((in[10 + inpos] - in[10 + inpos - 1]) << 22);
- out[10 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (31 - 21)
- | ((in[11 + inpos] - in[11 + inpos - 1]) << 21);
- out[11 + outpos] = (in[11 + inpos] - in[11 + inpos - 1]) >>> (31 - 20)
- | ((in[12 + inpos] - in[12 + inpos - 1]) << 20);
- out[12 + outpos] = (in[12 + inpos] - in[12 + inpos - 1]) >>> (31 - 19)
- | ((in[13 + inpos] - in[13 + inpos - 1]) << 19);
- out[13 + outpos] = (in[13 + inpos] - in[13 + inpos - 1]) >>> (31 - 18)
- | ((in[14 + inpos] - in[14 + inpos - 1]) << 18);
- out[14 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (31 - 17)
- | ((in[15 + inpos] - in[15 + inpos - 1]) << 17);
- out[15 + outpos] = (in[15 + inpos] - in[15 + inpos - 1]) >>> (31 - 16)
- | ((in[16 + inpos] - in[16 + inpos - 1]) << 16);
- out[16 + outpos] = (in[16 + inpos] - in[16 + inpos - 1]) >>> (31 - 15)
- | ((in[17 + inpos] - in[17 + inpos - 1]) << 15);
- out[17 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (31 - 14)
- | ((in[18 + inpos] - in[18 + inpos - 1]) << 14);
- out[18 + outpos] = (in[18 + inpos] - in[18 + inpos - 1]) >>> (31 - 13)
- | ((in[19 + inpos] - in[19 + inpos - 1]) << 13);
- out[19 + outpos] = (in[19 + inpos] - in[19 + inpos - 1]) >>> (31 - 12)
- | ((in[20 + inpos] - in[20 + inpos - 1]) << 12);
- out[20 + outpos] = (in[20 + inpos] - in[20 + inpos - 1]) >>> (31 - 11)
- | ((in[21 + inpos] - in[21 + inpos - 1]) << 11);
- out[21 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (31 - 10)
- | ((in[22 + inpos] - in[22 + inpos - 1]) << 10);
- out[22 + outpos] = (in[22 + inpos] - in[22 + inpos - 1]) >>> (31 - 9)
- | ((in[23 + inpos] - in[23 + inpos - 1]) << 9);
- out[23 + outpos] = (in[23 + inpos] - in[23 + inpos - 1]) >>> (31 - 8)
- | ((in[24 + inpos] - in[24 + inpos - 1]) << 8);
- out[24 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (31 - 7)
- | ((in[25 + inpos] - in[25 + inpos - 1]) << 7);
- out[25 + outpos] = (in[25 + inpos] - in[25 + inpos - 1]) >>> (31 - 6)
- | ((in[26 + inpos] - in[26 + inpos - 1]) << 6);
- out[26 + outpos] = (in[26 + inpos] - in[26 + inpos - 1]) >>> (31 - 5)
- | ((in[27 + inpos] - in[27 + inpos - 1]) << 5);
- out[27 + outpos] = (in[27 + inpos] - in[27 + inpos - 1]) >>> (31 - 4)
- | ((in[28 + inpos] - in[28 + inpos - 1]) << 4);
- out[28 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (31 - 3)
- | ((in[29 + inpos] - in[29 + inpos - 1]) << 3);
- out[29 + outpos] = (in[29 + inpos] - in[29 + inpos - 1]) >>> (31 - 2)
- | ((in[30 + inpos] - in[30 + inpos - 1]) << 2);
- out[30 + outpos] = (in[30 + inpos] - in[30 + inpos - 1]) >>> (31 - 1)
- | ((in[31 + inpos] - in[31 + inpos - 1]) << 1);
- }
-
- protected static void integratedunpack1(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 1) & 1))
- + out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 2) & 1))
- + out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 3) & 1))
- + out[3 + outpos - 1];
- out[4 + outpos] = (((in[0 + inpos] >>> 4) & 1))
- + out[4 + outpos - 1];
- out[5 + outpos] = (((in[0 + inpos] >>> 5) & 1))
- + out[5 + outpos - 1];
- out[6 + outpos] = (((in[0 + inpos] >>> 6) & 1))
- + out[6 + outpos - 1];
- out[7 + outpos] = (((in[0 + inpos] >>> 7) & 1))
- + out[7 + outpos - 1];
- out[8 + outpos] = (((in[0 + inpos] >>> 8) & 1))
- + out[8 + outpos - 1];
- out[9 + outpos] = (((in[0 + inpos] >>> 9) & 1))
- + out[9 + outpos - 1];
- out[10 + outpos] = (((in[0 + inpos] >>> 10) & 1))
- + out[10 + outpos - 1];
- out[11 + outpos] = (((in[0 + inpos] >>> 11) & 1))
- + out[11 + outpos - 1];
- out[12 + outpos] = (((in[0 + inpos] >>> 12) & 1))
- + out[12 + outpos - 1];
- out[13 + outpos] = (((in[0 + inpos] >>> 13) & 1))
- + out[13 + outpos - 1];
- out[14 + outpos] = (((in[0 + inpos] >>> 14) & 1))
- + out[14 + outpos - 1];
- out[15 + outpos] = (((in[0 + inpos] >>> 15) & 1))
- + out[15 + outpos - 1];
- out[16 + outpos] = (((in[0 + inpos] >>> 16) & 1))
- + out[16 + outpos - 1];
- out[17 + outpos] = (((in[0 + inpos] >>> 17) & 1))
- + out[17 + outpos - 1];
- out[18 + outpos] = (((in[0 + inpos] >>> 18) & 1))
- + out[18 + outpos - 1];
- out[19 + outpos] = (((in[0 + inpos] >>> 19) & 1))
- + out[19 + outpos - 1];
- out[20 + outpos] = (((in[0 + inpos] >>> 20) & 1))
- + out[20 + outpos - 1];
- out[21 + outpos] = (((in[0 + inpos] >>> 21) & 1))
- + out[21 + outpos - 1];
- out[22 + outpos] = (((in[0 + inpos] >>> 22) & 1))
- + out[22 + outpos - 1];
- out[23 + outpos] = (((in[0 + inpos] >>> 23) & 1))
- + out[23 + outpos - 1];
- out[24 + outpos] = (((in[0 + inpos] >>> 24) & 1))
- + out[24 + outpos - 1];
- out[25 + outpos] = (((in[0 + inpos] >>> 25) & 1))
- + out[25 + outpos - 1];
- out[26 + outpos] = (((in[0 + inpos] >>> 26) & 1))
- + out[26 + outpos - 1];
- out[27 + outpos] = (((in[0 + inpos] >>> 27) & 1))
- + out[27 + outpos - 1];
- out[28 + outpos] = (((in[0 + inpos] >>> 28) & 1))
- + out[28 + outpos - 1];
- out[29 + outpos] = (((in[0 + inpos] >>> 29) & 1))
- + out[29 + outpos - 1];
- out[30 + outpos] = (((in[0 + inpos] >>> 30) & 1))
- + out[30 + outpos - 1];
- out[31 + outpos] = ((in[0 + inpos] >>> 31))
- + out[31 + outpos - 1];
+ | ((in[1 + inpos] - in[1 + inpos - 1]) << 9)
+ | ((in[2 + inpos] - in[2 + inpos - 1]) << 18)
+ | ((in[3 + inpos] - in[3 + inpos - 1]) << 27);
+ out[1 + outpos] = (in[3 + inpos] - in[3 + inpos - 1]) >>> (9 - 4)
+ | ((in[4 + inpos] - in[4 + inpos - 1]) << 4)
+ | ((in[5 + inpos] - in[5 + inpos - 1]) << 13)
+ | ((in[6 + inpos] - in[6 + inpos - 1]) << 22)
+ | ((in[7 + inpos] - in[7 + inpos - 1]) << 31);
+ out[2 + outpos] = (in[7 + inpos] - in[7 + inpos - 1]) >>> (9 - 8)
+ | ((in[8 + inpos] - in[8 + inpos - 1]) << 8)
+ | ((in[9 + inpos] - in[9 + inpos - 1]) << 17)
+ | ((in[10 + inpos] - in[10 + inpos - 1]) << 26);
+ out[3 + outpos] = (in[10 + inpos] - in[10 + inpos - 1]) >>> (9 - 3)
+ | ((in[11 + inpos] - in[11 + inpos - 1]) << 3)
+ | ((in[12 + inpos] - in[12 + inpos - 1]) << 12)
+ | ((in[13 + inpos] - in[13 + inpos - 1]) << 21)
+ | ((in[14 + inpos] - in[14 + inpos - 1]) << 30);
+ out[4 + outpos] = (in[14 + inpos] - in[14 + inpos - 1]) >>> (9 - 7)
+ | ((in[15 + inpos] - in[15 + inpos - 1]) << 7)
+ | ((in[16 + inpos] - in[16 + inpos - 1]) << 16)
+ | ((in[17 + inpos] - in[17 + inpos - 1]) << 25);
+ out[5 + outpos] = (in[17 + inpos] - in[17 + inpos - 1]) >>> (9 - 2)
+ | ((in[18 + inpos] - in[18 + inpos - 1]) << 2)
+ | ((in[19 + inpos] - in[19 + inpos - 1]) << 11)
+ | ((in[20 + inpos] - in[20 + inpos - 1]) << 20)
+ | ((in[21 + inpos] - in[21 + inpos - 1]) << 29);
+ out[6 + outpos] = (in[21 + inpos] - in[21 + inpos - 1]) >>> (9 - 6)
+ | ((in[22 + inpos] - in[22 + inpos - 1]) << 6)
+ | ((in[23 + inpos] - in[23 + inpos - 1]) << 15)
+ | ((in[24 + inpos] - in[24 + inpos - 1]) << 24);
+ out[7 + outpos] = (in[24 + inpos] - in[24 + inpos - 1]) >>> (9 - 1)
+ | ((in[25 + inpos] - in[25 + inpos - 1]) << 1)
+ | ((in[26 + inpos] - in[26 + inpos - 1]) << 10)
+ | ((in[27 + inpos] - in[27 + inpos - 1]) << 19)
+ | ((in[28 + inpos] - in[28 + inpos - 1]) << 28);
+ out[8 + outpos] = (in[28 + inpos] - in[28 + inpos - 1]) >>> (9 - 5)
+ | ((in[29 + inpos] - in[29 + inpos - 1]) << 5)
+ | ((in[30 + inpos] - in[30 + inpos - 1]) << 14)
+ | ((in[31 + inpos] - in[31 + inpos - 1]) << 23);
}
- protected static void integratedunpack2(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 3)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 2) & 3))
- + out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 4) & 3))
+ /**
+ * Unpack 32 integers along with prefix sum computation
+ *
+ * @param initoffset value to add to all outputted values
+ * @param in source array
+ * @param inpos initial position in source array
+ * @param out output array
+ * @param outpos initial position in output array
+ * @param bit number of bits to use per integer
+ */
+ public static void integratedunpack(final int initoffset,
+ final int[] in, final int inpos, final int[] out, final int outpos,
+ final int bit) {
+ switch (bit) {
+ case 0:
+ integratedunpack0(initoffset, in, inpos, out, outpos);
+ break;
+ case 1:
+ integratedunpack1(initoffset, in, inpos, out, outpos);
+ break;
+ case 2:
+ integratedunpack2(initoffset, in, inpos, out, outpos);
+ break;
+ case 3:
+ integratedunpack3(initoffset, in, inpos, out, outpos);
+ break;
+ case 4:
+ integratedunpack4(initoffset, in, inpos, out, outpos);
+ break;
+ case 5:
+ integratedunpack5(initoffset, in, inpos, out, outpos);
+ break;
+ case 6:
+ integratedunpack6(initoffset, in, inpos, out, outpos);
+ break;
+ case 7:
+ integratedunpack7(initoffset, in, inpos, out, outpos);
+ break;
+ case 8:
+ integratedunpack8(initoffset, in, inpos, out, outpos);
+ break;
+ case 9:
+ integratedunpack9(initoffset, in, inpos, out, outpos);
+ break;
+ case 10:
+ integratedunpack10(initoffset, in, inpos, out, outpos);
+ break;
+ case 11:
+ integratedunpack11(initoffset, in, inpos, out, outpos);
+ break;
+ case 12:
+ integratedunpack12(initoffset, in, inpos, out, outpos);
+ break;
+ case 13:
+ integratedunpack13(initoffset, in, inpos, out, outpos);
+ break;
+ case 14:
+ integratedunpack14(initoffset, in, inpos, out, outpos);
+ break;
+ case 15:
+ integratedunpack15(initoffset, in, inpos, out, outpos);
+ break;
+ case 16:
+ integratedunpack16(initoffset, in, inpos, out, outpos);
+ break;
+ case 17:
+ integratedunpack17(initoffset, in, inpos, out, outpos);
+ break;
+ case 18:
+ integratedunpack18(initoffset, in, inpos, out, outpos);
+ break;
+ case 19:
+ integratedunpack19(initoffset, in, inpos, out, outpos);
+ break;
+ case 20:
+ integratedunpack20(initoffset, in, inpos, out, outpos);
+ break;
+ case 21:
+ integratedunpack21(initoffset, in, inpos, out, outpos);
+ break;
+ case 22:
+ integratedunpack22(initoffset, in, inpos, out, outpos);
+ break;
+ case 23:
+ integratedunpack23(initoffset, in, inpos, out, outpos);
+ break;
+ case 24:
+ integratedunpack24(initoffset, in, inpos, out, outpos);
+ break;
+ case 25:
+ integratedunpack25(initoffset, in, inpos, out, outpos);
+ break;
+ case 26:
+ integratedunpack26(initoffset, in, inpos, out, outpos);
+ break;
+ case 27:
+ integratedunpack27(initoffset, in, inpos, out, outpos);
+ break;
+ case 28:
+ integratedunpack28(initoffset, in, inpos, out, outpos);
+ break;
+ case 29:
+ integratedunpack29(initoffset, in, inpos, out, outpos);
+ break;
+ case 30:
+ integratedunpack30(initoffset, in, inpos, out, outpos);
+ break;
+ case 31:
+ integratedunpack31(initoffset, in, inpos, out, outpos);
+ break;
+ case 32:
+ integratedunpack32(initoffset, in, inpos, out, outpos);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unsupported bit width.");
+ }
+ }
+
+ protected static void integratedunpack0(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ Arrays.fill(out, outpos, outpos + 32, initoffset);
+ }
+
+ protected static void integratedunpack1(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 1) & 1))
+ + out[1 + outpos - 1];
+ out[2 + outpos] = (((in[0 + inpos] >>> 2) & 1))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 6) & 3))
+ out[3 + outpos] = (((in[0 + inpos] >>> 3) & 1))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[0 + inpos] >>> 8) & 3))
+ out[4 + outpos] = (((in[0 + inpos] >>> 4) & 1))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[0 + inpos] >>> 10) & 3))
+ out[5 + outpos] = (((in[0 + inpos] >>> 5) & 1))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[0 + inpos] >>> 12) & 3))
+ out[6 + outpos] = (((in[0 + inpos] >>> 6) & 1))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[0 + inpos] >>> 14) & 3))
+ out[7 + outpos] = (((in[0 + inpos] >>> 7) & 1))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[0 + inpos] >>> 16) & 3))
+ out[8 + outpos] = (((in[0 + inpos] >>> 8) & 1))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[0 + inpos] >>> 18) & 3))
+ out[9 + outpos] = (((in[0 + inpos] >>> 9) & 1))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[0 + inpos] >>> 20) & 3))
+ out[10 + outpos] = (((in[0 + inpos] >>> 10) & 1))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[0 + inpos] >>> 22) & 3))
+ out[11 + outpos] = (((in[0 + inpos] >>> 11) & 1))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[0 + inpos] >>> 24) & 3))
+ out[12 + outpos] = (((in[0 + inpos] >>> 12) & 1))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[0 + inpos] >>> 26) & 3))
+ out[13 + outpos] = (((in[0 + inpos] >>> 13) & 1))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[0 + inpos] >>> 28) & 3))
+ out[14 + outpos] = (((in[0 + inpos] >>> 14) & 1))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[0 + inpos] >>> 30))
+ out[15 + outpos] = (((in[0 + inpos] >>> 15) & 1))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[1 + inpos] >>> 0) & 3))
+ out[16 + outpos] = (((in[0 + inpos] >>> 16) & 1))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[1 + inpos] >>> 2) & 3))
+ out[17 + outpos] = (((in[0 + inpos] >>> 17) & 1))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[1 + inpos] >>> 4) & 3))
+ out[18 + outpos] = (((in[0 + inpos] >>> 18) & 1))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[1 + inpos] >>> 6) & 3))
+ out[19 + outpos] = (((in[0 + inpos] >>> 19) & 1))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[1 + inpos] >>> 8) & 3))
+ out[20 + outpos] = (((in[0 + inpos] >>> 20) & 1))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[1 + inpos] >>> 10) & 3))
+ out[21 + outpos] = (((in[0 + inpos] >>> 21) & 1))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[1 + inpos] >>> 12) & 3))
+ out[22 + outpos] = (((in[0 + inpos] >>> 22) & 1))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[1 + inpos] >>> 14) & 3))
+ out[23 + outpos] = (((in[0 + inpos] >>> 23) & 1))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[1 + inpos] >>> 16) & 3))
+ out[24 + outpos] = (((in[0 + inpos] >>> 24) & 1))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[1 + inpos] >>> 18) & 3))
+ out[25 + outpos] = (((in[0 + inpos] >>> 25) & 1))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[1 + inpos] >>> 20) & 3))
+ out[26 + outpos] = (((in[0 + inpos] >>> 26) & 1))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[1 + inpos] >>> 22) & 3))
+ out[27 + outpos] = (((in[0 + inpos] >>> 27) & 1))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[1 + inpos] >>> 24) & 3))
+ out[28 + outpos] = (((in[0 + inpos] >>> 28) & 1))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[1 + inpos] >>> 26) & 3))
+ out[29 + outpos] = (((in[0 + inpos] >>> 29) & 1))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[1 + inpos] >>> 28) & 3))
+ out[30 + outpos] = (((in[0 + inpos] >>> 30) & 1))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[1 + inpos] >>> 30))
+ out[31 + outpos] = ((in[0 + inpos] >>> 31))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack3(final int initoffset,
+ protected static void integratedunpack10(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 7)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 3) & 7))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1023)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 10) & 1023))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 6) & 7))
+ out[2 + outpos] = (((in[0 + inpos] >>> 20) & 1023))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 9) & 7))
+ out[3 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 255) << (10 - 8)))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[0 + inpos] >>> 12) & 7))
+ out[4 + outpos] = (((in[1 + inpos] >>> 8) & 1023))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[0 + inpos] >>> 15) & 7))
+ out[5 + outpos] = (((in[1 + inpos] >>> 18) & 1023))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[0 + inpos] >>> 18) & 7))
+ out[6 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 63) << (10 - 6)))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[0 + inpos] >>> 21) & 7))
+ out[7 + outpos] = (((in[2 + inpos] >>> 6) & 1023))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[0 + inpos] >>> 24) & 7))
+ out[8 + outpos] = (((in[2 + inpos] >>> 16) & 1023))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[0 + inpos] >>> 27) & 7))
+ out[9 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 15) << (10 - 4)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 1) << (3 - 1)))
+ out[10 + outpos] = (((in[3 + inpos] >>> 4) & 1023))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[1 + inpos] >>> 1) & 7))
+ out[11 + outpos] = (((in[3 + inpos] >>> 14) & 1023))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[1 + inpos] >>> 4) & 7))
+ out[12 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 3) << (10 - 2)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[1 + inpos] >>> 7) & 7))
+ out[13 + outpos] = (((in[4 + inpos] >>> 2) & 1023))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[1 + inpos] >>> 10) & 7))
+ out[14 + outpos] = (((in[4 + inpos] >>> 12) & 1023))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[1 + inpos] >>> 13) & 7))
+ out[15 + outpos] = ((in[4 + inpos] >>> 22))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[1 + inpos] >>> 16) & 7))
+ out[16 + outpos] = (((in[5 + inpos] >>> 0) & 1023))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[1 + inpos] >>> 19) & 7))
+ out[17 + outpos] = (((in[5 + inpos] >>> 10) & 1023))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[1 + inpos] >>> 22) & 7))
+ out[18 + outpos] = (((in[5 + inpos] >>> 20) & 1023))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[1 + inpos] >>> 25) & 7))
+ out[19 + outpos] = ((in[5 + inpos] >>> 30) | ((in[6 + inpos] & 255) << (10 - 8)))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[1 + inpos] >>> 28) & 7))
+ out[20 + outpos] = (((in[6 + inpos] >>> 8) & 1023))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 3) << (3 - 2)))
+ out[21 + outpos] = (((in[6 + inpos] >>> 18) & 1023))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[2 + inpos] >>> 2) & 7))
+ out[22 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 63) << (10 - 6)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[2 + inpos] >>> 5) & 7))
+ out[23 + outpos] = (((in[7 + inpos] >>> 6) & 1023))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[2 + inpos] >>> 8) & 7))
+ out[24 + outpos] = (((in[7 + inpos] >>> 16) & 1023))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[2 + inpos] >>> 11) & 7))
+ out[25 + outpos] = ((in[7 + inpos] >>> 26) | ((in[8 + inpos] & 15) << (10 - 4)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[2 + inpos] >>> 14) & 7))
+ out[26 + outpos] = (((in[8 + inpos] >>> 4) & 1023))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[2 + inpos] >>> 17) & 7))
+ out[27 + outpos] = (((in[8 + inpos] >>> 14) & 1023))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[2 + inpos] >>> 20) & 7))
+ out[28 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 3) << (10 - 2)))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[2 + inpos] >>> 23) & 7))
+ out[29 + outpos] = (((in[9 + inpos] >>> 2) & 1023))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[2 + inpos] >>> 26) & 7))
+ out[30 + outpos] = (((in[9 + inpos] >>> 12) & 1023))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[2 + inpos] >>> 29))
+ out[31 + outpos] = ((in[9 + inpos] >>> 22))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack4(final int initoffset,
+ protected static void integratedunpack11(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 15)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 4) & 15))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 2047)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 11) & 2047))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 8) & 15))
+ out[2 + outpos] = ((in[0 + inpos] >>> 22) | ((in[1 + inpos] & 1) << (11 - 1)))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 12) & 15))
+ out[3 + outpos] = (((in[1 + inpos] >>> 1) & 2047))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[0 + inpos] >>> 16) & 15))
+ out[4 + outpos] = (((in[1 + inpos] >>> 12) & 2047))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[0 + inpos] >>> 20) & 15))
+ out[5 + outpos] = ((in[1 + inpos] >>> 23) | ((in[2 + inpos] & 3) << (11 - 2)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[0 + inpos] >>> 24) & 15))
+ out[6 + outpos] = (((in[2 + inpos] >>> 2) & 2047))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[0 + inpos] >>> 28))
+ out[7 + outpos] = (((in[2 + inpos] >>> 13) & 2047))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[1 + inpos] >>> 0) & 15))
+ out[8 + outpos] = ((in[2 + inpos] >>> 24) | ((in[3 + inpos] & 7) << (11 - 3)))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[1 + inpos] >>> 4) & 15))
+ out[9 + outpos] = (((in[3 + inpos] >>> 3) & 2047))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[1 + inpos] >>> 8) & 15))
+ out[10 + outpos] = (((in[3 + inpos] >>> 14) & 2047))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[1 + inpos] >>> 12) & 15))
+ out[11 + outpos] = ((in[3 + inpos] >>> 25) | ((in[4 + inpos] & 15) << (11 - 4)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[1 + inpos] >>> 16) & 15))
+ out[12 + outpos] = (((in[4 + inpos] >>> 4) & 2047))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[1 + inpos] >>> 20) & 15))
+ out[13 + outpos] = (((in[4 + inpos] >>> 15) & 2047))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[1 + inpos] >>> 24) & 15))
+ out[14 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 31) << (11 - 5)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[1 + inpos] >>> 28))
+ out[15 + outpos] = (((in[5 + inpos] >>> 5) & 2047))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[2 + inpos] >>> 0) & 15))
+ out[16 + outpos] = (((in[5 + inpos] >>> 16) & 2047))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[2 + inpos] >>> 4) & 15))
+ out[17 + outpos] = ((in[5 + inpos] >>> 27) | ((in[6 + inpos] & 63) << (11 - 6)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[2 + inpos] >>> 8) & 15))
+ out[18 + outpos] = (((in[6 + inpos] >>> 6) & 2047))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[2 + inpos] >>> 12) & 15))
+ out[19 + outpos] = (((in[6 + inpos] >>> 17) & 2047))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[2 + inpos] >>> 16) & 15))
+ out[20 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 127) << (11 - 7)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[2 + inpos] >>> 20) & 15))
+ out[21 + outpos] = (((in[7 + inpos] >>> 7) & 2047))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[2 + inpos] >>> 24) & 15))
+ out[22 + outpos] = (((in[7 + inpos] >>> 18) & 2047))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[2 + inpos] >>> 28))
+ out[23 + outpos] = ((in[7 + inpos] >>> 29) | ((in[8 + inpos] & 255) << (11 - 8)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[3 + inpos] >>> 0) & 15))
+ out[24 + outpos] = (((in[8 + inpos] >>> 8) & 2047))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[3 + inpos] >>> 4) & 15))
+ out[25 + outpos] = (((in[8 + inpos] >>> 19) & 2047))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[3 + inpos] >>> 8) & 15))
+ out[26 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 511) << (11 - 9)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[3 + inpos] >>> 12) & 15))
+ out[27 + outpos] = (((in[9 + inpos] >>> 9) & 2047))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[3 + inpos] >>> 16) & 15))
+ out[28 + outpos] = (((in[9 + inpos] >>> 20) & 2047))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[3 + inpos] >>> 20) & 15))
+ out[29 + outpos] = ((in[9 + inpos] >>> 31) | ((in[10 + inpos] & 1023) << (11 - 10)))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[3 + inpos] >>> 24) & 15))
+ out[30 + outpos] = (((in[10 + inpos] >>> 10) & 2047))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[3 + inpos] >>> 28))
+ out[31 + outpos] = ((in[10 + inpos] >>> 21))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack5(final int initoffset,
+ protected static void integratedunpack12(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 31)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 5) & 31))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 4095)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 12) & 4095))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 10) & 31))
+ out[2 + outpos] = ((in[0 + inpos] >>> 24) | ((in[1 + inpos] & 15) << (12 - 4)))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 15) & 31))
+ out[3 + outpos] = (((in[1 + inpos] >>> 4) & 4095))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[0 + inpos] >>> 20) & 31))
+ out[4 + outpos] = (((in[1 + inpos] >>> 16) & 4095))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[0 + inpos] >>> 25) & 31))
+ out[5 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 255) << (12 - 8)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 7) << (5 - 3)))
+ out[6 + outpos] = (((in[2 + inpos] >>> 8) & 4095))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[1 + inpos] >>> 3) & 31))
+ out[7 + outpos] = ((in[2 + inpos] >>> 20))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[1 + inpos] >>> 8) & 31))
+ out[8 + outpos] = (((in[3 + inpos] >>> 0) & 4095))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[1 + inpos] >>> 13) & 31))
+ out[9 + outpos] = (((in[3 + inpos] >>> 12) & 4095))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[1 + inpos] >>> 18) & 31))
+ out[10 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 15) << (12 - 4)))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[1 + inpos] >>> 23) & 31))
+ out[11 + outpos] = (((in[4 + inpos] >>> 4) & 4095))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 1) << (5 - 1)))
+ out[12 + outpos] = (((in[4 + inpos] >>> 16) & 4095))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[2 + inpos] >>> 1) & 31))
+ out[13 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 255) << (12 - 8)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[2 + inpos] >>> 6) & 31))
+ out[14 + outpos] = (((in[5 + inpos] >>> 8) & 4095))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[2 + inpos] >>> 11) & 31))
+ out[15 + outpos] = ((in[5 + inpos] >>> 20))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[2 + inpos] >>> 16) & 31))
+ out[16 + outpos] = (((in[6 + inpos] >>> 0) & 4095))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[2 + inpos] >>> 21) & 31))
+ out[17 + outpos] = (((in[6 + inpos] >>> 12) & 4095))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[2 + inpos] >>> 26) & 31))
+ out[18 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 15) << (12 - 4)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[2 + inpos] >>> 31) | ((in[3 + inpos] & 15) << (5 - 4)))
+ out[19 + outpos] = (((in[7 + inpos] >>> 4) & 4095))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[3 + inpos] >>> 4) & 31))
+ out[20 + outpos] = (((in[7 + inpos] >>> 16) & 4095))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[3 + inpos] >>> 9) & 31))
+ out[21 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 255) << (12 - 8)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[3 + inpos] >>> 14) & 31))
+ out[22 + outpos] = (((in[8 + inpos] >>> 8) & 4095))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[3 + inpos] >>> 19) & 31))
+ out[23 + outpos] = ((in[8 + inpos] >>> 20))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[3 + inpos] >>> 24) & 31))
+ out[24 + outpos] = (((in[9 + inpos] >>> 0) & 4095))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[3 + inpos] >>> 29) | ((in[4 + inpos] & 3) << (5 - 2)))
+ out[25 + outpos] = (((in[9 + inpos] >>> 12) & 4095))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[4 + inpos] >>> 2) & 31))
+ out[26 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 15) << (12 - 4)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[4 + inpos] >>> 7) & 31))
+ out[27 + outpos] = (((in[10 + inpos] >>> 4) & 4095))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[4 + inpos] >>> 12) & 31))
+ out[28 + outpos] = (((in[10 + inpos] >>> 16) & 4095))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[4 + inpos] >>> 17) & 31))
+ out[29 + outpos] = ((in[10 + inpos] >>> 28) | ((in[11 + inpos] & 255) << (12 - 8)))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[4 + inpos] >>> 22) & 31))
+ out[30 + outpos] = (((in[11 + inpos] >>> 8) & 4095))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[4 + inpos] >>> 27))
+ out[31 + outpos] = ((in[11 + inpos] >>> 20))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack6(final int initoffset,
+ protected static void integratedunpack13(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 63)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 6) & 63))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 8191)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 13) & 8191))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 12) & 63))
+ out[2 + outpos] = ((in[0 + inpos] >>> 26) | ((in[1 + inpos] & 127) << (13 - 7)))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 18) & 63))
+ out[3 + outpos] = (((in[1 + inpos] >>> 7) & 8191))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[0 + inpos] >>> 24) & 63))
+ out[4 + outpos] = ((in[1 + inpos] >>> 20) | ((in[2 + inpos] & 1) << (13 - 1)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 15) << (6 - 4)))
+ out[5 + outpos] = (((in[2 + inpos] >>> 1) & 8191))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[1 + inpos] >>> 4) & 63))
+ out[6 + outpos] = (((in[2 + inpos] >>> 14) & 8191))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[1 + inpos] >>> 10) & 63))
+ out[7 + outpos] = ((in[2 + inpos] >>> 27) | ((in[3 + inpos] & 255) << (13 - 8)))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[1 + inpos] >>> 16) & 63))
+ out[8 + outpos] = (((in[3 + inpos] >>> 8) & 8191))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[1 + inpos] >>> 22) & 63))
+ out[9 + outpos] = ((in[3 + inpos] >>> 21) | ((in[4 + inpos] & 3) << (13 - 2)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 3) << (6 - 2)))
+ out[10 + outpos] = (((in[4 + inpos] >>> 2) & 8191))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[2 + inpos] >>> 2) & 63))
+ out[11 + outpos] = (((in[4 + inpos] >>> 15) & 8191))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[2 + inpos] >>> 8) & 63))
+ out[12 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 511) << (13 - 9)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[2 + inpos] >>> 14) & 63))
+ out[13 + outpos] = (((in[5 + inpos] >>> 9) & 8191))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[2 + inpos] >>> 20) & 63))
+ out[14 + outpos] = ((in[5 + inpos] >>> 22) | ((in[6 + inpos] & 7) << (13 - 3)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[2 + inpos] >>> 26))
+ out[15 + outpos] = (((in[6 + inpos] >>> 3) & 8191))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[3 + inpos] >>> 0) & 63))
+ out[16 + outpos] = (((in[6 + inpos] >>> 16) & 8191))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[3 + inpos] >>> 6) & 63))
+ out[17 + outpos] = ((in[6 + inpos] >>> 29) | ((in[7 + inpos] & 1023) << (13 - 10)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[3 + inpos] >>> 12) & 63))
+ out[18 + outpos] = (((in[7 + inpos] >>> 10) & 8191))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[3 + inpos] >>> 18) & 63))
+ out[19 + outpos] = ((in[7 + inpos] >>> 23) | ((in[8 + inpos] & 15) << (13 - 4)))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[3 + inpos] >>> 24) & 63))
+ out[20 + outpos] = (((in[8 + inpos] >>> 4) & 8191))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 15) << (6 - 4)))
+ out[21 + outpos] = (((in[8 + inpos] >>> 17) & 8191))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[4 + inpos] >>> 4) & 63))
+ out[22 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 2047) << (13 - 11)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[4 + inpos] >>> 10) & 63))
+ out[23 + outpos] = (((in[9 + inpos] >>> 11) & 8191))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[4 + inpos] >>> 16) & 63))
+ out[24 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 31) << (13 - 5)))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[4 + inpos] >>> 22) & 63))
+ out[25 + outpos] = (((in[10 + inpos] >>> 5) & 8191))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 3) << (6 - 2)))
+ out[26 + outpos] = (((in[10 + inpos] >>> 18) & 8191))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[5 + inpos] >>> 2) & 63))
+ out[27 + outpos] = ((in[10 + inpos] >>> 31) | ((in[11 + inpos] & 4095) << (13 - 12)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[5 + inpos] >>> 8) & 63))
+ out[28 + outpos] = (((in[11 + inpos] >>> 12) & 8191))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[5 + inpos] >>> 14) & 63))
+ out[29 + outpos] = ((in[11 + inpos] >>> 25) | ((in[12 + inpos] & 63) << (13 - 6)))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[5 + inpos] >>> 20) & 63))
+ out[30 + outpos] = (((in[12 + inpos] >>> 6) & 8191))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[5 + inpos] >>> 26))
+ out[31 + outpos] = ((in[12 + inpos] >>> 19))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack7(final int initoffset,
+ protected static void integratedunpack14(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 127)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 7) & 127))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 16383))
+ + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 14) & 16383))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 14) & 127))
+ out[2 + outpos] = ((in[0 + inpos] >>> 28) | ((in[1 + inpos] & 1023) << (14 - 10)))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[0 + inpos] >>> 21) & 127))
+ out[3 + outpos] = (((in[1 + inpos] >>> 10) & 16383))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[0 + inpos] >>> 28) | ((in[1 + inpos] & 7) << (7 - 3)))
+ out[4 + outpos] = ((in[1 + inpos] >>> 24) | ((in[2 + inpos] & 63) << (14 - 6)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[1 + inpos] >>> 3) & 127))
+ out[5 + outpos] = (((in[2 + inpos] >>> 6) & 16383))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[1 + inpos] >>> 10) & 127))
+ out[6 + outpos] = ((in[2 + inpos] >>> 20) | ((in[3 + inpos] & 3) << (14 - 2)))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[1 + inpos] >>> 17) & 127))
+ out[7 + outpos] = (((in[3 + inpos] >>> 2) & 16383))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[1 + inpos] >>> 24) & 127))
+ out[8 + outpos] = (((in[3 + inpos] >>> 16) & 16383))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 63) << (7 - 6)))
+ out[9 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 4095) << (14 - 12)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[2 + inpos] >>> 6) & 127))
+ out[10 + outpos] = (((in[4 + inpos] >>> 12) & 16383))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[2 + inpos] >>> 13) & 127))
+ out[11 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 255) << (14 - 8)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[2 + inpos] >>> 20) & 127))
+ out[12 + outpos] = (((in[5 + inpos] >>> 8) & 16383))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[2 + inpos] >>> 27) | ((in[3 + inpos] & 3) << (7 - 2)))
+ out[13 + outpos] = ((in[5 + inpos] >>> 22) | ((in[6 + inpos] & 15) << (14 - 4)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[3 + inpos] >>> 2) & 127))
+ out[14 + outpos] = (((in[6 + inpos] >>> 4) & 16383))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[3 + inpos] >>> 9) & 127))
+ out[15 + outpos] = ((in[6 + inpos] >>> 18))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[3 + inpos] >>> 16) & 127))
+ out[16 + outpos] = (((in[7 + inpos] >>> 0) & 16383))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[3 + inpos] >>> 23) & 127))
+ out[17 + outpos] = (((in[7 + inpos] >>> 14) & 16383))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 31) << (7 - 5)))
+ out[18 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 1023) << (14 - 10)))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[4 + inpos] >>> 5) & 127))
+ out[19 + outpos] = (((in[8 + inpos] >>> 10) & 16383))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[4 + inpos] >>> 12) & 127))
+ out[20 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 63) << (14 - 6)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[4 + inpos] >>> 19) & 127))
+ out[21 + outpos] = (((in[9 + inpos] >>> 6) & 16383))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 1) << (7 - 1)))
+ out[22 + outpos] = ((in[9 + inpos] >>> 20) | ((in[10 + inpos] & 3) << (14 - 2)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[5 + inpos] >>> 1) & 127))
+ out[23 + outpos] = (((in[10 + inpos] >>> 2) & 16383))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[5 + inpos] >>> 8) & 127))
+ out[24 + outpos] = (((in[10 + inpos] >>> 16) & 16383))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[5 + inpos] >>> 15) & 127))
+ out[25 + outpos] = ((in[10 + inpos] >>> 30) | ((in[11 + inpos] & 4095) << (14 - 12)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[5 + inpos] >>> 22) & 127))
+ out[26 + outpos] = (((in[11 + inpos] >>> 12) & 16383))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 15) << (7 - 4)))
+ out[27 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 255) << (14 - 8)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[6 + inpos] >>> 4) & 127))
+ out[28 + outpos] = (((in[12 + inpos] >>> 8) & 16383))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[6 + inpos] >>> 11) & 127))
+ out[29 + outpos] = ((in[12 + inpos] >>> 22) | ((in[13 + inpos] & 15) << (14 - 4)))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[6 + inpos] >>> 18) & 127))
+ out[30 + outpos] = (((in[13 + inpos] >>> 4) & 16383))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[6 + inpos] >>> 25))
+ out[31 + outpos] = ((in[13 + inpos] >>> 18))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack8(final int initoffset,
+ protected static void integratedunpack15(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 255)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 8) & 255))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 32767))
+ + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 15) & 32767))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 16) & 255))
+ out[2 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 8191) << (15 - 13)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[0 + inpos] >>> 24))
+ out[3 + outpos] = (((in[1 + inpos] >>> 13) & 32767))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[1 + inpos] >>> 0) & 255))
+ out[4 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 2047) << (15 - 11)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[1 + inpos] >>> 8) & 255))
+ out[5 + outpos] = (((in[2 + inpos] >>> 11) & 32767))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[1 + inpos] >>> 16) & 255))
+ out[6 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 511) << (15 - 9)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[1 + inpos] >>> 24))
+ out[7 + outpos] = (((in[3 + inpos] >>> 9) & 32767))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[2 + inpos] >>> 0) & 255))
+ out[8 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 127) << (15 - 7)))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[2 + inpos] >>> 8) & 255))
+ out[9 + outpos] = (((in[4 + inpos] >>> 7) & 32767))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[2 + inpos] >>> 16) & 255))
+ out[10 + outpos] = ((in[4 + inpos] >>> 22) | ((in[5 + inpos] & 31) << (15 - 5)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[2 + inpos] >>> 24))
+ out[11 + outpos] = (((in[5 + inpos] >>> 5) & 32767))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[3 + inpos] >>> 0) & 255))
+ out[12 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 7) << (15 - 3)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[3 + inpos] >>> 8) & 255))
+ out[13 + outpos] = (((in[6 + inpos] >>> 3) & 32767))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[3 + inpos] >>> 16) & 255))
+ out[14 + outpos] = ((in[6 + inpos] >>> 18) | ((in[7 + inpos] & 1) << (15 - 1)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[3 + inpos] >>> 24))
+ out[15 + outpos] = (((in[7 + inpos] >>> 1) & 32767))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[4 + inpos] >>> 0) & 255))
+ out[16 + outpos] = (((in[7 + inpos] >>> 16) & 32767))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[4 + inpos] >>> 8) & 255))
+ out[17 + outpos] = ((in[7 + inpos] >>> 31) | ((in[8 + inpos] & 16383) << (15 - 14)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[4 + inpos] >>> 16) & 255))
+ out[18 + outpos] = (((in[8 + inpos] >>> 14) & 32767))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[4 + inpos] >>> 24))
+ out[19 + outpos] = ((in[8 + inpos] >>> 29) | ((in[9 + inpos] & 4095) << (15 - 12)))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[5 + inpos] >>> 0) & 255))
+ out[20 + outpos] = (((in[9 + inpos] >>> 12) & 32767))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[5 + inpos] >>> 8) & 255))
+ out[21 + outpos] = ((in[9 + inpos] >>> 27) | ((in[10 + inpos] & 1023) << (15 - 10)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[5 + inpos] >>> 16) & 255))
+ out[22 + outpos] = (((in[10 + inpos] >>> 10) & 32767))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[5 + inpos] >>> 24))
+ out[23 + outpos] = ((in[10 + inpos] >>> 25) | ((in[11 + inpos] & 255) << (15 - 8)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[6 + inpos] >>> 0) & 255))
+ out[24 + outpos] = (((in[11 + inpos] >>> 8) & 32767))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[6 + inpos] >>> 8) & 255))
+ out[25 + outpos] = ((in[11 + inpos] >>> 23) | ((in[12 + inpos] & 63) << (15 - 6)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[6 + inpos] >>> 16) & 255))
+ out[26 + outpos] = (((in[12 + inpos] >>> 6) & 32767))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[6 + inpos] >>> 24))
+ out[27 + outpos] = ((in[12 + inpos] >>> 21) | ((in[13 + inpos] & 15) << (15 - 4)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[7 + inpos] >>> 0) & 255))
+ out[28 + outpos] = (((in[13 + inpos] >>> 4) & 32767))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[7 + inpos] >>> 8) & 255))
+ out[29 + outpos] = ((in[13 + inpos] >>> 19) | ((in[14 + inpos] & 3) << (15 - 2)))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[7 + inpos] >>> 16) & 255))
+ out[30 + outpos] = (((in[14 + inpos] >>> 2) & 32767))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[7 + inpos] >>> 24))
+ out[31 + outpos] = ((in[14 + inpos] >>> 17))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack9(final int initoffset,
+ protected static void integratedunpack16(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 511)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 9) & 511))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 65535))
+ + initoffset;
+ out[1 + outpos] = ((in[0 + inpos] >>> 16))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 18) & 511))
+ out[2 + outpos] = (((in[1 + inpos] >>> 0) & 65535))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[0 + inpos] >>> 27) | ((in[1 + inpos] & 15) << (9 - 4)))
+ out[3 + outpos] = ((in[1 + inpos] >>> 16))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[1 + inpos] >>> 4) & 511))
+ out[4 + outpos] = (((in[2 + inpos] >>> 0) & 65535))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[1 + inpos] >>> 13) & 511))
+ out[5 + outpos] = ((in[2 + inpos] >>> 16))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[1 + inpos] >>> 22) & 511))
+ out[6 + outpos] = (((in[3 + inpos] >>> 0) & 65535))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 255) << (9 - 8)))
+ out[7 + outpos] = ((in[3 + inpos] >>> 16))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[2 + inpos] >>> 8) & 511))
+ out[8 + outpos] = (((in[4 + inpos] >>> 0) & 65535))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[2 + inpos] >>> 17) & 511))
+ out[9 + outpos] = ((in[4 + inpos] >>> 16))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 7) << (9 - 3)))
+ out[10 + outpos] = (((in[5 + inpos] >>> 0) & 65535))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[3 + inpos] >>> 3) & 511))
+ out[11 + outpos] = ((in[5 + inpos] >>> 16))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[3 + inpos] >>> 12) & 511))
+ out[12 + outpos] = (((in[6 + inpos] >>> 0) & 65535))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[3 + inpos] >>> 21) & 511))
+ out[13 + outpos] = ((in[6 + inpos] >>> 16))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 127) << (9 - 7)))
+ out[14 + outpos] = (((in[7 + inpos] >>> 0) & 65535))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[4 + inpos] >>> 7) & 511))
+ out[15 + outpos] = ((in[7 + inpos] >>> 16))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[4 + inpos] >>> 16) & 511))
+ out[16 + outpos] = (((in[8 + inpos] >>> 0) & 65535))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[4 + inpos] >>> 25) | ((in[5 + inpos] & 3) << (9 - 2)))
+ out[17 + outpos] = ((in[8 + inpos] >>> 16))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[5 + inpos] >>> 2) & 511))
+ out[18 + outpos] = (((in[9 + inpos] >>> 0) & 65535))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[5 + inpos] >>> 11) & 511))
+ out[19 + outpos] = ((in[9 + inpos] >>> 16))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[5 + inpos] >>> 20) & 511))
+ out[20 + outpos] = (((in[10 + inpos] >>> 0) & 65535))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 63) << (9 - 6)))
+ out[21 + outpos] = ((in[10 + inpos] >>> 16))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[6 + inpos] >>> 6) & 511))
+ out[22 + outpos] = (((in[11 + inpos] >>> 0) & 65535))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[6 + inpos] >>> 15) & 511))
+ out[23 + outpos] = ((in[11 + inpos] >>> 16))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 1) << (9 - 1)))
+ out[24 + outpos] = (((in[12 + inpos] >>> 0) & 65535))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[7 + inpos] >>> 1) & 511))
+ out[25 + outpos] = ((in[12 + inpos] >>> 16))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[7 + inpos] >>> 10) & 511))
+ out[26 + outpos] = (((in[13 + inpos] >>> 0) & 65535))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[7 + inpos] >>> 19) & 511))
+ out[27 + outpos] = ((in[13 + inpos] >>> 16))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 31) << (9 - 5)))
+ out[28 + outpos] = (((in[14 + inpos] >>> 0) & 65535))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[8 + inpos] >>> 5) & 511))
+ out[29 + outpos] = ((in[14 + inpos] >>> 16))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[8 + inpos] >>> 14) & 511))
+ out[30 + outpos] = (((in[15 + inpos] >>> 0) & 65535))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[8 + inpos] >>> 23))
+ out[31 + outpos] = ((in[15 + inpos] >>> 16))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack10(final int initoffset,
+ protected static void integratedunpack17(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1023)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 10) & 1023))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 131071))
+ + initoffset;
+ out[1 + outpos] = ((in[0 + inpos] >>> 17) | ((in[1 + inpos] & 3) << (17 - 2)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[0 + inpos] >>> 20) & 1023))
+ out[2 + outpos] = (((in[1 + inpos] >>> 2) & 131071))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 255) << (10 - 8)))
+ out[3 + outpos] = ((in[1 + inpos] >>> 19) | ((in[2 + inpos] & 15) << (17 - 4)))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[1 + inpos] >>> 8) & 1023))
+ out[4 + outpos] = (((in[2 + inpos] >>> 4) & 131071))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[1 + inpos] >>> 18) & 1023))
+ out[5 + outpos] = ((in[2 + inpos] >>> 21) | ((in[3 + inpos] & 63) << (17 - 6)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 63) << (10 - 6)))
+ out[6 + outpos] = (((in[3 + inpos] >>> 6) & 131071))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[2 + inpos] >>> 6) & 1023))
+ out[7 + outpos] = ((in[3 + inpos] >>> 23) | ((in[4 + inpos] & 255) << (17 - 8)))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[2 + inpos] >>> 16) & 1023))
+ out[8 + outpos] = (((in[4 + inpos] >>> 8) & 131071))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 15) << (10 - 4)))
+ out[9 + outpos] = ((in[4 + inpos] >>> 25) | ((in[5 + inpos] & 1023) << (17 - 10)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[3 + inpos] >>> 4) & 1023))
+ out[10 + outpos] = (((in[5 + inpos] >>> 10) & 131071))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[3 + inpos] >>> 14) & 1023))
+ out[11 + outpos] = ((in[5 + inpos] >>> 27) | ((in[6 + inpos] & 4095) << (17 - 12)))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 3) << (10 - 2)))
+ out[12 + outpos] = (((in[6 + inpos] >>> 12) & 131071))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[4 + inpos] >>> 2) & 1023))
+ out[13 + outpos] = ((in[6 + inpos] >>> 29) | ((in[7 + inpos] & 16383) << (17 - 14)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[4 + inpos] >>> 12) & 1023))
+ out[14 + outpos] = (((in[7 + inpos] >>> 14) & 131071))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[4 + inpos] >>> 22))
+ out[15 + outpos] = ((in[7 + inpos] >>> 31) | ((in[8 + inpos] & 65535) << (17 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[5 + inpos] >>> 0) & 1023))
+ out[16 + outpos] = ((in[8 + inpos] >>> 16) | ((in[9 + inpos] & 1) << (17 - 1)))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[5 + inpos] >>> 10) & 1023))
+ out[17 + outpos] = (((in[9 + inpos] >>> 1) & 131071))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[5 + inpos] >>> 20) & 1023))
+ out[18 + outpos] = ((in[9 + inpos] >>> 18) | ((in[10 + inpos] & 7) << (17 - 3)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[5 + inpos] >>> 30) | ((in[6 + inpos] & 255) << (10 - 8)))
+ out[19 + outpos] = (((in[10 + inpos] >>> 3) & 131071))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[6 + inpos] >>> 8) & 1023))
+ out[20 + outpos] = ((in[10 + inpos] >>> 20) | ((in[11 + inpos] & 31) << (17 - 5)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[6 + inpos] >>> 18) & 1023))
+ out[21 + outpos] = (((in[11 + inpos] >>> 5) & 131071))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 63) << (10 - 6)))
+ out[22 + outpos] = ((in[11 + inpos] >>> 22) | ((in[12 + inpos] & 127) << (17 - 7)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[7 + inpos] >>> 6) & 1023))
+ out[23 + outpos] = (((in[12 + inpos] >>> 7) & 131071))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[7 + inpos] >>> 16) & 1023))
+ out[24 + outpos] = ((in[12 + inpos] >>> 24) | ((in[13 + inpos] & 511) << (17 - 9)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[7 + inpos] >>> 26) | ((in[8 + inpos] & 15) << (10 - 4)))
+ out[25 + outpos] = (((in[13 + inpos] >>> 9) & 131071))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[8 + inpos] >>> 4) & 1023))
+ out[26 + outpos] = ((in[13 + inpos] >>> 26) | ((in[14 + inpos] & 2047) << (17 - 11)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[8 + inpos] >>> 14) & 1023))
+ out[27 + outpos] = (((in[14 + inpos] >>> 11) & 131071))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 3) << (10 - 2)))
+ out[28 + outpos] = ((in[14 + inpos] >>> 28) | ((in[15 + inpos] & 8191) << (17 - 13)))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[9 + inpos] >>> 2) & 1023))
+ out[29 + outpos] = (((in[15 + inpos] >>> 13) & 131071))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[9 + inpos] >>> 12) & 1023))
+ out[30 + outpos] = ((in[15 + inpos] >>> 30) | ((in[16 + inpos] & 32767) << (17 - 15)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[9 + inpos] >>> 22))
+ out[31 + outpos] = ((in[16 + inpos] >>> 15))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack11(final int initoffset,
+ protected static void integratedunpack18(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 2047)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 11) & 2047))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 262143))
+ + initoffset;
+ out[1 + outpos] = ((in[0 + inpos] >>> 18) | ((in[1 + inpos] & 15) << (18 - 4)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[0 + inpos] >>> 22) | ((in[1 + inpos] & 1) << (11 - 1)))
+ out[2 + outpos] = (((in[1 + inpos] >>> 4) & 262143))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[1 + inpos] >>> 1) & 2047))
+ out[3 + outpos] = ((in[1 + inpos] >>> 22) | ((in[2 + inpos] & 255) << (18 - 8)))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[1 + inpos] >>> 12) & 2047))
+ out[4 + outpos] = (((in[2 + inpos] >>> 8) & 262143))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[1 + inpos] >>> 23) | ((in[2 + inpos] & 3) << (11 - 2)))
+ out[5 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 4095) << (18 - 12)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[2 + inpos] >>> 2) & 2047))
+ out[6 + outpos] = (((in[3 + inpos] >>> 12) & 262143))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[2 + inpos] >>> 13) & 2047))
+ out[7 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 65535) << (18 - 16)))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[2 + inpos] >>> 24) | ((in[3 + inpos] & 7) << (11 - 3)))
+ out[8 + outpos] = ((in[4 + inpos] >>> 16) | ((in[5 + inpos] & 3) << (18 - 2)))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[3 + inpos] >>> 3) & 2047))
+ out[9 + outpos] = (((in[5 + inpos] >>> 2) & 262143))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[3 + inpos] >>> 14) & 2047))
+ out[10 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 63) << (18 - 6)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[3 + inpos] >>> 25) | ((in[4 + inpos] & 15) << (11 - 4)))
+ out[11 + outpos] = (((in[6 + inpos] >>> 6) & 262143))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[4 + inpos] >>> 4) & 2047))
+ out[12 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 1023) << (18 - 10)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[4 + inpos] >>> 15) & 2047))
+ out[13 + outpos] = (((in[7 + inpos] >>> 10) & 262143))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 31) << (11 - 5)))
+ out[14 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 16383) << (18 - 14)))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[5 + inpos] >>> 5) & 2047))
+ out[15 + outpos] = ((in[8 + inpos] >>> 14))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[5 + inpos] >>> 16) & 2047))
+ out[16 + outpos] = (((in[9 + inpos] >>> 0) & 262143))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[5 + inpos] >>> 27) | ((in[6 + inpos] & 63) << (11 - 6)))
+ out[17 + outpos] = ((in[9 + inpos] >>> 18) | ((in[10 + inpos] & 15) << (18 - 4)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[6 + inpos] >>> 6) & 2047))
+ out[18 + outpos] = (((in[10 + inpos] >>> 4) & 262143))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[6 + inpos] >>> 17) & 2047))
+ out[19 + outpos] = ((in[10 + inpos] >>> 22) | ((in[11 + inpos] & 255) << (18 - 8)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 127) << (11 - 7)))
+ out[20 + outpos] = (((in[11 + inpos] >>> 8) & 262143))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[7 + inpos] >>> 7) & 2047))
+ out[21 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 4095) << (18 - 12)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[7 + inpos] >>> 18) & 2047))
+ out[22 + outpos] = (((in[12 + inpos] >>> 12) & 262143))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[7 + inpos] >>> 29) | ((in[8 + inpos] & 255) << (11 - 8)))
+ out[23 + outpos] = ((in[12 + inpos] >>> 30) | ((in[13 + inpos] & 65535) << (18 - 16)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[8 + inpos] >>> 8) & 2047))
+ out[24 + outpos] = ((in[13 + inpos] >>> 16) | ((in[14 + inpos] & 3) << (18 - 2)))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[8 + inpos] >>> 19) & 2047))
+ out[25 + outpos] = (((in[14 + inpos] >>> 2) & 262143))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 511) << (11 - 9)))
+ out[26 + outpos] = ((in[14 + inpos] >>> 20) | ((in[15 + inpos] & 63) << (18 - 6)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[9 + inpos] >>> 9) & 2047))
+ out[27 + outpos] = (((in[15 + inpos] >>> 6) & 262143))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[9 + inpos] >>> 20) & 2047))
+ out[28 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 1023) << (18 - 10)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[9 + inpos] >>> 31) | ((in[10 + inpos] & 1023) << (11 - 10)))
+ out[29 + outpos] = (((in[16 + inpos] >>> 10) & 262143))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[10 + inpos] >>> 10) & 2047))
+ out[30 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 16383) << (18 - 14)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[10 + inpos] >>> 21))
+ out[31 + outpos] = ((in[17 + inpos] >>> 14))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack12(final int initoffset,
+ protected static void integratedunpack19(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 4095)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 12) & 4095))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 524287))
+ + initoffset;
+ out[1 + outpos] = ((in[0 + inpos] >>> 19) | ((in[1 + inpos] & 63) << (19 - 6)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[0 + inpos] >>> 24) | ((in[1 + inpos] & 15) << (12 - 4)))
+ out[2 + outpos] = (((in[1 + inpos] >>> 6) & 524287))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[1 + inpos] >>> 4) & 4095))
+ out[3 + outpos] = ((in[1 + inpos] >>> 25) | ((in[2 + inpos] & 4095) << (19 - 12)))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[1 + inpos] >>> 16) & 4095))
+ out[4 + outpos] = (((in[2 + inpos] >>> 12) & 524287))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 255) << (12 - 8)))
+ out[5 + outpos] = ((in[2 + inpos] >>> 31) | ((in[3 + inpos] & 262143) << (19 - 18)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[2 + inpos] >>> 8) & 4095))
+ out[6 + outpos] = ((in[3 + inpos] >>> 18) | ((in[4 + inpos] & 31) << (19 - 5)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[2 + inpos] >>> 20))
+ out[7 + outpos] = (((in[4 + inpos] >>> 5) & 524287))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[3 + inpos] >>> 0) & 4095))
+ out[8 + outpos] = ((in[4 + inpos] >>> 24) | ((in[5 + inpos] & 2047) << (19 - 11)))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[3 + inpos] >>> 12) & 4095))
+ out[9 + outpos] = (((in[5 + inpos] >>> 11) & 524287))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 15) << (12 - 4)))
+ out[10 + outpos] = ((in[5 + inpos] >>> 30) | ((in[6 + inpos] & 131071) << (19 - 17)))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[4 + inpos] >>> 4) & 4095))
+ out[11 + outpos] = ((in[6 + inpos] >>> 17) | ((in[7 + inpos] & 15) << (19 - 4)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[4 + inpos] >>> 16) & 4095))
+ out[12 + outpos] = (((in[7 + inpos] >>> 4) & 524287))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 255) << (12 - 8)))
+ out[13 + outpos] = ((in[7 + inpos] >>> 23) | ((in[8 + inpos] & 1023) << (19 - 10)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[5 + inpos] >>> 8) & 4095))
+ out[14 + outpos] = (((in[8 + inpos] >>> 10) & 524287))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[5 + inpos] >>> 20))
+ out[15 + outpos] = ((in[8 + inpos] >>> 29) | ((in[9 + inpos] & 65535) << (19 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[6 + inpos] >>> 0) & 4095))
+ out[16 + outpos] = ((in[9 + inpos] >>> 16) | ((in[10 + inpos] & 7) << (19 - 3)))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[6 + inpos] >>> 12) & 4095))
+ out[17 + outpos] = (((in[10 + inpos] >>> 3) & 524287))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 15) << (12 - 4)))
+ out[18 + outpos] = ((in[10 + inpos] >>> 22) | ((in[11 + inpos] & 511) << (19 - 9)))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[7 + inpos] >>> 4) & 4095))
+ out[19 + outpos] = (((in[11 + inpos] >>> 9) & 524287))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[7 + inpos] >>> 16) & 4095))
+ out[20 + outpos] = ((in[11 + inpos] >>> 28) | ((in[12 + inpos] & 32767) << (19 - 15)))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 255) << (12 - 8)))
+ out[21 + outpos] = ((in[12 + inpos] >>> 15) | ((in[13 + inpos] & 3) << (19 - 2)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[8 + inpos] >>> 8) & 4095))
+ out[22 + outpos] = (((in[13 + inpos] >>> 2) & 524287))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[8 + inpos] >>> 20))
+ out[23 + outpos] = ((in[13 + inpos] >>> 21) | ((in[14 + inpos] & 255) << (19 - 8)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[9 + inpos] >>> 0) & 4095))
+ out[24 + outpos] = (((in[14 + inpos] >>> 8) & 524287))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[9 + inpos] >>> 12) & 4095))
+ out[25 + outpos] = ((in[14 + inpos] >>> 27) | ((in[15 + inpos] & 16383) << (19 - 14)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 15) << (12 - 4)))
+ out[26 + outpos] = ((in[15 + inpos] >>> 14) | ((in[16 + inpos] & 1) << (19 - 1)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[10 + inpos] >>> 4) & 4095))
+ out[27 + outpos] = (((in[16 + inpos] >>> 1) & 524287))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[10 + inpos] >>> 16) & 4095))
+ out[28 + outpos] = ((in[16 + inpos] >>> 20) | ((in[17 + inpos] & 127) << (19 - 7)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[10 + inpos] >>> 28) | ((in[11 + inpos] & 255) << (12 - 8)))
+ out[29 + outpos] = (((in[17 + inpos] >>> 7) & 524287))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[11 + inpos] >>> 8) & 4095))
+ out[30 + outpos] = ((in[17 + inpos] >>> 26) | ((in[18 + inpos] & 8191) << (19 - 13)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[11 + inpos] >>> 20))
+ out[31 + outpos] = ((in[18 + inpos] >>> 13))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack13(final int initoffset,
+ protected static void integratedunpack2(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 8191)) + initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 13) & 8191))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 3)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 2) & 3))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[0 + inpos] >>> 26) | ((in[1 + inpos] & 127) << (13 - 7)))
+ out[2 + outpos] = (((in[0 + inpos] >>> 4) & 3))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[1 + inpos] >>> 7) & 8191))
+ out[3 + outpos] = (((in[0 + inpos] >>> 6) & 3))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[1 + inpos] >>> 20) | ((in[2 + inpos] & 1) << (13 - 1)))
+ out[4 + outpos] = (((in[0 + inpos] >>> 8) & 3))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[2 + inpos] >>> 1) & 8191))
+ out[5 + outpos] = (((in[0 + inpos] >>> 10) & 3))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[2 + inpos] >>> 14) & 8191))
+ out[6 + outpos] = (((in[0 + inpos] >>> 12) & 3))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[2 + inpos] >>> 27) | ((in[3 + inpos] & 255) << (13 - 8)))
+ out[7 + outpos] = (((in[0 + inpos] >>> 14) & 3))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[3 + inpos] >>> 8) & 8191))
+ out[8 + outpos] = (((in[0 + inpos] >>> 16) & 3))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[3 + inpos] >>> 21) | ((in[4 + inpos] & 3) << (13 - 2)))
+ out[9 + outpos] = (((in[0 + inpos] >>> 18) & 3))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[4 + inpos] >>> 2) & 8191))
+ out[10 + outpos] = (((in[0 + inpos] >>> 20) & 3))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[4 + inpos] >>> 15) & 8191))
+ out[11 + outpos] = (((in[0 + inpos] >>> 22) & 3))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 511) << (13 - 9)))
+ out[12 + outpos] = (((in[0 + inpos] >>> 24) & 3))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[5 + inpos] >>> 9) & 8191))
+ out[13 + outpos] = (((in[0 + inpos] >>> 26) & 3))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[5 + inpos] >>> 22) | ((in[6 + inpos] & 7) << (13 - 3)))
+ out[14 + outpos] = (((in[0 + inpos] >>> 28) & 3))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[6 + inpos] >>> 3) & 8191))
+ out[15 + outpos] = ((in[0 + inpos] >>> 30))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[6 + inpos] >>> 16) & 8191))
+ out[16 + outpos] = (((in[1 + inpos] >>> 0) & 3))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[6 + inpos] >>> 29) | ((in[7 + inpos] & 1023) << (13 - 10)))
+ out[17 + outpos] = (((in[1 + inpos] >>> 2) & 3))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[7 + inpos] >>> 10) & 8191))
+ out[18 + outpos] = (((in[1 + inpos] >>> 4) & 3))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[7 + inpos] >>> 23) | ((in[8 + inpos] & 15) << (13 - 4)))
+ out[19 + outpos] = (((in[1 + inpos] >>> 6) & 3))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[8 + inpos] >>> 4) & 8191))
+ out[20 + outpos] = (((in[1 + inpos] >>> 8) & 3))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[8 + inpos] >>> 17) & 8191))
+ out[21 + outpos] = (((in[1 + inpos] >>> 10) & 3))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 2047) << (13 - 11)))
+ out[22 + outpos] = (((in[1 + inpos] >>> 12) & 3))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[9 + inpos] >>> 11) & 8191))
+ out[23 + outpos] = (((in[1 + inpos] >>> 14) & 3))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 31) << (13 - 5)))
+ out[24 + outpos] = (((in[1 + inpos] >>> 16) & 3))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[10 + inpos] >>> 5) & 8191))
+ out[25 + outpos] = (((in[1 + inpos] >>> 18) & 3))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[10 + inpos] >>> 18) & 8191))
+ out[26 + outpos] = (((in[1 + inpos] >>> 20) & 3))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[10 + inpos] >>> 31) | ((in[11 + inpos] & 4095) << (13 - 12)))
+ out[27 + outpos] = (((in[1 + inpos] >>> 22) & 3))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[11 + inpos] >>> 12) & 8191))
+ out[28 + outpos] = (((in[1 + inpos] >>> 24) & 3))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[11 + inpos] >>> 25) | ((in[12 + inpos] & 63) << (13 - 6)))
+ out[29 + outpos] = (((in[1 + inpos] >>> 26) & 3))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[12 + inpos] >>> 6) & 8191))
+ out[30 + outpos] = (((in[1 + inpos] >>> 28) & 3))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[12 + inpos] >>> 19))
+ out[31 + outpos] = ((in[1 + inpos] >>> 30))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack14(final int initoffset,
+ protected static void integratedunpack20(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 16383))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1048575))
+ initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 14) & 16383))
+ out[1 + outpos] = ((in[0 + inpos] >>> 20) | ((in[1 + inpos] & 255) << (20 - 8)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[0 + inpos] >>> 28) | ((in[1 + inpos] & 1023) << (14 - 10)))
+ out[2 + outpos] = (((in[1 + inpos] >>> 8) & 1048575))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[1 + inpos] >>> 10) & 16383))
+ out[3 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 65535) << (20 - 16)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[1 + inpos] >>> 24) | ((in[2 + inpos] & 63) << (14 - 6)))
+ out[4 + outpos] = ((in[2 + inpos] >>> 16) | ((in[3 + inpos] & 15) << (20 - 4)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[2 + inpos] >>> 6) & 16383))
+ out[5 + outpos] = (((in[3 + inpos] >>> 4) & 1048575))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[2 + inpos] >>> 20) | ((in[3 + inpos] & 3) << (14 - 2)))
+ out[6 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 4095) << (20 - 12)))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[3 + inpos] >>> 2) & 16383))
+ out[7 + outpos] = ((in[4 + inpos] >>> 12))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[3 + inpos] >>> 16) & 16383))
+ out[8 + outpos] = (((in[5 + inpos] >>> 0) & 1048575))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 4095) << (14 - 12)))
+ out[9 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 255) << (20 - 8)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[4 + inpos] >>> 12) & 16383))
+ out[10 + outpos] = (((in[6 + inpos] >>> 8) & 1048575))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 255) << (14 - 8)))
+ out[11 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 65535) << (20 - 16)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[5 + inpos] >>> 8) & 16383))
+ out[12 + outpos] = ((in[7 + inpos] >>> 16) | ((in[8 + inpos] & 15) << (20 - 4)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[5 + inpos] >>> 22) | ((in[6 + inpos] & 15) << (14 - 4)))
+ out[13 + outpos] = (((in[8 + inpos] >>> 4) & 1048575))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[6 + inpos] >>> 4) & 16383))
+ out[14 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 4095) << (20 - 12)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[6 + inpos] >>> 18))
+ out[15 + outpos] = ((in[9 + inpos] >>> 12))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[7 + inpos] >>> 0) & 16383))
+ out[16 + outpos] = (((in[10 + inpos] >>> 0) & 1048575))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[7 + inpos] >>> 14) & 16383))
+ out[17 + outpos] = ((in[10 + inpos] >>> 20) | ((in[11 + inpos] & 255) << (20 - 8)))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 1023) << (14 - 10)))
+ out[18 + outpos] = (((in[11 + inpos] >>> 8) & 1048575))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[8 + inpos] >>> 10) & 16383))
+ out[19 + outpos] = ((in[11 + inpos] >>> 28) | ((in[12 + inpos] & 65535) << (20 - 16)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 63) << (14 - 6)))
+ out[20 + outpos] = ((in[12 + inpos] >>> 16) | ((in[13 + inpos] & 15) << (20 - 4)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[9 + inpos] >>> 6) & 16383))
+ out[21 + outpos] = (((in[13 + inpos] >>> 4) & 1048575))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[9 + inpos] >>> 20) | ((in[10 + inpos] & 3) << (14 - 2)))
+ out[22 + outpos] = ((in[13 + inpos] >>> 24) | ((in[14 + inpos] & 4095) << (20 - 12)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[10 + inpos] >>> 2) & 16383))
+ out[23 + outpos] = ((in[14 + inpos] >>> 12))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[10 + inpos] >>> 16) & 16383))
+ out[24 + outpos] = (((in[15 + inpos] >>> 0) & 1048575))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[10 + inpos] >>> 30) | ((in[11 + inpos] & 4095) << (14 - 12)))
+ out[25 + outpos] = ((in[15 + inpos] >>> 20) | ((in[16 + inpos] & 255) << (20 - 8)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[11 + inpos] >>> 12) & 16383))
+ out[26 + outpos] = (((in[16 + inpos] >>> 8) & 1048575))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 255) << (14 - 8)))
+ out[27 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 65535) << (20 - 16)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[12 + inpos] >>> 8) & 16383))
+ out[28 + outpos] = ((in[17 + inpos] >>> 16) | ((in[18 + inpos] & 15) << (20 - 4)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[12 + inpos] >>> 22) | ((in[13 + inpos] & 15) << (14 - 4)))
+ out[29 + outpos] = (((in[18 + inpos] >>> 4) & 1048575))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[13 + inpos] >>> 4) & 16383))
+ out[30 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 4095) << (20 - 12)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[13 + inpos] >>> 18))
+ out[31 + outpos] = ((in[19 + inpos] >>> 12))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack15(final int initoffset,
+ protected static void integratedunpack21(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 32767))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 2097151))
+ initoffset;
- out[1 + outpos] = (((in[0 + inpos] >>> 15) & 32767))
+ out[1 + outpos] = ((in[0 + inpos] >>> 21) | ((in[1 + inpos] & 1023) << (21 - 10)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 8191) << (15 - 13)))
+ out[2 + outpos] = (((in[1 + inpos] >>> 10) & 2097151))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[1 + inpos] >>> 13) & 32767))
+ out[3 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 1048575) << (21 - 20)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 2047) << (15 - 11)))
+ out[4 + outpos] = ((in[2 + inpos] >>> 20) | ((in[3 + inpos] & 511) << (21 - 9)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[2 + inpos] >>> 11) & 32767))
+ out[5 + outpos] = (((in[3 + inpos] >>> 9) & 2097151))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 511) << (15 - 9)))
+ out[6 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 524287) << (21 - 19)))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[3 + inpos] >>> 9) & 32767))
+ out[7 + outpos] = ((in[4 + inpos] >>> 19) | ((in[5 + inpos] & 255) << (21 - 8)))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 127) << (15 - 7)))
+ out[8 + outpos] = (((in[5 + inpos] >>> 8) & 2097151))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[4 + inpos] >>> 7) & 32767))
+ out[9 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 262143) << (21 - 18)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[4 + inpos] >>> 22) | ((in[5 + inpos] & 31) << (15 - 5)))
+ out[10 + outpos] = ((in[6 + inpos] >>> 18) | ((in[7 + inpos] & 127) << (21 - 7)))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[5 + inpos] >>> 5) & 32767))
+ out[11 + outpos] = (((in[7 + inpos] >>> 7) & 2097151))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 7) << (15 - 3)))
+ out[12 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 131071) << (21 - 17)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[6 + inpos] >>> 3) & 32767))
+ out[13 + outpos] = ((in[8 + inpos] >>> 17) | ((in[9 + inpos] & 63) << (21 - 6)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[6 + inpos] >>> 18) | ((in[7 + inpos] & 1) << (15 - 1)))
+ out[14 + outpos] = (((in[9 + inpos] >>> 6) & 2097151))
+ out[14 + outpos - 1];
- out[15 + outpos] = (((in[7 + inpos] >>> 1) & 32767))
+ out[15 + outpos] = ((in[9 + inpos] >>> 27) | ((in[10 + inpos] & 65535) << (21 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[7 + inpos] >>> 16) & 32767))
+ out[16 + outpos] = ((in[10 + inpos] >>> 16) | ((in[11 + inpos] & 31) << (21 - 5)))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[7 + inpos] >>> 31) | ((in[8 + inpos] & 16383) << (15 - 14)))
+ out[17 + outpos] = (((in[11 + inpos] >>> 5) & 2097151))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[8 + inpos] >>> 14) & 32767))
+ out[18 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 32767) << (21 - 15)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[8 + inpos] >>> 29) | ((in[9 + inpos] & 4095) << (15 - 12)))
+ out[19 + outpos] = ((in[12 + inpos] >>> 15) | ((in[13 + inpos] & 15) << (21 - 4)))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[9 + inpos] >>> 12) & 32767))
+ out[20 + outpos] = (((in[13 + inpos] >>> 4) & 2097151))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[9 + inpos] >>> 27) | ((in[10 + inpos] & 1023) << (15 - 10)))
+ out[21 + outpos] = ((in[13 + inpos] >>> 25) | ((in[14 + inpos] & 16383) << (21 - 14)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[10 + inpos] >>> 10) & 32767))
+ out[22 + outpos] = ((in[14 + inpos] >>> 14) | ((in[15 + inpos] & 7) << (21 - 3)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[10 + inpos] >>> 25) | ((in[11 + inpos] & 255) << (15 - 8)))
+ out[23 + outpos] = (((in[15 + inpos] >>> 3) & 2097151))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[11 + inpos] >>> 8) & 32767))
+ out[24 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 8191) << (21 - 13)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[11 + inpos] >>> 23) | ((in[12 + inpos] & 63) << (15 - 6)))
+ out[25 + outpos] = ((in[16 + inpos] >>> 13) | ((in[17 + inpos] & 3) << (21 - 2)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[12 + inpos] >>> 6) & 32767))
+ out[26 + outpos] = (((in[17 + inpos] >>> 2) & 2097151))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[12 + inpos] >>> 21) | ((in[13 + inpos] & 15) << (15 - 4)))
+ out[27 + outpos] = ((in[17 + inpos] >>> 23) | ((in[18 + inpos] & 4095) << (21 - 12)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[13 + inpos] >>> 4) & 32767))
+ out[28 + outpos] = ((in[18 + inpos] >>> 12) | ((in[19 + inpos] & 1) << (21 - 1)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[13 + inpos] >>> 19) | ((in[14 + inpos] & 3) << (15 - 2)))
+ out[29 + outpos] = (((in[19 + inpos] >>> 1) & 2097151))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[14 + inpos] >>> 2) & 32767))
+ out[30 + outpos] = ((in[19 + inpos] >>> 22) | ((in[20 + inpos] & 2047) << (21 - 11)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[14 + inpos] >>> 17))
+ out[31 + outpos] = ((in[20 + inpos] >>> 11))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack16(final int initoffset,
+ protected static void integratedunpack22(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 65535))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 4194303))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 16))
+ out[1 + outpos] = ((in[0 + inpos] >>> 22) | ((in[1 + inpos] & 4095) << (22 - 12)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[1 + inpos] >>> 0) & 65535))
+ out[2 + outpos] = ((in[1 + inpos] >>> 12) | ((in[2 + inpos] & 3) << (22 - 2)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[1 + inpos] >>> 16))
+ out[3 + outpos] = (((in[2 + inpos] >>> 2) & 4194303))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[2 + inpos] >>> 0) & 65535))
+ out[4 + outpos] = ((in[2 + inpos] >>> 24) | ((in[3 + inpos] & 16383) << (22 - 14)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[2 + inpos] >>> 16))
+ out[5 + outpos] = ((in[3 + inpos] >>> 14) | ((in[4 + inpos] & 15) << (22 - 4)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[3 + inpos] >>> 0) & 65535))
+ out[6 + outpos] = (((in[4 + inpos] >>> 4) & 4194303))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[3 + inpos] >>> 16))
+ out[7 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 65535) << (22 - 16)))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[4 + inpos] >>> 0) & 65535))
+ out[8 + outpos] = ((in[5 + inpos] >>> 16) | ((in[6 + inpos] & 63) << (22 - 6)))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[4 + inpos] >>> 16))
+ out[9 + outpos] = (((in[6 + inpos] >>> 6) & 4194303))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[5 + inpos] >>> 0) & 65535))
+ out[10 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 262143) << (22 - 18)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[5 + inpos] >>> 16))
+ out[11 + outpos] = ((in[7 + inpos] >>> 18) | ((in[8 + inpos] & 255) << (22 - 8)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[6 + inpos] >>> 0) & 65535))
+ out[12 + outpos] = (((in[8 + inpos] >>> 8) & 4194303))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[6 + inpos] >>> 16))
+ out[13 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 1048575) << (22 - 20)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[7 + inpos] >>> 0) & 65535))
+ out[14 + outpos] = ((in[9 + inpos] >>> 20) | ((in[10 + inpos] & 1023) << (22 - 10)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[7 + inpos] >>> 16))
+ out[15 + outpos] = ((in[10 + inpos] >>> 10))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[8 + inpos] >>> 0) & 65535))
+ out[16 + outpos] = (((in[11 + inpos] >>> 0) & 4194303))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[8 + inpos] >>> 16))
+ out[17 + outpos] = ((in[11 + inpos] >>> 22) | ((in[12 + inpos] & 4095) << (22 - 12)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[9 + inpos] >>> 0) & 65535))
+ out[18 + outpos] = ((in[12 + inpos] >>> 12) | ((in[13 + inpos] & 3) << (22 - 2)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[9 + inpos] >>> 16))
+ out[19 + outpos] = (((in[13 + inpos] >>> 2) & 4194303))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[10 + inpos] >>> 0) & 65535))
+ out[20 + outpos] = ((in[13 + inpos] >>> 24) | ((in[14 + inpos] & 16383) << (22 - 14)))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[10 + inpos] >>> 16))
+ out[21 + outpos] = ((in[14 + inpos] >>> 14) | ((in[15 + inpos] & 15) << (22 - 4)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[11 + inpos] >>> 0) & 65535))
+ out[22 + outpos] = (((in[15 + inpos] >>> 4) & 4194303))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[11 + inpos] >>> 16))
+ out[23 + outpos] = ((in[15 + inpos] >>> 26) | ((in[16 + inpos] & 65535) << (22 - 16)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[12 + inpos] >>> 0) & 65535))
+ out[24 + outpos] = ((in[16 + inpos] >>> 16) | ((in[17 + inpos] & 63) << (22 - 6)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[12 + inpos] >>> 16))
+ out[25 + outpos] = (((in[17 + inpos] >>> 6) & 4194303))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[13 + inpos] >>> 0) & 65535))
+ out[26 + outpos] = ((in[17 + inpos] >>> 28) | ((in[18 + inpos] & 262143) << (22 - 18)))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[13 + inpos] >>> 16))
+ out[27 + outpos] = ((in[18 + inpos] >>> 18) | ((in[19 + inpos] & 255) << (22 - 8)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[14 + inpos] >>> 0) & 65535))
+ out[28 + outpos] = (((in[19 + inpos] >>> 8) & 4194303))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[14 + inpos] >>> 16))
+ out[29 + outpos] = ((in[19 + inpos] >>> 30) | ((in[20 + inpos] & 1048575) << (22 - 20)))
+ out[29 + outpos - 1];
- out[30 + outpos] = (((in[15 + inpos] >>> 0) & 65535))
+ out[30 + outpos] = ((in[20 + inpos] >>> 20) | ((in[21 + inpos] & 1023) << (22 - 10)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[15 + inpos] >>> 16))
+ out[31 + outpos] = ((in[21 + inpos] >>> 10))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack17(final int initoffset,
+ protected static void integratedunpack23(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 131071))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 8388607))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 17) | ((in[1 + inpos] & 3) << (17 - 2)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 23) | ((in[1 + inpos] & 16383) << (23 - 14)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[1 + inpos] >>> 2) & 131071))
+ out[2 + outpos] = ((in[1 + inpos] >>> 14) | ((in[2 + inpos] & 31) << (23 - 5)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[1 + inpos] >>> 19) | ((in[2 + inpos] & 15) << (17 - 4)))
+ out[3 + outpos] = (((in[2 + inpos] >>> 5) & 8388607))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[2 + inpos] >>> 4) & 131071))
+ out[4 + outpos] = ((in[2 + inpos] >>> 28) | ((in[3 + inpos] & 524287) << (23 - 19)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[2 + inpos] >>> 21) | ((in[3 + inpos] & 63) << (17 - 6)))
+ out[5 + outpos] = ((in[3 + inpos] >>> 19) | ((in[4 + inpos] & 1023) << (23 - 10)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[3 + inpos] >>> 6) & 131071))
+ out[6 + outpos] = ((in[4 + inpos] >>> 10) | ((in[5 + inpos] & 1) << (23 - 1)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[3 + inpos] >>> 23) | ((in[4 + inpos] & 255) << (17 - 8)))
+ out[7 + outpos] = (((in[5 + inpos] >>> 1) & 8388607))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[4 + inpos] >>> 8) & 131071))
+ out[8 + outpos] = ((in[5 + inpos] >>> 24) | ((in[6 + inpos] & 32767) << (23 - 15)))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[4 + inpos] >>> 25) | ((in[5 + inpos] & 1023) << (17 - 10)))
+ out[9 + outpos] = ((in[6 + inpos] >>> 15) | ((in[7 + inpos] & 63) << (23 - 6)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[5 + inpos] >>> 10) & 131071))
+ out[10 + outpos] = (((in[7 + inpos] >>> 6) & 8388607))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[5 + inpos] >>> 27) | ((in[6 + inpos] & 4095) << (17 - 12)))
+ out[11 + outpos] = ((in[7 + inpos] >>> 29) | ((in[8 + inpos] & 1048575) << (23 - 20)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[6 + inpos] >>> 12) & 131071))
+ out[12 + outpos] = ((in[8 + inpos] >>> 20) | ((in[9 + inpos] & 2047) << (23 - 11)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[6 + inpos] >>> 29) | ((in[7 + inpos] & 16383) << (17 - 14)))
+ out[13 + outpos] = ((in[9 + inpos] >>> 11) | ((in[10 + inpos] & 3) << (23 - 2)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[7 + inpos] >>> 14) & 131071))
+ out[14 + outpos] = (((in[10 + inpos] >>> 2) & 8388607))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[7 + inpos] >>> 31) | ((in[8 + inpos] & 65535) << (17 - 16)))
+ out[15 + outpos] = ((in[10 + inpos] >>> 25) | ((in[11 + inpos] & 65535) << (23 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[8 + inpos] >>> 16) | ((in[9 + inpos] & 1) << (17 - 1)))
+ out[16 + outpos] = ((in[11 + inpos] >>> 16) | ((in[12 + inpos] & 127) << (23 - 7)))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[9 + inpos] >>> 1) & 131071))
+ out[17 + outpos] = (((in[12 + inpos] >>> 7) & 8388607))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[9 + inpos] >>> 18) | ((in[10 + inpos] & 7) << (17 - 3)))
+ out[18 + outpos] = ((in[12 + inpos] >>> 30) | ((in[13 + inpos] & 2097151) << (23 - 21)))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[10 + inpos] >>> 3) & 131071))
+ out[19 + outpos] = ((in[13 + inpos] >>> 21) | ((in[14 + inpos] & 4095) << (23 - 12)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[10 + inpos] >>> 20) | ((in[11 + inpos] & 31) << (17 - 5)))
+ out[20 + outpos] = ((in[14 + inpos] >>> 12) | ((in[15 + inpos] & 7) << (23 - 3)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[11 + inpos] >>> 5) & 131071))
+ out[21 + outpos] = (((in[15 + inpos] >>> 3) & 8388607))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[11 + inpos] >>> 22) | ((in[12 + inpos] & 127) << (17 - 7)))
+ out[22 + outpos] = ((in[15 + inpos] >>> 26) | ((in[16 + inpos] & 131071) << (23 - 17)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[12 + inpos] >>> 7) & 131071))
+ out[23 + outpos] = ((in[16 + inpos] >>> 17) | ((in[17 + inpos] & 255) << (23 - 8)))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[12 + inpos] >>> 24) | ((in[13 + inpos] & 511) << (17 - 9)))
+ out[24 + outpos] = (((in[17 + inpos] >>> 8) & 8388607))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[13 + inpos] >>> 9) & 131071))
+ out[25 + outpos] = ((in[17 + inpos] >>> 31) | ((in[18 + inpos] & 4194303) << (23 - 22)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[13 + inpos] >>> 26) | ((in[14 + inpos] & 2047) << (17 - 11)))
+ out[26 + outpos] = ((in[18 + inpos] >>> 22) | ((in[19 + inpos] & 8191) << (23 - 13)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[14 + inpos] >>> 11) & 131071))
+ out[27 + outpos] = ((in[19 + inpos] >>> 13) | ((in[20 + inpos] & 15) << (23 - 4)))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[14 + inpos] >>> 28) | ((in[15 + inpos] & 8191) << (17 - 13)))
+ out[28 + outpos] = (((in[20 + inpos] >>> 4) & 8388607))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[15 + inpos] >>> 13) & 131071))
+ out[29 + outpos] = ((in[20 + inpos] >>> 27) | ((in[21 + inpos] & 262143) << (23 - 18)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[15 + inpos] >>> 30) | ((in[16 + inpos] & 32767) << (17 - 15)))
+ out[30 + outpos] = ((in[21 + inpos] >>> 18) | ((in[22 + inpos] & 511) << (23 - 9)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[16 + inpos] >>> 15))
+ out[31 + outpos] = ((in[22 + inpos] >>> 9))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack18(final int initoffset,
+ protected static void integratedunpack24(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 262143))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 16777215))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 18) | ((in[1 + inpos] & 15) << (18 - 4)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 24) | ((in[1 + inpos] & 65535) << (24 - 16)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[1 + inpos] >>> 4) & 262143))
+ out[2 + outpos] = ((in[1 + inpos] >>> 16) | ((in[2 + inpos] & 255) << (24 - 8)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[1 + inpos] >>> 22) | ((in[2 + inpos] & 255) << (18 - 8)))
- + out[3 + outpos - 1];
- out[4 + outpos] = (((in[2 + inpos] >>> 8) & 262143))
+ out[3 + outpos] = ((in[2 + inpos] >>> 8)) + out[3 + outpos - 1];
+ out[4 + outpos] = (((in[3 + inpos] >>> 0) & 16777215))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 4095) << (18 - 12)))
+ out[5 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 65535) << (24 - 16)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[3 + inpos] >>> 12) & 262143))
+ out[6 + outpos] = ((in[4 + inpos] >>> 16) | ((in[5 + inpos] & 255) << (24 - 8)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 65535) << (18 - 16)))
- + out[7 + outpos - 1];
- out[8 + outpos] = ((in[4 + inpos] >>> 16) | ((in[5 + inpos] & 3) << (18 - 2)))
+ out[7 + outpos] = ((in[5 + inpos] >>> 8)) + out[7 + outpos - 1];
+ out[8 + outpos] = (((in[6 + inpos] >>> 0) & 16777215))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[5 + inpos] >>> 2) & 262143))
+ out[9 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 65535) << (24 - 16)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 63) << (18 - 6)))
+ out[10 + outpos] = ((in[7 + inpos] >>> 16) | ((in[8 + inpos] & 255) << (24 - 8)))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[6 + inpos] >>> 6) & 262143))
+ out[11 + outpos] = ((in[8 + inpos] >>> 8))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 1023) << (18 - 10)))
+ out[12 + outpos] = (((in[9 + inpos] >>> 0) & 16777215))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[7 + inpos] >>> 10) & 262143))
+ out[13 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 65535) << (24 - 16)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 16383) << (18 - 14)))
+ out[14 + outpos] = ((in[10 + inpos] >>> 16) | ((in[11 + inpos] & 255) << (24 - 8)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[8 + inpos] >>> 14))
+ out[15 + outpos] = ((in[11 + inpos] >>> 8))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[9 + inpos] >>> 0) & 262143))
+ out[16 + outpos] = (((in[12 + inpos] >>> 0) & 16777215))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[9 + inpos] >>> 18) | ((in[10 + inpos] & 15) << (18 - 4)))
+ out[17 + outpos] = ((in[12 + inpos] >>> 24) | ((in[13 + inpos] & 65535) << (24 - 16)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[10 + inpos] >>> 4) & 262143))
+ out[18 + outpos] = ((in[13 + inpos] >>> 16) | ((in[14 + inpos] & 255) << (24 - 8)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[10 + inpos] >>> 22) | ((in[11 + inpos] & 255) << (18 - 8)))
+ out[19 + outpos] = ((in[14 + inpos] >>> 8))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[11 + inpos] >>> 8) & 262143))
+ out[20 + outpos] = (((in[15 + inpos] >>> 0) & 16777215))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 4095) << (18 - 12)))
+ out[21 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 65535) << (24 - 16)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[12 + inpos] >>> 12) & 262143))
+ out[22 + outpos] = ((in[16 + inpos] >>> 16) | ((in[17 + inpos] & 255) << (24 - 8)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[12 + inpos] >>> 30) | ((in[13 + inpos] & 65535) << (18 - 16)))
+ out[23 + outpos] = ((in[17 + inpos] >>> 8))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[13 + inpos] >>> 16) | ((in[14 + inpos] & 3) << (18 - 2)))
+ out[24 + outpos] = (((in[18 + inpos] >>> 0) & 16777215))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[14 + inpos] >>> 2) & 262143))
+ out[25 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 65535) << (24 - 16)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[14 + inpos] >>> 20) | ((in[15 + inpos] & 63) << (18 - 6)))
+ out[26 + outpos] = ((in[19 + inpos] >>> 16) | ((in[20 + inpos] & 255) << (24 - 8)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[15 + inpos] >>> 6) & 262143))
+ out[27 + outpos] = ((in[20 + inpos] >>> 8))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 1023) << (18 - 10)))
+ out[28 + outpos] = (((in[21 + inpos] >>> 0) & 16777215))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[16 + inpos] >>> 10) & 262143))
+ out[29 + outpos] = ((in[21 + inpos] >>> 24) | ((in[22 + inpos] & 65535) << (24 - 16)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 16383) << (18 - 14)))
+ out[30 + outpos] = ((in[22 + inpos] >>> 16) | ((in[23 + inpos] & 255) << (24 - 8)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[17 + inpos] >>> 14))
+ out[31 + outpos] = ((in[23 + inpos] >>> 8))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack19(final int initoffset,
+ protected static void integratedunpack25(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 524287))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 33554431))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 19) | ((in[1 + inpos] & 63) << (19 - 6)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 25) | ((in[1 + inpos] & 262143) << (25 - 18)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[1 + inpos] >>> 6) & 524287))
+ out[2 + outpos] = ((in[1 + inpos] >>> 18) | ((in[2 + inpos] & 2047) << (25 - 11)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[1 + inpos] >>> 25) | ((in[2 + inpos] & 4095) << (19 - 12)))
+ out[3 + outpos] = ((in[2 + inpos] >>> 11) | ((in[3 + inpos] & 15) << (25 - 4)))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[2 + inpos] >>> 12) & 524287))
+ out[4 + outpos] = (((in[3 + inpos] >>> 4) & 33554431))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[2 + inpos] >>> 31) | ((in[3 + inpos] & 262143) << (19 - 18)))
+ out[5 + outpos] = ((in[3 + inpos] >>> 29) | ((in[4 + inpos] & 4194303) << (25 - 22)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[3 + inpos] >>> 18) | ((in[4 + inpos] & 31) << (19 - 5)))
+ out[6 + outpos] = ((in[4 + inpos] >>> 22) | ((in[5 + inpos] & 32767) << (25 - 15)))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[4 + inpos] >>> 5) & 524287))
+ out[7 + outpos] = ((in[5 + inpos] >>> 15) | ((in[6 + inpos] & 255) << (25 - 8)))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[4 + inpos] >>> 24) | ((in[5 + inpos] & 2047) << (19 - 11)))
+ out[8 + outpos] = ((in[6 + inpos] >>> 8) | ((in[7 + inpos] & 1) << (25 - 1)))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[5 + inpos] >>> 11) & 524287))
+ out[9 + outpos] = (((in[7 + inpos] >>> 1) & 33554431))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[5 + inpos] >>> 30) | ((in[6 + inpos] & 131071) << (19 - 17)))
+ out[10 + outpos] = ((in[7 + inpos] >>> 26) | ((in[8 + inpos] & 524287) << (25 - 19)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[6 + inpos] >>> 17) | ((in[7 + inpos] & 15) << (19 - 4)))
+ out[11 + outpos] = ((in[8 + inpos] >>> 19) | ((in[9 + inpos] & 4095) << (25 - 12)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[7 + inpos] >>> 4) & 524287))
+ out[12 + outpos] = ((in[9 + inpos] >>> 12) | ((in[10 + inpos] & 31) << (25 - 5)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[7 + inpos] >>> 23) | ((in[8 + inpos] & 1023) << (19 - 10)))
+ out[13 + outpos] = (((in[10 + inpos] >>> 5) & 33554431))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[8 + inpos] >>> 10) & 524287))
+ out[14 + outpos] = ((in[10 + inpos] >>> 30) | ((in[11 + inpos] & 8388607) << (25 - 23)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[8 + inpos] >>> 29) | ((in[9 + inpos] & 65535) << (19 - 16)))
+ out[15 + outpos] = ((in[11 + inpos] >>> 23) | ((in[12 + inpos] & 65535) << (25 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[9 + inpos] >>> 16) | ((in[10 + inpos] & 7) << (19 - 3)))
+ out[16 + outpos] = ((in[12 + inpos] >>> 16) | ((in[13 + inpos] & 511) << (25 - 9)))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[10 + inpos] >>> 3) & 524287))
+ out[17 + outpos] = ((in[13 + inpos] >>> 9) | ((in[14 + inpos] & 3) << (25 - 2)))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[10 + inpos] >>> 22) | ((in[11 + inpos] & 511) << (19 - 9)))
+ out[18 + outpos] = (((in[14 + inpos] >>> 2) & 33554431))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[11 + inpos] >>> 9) & 524287))
+ out[19 + outpos] = ((in[14 + inpos] >>> 27) | ((in[15 + inpos] & 1048575) << (25 - 20)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[11 + inpos] >>> 28) | ((in[12 + inpos] & 32767) << (19 - 15)))
+ out[20 + outpos] = ((in[15 + inpos] >>> 20) | ((in[16 + inpos] & 8191) << (25 - 13)))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[12 + inpos] >>> 15) | ((in[13 + inpos] & 3) << (19 - 2)))
+ out[21 + outpos] = ((in[16 + inpos] >>> 13) | ((in[17 + inpos] & 63) << (25 - 6)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[13 + inpos] >>> 2) & 524287))
+ out[22 + outpos] = (((in[17 + inpos] >>> 6) & 33554431))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[13 + inpos] >>> 21) | ((in[14 + inpos] & 255) << (19 - 8)))
+ out[23 + outpos] = ((in[17 + inpos] >>> 31) | ((in[18 + inpos] & 16777215) << (25 - 24)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[14 + inpos] >>> 8) & 524287))
+ out[24 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 131071) << (25 - 17)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[14 + inpos] >>> 27) | ((in[15 + inpos] & 16383) << (19 - 14)))
+ out[25 + outpos] = ((in[19 + inpos] >>> 17) | ((in[20 + inpos] & 1023) << (25 - 10)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[15 + inpos] >>> 14) | ((in[16 + inpos] & 1) << (19 - 1)))
+ out[26 + outpos] = ((in[20 + inpos] >>> 10) | ((in[21 + inpos] & 7) << (25 - 3)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[16 + inpos] >>> 1) & 524287))
+ out[27 + outpos] = (((in[21 + inpos] >>> 3) & 33554431))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[16 + inpos] >>> 20) | ((in[17 + inpos] & 127) << (19 - 7)))
+ out[28 + outpos] = ((in[21 + inpos] >>> 28) | ((in[22 + inpos] & 2097151) << (25 - 21)))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[17 + inpos] >>> 7) & 524287))
+ out[29 + outpos] = ((in[22 + inpos] >>> 21) | ((in[23 + inpos] & 16383) << (25 - 14)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[17 + inpos] >>> 26) | ((in[18 + inpos] & 8191) << (19 - 13)))
+ out[30 + outpos] = ((in[23 + inpos] >>> 14) | ((in[24 + inpos] & 127) << (25 - 7)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[18 + inpos] >>> 13))
+ out[31 + outpos] = ((in[24 + inpos] >>> 7))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack20(final int initoffset,
+ protected static void integratedunpack26(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1048575))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 67108863))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 20) | ((in[1 + inpos] & 255) << (20 - 8)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 26) | ((in[1 + inpos] & 1048575) << (26 - 20)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[1 + inpos] >>> 8) & 1048575))
+ out[2 + outpos] = ((in[1 + inpos] >>> 20) | ((in[2 + inpos] & 16383) << (26 - 14)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 65535) << (20 - 16)))
+ out[3 + outpos] = ((in[2 + inpos] >>> 14) | ((in[3 + inpos] & 255) << (26 - 8)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[2 + inpos] >>> 16) | ((in[3 + inpos] & 15) << (20 - 4)))
+ out[4 + outpos] = ((in[3 + inpos] >>> 8) | ((in[4 + inpos] & 3) << (26 - 2)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[3 + inpos] >>> 4) & 1048575))
+ out[5 + outpos] = (((in[4 + inpos] >>> 2) & 67108863))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 4095) << (20 - 12)))
+ out[6 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 4194303) << (26 - 22)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[4 + inpos] >>> 12))
+ out[7 + outpos] = ((in[5 + inpos] >>> 22) | ((in[6 + inpos] & 65535) << (26 - 16)))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[5 + inpos] >>> 0) & 1048575))
+ out[8 + outpos] = ((in[6 + inpos] >>> 16) | ((in[7 + inpos] & 1023) << (26 - 10)))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 255) << (20 - 8)))
+ out[9 + outpos] = ((in[7 + inpos] >>> 10) | ((in[8 + inpos] & 15) << (26 - 4)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[6 + inpos] >>> 8) & 1048575))
+ out[10 + outpos] = (((in[8 + inpos] >>> 4) & 67108863))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 65535) << (20 - 16)))
+ out[11 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 16777215) << (26 - 24)))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[7 + inpos] >>> 16) | ((in[8 + inpos] & 15) << (20 - 4)))
+ out[12 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 262143) << (26 - 18)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[8 + inpos] >>> 4) & 1048575))
+ out[13 + outpos] = ((in[10 + inpos] >>> 18) | ((in[11 + inpos] & 4095) << (26 - 12)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 4095) << (20 - 12)))
+ out[14 + outpos] = ((in[11 + inpos] >>> 12) | ((in[12 + inpos] & 63) << (26 - 6)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[9 + inpos] >>> 12))
+ out[15 + outpos] = ((in[12 + inpos] >>> 6))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[10 + inpos] >>> 0) & 1048575))
+ out[16 + outpos] = (((in[13 + inpos] >>> 0) & 67108863))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[10 + inpos] >>> 20) | ((in[11 + inpos] & 255) << (20 - 8)))
+ out[17 + outpos] = ((in[13 + inpos] >>> 26) | ((in[14 + inpos] & 1048575) << (26 - 20)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[11 + inpos] >>> 8) & 1048575))
+ out[18 + outpos] = ((in[14 + inpos] >>> 20) | ((in[15 + inpos] & 16383) << (26 - 14)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[11 + inpos] >>> 28) | ((in[12 + inpos] & 65535) << (20 - 16)))
+ out[19 + outpos] = ((in[15 + inpos] >>> 14) | ((in[16 + inpos] & 255) << (26 - 8)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[12 + inpos] >>> 16) | ((in[13 + inpos] & 15) << (20 - 4)))
+ out[20 + outpos] = ((in[16 + inpos] >>> 8) | ((in[17 + inpos] & 3) << (26 - 2)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[13 + inpos] >>> 4) & 1048575))
+ out[21 + outpos] = (((in[17 + inpos] >>> 2) & 67108863))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[13 + inpos] >>> 24) | ((in[14 + inpos] & 4095) << (20 - 12)))
+ out[22 + outpos] = ((in[17 + inpos] >>> 28) | ((in[18 + inpos] & 4194303) << (26 - 22)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[14 + inpos] >>> 12))
+ out[23 + outpos] = ((in[18 + inpos] >>> 22) | ((in[19 + inpos] & 65535) << (26 - 16)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[15 + inpos] >>> 0) & 1048575))
+ out[24 + outpos] = ((in[19 + inpos] >>> 16) | ((in[20 + inpos] & 1023) << (26 - 10)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[15 + inpos] >>> 20) | ((in[16 + inpos] & 255) << (20 - 8)))
+ out[25 + outpos] = ((in[20 + inpos] >>> 10) | ((in[21 + inpos] & 15) << (26 - 4)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[16 + inpos] >>> 8) & 1048575))
+ out[26 + outpos] = (((in[21 + inpos] >>> 4) & 67108863))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 65535) << (20 - 16)))
+ out[27 + outpos] = ((in[21 + inpos] >>> 30) | ((in[22 + inpos] & 16777215) << (26 - 24)))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[17 + inpos] >>> 16) | ((in[18 + inpos] & 15) << (20 - 4)))
+ out[28 + outpos] = ((in[22 + inpos] >>> 24) | ((in[23 + inpos] & 262143) << (26 - 18)))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[18 + inpos] >>> 4) & 1048575))
+ out[29 + outpos] = ((in[23 + inpos] >>> 18) | ((in[24 + inpos] & 4095) << (26 - 12)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 4095) << (20 - 12)))
+ out[30 + outpos] = ((in[24 + inpos] >>> 12) | ((in[25 + inpos] & 63) << (26 - 6)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[19 + inpos] >>> 12))
+ out[31 + outpos] = ((in[25 + inpos] >>> 6))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack21(final int initoffset,
+ protected static void integratedunpack27(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 2097151))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 134217727))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 21) | ((in[1 + inpos] & 1023) << (21 - 10)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 27) | ((in[1 + inpos] & 4194303) << (27 - 22)))
+ out[1 + outpos - 1];
- out[2 + outpos] = (((in[1 + inpos] >>> 10) & 2097151))
+ out[2 + outpos] = ((in[1 + inpos] >>> 22) | ((in[2 + inpos] & 131071) << (27 - 17)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 1048575) << (21 - 20)))
+ out[3 + outpos] = ((in[2 + inpos] >>> 17) | ((in[3 + inpos] & 4095) << (27 - 12)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[2 + inpos] >>> 20) | ((in[3 + inpos] & 511) << (21 - 9)))
+ out[4 + outpos] = ((in[3 + inpos] >>> 12) | ((in[4 + inpos] & 127) << (27 - 7)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[3 + inpos] >>> 9) & 2097151))
+ out[5 + outpos] = ((in[4 + inpos] >>> 7) | ((in[5 + inpos] & 3) << (27 - 2)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 524287) << (21 - 19)))
+ out[6 + outpos] = (((in[5 + inpos] >>> 2) & 134217727))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[4 + inpos] >>> 19) | ((in[5 + inpos] & 255) << (21 - 8)))
+ out[7 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 16777215) << (27 - 24)))
+ out[7 + outpos - 1];
- out[8 + outpos] = (((in[5 + inpos] >>> 8) & 2097151))
+ out[8 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 524287) << (27 - 19)))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 262143) << (21 - 18)))
+ out[9 + outpos] = ((in[7 + inpos] >>> 19) | ((in[8 + inpos] & 16383) << (27 - 14)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[6 + inpos] >>> 18) | ((in[7 + inpos] & 127) << (21 - 7)))
+ out[10 + outpos] = ((in[8 + inpos] >>> 14) | ((in[9 + inpos] & 511) << (27 - 9)))
+ out[10 + outpos - 1];
- out[11 + outpos] = (((in[7 + inpos] >>> 7) & 2097151))
+ out[11 + outpos] = ((in[9 + inpos] >>> 9) | ((in[10 + inpos] & 15) << (27 - 4)))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 131071) << (21 - 17)))
+ out[12 + outpos] = (((in[10 + inpos] >>> 4) & 134217727))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[8 + inpos] >>> 17) | ((in[9 + inpos] & 63) << (21 - 6)))
+ out[13 + outpos] = ((in[10 + inpos] >>> 31) | ((in[11 + inpos] & 67108863) << (27 - 26)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[9 + inpos] >>> 6) & 2097151))
+ out[14 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 2097151) << (27 - 21)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[9 + inpos] >>> 27) | ((in[10 + inpos] & 65535) << (21 - 16)))
+ out[15 + outpos] = ((in[12 + inpos] >>> 21) | ((in[13 + inpos] & 65535) << (27 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[10 + inpos] >>> 16) | ((in[11 + inpos] & 31) << (21 - 5)))
+ out[16 + outpos] = ((in[13 + inpos] >>> 16) | ((in[14 + inpos] & 2047) << (27 - 11)))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[11 + inpos] >>> 5) & 2097151))
+ out[17 + outpos] = ((in[14 + inpos] >>> 11) | ((in[15 + inpos] & 63) << (27 - 6)))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 32767) << (21 - 15)))
+ out[18 + outpos] = ((in[15 + inpos] >>> 6) | ((in[16 + inpos] & 1) << (27 - 1)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[12 + inpos] >>> 15) | ((in[13 + inpos] & 15) << (21 - 4)))
+ out[19 + outpos] = (((in[16 + inpos] >>> 1) & 134217727))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[13 + inpos] >>> 4) & 2097151))
+ out[20 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 8388607) << (27 - 23)))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[13 + inpos] >>> 25) | ((in[14 + inpos] & 16383) << (21 - 14)))
+ out[21 + outpos] = ((in[17 + inpos] >>> 23) | ((in[18 + inpos] & 262143) << (27 - 18)))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[14 + inpos] >>> 14) | ((in[15 + inpos] & 7) << (21 - 3)))
+ out[22 + outpos] = ((in[18 + inpos] >>> 18) | ((in[19 + inpos] & 8191) << (27 - 13)))
+ out[22 + outpos - 1];
- out[23 + outpos] = (((in[15 + inpos] >>> 3) & 2097151))
+ out[23 + outpos] = ((in[19 + inpos] >>> 13) | ((in[20 + inpos] & 255) << (27 - 8)))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 8191) << (21 - 13)))
+ out[24 + outpos] = ((in[20 + inpos] >>> 8) | ((in[21 + inpos] & 7) << (27 - 3)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[16 + inpos] >>> 13) | ((in[17 + inpos] & 3) << (21 - 2)))
+ out[25 + outpos] = (((in[21 + inpos] >>> 3) & 134217727))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[17 + inpos] >>> 2) & 2097151))
+ out[26 + outpos] = ((in[21 + inpos] >>> 30) | ((in[22 + inpos] & 33554431) << (27 - 25)))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[17 + inpos] >>> 23) | ((in[18 + inpos] & 4095) << (21 - 12)))
+ out[27 + outpos] = ((in[22 + inpos] >>> 25) | ((in[23 + inpos] & 1048575) << (27 - 20)))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[18 + inpos] >>> 12) | ((in[19 + inpos] & 1) << (21 - 1)))
+ out[28 + outpos] = ((in[23 + inpos] >>> 20) | ((in[24 + inpos] & 32767) << (27 - 15)))
+ out[28 + outpos - 1];
- out[29 + outpos] = (((in[19 + inpos] >>> 1) & 2097151))
+ out[29 + outpos] = ((in[24 + inpos] >>> 15) | ((in[25 + inpos] & 1023) << (27 - 10)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[19 + inpos] >>> 22) | ((in[20 + inpos] & 2047) << (21 - 11)))
+ out[30 + outpos] = ((in[25 + inpos] >>> 10) | ((in[26 + inpos] & 31) << (27 - 5)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[20 + inpos] >>> 11))
+ out[31 + outpos] = ((in[26 + inpos] >>> 5))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack22(final int initoffset,
+ protected static void integratedunpack28(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 4194303))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 268435455))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 22) | ((in[1 + inpos] & 4095) << (22 - 12)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 28) | ((in[1 + inpos] & 16777215) << (28 - 24)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 12) | ((in[2 + inpos] & 3) << (22 - 2)))
+ out[2 + outpos] = ((in[1 + inpos] >>> 24) | ((in[2 + inpos] & 1048575) << (28 - 20)))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[2 + inpos] >>> 2) & 4194303))
+ out[3 + outpos] = ((in[2 + inpos] >>> 20) | ((in[3 + inpos] & 65535) << (28 - 16)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[2 + inpos] >>> 24) | ((in[3 + inpos] & 16383) << (22 - 14)))
+ out[4 + outpos] = ((in[3 + inpos] >>> 16) | ((in[4 + inpos] & 4095) << (28 - 12)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[3 + inpos] >>> 14) | ((in[4 + inpos] & 15) << (22 - 4)))
+ out[5 + outpos] = ((in[4 + inpos] >>> 12) | ((in[5 + inpos] & 255) << (28 - 8)))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[4 + inpos] >>> 4) & 4194303))
+ out[6 + outpos] = ((in[5 + inpos] >>> 8) | ((in[6 + inpos] & 15) << (28 - 4)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 65535) << (22 - 16)))
- + out[7 + outpos - 1];
- out[8 + outpos] = ((in[5 + inpos] >>> 16) | ((in[6 + inpos] & 63) << (22 - 6)))
+ out[7 + outpos] = ((in[6 + inpos] >>> 4)) + out[7 + outpos - 1];
+ out[8 + outpos] = (((in[7 + inpos] >>> 0) & 268435455))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[6 + inpos] >>> 6) & 4194303))
+ out[9 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 16777215) << (28 - 24)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[6 + inpos] >>> 28) | ((in[7 + inpos] & 262143) << (22 - 18)))
+ out[10 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 1048575) << (28 - 20)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[7 + inpos] >>> 18) | ((in[8 + inpos] & 255) << (22 - 8)))
+ out[11 + outpos] = ((in[9 + inpos] >>> 20) | ((in[10 + inpos] & 65535) << (28 - 16)))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[8 + inpos] >>> 8) & 4194303))
+ out[12 + outpos] = ((in[10 + inpos] >>> 16) | ((in[11 + inpos] & 4095) << (28 - 12)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 1048575) << (22 - 20)))
+ out[13 + outpos] = ((in[11 + inpos] >>> 12) | ((in[12 + inpos] & 255) << (28 - 8)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[9 + inpos] >>> 20) | ((in[10 + inpos] & 1023) << (22 - 10)))
+ out[14 + outpos] = ((in[12 + inpos] >>> 8) | ((in[13 + inpos] & 15) << (28 - 4)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[10 + inpos] >>> 10))
+ out[15 + outpos] = ((in[13 + inpos] >>> 4))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[11 + inpos] >>> 0) & 4194303))
+ out[16 + outpos] = (((in[14 + inpos] >>> 0) & 268435455))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[11 + inpos] >>> 22) | ((in[12 + inpos] & 4095) << (22 - 12)))
+ out[17 + outpos] = ((in[14 + inpos] >>> 28) | ((in[15 + inpos] & 16777215) << (28 - 24)))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[12 + inpos] >>> 12) | ((in[13 + inpos] & 3) << (22 - 2)))
+ out[18 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 1048575) << (28 - 20)))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[13 + inpos] >>> 2) & 4194303))
+ out[19 + outpos] = ((in[16 + inpos] >>> 20) | ((in[17 + inpos] & 65535) << (28 - 16)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[13 + inpos] >>> 24) | ((in[14 + inpos] & 16383) << (22 - 14)))
+ out[20 + outpos] = ((in[17 + inpos] >>> 16) | ((in[18 + inpos] & 4095) << (28 - 12)))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[14 + inpos] >>> 14) | ((in[15 + inpos] & 15) << (22 - 4)))
+ out[21 + outpos] = ((in[18 + inpos] >>> 12) | ((in[19 + inpos] & 255) << (28 - 8)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[15 + inpos] >>> 4) & 4194303))
+ out[22 + outpos] = ((in[19 + inpos] >>> 8) | ((in[20 + inpos] & 15) << (28 - 4)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[15 + inpos] >>> 26) | ((in[16 + inpos] & 65535) << (22 - 16)))
+ out[23 + outpos] = ((in[20 + inpos] >>> 4))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[16 + inpos] >>> 16) | ((in[17 + inpos] & 63) << (22 - 6)))
+ out[24 + outpos] = (((in[21 + inpos] >>> 0) & 268435455))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[17 + inpos] >>> 6) & 4194303))
+ out[25 + outpos] = ((in[21 + inpos] >>> 28) | ((in[22 + inpos] & 16777215) << (28 - 24)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[17 + inpos] >>> 28) | ((in[18 + inpos] & 262143) << (22 - 18)))
+ out[26 + outpos] = ((in[22 + inpos] >>> 24) | ((in[23 + inpos] & 1048575) << (28 - 20)))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[18 + inpos] >>> 18) | ((in[19 + inpos] & 255) << (22 - 8)))
+ out[27 + outpos] = ((in[23 + inpos] >>> 20) | ((in[24 + inpos] & 65535) << (28 - 16)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[19 + inpos] >>> 8) & 4194303))
+ out[28 + outpos] = ((in[24 + inpos] >>> 16) | ((in[25 + inpos] & 4095) << (28 - 12)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[19 + inpos] >>> 30) | ((in[20 + inpos] & 1048575) << (22 - 20)))
+ out[29 + outpos] = ((in[25 + inpos] >>> 12) | ((in[26 + inpos] & 255) << (28 - 8)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[20 + inpos] >>> 20) | ((in[21 + inpos] & 1023) << (22 - 10)))
+ out[30 + outpos] = ((in[26 + inpos] >>> 8) | ((in[27 + inpos] & 15) << (28 - 4)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[21 + inpos] >>> 10))
+ out[31 + outpos] = ((in[27 + inpos] >>> 4))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack23(final int initoffset,
+ protected static void integratedunpack29(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 8388607))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 536870911))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 23) | ((in[1 + inpos] & 16383) << (23 - 14)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 29) | ((in[1 + inpos] & 67108863) << (29 - 26)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 14) | ((in[2 + inpos] & 31) << (23 - 5)))
+ out[2 + outpos] = ((in[1 + inpos] >>> 26) | ((in[2 + inpos] & 8388607) << (29 - 23)))
+ out[2 + outpos - 1];
- out[3 + outpos] = (((in[2 + inpos] >>> 5) & 8388607))
+ out[3 + outpos] = ((in[2 + inpos] >>> 23) | ((in[3 + inpos] & 1048575) << (29 - 20)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[2 + inpos] >>> 28) | ((in[3 + inpos] & 524287) << (23 - 19)))
+ out[4 + outpos] = ((in[3 + inpos] >>> 20) | ((in[4 + inpos] & 131071) << (29 - 17)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[3 + inpos] >>> 19) | ((in[4 + inpos] & 1023) << (23 - 10)))
+ out[5 + outpos] = ((in[4 + inpos] >>> 17) | ((in[5 + inpos] & 16383) << (29 - 14)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[4 + inpos] >>> 10) | ((in[5 + inpos] & 1) << (23 - 1)))
+ out[6 + outpos] = ((in[5 + inpos] >>> 14) | ((in[6 + inpos] & 2047) << (29 - 11)))
+ out[6 + outpos - 1];
- out[7 + outpos] = (((in[5 + inpos] >>> 1) & 8388607))
+ out[7 + outpos] = ((in[6 + inpos] >>> 11) | ((in[7 + inpos] & 255) << (29 - 8)))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[5 + inpos] >>> 24) | ((in[6 + inpos] & 32767) << (23 - 15)))
+ out[8 + outpos] = ((in[7 + inpos] >>> 8) | ((in[8 + inpos] & 31) << (29 - 5)))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[6 + inpos] >>> 15) | ((in[7 + inpos] & 63) << (23 - 6)))
+ out[9 + outpos] = ((in[8 + inpos] >>> 5) | ((in[9 + inpos] & 3) << (29 - 2)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[7 + inpos] >>> 6) & 8388607))
+ out[10 + outpos] = (((in[9 + inpos] >>> 2) & 536870911))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[7 + inpos] >>> 29) | ((in[8 + inpos] & 1048575) << (23 - 20)))
+ out[11 + outpos] = ((in[9 + inpos] >>> 31) | ((in[10 + inpos] & 268435455) << (29 - 28)))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[8 + inpos] >>> 20) | ((in[9 + inpos] & 2047) << (23 - 11)))
+ out[12 + outpos] = ((in[10 + inpos] >>> 28) | ((in[11 + inpos] & 33554431) << (29 - 25)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[9 + inpos] >>> 11) | ((in[10 + inpos] & 3) << (23 - 2)))
+ out[13 + outpos] = ((in[11 + inpos] >>> 25) | ((in[12 + inpos] & 4194303) << (29 - 22)))
+ out[13 + outpos - 1];
- out[14 + outpos] = (((in[10 + inpos] >>> 2) & 8388607))
+ out[14 + outpos] = ((in[12 + inpos] >>> 22) | ((in[13 + inpos] & 524287) << (29 - 19)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[10 + inpos] >>> 25) | ((in[11 + inpos] & 65535) << (23 - 16)))
+ out[15 + outpos] = ((in[13 + inpos] >>> 19) | ((in[14 + inpos] & 65535) << (29 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[11 + inpos] >>> 16) | ((in[12 + inpos] & 127) << (23 - 7)))
+ out[16 + outpos] = ((in[14 + inpos] >>> 16) | ((in[15 + inpos] & 8191) << (29 - 13)))
+ out[16 + outpos - 1];
- out[17 + outpos] = (((in[12 + inpos] >>> 7) & 8388607))
+ out[17 + outpos] = ((in[15 + inpos] >>> 13) | ((in[16 + inpos] & 1023) << (29 - 10)))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[12 + inpos] >>> 30) | ((in[13 + inpos] & 2097151) << (23 - 21)))
+ out[18 + outpos] = ((in[16 + inpos] >>> 10) | ((in[17 + inpos] & 127) << (29 - 7)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[13 + inpos] >>> 21) | ((in[14 + inpos] & 4095) << (23 - 12)))
+ out[19 + outpos] = ((in[17 + inpos] >>> 7) | ((in[18 + inpos] & 15) << (29 - 4)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[14 + inpos] >>> 12) | ((in[15 + inpos] & 7) << (23 - 3)))
+ out[20 + outpos] = ((in[18 + inpos] >>> 4) | ((in[19 + inpos] & 1) << (29 - 1)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[15 + inpos] >>> 3) & 8388607))
+ out[21 + outpos] = (((in[19 + inpos] >>> 1) & 536870911))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[15 + inpos] >>> 26) | ((in[16 + inpos] & 131071) << (23 - 17)))
+ out[22 + outpos] = ((in[19 + inpos] >>> 30) | ((in[20 + inpos] & 134217727) << (29 - 27)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[16 + inpos] >>> 17) | ((in[17 + inpos] & 255) << (23 - 8)))
+ out[23 + outpos] = ((in[20 + inpos] >>> 27) | ((in[21 + inpos] & 16777215) << (29 - 24)))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[17 + inpos] >>> 8) & 8388607))
+ out[24 + outpos] = ((in[21 + inpos] >>> 24) | ((in[22 + inpos] & 2097151) << (29 - 21)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[17 + inpos] >>> 31) | ((in[18 + inpos] & 4194303) << (23 - 22)))
+ out[25 + outpos] = ((in[22 + inpos] >>> 21) | ((in[23 + inpos] & 262143) << (29 - 18)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[18 + inpos] >>> 22) | ((in[19 + inpos] & 8191) << (23 - 13)))
+ out[26 + outpos] = ((in[23 + inpos] >>> 18) | ((in[24 + inpos] & 32767) << (29 - 15)))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[19 + inpos] >>> 13) | ((in[20 + inpos] & 15) << (23 - 4)))
+ out[27 + outpos] = ((in[24 + inpos] >>> 15) | ((in[25 + inpos] & 4095) << (29 - 12)))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[20 + inpos] >>> 4) & 8388607))
+ out[28 + outpos] = ((in[25 + inpos] >>> 12) | ((in[26 + inpos] & 511) << (29 - 9)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[20 + inpos] >>> 27) | ((in[21 + inpos] & 262143) << (23 - 18)))
+ out[29 + outpos] = ((in[26 + inpos] >>> 9) | ((in[27 + inpos] & 63) << (29 - 6)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[21 + inpos] >>> 18) | ((in[22 + inpos] & 511) << (23 - 9)))
+ out[30 + outpos] = ((in[27 + inpos] >>> 6) | ((in[28 + inpos] & 7) << (29 - 3)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[22 + inpos] >>> 9))
+ out[31 + outpos] = ((in[28 + inpos] >>> 3))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack24(final int initoffset,
+ protected static void integratedunpack3(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 16777215))
- + initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 24) | ((in[1 + inpos] & 65535) << (24 - 16)))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 7)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 3) & 7))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 16) | ((in[2 + inpos] & 255) << (24 - 8)))
+ out[2 + outpos] = (((in[0 + inpos] >>> 6) & 7))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 8)) + out[3 + outpos - 1];
- out[4 + outpos] = (((in[3 + inpos] >>> 0) & 16777215))
+ out[3 + outpos] = (((in[0 + inpos] >>> 9) & 7))
+ + out[3 + outpos - 1];
+ out[4 + outpos] = (((in[0 + inpos] >>> 12) & 7))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 65535) << (24 - 16)))
+ out[5 + outpos] = (((in[0 + inpos] >>> 15) & 7))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[4 + inpos] >>> 16) | ((in[5 + inpos] & 255) << (24 - 8)))
+ out[6 + outpos] = (((in[0 + inpos] >>> 18) & 7))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[5 + inpos] >>> 8)) + out[7 + outpos - 1];
- out[8 + outpos] = (((in[6 + inpos] >>> 0) & 16777215))
+ out[7 + outpos] = (((in[0 + inpos] >>> 21) & 7))
+ + out[7 + outpos - 1];
+ out[8 + outpos] = (((in[0 + inpos] >>> 24) & 7))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 65535) << (24 - 16)))
+ out[9 + outpos] = (((in[0 + inpos] >>> 27) & 7))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[7 + inpos] >>> 16) | ((in[8 + inpos] & 255) << (24 - 8)))
+ out[10 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 1) << (3 - 1)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[8 + inpos] >>> 8))
+ out[11 + outpos] = (((in[1 + inpos] >>> 1) & 7))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[9 + inpos] >>> 0) & 16777215))
+ out[12 + outpos] = (((in[1 + inpos] >>> 4) & 7))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 65535) << (24 - 16)))
+ out[13 + outpos] = (((in[1 + inpos] >>> 7) & 7))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[10 + inpos] >>> 16) | ((in[11 + inpos] & 255) << (24 - 8)))
+ out[14 + outpos] = (((in[1 + inpos] >>> 10) & 7))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[11 + inpos] >>> 8))
+ out[15 + outpos] = (((in[1 + inpos] >>> 13) & 7))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[12 + inpos] >>> 0) & 16777215))
+ out[16 + outpos] = (((in[1 + inpos] >>> 16) & 7))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[12 + inpos] >>> 24) | ((in[13 + inpos] & 65535) << (24 - 16)))
+ out[17 + outpos] = (((in[1 + inpos] >>> 19) & 7))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[13 + inpos] >>> 16) | ((in[14 + inpos] & 255) << (24 - 8)))
+ out[18 + outpos] = (((in[1 + inpos] >>> 22) & 7))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[14 + inpos] >>> 8))
+ out[19 + outpos] = (((in[1 + inpos] >>> 25) & 7))
+ out[19 + outpos - 1];
- out[20 + outpos] = (((in[15 + inpos] >>> 0) & 16777215))
+ out[20 + outpos] = (((in[1 + inpos] >>> 28) & 7))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 65535) << (24 - 16)))
+ out[21 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 3) << (3 - 2)))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[16 + inpos] >>> 16) | ((in[17 + inpos] & 255) << (24 - 8)))
+ out[22 + outpos] = (((in[2 + inpos] >>> 2) & 7))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[17 + inpos] >>> 8))
+ out[23 + outpos] = (((in[2 + inpos] >>> 5) & 7))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[18 + inpos] >>> 0) & 16777215))
+ out[24 + outpos] = (((in[2 + inpos] >>> 8) & 7))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 65535) << (24 - 16)))
+ out[25 + outpos] = (((in[2 + inpos] >>> 11) & 7))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[19 + inpos] >>> 16) | ((in[20 + inpos] & 255) << (24 - 8)))
+ out[26 + outpos] = (((in[2 + inpos] >>> 14) & 7))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[20 + inpos] >>> 8))
+ out[27 + outpos] = (((in[2 + inpos] >>> 17) & 7))
+ out[27 + outpos - 1];
- out[28 + outpos] = (((in[21 + inpos] >>> 0) & 16777215))
+ out[28 + outpos] = (((in[2 + inpos] >>> 20) & 7))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[21 + inpos] >>> 24) | ((in[22 + inpos] & 65535) << (24 - 16)))
+ out[29 + outpos] = (((in[2 + inpos] >>> 23) & 7))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[22 + inpos] >>> 16) | ((in[23 + inpos] & 255) << (24 - 8)))
+ out[30 + outpos] = (((in[2 + inpos] >>> 26) & 7))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[23 + inpos] >>> 8))
+ out[31 + outpos] = ((in[2 + inpos] >>> 29))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack25(final int initoffset,
+ protected static void integratedunpack30(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 33554431))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1073741823))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 25) | ((in[1 + inpos] & 262143) << (25 - 18)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 268435455) << (30 - 28)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 18) | ((in[2 + inpos] & 2047) << (25 - 11)))
+ out[2 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 67108863) << (30 - 26)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 11) | ((in[3 + inpos] & 15) << (25 - 4)))
+ out[3 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 16777215) << (30 - 24)))
+ out[3 + outpos - 1];
- out[4 + outpos] = (((in[3 + inpos] >>> 4) & 33554431))
+ out[4 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 4194303) << (30 - 22)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[3 + inpos] >>> 29) | ((in[4 + inpos] & 4194303) << (25 - 22)))
+ out[5 + outpos] = ((in[4 + inpos] >>> 22) | ((in[5 + inpos] & 1048575) << (30 - 20)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[4 + inpos] >>> 22) | ((in[5 + inpos] & 32767) << (25 - 15)))
+ out[6 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 262143) << (30 - 18)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[5 + inpos] >>> 15) | ((in[6 + inpos] & 255) << (25 - 8)))
+ out[7 + outpos] = ((in[6 + inpos] >>> 18) | ((in[7 + inpos] & 65535) << (30 - 16)))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[6 + inpos] >>> 8) | ((in[7 + inpos] & 1) << (25 - 1)))
+ out[8 + outpos] = ((in[7 + inpos] >>> 16) | ((in[8 + inpos] & 16383) << (30 - 14)))
+ out[8 + outpos - 1];
- out[9 + outpos] = (((in[7 + inpos] >>> 1) & 33554431))
+ out[9 + outpos] = ((in[8 + inpos] >>> 14) | ((in[9 + inpos] & 4095) << (30 - 12)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[7 + inpos] >>> 26) | ((in[8 + inpos] & 524287) << (25 - 19)))
+ out[10 + outpos] = ((in[9 + inpos] >>> 12) | ((in[10 + inpos] & 1023) << (30 - 10)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[8 + inpos] >>> 19) | ((in[9 + inpos] & 4095) << (25 - 12)))
+ out[11 + outpos] = ((in[10 + inpos] >>> 10) | ((in[11 + inpos] & 255) << (30 - 8)))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[9 + inpos] >>> 12) | ((in[10 + inpos] & 31) << (25 - 5)))
+ out[12 + outpos] = ((in[11 + inpos] >>> 8) | ((in[12 + inpos] & 63) << (30 - 6)))
+ out[12 + outpos - 1];
- out[13 + outpos] = (((in[10 + inpos] >>> 5) & 33554431))
+ out[13 + outpos] = ((in[12 + inpos] >>> 6) | ((in[13 + inpos] & 15) << (30 - 4)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[10 + inpos] >>> 30) | ((in[11 + inpos] & 8388607) << (25 - 23)))
+ out[14 + outpos] = ((in[13 + inpos] >>> 4) | ((in[14 + inpos] & 3) << (30 - 2)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[11 + inpos] >>> 23) | ((in[12 + inpos] & 65535) << (25 - 16)))
+ out[15 + outpos] = ((in[14 + inpos] >>> 2))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[12 + inpos] >>> 16) | ((in[13 + inpos] & 511) << (25 - 9)))
+ out[16 + outpos] = (((in[15 + inpos] >>> 0) & 1073741823))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[13 + inpos] >>> 9) | ((in[14 + inpos] & 3) << (25 - 2)))
+ out[17 + outpos] = ((in[15 + inpos] >>> 30) | ((in[16 + inpos] & 268435455) << (30 - 28)))
+ out[17 + outpos - 1];
- out[18 + outpos] = (((in[14 + inpos] >>> 2) & 33554431))
+ out[18 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 67108863) << (30 - 26)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[14 + inpos] >>> 27) | ((in[15 + inpos] & 1048575) << (25 - 20)))
+ out[19 + outpos] = ((in[17 + inpos] >>> 26) | ((in[18 + inpos] & 16777215) << (30 - 24)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[15 + inpos] >>> 20) | ((in[16 + inpos] & 8191) << (25 - 13)))
+ out[20 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 4194303) << (30 - 22)))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[16 + inpos] >>> 13) | ((in[17 + inpos] & 63) << (25 - 6)))
+ out[21 + outpos] = ((in[19 + inpos] >>> 22) | ((in[20 + inpos] & 1048575) << (30 - 20)))
+ out[21 + outpos - 1];
- out[22 + outpos] = (((in[17 + inpos] >>> 6) & 33554431))
+ out[22 + outpos] = ((in[20 + inpos] >>> 20) | ((in[21 + inpos] & 262143) << (30 - 18)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[17 + inpos] >>> 31) | ((in[18 + inpos] & 16777215) << (25 - 24)))
+ out[23 + outpos] = ((in[21 + inpos] >>> 18) | ((in[22 + inpos] & 65535) << (30 - 16)))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 131071) << (25 - 17)))
+ out[24 + outpos] = ((in[22 + inpos] >>> 16) | ((in[23 + inpos] & 16383) << (30 - 14)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[19 + inpos] >>> 17) | ((in[20 + inpos] & 1023) << (25 - 10)))
+ out[25 + outpos] = ((in[23 + inpos] >>> 14) | ((in[24 + inpos] & 4095) << (30 - 12)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[20 + inpos] >>> 10) | ((in[21 + inpos] & 7) << (25 - 3)))
+ out[26 + outpos] = ((in[24 + inpos] >>> 12) | ((in[25 + inpos] & 1023) << (30 - 10)))
+ out[26 + outpos - 1];
- out[27 + outpos] = (((in[21 + inpos] >>> 3) & 33554431))
+ out[27 + outpos] = ((in[25 + inpos] >>> 10) | ((in[26 + inpos] & 255) << (30 - 8)))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[21 + inpos] >>> 28) | ((in[22 + inpos] & 2097151) << (25 - 21)))
+ out[28 + outpos] = ((in[26 + inpos] >>> 8) | ((in[27 + inpos] & 63) << (30 - 6)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[22 + inpos] >>> 21) | ((in[23 + inpos] & 16383) << (25 - 14)))
+ out[29 + outpos] = ((in[27 + inpos] >>> 6) | ((in[28 + inpos] & 15) << (30 - 4)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[23 + inpos] >>> 14) | ((in[24 + inpos] & 127) << (25 - 7)))
+ out[30 + outpos] = ((in[28 + inpos] >>> 4) | ((in[29 + inpos] & 3) << (30 - 2)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[24 + inpos] >>> 7))
+ out[31 + outpos] = ((in[29 + inpos] >>> 2))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack26(final int initoffset,
+ protected static void integratedunpack31(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 67108863))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 2147483647))
+ initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 26) | ((in[1 + inpos] & 1048575) << (26 - 20)))
+ out[1 + outpos] = ((in[0 + inpos] >>> 31) | ((in[1 + inpos] & 1073741823) << (31 - 30)))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 20) | ((in[2 + inpos] & 16383) << (26 - 14)))
+ out[2 + outpos] = ((in[1 + inpos] >>> 30) | ((in[2 + inpos] & 536870911) << (31 - 29)))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 14) | ((in[3 + inpos] & 255) << (26 - 8)))
+ out[3 + outpos] = ((in[2 + inpos] >>> 29) | ((in[3 + inpos] & 268435455) << (31 - 28)))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[3 + inpos] >>> 8) | ((in[4 + inpos] & 3) << (26 - 2)))
+ out[4 + outpos] = ((in[3 + inpos] >>> 28) | ((in[4 + inpos] & 134217727) << (31 - 27)))
+ out[4 + outpos - 1];
- out[5 + outpos] = (((in[4 + inpos] >>> 2) & 67108863))
+ out[5 + outpos] = ((in[4 + inpos] >>> 27) | ((in[5 + inpos] & 67108863) << (31 - 26)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 4194303) << (26 - 22)))
+ out[6 + outpos] = ((in[5 + inpos] >>> 26) | ((in[6 + inpos] & 33554431) << (31 - 25)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[5 + inpos] >>> 22) | ((in[6 + inpos] & 65535) << (26 - 16)))
+ out[7 + outpos] = ((in[6 + inpos] >>> 25) | ((in[7 + inpos] & 16777215) << (31 - 24)))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[6 + inpos] >>> 16) | ((in[7 + inpos] & 1023) << (26 - 10)))
+ out[8 + outpos] = ((in[7 + inpos] >>> 24) | ((in[8 + inpos] & 8388607) << (31 - 23)))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[7 + inpos] >>> 10) | ((in[8 + inpos] & 15) << (26 - 4)))
+ out[9 + outpos] = ((in[8 + inpos] >>> 23) | ((in[9 + inpos] & 4194303) << (31 - 22)))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[8 + inpos] >>> 4) & 67108863))
+ out[10 + outpos] = ((in[9 + inpos] >>> 22) | ((in[10 + inpos] & 2097151) << (31 - 21)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[8 + inpos] >>> 30) | ((in[9 + inpos] & 16777215) << (26 - 24)))
+ out[11 + outpos] = ((in[10 + inpos] >>> 21) | ((in[11 + inpos] & 1048575) << (31 - 20)))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[9 + inpos] >>> 24) | ((in[10 + inpos] & 262143) << (26 - 18)))
+ out[12 + outpos] = ((in[11 + inpos] >>> 20) | ((in[12 + inpos] & 524287) << (31 - 19)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[10 + inpos] >>> 18) | ((in[11 + inpos] & 4095) << (26 - 12)))
+ out[13 + outpos] = ((in[12 + inpos] >>> 19) | ((in[13 + inpos] & 262143) << (31 - 18)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[11 + inpos] >>> 12) | ((in[12 + inpos] & 63) << (26 - 6)))
+ out[14 + outpos] = ((in[13 + inpos] >>> 18) | ((in[14 + inpos] & 131071) << (31 - 17)))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[12 + inpos] >>> 6))
+ out[15 + outpos] = ((in[14 + inpos] >>> 17) | ((in[15 + inpos] & 65535) << (31 - 16)))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[13 + inpos] >>> 0) & 67108863))
+ out[16 + outpos] = ((in[15 + inpos] >>> 16) | ((in[16 + inpos] & 32767) << (31 - 15)))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[13 + inpos] >>> 26) | ((in[14 + inpos] & 1048575) << (26 - 20)))
+ out[17 + outpos] = ((in[16 + inpos] >>> 15) | ((in[17 + inpos] & 16383) << (31 - 14)))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[14 + inpos] >>> 20) | ((in[15 + inpos] & 16383) << (26 - 14)))
+ out[18 + outpos] = ((in[17 + inpos] >>> 14) | ((in[18 + inpos] & 8191) << (31 - 13)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[15 + inpos] >>> 14) | ((in[16 + inpos] & 255) << (26 - 8)))
+ out[19 + outpos] = ((in[18 + inpos] >>> 13) | ((in[19 + inpos] & 4095) << (31 - 12)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[16 + inpos] >>> 8) | ((in[17 + inpos] & 3) << (26 - 2)))
+ out[20 + outpos] = ((in[19 + inpos] >>> 12) | ((in[20 + inpos] & 2047) << (31 - 11)))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[17 + inpos] >>> 2) & 67108863))
+ out[21 + outpos] = ((in[20 + inpos] >>> 11) | ((in[21 + inpos] & 1023) << (31 - 10)))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[17 + inpos] >>> 28) | ((in[18 + inpos] & 4194303) << (26 - 22)))
+ out[22 + outpos] = ((in[21 + inpos] >>> 10) | ((in[22 + inpos] & 511) << (31 - 9)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[18 + inpos] >>> 22) | ((in[19 + inpos] & 65535) << (26 - 16)))
+ out[23 + outpos] = ((in[22 + inpos] >>> 9) | ((in[23 + inpos] & 255) << (31 - 8)))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[19 + inpos] >>> 16) | ((in[20 + inpos] & 1023) << (26 - 10)))
+ out[24 + outpos] = ((in[23 + inpos] >>> 8) | ((in[24 + inpos] & 127) << (31 - 7)))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[20 + inpos] >>> 10) | ((in[21 + inpos] & 15) << (26 - 4)))
+ out[25 + outpos] = ((in[24 + inpos] >>> 7) | ((in[25 + inpos] & 63) << (31 - 6)))
+ out[25 + outpos - 1];
- out[26 + outpos] = (((in[21 + inpos] >>> 4) & 67108863))
+ out[26 + outpos] = ((in[25 + inpos] >>> 6) | ((in[26 + inpos] & 31) << (31 - 5)))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[21 + inpos] >>> 30) | ((in[22 + inpos] & 16777215) << (26 - 24)))
+ out[27 + outpos] = ((in[26 + inpos] >>> 5) | ((in[27 + inpos] & 15) << (31 - 4)))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[22 + inpos] >>> 24) | ((in[23 + inpos] & 262143) << (26 - 18)))
+ out[28 + outpos] = ((in[27 + inpos] >>> 4) | ((in[28 + inpos] & 7) << (31 - 3)))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[23 + inpos] >>> 18) | ((in[24 + inpos] & 4095) << (26 - 12)))
+ out[29 + outpos] = ((in[28 + inpos] >>> 3) | ((in[29 + inpos] & 3) << (31 - 2)))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[24 + inpos] >>> 12) | ((in[25 + inpos] & 63) << (26 - 6)))
+ out[30 + outpos] = ((in[29 + inpos] >>> 2) | ((in[30 + inpos] & 1) << (31 - 1)))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[25 + inpos] >>> 6))
+ out[31 + outpos] = ((in[30 + inpos] >>> 1))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack27(final int initoffset,
+ protected static void integratedunpack32(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 134217727))
- + initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 27) | ((in[1 + inpos] & 4194303) << (27 - 22)))
- + out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 22) | ((in[2 + inpos] & 131071) << (27 - 17)))
- + out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 17) | ((in[3 + inpos] & 4095) << (27 - 12)))
+ System.arraycopy(in, inpos, out, outpos, 32); // no sense in
+ // doing delta
+ // coding
+ }
+
+ protected static void integratedunpack4(final int initoffset,
+ final int[] in, int inpos, final int[] out, int outpos) {
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 15)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 4) & 15))
+ + out[1 + outpos - 1];
+ out[2 + outpos] = (((in[0 + inpos] >>> 8) & 15))
+ + out[2 + outpos - 1];
+ out[3 + outpos] = (((in[0 + inpos] >>> 12) & 15))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[3 + inpos] >>> 12) | ((in[4 + inpos] & 127) << (27 - 7)))
+ out[4 + outpos] = (((in[0 + inpos] >>> 16) & 15))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[4 + inpos] >>> 7) | ((in[5 + inpos] & 3) << (27 - 2)))
+ out[5 + outpos] = (((in[0 + inpos] >>> 20) & 15))
+ out[5 + outpos - 1];
- out[6 + outpos] = (((in[5 + inpos] >>> 2) & 134217727))
+ out[6 + outpos] = (((in[0 + inpos] >>> 24) & 15))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 16777215) << (27 - 24)))
+ out[7 + outpos] = ((in[0 + inpos] >>> 28))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 524287) << (27 - 19)))
+ out[8 + outpos] = (((in[1 + inpos] >>> 0) & 15))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[7 + inpos] >>> 19) | ((in[8 + inpos] & 16383) << (27 - 14)))
+ out[9 + outpos] = (((in[1 + inpos] >>> 4) & 15))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[8 + inpos] >>> 14) | ((in[9 + inpos] & 511) << (27 - 9)))
+ out[10 + outpos] = (((in[1 + inpos] >>> 8) & 15))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[9 + inpos] >>> 9) | ((in[10 + inpos] & 15) << (27 - 4)))
+ out[11 + outpos] = (((in[1 + inpos] >>> 12) & 15))
+ out[11 + outpos - 1];
- out[12 + outpos] = (((in[10 + inpos] >>> 4) & 134217727))
+ out[12 + outpos] = (((in[1 + inpos] >>> 16) & 15))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[10 + inpos] >>> 31) | ((in[11 + inpos] & 67108863) << (27 - 26)))
+ out[13 + outpos] = (((in[1 + inpos] >>> 20) & 15))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[11 + inpos] >>> 26) | ((in[12 + inpos] & 2097151) << (27 - 21)))
+ out[14 + outpos] = (((in[1 + inpos] >>> 24) & 15))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[12 + inpos] >>> 21) | ((in[13 + inpos] & 65535) << (27 - 16)))
+ out[15 + outpos] = ((in[1 + inpos] >>> 28))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[13 + inpos] >>> 16) | ((in[14 + inpos] & 2047) << (27 - 11)))
+ out[16 + outpos] = (((in[2 + inpos] >>> 0) & 15))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[14 + inpos] >>> 11) | ((in[15 + inpos] & 63) << (27 - 6)))
+ out[17 + outpos] = (((in[2 + inpos] >>> 4) & 15))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[15 + inpos] >>> 6) | ((in[16 + inpos] & 1) << (27 - 1)))
+ out[18 + outpos] = (((in[2 + inpos] >>> 8) & 15))
+ out[18 + outpos - 1];
- out[19 + outpos] = (((in[16 + inpos] >>> 1) & 134217727))
+ out[19 + outpos] = (((in[2 + inpos] >>> 12) & 15))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 8388607) << (27 - 23)))
+ out[20 + outpos] = (((in[2 + inpos] >>> 16) & 15))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[17 + inpos] >>> 23) | ((in[18 + inpos] & 262143) << (27 - 18)))
+ out[21 + outpos] = (((in[2 + inpos] >>> 20) & 15))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[18 + inpos] >>> 18) | ((in[19 + inpos] & 8191) << (27 - 13)))
+ out[22 + outpos] = (((in[2 + inpos] >>> 24) & 15))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[19 + inpos] >>> 13) | ((in[20 + inpos] & 255) << (27 - 8)))
+ out[23 + outpos] = ((in[2 + inpos] >>> 28))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[20 + inpos] >>> 8) | ((in[21 + inpos] & 7) << (27 - 3)))
+ out[24 + outpos] = (((in[3 + inpos] >>> 0) & 15))
+ out[24 + outpos - 1];
- out[25 + outpos] = (((in[21 + inpos] >>> 3) & 134217727))
+ out[25 + outpos] = (((in[3 + inpos] >>> 4) & 15))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[21 + inpos] >>> 30) | ((in[22 + inpos] & 33554431) << (27 - 25)))
+ out[26 + outpos] = (((in[3 + inpos] >>> 8) & 15))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[22 + inpos] >>> 25) | ((in[23 + inpos] & 1048575) << (27 - 20)))
+ out[27 + outpos] = (((in[3 + inpos] >>> 12) & 15))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[23 + inpos] >>> 20) | ((in[24 + inpos] & 32767) << (27 - 15)))
+ out[28 + outpos] = (((in[3 + inpos] >>> 16) & 15))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[24 + inpos] >>> 15) | ((in[25 + inpos] & 1023) << (27 - 10)))
+ out[29 + outpos] = (((in[3 + inpos] >>> 20) & 15))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[25 + inpos] >>> 10) | ((in[26 + inpos] & 31) << (27 - 5)))
+ out[30 + outpos] = (((in[3 + inpos] >>> 24) & 15))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[26 + inpos] >>> 5))
+ out[31 + outpos] = ((in[3 + inpos] >>> 28))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack28(final int initoffset,
+ protected static void integratedunpack5(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 268435455))
- + initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 28) | ((in[1 + inpos] & 16777215) << (28 - 24)))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 31)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 5) & 31))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 24) | ((in[2 + inpos] & 1048575) << (28 - 20)))
+ out[2 + outpos] = (((in[0 + inpos] >>> 10) & 31))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 20) | ((in[3 + inpos] & 65535) << (28 - 16)))
+ out[3 + outpos] = (((in[0 + inpos] >>> 15) & 31))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[3 + inpos] >>> 16) | ((in[4 + inpos] & 4095) << (28 - 12)))
+ out[4 + outpos] = (((in[0 + inpos] >>> 20) & 31))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[4 + inpos] >>> 12) | ((in[5 + inpos] & 255) << (28 - 8)))
+ out[5 + outpos] = (((in[0 + inpos] >>> 25) & 31))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[5 + inpos] >>> 8) | ((in[6 + inpos] & 15) << (28 - 4)))
+ out[6 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 7) << (5 - 3)))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[6 + inpos] >>> 4)) + out[7 + outpos - 1];
- out[8 + outpos] = (((in[7 + inpos] >>> 0) & 268435455))
+ out[7 + outpos] = (((in[1 + inpos] >>> 3) & 31))
+ + out[7 + outpos - 1];
+ out[8 + outpos] = (((in[1 + inpos] >>> 8) & 31))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 16777215) << (28 - 24)))
+ out[9 + outpos] = (((in[1 + inpos] >>> 13) & 31))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[8 + inpos] >>> 24) | ((in[9 + inpos] & 1048575) << (28 - 20)))
+ out[10 + outpos] = (((in[1 + inpos] >>> 18) & 31))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[9 + inpos] >>> 20) | ((in[10 + inpos] & 65535) << (28 - 16)))
+ out[11 + outpos] = (((in[1 + inpos] >>> 23) & 31))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[10 + inpos] >>> 16) | ((in[11 + inpos] & 4095) << (28 - 12)))
+ out[12 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 1) << (5 - 1)))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[11 + inpos] >>> 12) | ((in[12 + inpos] & 255) << (28 - 8)))
+ out[13 + outpos] = (((in[2 + inpos] >>> 1) & 31))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[12 + inpos] >>> 8) | ((in[13 + inpos] & 15) << (28 - 4)))
+ out[14 + outpos] = (((in[2 + inpos] >>> 6) & 31))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[13 + inpos] >>> 4))
+ out[15 + outpos] = (((in[2 + inpos] >>> 11) & 31))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[14 + inpos] >>> 0) & 268435455))
+ out[16 + outpos] = (((in[2 + inpos] >>> 16) & 31))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[14 + inpos] >>> 28) | ((in[15 + inpos] & 16777215) << (28 - 24)))
+ out[17 + outpos] = (((in[2 + inpos] >>> 21) & 31))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[15 + inpos] >>> 24) | ((in[16 + inpos] & 1048575) << (28 - 20)))
+ out[18 + outpos] = (((in[2 + inpos] >>> 26) & 31))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[16 + inpos] >>> 20) | ((in[17 + inpos] & 65535) << (28 - 16)))
+ out[19 + outpos] = ((in[2 + inpos] >>> 31) | ((in[3 + inpos] & 15) << (5 - 4)))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[17 + inpos] >>> 16) | ((in[18 + inpos] & 4095) << (28 - 12)))
+ out[20 + outpos] = (((in[3 + inpos] >>> 4) & 31))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[18 + inpos] >>> 12) | ((in[19 + inpos] & 255) << (28 - 8)))
+ out[21 + outpos] = (((in[3 + inpos] >>> 9) & 31))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[19 + inpos] >>> 8) | ((in[20 + inpos] & 15) << (28 - 4)))
+ out[22 + outpos] = (((in[3 + inpos] >>> 14) & 31))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[20 + inpos] >>> 4))
+ out[23 + outpos] = (((in[3 + inpos] >>> 19) & 31))
+ out[23 + outpos - 1];
- out[24 + outpos] = (((in[21 + inpos] >>> 0) & 268435455))
+ out[24 + outpos] = (((in[3 + inpos] >>> 24) & 31))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[21 + inpos] >>> 28) | ((in[22 + inpos] & 16777215) << (28 - 24)))
+ out[25 + outpos] = ((in[3 + inpos] >>> 29) | ((in[4 + inpos] & 3) << (5 - 2)))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[22 + inpos] >>> 24) | ((in[23 + inpos] & 1048575) << (28 - 20)))
+ out[26 + outpos] = (((in[4 + inpos] >>> 2) & 31))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[23 + inpos] >>> 20) | ((in[24 + inpos] & 65535) << (28 - 16)))
+ out[27 + outpos] = (((in[4 + inpos] >>> 7) & 31))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[24 + inpos] >>> 16) | ((in[25 + inpos] & 4095) << (28 - 12)))
+ out[28 + outpos] = (((in[4 + inpos] >>> 12) & 31))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[25 + inpos] >>> 12) | ((in[26 + inpos] & 255) << (28 - 8)))
+ out[29 + outpos] = (((in[4 + inpos] >>> 17) & 31))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[26 + inpos] >>> 8) | ((in[27 + inpos] & 15) << (28 - 4)))
+ out[30 + outpos] = (((in[4 + inpos] >>> 22) & 31))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[27 + inpos] >>> 4))
+ out[31 + outpos] = ((in[4 + inpos] >>> 27))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack29(final int initoffset,
+ protected static void integratedunpack6(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 536870911))
- + initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 29) | ((in[1 + inpos] & 67108863) << (29 - 26)))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 63)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 6) & 63))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 26) | ((in[2 + inpos] & 8388607) << (29 - 23)))
+ out[2 + outpos] = (((in[0 + inpos] >>> 12) & 63))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 23) | ((in[3 + inpos] & 1048575) << (29 - 20)))
+ out[3 + outpos] = (((in[0 + inpos] >>> 18) & 63))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[3 + inpos] >>> 20) | ((in[4 + inpos] & 131071) << (29 - 17)))
+ out[4 + outpos] = (((in[0 + inpos] >>> 24) & 63))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[4 + inpos] >>> 17) | ((in[5 + inpos] & 16383) << (29 - 14)))
+ out[5 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 15) << (6 - 4)))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[5 + inpos] >>> 14) | ((in[6 + inpos] & 2047) << (29 - 11)))
+ out[6 + outpos] = (((in[1 + inpos] >>> 4) & 63))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[6 + inpos] >>> 11) | ((in[7 + inpos] & 255) << (29 - 8)))
+ out[7 + outpos] = (((in[1 + inpos] >>> 10) & 63))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[7 + inpos] >>> 8) | ((in[8 + inpos] & 31) << (29 - 5)))
+ out[8 + outpos] = (((in[1 + inpos] >>> 16) & 63))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[8 + inpos] >>> 5) | ((in[9 + inpos] & 3) << (29 - 2)))
+ out[9 + outpos] = (((in[1 + inpos] >>> 22) & 63))
+ out[9 + outpos - 1];
- out[10 + outpos] = (((in[9 + inpos] >>> 2) & 536870911))
+ out[10 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 3) << (6 - 2)))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[9 + inpos] >>> 31) | ((in[10 + inpos] & 268435455) << (29 - 28)))
+ out[11 + outpos] = (((in[2 + inpos] >>> 2) & 63))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[10 + inpos] >>> 28) | ((in[11 + inpos] & 33554431) << (29 - 25)))
+ out[12 + outpos] = (((in[2 + inpos] >>> 8) & 63))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[11 + inpos] >>> 25) | ((in[12 + inpos] & 4194303) << (29 - 22)))
+ out[13 + outpos] = (((in[2 + inpos] >>> 14) & 63))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[12 + inpos] >>> 22) | ((in[13 + inpos] & 524287) << (29 - 19)))
+ out[14 + outpos] = (((in[2 + inpos] >>> 20) & 63))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[13 + inpos] >>> 19) | ((in[14 + inpos] & 65535) << (29 - 16)))
+ out[15 + outpos] = ((in[2 + inpos] >>> 26))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[14 + inpos] >>> 16) | ((in[15 + inpos] & 8191) << (29 - 13)))
+ out[16 + outpos] = (((in[3 + inpos] >>> 0) & 63))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[15 + inpos] >>> 13) | ((in[16 + inpos] & 1023) << (29 - 10)))
+ out[17 + outpos] = (((in[3 + inpos] >>> 6) & 63))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[16 + inpos] >>> 10) | ((in[17 + inpos] & 127) << (29 - 7)))
+ out[18 + outpos] = (((in[3 + inpos] >>> 12) & 63))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[17 + inpos] >>> 7) | ((in[18 + inpos] & 15) << (29 - 4)))
+ out[19 + outpos] = (((in[3 + inpos] >>> 18) & 63))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[18 + inpos] >>> 4) | ((in[19 + inpos] & 1) << (29 - 1)))
+ out[20 + outpos] = (((in[3 + inpos] >>> 24) & 63))
+ out[20 + outpos - 1];
- out[21 + outpos] = (((in[19 + inpos] >>> 1) & 536870911))
+ out[21 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 15) << (6 - 4)))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[19 + inpos] >>> 30) | ((in[20 + inpos] & 134217727) << (29 - 27)))
+ out[22 + outpos] = (((in[4 + inpos] >>> 4) & 63))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[20 + inpos] >>> 27) | ((in[21 + inpos] & 16777215) << (29 - 24)))
+ out[23 + outpos] = (((in[4 + inpos] >>> 10) & 63))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[21 + inpos] >>> 24) | ((in[22 + inpos] & 2097151) << (29 - 21)))
+ out[24 + outpos] = (((in[4 + inpos] >>> 16) & 63))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[22 + inpos] >>> 21) | ((in[23 + inpos] & 262143) << (29 - 18)))
+ out[25 + outpos] = (((in[4 + inpos] >>> 22) & 63))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[23 + inpos] >>> 18) | ((in[24 + inpos] & 32767) << (29 - 15)))
+ out[26 + outpos] = ((in[4 + inpos] >>> 28) | ((in[5 + inpos] & 3) << (6 - 2)))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[24 + inpos] >>> 15) | ((in[25 + inpos] & 4095) << (29 - 12)))
+ out[27 + outpos] = (((in[5 + inpos] >>> 2) & 63))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[25 + inpos] >>> 12) | ((in[26 + inpos] & 511) << (29 - 9)))
+ out[28 + outpos] = (((in[5 + inpos] >>> 8) & 63))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[26 + inpos] >>> 9) | ((in[27 + inpos] & 63) << (29 - 6)))
+ out[29 + outpos] = (((in[5 + inpos] >>> 14) & 63))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[27 + inpos] >>> 6) | ((in[28 + inpos] & 7) << (29 - 3)))
+ out[30 + outpos] = (((in[5 + inpos] >>> 20) & 63))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[28 + inpos] >>> 3))
+ out[31 + outpos] = ((in[5 + inpos] >>> 26))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack30(final int initoffset,
+ protected static void integratedunpack7(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 1073741823))
- + initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 30) | ((in[1 + inpos] & 268435455) << (30 - 28)))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 127)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 7) & 127))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 28) | ((in[2 + inpos] & 67108863) << (30 - 26)))
+ out[2 + outpos] = (((in[0 + inpos] >>> 14) & 127))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 16777215) << (30 - 24)))
+ out[3 + outpos] = (((in[0 + inpos] >>> 21) & 127))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[3 + inpos] >>> 24) | ((in[4 + inpos] & 4194303) << (30 - 22)))
+ out[4 + outpos] = ((in[0 + inpos] >>> 28) | ((in[1 + inpos] & 7) << (7 - 3)))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[4 + inpos] >>> 22) | ((in[5 + inpos] & 1048575) << (30 - 20)))
+ out[5 + outpos] = (((in[1 + inpos] >>> 3) & 127))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[5 + inpos] >>> 20) | ((in[6 + inpos] & 262143) << (30 - 18)))
+ out[6 + outpos] = (((in[1 + inpos] >>> 10) & 127))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[6 + inpos] >>> 18) | ((in[7 + inpos] & 65535) << (30 - 16)))
+ out[7 + outpos] = (((in[1 + inpos] >>> 17) & 127))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[7 + inpos] >>> 16) | ((in[8 + inpos] & 16383) << (30 - 14)))
+ out[8 + outpos] = (((in[1 + inpos] >>> 24) & 127))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[8 + inpos] >>> 14) | ((in[9 + inpos] & 4095) << (30 - 12)))
+ out[9 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 63) << (7 - 6)))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[9 + inpos] >>> 12) | ((in[10 + inpos] & 1023) << (30 - 10)))
+ out[10 + outpos] = (((in[2 + inpos] >>> 6) & 127))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[10 + inpos] >>> 10) | ((in[11 + inpos] & 255) << (30 - 8)))
+ out[11 + outpos] = (((in[2 + inpos] >>> 13) & 127))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[11 + inpos] >>> 8) | ((in[12 + inpos] & 63) << (30 - 6)))
+ out[12 + outpos] = (((in[2 + inpos] >>> 20) & 127))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[12 + inpos] >>> 6) | ((in[13 + inpos] & 15) << (30 - 4)))
+ out[13 + outpos] = ((in[2 + inpos] >>> 27) | ((in[3 + inpos] & 3) << (7 - 2)))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[13 + inpos] >>> 4) | ((in[14 + inpos] & 3) << (30 - 2)))
+ out[14 + outpos] = (((in[3 + inpos] >>> 2) & 127))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[14 + inpos] >>> 2))
+ out[15 + outpos] = (((in[3 + inpos] >>> 9) & 127))
+ out[15 + outpos - 1];
- out[16 + outpos] = (((in[15 + inpos] >>> 0) & 1073741823))
+ out[16 + outpos] = (((in[3 + inpos] >>> 16) & 127))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[15 + inpos] >>> 30) | ((in[16 + inpos] & 268435455) << (30 - 28)))
+ out[17 + outpos] = (((in[3 + inpos] >>> 23) & 127))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[16 + inpos] >>> 28) | ((in[17 + inpos] & 67108863) << (30 - 26)))
+ out[18 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 31) << (7 - 5)))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[17 + inpos] >>> 26) | ((in[18 + inpos] & 16777215) << (30 - 24)))
+ out[19 + outpos] = (((in[4 + inpos] >>> 5) & 127))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[18 + inpos] >>> 24) | ((in[19 + inpos] & 4194303) << (30 - 22)))
+ out[20 + outpos] = (((in[4 + inpos] >>> 12) & 127))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[19 + inpos] >>> 22) | ((in[20 + inpos] & 1048575) << (30 - 20)))
+ out[21 + outpos] = (((in[4 + inpos] >>> 19) & 127))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[20 + inpos] >>> 20) | ((in[21 + inpos] & 262143) << (30 - 18)))
+ out[22 + outpos] = ((in[4 + inpos] >>> 26) | ((in[5 + inpos] & 1) << (7 - 1)))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[21 + inpos] >>> 18) | ((in[22 + inpos] & 65535) << (30 - 16)))
+ out[23 + outpos] = (((in[5 + inpos] >>> 1) & 127))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[22 + inpos] >>> 16) | ((in[23 + inpos] & 16383) << (30 - 14)))
+ out[24 + outpos] = (((in[5 + inpos] >>> 8) & 127))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[23 + inpos] >>> 14) | ((in[24 + inpos] & 4095) << (30 - 12)))
+ out[25 + outpos] = (((in[5 + inpos] >>> 15) & 127))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[24 + inpos] >>> 12) | ((in[25 + inpos] & 1023) << (30 - 10)))
+ out[26 + outpos] = (((in[5 + inpos] >>> 22) & 127))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[25 + inpos] >>> 10) | ((in[26 + inpos] & 255) << (30 - 8)))
+ out[27 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 15) << (7 - 4)))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[26 + inpos] >>> 8) | ((in[27 + inpos] & 63) << (30 - 6)))
+ out[28 + outpos] = (((in[6 + inpos] >>> 4) & 127))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[27 + inpos] >>> 6) | ((in[28 + inpos] & 15) << (30 - 4)))
+ out[29 + outpos] = (((in[6 + inpos] >>> 11) & 127))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[28 + inpos] >>> 4) | ((in[29 + inpos] & 3) << (30 - 2)))
+ out[30 + outpos] = (((in[6 + inpos] >>> 18) & 127))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[29 + inpos] >>> 2))
+ out[31 + outpos] = ((in[6 + inpos] >>> 25))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack31(final int initoffset,
+ protected static void integratedunpack8(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- out[0 + outpos] = (((in[0 + inpos] >>> 0) & 2147483647))
- + initoffset;
- out[1 + outpos] = ((in[0 + inpos] >>> 31) | ((in[1 + inpos] & 1073741823) << (31 - 30)))
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 255)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 8) & 255))
+ out[1 + outpos - 1];
- out[2 + outpos] = ((in[1 + inpos] >>> 30) | ((in[2 + inpos] & 536870911) << (31 - 29)))
+ out[2 + outpos] = (((in[0 + inpos] >>> 16) & 255))
+ out[2 + outpos - 1];
- out[3 + outpos] = ((in[2 + inpos] >>> 29) | ((in[3 + inpos] & 268435455) << (31 - 28)))
+ out[3 + outpos] = ((in[0 + inpos] >>> 24))
+ out[3 + outpos - 1];
- out[4 + outpos] = ((in[3 + inpos] >>> 28) | ((in[4 + inpos] & 134217727) << (31 - 27)))
+ out[4 + outpos] = (((in[1 + inpos] >>> 0) & 255))
+ out[4 + outpos - 1];
- out[5 + outpos] = ((in[4 + inpos] >>> 27) | ((in[5 + inpos] & 67108863) << (31 - 26)))
+ out[5 + outpos] = (((in[1 + inpos] >>> 8) & 255))
+ out[5 + outpos - 1];
- out[6 + outpos] = ((in[5 + inpos] >>> 26) | ((in[6 + inpos] & 33554431) << (31 - 25)))
+ out[6 + outpos] = (((in[1 + inpos] >>> 16) & 255))
+ out[6 + outpos - 1];
- out[7 + outpos] = ((in[6 + inpos] >>> 25) | ((in[7 + inpos] & 16777215) << (31 - 24)))
+ out[7 + outpos] = ((in[1 + inpos] >>> 24))
+ out[7 + outpos - 1];
- out[8 + outpos] = ((in[7 + inpos] >>> 24) | ((in[8 + inpos] & 8388607) << (31 - 23)))
+ out[8 + outpos] = (((in[2 + inpos] >>> 0) & 255))
+ out[8 + outpos - 1];
- out[9 + outpos] = ((in[8 + inpos] >>> 23) | ((in[9 + inpos] & 4194303) << (31 - 22)))
+ out[9 + outpos] = (((in[2 + inpos] >>> 8) & 255))
+ out[9 + outpos - 1];
- out[10 + outpos] = ((in[9 + inpos] >>> 22) | ((in[10 + inpos] & 2097151) << (31 - 21)))
+ out[10 + outpos] = (((in[2 + inpos] >>> 16) & 255))
+ out[10 + outpos - 1];
- out[11 + outpos] = ((in[10 + inpos] >>> 21) | ((in[11 + inpos] & 1048575) << (31 - 20)))
+ out[11 + outpos] = ((in[2 + inpos] >>> 24))
+ out[11 + outpos - 1];
- out[12 + outpos] = ((in[11 + inpos] >>> 20) | ((in[12 + inpos] & 524287) << (31 - 19)))
+ out[12 + outpos] = (((in[3 + inpos] >>> 0) & 255))
+ out[12 + outpos - 1];
- out[13 + outpos] = ((in[12 + inpos] >>> 19) | ((in[13 + inpos] & 262143) << (31 - 18)))
+ out[13 + outpos] = (((in[3 + inpos] >>> 8) & 255))
+ out[13 + outpos - 1];
- out[14 + outpos] = ((in[13 + inpos] >>> 18) | ((in[14 + inpos] & 131071) << (31 - 17)))
+ out[14 + outpos] = (((in[3 + inpos] >>> 16) & 255))
+ out[14 + outpos - 1];
- out[15 + outpos] = ((in[14 + inpos] >>> 17) | ((in[15 + inpos] & 65535) << (31 - 16)))
+ out[15 + outpos] = ((in[3 + inpos] >>> 24))
+ out[15 + outpos - 1];
- out[16 + outpos] = ((in[15 + inpos] >>> 16) | ((in[16 + inpos] & 32767) << (31 - 15)))
+ out[16 + outpos] = (((in[4 + inpos] >>> 0) & 255))
+ out[16 + outpos - 1];
- out[17 + outpos] = ((in[16 + inpos] >>> 15) | ((in[17 + inpos] & 16383) << (31 - 14)))
+ out[17 + outpos] = (((in[4 + inpos] >>> 8) & 255))
+ out[17 + outpos - 1];
- out[18 + outpos] = ((in[17 + inpos] >>> 14) | ((in[18 + inpos] & 8191) << (31 - 13)))
+ out[18 + outpos] = (((in[4 + inpos] >>> 16) & 255))
+ out[18 + outpos - 1];
- out[19 + outpos] = ((in[18 + inpos] >>> 13) | ((in[19 + inpos] & 4095) << (31 - 12)))
+ out[19 + outpos] = ((in[4 + inpos] >>> 24))
+ out[19 + outpos - 1];
- out[20 + outpos] = ((in[19 + inpos] >>> 12) | ((in[20 + inpos] & 2047) << (31 - 11)))
+ out[20 + outpos] = (((in[5 + inpos] >>> 0) & 255))
+ out[20 + outpos - 1];
- out[21 + outpos] = ((in[20 + inpos] >>> 11) | ((in[21 + inpos] & 1023) << (31 - 10)))
+ out[21 + outpos] = (((in[5 + inpos] >>> 8) & 255))
+ out[21 + outpos - 1];
- out[22 + outpos] = ((in[21 + inpos] >>> 10) | ((in[22 + inpos] & 511) << (31 - 9)))
+ out[22 + outpos] = (((in[5 + inpos] >>> 16) & 255))
+ out[22 + outpos - 1];
- out[23 + outpos] = ((in[22 + inpos] >>> 9) | ((in[23 + inpos] & 255) << (31 - 8)))
+ out[23 + outpos] = ((in[5 + inpos] >>> 24))
+ out[23 + outpos - 1];
- out[24 + outpos] = ((in[23 + inpos] >>> 8) | ((in[24 + inpos] & 127) << (31 - 7)))
+ out[24 + outpos] = (((in[6 + inpos] >>> 0) & 255))
+ out[24 + outpos - 1];
- out[25 + outpos] = ((in[24 + inpos] >>> 7) | ((in[25 + inpos] & 63) << (31 - 6)))
+ out[25 + outpos] = (((in[6 + inpos] >>> 8) & 255))
+ out[25 + outpos - 1];
- out[26 + outpos] = ((in[25 + inpos] >>> 6) | ((in[26 + inpos] & 31) << (31 - 5)))
+ out[26 + outpos] = (((in[6 + inpos] >>> 16) & 255))
+ out[26 + outpos - 1];
- out[27 + outpos] = ((in[26 + inpos] >>> 5) | ((in[27 + inpos] & 15) << (31 - 4)))
+ out[27 + outpos] = ((in[6 + inpos] >>> 24))
+ out[27 + outpos - 1];
- out[28 + outpos] = ((in[27 + inpos] >>> 4) | ((in[28 + inpos] & 7) << (31 - 3)))
+ out[28 + outpos] = (((in[7 + inpos] >>> 0) & 255))
+ out[28 + outpos - 1];
- out[29 + outpos] = ((in[28 + inpos] >>> 3) | ((in[29 + inpos] & 3) << (31 - 2)))
+ out[29 + outpos] = (((in[7 + inpos] >>> 8) & 255))
+ out[29 + outpos - 1];
- out[30 + outpos] = ((in[29 + inpos] >>> 2) | ((in[30 + inpos] & 1) << (31 - 1)))
+ out[30 + outpos] = (((in[7 + inpos] >>> 16) & 255))
+ out[30 + outpos - 1];
- out[31 + outpos] = ((in[30 + inpos] >>> 1))
+ out[31 + outpos] = ((in[7 + inpos] >>> 24))
+ out[31 + outpos - 1];
}
- protected static void integratedunpack32(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- System.arraycopy(in, inpos, out, outpos, 32); // no sense in
- // doing delta
- // coding
- }
-
- protected static void integratedpack32(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- System.arraycopy(in, inpos, out, outpos, 32); // no sense in
- // doing delta
- // coding
- }
-
- protected static void integratedunpack0(final int initoffset,
- final int[] in, int inpos, final int[] out, int outpos) {
- Arrays.fill(out, outpos, outpos + 32, initoffset);
- }
-
- protected static void integratedpack0(final int initoffset,
+ protected static void integratedunpack9(final int initoffset,
final int[] in, int inpos, final int[] out, int outpos) {
- // nothing
- }
-
- /**
- * Unpack 32 integers along with prefix sum computation
- *
- * @param initoffset value to add to all outputted values
- * @param in source array
- * @param inpos initial position in source array
- * @param out output array
- * @param outpos initial position in output array
- * @param bit number of bits to use per integer
- */
- public static void integratedunpack(final int initoffset,
- final int[] in, final int inpos, final int[] out, final int outpos,
- final int bit) {
- switch (bit) {
- case 0:
- integratedunpack0(initoffset, in, inpos, out, outpos);
- break;
- case 1:
- integratedunpack1(initoffset, in, inpos, out, outpos);
- break;
- case 2:
- integratedunpack2(initoffset, in, inpos, out, outpos);
- break;
- case 3:
- integratedunpack3(initoffset, in, inpos, out, outpos);
- break;
- case 4:
- integratedunpack4(initoffset, in, inpos, out, outpos);
- break;
- case 5:
- integratedunpack5(initoffset, in, inpos, out, outpos);
- break;
- case 6:
- integratedunpack6(initoffset, in, inpos, out, outpos);
- break;
- case 7:
- integratedunpack7(initoffset, in, inpos, out, outpos);
- break;
- case 8:
- integratedunpack8(initoffset, in, inpos, out, outpos);
- break;
- case 9:
- integratedunpack9(initoffset, in, inpos, out, outpos);
- break;
- case 10:
- integratedunpack10(initoffset, in, inpos, out, outpos);
- break;
- case 11:
- integratedunpack11(initoffset, in, inpos, out, outpos);
- break;
- case 12:
- integratedunpack12(initoffset, in, inpos, out, outpos);
- break;
- case 13:
- integratedunpack13(initoffset, in, inpos, out, outpos);
- break;
- case 14:
- integratedunpack14(initoffset, in, inpos, out, outpos);
- break;
- case 15:
- integratedunpack15(initoffset, in, inpos, out, outpos);
- break;
- case 16:
- integratedunpack16(initoffset, in, inpos, out, outpos);
- break;
- case 17:
- integratedunpack17(initoffset, in, inpos, out, outpos);
- break;
- case 18:
- integratedunpack18(initoffset, in, inpos, out, outpos);
- break;
- case 19:
- integratedunpack19(initoffset, in, inpos, out, outpos);
- break;
- case 20:
- integratedunpack20(initoffset, in, inpos, out, outpos);
- break;
- case 21:
- integratedunpack21(initoffset, in, inpos, out, outpos);
- break;
- case 22:
- integratedunpack22(initoffset, in, inpos, out, outpos);
- break;
- case 23:
- integratedunpack23(initoffset, in, inpos, out, outpos);
- break;
- case 24:
- integratedunpack24(initoffset, in, inpos, out, outpos);
- break;
- case 25:
- integratedunpack25(initoffset, in, inpos, out, outpos);
- break;
- case 26:
- integratedunpack26(initoffset, in, inpos, out, outpos);
- break;
- case 27:
- integratedunpack27(initoffset, in, inpos, out, outpos);
- break;
- case 28:
- integratedunpack28(initoffset, in, inpos, out, outpos);
- break;
- case 29:
- integratedunpack29(initoffset, in, inpos, out, outpos);
- break;
- case 30:
- integratedunpack30(initoffset, in, inpos, out, outpos);
- break;
- case 31:
- integratedunpack31(initoffset, in, inpos, out, outpos);
- break;
- case 32:
- integratedunpack32(initoffset, in, inpos, out, outpos);
- break;
- default:
- throw new IllegalArgumentException(
- "Unsupported bit width.");
- }
- }
-
- /**
- * Pack 32 integers as deltas with an initial value
- *
- * @param initoffset initial value (used to compute first delta)
- * @param in input array
- * @param inpos initial position in input array
- * @param out output array
- * @param outpos initial position in output array
- * @param bit number of bits to use per integer
- */
- public static void integratedpack(final int initoffset, final int[] in,
- final int inpos, final int[] out, final int outpos, final int bit) {
- switch (bit) {
- case 0:
- integratedpack0(initoffset, in, inpos, out, outpos);
- break;
- case 1:
- integratedpack1(initoffset, in, inpos, out, outpos);
- break;
- case 2:
- integratedpack2(initoffset, in, inpos, out, outpos);
- break;
- case 3:
- integratedpack3(initoffset, in, inpos, out, outpos);
- break;
- case 4:
- integratedpack4(initoffset, in, inpos, out, outpos);
- break;
- case 5:
- integratedpack5(initoffset, in, inpos, out, outpos);
- break;
- case 6:
- integratedpack6(initoffset, in, inpos, out, outpos);
- break;
- case 7:
- integratedpack7(initoffset, in, inpos, out, outpos);
- break;
- case 8:
- integratedpack8(initoffset, in, inpos, out, outpos);
- break;
- case 9:
- integratedpack9(initoffset, in, inpos, out, outpos);
- break;
- case 10:
- integratedpack10(initoffset, in, inpos, out, outpos);
- break;
- case 11:
- integratedpack11(initoffset, in, inpos, out, outpos);
- break;
- case 12:
- integratedpack12(initoffset, in, inpos, out, outpos);
- break;
- case 13:
- integratedpack13(initoffset, in, inpos, out, outpos);
- break;
- case 14:
- integratedpack14(initoffset, in, inpos, out, outpos);
- break;
- case 15:
- integratedpack15(initoffset, in, inpos, out, outpos);
- break;
- case 16:
- integratedpack16(initoffset, in, inpos, out, outpos);
- break;
- case 17:
- integratedpack17(initoffset, in, inpos, out, outpos);
- break;
- case 18:
- integratedpack18(initoffset, in, inpos, out, outpos);
- break;
- case 19:
- integratedpack19(initoffset, in, inpos, out, outpos);
- break;
- case 20:
- integratedpack20(initoffset, in, inpos, out, outpos);
- break;
- case 21:
- integratedpack21(initoffset, in, inpos, out, outpos);
- break;
- case 22:
- integratedpack22(initoffset, in, inpos, out, outpos);
- break;
- case 23:
- integratedpack23(initoffset, in, inpos, out, outpos);
- break;
- case 24:
- integratedpack24(initoffset, in, inpos, out, outpos);
- break;
- case 25:
- integratedpack25(initoffset, in, inpos, out, outpos);
- break;
- case 26:
- integratedpack26(initoffset, in, inpos, out, outpos);
- break;
- case 27:
- integratedpack27(initoffset, in, inpos, out, outpos);
- break;
- case 28:
- integratedpack28(initoffset, in, inpos, out, outpos);
- break;
- case 29:
- integratedpack29(initoffset, in, inpos, out, outpos);
- break;
- case 30:
- integratedpack30(initoffset, in, inpos, out, outpos);
- break;
- case 31:
- integratedpack31(initoffset, in, inpos, out, outpos);
- break;
- case 32:
- integratedpack32(initoffset, in, inpos, out, outpos);
- break;
- default:
- throw new IllegalArgumentException(
- "Unsupported bit width.");
- }
+ out[0 + outpos] = (((in[0 + inpos] >>> 0) & 511)) + initoffset;
+ out[1 + outpos] = (((in[0 + inpos] >>> 9) & 511))
+ + out[1 + outpos - 1];
+ out[2 + outpos] = (((in[0 + inpos] >>> 18) & 511))
+ + out[2 + outpos - 1];
+ out[3 + outpos] = ((in[0 + inpos] >>> 27) | ((in[1 + inpos] & 15) << (9 - 4)))
+ + out[3 + outpos - 1];
+ out[4 + outpos] = (((in[1 + inpos] >>> 4) & 511))
+ + out[4 + outpos - 1];
+ out[5 + outpos] = (((in[1 + inpos] >>> 13) & 511))
+ + out[5 + outpos - 1];
+ out[6 + outpos] = (((in[1 + inpos] >>> 22) & 511))
+ + out[6 + outpos - 1];
+ out[7 + outpos] = ((in[1 + inpos] >>> 31) | ((in[2 + inpos] & 255) << (9 - 8)))
+ + out[7 + outpos - 1];
+ out[8 + outpos] = (((in[2 + inpos] >>> 8) & 511))
+ + out[8 + outpos - 1];
+ out[9 + outpos] = (((in[2 + inpos] >>> 17) & 511))
+ + out[9 + outpos - 1];
+ out[10 + outpos] = ((in[2 + inpos] >>> 26) | ((in[3 + inpos] & 7) << (9 - 3)))
+ + out[10 + outpos - 1];
+ out[11 + outpos] = (((in[3 + inpos] >>> 3) & 511))
+ + out[11 + outpos - 1];
+ out[12 + outpos] = (((in[3 + inpos] >>> 12) & 511))
+ + out[12 + outpos - 1];
+ out[13 + outpos] = (((in[3 + inpos] >>> 21) & 511))
+ + out[13 + outpos - 1];
+ out[14 + outpos] = ((in[3 + inpos] >>> 30) | ((in[4 + inpos] & 127) << (9 - 7)))
+ + out[14 + outpos - 1];
+ out[15 + outpos] = (((in[4 + inpos] >>> 7) & 511))
+ + out[15 + outpos - 1];
+ out[16 + outpos] = (((in[4 + inpos] >>> 16) & 511))
+ + out[16 + outpos - 1];
+ out[17 + outpos] = ((in[4 + inpos] >>> 25) | ((in[5 + inpos] & 3) << (9 - 2)))
+ + out[17 + outpos - 1];
+ out[18 + outpos] = (((in[5 + inpos] >>> 2) & 511))
+ + out[18 + outpos - 1];
+ out[19 + outpos] = (((in[5 + inpos] >>> 11) & 511))
+ + out[19 + outpos - 1];
+ out[20 + outpos] = (((in[5 + inpos] >>> 20) & 511))
+ + out[20 + outpos - 1];
+ out[21 + outpos] = ((in[5 + inpos] >>> 29) | ((in[6 + inpos] & 63) << (9 - 6)))
+ + out[21 + outpos - 1];
+ out[22 + outpos] = (((in[6 + inpos] >>> 6) & 511))
+ + out[22 + outpos - 1];
+ out[23 + outpos] = (((in[6 + inpos] >>> 15) & 511))
+ + out[23 + outpos - 1];
+ out[24 + outpos] = ((in[6 + inpos] >>> 24) | ((in[7 + inpos] & 1) << (9 - 1)))
+ + out[24 + outpos - 1];
+ out[25 + outpos] = (((in[7 + inpos] >>> 1) & 511))
+ + out[25 + outpos - 1];
+ out[26 + outpos] = (((in[7 + inpos] >>> 10) & 511))
+ + out[26 + outpos - 1];
+ out[27 + outpos] = (((in[7 + inpos] >>> 19) & 511))
+ + out[27 + outpos - 1];
+ out[28 + outpos] = ((in[7 + inpos] >>> 28) | ((in[8 + inpos] & 31) << (9 - 5)))
+ + out[28 + outpos - 1];
+ out[29 + outpos] = (((in[8 + inpos] >>> 5) & 511))
+ + out[29 + outpos - 1];
+ out[30 + outpos] = (((in[8 + inpos] >>> 14) & 511))
+ + out[30 + outpos - 1];
+ out[31 + outpos] = ((in[8 + inpos] >>> 23))
+ + out[31 + outpos - 1];
}
}
diff --git a/src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java b/src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java
index fe9fcab..911d5c2 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java
@@ -14,10 +14,11 @@
* This is an integrated version of FastPFOR meaning that it computes
* differential coding as part of the compression.
*
- *
- * It encodes integers in blocks of 128 integers. For arrays containing
- * an arbitrary number of integers, you should use it in conjunction
- * with another CODEC:
+ * It encodes integers in blocks of 128 integers within pages of
+ * up to 65536 integers. Note that it is important, to get good
+ * compression and good performance, to use sizeable blocks (greater than 1024 integers).
+ * For arrays containing a number of integers that is not divisible by 128,
+ * you should use it in conjunction with another CODEC:
* IntegratedIntegerCODEC is =
* new IntegratedComposition(new IntegratedFastPFOR(),
* new IntegratedVariableByte())
From c4cef4c3a56447c5f27cc3d49aa3e8f275c9b77c Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 09:45:58 -0400
Subject: [PATCH 007/266] Preparing new release
---
CHANGELOG | 4 ++++
README.md | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG b/CHANGELOG
index 49921bb..d6560fe 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+0.0.12 (June 9th 2014)
+ - Better API documentation
+
+
0.0.11 (Feb. 14th 2014)
- Fix rare bug in FastPFOR (reported by Stefan Ackermann (https://github.com/Stivo))
- Improved API documentation
diff --git a/README.md b/README.md
index 77ddd36..03371f1 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ the following code in your pom.xml file:
me.lemire.integercompression
JavaFastPFOR
- 0.0.11
+ 0.0.12
From 54f7edcf9f34f3a94893384584f87879cae08e10 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 09:50:34 -0400
Subject: [PATCH 008/266] Avoiding silly errors
---
src/test/java/me/lemire/integercompression/TestUtils.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index 69fde8a..3a581f6 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -2,6 +2,8 @@
import java.util.Arrays;
+import org.junit.Test;
+
import static org.junit.Assert.*;
/**
@@ -9,6 +11,8 @@
*/
@SuppressWarnings({ "javadoc"})
public class TestUtils {
+ @Test
+ public void bogus() {}// to avoid useless complaining.
public static void dumpIntArray(int[] data, String label) {
System.out.print(label);
From 1a18da88858a71408c425c34a0ec413b4074f762 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 10:03:20 -0400
Subject: [PATCH 009/266] Fixing doc errors
---
src/main/java/com/kamikaze/pfordelta/LCPForDelta.java | 8 ++++----
.../com/kamikaze/pfordelta/Simple16WithHardCodes.java | 2 +-
.../java/me/lemire/integercompression/BitPacking.java | 6 +++---
.../java/me/lemire/integercompression/FastPFOR.java | 10 +++++-----
.../integercompression/IntegratedBitPacking.java | 4 ++--
src/main/java/me/lemire/integercompression/NewPFD.java | 6 +++---
.../java/me/lemire/integercompression/NewPFDS16.java | 6 +++---
.../java/me/lemire/integercompression/NewPFDS9.java | 6 +++---
src/main/java/me/lemire/integercompression/OptPFD.java | 8 ++++----
.../java/me/lemire/integercompression/OptPFDS16.java | 8 ++++----
.../java/me/lemire/integercompression/OptPFDS9.java | 8 ++++----
src/main/java/me/lemire/integercompression/S16.java | 4 ++--
12 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java b/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
index ebed219..1e331fc 100644
--- a/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
+++ b/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
@@ -43,7 +43,7 @@
* literature.
*
* This implementation overcomes the problem that Simple16 cannot deal with
- * >2^28 numbers.
+ * greater than 2^28 numbers.
*
* This implementation is almost same as PForDelta in the same package, except
* that it is tuned especially for Lucene-4.0 Codec to achieve the best
@@ -417,7 +417,7 @@ public static int estimateCompressedSize(int[] inputBlock,
}
/**
- * Check if the block contains big numbers that is greater than ((1<<
+ * Check if the block contains big numbers that is greater than ((1<<
* bits)-1)
*
* @param inputBlock
@@ -578,7 +578,7 @@ public static void decompressBlockByS16WithIntBufferIntegrated(
* @param outOffset
* the start offset in bits in the output array
* @param bits
- * the number of bits to be written (bits>=0)
+ * the number of bits to be written (bits greater or equal to 0)
*/
public static final void writeBits(int[] out, int val, int outOffset,
int bits) {
@@ -604,7 +604,7 @@ public static final void writeBits(int[] out, int val, int outOffset,
* @param bits
* the number of bits to be read, unlike writeBits(),
* readBits() does not deal with bits==0 and thus bits
- * must > 0. When bits ==0, the calling functions will
+ * must be greater than 0. When bits ==0, the calling functions will
* just skip the entire bits-bit slots without decoding
* them
* @return the bits bits of the input
diff --git a/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java b/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
index 9ea0bff..03184f2 100644
--- a/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
+++ b/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
@@ -14,7 +14,7 @@
*
* 2. http://www2009.org/proceedings/pdf/p401.pdf
*
- * The maximum possible integer value Simple16 can encode is < 2^28 (this is
+ * The maximum possible integer value Simple16 can encode is less than 2^28 (this is
* dertermined by the Simple16 algorithm itself). Therefore, in order to use
* Simple16, the application must write their own code to encode numbers in the
* range of [2^28, 2^32). A simple way is just write those numbers as 32-bit
diff --git a/src/main/java/me/lemire/integercompression/BitPacking.java b/src/main/java/me/lemire/integercompression/BitPacking.java
index e36291b..ee71fbd 100644
--- a/src/main/java/me/lemire/integercompression/BitPacking.java
+++ b/src/main/java/me/lemire/integercompression/BitPacking.java
@@ -12,13 +12,13 @@
/**
* Bitpacking routines
*
- * For details, please see
- *
+ * For details, please see
+ *
* Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
* through vectorization Software: Practice & Experience
* http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
* http://arxiv.org/abs/1209.2137
- *
+ *
*
* @author Daniel Lemire
*
diff --git a/src/main/java/me/lemire/integercompression/FastPFOR.java b/src/main/java/me/lemire/integercompression/FastPFOR.java
index 3cd6c58..3caa94a 100644
--- a/src/main/java/me/lemire/integercompression/FastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/FastPFOR.java
@@ -18,16 +18,16 @@
* it in conjunction with another CODEC:
*
* IntegerCODEC ic = new Composition(new FastPFOR(), new VariableByte()).
- *
+ *
* For details, please see
- *
+ *
* Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
* through vectorization Software: Practice & Experience
* http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
* http://arxiv.org/abs/1209.2137
- *
- * For sufficiently compressible arrays, it is faster and better than other PFOR
- * schemes.
+ *
+ * For sufficiently compressible and long arrays, it is faster and better than other PFOR
+ * schemes.
*
* Note that this does not use differential coding: if you are working on sorted
* lists, use IntegratedFastPFOR instead.
diff --git a/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java b/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
index a0fd463..71387bb 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
+++ b/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
@@ -14,12 +14,12 @@
* differential coding.
*
* For details, please see
- *
+ *
* Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
* through vectorization Software: Practice & Experience
* http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
* http://arxiv.org/abs/1209.2137
- *
+ *
*
* @author Daniel Lemire
*
diff --git a/src/main/java/me/lemire/integercompression/NewPFD.java b/src/main/java/me/lemire/integercompression/NewPFD.java
index bd575e9..28e28a3 100644
--- a/src/main/java/me/lemire/integercompression/NewPFD.java
+++ b/src/main/java/me/lemire/integercompression/NewPFD.java
@@ -9,12 +9,12 @@
/**
* NewPFD/NewPFOR: fast patching scheme by Yan et al.
- *
+ *
* Follows:
- *
+ *
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
* with optimized document ordering, in: WWW �09, 2009, pp. 401�410.
- *
+ *
* using Simple16 as the secondary coder.
*
* It encodes integers in blocks of 128 integers. For arrays containing
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS16.java b/src/main/java/me/lemire/integercompression/NewPFDS16.java
index 0c045d9..bf0b5c6 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS16.java
@@ -9,12 +9,12 @@
/**
* NewPFD/NewPFOR based on Simple16 by Yan et al.
- *
+ *
* Follows:
- *
+ *
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
* with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
- *
+ *
* using Simple16 as the secondary coder.
*
* It encodes integers in blocks of 128 integers. For arrays containing
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS9.java b/src/main/java/me/lemire/integercompression/NewPFDS9.java
index 1078a41..ee671ef 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS9.java
@@ -9,12 +9,12 @@
/**
* NewPFD/NewPFOR based on Simple9 by Yan et al.
- *
+ *
* Follows:
- *
+ *
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
* with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
- *
+ *
* using Simple9 as the secondary coder.
*
* It encodes integers in blocks of 128 integers. For arrays containing
diff --git a/src/main/java/me/lemire/integercompression/OptPFD.java b/src/main/java/me/lemire/integercompression/OptPFD.java
index b01c7d5..2395c3f 100644
--- a/src/main/java/me/lemire/integercompression/OptPFD.java
+++ b/src/main/java/me/lemire/integercompression/OptPFD.java
@@ -8,12 +8,12 @@
/**
* OptPFD: fast patching scheme by Yan et al.
- *
+ *
* Follows:
- *
+ *
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
- * with optimized document ordering, in: WWW �09, 2009, pp. 401�410.
- *
+ * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
+ *
* using Simple16 as the secondary coder.
*
* It encodes integers in blocks of 128 integers. For arrays containing
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS16.java b/src/main/java/me/lemire/integercompression/OptPFDS16.java
index 4334412..3f6a6cc 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS16.java
@@ -9,12 +9,12 @@
/**
* OptPFD based on Simple16 by Yan et al.
- *
+ *
* Follows:
- *
+ *
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
- * with optimized document ordering, in: WWW 09, 2009, pp. 401--410.
- *
+ * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
+ *
* using Simple16 as the secondary coder.
*
* It encodes integers in blocks of 128 integers. For arrays containing
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS9.java b/src/main/java/me/lemire/integercompression/OptPFDS9.java
index 100fb43..75cf4be 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS9.java
@@ -9,12 +9,12 @@
/**
* OptPFD based on Simple9 by Yan et al.
- *
+ *
* Follows:
- *
+ *
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
- * with optimized document ordering, in: WWW 09, 2009, pp. 401--410.
- *
+ * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
+ *
* using Simple9 as the secondary coder.
*
* It encodes integers in blocks of 128 integers. For arrays containing
diff --git a/src/main/java/me/lemire/integercompression/S16.java b/src/main/java/me/lemire/integercompression/S16.java
index 3d65b7b..6829b76 100644
--- a/src/main/java/me/lemire/integercompression/S16.java
+++ b/src/main/java/me/lemire/integercompression/S16.java
@@ -9,9 +9,9 @@
/**
* Version of Simple16 for NewPFD and OptPFD.
- *
+ *
* Adapted by D. Lemire from the Apache Lucene project.
- *
+ *
*/
public final class S16 {
From 818595ef4c4ff9ebce5087818d4d3af59dc483db Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 10:08:43 -0400
Subject: [PATCH 010/266] More documentation fixes
---
src/main/java/com/kamikaze/pfordelta/PForDelta.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/kamikaze/pfordelta/PForDelta.java b/src/main/java/com/kamikaze/pfordelta/PForDelta.java
index 6f59700..b17c9cd 100644
--- a/src/main/java/com/kamikaze/pfordelta/PForDelta.java
+++ b/src/main/java/com/kamikaze/pfordelta/PForDelta.java
@@ -25,7 +25,7 @@
* literatures.
*
* This implementation overcomes the problem that Simple16 cannot deal with
- * >2^28 numbers.
+ * more than 2^28 numbers.
*
* Author: hao yan hyan2008@gmail.com
*/
@@ -181,7 +181,7 @@ public static int estimateCompressedSize(int[] inputBlock, int bits,
}
/**
- * Check if the block contains big numbers that is greater than ((1<<
+ * Check if the block contains big numbers that is greater than ((1<<
* bits)-1)
*
* @param inputBlock
@@ -377,7 +377,7 @@ public static int decompressBlockByS16(int[] outDecompBlock,
* @param outOffset
* the start offset in bits in the output array
* @param bits
- * the number of bits to be written (bits>=0)
+ * the number of bits to be written (bits greater or equal to 0)
*/
public static final void writeBits(int[] out, int val, int outOffset,
int bits) {
@@ -426,7 +426,7 @@ static int decompressBBitSlotsWithHardCodes(int[] decompressedSlots,
* @param bits
* the number of bits to be read, unlike writeBits(),
* readBits() does not deal with bits==0 and thus bits
- * must > 0. When bits ==0, the calling functions will
+ * must be greater than 0. When bits ==0, the calling functions will
* just skip the entire bits-bit slots without decoding
* them
* @return the bits bits of the input
From fc93eba764956b3f6410812ac8a66efb887f6b22 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 10:11:05 -0400
Subject: [PATCH 011/266] Another doc update
---
src/main/java/com/kamikaze/pfordelta/Simple16.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/com/kamikaze/pfordelta/Simple16.java b/src/main/java/com/kamikaze/pfordelta/Simple16.java
index 8b77355..d94ab9c 100644
--- a/src/main/java/com/kamikaze/pfordelta/Simple16.java
+++ b/src/main/java/com/kamikaze/pfordelta/Simple16.java
@@ -14,7 +14,7 @@
*
* 2. http://www2009.org/proceedings/pdf/p401.pdf
*
- * The maximum possible integer value Simple16 can encode is < 2^28 (this is
+ * The maximum possible integer value Simple16 can encode is less than 2^28 (this is
* dertermined by the Simple16 algorithm itself). Therefore, in order to use
* Simple16, the application must write their own code to encode numbers in the
* range of [2^28, 2^32). A simple way is just write those numbers as 32-bit
From b4178194c142d0acdd3944e13fbdc91367e16caf Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 10:12:02 -0400
Subject: [PATCH 012/266] [maven-release-plugin] prepare release
JavaFastPFOR-0.0.12
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 946c13f..860d151 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.12-SNAPSHOT
+ 0.0.12
jar
From 46468b3bfda377129c1d9a2ecd6e504e177de16a Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 9 Jun 2014 10:12:05 -0400
Subject: [PATCH 013/266] [maven-release-plugin] prepare for next development
iteration
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 860d151..79f9c3d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.12
+ 0.0.13-SNAPSHOT
jar
From 80d7502e1cb89abf8fa2bda2ca5ad06052ea8b61 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 23 Jul 2014 14:05:33 -0400
Subject: [PATCH 014/266] Preparing new release
---
CHANGELOG | 4 +-
README.md | 16 +-
example.java | 1 +
.../com/kamikaze/pfordelta/LCPForDelta.java | 29 +-
.../com/kamikaze/pfordelta/PForDelta.java | 9 +-
.../pfordelta/PForDeltaUnpack128.java | 2 +-
.../PForDeltaUnpack128WIthIntBuffer.java | 2 +-
.../java/com/kamikaze/pfordelta/Simple16.java | 1 +
.../pfordelta/Simple16WithHardCodes.java | 24 +-
.../lemire/integercompression/IntWrapper.java | 3 +-
.../me/lemire/integercompression/Util.java | 148 +++---
.../benchmarktools/Benchmark.java | 18 +-
.../benchmarktools/BenchmarkBitPacking.java | 4 +-
.../benchmarktools/BenchmarkCSV.java | 11 +-
.../BenchmarkOffsettedSeries.java | 8 +-
.../{ => differential}/Delta.java | 2 +-
.../IntegratedBinaryPacking.java | 5 +-
.../IntegratedBitPacking.java | 2 +-
.../IntegratedByteIntegerCODEC.java | 4 +-
.../IntegratedComposition.java | 4 +-
.../IntegratedFastPFOR.java | 7 +-
.../IntegratedIntegerCODEC.java | 4 +-
.../IntegratedVariableByte.java | 4 +-
.../{ => differential}/XorBinaryPacking.java | 5 +-
.../lemire/integercompression/AdhocTest.java | 9 +
.../lemire/integercompression/BasicTest.java | 424 ++++++++++--------
.../integercompression/BoundaryTest.java | 46 +-
.../DeltaZigzagEncodingTest.java | 33 +-
.../lemire/integercompression/TestUtils.java | 13 +-
.../XorBinaryPackingTest.java | 27 +-
30 files changed, 522 insertions(+), 347 deletions(-)
rename src/main/java/me/lemire/integercompression/{ => differential}/Delta.java (98%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedBinaryPacking.java (97%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedBitPacking.java (99%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedByteIntegerCODEC.java (78%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedComposition.java (95%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedFastPFOR.java (98%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedIntegerCODEC.java (80%)
rename src/main/java/me/lemire/integercompression/{ => differential}/IntegratedVariableByte.java (98%)
rename src/main/java/me/lemire/integercompression/{ => differential}/XorBinaryPacking.java (97%)
diff --git a/CHANGELOG b/CHANGELOG
index d6560fe..8297989 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,9 @@
+0.0.13 (July 23rd 2014)
+ - CODECs using differential coding are now in a separate package (me.lemire.integercompression.differential)
+
0.0.12 (June 9th 2014)
- Better API documentation
-
0.0.11 (Feb. 14th 2014)
- Fix rare bug in FastPFOR (reported by Stefan Ackermann (https://github.com/Stivo))
- Improved API documentation
diff --git a/README.md b/README.md
index 03371f1..230059c 100644
--- a/README.md
+++ b/README.md
@@ -32,8 +32,15 @@ library is used by the zsearch engine (http://victorparmar.github.com/zsearch/)
as well as in GMAP and GSNAP (http://research-pub.gene.com/gmap/).
+Usage
+------
+
+See example.java.
+
Some CODECs ("integrated codecs") assume that the integers are
-in sorted orders. Most others do not.
+in sorted orders and use differential coding (they compress deltas).
+They can be found in the package me.lemire.integercopression.differential.
+Most others do not.
Maven central repository
@@ -47,7 +54,7 @@ the following code in your pom.xml file:
me.lemire.integercompression
JavaFastPFOR
- 0.0.12
+ 0.0.13
@@ -101,11 +108,6 @@ Good instructions on installing Java 7 on Linux:
http://forums.linuxmint.com/viewtopic.php?f=42&t=93052
-Usage
------
-
-See example.java for a simple demonstration.
-
How fast is it?
---------------
diff --git a/example.java b/example.java
index d96ddc4..dbe70d0 100644
--- a/example.java
+++ b/example.java
@@ -1,4 +1,5 @@
import me.lemire.integercompression.*;
+import me.lemire.integercompression.differential.*;
import java.util.*;
public class example {
diff --git a/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java b/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
index 1e331fc..bf5154e 100644
--- a/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
+++ b/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
@@ -82,11 +82,11 @@ public class LCPForDelta {
private int[] compBuffer; // buffer to hold the compressed data
- public int[] getCompBuffer() {
+ protected int[] getCompBuffer() {
return compBuffer;
}
- public void setCompBuffer(int[] buffer) {
+ protected void setCompBuffer(int[] buffer) {
compBuffer = buffer;
}
@@ -141,10 +141,9 @@ public int compress(int[] inBlock, int blockSize) {
* @param bits
* the the value of the parameter b
* @return the size of the compressed block (the number of ints)
- * @throws IllegalArgumentException
*/
public int compressOneBlockCore(int[] inputBlock, int blockSize,
- int bits) throws IllegalArgumentException {
+ int bits) {
int outputOffset = HEADER_SIZE;
int expUpperBound = 1 << bits;
int expNum = 0;
@@ -202,7 +201,7 @@ public int compressOneBlockCore(int[] inputBlock, int blockSize,
return compressedSizeInInts;
}
- public int compressOneBlockCore2(int[] inputBlock, int blockSize,
+ protected int compressOneBlockCore2(int[] inputBlock, int blockSize,
int bits) throws IllegalArgumentException {
int outputOffset = HEADER_SIZE;
int expUpperBound = 1 << bits;
@@ -311,7 +310,7 @@ public static void decompressOneBlock(int[] decompBlock, int[] inBlock,
}
}
- public static void decompressOneBlockWithSize(int[] decompBlock,
+ protected static void decompressOneBlockWithSize(int[] decompBlock,
int[] inBlock, int blockSize, int[] expPosBuffer,
int[] expHighBitsBuffer, int inBlockLen) {
int expNum = inBlock[0] & MASK[31 - POSSIBLE_B_BITS];
@@ -349,7 +348,7 @@ public static void decompressOneBlockWithSize(int[] decompBlock,
}
}
- public static void decompressOneBlockWithSizeWithIntBuffer(
+ protected static void decompressOneBlockWithSizeWithIntBuffer(
final int[] decompBlock, final IntBuffer inBlock,
final int blockSize, final int[] expPosBuffer,
final int[] expHighBitsBuffer, final int inBlockLen) {
@@ -397,10 +396,9 @@ public static void decompressOneBlockWithSizeWithIntBuffer(
* @param blockSize
* the block size
* @return the compressed size in ints
- * @throws IllegalArgumentException
*/
public static int estimateCompressedSize(int[] inputBlock,
- int blockSize, int bits) throws IllegalArgumentException {
+ int blockSize, int bits) {
int maxNoExp = (1 << bits) - 1;
// Size of the header and the bits-bit slots
int outputOffset = HEADER_SIZE + bits * blockSize;
@@ -428,10 +426,9 @@ public static int estimateCompressedSize(int[] inputBlock,
* @param blockSize
* the block size
* @return true if there is any big numbers in the block
- * @throws IllegalArgumentException
*/
public static boolean checkBigNumbers(int[] inputBlock, int blockSize,
- int bits) throws IllegalArgumentException {
+ int bits) {
int maxNoExp = (1 << bits) - 1;
for (int i = 0; i < blockSize; ++i) {
if (inputBlock[i] > maxNoExp)
@@ -467,7 +464,7 @@ public static int decompressBBitSlots(int[] outDecompSlots,
return compressedBitSize;
}
- public static int decompressBBitSlotsWithHardCodes(
+ protected static int decompressBBitSlotsWithHardCodes(
final int[] outDecompSlots, final int[] inCompBlock,
final int blockSize, final int bits) {
int compressedBitSize = 0;
@@ -476,7 +473,7 @@ public static int decompressBBitSlotsWithHardCodes(
return compressedBitSize;
}
- public static int decompressBBitSlotsWithHardCodesWithIntBuffer(
+ protected static int decompressBBitSlotsWithHardCodesWithIntBuffer(
final int[] outDecompSlots, final IntBuffer inCompBlock,
final int blockSize, final int bits) {
PForDeltaUnpack128WIthIntBuffer.unpack(outDecompSlots,
@@ -541,7 +538,7 @@ public static int decompressBlockByS16(int[] outDecompBlock,
return compressedBitSize;
}
- public static void decompressBlockByS16WithIntBuffer(
+ protected static void decompressBlockByS16WithIntBuffer(
final int[] outDecompBlock, final IntBuffer inCompBlock,
final int blockSize) {
int num, outOffset = 0, numLeft;
@@ -553,7 +550,7 @@ public static void decompressBlockByS16WithIntBuffer(
}
}
- public static void decompressBlockByS16WithIntBufferIntegrated(
+ protected static void decompressBlockByS16WithIntBufferIntegrated(
final int[] outDecompBlock, final IntBuffer inCompBlock,
final int blockSize, int[] expPosBuffer, int oribits) {
int num, outOffset = 0, numLeft;
@@ -620,7 +617,7 @@ public static final int readBits(int[] in, final int inOffset,
return val & (0xffffffff >>> (32 - bits));
}
- public static final int readBitsWithBuffer(int[] in,
+ protected static final int readBitsWithBuffer(int[] in,
final int inOffset, final int bits) {
final int index = inOffset >>> 5;
final int skip = inOffset & 0x1f;
diff --git a/src/main/java/com/kamikaze/pfordelta/PForDelta.java b/src/main/java/com/kamikaze/pfordelta/PForDelta.java
index b17c9cd..9be8e07 100644
--- a/src/main/java/com/kamikaze/pfordelta/PForDelta.java
+++ b/src/main/java/com/kamikaze/pfordelta/PForDelta.java
@@ -161,10 +161,9 @@ public static int decompressOneBlock(int[] outBlock, int[] inBlock,
* @param blockSize
* the block size
* @return the compressed size in ints
- * @throws IllegalArgumentException
*/
public static int estimateCompressedSize(int[] inputBlock, int bits,
- int blockSize) throws IllegalArgumentException {
+ int blockSize) {
int maxNoExp = (1 << bits) - 1;
// Size of the header and the bits-bit slots
int outputOffset = HEADER_SIZE + bits * blockSize;
@@ -192,10 +191,9 @@ public static int estimateCompressedSize(int[] inputBlock, int bits,
* @param blockSize
* the block size
* @return true if there is any big numbers in the block
- * @throws IllegalArgumentException
*/
public static boolean checkBigNumbers(int[] inputBlock, int bits,
- int blockSize) throws IllegalArgumentException {
+ int blockSize) {
int maxNoExp = (1 << bits) - 1;
for (int i = 0; i < blockSize; ++i) {
if (inputBlock[i] > maxNoExp)
@@ -215,10 +213,9 @@ public static boolean checkBigNumbers(int[] inputBlock, int bits,
* @param blockSize
* the block size
* @return the compressed block
- * @throws IllegalArgumentException
*/
public static int[] compressOneBlock(int[] inputBlock, int bits,
- int blockSize) throws IllegalArgumentException {
+ int blockSize) {
int[] expAux = new int[blockSize * 2];
diff --git a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java
index 4da7a61..31b5378 100644
--- a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java
+++ b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java
@@ -8,7 +8,7 @@
@SuppressWarnings("javadoc")
public class PForDeltaUnpack128 {
- static public void unpack(int[] out, int[] in, int bits) {
+ static protected void unpack(int[] out, int[] in, int bits) {
switch (bits) {
case 0:
unpack0(out, in);
diff --git a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java
index 5596517..2e10e29 100644
--- a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java
+++ b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java
@@ -15,7 +15,7 @@
@SuppressWarnings("javadoc")
public class PForDeltaUnpack128WIthIntBuffer {
- static public void unpack(int[] out, IntBuffer in, int bits) {
+ static protected void unpack(int[] out, IntBuffer in, int bits) {
switch (bits) {
case 0:
unpack0(out, in);
diff --git a/src/main/java/com/kamikaze/pfordelta/Simple16.java b/src/main/java/com/kamikaze/pfordelta/Simple16.java
index d94ab9c..1ccd315 100644
--- a/src/main/java/com/kamikaze/pfordelta/Simple16.java
+++ b/src/main/java/com/kamikaze/pfordelta/Simple16.java
@@ -79,6 +79,7 @@ public class Simple16 {
* the offset of the input in the number of integers
* @param n
* the number of elements to be compressed
+ * @param blockSize block size
* @return the number of compressed integers
*/
public static final int s16Compress(int[] out, int outOffset, int[] in,
diff --git a/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java b/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
index 03184f2..b1a9f3f 100644
--- a/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
+++ b/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
@@ -85,6 +85,9 @@ public class Simple16WithHardCodes {
* the offset of the input in the number of integers
* @param n
* the number of elements to be compressed
+ * @param blockSize block size
+ * @param oriBlockSize ori block size
+ * @param oriInputBlock ori input block
* @return the number of compressed integers
*/
public static final int s16Compress(int[] out, int outOffset, int[] in,
@@ -114,7 +117,8 @@ public static final int s16Compress(int[] out, int outOffset, int[] in,
return -1;
}
- public static final int s16CompressBackup(int[] out, int outOffset,
+
+ protected static final int s16CompressBackup(int[] out, int outOffset,
int[] in, int inOffset, int n, int blockSize, int oriBlockSize,
int[] oriInputBlock) {
int numIdx, j, num, bits;
@@ -152,7 +156,7 @@ public static final int s16CompressBackup(int[] out, int outOffset,
* the number of elements to be compressed
* @return the number of processed integers
*/
- public static final int s16Decompress(int[] out, int outOffset,
+ protected 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;
@@ -165,7 +169,7 @@ public static final int s16Decompress(int[] out, int outOffset,
return num;
}
- public static final int s16DecompressWithIntBufferBackup(
+ protected static final int s16DecompressWithIntBufferBackup(
final int[] out, int outOffset, final int value, final int n) {
int j = 0, shift;
final int numIdx = value >>> S16_BITSSIZE;
@@ -180,7 +184,7 @@ public static final int s16DecompressWithIntBufferBackup(
return num;
}
- public static final int s16DecompressWithIntBuffer(final int[] out,
+ protected static final int s16DecompressWithIntBuffer(final int[] out,
int outOffset, final int value, final int n) {
int j = 0, shift;
final int numIdx = value >>> S16_BITSSIZE;
@@ -196,14 +200,14 @@ public static final int s16DecompressWithIntBuffer(final int[] out,
return num;
}
- public static final int s16DecompressWithIntBufferWithHardCodes(
+ protected static final int s16DecompressWithIntBufferWithHardCodes(
final int[] out, int outOffset, final int value, final int n) {
final int numIdx = value >>> S16_BITSSIZE;
return s16DecompressOneNumberWithHardCodes(out, outOffset,
value, numIdx);
}
- public static final int s16DecompressWithIntBufferIntegrated(
+ protected static final int s16DecompressWithIntBufferIntegrated(
final int[] out, int outOffset, final int value, final int n,
int[] expPos, int oribits) {
int j = 0, shift = 0;
@@ -219,7 +223,7 @@ public static final int s16DecompressWithIntBufferIntegrated(
return num;
}
- public static final int s16DecompressWithIntBufferIntegrated2(
+ protected static final int s16DecompressWithIntBufferIntegrated2(
final int[] out, int outOffset, final int value, final int n,
int[] expPos, int oribits) {
final int numIdx = value >>> S16_BITSSIZE;
@@ -227,7 +231,7 @@ public static final int s16DecompressWithIntBufferIntegrated2(
outOffset, value, numIdx, oribits, expPos);
}
- public static final int s16DecompressWithIntBufferIntegratedBackup(
+ protected static final int s16DecompressWithIntBufferIntegratedBackup(
final int[] out, int outOffset, final int value, final int n,
int[] expPos, int oribits) {
int j = 0, shift = 0;
@@ -242,7 +246,7 @@ public static final int s16DecompressWithIntBufferIntegratedBackup(
return num;
}
- public static int s16DecompressOneNumberWithHardCodes(int[] out,
+ protected static int s16DecompressOneNumberWithHardCodes(int[] out,
int outOffset, int value, int numIdx) {
switch (numIdx) {
case 0: {
@@ -459,7 +463,7 @@ public static int s16DecompressOneNumberWithHardCodes(int[] out,
}
}
- public static int s16DecompressOneNumberWithHardCodesIntegrated(
+ protected static int s16DecompressOneNumberWithHardCodesIntegrated(
int[] out, int outOffset, int value, int numIdx, int oribits,
int[] expPos) {
switch (numIdx) {
diff --git a/src/main/java/me/lemire/integercompression/IntWrapper.java b/src/main/java/me/lemire/integercompression/IntWrapper.java
index 94968eb..6bd8f0b 100644
--- a/src/main/java/me/lemire/integercompression/IntWrapper.java
+++ b/src/main/java/me/lemire/integercompression/IntWrapper.java
@@ -33,7 +33,8 @@ public IntWrapper(final int v) {
}
/**
- * @param v
+ * add the provided value to the integer
+ * @param v value to add
*/
public void add(int v) {
this.value += v;
diff --git a/src/main/java/me/lemire/integercompression/Util.java b/src/main/java/me/lemire/integercompression/Util.java
index ba47bfc..573c829 100644
--- a/src/main/java/me/lemire/integercompression/Util.java
+++ b/src/main/java/me/lemire/integercompression/Util.java
@@ -13,64 +13,102 @@
*
*/
public final class Util {
- protected static int maxbits(int[] i, int pos, int length) {
- int mask = 0;
- for (int k = pos; k < pos + length; ++k)
- mask |= i[k];
- return bits(mask);
- }
+ /**
+ * Compute the maximum of the integer logarithms (ceil(log(x+1)) of a range
+ * of value
+ *
+ * @param i
+ * source array
+ * @param pos
+ * starting position
+ * @param length
+ * number of integers to consider
+ * @return integer logarithm
+ */
+ public static int maxbits(int[] i, int pos, int length) {
+ int mask = 0;
+ for (int k = pos; k < pos + length; ++k)
+ mask |= i[k];
+ return bits(mask);
+ }
- protected static int maxbits32(int[] i, int pos) {
- int mask = i[pos];
- mask |= i[pos + 1];
- mask |= i[pos + 2];
- mask |= i[pos + 3];
- mask |= i[pos + 4];
- mask |= i[pos + 5];
- mask |= i[pos + 6];
- mask |= i[pos + 7];
- mask |= i[pos + 8];
- mask |= i[pos + 9];
- mask |= i[pos + 10];
- mask |= i[pos + 11];
- mask |= i[pos + 12];
- mask |= i[pos + 13];
- mask |= i[pos + 14];
- mask |= i[pos + 15];
- mask |= i[pos + 16];
- mask |= i[pos + 17];
- mask |= i[pos + 18];
- mask |= i[pos + 19];
- mask |= i[pos + 20];
- mask |= i[pos + 21];
- mask |= i[pos + 22];
- mask |= i[pos + 23];
- mask |= i[pos + 24];
- mask |= i[pos + 25];
- mask |= i[pos + 26];
- mask |= i[pos + 27];
- mask |= i[pos + 28];
- mask |= i[pos + 29];
- mask |= i[pos + 30];
- mask |= i[pos + 31];
- return bits(mask);
- }
+ protected static int maxbits32(int[] i, int pos) {
+ int mask = i[pos];
+ mask |= i[pos + 1];
+ mask |= i[pos + 2];
+ mask |= i[pos + 3];
+ mask |= i[pos + 4];
+ mask |= i[pos + 5];
+ mask |= i[pos + 6];
+ mask |= i[pos + 7];
+ mask |= i[pos + 8];
+ mask |= i[pos + 9];
+ mask |= i[pos + 10];
+ mask |= i[pos + 11];
+ mask |= i[pos + 12];
+ mask |= i[pos + 13];
+ mask |= i[pos + 14];
+ mask |= i[pos + 15];
+ mask |= i[pos + 16];
+ mask |= i[pos + 17];
+ mask |= i[pos + 18];
+ mask |= i[pos + 19];
+ mask |= i[pos + 20];
+ mask |= i[pos + 21];
+ mask |= i[pos + 22];
+ mask |= i[pos + 23];
+ mask |= i[pos + 24];
+ mask |= i[pos + 25];
+ mask |= i[pos + 26];
+ mask |= i[pos + 27];
+ mask |= i[pos + 28];
+ mask |= i[pos + 29];
+ mask |= i[pos + 30];
+ mask |= i[pos + 31];
+ return bits(mask);
+ }
- protected static int maxdiffbits(int initoffset, int[] i, int pos,
- int length) {
- int mask = 0;
- mask |= (i[pos] - initoffset);
- for (int k = pos + 1; k < pos + length; ++k) {
- mask |= i[k] - i[k - 1];
- }
- return bits(mask);
+ /**
+ * Compute the maximum of the integer logarithms (ceil(log(x+1)) of a the
+ * successive differences (deltas) of a range of value
+ * @param initoffset initial vallue for the computation of the deltas
+ * @param i
+ * source array
+ * @param pos
+ * starting position
+ * @param length
+ * number of integers to consider
+ * @return integer logarithm
+ */
+ public static int maxdiffbits(int initoffset, int[] i, int pos, int length) {
+ int mask = 0;
+ mask |= (i[pos] - initoffset);
+ for (int k = pos + 1; k < pos + length; ++k) {
+ mask |= i[k] - i[k - 1];
}
+ return bits(mask);
+ }
- protected static int bits(int i) {
- return 32 - Integer.numberOfLeadingZeros(i);
- }
+ /**
+ * Compute the integer logarithms (ceil(log(x+1)) of a value
+ *
+ * @param i
+ * source value
+ * @return integer logarithm
+ */
+ public static int bits(int i) {
+ return 32 - Integer.numberOfLeadingZeros(i);
+ }
- protected static int floorBy(int value, int factor) {
- return value - value % factor;
- }
+ /**
+ * return floor(value / factor)
+ *
+ * @param value numerator
+ * @param factor denominator
+ * @return result of the division
+ */
+ public static int floorBy(int value, int factor) {
+
+ return value - value % factor;
+ }
}
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
index 3e60c9e..7ca21da 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
@@ -11,18 +11,11 @@
import me.lemire.integercompression.BinaryPacking;
import me.lemire.integercompression.ByteIntegerCODEC;
import me.lemire.integercompression.Composition;
-import me.lemire.integercompression.Delta;
import me.lemire.integercompression.DeltaZigzagBinaryPacking;
import me.lemire.integercompression.DeltaZigzagVariableByte;
import me.lemire.integercompression.FastPFOR;
import me.lemire.integercompression.IntWrapper;
import me.lemire.integercompression.IntegerCODEC;
-import me.lemire.integercompression.IntegratedBinaryPacking;
-import me.lemire.integercompression.IntegratedByteIntegerCODEC;
-import me.lemire.integercompression.IntegratedComposition;
-import me.lemire.integercompression.IntegratedFastPFOR;
-import me.lemire.integercompression.IntegratedIntegerCODEC;
-import me.lemire.integercompression.IntegratedVariableByte;
import me.lemire.integercompression.JustCopy;
import me.lemire.integercompression.NewPFD;
import me.lemire.integercompression.NewPFDS16;
@@ -32,7 +25,14 @@
import me.lemire.integercompression.OptPFDS9;
import me.lemire.integercompression.Simple9;
import me.lemire.integercompression.VariableByte;
-import me.lemire.integercompression.XorBinaryPacking;
+import me.lemire.integercompression.differential.Delta;
+import me.lemire.integercompression.differential.IntegratedBinaryPacking;
+import me.lemire.integercompression.differential.IntegratedByteIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedComposition;
+import me.lemire.integercompression.differential.IntegratedFastPFOR;
+import me.lemire.integercompression.differential.IntegratedIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedVariableByte;
+import me.lemire.integercompression.differential.XorBinaryPacking;
import me.lemire.integercompression.synth.ClusteredDataGenerator;
import java.io.File;
@@ -300,7 +300,7 @@ private static void testByteCodec(PrintWriter csvLog, int sparsity,
*
* @param args
* command-line arguments
- * @throws FileNotFoundException
+ * @throws FileNotFoundException when we fail to create a new file
*/
public static void main(String args[]) throws FileNotFoundException {
System.out
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkBitPacking.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkBitPacking.java
index 2a05dcb..3380d36 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkBitPacking.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkBitPacking.java
@@ -11,8 +11,8 @@
import java.util.Random;
import me.lemire.integercompression.BitPacking;
-import me.lemire.integercompression.Delta;
-import me.lemire.integercompression.IntegratedBitPacking;
+import me.lemire.integercompression.differential.Delta;
+import me.lemire.integercompression.differential.IntegratedBitPacking;
/**
* Class used to benchmark the speed of bit packing. (For expert use.)
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java
index e301d8f..c0af811 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkCSV.java
@@ -1,6 +1,13 @@
package me.lemire.integercompression.benchmarktools;
import me.lemire.integercompression.*;
+import me.lemire.integercompression.differential.IntegratedBinaryPacking;
+import me.lemire.integercompression.differential.IntegratedByteIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedComposition;
+import me.lemire.integercompression.differential.IntegratedFastPFOR;
+import me.lemire.integercompression.differential.IntegratedIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedVariableByte;
+
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
@@ -119,8 +126,8 @@ private enum CompressionMode {
}
/**
- * @param args
- * @throws IOException
+ * @param args command-line arguments
+ * @throws IOException when some IO error occurs
*/
public static void main(final String[] args) throws IOException {
Format myformat = Format.ONEARRAYPERLINE;
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkOffsettedSeries.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkOffsettedSeries.java
index 9975ebc..9e25dc6 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkOffsettedSeries.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkOffsettedSeries.java
@@ -15,9 +15,9 @@
import me.lemire.integercompression.FastPFOR;
import me.lemire.integercompression.IntWrapper;
import me.lemire.integercompression.IntegerCODEC;
-import me.lemire.integercompression.IntegratedBinaryPacking;
import me.lemire.integercompression.JustCopy;
-import me.lemire.integercompression.XorBinaryPacking;
+import me.lemire.integercompression.differential.IntegratedBinaryPacking;
+import me.lemire.integercompression.differential.XorBinaryPacking;
/**
* Simple synthetic benchmark
@@ -265,8 +265,8 @@ private static int[][] sortDataChunks(int[][] src) {
}
/**
- * @param args
- * @throws Exception
+ * @param args command-line arguments
+ * @throws Exception when some problem occurs
*/
public static void main(final String[] args) throws Exception {
File csvFile = new File(
diff --git a/src/main/java/me/lemire/integercompression/Delta.java b/src/main/java/me/lemire/integercompression/differential/Delta.java
similarity index 98%
rename from src/main/java/me/lemire/integercompression/Delta.java
rename to src/main/java/me/lemire/integercompression/differential/Delta.java
index 29f0cd2..4f7c144 100644
--- a/src/main/java/me/lemire/integercompression/Delta.java
+++ b/src/main/java/me/lemire/integercompression/differential/Delta.java
@@ -5,7 +5,7 @@
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
/**
* Generic class to compute differential coding.
diff --git a/src/main/java/me/lemire/integercompression/IntegratedBinaryPacking.java b/src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java
similarity index 97%
rename from src/main/java/me/lemire/integercompression/IntegratedBinaryPacking.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java
index 478f98c..82f95b2 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedBinaryPacking.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java
@@ -5,7 +5,10 @@
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.IntWrapper;
+import me.lemire.integercompression.Util;
/**
* Scheme based on a commonly used idea: can be extremely fast.
diff --git a/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java b/src/main/java/me/lemire/integercompression/differential/IntegratedBitPacking.java
similarity index 99%
rename from src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedBitPacking.java
index 71387bb..8b26f6b 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedBitPacking.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedBitPacking.java
@@ -5,7 +5,7 @@
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
import java.util.Arrays;
diff --git a/src/main/java/me/lemire/integercompression/IntegratedByteIntegerCODEC.java b/src/main/java/me/lemire/integercompression/differential/IntegratedByteIntegerCODEC.java
similarity index 78%
rename from src/main/java/me/lemire/integercompression/IntegratedByteIntegerCODEC.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedByteIntegerCODEC.java
index e155b66..b0184b8 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedByteIntegerCODEC.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedByteIntegerCODEC.java
@@ -5,7 +5,9 @@
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.ByteIntegerCODEC;
/**
* Interface describing a CODEC to compress integers to bytes.
diff --git a/src/main/java/me/lemire/integercompression/IntegratedComposition.java b/src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java
similarity index 95%
rename from src/main/java/me/lemire/integercompression/IntegratedComposition.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java
index 9cf274b..4843497 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedComposition.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java
@@ -4,7 +4,9 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.IntWrapper;
/**
* Helper class to compose schemes.
diff --git a/src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
similarity index 98%
rename from src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
index 911d5c2..8b5e499 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
@@ -4,11 +4,16 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
import java.nio.ByteBuffer;
import java.util.Arrays;
+import me.lemire.integercompression.BitPacking;
+import me.lemire.integercompression.IntWrapper;
+import me.lemire.integercompression.IntegerCODEC;
+import me.lemire.integercompression.Util;
+
/**
*
* This is an integrated version of FastPFOR meaning that it computes
diff --git a/src/main/java/me/lemire/integercompression/IntegratedIntegerCODEC.java b/src/main/java/me/lemire/integercompression/differential/IntegratedIntegerCODEC.java
similarity index 80%
rename from src/main/java/me/lemire/integercompression/IntegratedIntegerCODEC.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedIntegerCODEC.java
index 7cb07c4..4c03d29 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedIntegerCODEC.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedIntegerCODEC.java
@@ -4,7 +4,9 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.IntegerCODEC;
/**
* This is just like IntegerCODEC, except that it indicates that delta coding is
diff --git a/src/main/java/me/lemire/integercompression/IntegratedVariableByte.java b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
similarity index 98%
rename from src/main/java/me/lemire/integercompression/IntegratedVariableByte.java
rename to src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
index e085327..19be4b8 100644
--- a/src/main/java/me/lemire/integercompression/IntegratedVariableByte.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
@@ -4,11 +4,13 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
+import me.lemire.integercompression.IntWrapper;
+
/**
* Implementation of variable-byte with differential coding. For best
* performance, use it using the IntegratedByteIntegerCODEC interface.
diff --git a/src/main/java/me/lemire/integercompression/XorBinaryPacking.java b/src/main/java/me/lemire/integercompression/differential/XorBinaryPacking.java
similarity index 97%
rename from src/main/java/me/lemire/integercompression/XorBinaryPacking.java
rename to src/main/java/me/lemire/integercompression/differential/XorBinaryPacking.java
index 131db4b..0e2b067 100644
--- a/src/main/java/me/lemire/integercompression/XorBinaryPacking.java
+++ b/src/main/java/me/lemire/integercompression/differential/XorBinaryPacking.java
@@ -2,7 +2,10 @@
* This code is released under the
* Apache License Version 2.0 http://www.apache.org/licenses/.
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.BitPacking;
+import me.lemire.integercompression.IntWrapper;
/**
* BinaryPacking over XOR differential.
diff --git a/src/test/java/me/lemire/integercompression/AdhocTest.java b/src/test/java/me/lemire/integercompression/AdhocTest.java
index d076b44..b82b69b 100644
--- a/src/test/java/me/lemire/integercompression/AdhocTest.java
+++ b/src/test/java/me/lemire/integercompression/AdhocTest.java
@@ -10,6 +10,9 @@
public class AdhocTest
{
+ /**
+ * a test
+ */
@Test
public void biggerCompressedArray0() {
// No problem: for comparison.
@@ -17,6 +20,9 @@ public void biggerCompressedArray0() {
assertSymmetry(c, 0, 16384);
}
+ /**
+ * a test
+ */
@Test
public void biggerCompressedArray1() {
// Compressed array is bigger than original, because of VariableByte.
@@ -24,6 +30,9 @@ public void biggerCompressedArray1() {
assertSymmetry(c, -1);
}
+ /**
+ * a test
+ */
@Test
public void biggerCompressedArray2() {
// Compressed array is bigger than original, because of Composition.
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index 7835adf..dc3b255 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -3,9 +3,17 @@
import java.util.Arrays;
import java.util.Random;
+import me.lemire.integercompression.differential.Delta;
+import me.lemire.integercompression.differential.IntegratedBinaryPacking;
+import me.lemire.integercompression.differential.IntegratedComposition;
+import me.lemire.integercompression.differential.IntegratedFastPFOR;
+import me.lemire.integercompression.differential.IntegratedIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedVariableByte;
+import me.lemire.integercompression.differential.XorBinaryPacking;
import me.lemire.integercompression.synth.ClusteredDataGenerator;
import org.junit.Test;
+
import static org.junit.Assert.*;
/**
@@ -13,90 +21,93 @@
*
* @author Daniel Lemire
*/
-@SuppressWarnings({"static-method","javadoc"})
-public class BasicTest
-{
- IntegerCODEC[] codecs = {
- new IntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()),
- new JustCopy(),
- new VariableByte(),
- new IntegratedVariableByte(),
- new Composition(new BinaryPacking(), new VariableByte()),
- new Composition(new NewPFD(), new VariableByte()),
- new Composition(new NewPFDS16(), new VariableByte()),
- new Composition(new OptPFDS9(), new VariableByte()),
- new Composition(new OptPFDS16(), new VariableByte()),
- new IntegratedComposition(new IntegratedFastPFOR(),
- new IntegratedVariableByte()),
- new Composition(new FastPFOR(), new VariableByte()),
- new Simple9(),
- new Composition(new XorBinaryPacking(), new VariableByte()),
- new Composition(new DeltaZigzagBinaryPacking(),
- new DeltaZigzagVariableByte()) };
+@SuppressWarnings({ "static-method", "javadoc" })
+public class BasicTest {
+ IntegerCODEC[] codecs = {
+ new IntegratedComposition(new IntegratedBinaryPacking(),
+ new IntegratedVariableByte()),
+ new JustCopy(),
+ new VariableByte(),
+ new IntegratedVariableByte(),
+ new Composition(new BinaryPacking(), new VariableByte()),
+ new Composition(new NewPFD(), new VariableByte()),
+ new Composition(new NewPFDS16(), new VariableByte()),
+ new Composition(new OptPFDS9(), new VariableByte()),
+ new Composition(new OptPFDS16(), new VariableByte()),
+ new IntegratedComposition(new IntegratedFastPFOR(),
+ new IntegratedVariableByte()),
+ new Composition(new FastPFOR(), new VariableByte()),
+ new Simple9(),
+ new Composition(new XorBinaryPacking(), new VariableByte()),
+ new Composition(new DeltaZigzagBinaryPacking(),
+ new DeltaZigzagVariableByte()) };
+
+ /**
+ *
+ */
@Test
public void varyingLengthTest() {
- int N = 4096;
- int[] data = new int[N];
- for (int k = 0; k < N; ++k)
- data[k] = k;
- for (IntegerCODEC c : codecs) {
- for (int L = 1; L <= 128; L++) {
- int[] comp = TestUtils.compress(c,
- Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
- for (int k = 0; k < L; ++k)
- if (answer[k] != data[k])
- throw new RuntimeException(
- "bug");
- }
- for (int L = 128; L <= N; L*=2) {
- int[] comp = TestUtils.compress(c,
- Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
- for (int k = 0; k < L; ++k)
- if (answer[k] != data[k])
- throw new RuntimeException(
- "bug");
- }
+ int N = 4096;
+ int[] data = new int[N];
+ for (int k = 0; k < N; ++k)
+ data[k] = k;
+ for (IntegerCODEC c : codecs) {
+ for (int L = 1; L <= 128; L++) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
+ for (int L = 128; L <= N; L *= 2) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
- }
}
+ }
+
+ /**
+ *
+ */
@Test
public void varyingLengthTest2() {
- int N = 128;
- int[] data = new int[N];
- data[127] = -1;
- for (IntegerCODEC c : codecs) {
- try {
- // CODEC Simple9 is limited to "small" integers.
- if(c.getClass().equals(Class.forName("me.lemire.integercompression.Simple9")))
- continue;
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- for (int L = 1; L <= 128; L++) {
- int[] comp = TestUtils.compress(c,
- Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
- for (int k = 0; k < L; ++k)
- if (answer[k] != data[k])
- throw new RuntimeException(
- "bug");
- }
- for (int L = 128; L <= N; L*=2) {
- int[] comp = TestUtils.compress(c,
- Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
- for (int k = 0; k < L; ++k)
- if (answer[k] != data[k])
- throw new RuntimeException(
- "bug");
- }
+ int N = 128;
+ int[] data = new int[N];
+ data[127] = -1;
+ for (IntegerCODEC c : codecs) {
+ try {
+ // CODEC Simple9 is limited to "small" integers.
+ if (c.getClass().equals(
+ Class.forName("me.lemire.integercompression.Simple9")))
+ continue;
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ for (int L = 1; L <= 128; L++) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
+ for (int L = 128; L <= N; L *= 2) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
- }
}
-
+ }
+
+ /**
+ *
+ */
@Test
public void checkDeltaZigzagVB() {
DeltaZigzagVariableByte codec = new DeltaZigzagVariableByte();
@@ -108,17 +119,18 @@ public void checkDeltaZigzagVB() {
test(codec, codeco, 2, 18);
}
+ /**
+ *
+ */
@Test
public void checkDeltaZigzagPacking() {
DeltaZigzagBinaryPacking codec = new DeltaZigzagBinaryPacking();
testZeroInZeroOut(codec);
testSpurious(codec);
- IntegerCODEC compo = new Composition(
- new DeltaZigzagBinaryPacking(),
+ IntegerCODEC compo = new Composition(new DeltaZigzagBinaryPacking(),
new VariableByte());
- IntegerCODEC compo2 = new Composition(
- new DeltaZigzagBinaryPacking(),
+ IntegerCODEC compo2 = new Composition(new DeltaZigzagBinaryPacking(),
new VariableByte());
testZeroInZeroOut(compo);
@@ -128,12 +140,18 @@ public void checkDeltaZigzagPacking() {
test(compo, compo2, 2, 18);
}
+ /**
+ *
+ */
@Test
public void checkXorBinaryPacking() {
testZeroInZeroOut(new XorBinaryPacking());
testSpurious(new XorBinaryPacking());
}
+ /**
+ *
+ */
@Test
public void checkXorBinaryPacking1() {
IntegerCODEC c = new IntegratedComposition(new XorBinaryPacking(),
@@ -141,6 +159,9 @@ public void checkXorBinaryPacking1() {
testZeroInZeroOut(c);
}
+ /**
+ *
+ */
@Test
public void checkXorBinaryPacking2() {
IntegerCODEC c = new IntegratedComposition(new XorBinaryPacking(),
@@ -148,6 +169,9 @@ public void checkXorBinaryPacking2() {
testUnsorted(c);
}
+ /**
+ *
+ */
@Test
public void checkXorBinaryPacking3() {
IntegerCODEC c = new IntegratedComposition(new XorBinaryPacking(),
@@ -205,6 +229,12 @@ public void verifyWithoutMask() {
}
}
+ /**
+ * @param array
+ * some array
+ * @param mask
+ * provided mask
+ */
public static void maskArray(int[] array, int mask) {
for (int i = 0, end = array.length; i < end; ++i) {
array[i] &= mask;
@@ -264,8 +294,7 @@ public void spuriousouttest() {
}
/**
- * check that an empty array generates an empty array
- * after compression.
+ * check that an empty array generates an empty array after compression.
*/
@Test
public void zeroinzerouttest() {
@@ -280,8 +309,10 @@ public void zeroinzerouttest() {
testZeroInZeroOut(new OptPFDS16());
testZeroInZeroOut(new FastPFOR());
testZeroInZeroOut(new VariableByte());
- testZeroInZeroOut(new Composition(new IntegratedBinaryPacking(), new VariableByte()));
- testZeroInZeroOut(new Composition(new BinaryPacking(), new VariableByte()));
+ testZeroInZeroOut(new Composition(new IntegratedBinaryPacking(),
+ new VariableByte()));
+ testZeroInZeroOut(new Composition(new BinaryPacking(),
+ new VariableByte()));
testZeroInZeroOut(new Composition(new NewPFD(), new VariableByte()));
testZeroInZeroOut(new Composition(new NewPFDS9(), new VariableByte()));
testZeroInZeroOut(new Composition(new NewPFDS16(), new VariableByte()));
@@ -290,7 +321,8 @@ public void zeroinzerouttest() {
testZeroInZeroOut(new Composition(new OptPFDS16(), new VariableByte()));
testZeroInZeroOut(new Composition(new FastPFOR(), new VariableByte()));
- testZeroInZeroOut(new IntegratedComposition(new IntegratedBinaryPacking(), new IntegratedVariableByte()));
+ testZeroInZeroOut(new IntegratedComposition(
+ new IntegratedBinaryPacking(), new IntegratedVariableByte()));
}
private static void testSpurious(IntegerCODEC c) {
@@ -318,7 +350,7 @@ private static void testZeroInZeroOut(IntegerCODEC c) {
assertEquals(0, outpos.intValue());
}
- private static void test(IntegerCODEC c,IntegerCODEC co, int N, int nbr) {
+ private static void test(IntegerCODEC c, IntegerCODEC co, int N, int nbr) {
ClusteredDataGenerator cdg = new ClusteredDataGenerator();
for (int sparsity = 1; sparsity < 31 - nbr; sparsity += 4) {
int[][] data = new int[N][];
@@ -340,11 +372,13 @@ private static void test(int N, int nbr) {
}
testCodec(new IntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()),new IntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()), data, max);
- testCodec(new JustCopy(),new JustCopy(), data, max);
+ new IntegratedVariableByte()),
+ new IntegratedComposition(new IntegratedBinaryPacking(),
+ new IntegratedVariableByte()), data, max);
+ testCodec(new JustCopy(), new JustCopy(), data, max);
testCodec(new VariableByte(), new VariableByte(), data, max);
- testCodec(new IntegratedVariableByte(),new IntegratedVariableByte(), data, max);
+ testCodec(new IntegratedVariableByte(),
+ new IntegratedVariableByte(), data, max);
testCodec(new Composition(new BinaryPacking(), new VariableByte()),
new Composition(new BinaryPacking(), new VariableByte()),
data, max);
@@ -352,28 +386,29 @@ private static void test(int N, int nbr) {
new Composition(new NewPFD(), new VariableByte()), data,
max);
testCodec(new Composition(new NewPFDS9(), new VariableByte()),
- new Composition(new NewPFDS9(), new VariableByte()),
- data, max);
+ new Composition(new NewPFDS9(), new VariableByte()), data,
+ max);
testCodec(new Composition(new NewPFDS16(), new VariableByte()),
- new Composition(new NewPFDS16(), new VariableByte()),
- data, max);
+ new Composition(new NewPFDS16(), new VariableByte()), data,
+ max);
testCodec(new Composition(new OptPFD(), new VariableByte()),
- new Composition(new OptPFD(), new VariableByte()),data,
+ new Composition(new OptPFD(), new VariableByte()), data,
max);
testCodec(new Composition(new OptPFDS9(), new VariableByte()),
- new Composition(new OptPFDS9(), new VariableByte()),
- data, max);
+ new Composition(new OptPFDS9(), new VariableByte()), data,
+ max);
testCodec(new Composition(new OptPFDS16(), new VariableByte()),
- new Composition(new OptPFDS16(), new VariableByte()),
- data, max);
+ new Composition(new OptPFDS16(), new VariableByte()), data,
+ max);
testCodec(new Composition(new FastPFOR(), new VariableByte()),
- new Composition(new FastPFOR(), new VariableByte()),
- data, max);
- testCodec(new Simple9(),new Simple9(), data, max);
+ new Composition(new FastPFOR(), new VariableByte()), data,
+ max);
+ testCodec(new Simple9(), new Simple9(), data, max);
}
}
- private static void testCodec(IntegerCODEC c,IntegerCODEC co, int[][] data, int max) {
+ private static void testCodec(IntegerCODEC c, IntegerCODEC co,
+ int[][] data, int max) {
int N = data.length;
int maxlength = 0;
for (int k = 0; k < N; ++k) {
@@ -407,8 +442,8 @@ private static void testCodec(IntegerCODEC c,IntegerCODEC co, int[][] data, int
// Check assertions.
assertEquals("length is not match", outpos.get(), data[k].length);
int[] bufferCutout = Arrays.copyOf(buffer, outpos.get());
- assertArrayEquals("failed to reconstruct original data",
- data[k], bufferCutout);
+ assertArrayEquals("failed to reconstruct original data", data[k],
+ bufferCutout);
}
}
@@ -429,8 +464,9 @@ public void testUnsortedExample() {
testUnsorted(new Composition(new FastPFOR(), new VariableByte()));
testUnsorted(new IntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()));
- testUnsorted(new Composition(new IntegratedBinaryPacking(), new VariableByte()));
+ new IntegratedVariableByte()));
+ testUnsorted(new Composition(new IntegratedBinaryPacking(),
+ new VariableByte()));
testUnsorted(new IntegratedComposition(new IntegratedFastPFOR(),
new IntegratedVariableByte()));
@@ -446,8 +482,9 @@ public void testUnsortedExample() {
testUnsorted2(new Composition(new FastPFOR(), new VariableByte()));
testUnsorted3(new IntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()));
- testUnsorted3(new Composition(new IntegratedBinaryPacking(), new VariableByte()));
+ new IntegratedVariableByte()));
+ testUnsorted3(new Composition(new IntegratedBinaryPacking(),
+ new VariableByte()));
testUnsorted3(new IntegratedComposition(new IntegratedFastPFOR(),
new IntegratedVariableByte()));
testUnsorted3(new VariableByte());
@@ -462,15 +499,19 @@ public void testUnsortedExample() {
testUnsorted3(new Composition(new FastPFOR(), new VariableByte()));
testUnsorted2(new IntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()));
- testUnsorted2(new Composition(new IntegratedBinaryPacking(), new VariableByte()));
+ new IntegratedVariableByte()));
+ testUnsorted2(new Composition(new IntegratedBinaryPacking(),
+ new VariableByte()));
testUnsorted2(new IntegratedComposition(new IntegratedFastPFOR(),
new IntegratedVariableByte()));
}
- public void testUnsorted(IntegerCODEC codec)
- {
+ /**
+ * @param codec
+ * provided codec
+ */
+ public void testUnsorted(IntegerCODEC codec) {
int[] lengths = { 133, 1333333 };
for (int N : lengths) {
int[] data = new int[N];
@@ -487,90 +528,93 @@ public void testUnsorted(IntegerCODEC codec)
int[] compressed = new int[(int) Math.ceil(N * 1.01) + 1024];
IntWrapper inputoffset = new IntWrapper(0);
IntWrapper outputoffset = new IntWrapper(0);
- codec.compress(data, inputoffset, data.length, compressed, outputoffset);
+ codec.compress(data, inputoffset, data.length, compressed,
+ outputoffset);
// we can repack the data: (optional)
compressed = Arrays.copyOf(compressed, outputoffset.intValue());
int[] recovered = new int[N];
IntWrapper recoffset = new IntWrapper(0);
- codec.uncompress(compressed, new IntWrapper(0),
- compressed.length, recovered, recoffset);
+ codec.uncompress(compressed, new IntWrapper(0), compressed.length,
+ recovered, recoffset);
assertArrayEquals(data, recovered);
}
}
-
- public void testUnsorted2(IntegerCODEC codec) {
- int[] data = new int[128];
- data[5] = -1;
- int[] compressed = new int[1024];
- IntWrapper inputoffset = new IntWrapper(0);
- IntWrapper outputoffset = new IntWrapper(0);
- codec.compress(data, inputoffset, data.length, compressed,
- outputoffset);
- // we can repack the data: (optional)
- compressed = Arrays.copyOf(compressed, outputoffset.intValue());
-
- int[] recovered = new int[128];
- IntWrapper recoffset = new IntWrapper(0);
- codec.uncompress(compressed, new IntWrapper(0),
- compressed.length, recovered, recoffset);
- assertArrayEquals(data, recovered);
- }
- public void testUnsorted3(IntegerCODEC codec) {
- int[] data = new int[128];
- data[127] = -1;
- int[] compressed = new int[1024];
- IntWrapper inputoffset = new IntWrapper(0);
- IntWrapper outputoffset = new IntWrapper(0);
- codec.compress(data, inputoffset, data.length, compressed,
- outputoffset);
- // we can repack the data: (optional)
- compressed = Arrays.copyOf(compressed, outputoffset.intValue());
-
- int[] recovered = new int[128];
- IntWrapper recoffset = new IntWrapper(0);
- codec.uncompress(compressed, new IntWrapper(0),
- compressed.length, recovered, recoffset);
- assertArrayEquals(data, recovered);
- }
-
-
- @Test
- public void fastPforTest() {
- // proposed by Stefan Ackermann (https://github.com/Stivo)
- FastPFOR codec1 = new FastPFOR();
- FastPFOR codec2 = new FastPFOR();
- int N = 128;
- int[] data = new int[N];
- for (int i = 0; i < N; i++)
- data[i] = 0;
- data[126] = -1;
- int[] comp = TestUtils.compress(codec1,
- Arrays.copyOf(data, N));
- int[] answer = TestUtils.uncompress(codec2, comp, N);
- for (int k = 0; k < N; ++k)
- if (answer[k] != data[k])
- throw new RuntimeException(
- "bug "+k+" "+answer[k]+" != "+data[k]);
- }
- @Test
- public void ifastPforTest() {
- // inspired by Stefan Ackermann (https://github.com/Stivo)
- IntegratedFastPFOR codec1 = new IntegratedFastPFOR();
- IntegratedFastPFOR codec2 = new IntegratedFastPFOR();
- int N = 128;
- int[] data = new int[N];
- for (int i = 0; i < N; i++)
- data[i] = 0;
- data[126] = -1;
- int[] comp = TestUtils.compress(codec1,
- Arrays.copyOf(data, N));
- int[] answer = TestUtils.uncompress(codec2, comp, N);
- for (int k = 0; k < N; ++k)
- if (answer[k] != data[k])
- throw new RuntimeException(
- "bug "+k+" "+answer[k]+" != "+data[k]);
- }
-
+ private void testUnsorted2(IntegerCODEC codec) {
+ int[] data = new int[128];
+ data[5] = -1;
+ int[] compressed = new int[1024];
+ IntWrapper inputoffset = new IntWrapper(0);
+ IntWrapper outputoffset = new IntWrapper(0);
+ codec.compress(data, inputoffset, data.length, compressed, outputoffset);
+ // we can repack the data: (optional)
+ compressed = Arrays.copyOf(compressed, outputoffset.intValue());
+
+ int[] recovered = new int[128];
+ IntWrapper recoffset = new IntWrapper(0);
+ codec.uncompress(compressed, new IntWrapper(0), compressed.length,
+ recovered, recoffset);
+ assertArrayEquals(data, recovered);
+ }
+
+ private void testUnsorted3(IntegerCODEC codec) {
+ int[] data = new int[128];
+ data[127] = -1;
+ int[] compressed = new int[1024];
+ IntWrapper inputoffset = new IntWrapper(0);
+ IntWrapper outputoffset = new IntWrapper(0);
+ codec.compress(data, inputoffset, data.length, compressed, outputoffset);
+ // we can repack the data: (optional)
+ compressed = Arrays.copyOf(compressed, outputoffset.intValue());
+
+ int[] recovered = new int[128];
+ IntWrapper recoffset = new IntWrapper(0);
+ codec.uncompress(compressed, new IntWrapper(0), compressed.length,
+ recovered, recoffset);
+ assertArrayEquals(data, recovered);
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void fastPforTest() {
+ // proposed by Stefan Ackermann (https://github.com/Stivo)
+ FastPFOR codec1 = new FastPFOR();
+ FastPFOR codec2 = new FastPFOR();
+ int N = 128;
+ int[] data = new int[N];
+ for (int i = 0; i < N; i++)
+ data[i] = 0;
+ data[126] = -1;
+ int[] comp = TestUtils.compress(codec1, Arrays.copyOf(data, N));
+ int[] answer = TestUtils.uncompress(codec2, comp, N);
+ for (int k = 0; k < N; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug " + k + " " + answer[k]
+ + " != " + data[k]);
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void ifastPforTest() {
+ // inspired by Stefan Ackermann (https://github.com/Stivo)
+ IntegratedFastPFOR codec1 = new IntegratedFastPFOR();
+ IntegratedFastPFOR codec2 = new IntegratedFastPFOR();
+ int N = 128;
+ int[] data = new int[N];
+ for (int i = 0; i < N; i++)
+ data[i] = 0;
+ data[126] = -1;
+ int[] comp = TestUtils.compress(codec1, Arrays.copyOf(data, N));
+ int[] answer = TestUtils.uncompress(codec2, comp, N);
+ for (int k = 0; k < N; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug " + k + " " + answer[k]
+ + " != " + data[k]);
+ }
+
}
diff --git a/src/test/java/me/lemire/integercompression/BoundaryTest.java b/src/test/java/me/lemire/integercompression/BoundaryTest.java
index f68ae36..99dc931 100644
--- a/src/test/java/me/lemire/integercompression/BoundaryTest.java
+++ b/src/test/java/me/lemire/integercompression/BoundaryTest.java
@@ -2,12 +2,21 @@
import java.util.Arrays;
+import me.lemire.integercompression.differential.IntegratedBinaryPacking;
+import me.lemire.integercompression.differential.IntegratedComposition;
+import me.lemire.integercompression.differential.IntegratedFastPFOR;
+import me.lemire.integercompression.differential.IntegratedVariableByte;
+
import org.junit.Test;
+
import static org.junit.Assert.*;
+/**
+ * @author lemire
+ *
+ */
@SuppressWarnings({ "static-method", "javadoc" })
-public class BoundaryTest
-{
+public class BoundaryTest {
private static void compressAndUncompress(int length, IntegerCODEC c) {
// Initialize array.
int[] source = new int[length];
@@ -26,15 +35,15 @@ private static void compressAndUncompress(int length, IntegerCODEC c) {
int[] uncompressed = new int[length];
IntWrapper u_inpos = new IntWrapper(0);
IntWrapper u_outpos = new IntWrapper(0);
- c.uncompress(compressed, u_inpos, c_outpos.get(),
- uncompressed, u_outpos);
+ c.uncompress(compressed, u_inpos, c_outpos.get(), uncompressed,
+ u_outpos);
// Compare between uncompressed and original arrays.
int[] target = Arrays.copyOf(uncompressed, u_outpos.get());
- if(!Arrays.equals(source, target)) {
- System.out.println("problem with length = "+length+" and "+c);
- System.out.println(Arrays.toString(source));
- System.out.println(Arrays.toString(target));
+ if (!Arrays.equals(source, target)) {
+ System.out.println("problem with length = " + length + " and " + c);
+ System.out.println(Arrays.toString(source));
+ System.out.println(Arrays.toString(target));
}
assertArrayEquals(source, target);
}
@@ -56,23 +65,24 @@ private static void testBoundary(IntegerCODEC c) {
around256(c);
}
+
+ /**
+ */
@Test
- public void testIntegratedComposition() throws Exception {
+ public void testIntegratedComposition() {
IntegratedComposition c = new IntegratedComposition(
- new IntegratedBinaryPacking(),
- new IntegratedVariableByte());
+ new IntegratedBinaryPacking(), new IntegratedVariableByte());
testBoundary(c);
IntegratedComposition c2 = new IntegratedComposition(
- new IntegratedFastPFOR(),
- new IntegratedVariableByte());
+ new IntegratedFastPFOR(), new IntegratedVariableByte());
testBoundary(c2);
}
- @Test
- public void testComposition() throws Exception {
- Composition c = new Composition(
- new BinaryPacking(),
- new VariableByte());
+ /**
+ */
+ @Test
+ public void testComposition() {
+ Composition c = new Composition(new BinaryPacking(), new VariableByte());
testBoundary(c);
}
}
diff --git a/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java b/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java
index 872c6ac..76a1e81 100644
--- a/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java
+++ b/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java
@@ -7,20 +7,24 @@
import org.junit.Test;
import static org.junit.Assert.*;
+/**
+ * @author lemire
+ *
+ */
@SuppressWarnings({ "javadoc", "static-method" })
public class DeltaZigzagEncodingTest {
- public static int zigzagEncode(DeltaZigzagEncoding.Encoder e, int value) {
+ protected static int zigzagEncode(DeltaZigzagEncoding.Encoder e, int value) {
e.setContextValue(0);
return e.encodeInt(value);
}
- public static int zigzagDecode(DeltaZigzagEncoding.Decoder d, int value) {
+ protected static int zigzagDecode(DeltaZigzagEncoding.Decoder d, int value) {
d.setContextValue(0);
return d.decodeInt(value);
}
- public static void checkEncode(
+ protected static void checkEncode(
DeltaZigzagEncoding.Encoder e,
int[] data,
int[] expected)
@@ -29,7 +33,7 @@ public static void checkEncode(
assertEquals(data[data.length - 1], e.getContextValue());
}
- public static void checkDecode(
+ protected static void checkDecode(
DeltaZigzagEncoding.Decoder d,
int[] data,
int[] expected)
@@ -38,7 +42,9 @@ public static void checkDecode(
assertArrayEquals(expected, r);
assertEquals(r[r.length - 1], d.getContextValue());
}
-
+ /**
+ *
+ */
@Test
public void checkZigzagEncode() {
DeltaZigzagEncoding.Encoder e = new DeltaZigzagEncoding.Encoder(0);
@@ -50,7 +56,9 @@ public void checkZigzagEncode() {
assertEquals(3, zigzagEncode(e, -2));
assertEquals(5, zigzagEncode(e, -3));
}
-
+ /**
+ *
+ */
@Test
public void checkZigzagDecoder() {
DeltaZigzagEncoding.Decoder d = new DeltaZigzagEncoding.Decoder(0);
@@ -61,7 +69,9 @@ public void checkZigzagDecoder() {
assertEquals( 2, zigzagDecode(d, 4));
assertEquals(-3, zigzagDecode(d, 5));
}
-
+ /**
+ *
+ */
@Test
public void checkEncodeSimple() {
DeltaZigzagEncoding.Encoder e = new DeltaZigzagEncoding.Encoder(0);
@@ -69,7 +79,9 @@ public void checkEncodeSimple() {
new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
new int[]{ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2 });
}
-
+ /**
+ *
+ */
@Test
public void checkDecodeSimple() {
DeltaZigzagEncoding.Decoder d = new DeltaZigzagEncoding.Decoder(0);
@@ -78,7 +90,7 @@ public void checkDecodeSimple() {
new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
}
- public static class SpotChecker {
+ protected static class SpotChecker {
private final static DeltaZigzagEncoding.Encoder encoder =
new DeltaZigzagEncoding.Encoder(0);
@@ -94,6 +106,9 @@ public void check(int value) {
}
}
+ /**
+ *
+ */
@Test
public void checkSpots() {
SpotChecker c = new SpotChecker();
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index 3a581f6..c6ca197 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -11,10 +11,13 @@
*/
@SuppressWarnings({ "javadoc"})
public class TestUtils {
+ /**
+ *
+ */
@Test
public void bogus() {}// to avoid useless complaining.
- public static void dumpIntArray(int[] data, String label) {
+ protected static void dumpIntArray(int[] data, String label) {
System.out.print(label);
for (int i = 0; i < data.length; ++i) {
if (i % 6 == 0) {
@@ -25,7 +28,7 @@ public static void dumpIntArray(int[] data, String label) {
System.out.println();
}
- public static void dumpIntArrayAsHex(int[] data, String label) {
+ protected static void dumpIntArrayAsHex(int[] data, String label) {
System.out.print(label);
for (int i = 0; i < data.length; ++i) {
if (i % 8 == 0) {
@@ -40,7 +43,7 @@ public static void dumpIntArrayAsHex(int[] data, String label) {
* Check that compress and uncompress keep original array.
*
* @param codec CODEC to test.
- * @param source Data for test.
+ * @param orig original integers
*/
public static void assertSymmetry(IntegerCODEC codec, int... orig) {
// There are some cases that compressed array is bigger than original
@@ -71,7 +74,7 @@ public static void assertSymmetry(IntegerCODEC codec, int... orig) {
assertArrayEquals(orig, target);
}
- public static int[] compress(IntegerCODEC codec, int[] data) {
+ protected static int[] compress(IntegerCODEC codec, int[] data) {
int[] outBuf = new int[data.length * 4];
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
@@ -79,7 +82,7 @@ public static int[] compress(IntegerCODEC codec, int[] data) {
return Arrays.copyOf(outBuf, outPos.get());
}
- public static int[] uncompress(IntegerCODEC codec, int[] data, int len) {
+ protected static int[] uncompress(IntegerCODEC codec, int[] data, int len) {
int[] outBuf = new int[len + 1024];
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
diff --git a/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java b/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java
index 35dde4e..49351b4 100644
--- a/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java
+++ b/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java
@@ -6,9 +6,16 @@
import java.util.Arrays;
+import me.lemire.integercompression.differential.XorBinaryPacking;
+
import org.junit.Test;
+
import static org.junit.Assert.*;
+/**
+ * @author lemire
+ *
+ */
@SuppressWarnings({ "javadoc", "static-method" })
public final class XorBinaryPackingTest
{
@@ -18,13 +25,16 @@ public final class XorBinaryPackingTest
- public static void checkCompressAndUncompress(String label, int[] data) {
+ private static void checkCompressAndUncompress(String label, int[] data) {
XorBinaryPacking codec = new XorBinaryPacking();
int[] compBuf = TestUtils.compress(codec, data);
int[] decompBuf = TestUtils.uncompress(codec, compBuf, data.length);
assertArrayEquals(data, decompBuf);
}
+ /**
+ *
+ */
@Test
public void compressAndUncompress0() {
int[] data = new int[128];
@@ -35,6 +45,9 @@ public void compressAndUncompress0() {
checkCompressAndUncompress("compressAndUncompress0", data);
}
+ /**
+ *
+ */
@Test
public void compressAndUncompress1() {
int[] data = new int[128];
@@ -44,6 +57,9 @@ public void compressAndUncompress1() {
checkCompressAndUncompress("compressAndUncompress1", data);
}
+ /**
+ *
+ */
@Test
public void compressAndUncompress2() {
int[] data = new int[128];
@@ -53,6 +69,9 @@ public void compressAndUncompress2() {
checkCompressAndUncompress("compressAndUncompress2", data);
}
+ /**
+ *
+ */
@Test
public void compressAndUncompress3() {
int[] data = new int[256];
@@ -61,6 +80,9 @@ public void compressAndUncompress3() {
checkCompressAndUncompress("compressAndUncompress3", data);
}
+ /**
+ *
+ */
@Test
public void compressAndUncompress4() {
int[] data = new int[256];
@@ -69,6 +91,9 @@ public void compressAndUncompress4() {
checkCompressAndUncompress("compressAndUncompress4", data);
}
+ /**
+ *
+ */
@Test
public void compressAndUncompress5() {
int[] data = new int[256];
From addf94f7fc15dfe392c8d79d4b36f4f4be08e2b1 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 23 Jul 2014 14:08:32 -0400
Subject: [PATCH 015/266] [maven-release-plugin] prepare release
JavaFastPFOR-0.0.13
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 79f9c3d..0140062 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.13-SNAPSHOT
+ 0.0.13
jar
From bb28899b5817c0b5ac89c029c5de1b648134eda5 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 23 Jul 2014 14:08:34 -0400
Subject: [PATCH 016/266] [maven-release-plugin] prepare for next development
iteration
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 0140062..617a7bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.13
+ 0.0.14-SNAPSHOT
jar
From 1365ed0b6357da7ef2cefc6259a4a71a65315352 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Mon, 11 Aug 2014 15:58:58 -0400
Subject: [PATCH 017/266] Resolved issue where the java version of FastPFOR
differs from the C++ version
---
src/main/java/me/lemire/integercompression/FastPFOR.java | 8 ++++----
.../differential/IntegratedFastPFOR.java | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/FastPFOR.java b/src/main/java/me/lemire/integercompression/FastPFOR.java
index 3caa94a..2245411 100644
--- a/src/main/java/me/lemire/integercompression/FastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/FastPFOR.java
@@ -182,11 +182,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
inpos.set(tmpinpos);
out[headerpos] = tmpoutpos - headerpos;
+ final int bytesize = byteContainer.position();
while ((byteContainer.position() & 3) != 0)
byteContainer.put((byte) 0);
- final int bytesize = byteContainer.position();
out[tmpoutpos++] = bytesize;
- final int howmanyints = bytesize / 4;
+ final int howmanyints = byteContainer.position() / 4;
byteContainer.flip();
byteContainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
tmpoutpos += howmanyints;
@@ -245,8 +245,8 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int inexcept = initpos + wheremeta;
final int bytesize = in[inexcept++];
byteContainer.clear();
- byteContainer.asIntBuffer().put(in, inexcept, bytesize / 4);
- inexcept += bytesize / 4;
+ byteContainer.asIntBuffer().put(in, inexcept, (bytesize + 3) / 4);
+ inexcept += (bytesize + 3)/ 4;
final int bitmap = in[inexcept++];
for (int k = 1; k <= 32; ++k) {
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
index 8b5e499..4af2f0a 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
@@ -203,11 +203,11 @@ private void encodePage(int[] constin, IntWrapper constinpos,
}
constinpos.set(tmpconstinpos);
out[headerpos] = tmpoutpos - headerpos;
+ final int bytesize = byteContainer.position();
while ((byteContainer.position() & 3) != 0)
byteContainer.put((byte) 0);
- final int bytesize = byteContainer.position();
out[tmpoutpos++] = bytesize;
- final int howmanyints = bytesize / 4;
+ final int howmanyints = byteContainer.position() / 4;
byteContainer.flip();
byteContainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
tmpoutpos += howmanyints;
@@ -267,8 +267,8 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int inexcept = initpos + wheremeta;
final int bytesize = in[inexcept++];
byteContainer.clear();
- byteContainer.asIntBuffer().put(in, inexcept, bytesize / 4);
- inexcept += bytesize / 4;
+ byteContainer.asIntBuffer().put(in, inexcept, (bytesize + 3) / 4);
+ inexcept += (bytesize + 3) / 4;
final int bitmap = in[inexcept++];
for (int k = 1; k <= 32; ++k) {
From 70ac1e80348bcebf54cdbd93ae96f11a695e6684 Mon Sep 17 00:00:00 2001
From: roysamit
Date: Mon, 11 Aug 2014 23:33:48 -0500
Subject: [PATCH 018/266] Changed the logic of VariableByte Java version to
match the C++ version
---
.../integercompression/VariableByte.java | 233 +++++++++++-------
1 file changed, 138 insertions(+), 95 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 599d7c6..1fac495 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
import java.nio.IntBuffer;
/**
@@ -19,105 +20,147 @@
* @author Daniel Lemire
*/
public class VariableByte implements IntegerCODEC, ByteIntegerCODEC {
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
- for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- int val = in[k];
- do {
- int b = (val & 127);
- val >>>= 7;
- if (val != 0) {
- b |= 128;
- }
- buf.put((byte) b);
- } while (val != 0);
- }
- while (buf.position() % 4 != 0)
- buf.put((byte) 128);
- final int length = buf.position();
- buf.flip();
- IntBuffer ibuf = buf.asIntBuffer();
- ibuf.get(out, outpos.get(), length / 4);
- outpos.add(length / 4);
- inpos.add(inlength);
- }
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- byte[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- int outp = outpos.get();
- for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- int val = in[k];
- do {
- int b = (val & 127);
- val >>>= 7;
- if (val != 0) {
- b |= 128;
- }
- out[outp++] = (byte) b;
- } while (val != 0);
- }
- outpos.set(outp);
- inpos.add(inlength);
- }
+ private byte extract7bits(int i, long val) {
+ return (byte)((val >> (7 * i)) & ((1 << 7) - 1));
+ }
- @Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- int s = 0;
- int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- for (int v = 0, shift = 0; p < finalp;) {
- int c = (byte) (in[p] >>> (24 - s));
- s += 8;
- if (s == 32) {
- s = 0;
- p++;
- }
- v += ((c & 127) << shift);
- if ((c & 128) == 0) {
- out[tmpoutpos++] = v;
- v = 0;
- shift = 0;
- } else
- shift += 7;
- }
- outpos.set(tmpoutpos);
- inpos.add(inlength);
- }
+ private byte extract7bitsmaskless(int i, long val) {
+ return (byte)((val >> (7 * i)));
+ }
- @Override
- public void uncompress(byte[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- int v = 0;
- int shift = 0;
- for (; p < finalp; ++p) {
- int c = in[p];
- v += ((c & 127) << shift);
- if ((c & 128) == 0) {
- out[tmpoutpos++] = v;
- v = 0;
- shift = 0;
- } else
- shift += 7;
- }
- outpos.set(tmpoutpos);
- inpos.add(p);
- }
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ long val = in[k] & 0xFFFFFFFFL;
+ if (val < (1 << 7)) {
+ buf.put((byte)(val | (1 << 7)));
+ } else if (val < (1 << 14)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
+ } else if (val < (1 << 21)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
+ } else if (val < (1 << 28)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
+ } else {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)extract7bits(3, val));
+ buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
+ }
+ }
+ while (buf.position() % 4 != 0)
+ buf.put((byte) 0);
+ final int length = buf.position();
+ buf.flip();
+ IntBuffer ibuf = buf.asIntBuffer();
+ ibuf.get(out, outpos.get(), length / 4);
+ outpos.add(length / 4);
+ inpos.add(inlength);
+ }
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength,
+ byte[] out, IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ long val = in[k] & 0xFFFFFFFFL;
+ if (val < (1 << 7)) {
+ buf.put((byte)(val | (1 << 7)));
+ } else if (val < (1 << 14)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
+ } else if (val < (1 << 21)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
+ } else if (val < (1 << 28)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
+ } else {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)extract7bits(3, val));
+ buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
+ }
+ }
+ while (buf.position() % 4 != 0)
+ buf.put((byte) 0);
+ final int length = buf.position();
+ buf.flip();
+ buf.get(out,0,length);
+ outpos.set(length);
+ inpos.add(inlength);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ int s = 0;
+ int val = 0;
+ int p = inpos.get();
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ for (int v = 0, shift =0; p < finalp;) {
+ val = in[p];
+ int c = (byte) (val >>> (24 - s));
+ s += 8;
+ if (s == 32) {
+ s = 0;
+ p++;
+ }
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos++] = v;
+ v = 0;
+ shift = 0;
+ } else
+ shift +=7;
+ }
+ outpos.set(tmpoutpos);
+ inpos.add(inlength);
+ }
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
+ @Override
+ public void uncompress(byte[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ int p = inpos.get();
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ int v = 0;
+ int shift = 0;
+ for (; p < finalp; ++p) {
+ int c = in[p];
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos++] = v;
+ v = 0;
+ shift = 0;
+ } else
+ shift += 7;
}
+ outpos.set(tmpoutpos);
+ inpos.add(p);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
}
From d7fe1ba89fee9def40a1bc27110e0e117d6f1fff Mon Sep 17 00:00:00 2001
From: roysamit
Date: Mon, 11 Aug 2014 23:40:33 -0500
Subject: [PATCH 019/266] Updated the logic of VariableByte Java version to
match the C++ version
---
.../integercompression/VariableByte.java | 35 +++++++++----------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 1fac495..64614d0 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -7,7 +7,6 @@
package me.lemire.integercompression;
import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
import java.nio.IntBuffer;
/**
@@ -140,24 +139,24 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
public void uncompress(byte[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- int v = 0;
- int shift = 0;
- for (; p < finalp; ++p) {
- int c = in[p];
- v += ((c & 127) << shift);
- if ((c & 128) == 128) {
- out[tmpoutpos++] = v;
- v = 0;
- shift = 0;
- } else
- shift += 7;
- }
- outpos.set(tmpoutpos);
- inpos.add(p);
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ int v = 0;
+ int shift = 0;
+ for (; p < finalp; ++p) {
+ int c = in[p];
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos++] = v;
+ v = 0;
+ shift = 0;
+ } else
+ shift += 7;
+ }
+ outpos.set(tmpoutpos);
+ inpos.add(p);
}
-
+
@Override
public String toString() {
return this.getClass().getSimpleName();
From 37b5e11fbb31e1b081815b675465a7f88ab2cb2b Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 12 Aug 2014 08:28:25 -0400
Subject: [PATCH 020/266] Minor consistency checks
---
.../integercompression/VariableByte.java | 8 +-
.../differential/IntegratedVariableByte.java | 250 ++++++++++--------
2 files changed, 148 insertions(+), 110 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 64614d0..318d46a 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -20,11 +20,11 @@
*/
public class VariableByte implements IntegerCODEC, ByteIntegerCODEC {
- private byte extract7bits(int i, long val) {
+ private static byte extract7bits(int i, long val) {
return (byte)((val >> (7 * i)) & ((1 << 7) - 1));
}
- private byte extract7bitsmaskless(int i, long val) {
+ private static byte extract7bitsmaskless(int i, long val) {
return (byte)((val >> (7 * i)));
}
@@ -35,7 +35,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
return;
ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- long val = in[k] & 0xFFFFFFFFL;
+ final long val = in[k] & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
if (val < (1 << 7)) {
buf.put((byte)(val | (1 << 7)));
} else if (val < (1 << 14)) {
@@ -75,7 +75,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
return;
ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- long val = in[k] & 0xFFFFFFFFL;
+ final long val = in[k] & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
if (val < (1 << 7)) {
buf.put((byte)(val | (1 << 7)));
} else if (val < (1 << 14)) {
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
index 19be4b8..e086e10 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
@@ -20,120 +20,158 @@
*
* @author Daniel Lemire
*/
-public class IntegratedVariableByte implements IntegratedIntegerCODEC,
- IntegratedByteIntegerCODEC {
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- int initoffset = 0;
- ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
- for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- int val = in[k] - initoffset;
- initoffset = in[k];
- do {
- int b = (val & 127);
- val >>>= 7;
- if (val != 0) {
- b |= 128;
- }
- buf.put((byte) b);
- } while (val != 0);
- }
- while (buf.position() % 4 != 0)
- buf.put((byte) 128);
- final int length = buf.position();
- buf.flip();
- IntBuffer ibuf = buf.asIntBuffer();
- ibuf.get(out, outpos.get(), length / 4);
- outpos.add(length / 4);
- inpos.add(inlength);
- }
+public class IntegratedVariableByte implements IntegratedIntegerCODEC, IntegratedByteIntegerCODEC {
+
+ private static byte extract7bits(int i, long val) {
+ return (byte)((val >> (7 * i)) & ((1 << 7) - 1));
+ }
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- byte[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- int outp = outpos.get();
- int initoffset = 0;
+ private static byte extract7bitsmaskless(int i, long val) {
+ return (byte)((val >> (7 * i)));
+ }
- for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- int val = in[k] - initoffset;
- initoffset = in[k];
- do {
- int b = (val & 127);
- val >>>= 7;
- if (val != 0) {
- b |= 128;
- }
- out[outp++] = (byte) b;
- } while (val != 0);
- }
- outpos.set(outp);
- inpos.add(inlength);
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ int initoffset = 0;
+ ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ final long val = (in[k] - initoffset) & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
+ initoffset = in[k];
+ if (val < (1 << 7)) {
+ buf.put((byte)(val | (1 << 7)));
+ } else if (val < (1 << 14)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
+ } else if (val < (1 << 21)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
+ } else if (val < (1 << 28)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
+ } else {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)extract7bits(3, val));
+ buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
+ }
}
+ while (buf.position() % 4 != 0)
+ buf.put((byte) 0);
+ final int length = buf.position();
+ buf.flip();
+ IntBuffer ibuf = buf.asIntBuffer();
+ ibuf.get(out, outpos.get(), length / 4);
+ outpos.add(length / 4);
+ inpos.add(inlength);
+ }
- @Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- int s = 0;
- int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- int initoffset = 0;
- for (int v = 0, shift = 0; p < finalp;) {
- int c = (byte) (in[p] >>> (24 - s));
- s += 8;
- if (s == 32) {
- s = 0;
- p++;
- }
- v += ((c & 127) << shift);
- if ((c & 128) == 0) {
- out[tmpoutpos] = v + initoffset;
- initoffset = out[tmpoutpos];
- tmpoutpos++;
- v = 0;
- shift = 0;
- } else
- shift += 7;
- }
- outpos.set(tmpoutpos);
- inpos.add(inlength);
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength,
+ byte[] out, IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ int initoffset = 0;
+ ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ final long val = (in[k] - initoffset) & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
+ initoffset = in[k];
+ if (val < (1 << 7)) {
+ buf.put((byte)(val | (1 << 7)));
+ } else if (val < (1 << 14)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
+ } else if (val < (1 << 21)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
+ } else if (val < (1 << 28)) {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
+ } else {
+ buf.put((byte)extract7bits(0, val));
+ buf.put((byte)extract7bits(1, val));
+ buf.put((byte)extract7bits(2, val));
+ buf.put((byte)extract7bits(3, val));
+ buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
+ }
}
+ while (buf.position() % 4 != 0)
+ buf.put((byte) 0);
+ final int length = buf.position();
+ buf.flip();
+ buf.get(out,0,length);
+ outpos.set(length);
+ inpos.add(inlength);
+ }
- @Override
- public void uncompress(byte[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- int v = 0;
- int shift = 0;
- int initoffset = 0;
- for (; p < finalp; ++p) {
- byte c = in[p];
- v += ((c & 127) << shift);
- if ((c & 128) == 0) {
- out[tmpoutpos] = v + initoffset;
- initoffset = out[tmpoutpos];
- v = 0;
- ++tmpoutpos;
- shift = 0;
- } else
- shift += 7;
- }
- outpos.set(tmpoutpos);
- inpos.add(p);
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ int s = 0;
+ int val = 0;
+ int p = inpos.get();
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ int initoffset = 0;
+ for (int v = 0, shift =0; p < finalp;) {
+ val = in[p];
+ int c = (byte) (val >>> (24 - s));
+ s += 8;
+ if (s == 32) {
+ s = 0;
+ p++;
+ }
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos] = v + initoffset;
+ initoffset = out[tmpoutpos];
+ tmpoutpos++;
+ v = 0;
+ shift = 0;
+ } else
+ shift +=7;
}
+ outpos.set(tmpoutpos);
+ inpos.add(inlength);
+ }
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
+ @Override
+ public void uncompress(byte[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ int p = inpos.get();
+ int initoffset = 0;
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ int v = 0;
+ int shift = 0;
+ for (; p < finalp; ++p) {
+ int c = in[p];
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos] = v + initoffset;
+ initoffset = out[tmpoutpos];
+ tmpoutpos++;
+ v = 0;
+ shift = 0;
+ } else
+ shift += 7;
}
+ outpos.set(tmpoutpos);
+ inpos.add(p);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
}
From f9e2224455f534371331578c78bc147c3983aba0 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 12 Aug 2014 08:31:00 -0400
Subject: [PATCH 021/266] Book-keeping
---
CHANGELOG | 3 +++
README.md | 1 +
2 files changed, 4 insertions(+)
diff --git a/CHANGELOG b/CHANGELOG
index 8297989..843493d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+0.0.14 (upcoming)
+ - FastPFOR and VariableByte codecs made consistent with C++ version at https://github.com/lemire/FastPFor
+
0.0.13 (July 23rd 2014)
- CODECs using differential coding are now in a separate package (me.lemire.integercompression.differential)
diff --git a/README.md b/README.md
index 230059c..fc8994b 100644
--- a/README.md
+++ b/README.md
@@ -85,6 +85,7 @@ Main contributors
with contributions by
* Di Wu, http://www.facebook.com/diwu1989
* Stefan Ackermann, https://github.com/Stivo
+* Samit Roy, https://github.com/roysamit
How does it compare to the Kamikaze PForDelta library?
------------------------------------------------------
From 38d395961fe30dc546b61ffa5f718d56ddffff60 Mon Sep 17 00:00:00 2001
From: Samit Roy
Date: Tue, 19 Aug 2014 00:19:11 -0500
Subject: [PATCH 022/266] Modifying the compressed integers byte order of
VariableByte to match FastPFor when using both in Composition in Java to work
with C++ decompression
---
src/main/java/me/lemire/integercompression/VariableByte.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 318d46a..5c34cb8 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
import java.nio.IntBuffer;
/**
@@ -34,6 +35,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ buf.order(ByteOrder.LITTLE_ENDIAN);
for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
final long val = in[k] & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
if (val < (1 << 7)) {
@@ -117,7 +119,7 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
int tmpoutpos = outpos.get();
for (int v = 0, shift =0; p < finalp;) {
val = in[p];
- int c = (byte) (val >>> (24 - s));
+ int c = (byte) (val >>> s);
s += 8;
if (s == 32) {
s = 0;
From d0a008a2bf606a7a29fa792144b3a233bfe30dc1 Mon Sep 17 00:00:00 2001
From: Samit Roy
Date: Thu, 21 Aug 2014 00:55:54 -0500
Subject: [PATCH 023/266] Modifying the compressed integers byte order of
IntegratedVariableByte to match IntegratedFastPFor when using both in
Composition
---
.../differential/IntegratedVariableByte.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
index e086e10..c0a4a0b 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
@@ -4,9 +4,10 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression.differential;
+package me.lemire.integercompression;
import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
import java.nio.IntBuffer;
import me.lemire.integercompression.IntWrapper;
@@ -37,6 +38,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
return;
int initoffset = 0;
ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ buf.order(ByteOrder.LITTLE_ENDIAN);
for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
final long val = (in[k] - initoffset) & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
initoffset = in[k];
@@ -124,7 +126,7 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
int initoffset = 0;
for (int v = 0, shift =0; p < finalp;) {
val = in[p];
- int c = (byte) (val >>> (24 - s));
+ int c = (byte) (val >>> s);
s += 8;
if (s == 32) {
s = 0;
From dadded4194072302f698e14d0b76c0b417410c79 Mon Sep 17 00:00:00 2001
From: Samit Roy
Date: Thu, 21 Aug 2014 01:07:17 -0500
Subject: [PATCH 024/266] Update IntegratedVariableByte.java
---
.../integercompression/differential/IntegratedVariableByte.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
index c0a4a0b..149fb0f 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
@@ -4,7 +4,7 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression;
+package me.lemire.integercompression.differential;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
From 11afd64312914ec8f7177eb0c0f551c9dda38502 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 21 Aug 2014 15:20:56 -0400
Subject: [PATCH 025/266] Preparing new release
---
CHANGELOG | 4 +++-
README.md | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 843493d..da36702 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
-0.0.14 (upcoming)
+
+0.0.14 (August 21st 2014)
- FastPFOR and VariableByte codecs made consistent with C++ version at https://github.com/lemire/FastPFor
+ - VariableByte made to use little endian encoding
0.0.13 (July 23rd 2014)
- CODECs using differential coding are now in a separate package (me.lemire.integercompression.differential)
diff --git a/README.md b/README.md
index fc8994b..dc3cd6b 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ the following code in your pom.xml file:
me.lemire.integercompression
JavaFastPFOR
- 0.0.13
+ 0.0.14
From 6caf527d496f1f8890c9b3f0ee524e88cbc609ad Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 21 Aug 2014 15:22:20 -0400
Subject: [PATCH 026/266] [maven-release-plugin] prepare release
JavaFastPFOR-0.0.14
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 617a7bc..645de5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.14-SNAPSHOT
+ 0.0.14
jar
From 9b6377832f6190578c61cdb44afa7fb46c2867e9 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 21 Aug 2014 15:22:23 -0400
Subject: [PATCH 027/266] [maven-release-plugin] prepare for next development
iteration
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 645de5f..a69bb88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.14
+ 0.0.15-SNAPSHOT
jar
From ece748e925ac5a4db913e7f4fe72428054b5d04f Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 9 Sep 2014 11:34:40 -0400
Subject: [PATCH 028/266] Preparing new release
---
CHANGELOG | 2 +
README.md | 2 +-
.../com/kamikaze/pfordelta/LCPForDelta.java | 1 -
.../pfordelta/PForDeltaUnpack128.java | 1 -
.../PForDeltaUnpack128WIthIntBuffer.java | 1 -
.../java/com/kamikaze/pfordelta/Simple16.java | 1 -
.../pfordelta/Simple16WithHardCodes.java | 1 -
.../integercompression/VariableByte.java | 281 +++++++++---------
.../differential/IntegratedVariableByte.java | 75 ++---
.../lemire/integercompression/AdhocTest.java | 2 +-
.../lemire/integercompression/BasicTest.java | 2 +-
.../integercompression/BoundaryTest.java | 2 +-
.../DeltaZigzagEncodingTest.java | 2 +-
.../lemire/integercompression/TestUtils.java | 20 +-
.../XorBinaryPackingTest.java | 2 +-
15 files changed, 212 insertions(+), 183 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index da36702..82dadde 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+0.0.15 (September 9th 2014)
+ - Improved the performance of VariableByte schemes when used as a ByteIntegerCODEC
0.0.14 (August 21st 2014)
- FastPFOR and VariableByte codecs made consistent with C++ version at https://github.com/lemire/FastPFor
diff --git a/README.md b/README.md
index dc3cd6b..0d896ca 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ the following code in your pom.xml file:
me.lemire.integercompression
JavaFastPFOR
- 0.0.14
+ 0.0.15
diff --git a/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java b/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
index bf5154e..a948097 100644
--- a/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
+++ b/src/main/java/com/kamikaze/pfordelta/LCPForDelta.java
@@ -51,7 +51,6 @@
*
* @author hao yan, hyan2008@gmail.com
*/
-@SuppressWarnings("javadoc")
public class LCPForDelta {
// NOTE: we expect the blockSize is always < (1<<(31-POSSIBLE_B_BITS)).
diff --git a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java
index 31b5378..fe5647c 100644
--- a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java
+++ b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128.java
@@ -5,7 +5,6 @@
* up by D. Lemire. It is included in the JavaFastPFOR library for comparison
* purposes. As the original
*/
-@SuppressWarnings("javadoc")
public class PForDeltaUnpack128 {
static protected void unpack(int[] out, int[] in, int bits) {
diff --git a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java
index 2e10e29..4b7a483 100644
--- a/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java
+++ b/src/main/java/com/kamikaze/pfordelta/PForDeltaUnpack128WIthIntBuffer.java
@@ -12,7 +12,6 @@
* PForDeltaUnpack128WIthIntBuffer is almost the same as PForDeltaUnpack128,
* except that it use IntBuffer as input instead of int[].
*/
-@SuppressWarnings("javadoc")
public class PForDeltaUnpack128WIthIntBuffer {
static protected void unpack(int[] out, IntBuffer in, int bits) {
diff --git a/src/main/java/com/kamikaze/pfordelta/Simple16.java b/src/main/java/com/kamikaze/pfordelta/Simple16.java
index 1ccd315..c427f4d 100644
--- a/src/main/java/com/kamikaze/pfordelta/Simple16.java
+++ b/src/main/java/com/kamikaze/pfordelta/Simple16.java
@@ -20,7 +20,6 @@
* range of [2^28, 2^32). A simple way is just write those numbers as 32-bit
* integers (that is, no compression for very big numbers).
*/
-@SuppressWarnings("javadoc")
public class Simple16 {
private static final int S16_NUMSIZE = 16;
diff --git a/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java b/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
index b1a9f3f..b371360 100644
--- a/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
+++ b/src/main/java/com/kamikaze/pfordelta/Simple16WithHardCodes.java
@@ -26,7 +26,6 @@
*
* Author: Hao Yan, hyan2008@gmail.com
*/
-@SuppressWarnings("javadoc")
public class Simple16WithHardCodes {
private static final int S16_NUMSIZE = 16;
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 5c34cb8..e33fc1f 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -21,147 +21,156 @@
*/
public class VariableByte implements IntegerCODEC, ByteIntegerCODEC {
- private static byte extract7bits(int i, long val) {
- return (byte)((val >> (7 * i)) & ((1 << 7) - 1));
- }
+ private static byte extract7bits(int i, long val) {
+ return (byte) ((val >> (7 * i)) & ((1 << 7) - 1));
+ }
- private static byte extract7bitsmaskless(int i, long val) {
- return (byte)((val >> (7 * i)));
- }
+ private static byte extract7bitsmaskless(int i, long val) {
+ return (byte) ((val >> (7 * i)));
+ }
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
- buf.order(ByteOrder.LITTLE_ENDIAN);
- for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- final long val = in[k] & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
- if (val < (1 << 7)) {
- buf.put((byte)(val | (1 << 7)));
- } else if (val < (1 << 14)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
- } else if (val < (1 << 21)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
- } else if (val < (1 << 28)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)extract7bits(2, val));
- buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
- } else {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)extract7bits(2, val));
- buf.put((byte)extract7bits(3, val));
- buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
- }
- }
- while (buf.position() % 4 != 0)
- buf.put((byte) 0);
- final int length = buf.position();
- buf.flip();
- IntBuffer ibuf = buf.asIntBuffer();
- ibuf.get(out, outpos.get(), length / 4);
- outpos.add(length / 4);
- inpos.add(inlength);
- }
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ buf.order(ByteOrder.LITTLE_ENDIAN);
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ final long val = in[k] & 0xFFFFFFFFL; // To be consistent with
+ // unsigned integers in C/C++
+ if (val < (1 << 7)) {
+ buf.put((byte) (val | (1 << 7)));
+ } else if (val < (1 << 14)) {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) (extract7bitsmaskless(1, (val)) | (1 << 7)));
+ } else if (val < (1 << 21)) {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) extract7bits(1, val));
+ buf.put((byte) (extract7bitsmaskless(2, (val)) | (1 << 7)));
+ } else if (val < (1 << 28)) {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) extract7bits(1, val));
+ buf.put((byte) extract7bits(2, val));
+ buf.put((byte) (extract7bitsmaskless(3, (val)) | (1 << 7)));
+ } else {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) extract7bits(1, val));
+ buf.put((byte) extract7bits(2, val));
+ buf.put((byte) extract7bits(3, val));
+ buf.put((byte) (extract7bitsmaskless(4, (val)) | (1 << 7)));
+ }
+ }
+ while (buf.position() % 4 != 0)
+ buf.put((byte) 0);
+ final int length = buf.position();
+ buf.flip();
+ IntBuffer ibuf = buf.asIntBuffer();
+ ibuf.get(out, outpos.get(), length / 4);
+ outpos.add(length / 4);
+ inpos.add(inlength);
+ }
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- byte[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
- for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
- final long val = in[k] & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
- if (val < (1 << 7)) {
- buf.put((byte)(val | (1 << 7)));
- } else if (val < (1 << 14)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
- } else if (val < (1 << 21)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
- } else if (val < (1 << 28)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)extract7bits(2, val));
- buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
- } else {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)extract7bits(2, val));
- buf.put((byte)extract7bits(3, val));
- buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
- }
- }
- while (buf.position() % 4 != 0)
- buf.put((byte) 0);
- final int length = buf.position();
- buf.flip();
- buf.get(out,0,length);
- outpos.set(length);
- inpos.add(inlength);
- }
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, byte[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ int outpostmp = outpos.get();
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ final long val = in[k] & 0xFFFFFFFFL; // To be consistent with
+ // unsigned integers in C/C++
+ if (val < (1 << 7)) {
+ out[outpostmp++] = (byte) (val | (1 << 7));
+ } else if (val < (1 << 14)) {
+ out[outpostmp++] = (byte) extract7bits(0, val);
+ out[outpostmp++] = (byte) (extract7bitsmaskless(1, (val)) | (1 << 7));
+ } else if (val < (1 << 21)) {
+ out[outpostmp++] = (byte) extract7bits(0, val);
+ out[outpostmp++] = (byte) extract7bits(1, val);
+ out[outpostmp++] = (byte) (extract7bitsmaskless(2, (val)) | (1 << 7));
+ } else if (val < (1 << 28)) {
+ out[outpostmp++] = (byte) extract7bits(0, val);
+ out[outpostmp++] = (byte) extract7bits(1, val);
+ out[outpostmp++] = (byte) extract7bits(2, val);
+ out[outpostmp++] = (byte) (extract7bitsmaskless(3, (val)) | (1 << 7));
+ } else {
+ out[outpostmp++] = (byte) extract7bits(0, val);
+ out[outpostmp++] = (byte) extract7bits(1, val);
+ out[outpostmp++] = (byte) extract7bits(2, val);
+ out[outpostmp++] = (byte) extract7bits(3, val);
+ out[outpostmp++] = (byte) (extract7bitsmaskless(4, (val)) | (1 << 7));
+ }
+ }
+ outpos.set(outpostmp);
+ inpos.add(inlength);
+ }
- @Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- int s = 0;
- int val = 0;
- int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- for (int v = 0, shift =0; p < finalp;) {
- val = in[p];
- int c = (byte) (val >>> s);
- s += 8;
- if (s == 32) {
- s = 0;
- p++;
- }
- v += ((c & 127) << shift);
- if ((c & 128) == 128) {
- out[tmpoutpos++] = v;
- v = 0;
- shift = 0;
- } else
- shift +=7;
- }
- outpos.set(tmpoutpos);
- inpos.add(inlength);
- }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ int s = 0;
+ int val = 0;
+ int p = inpos.get();
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ for (int v = 0, shift = 0; p < finalp;) {
+ val = in[p];
+ int c = (byte) (val >>> s);
+ s += 8;
+ if (s == 32) {
+ s = 0;
+ p++;
+ }
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos++] = v;
+ v = 0;
+ shift = 0;
+ } else
+ shift += 7;
+ }
+ outpos.set(tmpoutpos);
+ inpos.add(inlength);
+ }
- @Override
- public void uncompress(byte[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- int p = inpos.get();
- int finalp = inpos.get() + inlength;
- int tmpoutpos = outpos.get();
- int v = 0;
- int shift = 0;
- for (; p < finalp; ++p) {
- int c = in[p];
- v += ((c & 127) << shift);
- if ((c & 128) == 128) {
- out[tmpoutpos++] = v;
- v = 0;
- shift = 0;
- } else
- shift += 7;
- }
- outpos.set(tmpoutpos);
- inpos.add(p);
- }
+ @Override
+ public void uncompress(byte[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ int p = inpos.get();
+ int finalp = inpos.get() + inlength;
+ int tmpoutpos = outpos.get();
+ for (int v = 0; p < finalp; out[tmpoutpos++] = v) {
+ v = in[p] & 0x7F;
+ if (in[p] < 0) {
+ p += 1;
+ continue;
+ }
+ v = ((in[p + 1] & 0x7F) << 7) | v;
+ if (in[p + 1] < 0) {
+ p += 2;
+ continue;
+ }
+ v = ((in[p + 2] & 0x7F) << 14) | v;
+ if ((in[p + 2] & 128) == 128) {
+ p += 3;
+ continue;
+ }
+ v = ((in[p + 3] & 0x7F) << 21) | v;
+ if ((in[p + 3] & 128) == 128) {
+ p += 4;
+ continue;
+ }
+ v = ((in[p + 4] & 0x7F) << 28) | v;
+ p += 5;
+ }
+ outpos.set(tmpoutpos);
+ inpos.add(p);
+ }
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
}
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
index 149fb0f..9d3d925 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
@@ -80,38 +80,33 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
int initoffset = 0;
- ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ int outpostmp = outpos.get();
for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
final long val = (in[k] - initoffset) & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
initoffset = in[k];
if (val < (1 << 7)) {
- buf.put((byte)(val | (1 << 7)));
+ out[outpostmp++] = (byte)(val | (1 << 7));
} else if (val < (1 << 14)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)(extract7bitsmaskless(1, (val)) | (1 << 7)));
+ out[outpostmp++] = (byte)extract7bits(0, val);
+ out[outpostmp++] = (byte)(extract7bitsmaskless(1, (val)) | (1 << 7));
} else if (val < (1 << 21)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)(extract7bitsmaskless(2, (val)) | (1 << 7)));
+ out[outpostmp++] = (byte)extract7bits(0, val);
+ out[outpostmp++] = (byte)extract7bits(1, val);
+ out[outpostmp++] = (byte)(extract7bitsmaskless(2, (val)) | (1 << 7));
} else if (val < (1 << 28)) {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)extract7bits(2, val));
- buf.put((byte)(extract7bitsmaskless(3, (val)) | (1 << 7)));
+ out[outpostmp++] = (byte)extract7bits(0, val);
+ out[outpostmp++] = (byte)extract7bits(1, val);
+ out[outpostmp++] = (byte)extract7bits(2, val);
+ out[outpostmp++] = (byte)(extract7bitsmaskless(3, (val)) | (1 << 7));
} else {
- buf.put((byte)extract7bits(0, val));
- buf.put((byte)extract7bits(1, val));
- buf.put((byte)extract7bits(2, val));
- buf.put((byte)extract7bits(3, val));
- buf.put((byte)(extract7bitsmaskless(4, (val)) | (1 << 7)));
+ out[outpostmp++] = (byte)extract7bits(0, val);
+ out[outpostmp++] = (byte)extract7bits(1, val);
+ out[outpostmp++] = (byte)extract7bits(2, val);
+ out[outpostmp++] = (byte)extract7bits(3, val);
+ out[outpostmp++] = (byte)(extract7bitsmaskless(4, (val)) | (1 << 7));
}
}
- while (buf.position() % 4 != 0)
- buf.put((byte) 0);
- final int length = buf.position();
- buf.flip();
- buf.get(out,0,length);
- outpos.set(length);
+ outpos.set(outpostmp);
inpos.add(inlength);
}
@@ -153,19 +148,29 @@ public void uncompress(byte[] in, IntWrapper inpos, int inlength,
int initoffset = 0;
int finalp = inpos.get() + inlength;
int tmpoutpos = outpos.get();
- int v = 0;
- int shift = 0;
- for (; p < finalp; ++p) {
- int c = in[p];
- v += ((c & 127) << shift);
- if ((c & 128) == 128) {
- out[tmpoutpos] = v + initoffset;
- initoffset = out[tmpoutpos];
- tmpoutpos++;
- v = 0;
- shift = 0;
- } else
- shift += 7;
+ for (int v = 0;p < finalp; out[tmpoutpos++] = (initoffset = initoffset + v)) {
+ v = in[p] & 0x7F;
+ if (in[p] <0 ) {
+ p+= 1;
+ continue;
+ }
+ v = ((in[p+1] & 0x7F)<<7) | v;
+ if (in[p+1] < 0) {
+ p+= 2;
+ continue;
+ }
+ v = ((in[p+2] & 0x7F)<<14) | v;
+ if ((in[p+2]& 128) == 128) {
+ p+= 3;
+ continue;
+ }
+ v = ((in[p+3] & 0x7F)<<21) | v;
+ if ((in[p+3] & 128) == 128) {
+ p+= 4;
+ continue;
+ }
+ v = ((in[p+4] & 0x7F)<<28) | v;
+ p+= 5;
}
outpos.set(tmpoutpos);
inpos.add(p);
diff --git a/src/test/java/me/lemire/integercompression/AdhocTest.java b/src/test/java/me/lemire/integercompression/AdhocTest.java
index b82b69b..50c2ad5 100644
--- a/src/test/java/me/lemire/integercompression/AdhocTest.java
+++ b/src/test/java/me/lemire/integercompression/AdhocTest.java
@@ -6,7 +6,7 @@
/**
* Collection of adhoc tests.
*/
-@SuppressWarnings({ "javadoc", "static-method" })
+@SuppressWarnings({ "static-method" })
public class AdhocTest
{
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index dc3b255..91d36e8 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -21,7 +21,7 @@
*
* @author Daniel Lemire
*/
-@SuppressWarnings({ "static-method", "javadoc" })
+@SuppressWarnings({ "static-method" })
public class BasicTest {
IntegerCODEC[] codecs = {
new IntegratedComposition(new IntegratedBinaryPacking(),
diff --git a/src/test/java/me/lemire/integercompression/BoundaryTest.java b/src/test/java/me/lemire/integercompression/BoundaryTest.java
index 99dc931..0d6d573 100644
--- a/src/test/java/me/lemire/integercompression/BoundaryTest.java
+++ b/src/test/java/me/lemire/integercompression/BoundaryTest.java
@@ -15,7 +15,7 @@
* @author lemire
*
*/
-@SuppressWarnings({ "static-method", "javadoc" })
+@SuppressWarnings({ "static-method" })
public class BoundaryTest {
private static void compressAndUncompress(int length, IntegerCODEC c) {
// Initialize array.
diff --git a/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java b/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java
index 76a1e81..5e0923d 100644
--- a/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java
+++ b/src/test/java/me/lemire/integercompression/DeltaZigzagEncodingTest.java
@@ -11,7 +11,7 @@
* @author lemire
*
*/
-@SuppressWarnings({ "javadoc", "static-method" })
+@SuppressWarnings({ "static-method" })
public class DeltaZigzagEncodingTest {
protected static int zigzagEncode(DeltaZigzagEncoding.Encoder e, int value) {
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index c6ca197..9217097 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -9,7 +9,6 @@
/**
* Static utility methods for test.
*/
-@SuppressWarnings({ "javadoc"})
public class TestUtils {
/**
*
@@ -89,4 +88,23 @@ protected static int[] uncompress(IntegerCODEC codec, int[] data, int len) {
codec.uncompress(data, inPos, data.length, outBuf, outPos);
return Arrays.copyOf(outBuf, outPos.get());
}
+
+
+
+ protected static byte[] compress(ByteIntegerCODEC codec, int[] data) {
+ byte[] outBuf = new byte[data.length * 4 * 4];
+ IntWrapper inPos = new IntWrapper();
+ IntWrapper outPos = new IntWrapper();
+ codec.compress(data, inPos, data.length, outBuf, outPos);
+ return Arrays.copyOf(outBuf, outPos.get());
+ }
+
+ protected static int[] uncompress(ByteIntegerCODEC codec, byte[] data, int len) {
+ int[] outBuf = new int[len + 1024];
+ IntWrapper inPos = new IntWrapper();
+ IntWrapper outPos = new IntWrapper();
+ codec.uncompress(data, inPos, data.length, outBuf, outPos);
+ return Arrays.copyOf(outBuf, outPos.get());
+ }
+
}
diff --git a/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java b/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java
index 49351b4..3201b02 100644
--- a/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java
+++ b/src/test/java/me/lemire/integercompression/XorBinaryPackingTest.java
@@ -16,7 +16,7 @@
* @author lemire
*
*/
-@SuppressWarnings({ "javadoc", "static-method" })
+@SuppressWarnings({ "static-method" })
public final class XorBinaryPackingTest
{
From e6fa6beb631207204fde213c4c7cb87d043784d2 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 9 Sep 2014 11:35:54 -0400
Subject: [PATCH 029/266] [maven-release-plugin] prepare release
JavaFastPFOR-0.0.15
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a69bb88..d032256 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.15-SNAPSHOT
+ 0.0.15
jar
From 6fc1e98cbdd4028ea02db4505017e58b53ba60e3 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 9 Sep 2014 11:35:57 -0400
Subject: [PATCH 030/266] [maven-release-plugin] prepare for next development
iteration
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index d032256..a457116 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.15
+ 0.0.16-SNAPSHOT
jar
From 27d26220ac20b729f9e952d0bbf87164d3f51ef3 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 9 Sep 2014 15:47:07 -0400
Subject: [PATCH 031/266] Updating readme
---
README.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0d896ca..0e1844d 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,10 @@ It can decompress integers at a rate of over 1.2 billions per second
as Snappy, LZ4 and so on) when compressing arrays of integers.
Part of this library has been integrated in Parquet (http://parquet.io/).
-This libary is used by ClueWeb Tools (https://github.com/lintool/clueweb).
+A modified version of the library is included in the search engine
+Terrier (http://terrier.org/). This libary is used by ClueWeb
+Tools (https://github.com/lintool/clueweb).
+
This library inspired a compression scheme used by Apache Lucene (e.g., see
http://lucene.apache.org/core/4_6_1/core/org/apache/lucene/util/PForDeltaDocIdSet.html ).
From 38475acae1b2b5292a279795120e48426d705e2a Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 10 Sep 2014 16:33:30 -0400
Subject: [PATCH 032/266] Adding skippable codecs (not yet tested)
---
CHANGELOG | 3 +
.../me/lemire/integercompression/NewPFD.java | 2 +-
.../me/lemire/integercompression/S16.java | 28 +-
.../java/me/lemire/integercompression/S9.java | 28 +-
.../skippable/Kamikaze.java | 46 +++
.../skippable/SkippableComposition.java | 62 ++++
.../skippable/SkippableFastPFOR.java | 262 ++++++++++++++++
.../skippable/SkippableIntegerCODEC.java | 69 +++++
.../skippable/SkippableNewPFD.java | 178 +++++++++++
.../skippable/SkippableOptPFD.java | 198 ++++++++++++
.../skippable/SkippableSimple16.java | 207 +++++++++++++
.../skippable/SkippableSimple9.java | 291 ++++++++++++++++++
12 files changed, 1369 insertions(+), 5 deletions(-)
create mode 100644 src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
diff --git a/CHANGELOG b/CHANGELOG
index 82dadde..e6db188 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+0.1.0 (upcoming)
+ - Introduced skippable versions (for use in a search engine like Terrier)
+
0.0.15 (September 9th 2014)
- Improved the performance of VariableByte schemes when used as a ByteIntegerCODEC
diff --git a/src/main/java/me/lemire/integercompression/NewPFD.java b/src/main/java/me/lemire/integercompression/NewPFD.java
index 28e28a3..9530c05 100644
--- a/src/main/java/me/lemire/integercompression/NewPFD.java
+++ b/src/main/java/me/lemire/integercompression/NewPFD.java
@@ -13,7 +13,7 @@
* Follows:
*
* H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
- * with optimized document ordering, in: WWW �09, 2009, pp. 401�410.
+ * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
*
* using Simple16 as the secondary coder.
*
diff --git a/src/main/java/me/lemire/integercompression/S16.java b/src/main/java/me/lemire/integercompression/S16.java
index 6829b76..4b3b577 100644
--- a/src/main/java/me/lemire/integercompression/S16.java
+++ b/src/main/java/me/lemire/integercompression/S16.java
@@ -15,7 +15,21 @@
*/
public final class S16 {
- protected static int compress(final int[] in, int currentPos,
+ /**
+ * Compress an integer array using Simple16
+ *
+ *
+ * @param in
+ * array to compress
+ * @param currentPos
+ * where to start reading
+ * @param inlength
+ * how many integers to read
+ * @param out output array
+ * @param tmpoutpos location in the output array
+ * @return the number of 32-bit words written (in compressed form)
+ */
+ public static int compress(final int[] in, int currentPos,
int inlength, final int out[], final int tmpoutpos) {
int outpos = tmpoutpos;
final int finalin = currentPos + inlength;
@@ -141,7 +155,17 @@ public static final int decompressblock(int[] out, int outOffset,
return num;
}
- protected static void uncompress(final int[] in, int tmpinpos,
+ /**
+ * Uncompressed data from an input array into an output array
+ *
+ * @param in input array (in compressed form)
+ * @param tmpinpos starting location in the compressed input array
+ * @param inlength how much data we wish the read (in 32-bit words)
+ * @param out output array (in decompressed form)
+ * @param currentPos current position in the output array
+ * @param outlength available data in the output array
+ */
+ public static void uncompress(final int[] in, int tmpinpos,
final int inlength, final int[] out, int currentPos,
int outlength) {
final int finalpos = tmpinpos + inlength;
diff --git a/src/main/java/me/lemire/integercompression/S9.java b/src/main/java/me/lemire/integercompression/S9.java
index d8a7121..d5846c7 100644
--- a/src/main/java/me/lemire/integercompression/S9.java
+++ b/src/main/java/me/lemire/integercompression/S9.java
@@ -53,7 +53,21 @@ public static int estimatecompress(int[] in, int currentPos,
return tmpoutpos;
}
- protected static int compress(int[] in, int currentPos, int inlength,
+ /**
+ * Compress an integer array using Simple9
+ *
+ *
+ * @param in
+ * array to compress
+ * @param currentPos
+ * where to start reading
+ * @param inlength
+ * how many integers to read
+ * @param out output array
+ * @param tmpoutpos location in the output array
+ * @return the number of 32-bit words written (in compressed form)
+ */
+ public static int compress(int[] in, int currentPos, int inlength,
int out[], int tmpoutpos) {
int origtmpoutpos = tmpoutpos;
int finalpos = currentPos + inlength;
@@ -87,7 +101,17 @@ protected static int compress(int[] in, int currentPos, int inlength,
return tmpoutpos - origtmpoutpos;
}
- protected static void uncompress(int[] in, int tmpinpos, int inlength,
+ /**
+ * Uncompressed data from an input array into an output array
+ *
+ * @param in input array (in compressed form)
+ * @param tmpinpos starting location in the compressed input array
+ * @param inlength how much data we wish the read (in 32-bit words)
+ * @param out output array (in decompressed form)
+ * @param currentPos current position in the output array
+ * @param outlength available data in the output array
+ */
+ public static void uncompress(int[] in, int tmpinpos, int inlength,
int[] out, int currentPos, int outlength) {
int finallength = currentPos + outlength;
diff --git a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java b/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
new file mode 100644
index 0000000..f5a344e
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
@@ -0,0 +1,46 @@
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.IntWrapper;
+import com.kamikaze.pfordelta.PForDelta;
+
+/**
+ * IntegerCODEC wrapper for Kamikaze's PForDelta.
+ *
+ *
+ * @author Matteo Catena
+ *
+ */
+public class Kamikaze implements SkippableIntegerCODEC {
+
+ private int BLOCK_SIZE = 128;
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ if (inlength > 0) {
+ int[] out2 = PForDelta.compressOneBlockOpt(in, inlength);
+ inpos.add(inlength);
+ System.arraycopy(out2, 0, out, outpos.get(), out2.length);
+ outpos.add(out2.length);
+ }
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+
+ num = num / BLOCK_SIZE * BLOCK_SIZE;
+ if (num > 0) {
+ int d = PForDelta.decompressOneBlock(out, in, num);
+ inpos.add(d / 32);
+ outpos.add(num);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "Kamikaze's PForDelta";
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java b/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
new file mode 100644
index 0000000..b3ba09f
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
@@ -0,0 +1,62 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.*;
+
+/**
+ * Helper class to compose schemes.
+ *
+ * @author Daniel Lemire
+ */
+public class SkippableComposition implements SkippableIntegerCODEC {
+ SkippableIntegerCODEC F1, F2;
+
+ /**
+ * Compose a scheme from a first one (f1) and a second one (f2). The first
+ * one is called first and then the second one tries to compress whatever
+ * remains from the first run.
+ *
+ * By convention, the first scheme should be such that if, during decoding,
+ * a 32-bit zero is first encountered, then there is no output.
+ *
+ * @param f1
+ * first codec
+ * @param f2
+ * second codec
+ */
+ public SkippableComposition(SkippableIntegerCODEC f1,
+ SkippableIntegerCODEC f2) {
+ F1 = f1;
+ F2 = f2;
+ }
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ int init = inpos.get();
+ F1.compress(in, inpos, inlength, out, outpos);
+ inlength -= inpos.get() - init;
+ F2.compress(in, inpos, inlength, out, outpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ int init = inpos.get();
+ F1.uncompress(in, inpos, inlength, out, outpos, num);
+ inlength -= inpos.get() - init;
+ num -= outpos.get();
+ F2.uncompress(in, inpos, inlength, out, outpos, num);
+ }
+
+ @Override
+ public String toString() {
+ return F1.getClass().getName() + "+" + F2.getClass().getName();
+ }
+
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
new file mode 100644
index 0000000..34fe3ef
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
@@ -0,0 +1,262 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression.skippable;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import me.lemire.integercompression.*;
+
+/**
+ * This is a patching scheme designed for speed. It encodes integers in blocks
+ * of 128 integers within pages of up to 65536 integers. Note that it is
+ * important, to get good compression and good performance, to use sizeable
+ * blocks (greater than 1024 integers). For arrays containing a number of
+ * integers that is not divisible by 128, you should use it in conjunction with
+ * another CODEC:
+ *
+ * IntegerCODEC ic = new Composition(new FastPFOR(), new VariableByte()).
+ *
+ * For details, please see
+ *
+ *
+ * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
+ * through vectorization Software: Practice & Experience http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract http://arxiv.org/abs/1209.2137
+ *
+ *
+ * For sufficiently compressible and long arrays, it is faster and better than
+ * other PFOR schemes.
+ *
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, use IntegratedFastPFOR instead.
+ *
+ * For multi-threaded applications, each thread should use its own FastPFOR
+ * object.
+ *
+ * @author Daniel Lemire
+ */
+public final class SkippableFastPFOR implements SkippableIntegerCODEC {
+ int PageSize;
+ final static int BlockSize = 128;
+ final static int overheadofeachexcept = 8;
+
+ int[][] datatobepacked = new int[32][];
+ ByteBuffer bytecontainer;
+
+ /**
+ * Constructor for FastPFOR
+ *
+ * @param pagesize
+ * size of the page in number of integers
+ */
+ public SkippableFastPFOR(int pagesize) {
+ PageSize = pagesize;
+ initArrays();
+ }
+
+ /**
+ *
+ */
+ public SkippableFastPFOR() {
+ PageSize = 65536;
+ initArrays();
+ }
+
+ private void initArrays() {
+ bytecontainer = ByteBuffer.allocateDirect(3 * PageSize / BlockSize
+ + PageSize);
+ for (int k = 1; k < 32; ++k)
+ datatobepacked[k] = new int[PageSize / 32 * 4];// heuristic
+ }
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = inlength / 128 * 128;
+
+ final int finalinpos = inpos.get() + inlength;
+ while (inpos.get() != finalinpos) {
+ int thissize = finalinpos > PageSize + inpos.get() ? PageSize
+ : (finalinpos - inpos.get());
+ encodePage(in, inpos, thissize, out, outpos);
+ }
+ }
+
+ private static void getBestBFromData(int[] in, int pos,
+ byte[] bestbbestcexceptmaxb) {
+ int freqs[] = new int[32];
+ for (int k = pos; k < BlockSize + pos; ++k)
+ freqs[Util.bits(in[k])]++;
+ bestbbestcexceptmaxb[0] = 31;
+ while (freqs[bestbbestcexceptmaxb[0]] == 0)
+ bestbbestcexceptmaxb[0]--;
+ bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
+ int bestcost = bestbbestcexceptmaxb[0] * BlockSize;
+ byte cexcept = 0;
+ bestbbestcexceptmaxb[1] = cexcept;
+ for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
+ cexcept += freqs[b + 1];
+ if (cexcept < 0)
+ break;
+ int thiscost = cexcept * overheadofeachexcept + cexcept
+ * (bestbbestcexceptmaxb[2] - b) + b * BlockSize + 8;// the
+ // extra
+ // 8 is
+ // the
+ // cost
+ // of
+ // storing
+ // maxbits
+ if (thiscost < bestcost) {
+ bestcost = thiscost;
+ bestbbestcexceptmaxb[0] = (byte) b;
+ bestbbestcexceptmaxb[1] = cexcept;
+ }
+ }
+ }
+
+ private void encodePage(int[] in, IntWrapper inpos, int thissize,
+ int[] out, IntWrapper outpos) {
+ final int headerpos = outpos.get();
+ outpos.increment();
+ int tmpoutpos = outpos.get();
+ int[] datapointers = new int[32];
+ bytecontainer.clear();
+ final byte[] bestbbestcexceptmaxb = new byte[3];
+ int tmpinpos = inpos.get();
+ for (final int finalinpos = tmpinpos + thissize; tmpinpos + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ getBestBFromData(in, tmpinpos, bestbbestcexceptmaxb);
+ final int tmpbestb = bestbbestcexceptmaxb[0];
+ bytecontainer.put(bestbbestcexceptmaxb[0]);
+ bytecontainer.put(bestbbestcexceptmaxb[1]);
+ if (bestbbestcexceptmaxb[1] > 0) {
+ bytecontainer.put(bestbbestcexceptmaxb[2]);
+ final int index = bestbbestcexceptmaxb[2]
+ - bestbbestcexceptmaxb[0];
+ if (datapointers[index] + bestbbestcexceptmaxb[1] >= datatobepacked[index].length) {
+ int newsize = 2 * (datapointers[index] + bestbbestcexceptmaxb[1]);
+ newsize = (newsize + 31) / 32 * 32;// make sure it is a
+ // multiple of
+ // 32
+ datatobepacked[index] = Arrays.copyOf(
+ datatobepacked[index], newsize);
+ }
+ final int maxval = 1 << bestbbestcexceptmaxb[0];
+ for (int k = 0; k < BlockSize; ++k) {
+ if (in[k + tmpinpos] >= maxval) {
+ // we have an exception
+ bytecontainer.put((byte) k);
+ datatobepacked[index][datapointers[index]++] = in[k
+ + tmpinpos] >>> tmpbestb;
+ }
+ }
+ }
+ for (int k = 0; k < 128; k += 32) {
+ BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos, tmpbestb);
+ tmpoutpos += tmpbestb;
+ }
+ }
+ inpos.set(tmpinpos);
+ out[headerpos] = tmpoutpos - headerpos;
+ while ((bytecontainer.position() & 3) != 0)
+ bytecontainer.put((byte) 0);
+ final int bytesize = bytecontainer.position();
+ out[tmpoutpos++] = bytesize;
+ final int howmanyints = bytesize / 4;
+ bytecontainer.flip();
+ bytecontainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
+ tmpoutpos += howmanyints;
+ int bitmap = 0;
+ for (int k = 1; k <= 31; ++k) {
+ if (datapointers[k] != 0)
+ bitmap |= (1 << (k - 1));
+ }
+ out[tmpoutpos++] = bitmap;
+ for (int k = 1; k <= 31; ++k) {
+
+ if (datapointers[k] != 0) {
+ out[tmpoutpos++] = datapointers[k];// size
+ for (int j = 0; j < datapointers[k]; j += 32) {
+ BitPacking
+ .fastpack(datatobepacked[k], j, out, tmpoutpos, k);
+ tmpoutpos += k;
+ }
+ }
+ }
+ outpos.set(tmpoutpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ int mynvalue = num / BlockSize * BlockSize;
+ int finalout = outpos.get() + mynvalue;
+ while (outpos.get() != finalout) {
+ int thissize = finalout > PageSize + outpos.get() ? PageSize
+ : (finalout - outpos.get());
+ decodePage(in, inpos, out, outpos, thissize);
+ }
+ }
+
+ private void decodePage(int[] in, IntWrapper inpos, int[] out,
+ IntWrapper outpos, int thissize) {
+ final int initpos = inpos.get();
+ final int wheremeta = in[inpos.get()];
+ inpos.increment();
+ int inexcept = initpos + wheremeta;
+ final int bytesize = in[inexcept++];
+ bytecontainer.clear();
+ bytecontainer.asIntBuffer().put(in, inexcept, bytesize / 4);
+ inexcept += bytesize / 4;
+
+ final int bitmap = in[inexcept++];
+ for (int k = 1; k <= 31; ++k) {
+ if ((bitmap & (1 << (k - 1))) != 0) {
+ int size = in[inexcept++];
+ if (datatobepacked[k].length < size)
+ datatobepacked[k] = new int[(size + 31) / 32 * 32];
+ for (int j = 0; j < size; j += 32) {
+ BitPacking
+ .fastunpack(in, inexcept, datatobepacked[k], j, k);
+ inexcept += k;
+ }
+ }
+ }
+ int[] datapointers = new int[32];
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
+
+ for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ final byte b = bytecontainer.get();
+ final byte cexcept = bytecontainer.get();
+ for (int k = 0; k < 128; k += 32) {
+ BitPacking.fastunpack(in, tmpinpos, out, tmpoutpos + k, b);
+ tmpinpos += b;
+ }
+ if (cexcept > 0) {
+ final byte maxbits = bytecontainer.get();
+ final int index = maxbits - b;
+ for (int k = 0; k < cexcept; ++k) {
+ final byte pos = bytecontainer.get();
+ final int exceptvalue = datatobepacked[index][datapointers[index]++];
+ out[pos + tmpoutpos] |= exceptvalue << b;
+ }
+
+ }
+ }
+ outpos.set(tmpoutpos);
+ inpos.set(inexcept);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java b/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
new file mode 100644
index 0000000..6040e95
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
@@ -0,0 +1,69 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.*;
+
+/**
+ * Interface describing a standard CODEC to compress integers. This is a
+ * variation on the IntegerCODEC interface meant to be used for random access.
+ *
+ * The main difference is that we must specify the number of integers we wish to
+ * decode. This information should be stored elsewhere.
+ *
+ * This interface was designed by the Terrier team for their search engine.
+ *
+ * @author Daniel Lemire
+ *
+ */
+public interface SkippableIntegerCODEC {
+ /**
+ * Compress data from an array to another array.
+ *
+ * Both inpos and outpos are modified to represent how much data was read
+ * and written to if 12 ints (inlength = 12) are compressed to 3 ints, then
+ * inpos will be incremented by 12 while outpos will be incremented by 3 we
+ * use IntWrapper to pass the values by reference.
+ *
+ * @param in
+ * input array
+ * @param inpos
+ * location in the input array
+ * @param inlength
+ * how many integers to compress
+ * @param out
+ * output array
+ * @param outpos
+ * where to write in the output array
+ */
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos);
+
+ /**
+ * Uncompress data from an array to another array.
+ *
+ * Both inpos and outpos parameters are modified to indicate new positions
+ * after read/write.
+ *
+ * @param in
+ * array containing data in compressed form
+ * @param inpos
+ * where to start reading in the array
+ * @param inlength
+ * length of the compressed data (ignored by some schemes)
+ * @param out
+ * array where to write the compressed output
+ * @param outpos
+ * where to write the compressed output in out
+ * @param num
+ * number of integers we want to decode
+ */
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num);
+
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
new file mode 100644
index 0000000..33a733f
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
@@ -0,0 +1,178 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.*;
+
+/**
+ * NewPFD/NewPFOR: fast patching scheme by Yan et al.
+ *
+ * Follows:
+ *
+ *
+ * H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
+ * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
+ *
+ * using Simple16 as the secondary coder.
+ *
+ * It encodes integers in blocks of 128 integers. For arrays containing an
+ * arbitrary number of integers, you should use it in conjunction with another
+ * CODEC:
+ *
+ *
+ * IntegerCODEC ic =
+ * new Composition(new NewPDF(), new VariableByte()).
+ *
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, you must compute the deltas separately. (Yes, this is true even though
+ * the "D" at the end of the name probably stands for delta.)
+ *
+ * For multi-threaded applications, each thread should use its own NewPFD
+ * object.
+ *
+ * @author Daniel Lemire
+ */
+public final class SkippableNewPFD implements SkippableIntegerCODEC {
+ final int PageSize;
+ final static int BlockSize = 128;
+
+ int[] exceptbuffer = new int[2 * BlockSize];
+
+ /**
+ * Constructor for the NewPFD CODEC.
+ */
+ public SkippableNewPFD() {
+ PageSize = 65536;
+ }
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = inlength / BlockSize * BlockSize;
+
+ final int finalinpos = inpos.get() + inlength;
+ while (inpos.get() != finalinpos) {
+ int thissize = finalinpos > PageSize + inpos.get() ? PageSize
+ : (finalinpos - inpos.get());
+ encodePage(in, inpos, thissize, out, outpos);
+ }
+
+ }
+
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 16, 20, 32 };
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16 };
+
+ private static void getBestBFromData(int[] in, int pos, IntWrapper bestb,
+ IntWrapper bestexcept) {
+ final int mb = Util.maxbits(in, pos, BlockSize);
+ int mini = 0;
+ if (mini + 28 < bits[invbits[mb]])
+ mini = bits[invbits[mb]] - 28; // 28 is the max for exceptions
+ int besti = bits.length - 1;
+ int exceptcounter = 0;
+ for (int i = mini; i < bits.length - 1; ++i) {
+ int tmpcounter = 0;
+ final int maxv = 1 << bits[i];
+ for (int k = pos; k < BlockSize + pos; ++k)
+ if (in[k] >= maxv)
+ ++tmpcounter;
+ if (tmpcounter * 10 <= BlockSize) {
+ besti = i;
+ exceptcounter = tmpcounter;
+ break;
+ }
+ }
+ bestb.set(besti);
+ bestexcept.set(exceptcounter);
+ }
+
+ private void encodePage(int[] in, IntWrapper inpos, int thissize,
+ int[] out, IntWrapper outpos) {
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
+ IntWrapper bestb = new IntWrapper();
+ IntWrapper bestexcept = new IntWrapper();
+ for (final int finalinpos = tmpinpos + thissize; tmpinpos + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ getBestBFromData(in, tmpinpos, bestb, bestexcept);
+ int tmpbestb = bestb.get();
+ int nbrexcept = bestexcept.get();
+ int exceptsize = 0;
+ int remember = tmpoutpos;
+ tmpoutpos++;
+ if (nbrexcept > 0) {
+ final int maxv = 1 << bits[tmpbestb];
+ for (int i = 0, c = 0; i < BlockSize; ++i) {
+ if (in[tmpinpos + i] >= maxv) {
+ exceptbuffer[c + nbrexcept] = i;
+ exceptbuffer[c] = in[tmpinpos + i] >>> bits[tmpbestb];
+ ++c;
+ }
+ }
+ exceptsize = S16.compress(exceptbuffer, 0, 2 * nbrexcept, out,
+ tmpoutpos);
+ tmpoutpos += exceptsize;
+ }
+ out[remember] = tmpbestb | (nbrexcept << 8) | (exceptsize << 16);
+ for (int k = 0; k < BlockSize; k += 32) {
+ BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos,
+ bits[tmpbestb]);
+ tmpoutpos += bits[tmpbestb];
+ }
+ }
+ inpos.set(tmpinpos);
+ outpos.set(tmpoutpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ int mynvalue = num / BlockSize * BlockSize;
+ int finalout = outpos.get() + mynvalue;
+ while (outpos.get() != finalout) {
+ int thissize = finalout > PageSize + outpos.get() ? PageSize
+ : (finalout - outpos.get());
+ decodePage(in, inpos, out, outpos, thissize);
+ }
+ }
+
+ private void decodePage(int[] in, IntWrapper inpos, int[] out,
+ IntWrapper outpos, int thissize) {
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
+
+ for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ final int b = in[tmpinpos] & 0xFF;
+ final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
+ final int exceptsize = (in[tmpinpos] >>> 16);
+ ++tmpinpos;
+ S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer, 0,
+ 2 * cexcept);
+ tmpinpos += exceptsize;
+ for (int k = 0; k < BlockSize; k += 32) {
+ BitPacking
+ .fastunpack(in, tmpinpos, out, tmpoutpos + k, bits[b]);
+ tmpinpos += bits[b];
+ }
+ for (int k = 0; k < cexcept; ++k) {
+ out[tmpoutpos + exceptbuffer[k + cexcept]] |= (exceptbuffer[k] << bits[b]);
+ }
+ }
+ outpos.set(tmpoutpos);
+ inpos.set(tmpinpos);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
new file mode 100644
index 0000000..d851c82
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
@@ -0,0 +1,198 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.*;
+
+/**
+ * OptPFD: fast patching scheme by Yan et al.
+ *
+ * Follows:
+ *
+ *
+ * H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
+ * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
+ *
+ * using Simple16 as the secondary coder.
+ *
+ * It encodes integers in blocks of 128 integers. For arrays containing an
+ * arbitrary number of integers, you should use it in conjunction with another
+ * CODEC:
+ *
+ *
+ * IntegerCODEC ic = new Composition(new OptPFD(), new VariableByte()).
+ *
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, you must compute the deltas separately. (Yes, this is true even though
+ * the "D" at the end of the name probably stands for delta.)
+ *
+ * For multi-threaded applications, each thread should use its own OptPFD
+ * object.
+ *
+ * @author Daniel Lemire
+ */
+public final class SkippableOptPFD implements SkippableIntegerCODEC {
+ final int PageSize;
+ final static int BlockSize = 128;
+
+ int[] exceptbuffer = new int[2 * BlockSize];
+ int[] sillybuffer = new int[2 * BlockSize];
+
+ /**
+ *
+ */
+ public SkippableOptPFD() {
+ PageSize = 65536;
+ }
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ // Util.assertTrue(inpos.get()+inlength <= in.length);
+ inlength = inlength / BlockSize * BlockSize;
+
+ final int finalinpos = inpos.get() + inlength;
+ // out[outpos.get()] = inlength;
+ // outpos.increment();
+ while (inpos.get() != finalinpos) {
+ int thissize = finalinpos > PageSize + inpos.get() ? PageSize
+ : (finalinpos - inpos.get());
+ encodePage(in, inpos, thissize, out, outpos);
+ }
+
+ }
+
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 16, 20, 32 };
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16 };
+
+ void getBestBFromData(int[] in, int pos, IntWrapper bestb,
+ IntWrapper bestexcept) {
+ final int mb = Util.maxbits(in, pos, BlockSize);
+ int mini = 0;
+ if (mini + 28 < bits[invbits[mb]])
+ mini = bits[invbits[mb]] - 28; // 28 is the max for exceptions
+ int besti = bits.length - 1;
+ int bestcost = bits[besti] * 4;
+ int exceptcounter = 0;
+ for (int i = mini; i < bits.length - 1; ++i) {
+ int tmpcounter = 0;
+ final int maxv = 1 << bits[i];
+ for (int k = pos; k < BlockSize + pos; ++k)
+ if (in[k] >= maxv) {
+ ++tmpcounter;
+ }
+ if (tmpcounter == BlockSize)
+ continue; // no need
+ for (int k = pos, c = 0; k < pos + BlockSize; ++k)
+ if (in[k] >= maxv) {
+ exceptbuffer[tmpcounter + c] = k - pos;
+ exceptbuffer[c] = in[k] >>> bits[i];
+ ++c;
+ }
+
+ final int thiscost = bits[i] * 4
+ + S16.estimatecompress(exceptbuffer, 0, 2 * tmpcounter);
+ if (thiscost <= bestcost) {
+ bestcost = thiscost;
+ besti = i;
+ exceptcounter = tmpcounter;
+ }
+ }
+
+ bestb.set(besti);
+ bestexcept.set(exceptcounter);
+ }
+
+ private void encodePage(int[] in, IntWrapper inpos, int thissize,
+ int[] out, IntWrapper outpos) {
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
+ IntWrapper bestb = new IntWrapper();
+ IntWrapper bestexcept = new IntWrapper();
+ for (final int finalinpos = tmpinpos + thissize; tmpinpos + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ getBestBFromData(in, tmpinpos, bestb, bestexcept);
+ int tmpbestb = bestb.get();
+ int nbrexcept = bestexcept.get();
+ int exceptsize = 0;
+ int remember = tmpoutpos;
+ tmpoutpos++;
+ if (nbrexcept > 0) {
+ final int maxv = 1 << bits[tmpbestb];
+ int c = 0;
+ for (int i = 0; i < BlockSize; ++i) {
+ if (in[tmpinpos + i] >= maxv) {
+ exceptbuffer[c + nbrexcept] = i;
+ exceptbuffer[c] = in[tmpinpos + i] >>> bits[tmpbestb];
+ ++c;
+ }
+ }
+ exceptsize = S16.compress(exceptbuffer, 0, 2 * nbrexcept, out,
+ tmpoutpos);
+ tmpoutpos += exceptsize;
+ }
+ out[remember] = tmpbestb | (nbrexcept << 8) | (exceptsize << 16);
+ for (int k = 0; k < BlockSize; k += 32) {
+ BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos,
+ bits[tmpbestb]);
+ tmpoutpos += bits[tmpbestb];
+ }
+ }
+ inpos.set(tmpinpos);
+ outpos.set(tmpoutpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ // Util.assertTrue(inpos.get()+inlength <= in.length);
+ int mynvalue = num / BlockSize * BlockSize;
+ // int mynvalue = in[inpos.get()];
+ // inpos.increment();
+ int finalout = outpos.get() + mynvalue;
+ while (outpos.get() != finalout) {
+ int thissize = finalout > PageSize + outpos.get() ? PageSize
+ : (finalout - outpos.get());
+ decodePage(in, inpos, out, outpos, thissize);
+ }
+ }
+
+ private void decodePage(int[] in, IntWrapper inpos, int[] out,
+ IntWrapper outpos, int thissize) {
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
+
+ for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ final int b = in[tmpinpos] & 0xFF;
+ final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
+ final int exceptsize = (in[tmpinpos] >>> 16);
+ ++tmpinpos;
+ S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer, 0,
+ 2 * cexcept);
+ tmpinpos += exceptsize;
+ for (int k = 0; k < BlockSize; k += 32) {
+ BitPacking
+ .fastunpack(in, tmpinpos, out, tmpoutpos + k, bits[b]);
+ tmpinpos += bits[b];
+ }
+ for (int k = 0; k < cexcept; ++k) {
+ out[tmpoutpos + exceptbuffer[k + cexcept]] |= (exceptbuffer[k] << bits[b]);
+ }
+ }
+ outpos.set(tmpoutpos);
+ inpos.set(tmpinpos);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
new file mode 100644
index 0000000..f8adbc0
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
@@ -0,0 +1,207 @@
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.*;
+
+/**
+ * This is an implementation of the popular Simple9 scheme. It is limited to
+ * 28-bit integers (between 0 and 2^28-1).
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, you must compute the deltas separately.
+ *
+ * @author Daniel Lemire
+ *
+ */
+public final class SkippableSimple16 implements SkippableIntegerCODEC {
+
+ public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
+ IntWrapper outpos) {
+ int i_inpos = inpos.get();
+ int i_outpos = outpos.get();
+ final int finalin = i_inpos + inlength;
+ while (i_inpos < finalin) {
+ int inoffset = compressblock(out, i_outpos++, in, i_inpos, inlength);
+ if (inoffset == -1)
+ throw new RuntimeException("Too big a number");
+ i_inpos += inoffset;
+ inlength -= inoffset;
+ }
+ inpos.set(i_inpos);
+ outpos.set(i_outpos);
+ }
+
+ protected static int estimatecompress(int[] in, int currentPos, int inlength) {
+ final int finalin = currentPos + inlength;
+ int counter = 0;
+ while (currentPos < finalin) {
+ int inoffset = fakecompressblock(in, currentPos, inlength);
+ if (inoffset == -1)
+ throw new RuntimeException("Too big a number");
+ currentPos += inoffset;
+ inlength -= inoffset;
+ ++counter;
+ }
+ return counter;
+ }
+
+ /**
+ * Compress an integer array using Simple16
+ *
+ * @param out
+ * the compressed output
+ * @param outOffset
+ * the offset of the output in the number of integers
+ * @param in
+ * the integer 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 compressed integers
+ */
+ public static final int compressblock(int[] out, int outOffset, int[] in,
+ int inOffset, int n) {
+ int numIdx, j, num, bits;
+ for (numIdx = 0; numIdx < S16_NUMSIZE; numIdx++) {
+ out[outOffset] = numIdx << S16_BITSSIZE;
+ num = (S16_NUM[numIdx] < n) ? S16_NUM[numIdx] : n;
+
+ for (j = 0, bits = 0; (j < num)
+ && (in[inOffset + j] < SHIFTED_S16_BITS[numIdx][j]);) {
+ out[outOffset] |= (in[inOffset + j] << bits);
+ bits += S16_BITS[numIdx][j];
+ j++;
+ }
+
+ if (j == num) {
+ return num;
+ }
+ }
+
+ return -1;
+ }
+
+ protected static final int fakecompressblock(int[] in, int inOffset, int n) {
+ int numIdx, j, num;
+ for (numIdx = 0; numIdx < S16_NUMSIZE; numIdx++) {
+ num = (S16_NUM[numIdx] < n) ? S16_NUM[numIdx] : n;
+
+ for (j = 0; (j < num)
+ && (in[inOffset + j] < SHIFTED_S16_BITS[numIdx][j]);) {
+ j++;
+ }
+
+ if (j == num) {
+ return num;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * 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 decompressblock(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] = (in[inOffset] >>> bits)
+ & (0xffffffff >>> (32 - S16_BITS[numIdx][j]));
+ bits += S16_BITS[numIdx][j];
+ }
+ return num;
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ int i_inpos = inpos.get();
+ int i_outpos = outpos.get();
+ final int finalpos = i_inpos + inlength;
+ while (i_inpos < finalpos) {
+ final int howmany = decompressblock(out, i_outpos, in, i_inpos, num);
+ num -= howmany;
+ i_outpos += howmany;
+ i_inpos++;
+ }
+ inpos.set(i_inpos);
+ outpos.set(i_outpos);
+ }
+
+ /**
+ * Uncompress data from an array to another array.
+ *
+ * Both inpos and outpos parameters are modified to indicate new positions
+ * after read/write.
+ *
+ * @param in
+ * array containing data in compressed form
+ * @param tmpinpos
+ * where to start reading in the array
+ * @param inlength
+ * length of the compressed data (ignored by some schemes)
+ * @param out
+ * array where to write the compressed output
+ * @param currentPos
+ * where to write the compressed output in out
+ * @param outlength
+ * number of integers we want to decode
+ */
+ public static void uncompress(int[] in, int tmpinpos, int inlength,
+ int[] out, int currentPos, int outlength) {
+ final int finalpos = tmpinpos + inlength;
+ while (tmpinpos < finalpos) {
+ final int howmany = decompressblock(out, currentPos, in, tmpinpos,
+ outlength);
+ outlength -= howmany;
+ currentPos += howmany;
+ tmpinpos += 1;
+ }
+
+ }
+
+ private static int[][] shiftme(int[][] x) {
+ int[][] answer = new int[x.length][];
+ for (int k = 0; k < x.length; ++k) {
+ answer[k] = new int[x[k].length];
+ for (int z = 0; z < answer[k].length; ++z)
+ answer[k][z] = 1 << x[k][z];
+ }
+ return answer;
+ }
+
+ private static final int S16_NUMSIZE = 16;
+ private static final int S16_BITSSIZE = 28;
+ // the possible number of bits used to represent one integer
+ private static final int[] S16_NUM = { 28, 21, 21, 21, 14, 9, 8, 7, 6, 6,
+ 5, 5, 4, 3, 2, 1 };
+ // the corresponding number of elements for each value of the number of bits
+ private static final int[][] S16_BITS = {
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1 },
+ { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2 },
+ { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
+ { 4, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 4, 4, 4, 4, 3, 3, 3 },
+ { 4, 4, 4, 4, 4, 4, 4 }, { 5, 5, 5, 5, 4, 4 },
+ { 4, 4, 5, 5, 5, 5 }, { 6, 6, 6, 5, 5 }, { 5, 5, 6, 6, 6 },
+ { 7, 7, 7, 7 }, { 10, 9, 9, }, { 14, 14 }, { 28 } };
+ private static final int[][] SHIFTED_S16_BITS = shiftme(S16_BITS);
+
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
new file mode 100644
index 0000000..bca2b55
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
@@ -0,0 +1,291 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.IntWrapper;
+
+/**
+ * This is an implementation of the popular Simple9 scheme. It is limited to
+ * 28-bit integers (between 0 and 2^28-1).
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, you must compute the deltas separately.
+ *
+ * @author Daniel Lemire
+ *
+ */
+public final class SkippableSimple9 implements SkippableIntegerCODEC {
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
+ IntWrapper outpos) {
+ int tmpoutpos = outpos.get();
+ int currentPos = inpos.get();
+ final int finalin = currentPos + inlength;
+ outer: while (currentPos < finalin - 28) {
+ mainloop: for (int selector = 0; selector < 8; selector++) {
+
+ int res = 0;
+ int compressedNum = codeNum[selector];
+ int b = bitLength[selector];
+ int max = 1 << b;
+ int i = 0;
+ for (; i < compressedNum; i++) {
+ if (max <= in[currentPos + i])
+ continue mainloop;
+ res = (res << b) + in[currentPos + i];
+ }
+ res |= selector << 28;
+ out[tmpoutpos++] = res;
+ currentPos += compressedNum;
+ continue outer;
+ }
+ final int selector = 8;
+ if (in[currentPos] >= 1 << bitLength[selector])
+ throw new RuntimeException("Too big a number");
+ out[tmpoutpos++] = in[currentPos++] | (selector << 28);
+ }
+ outer: while (currentPos < finalin) {
+ mainloop: for (int selector = 0; selector < 8; selector++) {
+ int res = 0;
+ int compressedNum = codeNum[selector];
+ if (finalin <= currentPos + compressedNum - 1)
+ compressedNum = finalin - currentPos;
+ int b = bitLength[selector];
+ int max = 1 << b;
+ int i = 0;
+ for (; i < compressedNum; i++) {
+ if (max <= in[currentPos + i])
+ continue mainloop;
+ res = (res << b) + in[currentPos + i];
+ }
+
+ if (compressedNum != codeNum[selector])
+ res <<= (codeNum[selector] - compressedNum) * b;
+ res |= selector << 28;
+ out[tmpoutpos++] = res;
+ currentPos += compressedNum;
+ continue outer;
+ }
+ final int selector = 8;
+ // Util.assertTrue(codeNum[selector] == 1);
+ if (in[currentPos] >= 1 << bitLength[selector])
+ throw new RuntimeException("Too big a number");
+ out[tmpoutpos++] = in[currentPos++] | (selector << 28);
+ }
+ // Util.assertTrue(currentPos == finalin);
+ inpos.set(currentPos);
+ outpos.set(tmpoutpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ int currentPos = outpos.get();
+ int tmpinpos = inpos.get();
+ final int finalout = currentPos + num;
+ while (currentPos < finalout - 28) {
+ int val = in[tmpinpos++];
+ int header = val >>> 28;
+ switch (header) {
+ case 0: { // number : 28, bitwidth : 1
+ out[currentPos++] = (val << 4) >>> 31;
+ out[currentPos++] = (val << 5) >>> 31;
+ out[currentPos++] = (val << 6) >>> 31;
+ out[currentPos++] = (val << 7) >>> 31;
+ out[currentPos++] = (val << 8) >>> 31;
+ out[currentPos++] = (val << 9) >>> 31;
+ out[currentPos++] = (val << 10) >>> 31;
+ out[currentPos++] = (val << 11) >>> 31;
+ out[currentPos++] = (val << 12) >>> 31;
+ out[currentPos++] = (val << 13) >>> 31; // 10
+ out[currentPos++] = (val << 14) >>> 31;
+ out[currentPos++] = (val << 15) >>> 31;
+ out[currentPos++] = (val << 16) >>> 31;
+ out[currentPos++] = (val << 17) >>> 31;
+ out[currentPos++] = (val << 18) >>> 31;
+ out[currentPos++] = (val << 19) >>> 31;
+ out[currentPos++] = (val << 20) >>> 31;
+ out[currentPos++] = (val << 21) >>> 31;
+ out[currentPos++] = (val << 22) >>> 31;
+ out[currentPos++] = (val << 23) >>> 31; // 20
+ out[currentPos++] = (val << 24) >>> 31;
+ out[currentPos++] = (val << 25) >>> 31;
+ out[currentPos++] = (val << 26) >>> 31;
+ out[currentPos++] = (val << 27) >>> 31;
+ out[currentPos++] = (val << 28) >>> 31;
+ out[currentPos++] = (val << 29) >>> 31;
+ out[currentPos++] = (val << 30) >>> 31;
+ out[currentPos++] = (val << 31) >>> 31;
+ break;
+ }
+ case 1: { // number : 14, bitwidth : 2
+ out[currentPos++] = (val << 4) >>> 30;
+ out[currentPos++] = (val << 6) >>> 30;
+ out[currentPos++] = (val << 8) >>> 30;
+ out[currentPos++] = (val << 10) >>> 30;
+ out[currentPos++] = (val << 12) >>> 30;
+ out[currentPos++] = (val << 14) >>> 30;
+ out[currentPos++] = (val << 16) >>> 30;
+ out[currentPos++] = (val << 18) >>> 30;
+ out[currentPos++] = (val << 20) >>> 30;
+ out[currentPos++] = (val << 22) >>> 30; // 10
+ out[currentPos++] = (val << 24) >>> 30;
+ out[currentPos++] = (val << 26) >>> 30;
+ out[currentPos++] = (val << 28) >>> 30;
+ out[currentPos++] = (val << 30) >>> 30;
+ break;
+ }
+ case 2: { // number : 9, bitwidth : 3
+ out[currentPos++] = (val << 5) >>> 29;
+ out[currentPos++] = (val << 8) >>> 29;
+ out[currentPos++] = (val << 11) >>> 29;
+ out[currentPos++] = (val << 14) >>> 29;
+ out[currentPos++] = (val << 17) >>> 29;
+ out[currentPos++] = (val << 20) >>> 29;
+ out[currentPos++] = (val << 23) >>> 29;
+ out[currentPos++] = (val << 26) >>> 29;
+ out[currentPos++] = (val << 29) >>> 29;
+ break;
+ }
+ case 3: { // number : 7, bitwidth : 4
+ out[currentPos++] = (val << 4) >>> 28;
+ out[currentPos++] = (val << 8) >>> 28;
+ out[currentPos++] = (val << 12) >>> 28;
+ out[currentPos++] = (val << 16) >>> 28;
+ out[currentPos++] = (val << 20) >>> 28;
+ out[currentPos++] = (val << 24) >>> 28;
+ out[currentPos++] = (val << 28) >>> 28;
+ break;
+ }
+ case 4: { // number : 5, bitwidth : 5
+ out[currentPos++] = (val << 7) >>> 27;
+ out[currentPos++] = (val << 12) >>> 27;
+ out[currentPos++] = (val << 17) >>> 27;
+ out[currentPos++] = (val << 22) >>> 27;
+ out[currentPos++] = (val << 27) >>> 27;
+ break;
+ }
+ case 5: { // number : 4, bitwidth : 7
+ out[currentPos++] = (val << 4) >>> 25;
+ out[currentPos++] = (val << 11) >>> 25;
+ out[currentPos++] = (val << 18) >>> 25;
+ out[currentPos++] = (val << 25) >>> 25;
+ break;
+ }
+ case 6: { // number : 3, bitwidth : 9
+ out[currentPos++] = (val << 5) >>> 23;
+ out[currentPos++] = (val << 14) >>> 23;
+ out[currentPos++] = (val << 23) >>> 23;
+ break;
+ }
+ case 7: { // number : 2, bitwidth : 14
+ out[currentPos++] = (val << 4) >>> 18;
+ out[currentPos++] = (val << 18) >>> 18;
+ break;
+ }
+ case 8: { // number : 1, bitwidth : 28
+ out[currentPos++] = (val << 4) >>> 4;
+ break;
+ }
+ default: {
+ throw new RuntimeException("shouldn't happen");
+ }
+ }
+ }
+ while (currentPos < finalout) {
+ int val = in[tmpinpos++];
+ int header = val >>> 28;
+ switch (header) {
+ case 0: { // number : 28, bitwidth : 1
+ final int howmany = finalout - currentPos;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (k + 4)) >>> 31;
+ }
+ break;
+ }
+ case 1: { // number : 14, bitwidth : 2
+ final int howmany = finalout - currentPos < 14 ? finalout
+ - currentPos : 14;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (2 * k + 4)) >>> 30;
+ }
+ break;
+ }
+ case 2: { // number : 9, bitwidth : 3
+ final int howmany = finalout - currentPos < 9 ? finalout
+ - currentPos : 9;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (3 * k + 5)) >>> 29;
+ }
+ break;
+ }
+ case 3: { // number : 7, bitwidth : 4
+ final int howmany = finalout - currentPos < 7 ? finalout
+ - currentPos : 7;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (4 * k + 4)) >>> 28;
+ }
+ break;
+ }
+ case 4: { // number : 5, bitwidth : 5
+ final int howmany = finalout - currentPos < 5 ? finalout
+ - currentPos : 5;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (5 * k + 7)) >>> 27;
+ }
+ break;
+ }
+ case 5: { // number : 4, bitwidth : 7
+ final int howmany = finalout - currentPos < 4 ? finalout
+ - currentPos : 4;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (7 * k + 4)) >>> 25;
+ }
+ break;
+ }
+ case 6: { // number : 3, bitwidth : 9
+ final int howmany = finalout - currentPos < 3 ? finalout
+ - currentPos : 3;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (9 * k + 5)) >>> 23;
+ }
+ break;
+ }
+ case 7: { // number : 2, bitwidth : 14
+ final int howmany = finalout - currentPos < 2 ? finalout
+ - currentPos : 2;
+ for (int k = 0; k < howmany; ++k) {
+ out[currentPos++] = (val << (14 * k + 4)) >>> 18;
+ }
+ break;
+ }
+ case 8: { // number : 1, bitwidth : 28
+ out[currentPos++] = (val << 4) >>> 4;
+ break;
+ }
+ default: {
+ throw new RuntimeException("shouldn't happen");
+ }
+ }
+ }
+ outpos.set(currentPos);
+ inpos.set(tmpinpos);
+
+ }
+
+ private final static int bitLength[] = { 1, 2, 3, 4, 5, 7, 9, 14, 28 };
+
+ private final static int codeNum[] = { 28, 14, 9, 7, 5, 4, 3, 2, 1 };
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+}
From 6af200a5d89b7b65ccef3a06788b6ef11493143b Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 10 Sep 2014 19:40:59 -0400
Subject: [PATCH 033/266] Now with failing unit tests
---
.../lemire/integercompression/JustCopy.java | 13 ++-
.../integercompression/VariableByte.java | 32 +++++-
.../skippable/SkippableBinaryPacking.java | 91 +++++++++++++++++
.../skippable/SkippableIntegerCODEC.java | 2 +-
.../integercompression/ByteBasicTest.java | 86 ++++++++++++++++
.../SkippableBasicTest.java | 99 +++++++++++++++++++
.../lemire/integercompression/TestUtils.java | 18 ++++
7 files changed, 338 insertions(+), 3 deletions(-)
create mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java
create mode 100644 src/test/java/me/lemire/integercompression/ByteBasicTest.java
create mode 100644 src/test/java/me/lemire/integercompression/SkippableBasicTest.java
diff --git a/src/main/java/me/lemire/integercompression/JustCopy.java b/src/main/java/me/lemire/integercompression/JustCopy.java
index a385bde..9a535d4 100644
--- a/src/main/java/me/lemire/integercompression/JustCopy.java
+++ b/src/main/java/me/lemire/integercompression/JustCopy.java
@@ -7,11 +7,13 @@
package me.lemire.integercompression;
+import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
+
/**
* @author Daniel Lemire
*
*/
-public final class JustCopy implements IntegerCODEC {
+public final class JustCopy implements IntegerCODEC, SkippableIntegerCODEC {
@Override
public void compress(int[] in, IntWrapper inpos, int inlength,
@@ -34,4 +36,13 @@ public String toString() {
return this.getClass().getSimpleName();
}
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int num) {
+ System.arraycopy(in, inpos.get(), out, outpos.get(), num);
+ inpos.add(num);
+ outpos.add(num);
+
+ }
+
}
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index e33fc1f..e95ee0f 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -10,6 +10,8 @@
import java.nio.ByteOrder;
import java.nio.IntBuffer;
+import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
+
/**
* Implementation of variable-byte. For best performance, use it using the
* ByteIntegerCODEC interface.
@@ -19,7 +21,7 @@
*
* @author Daniel Lemire
*/
-public class VariableByte implements IntegerCODEC, ByteIntegerCODEC {
+public class VariableByte implements IntegerCODEC, ByteIntegerCODEC, SkippableIntegerCODEC {
private static byte extract7bits(int i, long val) {
return (byte) ((val >> (7 * i)) & ((1 << 7) - 1));
@@ -173,4 +175,32 @@ public String toString() {
return this.getClass().getSimpleName();
}
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num) {
+ int s = 0;
+ int val = 0;
+ int p = inpos.get();
+ int tmpoutpos = outpos.get();
+ int finaloutpos = num + tmpoutpos;
+ for (int v = 0, shift = 0; tmpoutpos < finaloutpos;) {
+ val = in[p];
+ int c = (byte) (val >>> s);
+ s += 8;
+ if (s == 32) {
+ s = 0;
+ p++;
+ }
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos++] = v;
+ v = 0;
+ shift = 0;
+ } else
+ shift += 7;
+ }
+ outpos.set(tmpoutpos);
+ inpos.add(inlength);
+ }
+
}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java b/src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java
new file mode 100644
index 0000000..3d8ae13
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java
@@ -0,0 +1,91 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression.skippable;
+
+import me.lemire.integercompression.*;
+
+
+
+/**
+ * Scheme based on a commonly used idea: can be extremely fast.
+ * It encodes integers in blocks of 128 integers. For arrays containing
+ * an arbitrary number of integers, you should use it in conjunction
+ * with another CODEC:
+ *
+ * IntegerCODEC ic =
+ * new Composition(new BinaryPacking(), new VariableByte()).
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, use IntegratedBinaryPacking instead.
+ *
+ *
+ * For details, please see
+ *
+ *
+ * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
+ * through vectorization Software: Practice & Experience
+ * http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
+ * http://arxiv.org/abs/1209.2137
+ *
+ *
+ * Daniel Lemire, Leonid Boytsov, Nathan Kurz,
+ * SIMD Compression and the Intersection of Sorted Integers
+ * http://arxiv.org/abs/1401.6399
+ *
+ *
+ * @author Daniel Lemire
+ */
+public final class SkippableBinaryPacking implements SkippableIntegerCODEC {
+
+ @Override
+public void compress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos) {
+ inlength = inlength / 128 * 128;
+ int tmpoutpos = outpos.get();
+ for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
+ final int mbits1 = Util.maxbits(in, s, 32);
+ final int mbits2 = Util.maxbits(in, s + 32, 32);
+ final int mbits3 = Util.maxbits(in, s + 2 * 32, 32);
+ final int mbits4 = Util.maxbits(in, s + 3 * 32, 32);
+ out[tmpoutpos++] = (mbits1 << 24) | (mbits2 << 16) | (mbits3 << 8)
+ | (mbits4);
+ BitPacking.fastpackwithoutmask(in, s, out, tmpoutpos, mbits1);
+ tmpoutpos += mbits1;
+ BitPacking.fastpackwithoutmask(in, s + 32, out, tmpoutpos, mbits2);
+ tmpoutpos += mbits2;
+ BitPacking.fastpackwithoutmask(in, s + 2 * 32, out, tmpoutpos, mbits3);
+ tmpoutpos += mbits3;
+ BitPacking.fastpackwithoutmask(in, s + 3 * 32, out, tmpoutpos, mbits4);
+ tmpoutpos += mbits4;
+ }
+ inpos.add(inlength);
+ outpos.set(tmpoutpos);
+ }
+
+ @Override
+public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos, int num) {
+ final int outlength = num / 128 * 128;
+ int tmpinpos = inpos.get();
+ for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
+ final int mbits1 = (in[tmpinpos] >>> 24);
+ final int mbits2 = (in[tmpinpos] >>> 16) & 0xFF;
+ final int mbits3 = (in[tmpinpos] >>> 8) & 0xFF;
+ final int mbits4 = (in[tmpinpos]) & 0xFF;
+ ++tmpinpos;
+ BitPacking.fastunpack(in, tmpinpos, out, s, mbits1);
+ tmpinpos += mbits1;
+ BitPacking.fastunpack(in, tmpinpos, out, s + 32, mbits2);
+ tmpinpos += mbits2;
+ BitPacking.fastunpack(in, tmpinpos, out, s + 2 * 32, mbits3);
+ tmpinpos += mbits3;
+ BitPacking.fastunpack(in, tmpinpos, out, s + 3 * 32, mbits4);
+ tmpinpos += mbits4;
+ }
+ outpos.add(outlength);
+ inpos.set(tmpinpos);
+ }
+
+}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java b/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
index 6040e95..f3d9900 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
@@ -61,7 +61,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
* @param outpos
* where to write the compressed output in out
* @param num
- * number of integers we want to decode
+ * number of integers we want to decode, the actual number of integers decoded can be less
*/
public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num);
diff --git a/src/test/java/me/lemire/integercompression/ByteBasicTest.java b/src/test/java/me/lemire/integercompression/ByteBasicTest.java
new file mode 100644
index 0000000..314bdfc
--- /dev/null
+++ b/src/test/java/me/lemire/integercompression/ByteBasicTest.java
@@ -0,0 +1,86 @@
+package me.lemire.integercompression;
+
+import java.util.Arrays;
+
+import me.lemire.integercompression.differential.IntegratedVariableByte;
+
+import org.junit.Test;
+
+
+/**
+ * Just some basic sanity tests.
+ *
+ * @author Daniel Lemire
+ */
+@SuppressWarnings({ "static-method" })
+public class ByteBasicTest {
+ ByteIntegerCODEC[] codecs = {
+ new VariableByte(),
+ new IntegratedVariableByte(),
+ };
+
+ /**
+ *
+ */
+ @Test
+ public void varyingLengthTest() {
+ int N = 4096;
+ int[] data = new int[N];
+ for (int k = 0; k < N; ++k)
+ data[k] = k;
+ for (ByteIntegerCODEC c : codecs) {
+ for (int L = 1; L <= 128; L++) {
+ byte[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug "+c.toString()+" "+k+" "+answer[k]+" "+data[k]);
+ }
+ for (int L = 128; L <= N; L *= 2) {
+ byte[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
+
+ }
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void varyingLengthTest2() {
+ int N = 128;
+ int[] data = new int[N];
+ data[127] = -1;
+ for (ByteIntegerCODEC c : codecs) {
+ try {
+ // CODEC Simple9 is limited to "small" integers.
+ if (c.getClass().equals(
+ Class.forName("me.lemire.integercompression.Simple9")))
+ continue;
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ for (int L = 1; L <= 128; L++) {
+ byte[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug at k = "+k+" "+answer[k]+" "+data[k]);
+ }
+ for (int L = 128; L <= N; L *= 2) {
+ byte[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
+
+ }
+ }
+
+
+}
diff --git a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
new file mode 100644
index 0000000..bcb7322
--- /dev/null
+++ b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
@@ -0,0 +1,99 @@
+package me.lemire.integercompression;
+
+import java.util.Arrays;
+
+import me.lemire.integercompression.skippable.*;
+
+import org.junit.Test;
+
+
+/**
+ * Just some basic sanity tests.
+ *
+ * @author Daniel Lemire
+ */
+@SuppressWarnings({ "static-method" })
+public class SkippableBasicTest {
+ SkippableIntegerCODEC[] codecs = {
+ new JustCopy(),
+ new VariableByte(),
+ new SkippableComposition(new SkippableBinaryPacking(), new VariableByte()),
+ // new SkippableComposition(new SkippableNewPFD(), new VariableByte()),
+ // new SkippableComposition(new SkippableOptPFD(), new VariableByte()),
+ // new SkippableComposition(new SkippableFastPFOR(), new VariableByte()),
+ new SkippableSimple9(),
+ new SkippableSimple16() };
+
+ /**
+ *
+ */
+ @Test
+ public void varyingLengthTest() {
+ int N = 4096;
+ int[] data = new int[N];
+ for (int k = 0; k < N; ++k)
+ data[k] = k;
+ for (SkippableIntegerCODEC c : codecs) {
+ for (int L = 1; L <= 128; L++) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug "+c.toString()+" "+k+" "+answer[k]+" "+data[k]);
+ }
+ for (int L = 128; L <= N; L *= 2) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
+
+ }
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void varyingLengthTest2() {
+ int N = 128;
+ int[] data = new int[N];
+ data[127] = -1;
+ for (SkippableIntegerCODEC c : codecs) {
+ try {
+ // CODEC Simple9 is limited to "small" integers.
+ if (c.getClass().equals(
+ Class.forName("me.lemire.integercompression.skippable.SkippableSimple9")))
+ continue;
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ try {
+ // CODEC Simple16 is limited to "small" integers.
+ if (c.getClass().equals(
+ Class.forName("me.lemire.integercompression.skippable.SkippableSimple16")))
+ continue;
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ for (int L = 1; L <= 128; L++) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug at k = "+k+" "+answer[k]+" "+data[k]+" for "+c.toString());
+ }
+ for (int L = 128; L <= N; L *= 2) {
+ int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompress(c, comp, L);
+ for (int k = 0; k < L; ++k)
+ if (answer[k] != data[k])
+ throw new RuntimeException("bug");
+ }
+
+ }
+ }
+
+
+}
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index 9217097..ee296b8 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -2,6 +2,8 @@
import java.util.Arrays;
+import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
+
import org.junit.Test;
import static org.junit.Assert.*;
@@ -107,4 +109,20 @@ protected static int[] uncompress(ByteIntegerCODEC codec, byte[] data, int len)
return Arrays.copyOf(outBuf, outPos.get());
}
+ protected static int[] compress(SkippableIntegerCODEC codec, int[] data) {
+ int[] outBuf = new int[data.length * 4];
+ IntWrapper inPos = new IntWrapper();
+ IntWrapper outPos = new IntWrapper();
+ codec.compress(data, inPos, data.length, outBuf, outPos);
+ return Arrays.copyOf(outBuf, outPos.get());
+ }
+
+ protected static int[] uncompress(SkippableIntegerCODEC codec, int[] data, int len) {
+ int[] outBuf = new int[len + 1024];
+ IntWrapper inPos = new IntWrapper();
+ IntWrapper outPos = new IntWrapper();
+ codec.uncompress(data, inPos, data.length, outBuf, outPos,len);
+ return Arrays.copyOf(outBuf, outPos.get());
+ }
+
}
From ad82035bad157633b0de4c88f81cb23c544f2a5f Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 10 Sep 2014 20:24:27 -0400
Subject: [PATCH 034/266] Now test are passing.
---
.../java/me/lemire/integercompression/S9.java | 4 +-
.../lemire/integercompression/Simple16.java | 179 +++++++++
.../skippable/Kamikaze.java | 2 +
.../skippable/SkippableFastPFOR.java | 374 ++++++++++--------
.../skippable/SkippableNewPFD.java | 6 +-
.../skippable/SkippableOptPFD.java | 8 +-
.../skippable/SkippableSimple16.java | 6 +-
.../lemire/integercompression/BasicTest.java | 10 +
.../SkippableBasicTest.java | 6 +-
.../lemire/integercompression/TestUtils.java | 1 +
10 files changed, 412 insertions(+), 184 deletions(-)
create mode 100644 src/main/java/me/lemire/integercompression/Simple16.java
diff --git a/src/main/java/me/lemire/integercompression/S9.java b/src/main/java/me/lemire/integercompression/S9.java
index d5846c7..a14b1fb 100644
--- a/src/main/java/me/lemire/integercompression/S9.java
+++ b/src/main/java/me/lemire/integercompression/S9.java
@@ -8,7 +8,9 @@
/**
* This is a version of Simple9 optimized for NewPFOR, OptPFOR
- *
+ *
+ * Adapted by D. Lemire from the Apache Lucene project.
+ *
* @author Daniel Lemire
*/
public final class S9 {
diff --git a/src/main/java/me/lemire/integercompression/Simple16.java b/src/main/java/me/lemire/integercompression/Simple16.java
new file mode 100644
index 0000000..5b6098e
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/Simple16.java
@@ -0,0 +1,179 @@
+package me.lemire.integercompression;
+
+
+
+/**
+ * This is an implementation of the popular Simple16 scheme. It is limited to
+ * 28-bit integers (between 0 and 2^28-1).
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, you must compute the deltas separately.
+ *
+ *
+ * Adapted by D. Lemire from the Apache Lucene project.
+ *
+ */
+public final class Simple16 implements IntegerCODEC {
+
+ public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
+ IntWrapper outpos) {
+ int i_inpos = inpos.get();
+ int i_outpos = outpos.get();
+ out[i_outpos++] = inlength;
+ final int finalin = i_inpos + inlength;
+ while (i_inpos < finalin) {
+ int inoffset = compressblock(out, i_outpos++, in, i_inpos, inlength);
+ if (inoffset == -1)
+ throw new RuntimeException("Too big a number");
+ i_inpos += inoffset;
+ inlength -= inoffset;
+ }
+ inpos.set(i_inpos);
+ outpos.set(i_outpos);
+ }
+
+ /**
+ * Compress an integer array using Simple16
+ *
+ * @param out
+ * the compressed output
+ * @param outOffset
+ * the offset of the output in the number of integers
+ * @param in
+ * the integer 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 compressed integers
+ */
+ public static final int compressblock(int[] out, int outOffset, int[] in,
+ int inOffset, int n) {
+ int numIdx, j, num, bits;
+ for (numIdx = 0; numIdx < S16_NUMSIZE; numIdx++) {
+ out[outOffset] = numIdx << S16_BITSSIZE;
+ num = (S16_NUM[numIdx] < n) ? S16_NUM[numIdx] : n;
+
+ for (j = 0, bits = 0; (j < num)
+ && (in[inOffset + j] < SHIFTED_S16_BITS[numIdx][j]);) {
+ out[outOffset] |= (in[inOffset + j] << bits);
+ bits += S16_BITS[numIdx][j];
+ j++;
+ }
+
+ if (j == num) {
+ return num;
+ }
+ }
+
+ return -1;
+ }
+
+
+ /**
+ * 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 decompressblock(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] = (in[inOffset] >>> bits)
+ & (0xffffffff >>> (32 - S16_BITS[numIdx][j]));
+ bits += S16_BITS[numIdx][j];
+ }
+ return num;
+ }
+
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ int i_inpos = inpos.get();
+ int num = in[i_inpos++];
+ int i_outpos = outpos.get();
+ while (num > 0) {
+ final int howmany = decompressblock(out, i_outpos, in, i_inpos, num);
+ num -= howmany;
+ i_outpos += howmany;
+ i_inpos++;
+ }
+ inpos.set(i_inpos);
+ outpos.set(i_outpos);
+ }
+
+ /**
+ * Uncompress data from an array to another array.
+ *
+ * Both inpos and outpos parameters are modified to indicate new positions
+ * after read/write.
+ *
+ * @param in
+ * array containing data in compressed form
+ * @param tmpinpos
+ * where to start reading in the array
+ * @param inlength
+ * length of the compressed data (ignored by some schemes)
+ * @param out
+ * array where to write the compressed output
+ * @param currentPos
+ * where to write the compressed output in out
+ * @param outlength
+ * number of integers we want to decode
+ */
+ public static void uncompress(int[] in, int tmpinpos, int inlength,
+ int[] out, int currentPos, int outlength) {
+ final int finalpos = tmpinpos + inlength;
+ while (tmpinpos < finalpos) {
+ final int howmany = decompressblock(out, currentPos, in, tmpinpos,
+ outlength);
+ outlength -= howmany;
+ currentPos += howmany;
+ tmpinpos += 1;
+ }
+
+ }
+
+ private static int[][] shiftme(int[][] x) {
+ int[][] answer = new int[x.length][];
+ for (int k = 0; k < x.length; ++k) {
+ answer[k] = new int[x[k].length];
+ for (int z = 0; z < answer[k].length; ++z)
+ answer[k][z] = 1 << x[k][z];
+ }
+ return answer;
+ }
+
+ private static final int S16_NUMSIZE = 16;
+ private static final int S16_BITSSIZE = 28;
+ // the possible number of bits used to represent one integer
+ private static final int[] S16_NUM = { 28, 21, 21, 21, 14, 9, 8, 7, 6, 6,
+ 5, 5, 4, 3, 2, 1 };
+ // the corresponding number of elements for each value of the number of bits
+ private static final int[][] S16_BITS = {
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1 },
+ { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2 },
+ { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
+ { 4, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 4, 4, 4, 4, 3, 3, 3 },
+ { 4, 4, 4, 4, 4, 4, 4 }, { 5, 5, 5, 5, 4, 4 },
+ { 4, 4, 5, 5, 5, 5 }, { 6, 6, 6, 5, 5 }, { 5, 5, 6, 6, 6 },
+ { 7, 7, 7, 7 }, { 10, 9, 9, }, { 14, 14 }, { 28 } };
+ private static final int[][] SHIFTED_S16_BITS = shiftme(S16_BITS);
+
+}
\ No newline at end of file
diff --git a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java b/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
index f5a344e..c1909f4 100644
--- a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
+++ b/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
@@ -6,6 +6,8 @@
/**
* IntegerCODEC wrapper for Kamikaze's PForDelta.
*
+ * Note: this class is only included for speed benchmarks.
+ * It is not recommended. Use at your own risks.
*
* @author Matteo Catena
*
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
index 34fe3ef..94d0af8 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
@@ -8,6 +8,7 @@
import java.nio.ByteBuffer;
import java.util.Arrays;
+
import me.lemire.integercompression.*;
/**
@@ -43,220 +44,255 @@
* @author Daniel Lemire
*/
public final class SkippableFastPFOR implements SkippableIntegerCODEC {
- int PageSize;
- final static int BlockSize = 128;
- final static int overheadofeachexcept = 8;
+ final static int BLOCK_SIZE = 128;
+ final static int OVERHEAD_OF_EACH_EXCEPT = 8;
+ final static int DEFAULT_PAGE_SIZE = 65536;
+
+ int pageSize;
+ final int[][] dataTobePacked = new int[33][];
+ final ByteBuffer byteContainer;
- int[][] datatobepacked = new int[32][];
- ByteBuffer bytecontainer;
+ // Working area for compress and uncompress.
+ int[] dataPointers;
+ int[] freqs;
+ byte[] bestbbestcexceptmaxb;
/**
- * Constructor for FastPFOR
+ * Construct the FastPFOR CODEC.
*
* @param pagesize
- * size of the page in number of integers
+ * the desired page size (for expert use)
*/
public SkippableFastPFOR(int pagesize) {
- PageSize = pagesize;
- initArrays();
+ pageSize = pagesize;
+ // Initiate arrrays.
+ byteContainer = ByteBuffer.allocateDirect(3 * pageSize
+ / BLOCK_SIZE + pageSize);
+ for (int k = 1; k < dataTobePacked.length; ++k)
+ dataTobePacked[k] = new int[pageSize / 32 * 4]; // heuristic
}
/**
- *
- */
+ * Construct the fastPFOR CODEC with default parameters.
+ */
public SkippableFastPFOR() {
- PageSize = 65536;
- initArrays();
- }
-
- private void initArrays() {
- bytecontainer = ByteBuffer.allocateDirect(3 * PageSize / BlockSize
- + PageSize);
- for (int k = 1; k < 32; ++k)
- datatobepacked[k] = new int[PageSize / 32 * 4];// heuristic
+ this(DEFAULT_PAGE_SIZE);
}
+ /**
+ * Compress data in blocks of 128 integers (if fewer than 128 integers
+ * are provided, nothing is done).
+ *
+ * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
+ */
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = inlength / 128 * 128;
+ inlength = Util.floorBy(inlength, 128);
+ if (inlength == 0)
+ return;
- final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
+ // Allocate memory for working area.
+ dataPointers = new int[33];
+ freqs = new int[33];
+ bestbbestcexceptmaxb = new byte[3];
+
+ final int finalinpos = inpos.get() + inlength;
+ while (inpos.get() != finalinpos) {
+ int thissize = Math.min(pageSize,
+ finalinpos - inpos.get());
+ encodePage(in, inpos, thissize, out, outpos);
+ }
+
+ dataPointers = null;
+ freqs = null;
+ bestbbestcexceptmaxb = null;
}
- private static void getBestBFromData(int[] in, int pos,
- byte[] bestbbestcexceptmaxb) {
- int freqs[] = new int[32];
- for (int k = pos; k < BlockSize + pos; ++k)
- freqs[Util.bits(in[k])]++;
- bestbbestcexceptmaxb[0] = 31;
- while (freqs[bestbbestcexceptmaxb[0]] == 0)
- bestbbestcexceptmaxb[0]--;
- bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
- int bestcost = bestbbestcexceptmaxb[0] * BlockSize;
- byte cexcept = 0;
- bestbbestcexceptmaxb[1] = cexcept;
- for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
- cexcept += freqs[b + 1];
- if (cexcept < 0)
- break;
- int thiscost = cexcept * overheadofeachexcept + cexcept
- * (bestbbestcexceptmaxb[2] - b) + b * BlockSize + 8;// the
- // extra
- // 8 is
- // the
- // cost
- // of
- // storing
- // maxbits
- if (thiscost < bestcost) {
- bestcost = thiscost;
- bestbbestcexceptmaxb[0] = (byte) b;
- bestbbestcexceptmaxb[1] = cexcept;
+ private void getBestBFromData(int[] in, int pos) {
+ Arrays.fill(freqs, 0);
+ for (int k = pos, k_end = pos + BLOCK_SIZE; k < k_end; ++k) {
+ freqs[Util.bits(in[k])]++;
+ }
+ bestbbestcexceptmaxb[0] = 32;
+ while (freqs[bestbbestcexceptmaxb[0]] == 0)
+ bestbbestcexceptmaxb[0]--;
+ bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
+ int bestcost = bestbbestcexceptmaxb[0] * BLOCK_SIZE;
+ byte cexcept = 0;
+ bestbbestcexceptmaxb[1] = cexcept;
+ for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
+ cexcept += freqs[b + 1];
+ if (cexcept < 0)
+ break;
+ // the extra 8 is the cost of storing maxbits
+ int thiscost = cexcept * OVERHEAD_OF_EACH_EXCEPT
+ + cexcept * (bestbbestcexceptmaxb[2] - b) + b
+ * BLOCK_SIZE + 8;
+ if (thiscost < bestcost) {
+ bestcost = thiscost;
+ bestbbestcexceptmaxb[0] = (byte) b;
+ bestbbestcexceptmaxb[1] = cexcept;
+ }
}
- }
}
private void encodePage(int[] in, IntWrapper inpos, int thissize,
int[] out, IntWrapper outpos) {
- final int headerpos = outpos.get();
- outpos.increment();
- int tmpoutpos = outpos.get();
- int[] datapointers = new int[32];
- bytecontainer.clear();
- final byte[] bestbbestcexceptmaxb = new byte[3];
- int tmpinpos = inpos.get();
- for (final int finalinpos = tmpinpos + thissize; tmpinpos + BlockSize <= finalinpos; tmpinpos += BlockSize) {
- getBestBFromData(in, tmpinpos, bestbbestcexceptmaxb);
- final int tmpbestb = bestbbestcexceptmaxb[0];
- bytecontainer.put(bestbbestcexceptmaxb[0]);
- bytecontainer.put(bestbbestcexceptmaxb[1]);
- if (bestbbestcexceptmaxb[1] > 0) {
- bytecontainer.put(bestbbestcexceptmaxb[2]);
- final int index = bestbbestcexceptmaxb[2]
- - bestbbestcexceptmaxb[0];
- if (datapointers[index] + bestbbestcexceptmaxb[1] >= datatobepacked[index].length) {
- int newsize = 2 * (datapointers[index] + bestbbestcexceptmaxb[1]);
- newsize = (newsize + 31) / 32 * 32;// make sure it is a
- // multiple of
- // 32
- datatobepacked[index] = Arrays.copyOf(
- datatobepacked[index], newsize);
- }
- final int maxval = 1 << bestbbestcexceptmaxb[0];
- for (int k = 0; k < BlockSize; ++k) {
- if (in[k + tmpinpos] >= maxval) {
- // we have an exception
- bytecontainer.put((byte) k);
- datatobepacked[index][datapointers[index]++] = in[k
- + tmpinpos] >>> tmpbestb;
+ final int headerpos = outpos.get();
+ outpos.increment();
+ int tmpoutpos = outpos.get();
+
+ // Clear working area.
+ Arrays.fill(dataPointers, 0);
+ // Arrays.fill(bestbbestcexceptmaxb, (byte)0);//DL:unncessary
+ byteContainer.clear();
+
+ int tmpinpos = inpos.get();
+ for (final int finalinpos = tmpinpos + thissize - BLOCK_SIZE; tmpinpos <= finalinpos; tmpinpos += BLOCK_SIZE) {
+ getBestBFromData(in, tmpinpos);
+ final int tmpbestb = bestbbestcexceptmaxb[0];
+ byteContainer.put(bestbbestcexceptmaxb[0]);
+ byteContainer.put(bestbbestcexceptmaxb[1]);
+ if (bestbbestcexceptmaxb[1] > 0) {
+ byteContainer.put(bestbbestcexceptmaxb[2]);
+ final int index = bestbbestcexceptmaxb[2]
+ - bestbbestcexceptmaxb[0];
+ if (dataPointers[index]
+ + bestbbestcexceptmaxb[1] >= dataTobePacked[index].length) {
+ int newsize = 2 * (dataPointers[index] + bestbbestcexceptmaxb[1]);
+ // make sure it is a multiple of 32
+ newsize = Util
+ .floorBy(newsize + 31, 32);
+ dataTobePacked[index] = Arrays.copyOf(
+ dataTobePacked[index], newsize);
+ }
+ for (int k = 0; k < BLOCK_SIZE; ++k) {
+ if ((in[k + tmpinpos] >>> bestbbestcexceptmaxb[0]) != 0) {
+ // we have an exception
+ byteContainer.put((byte) k);
+ dataTobePacked[index][dataPointers[index]++] = in[k
+ + tmpinpos] >>> tmpbestb;
+ }
+ }
+
+ }
+ for (int k = 0; k < 128; k += 32) {
+ BitPacking.fastpack(in, tmpinpos + k, out,
+ tmpoutpos, tmpbestb);
+ tmpoutpos += tmpbestb;
}
- }
}
- for (int k = 0; k < 128; k += 32) {
- BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos, tmpbestb);
- tmpoutpos += tmpbestb;
+ inpos.set(tmpinpos);
+ out[headerpos] = tmpoutpos - headerpos;
+ final int bytesize = byteContainer.position();
+ while ((byteContainer.position() & 3) != 0)
+ byteContainer.put((byte) 0);
+ out[tmpoutpos++] = bytesize;
+ final int howmanyints = byteContainer.position() / 4;
+ byteContainer.flip();
+ byteContainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
+ tmpoutpos += howmanyints;
+ int bitmap = 0;
+ for (int k = 1; k <= 32; ++k) {
+ if (dataPointers[k] != 0)
+ bitmap |= (1 << (k - 1));
}
- }
- inpos.set(tmpinpos);
- out[headerpos] = tmpoutpos - headerpos;
- while ((bytecontainer.position() & 3) != 0)
- bytecontainer.put((byte) 0);
- final int bytesize = bytecontainer.position();
- out[tmpoutpos++] = bytesize;
- final int howmanyints = bytesize / 4;
- bytecontainer.flip();
- bytecontainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
- tmpoutpos += howmanyints;
- int bitmap = 0;
- for (int k = 1; k <= 31; ++k) {
- if (datapointers[k] != 0)
- bitmap |= (1 << (k - 1));
- }
- out[tmpoutpos++] = bitmap;
- for (int k = 1; k <= 31; ++k) {
-
- if (datapointers[k] != 0) {
- out[tmpoutpos++] = datapointers[k];// size
- for (int j = 0; j < datapointers[k]; j += 32) {
- BitPacking
- .fastpack(datatobepacked[k], j, out, tmpoutpos, k);
- tmpoutpos += k;
- }
+ out[tmpoutpos++] = bitmap;
+ for (int k = 1; k <= 32; ++k) {
+ if (dataPointers[k] != 0) {
+ out[tmpoutpos++] = dataPointers[k];// size
+ for (int j = 0; j < dataPointers[k]; j += 32) {
+ BitPacking.fastpack(dataTobePacked[k],
+ j, out, tmpoutpos, k);
+ tmpoutpos += k;
+ }
+ }
}
- }
- outpos.set(tmpoutpos);
+ outpos.set(tmpoutpos);
}
+ /**
+ * Uncompress data in blocks of 128 integers. In this particular case,
+ * the inlength parameter is ignored: it is deduced from the compressed
+ * data.
+ *
+ * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
+ */
@Override
public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
- int mynvalue = num / BlockSize * BlockSize;
- int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ if (inlength == 0)
+ return;
+
+ int mynvalue = num / BLOCK_SIZE * BLOCK_SIZE;
+
+ dataPointers = new int[33];
+
+ int finalout = outpos.get() + mynvalue;
+ while (outpos.get() != finalout) {
+ int thissize = Math.min(pageSize,
+ finalout - outpos.get());
+ decodePage(in, inpos, out, outpos, thissize);
+ }
+
+ dataPointers = null;
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
IntWrapper outpos, int thissize) {
- final int initpos = inpos.get();
- final int wheremeta = in[inpos.get()];
- inpos.increment();
- int inexcept = initpos + wheremeta;
- final int bytesize = in[inexcept++];
- bytecontainer.clear();
- bytecontainer.asIntBuffer().put(in, inexcept, bytesize / 4);
- inexcept += bytesize / 4;
+ final int initpos = inpos.get();
+ final int wheremeta = in[inpos.get()];
+ inpos.increment();
+ int inexcept = initpos + wheremeta;
+ final int bytesize = in[inexcept++];
+ byteContainer.clear();
+ byteContainer.asIntBuffer().put(in, inexcept, (bytesize + 3) / 4);
+ inexcept += (bytesize + 3)/ 4;
- final int bitmap = in[inexcept++];
- for (int k = 1; k <= 31; ++k) {
- if ((bitmap & (1 << (k - 1))) != 0) {
- int size = in[inexcept++];
- if (datatobepacked[k].length < size)
- datatobepacked[k] = new int[(size + 31) / 32 * 32];
- for (int j = 0; j < size; j += 32) {
- BitPacking
- .fastunpack(in, inexcept, datatobepacked[k], j, k);
- inexcept += k;
- }
+ final int bitmap = in[inexcept++];
+ for (int k = 1; k <= 32; ++k) {
+ if ((bitmap & (1 << (k - 1))) != 0) {
+ int size = in[inexcept++];
+ if (dataTobePacked[k].length < size)
+ dataTobePacked[k] = new int[Util
+ .floorBy(size + 31, 32)];
+ for (int j = 0; j < size; j += 32) {
+ BitPacking.fastunpack(in, inexcept,
+ dataTobePacked[k], j, k);
+ inexcept += k;
+ }
+ }
}
- }
- int[] datapointers = new int[32];
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
+ Arrays.fill(dataPointers, 0);
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
- final byte b = bytecontainer.get();
- final byte cexcept = bytecontainer.get();
- for (int k = 0; k < 128; k += 32) {
- BitPacking.fastunpack(in, tmpinpos, out, tmpoutpos + k, b);
- tmpinpos += b;
- }
- if (cexcept > 0) {
- final byte maxbits = bytecontainer.get();
- final int index = maxbits - b;
- for (int k = 0; k < cexcept; ++k) {
- final byte pos = bytecontainer.get();
- final int exceptvalue = datatobepacked[index][datapointers[index]++];
- out[pos + tmpoutpos] |= exceptvalue << b;
- }
+ for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
+ final byte b = byteContainer.get();
+ final byte cexcept = byteContainer.get();
+ for (int k = 0; k < 128; k += 32) {
+ BitPacking.fastunpack(in, tmpinpos, out,
+ tmpoutpos + k, b);
+ tmpinpos += b;
+ }
+ if (cexcept > 0) {
+ final byte maxbits = byteContainer.get();
+ final int index = maxbits - b;
+ for (int k = 0; k < cexcept; ++k) {
+ final byte pos = byteContainer.get();
+ final int exceptvalue = dataTobePacked[index][dataPointers[index]++];
+ out[pos + tmpoutpos] |= exceptvalue << b;
+ }
+ }
}
- }
- outpos.set(tmpoutpos);
- inpos.set(inexcept);
+ outpos.set(tmpoutpos);
+ inpos.set(inexcept);
}
@Override
public String toString() {
- return this.getClass().getName();
+ return this.getClass().getSimpleName();
}
}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
index 33a733f..bb8db7c 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
@@ -81,9 +81,8 @@ private static void getBestBFromData(int[] in, int pos, IntWrapper bestb,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- final int maxv = 1 << bits[i];
for (int k = pos; k < BlockSize + pos; ++k)
- if (in[k] >= maxv)
+ if ((in[k] >>> bits[i]) != 0)
++tmpcounter;
if (tmpcounter * 10 <= BlockSize) {
besti = i;
@@ -109,9 +108,8 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
int remember = tmpoutpos;
tmpoutpos++;
if (nbrexcept > 0) {
- final int maxv = 1 << bits[tmpbestb];
for (int i = 0, c = 0; i < BlockSize; ++i) {
- if (in[tmpinpos + i] >= maxv) {
+ if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos + i] >>> bits[tmpbestb];
++c;
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
index d851c82..d3e3e37 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
@@ -84,15 +84,14 @@ void getBestBFromData(int[] in, int pos, IntWrapper bestb,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- final int maxv = 1 << bits[i];
for (int k = pos; k < BlockSize + pos; ++k)
- if (in[k] >= maxv) {
+ if ((in[k] >>> bits[i]) != 0) {
++tmpcounter;
}
if (tmpcounter == BlockSize)
continue; // no need
for (int k = pos, c = 0; k < pos + BlockSize; ++k)
- if (in[k] >= maxv) {
+ if ((in[k] >>> bits[i]) != 0) {
exceptbuffer[tmpcounter + c] = k - pos;
exceptbuffer[c] = in[k] >>> bits[i];
++c;
@@ -125,10 +124,9 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
int remember = tmpoutpos;
tmpoutpos++;
if (nbrexcept > 0) {
- final int maxv = 1 << bits[tmpbestb];
int c = 0;
for (int i = 0; i < BlockSize; ++i) {
- if (in[tmpinpos + i] >= maxv) {
+ if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos + i] >>> bits[tmpbestb];
++c;
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
index f8adbc0..4ebccd1 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
@@ -3,13 +3,15 @@
import me.lemire.integercompression.*;
/**
- * This is an implementation of the popular Simple9 scheme. It is limited to
+ * This is an implementation of the popular Simple16 scheme. It is limited to
* 28-bit integers (between 0 and 2^28-1).
*
* Note that this does not use differential coding: if you are working on sorted
* lists, you must compute the deltas separately.
*
- * @author Daniel Lemire
+ *
+ * Adapted by D. Lemire from the Apache Lucene project.
+ *
*
*/
public final class SkippableSimple16 implements SkippableIntegerCODEC {
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index 91d36e8..383f407 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -38,6 +38,7 @@ public class BasicTest {
new IntegratedVariableByte()),
new Composition(new FastPFOR(), new VariableByte()),
new Simple9(),
+ new Simple16(),
new Composition(new XorBinaryPacking(), new VariableByte()),
new Composition(new DeltaZigzagBinaryPacking(),
new DeltaZigzagVariableByte()) };
@@ -87,6 +88,15 @@ public void varyingLengthTest2() {
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
+ try {
+ // CODEC Simple16 is limited to "small" integers.
+ if (c.getClass().equals(
+ Class.forName("me.lemire.integercompression.Simple16")))
+ continue;
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+
for (int L = 1; L <= 128; L++) {
int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
int[] answer = TestUtils.uncompress(c, comp, L);
diff --git a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
index bcb7322..550853a 100644
--- a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
+++ b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
@@ -18,9 +18,9 @@ public class SkippableBasicTest {
new JustCopy(),
new VariableByte(),
new SkippableComposition(new SkippableBinaryPacking(), new VariableByte()),
- // new SkippableComposition(new SkippableNewPFD(), new VariableByte()),
- // new SkippableComposition(new SkippableOptPFD(), new VariableByte()),
- // new SkippableComposition(new SkippableFastPFOR(), new VariableByte()),
+ new SkippableComposition(new SkippableNewPFD(), new VariableByte()),
+ new SkippableComposition(new SkippableOptPFD(), new VariableByte()),
+ new SkippableComposition(new SkippableFastPFOR(), new VariableByte()),
new SkippableSimple9(),
new SkippableSimple16() };
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index ee296b8..60271ec 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -122,6 +122,7 @@ protected static int[] uncompress(SkippableIntegerCODEC codec, int[] data, int l
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
codec.uncompress(data, inPos, data.length, outBuf, outPos,len);
+ if(outPos.get() < len) throw new RuntimeException("Insufficient output.");
return Arrays.copyOf(outBuf, outPos.get());
}
From 5dbd0b494be1f38bad49d3a8382a5d8c2139843a Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 11 Sep 2014 11:54:14 -0400
Subject: [PATCH 035/266] Merging classes.
---
.../integercompression/BinaryPacking.java | 28 ++++--
.../lemire/integercompression/JustCopy.java | 14 ++-
.../integercompression/VariableByte.java | 9 +-
.../skippable/Kamikaze.java | 4 +-
.../skippable/SkippableBinaryPacking.java | 91 -------------------
.../skippable/SkippableComposition.java | 12 +--
.../skippable/SkippableFastPFOR.java | 4 +-
.../skippable/SkippableIntegerCODEC.java | 4 +-
.../skippable/SkippableNewPFD.java | 4 +-
.../skippable/SkippableOptPFD.java | 4 +-
.../skippable/SkippableSimple16.java | 4 +-
.../skippable/SkippableSimple9.java | 4 +-
.../SkippableBasicTest.java | 2 +-
.../lemire/integercompression/TestUtils.java | 4 +-
14 files changed, 60 insertions(+), 128 deletions(-)
delete mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java
diff --git a/src/main/java/me/lemire/integercompression/BinaryPacking.java b/src/main/java/me/lemire/integercompression/BinaryPacking.java
index f2c66c6..820ecac 100644
--- a/src/main/java/me/lemire/integercompression/BinaryPacking.java
+++ b/src/main/java/me/lemire/integercompression/BinaryPacking.java
@@ -6,6 +6,8 @@
*/
package me.lemire.integercompression;
+import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
+
/**
* Scheme based on a commonly used idea: can be extremely fast.
* It encodes integers in blocks of 128 integers. For arrays containing
@@ -35,17 +37,23 @@
*
* @author Daniel Lemire
*/
-public final class BinaryPacking implements IntegerCODEC {
+public final class BinaryPacking implements IntegerCODEC, SkippableIntegerCODEC {
@Override
public void compress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / 128 * 128;
- if (inlength == 0)
- return;
+ inlength = inlength / 128 * 128;
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
- out[outpos.get()] = inlength;
- outpos.increment();
+ @Override
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ inlength = inlength / 128 * 128;
int tmpoutpos = outpos.get();
for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
final int mbits1 = Util.maxbits(in, s, 32);
@@ -78,6 +86,13 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
return;
final int outlength = in[inpos.get()];
inpos.increment();
+ headlessUncompress(in,inpos, inlength,out,outpos,outlength);
+ }
+
+ @Override
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int num) {
+ final int outlength = num / 128 * 128;
int tmpinpos = inpos.get();
for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
final int mbits1 = (in[tmpinpos] >>> 24);
@@ -100,7 +115,6 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
outpos.add(outlength);
inpos.set(tmpinpos);
}
-
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/JustCopy.java b/src/main/java/me/lemire/integercompression/JustCopy.java
index 9a535d4..720d71d 100644
--- a/src/main/java/me/lemire/integercompression/JustCopy.java
+++ b/src/main/java/me/lemire/integercompression/JustCopy.java
@@ -16,7 +16,7 @@
public final class JustCopy implements IntegerCODEC, SkippableIntegerCODEC {
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
System.arraycopy(in, inpos.get(), out, outpos.get(), inlength);
inpos.add(inlength);
@@ -26,9 +26,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
@Override
public void uncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- System.arraycopy(in, inpos.get(), out, outpos.get(), inlength);
- inpos.add(inlength);
- outpos.add(inlength);
+ headlessUncompress(in,inpos,inlength,out,outpos,inlength);
}
@Override
@@ -37,7 +35,7 @@ public String toString() {
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int num) {
System.arraycopy(in, inpos.get(), out, outpos.get(), num);
inpos.add(num);
@@ -45,4 +43,10 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ headlessCompress(in,inpos,inlength,out,outpos);
+ }
+
}
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index e95ee0f..69148bd 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -30,10 +30,15 @@ private static byte extract7bits(int i, long val) {
private static byte extract7bitsmaskless(int i, long val) {
return (byte) ((val >> (7 * i)));
}
-
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+
+ @Override
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
if (inlength == 0)
return;
ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
@@ -176,7 +181,7 @@ public String toString() {
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
int s = 0;
int val = 0;
diff --git a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java b/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
index c1909f4..d43d76b 100644
--- a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
+++ b/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
@@ -17,7 +17,7 @@ public class Kamikaze implements SkippableIntegerCODEC {
private int BLOCK_SIZE = 128;
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
@@ -30,7 +30,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
num = num / BLOCK_SIZE * BLOCK_SIZE;
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java b/src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java
deleted file mode 100644
index 3d8ae13..0000000
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableBinaryPacking.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * This is code is released under the
- * Apache License Version 2.0 http://www.apache.org/licenses/.
- *
- * (c) Daniel Lemire, http://lemire.me/en/
- */
-package me.lemire.integercompression.skippable;
-
-import me.lemire.integercompression.*;
-
-
-
-/**
- * Scheme based on a commonly used idea: can be extremely fast.
- * It encodes integers in blocks of 128 integers. For arrays containing
- * an arbitrary number of integers, you should use it in conjunction
- * with another CODEC:
- *
- * IntegerCODEC ic =
- * new Composition(new BinaryPacking(), new VariableByte()).
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, use IntegratedBinaryPacking instead.
- *
- *
- * For details, please see
- *
- *
- * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
- * through vectorization Software: Practice & Experience
- * http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
- * http://arxiv.org/abs/1209.2137
- *
- *
- * Daniel Lemire, Leonid Boytsov, Nathan Kurz,
- * SIMD Compression and the Intersection of Sorted Integers
- * http://arxiv.org/abs/1401.6399
- *
- *
- * @author Daniel Lemire
- */
-public final class SkippableBinaryPacking implements SkippableIntegerCODEC {
-
- @Override
-public void compress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos) {
- inlength = inlength / 128 * 128;
- int tmpoutpos = outpos.get();
- for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
- final int mbits1 = Util.maxbits(in, s, 32);
- final int mbits2 = Util.maxbits(in, s + 32, 32);
- final int mbits3 = Util.maxbits(in, s + 2 * 32, 32);
- final int mbits4 = Util.maxbits(in, s + 3 * 32, 32);
- out[tmpoutpos++] = (mbits1 << 24) | (mbits2 << 16) | (mbits3 << 8)
- | (mbits4);
- BitPacking.fastpackwithoutmask(in, s, out, tmpoutpos, mbits1);
- tmpoutpos += mbits1;
- BitPacking.fastpackwithoutmask(in, s + 32, out, tmpoutpos, mbits2);
- tmpoutpos += mbits2;
- BitPacking.fastpackwithoutmask(in, s + 2 * 32, out, tmpoutpos, mbits3);
- tmpoutpos += mbits3;
- BitPacking.fastpackwithoutmask(in, s + 3 * 32, out, tmpoutpos, mbits4);
- tmpoutpos += mbits4;
- }
- inpos.add(inlength);
- outpos.set(tmpoutpos);
- }
-
- @Override
-public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos, int num) {
- final int outlength = num / 128 * 128;
- int tmpinpos = inpos.get();
- for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
- final int mbits1 = (in[tmpinpos] >>> 24);
- final int mbits2 = (in[tmpinpos] >>> 16) & 0xFF;
- final int mbits3 = (in[tmpinpos] >>> 8) & 0xFF;
- final int mbits4 = (in[tmpinpos]) & 0xFF;
- ++tmpinpos;
- BitPacking.fastunpack(in, tmpinpos, out, s, mbits1);
- tmpinpos += mbits1;
- BitPacking.fastunpack(in, tmpinpos, out, s + 32, mbits2);
- tmpinpos += mbits2;
- BitPacking.fastunpack(in, tmpinpos, out, s + 2 * 32, mbits3);
- tmpinpos += mbits3;
- BitPacking.fastunpack(in, tmpinpos, out, s + 3 * 32, mbits4);
- tmpinpos += mbits4;
- }
- outpos.add(outlength);
- inpos.set(tmpinpos);
- }
-
-}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java b/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
index b3ba09f..45d0ee1 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
@@ -36,22 +36,22 @@ public SkippableComposition(SkippableIntegerCODEC f1,
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
int init = inpos.get();
- F1.compress(in, inpos, inlength, out, outpos);
+ F1.headlessCompress(in, inpos, inlength, out, outpos);
inlength -= inpos.get() - init;
- F2.compress(in, inpos, inlength, out, outpos);
+ F2.headlessCompress(in, inpos, inlength, out, outpos);
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
int init = inpos.get();
- F1.uncompress(in, inpos, inlength, out, outpos, num);
+ F1.headlessUncompress(in, inpos, inlength, out, outpos, num);
inlength -= inpos.get() - init;
num -= outpos.get();
- F2.uncompress(in, inpos, inlength, out, outpos, num);
+ F2.headlessUncompress(in, inpos, inlength, out, outpos, num);
}
@Override
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
index 94d0af8..419aba9 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
@@ -86,7 +86,7 @@ public SkippableFastPFOR() {
* @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
*/
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
inlength = Util.floorBy(inlength, 128);
if (inlength == 0)
@@ -220,7 +220,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
* @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
*/
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
if (inlength == 0)
return;
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java b/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
index f3d9900..50594c3 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
@@ -41,7 +41,7 @@ public interface SkippableIntegerCODEC {
* @param outpos
* where to write in the output array
*/
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos);
/**
@@ -63,7 +63,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
* @param num
* number of integers we want to decode, the actual number of integers decoded can be less
*/
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num);
}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
index bb8db7c..b3a7af8 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
@@ -52,7 +52,7 @@ public SkippableNewPFD() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
inlength = inlength / BlockSize * BlockSize;
@@ -131,7 +131,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
int mynvalue = num / BlockSize * BlockSize;
int finalout = outpos.get() + mynvalue;
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
index d3e3e37..1807345 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
@@ -51,7 +51,7 @@ public SkippableOptPFD() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
// Util.assertTrue(inpos.get()+inlength <= in.length);
inlength = inlength / BlockSize * BlockSize;
@@ -148,7 +148,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
// Util.assertTrue(inpos.get()+inlength <= in.length);
int mynvalue = num / BlockSize * BlockSize;
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
index 4ebccd1..932ce49 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
@@ -16,7 +16,7 @@
*/
public final class SkippableSimple16 implements SkippableIntegerCODEC {
- public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int out[],
IntWrapper outpos) {
int i_inpos = inpos.get();
int i_outpos = outpos.get();
@@ -130,7 +130,7 @@ public static final int decompressblock(int[] out, int outOffset, int[] in,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
int i_inpos = inpos.get();
int i_outpos = outpos.get();
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
index bca2b55..cdf061f 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
+++ b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
@@ -22,7 +22,7 @@
public final class SkippableSimple9 implements SkippableIntegerCODEC {
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int out[],
IntWrapper outpos) {
int tmpoutpos = outpos.get();
int currentPos = inpos.get();
@@ -84,7 +84,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
int currentPos = outpos.get();
int tmpinpos = inpos.get();
diff --git a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
index 550853a..ee2162d 100644
--- a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
+++ b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
@@ -17,7 +17,7 @@ public class SkippableBasicTest {
SkippableIntegerCODEC[] codecs = {
new JustCopy(),
new VariableByte(),
- new SkippableComposition(new SkippableBinaryPacking(), new VariableByte()),
+ new SkippableComposition(new BinaryPacking(), new VariableByte()),
new SkippableComposition(new SkippableNewPFD(), new VariableByte()),
new SkippableComposition(new SkippableOptPFD(), new VariableByte()),
new SkippableComposition(new SkippableFastPFOR(), new VariableByte()),
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index 60271ec..6403fa6 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -113,7 +113,7 @@ protected static int[] compress(SkippableIntegerCODEC codec, int[] data) {
int[] outBuf = new int[data.length * 4];
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
- codec.compress(data, inPos, data.length, outBuf, outPos);
+ codec.headlessCompress(data, inPos, data.length, outBuf, outPos);
return Arrays.copyOf(outBuf, outPos.get());
}
@@ -121,7 +121,7 @@ protected static int[] uncompress(SkippableIntegerCODEC codec, int[] data, int l
int[] outBuf = new int[len + 1024];
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
- codec.uncompress(data, inPos, data.length, outBuf, outPos,len);
+ codec.headlessUncompress(data, inPos, data.length, outBuf, outPos,len);
if(outPos.get() < len) throw new RuntimeException("Insufficient output.");
return Arrays.copyOf(outBuf, outPos.get());
}
From 07fc7db667826c5fb118ad5708433955104e9a5c Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 16 Sep 2014 22:12:58 -0400
Subject: [PATCH 036/266] Merging codecs so that most of them are skippable
---
.../integercompression/BinaryPacking.java | 1 -
.../lemire/integercompression/FastPFOR.java | 39 ++-
.../lemire/integercompression/JustCopy.java | 1 -
.../{skippable => }/Kamikaze.java | 33 +-
.../me/lemire/integercompression/NewPFD.java | 55 ++--
.../lemire/integercompression/NewPFDS16.java | 55 ++--
.../lemire/integercompression/NewPFDS9.java | 55 ++--
.../me/lemire/integercompression/OptPFD.java | 59 ++--
.../lemire/integercompression/OptPFDS16.java | 57 ++--
.../lemire/integercompression/OptPFDS9.java | 58 ++--
.../lemire/integercompression/Simple16.java | 36 ++-
.../me/lemire/integercompression/Simple9.java | 31 +-
.../{skippable => }/SkippableComposition.java | 5 +-
.../SkippableIntegerCODEC.java | 3 +-
.../integercompression/VariableByte.java | 2 -
.../skippable/SkippableFastPFOR.java | 298 ------------------
.../skippable/SkippableNewPFD.java | 176 -----------
.../skippable/SkippableOptPFD.java | 196 ------------
.../skippable/SkippableSimple16.java | 209 ------------
.../skippable/SkippableSimple9.java | 291 -----------------
.../lemire/integercompression/BasicTest.java | 3 +
.../SkippableBasicTest.java | 39 ++-
.../lemire/integercompression/TestUtils.java | 6 +-
23 files changed, 359 insertions(+), 1349 deletions(-)
rename src/main/java/me/lemire/integercompression/{skippable => }/Kamikaze.java (54%)
rename src/main/java/me/lemire/integercompression/{skippable => }/SkippableComposition.java (91%)
rename src/main/java/me/lemire/integercompression/{skippable => }/SkippableIntegerCODEC.java (96%)
delete mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
delete mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
delete mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
delete mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
delete mode 100644 src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
diff --git a/src/main/java/me/lemire/integercompression/BinaryPacking.java b/src/main/java/me/lemire/integercompression/BinaryPacking.java
index 820ecac..6377c25 100644
--- a/src/main/java/me/lemire/integercompression/BinaryPacking.java
+++ b/src/main/java/me/lemire/integercompression/BinaryPacking.java
@@ -6,7 +6,6 @@
*/
package me.lemire.integercompression;
-import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
/**
* Scheme based on a commonly used idea: can be extremely fast.
diff --git a/src/main/java/me/lemire/integercompression/FastPFOR.java b/src/main/java/me/lemire/integercompression/FastPFOR.java
index 2245411..0c4ddd2 100644
--- a/src/main/java/me/lemire/integercompression/FastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/FastPFOR.java
@@ -37,7 +37,7 @@
*
* @author Daniel Lemire
*/
-public final class FastPFOR implements IntegerCODEC {
+public final class FastPFOR implements IntegerCODEC,SkippableIntegerCODEC {
final static int BLOCK_SIZE = 128;
final static int OVERHEAD_OF_EACH_EXCEPT = 8;
final static int DEFAULT_PAGE_SIZE = 65536;
@@ -80,14 +80,12 @@ public FastPFOR() {
* @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
*/
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = Util.floorBy(inlength, 128);
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
- out[outpos.get()] = inlength;
- outpos.increment();
// Allocate memory for working area.
dataPointers = new int[33];
@@ -174,7 +172,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
}
- for (int k = 0; k < 128; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, tmpbestb);
tmpoutpos += tmpbestb;
@@ -217,13 +215,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
* @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
*/
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
-
- int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
dataPointers = new int[33];
@@ -269,7 +265,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
final byte b = byteContainer.get();
final byte cexcept = byteContainer.get();
- for (int k = 0; k < 128; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, b);
tmpinpos += b;
@@ -288,7 +284,26 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(inexcept);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/JustCopy.java b/src/main/java/me/lemire/integercompression/JustCopy.java
index 720d71d..709b86a 100644
--- a/src/main/java/me/lemire/integercompression/JustCopy.java
+++ b/src/main/java/me/lemire/integercompression/JustCopy.java
@@ -7,7 +7,6 @@
package me.lemire.integercompression;
-import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
/**
* @author Daniel Lemire
diff --git a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java b/src/main/java/me/lemire/integercompression/Kamikaze.java
similarity index 54%
rename from src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
rename to src/main/java/me/lemire/integercompression/Kamikaze.java
index d43d76b..9f422d8 100644
--- a/src/main/java/me/lemire/integercompression/skippable/Kamikaze.java
+++ b/src/main/java/me/lemire/integercompression/Kamikaze.java
@@ -1,6 +1,5 @@
-package me.lemire.integercompression.skippable;
+package me.lemire.integercompression;
-import me.lemire.integercompression.IntWrapper;
import com.kamikaze.pfordelta.PForDelta;
/**
@@ -12,15 +11,14 @@
* @author Matteo Catena
*
*/
-public class Kamikaze implements SkippableIntegerCODEC {
+public class Kamikaze implements SkippableIntegerCODEC, IntegerCODEC {
private int BLOCK_SIZE = 128;
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
-
- inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
if (inlength > 0) {
int[] out2 = PForDelta.compressOneBlockOpt(in, inlength);
inpos.add(inlength);
@@ -32,8 +30,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out
@Override
public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
-
- num = num / BLOCK_SIZE * BLOCK_SIZE;
+ num = Util.floorBy(num, BLOCK_SIZE);
if (num > 0) {
int d = PForDelta.decompressOneBlock(out, in, num);
inpos.add(d / 32);
@@ -45,4 +42,26 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] o
public String toString() {
return "Kamikaze's PForDelta";
}
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+
+ }
}
\ No newline at end of file
diff --git a/src/main/java/me/lemire/integercompression/NewPFD.java b/src/main/java/me/lemire/integercompression/NewPFD.java
index 9530c05..0ea6cc3 100644
--- a/src/main/java/me/lemire/integercompression/NewPFD.java
+++ b/src/main/java/me/lemire/integercompression/NewPFD.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
+
/**
* NewPFD/NewPFOR: fast patching scheme by Yan et al.
*
@@ -33,11 +34,11 @@
*
* @author Daniel Lemire
*/
-public final class NewPFD implements IntegerCODEC {
+public final class NewPFD implements IntegerCODEC,SkippableIntegerCODEC {
final int PageSize;
- final static int BlockSize = 128;
+ final static int BLOCK_SIZE = 128;
- int[] exceptbuffer = new int[2 * BlockSize];
+ int[] exceptbuffer = new int[2 * BLOCK_SIZE];
/**
* Constructor for the NewPFD CODEC.
@@ -47,14 +48,12 @@ public NewPFD() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- out[outpos.get()] = inlength;
- outpos.increment();
while (inpos.get() != finalinpos) {
int thissize = finalinpos > PageSize + inpos.get() ? PageSize
: (finalinpos - inpos.get());
@@ -71,7 +70,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
protected static void getBestBFromData(int[] in, int pos,
IntWrapper bestb, IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
+ final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
if (mini + 28 < bits[invbits[mb]])
mini = bits[invbits[mb]] - 28; // 28 is the max for
@@ -80,10 +79,10 @@ protected static void getBestBFromData(int[] in, int pos,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
+ for (int k = pos; k < BLOCK_SIZE + pos; ++k)
if ((in[k] >>> bits[i]) != 0)
++tmpcounter;
- if (tmpcounter * 10 <= BlockSize) {
+ if (tmpcounter * 10 <= BLOCK_SIZE) {
besti = i;
exceptcounter = tmpcounter;
break;
@@ -100,7 +99,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
IntWrapper bestb = new IntWrapper();
IntWrapper bestexcept = new IntWrapper();
for (final int finalinpos = tmpinpos + thissize; tmpinpos
- + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ + BLOCK_SIZE <= finalinpos; tmpinpos += BLOCK_SIZE) {
getBestBFromData(in, tmpinpos, bestb, bestexcept);
final int tmpbestb = bestb.get();
final int nbrexcept = bestexcept.get();
@@ -108,7 +107,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
final int remember = tmpoutpos;
tmpoutpos++;
if (nbrexcept > 0) {
- for (int i = 0, c = 0; i < BlockSize; ++i) {
+ for (int i = 0, c = 0; i < BLOCK_SIZE; ++i) {
if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos
@@ -122,7 +121,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
out[remember] = tmpbestb | (nbrexcept << 8)
| (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, bits[tmpbestb]);
tmpoutpos += bits[tmpbestb];
@@ -133,12 +132,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
while (outpos.get() != finalout) {
int thissize = finalout > PageSize + outpos.get() ? PageSize
@@ -152,7 +150,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpoutpos = outpos.get();
int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ for (int run = 0; run < thissize / BLOCK_SIZE; ++run, tmpoutpos += BLOCK_SIZE) {
final int b = in[tmpinpos] & 0xFF;
final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
final int exceptsize = (in[tmpinpos] >>> 16);
@@ -160,7 +158,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer,
0, 2 * cexcept);
tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, bits[b]);
tmpinpos += bits[b];
@@ -172,7 +170,26 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS16.java b/src/main/java/me/lemire/integercompression/NewPFDS16.java
index bf0b5c6..fc6599b 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS16.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
+
/**
* NewPFD/NewPFOR based on Simple16 by Yan et al.
*
@@ -32,11 +33,11 @@
*
* @author Daniel Lemire
*/
-public final class NewPFDS16 implements IntegerCODEC {
+public final class NewPFDS16 implements IntegerCODEC,SkippableIntegerCODEC {
final int PageSize;
- final static int BlockSize = 128;
+ final static int BLOCK_SIZE= 128;
- int[] exceptbuffer = new int[2 * BlockSize];
+ int[] exceptbuffer = new int[2 * BLOCK_SIZE];
/**
* Constructor for the NewPFDS16 CODEC.
@@ -46,14 +47,12 @@ public NewPFDS16() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- out[outpos.get()] = inlength;
- outpos.increment();
while (inpos.get() != finalinpos) {
int thissize = finalinpos > PageSize + inpos.get() ? PageSize
: (finalinpos - inpos.get());
@@ -70,7 +69,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
protected static void getBestBFromData(int[] in, int pos,
IntWrapper bestb, IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
+ final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
if (mini + 28 < bits[invbits[mb]])
mini = bits[invbits[mb]] - 28; // 28 is the max for
@@ -79,10 +78,10 @@ protected static void getBestBFromData(int[] in, int pos,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
+ for (int k = pos; k < BLOCK_SIZE + pos; ++k)
if ((in[k] >>> bits[i]) != 0)
++tmpcounter;
- if (tmpcounter * 10 <= BlockSize) {
+ if (tmpcounter * 10 <= BLOCK_SIZE) {
besti = i;
exceptcounter = tmpcounter;
break;
@@ -99,7 +98,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
IntWrapper bestb = new IntWrapper();
IntWrapper bestexcept = new IntWrapper();
for (final int finalinpos = tmpinpos + thissize; tmpinpos
- + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ + BLOCK_SIZE <= finalinpos; tmpinpos += BLOCK_SIZE) {
getBestBFromData(in, tmpinpos, bestb, bestexcept);
final int tmpbestb = bestb.get();
final int nbrexcept = bestexcept.get();
@@ -107,7 +106,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
final int remember = tmpoutpos;
tmpoutpos++;
if (nbrexcept > 0) {
- for (int i = 0, c = 0; i < BlockSize; ++i) {
+ for (int i = 0, c = 0; i < BLOCK_SIZE; ++i) {
if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos
@@ -121,7 +120,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
out[remember] = tmpbestb | (nbrexcept << 8)
| (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, bits[tmpbestb]);
tmpoutpos += bits[tmpbestb];
@@ -132,12 +131,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- final int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
int finalout = outpos.get() + mynvalue;
while (outpos.get() != finalout) {
int thissize = finalout > PageSize + outpos.get() ? PageSize
@@ -151,7 +149,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpoutpos = outpos.get();
int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ for (int run = 0; run < thissize / BLOCK_SIZE; ++run, tmpoutpos += BLOCK_SIZE) {
final int b = in[tmpinpos] & 0xFF;
final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
final int exceptsize = (in[tmpinpos] >>> 16);
@@ -159,7 +157,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer,
0, 2 * cexcept);
tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, bits[b]);
tmpinpos += bits[b];
@@ -171,7 +169,26 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS9.java b/src/main/java/me/lemire/integercompression/NewPFDS9.java
index ee671ef..7a15ed4 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS9.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
+
/**
* NewPFD/NewPFOR based on Simple9 by Yan et al.
*
@@ -31,11 +32,11 @@
*
* @author Daniel Lemire
*/
-public final class NewPFDS9 implements IntegerCODEC {
+public final class NewPFDS9 implements IntegerCODEC,SkippableIntegerCODEC {
final int PageSize;
- final static int BlockSize = 128;
+ final static int BLOCK_SIZE = 128;
- int[] exceptbuffer = new int[2 * BlockSize];
+ int[] exceptbuffer = new int[2 * BLOCK_SIZE];
/**
* Constructor for the NewPFDS9 CODEC.
@@ -45,14 +46,12 @@ public NewPFDS9() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- out[outpos.get()] = inlength;
- outpos.increment();
while (inpos.get() != finalinpos) {
int thissize = finalinpos > PageSize + inpos.get() ? PageSize
: (finalinpos - inpos.get());
@@ -69,7 +68,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
protected static void getBestBFromData(int[] in, int pos,
IntWrapper bestb, IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
+ final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
if (mini + 28 < bits[invbits[mb]])
mini = bits[invbits[mb]] - 28; // 28 is the max for
@@ -78,10 +77,10 @@ protected static void getBestBFromData(int[] in, int pos,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
+ for (int k = pos; k < BLOCK_SIZE + pos; ++k)
if ((in[k] >>> bits[i]) != 0)
++tmpcounter;
- if (tmpcounter * 10 <= BlockSize) {
+ if (tmpcounter * 10 <= BLOCK_SIZE) {
besti = i;
exceptcounter = tmpcounter;
break;
@@ -98,7 +97,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
IntWrapper bestb = new IntWrapper();
IntWrapper bestexcept = new IntWrapper();
for (final int finalinpos = tmpinpos + thissize; tmpinpos
- + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ + BLOCK_SIZE <= finalinpos; tmpinpos += BLOCK_SIZE) {
getBestBFromData(in, tmpinpos, bestb, bestexcept);
final int tmpbestb = bestb.get();
final int nbrexcept = bestexcept.get();
@@ -106,7 +105,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
final int remember = tmpoutpos;
tmpoutpos++;
if (nbrexcept > 0) {
- for (int i = 0, c = 0; i < BlockSize; ++i) {
+ for (int i = 0, c = 0; i < BLOCK_SIZE; ++i) {
if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos
@@ -120,7 +119,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
out[remember] = tmpbestb | (nbrexcept << 8)
| (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, bits[tmpbestb]);
tmpoutpos += bits[tmpbestb];
@@ -131,12 +130,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- final int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
int finalout = outpos.get() + mynvalue;
while (outpos.get() != finalout) {
int thissize = finalout > PageSize + outpos.get() ? PageSize
@@ -150,7 +148,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpoutpos = outpos.get();
int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ for (int run = 0; run < thissize / BLOCK_SIZE; ++run, tmpoutpos += BLOCK_SIZE) {
final int b = in[tmpinpos] & 0xFF;
final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
final int exceptsize = (in[tmpinpos] >>> 16);
@@ -158,7 +156,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
S9.uncompress(in, tmpinpos, exceptsize, exceptbuffer,
0, 2 * cexcept);
tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, bits[b]);
tmpinpos += bits[b];
@@ -170,7 +168,26 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/OptPFD.java b/src/main/java/me/lemire/integercompression/OptPFD.java
index 2395c3f..051b11f 100644
--- a/src/main/java/me/lemire/integercompression/OptPFD.java
+++ b/src/main/java/me/lemire/integercompression/OptPFD.java
@@ -6,6 +6,7 @@
*/
package me.lemire.integercompression;
+
/**
* OptPFD: fast patching scheme by Yan et al.
*
@@ -31,12 +32,12 @@
*
* @author Daniel Lemire
*/
-public final class OptPFD implements IntegerCODEC {
+public final class OptPFD implements IntegerCODEC,SkippableIntegerCODEC {
final int PageSize;
- final static int BlockSize = 128;
+ final static int BLOCK_SIZE = 128;
- int[] exceptbuffer = new int[2 * BlockSize];
- int[] sillybuffer = new int[2 * BlockSize];
+ int[] exceptbuffer = new int[2 * BLOCK_SIZE];
+ int[] sillybuffer = new int[2 * BLOCK_SIZE];
/**
* Constructor for the OptPFD CODEC.
@@ -46,14 +47,12 @@ public OptPFD() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- out[outpos.get()] = inlength;
- outpos.increment();
while (inpos.get() != finalinpos) {
int thissize = finalinpos > PageSize + inpos.get() ? PageSize
: (finalinpos - inpos.get());
@@ -70,7 +69,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
void getBestBFromData(int[] in, int pos, IntWrapper bestb,
IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
+ final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
if (mini + 28 < bits[invbits[mb]])
mini = bits[invbits[mb]] - 28; // 28 is the max for
@@ -80,13 +79,13 @@ void getBestBFromData(int[] in, int pos, IntWrapper bestb,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
+ for (int k = pos; k < BLOCK_SIZE + pos; ++k)
if ((in[k] >>> bits[i]) != 0) {
++tmpcounter;
}
- if (tmpcounter == BlockSize)
+ if (tmpcounter == BLOCK_SIZE)
continue; // no need
- for (int k = pos, c = 0; k < pos + BlockSize; ++k)
+ for (int k = pos, c = 0; k < pos + BLOCK_SIZE; ++k)
if ((in[k] >>> bits[i]) != 0) {
exceptbuffer[tmpcounter + c] = k - pos;
exceptbuffer[c] = in[k] >>> bits[i];
@@ -115,7 +114,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
IntWrapper bestb = new IntWrapper();
IntWrapper bestexcept = new IntWrapper();
for (final int finalinpos = tmpinpos + thissize; tmpinpos
- + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ + BLOCK_SIZE <= finalinpos; tmpinpos += BLOCK_SIZE) {
getBestBFromData(in, tmpinpos, bestb, bestexcept);
final int tmpbestb = bestb.get();
final int nbrexcept = bestexcept.get();
@@ -124,7 +123,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
tmpoutpos++;
if (nbrexcept > 0) {
int c = 0;
- for (int i = 0; i < BlockSize; ++i) {
+ for (int i = 0; i < BLOCK_SIZE; ++i) {
if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos
@@ -138,7 +137,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
out[remember] = tmpbestb | (nbrexcept << 8)
| (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, bits[tmpbestb]);
tmpoutpos += bits[tmpbestb];
@@ -149,12 +148,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- final int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
while (outpos.get() != finalout) {
int thissize = finalout > PageSize + outpos.get() ? PageSize
@@ -168,7 +166,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpoutpos = outpos.get();
int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ for (int run = 0; run < thissize / BLOCK_SIZE; ++run, tmpoutpos += BLOCK_SIZE) {
final int b = in[tmpinpos] & 0xFF;
final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
final int exceptsize = (in[tmpinpos] >>> 16);
@@ -176,7 +174,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer,
0, 2 * cexcept);
tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, bits[b]);
tmpinpos += bits[b];
@@ -188,7 +186,26 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS16.java b/src/main/java/me/lemire/integercompression/OptPFDS16.java
index 3f6a6cc..8355a59 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS16.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
+
/**
* OptPFD based on Simple16 by Yan et al.
*
@@ -31,10 +32,10 @@
*
* @author Daniel Lemire
*/
-public final class OptPFDS16 implements IntegerCODEC {
+public final class OptPFDS16 implements IntegerCODEC,SkippableIntegerCODEC {
final int PageSize;
- final static int BlockSize = 128;
- int[] exceptbuffer = new int[2 * BlockSize];
+ final static int BLOCK_SIZE = 128;
+ int[] exceptbuffer = new int[2 * BLOCK_SIZE];
/**
* Constructor for the OptPFDS16 CODEC.
@@ -44,15 +45,13 @@ public OptPFDS16() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- out[outpos.get()] = inlength;
- outpos.increment();
while (inpos.get() != finalinpos) {
int thissize = finalinpos > PageSize + inpos.get() ? PageSize
: (finalinpos - inpos.get());
@@ -69,7 +68,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
protected void getBestBFromData(int[] in, int pos, IntWrapper bestb,
IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
+ final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
if (mini + 28 < bits[invbits[mb]])
mini = bits[invbits[mb]] - 28; // 28 is the max for
@@ -79,13 +78,13 @@ protected void getBestBFromData(int[] in, int pos, IntWrapper bestb,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
+ for (int k = pos; k < BLOCK_SIZE + pos; ++k)
if ((in[k] >>> bits[i]) != 0) {
++tmpcounter;
}
- if (tmpcounter == BlockSize)
+ if (tmpcounter == BLOCK_SIZE)
continue; // no need
- for (int k = pos, c = 0; k < pos + BlockSize; ++k)
+ for (int k = pos, c = 0; k < pos + BLOCK_SIZE; ++k)
if ((in[k] >>> bits[i]) != 0) {
exceptbuffer[tmpcounter + c] = k - pos;
exceptbuffer[c] = in[k] >>> bits[i];
@@ -113,7 +112,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
IntWrapper bestb = new IntWrapper();
IntWrapper bestexcept = new IntWrapper();
for (final int finalinpos = tmpinpos + thissize; tmpinpos
- + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ + BLOCK_SIZE <= finalinpos; tmpinpos += BLOCK_SIZE) {
getBestBFromData(in, tmpinpos, bestb, bestexcept);
final int tmpbestb = bestb.get();
final int nbrexcept = bestexcept.get();
@@ -122,7 +121,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
tmpoutpos++;
if (nbrexcept > 0) {
int c = 0;
- for (int i = 0; i < BlockSize; ++i) {
+ for (int i = 0; i < BLOCK_SIZE; ++i) {
if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos
@@ -136,7 +135,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
out[remember] = tmpbestb | (nbrexcept << 8)
| (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, bits[tmpbestb]);
tmpoutpos += bits[tmpbestb];
@@ -147,12 +146,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- final int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
while (outpos.get() != finalout) {
int thissize = finalout > PageSize + outpos.get() ? PageSize
@@ -166,7 +164,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpoutpos = outpos.get();
int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ for (int run = 0; run < thissize / BLOCK_SIZE; ++run, tmpoutpos += BLOCK_SIZE) {
final int b = in[tmpinpos] & 0xFF;
final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
final int exceptsize = (in[tmpinpos] >>> 16);
@@ -174,7 +172,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer,
0, 2 * cexcept);
tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, bits[b]);
tmpinpos += bits[b];
@@ -186,7 +184,26 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS9.java b/src/main/java/me/lemire/integercompression/OptPFDS9.java
index 75cf4be..6b890aa 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS9.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
+
/**
* OptPFD based on Simple9 by Yan et al.
*
@@ -31,10 +32,10 @@
*
* @author Daniel Lemire
*/
-public final class OptPFDS9 implements IntegerCODEC {
+public final class OptPFDS9 implements IntegerCODEC, SkippableIntegerCODEC {
final int PageSize;
- final static int BlockSize = 128;
- int[] exceptbuffer = new int[2 * BlockSize];
+ final static int BLOCK_SIZE = 128;
+ int[] exceptbuffer = new int[2 * BLOCK_SIZE];
/**
* Constructor for the OptPFDS9 CODEC.
@@ -44,15 +45,13 @@ public OptPFDS9() {
}
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- out[outpos.get()] = inlength;
- outpos.increment();
while (inpos.get() != finalinpos) {
int thissize = finalinpos > PageSize + inpos.get() ? PageSize
: (finalinpos - inpos.get());
@@ -69,7 +68,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
protected void getBestBFromData(int[] in, int pos, IntWrapper bestb,
IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
+ final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
if (mini + 28 < bits[invbits[mb]])
mini = bits[invbits[mb]] - 28; // 28 is the max for
@@ -79,13 +78,13 @@ protected void getBestBFromData(int[] in, int pos, IntWrapper bestb,
int exceptcounter = 0;
for (int i = mini; i < bits.length - 1; ++i) {
int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
+ for (int k = pos; k < BLOCK_SIZE + pos; ++k)
if ((in[k] >>> bits[i]) != 0) {
++tmpcounter;
}
- if (tmpcounter == BlockSize)
+ if (tmpcounter == BLOCK_SIZE)
continue; // no need
- for (int k = pos, c = 0; k < pos + BlockSize; ++k)
+ for (int k = pos, c = 0; k < pos + BLOCK_SIZE; ++k)
if ((in[k] >>> bits[i]) != 0) {
exceptbuffer[tmpcounter + c] = k - pos;
exceptbuffer[c] = in[k] >>> bits[i];
@@ -113,7 +112,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
IntWrapper bestb = new IntWrapper();
IntWrapper bestexcept = new IntWrapper();
for (final int finalinpos = tmpinpos + thissize; tmpinpos
- + BlockSize <= finalinpos; tmpinpos += BlockSize) {
+ + BLOCK_SIZE <= finalinpos; tmpinpos += BLOCK_SIZE) {
getBestBFromData(in, tmpinpos, bestb, bestexcept);
final int tmpbestb = bestb.get();
final int nbrexcept = bestexcept.get();
@@ -122,7 +121,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
tmpoutpos++;
if (nbrexcept > 0) {
int c = 0;
- for (int i = 0; i < BlockSize; ++i) {
+ for (int i = 0; i < BLOCK_SIZE; ++i) {
if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
exceptbuffer[c + nbrexcept] = i;
exceptbuffer[c] = in[tmpinpos
@@ -136,7 +135,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
out[remember] = tmpbestb | (nbrexcept << 8)
| (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastpack(in, tmpinpos + k, out,
tmpoutpos, bits[tmpbestb]);
tmpoutpos += bits[tmpbestb];
@@ -147,12 +146,11 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- final int mynvalue = in[inpos.get()];
- inpos.increment();
+ mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
while (outpos.get() != finalout) {
int thissize = finalout > PageSize + outpos.get() ? PageSize
@@ -166,7 +164,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpoutpos = outpos.get();
int tmpinpos = inpos.get();
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
+ for (int run = 0; run < thissize / BLOCK_SIZE; ++run, tmpoutpos += BLOCK_SIZE) {
final int b = in[tmpinpos] & 0xFF;
final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
final int exceptsize = (in[tmpinpos] >>> 16);
@@ -174,7 +172,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
S9.uncompress(in, tmpinpos, exceptsize, exceptbuffer,
0, 2 * cexcept);
tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, bits[b]);
tmpinpos += bits[b];
@@ -186,7 +184,27 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
outpos.set(tmpoutpos);
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
+
@Override
public String toString() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/me/lemire/integercompression/Simple16.java b/src/main/java/me/lemire/integercompression/Simple16.java
index 5b6098e..9562c3a 100644
--- a/src/main/java/me/lemire/integercompression/Simple16.java
+++ b/src/main/java/me/lemire/integercompression/Simple16.java
@@ -2,6 +2,7 @@
+
/**
* This is an implementation of the popular Simple16 scheme. It is limited to
* 28-bit integers (between 0 and 2^28-1).
@@ -13,13 +14,12 @@
* Adapted by D. Lemire from the Apache Lucene project.
*
*/
-public final class Simple16 implements IntegerCODEC {
+public final class Simple16 implements IntegerCODEC,SkippableIntegerCODEC {
- public void compress(int[] in, IntWrapper inpos, int inlength, int out[],
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int out[],
IntWrapper outpos) {
int i_inpos = inpos.get();
int i_outpos = outpos.get();
- out[i_outpos++] = inlength;
final int finalin = i_inpos + inlength;
while (i_inpos < finalin) {
int inoffset = compressblock(out, i_outpos++, in, i_inpos, inlength);
@@ -100,10 +100,9 @@ public static final int decompressblock(int[] out, int outOffset, int[] in,
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos,int num) {
int i_inpos = inpos.get();
- int num = in[i_inpos++];
int i_outpos = outpos.get();
while (num > 0) {
final int howmany = decompressblock(out, i_outpos, in, i_inpos, num);
@@ -156,6 +155,31 @@ private static int[][] shiftme(int[][] x) {
}
return answer;
}
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+
+ }
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
private static final int S16_NUMSIZE = 16;
private static final int S16_BITSSIZE = 28;
diff --git a/src/main/java/me/lemire/integercompression/Simple9.java b/src/main/java/me/lemire/integercompression/Simple9.java
index 073521c..5703b04 100644
--- a/src/main/java/me/lemire/integercompression/Simple9.java
+++ b/src/main/java/me/lemire/integercompression/Simple9.java
@@ -7,6 +7,7 @@
package me.lemire.integercompression;
+
/**
* This is an implementation of the popular Simple9 scheme.
* It is limited to 28-bit integers (between 0 and 2^28-1).
@@ -17,13 +18,12 @@
* @author Daniel Lemire
*
*/
-public final class Simple9 implements IntegerCODEC {
+public final class Simple9 implements IntegerCODEC, SkippableIntegerCODEC {
@Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int out[], IntWrapper outpos) {
int tmpoutpos = outpos.get();
int currentPos = inpos.get();
- out[tmpoutpos++] = inlength;
final int finalin = currentPos + inlength;
outer: while (currentPos < finalin - 28) {
mainloop: for (int selector = 0; selector < 8; selector++) {
@@ -81,11 +81,11 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
}
@Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int outlength) {
int currentPos = outpos.get();
int tmpinpos = inpos.get();
- final int finalout = currentPos + in[tmpinpos++];
+ final int finalout = currentPos + outlength;
while (currentPos < finalout - 28) {
int val = in[tmpinpos++];
int header = val >>> 28;
@@ -282,7 +282,26 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
inpos.set(tmpinpos);
}
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+
+ }
private final static int bitLength[] = { 1, 2, 3, 4, 5, 7, 9, 14, 28 };
private final static int codeNum[] = { 28, 14, 9, 7, 5, 4, 3, 2, 1 };
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java b/src/main/java/me/lemire/integercompression/SkippableComposition.java
similarity index 91%
rename from src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
rename to src/main/java/me/lemire/integercompression/SkippableComposition.java
index 45d0ee1..ed0f0de 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableComposition.java
+++ b/src/main/java/me/lemire/integercompression/SkippableComposition.java
@@ -4,9 +4,8 @@
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression.skippable;
+package me.lemire.integercompression;
-import me.lemire.integercompression.*;
/**
* Helper class to compose schemes.
@@ -56,7 +55,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] o
@Override
public String toString() {
- return F1.getClass().getName() + "+" + F2.getClass().getName();
+ return F1.toString() + "+" + F2.toString();
}
}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java b/src/main/java/me/lemire/integercompression/SkippableIntegerCODEC.java
similarity index 96%
rename from src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
rename to src/main/java/me/lemire/integercompression/SkippableIntegerCODEC.java
index 50594c3..c10d2f0 100644
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableIntegerCODEC.java
+++ b/src/main/java/me/lemire/integercompression/SkippableIntegerCODEC.java
@@ -5,9 +5,8 @@
* (c) Daniel Lemire, http://lemire.me/en/
*/
-package me.lemire.integercompression.skippable;
+package me.lemire.integercompression;
-import me.lemire.integercompression.*;
/**
* Interface describing a standard CODEC to compress integers. This is a
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 69148bd..73719e9 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -10,8 +10,6 @@
import java.nio.ByteOrder;
import java.nio.IntBuffer;
-import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
-
/**
* Implementation of variable-byte. For best performance, use it using the
* ByteIntegerCODEC interface.
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java b/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
deleted file mode 100644
index 419aba9..0000000
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableFastPFOR.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/**
- * This is code is released under the
- * Apache License Version 2.0 http://www.apache.org/licenses/.
- *
- * (c) Daniel Lemire, http://lemire.me/en/
- */
-package me.lemire.integercompression.skippable;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import me.lemire.integercompression.*;
-
-/**
- * This is a patching scheme designed for speed. It encodes integers in blocks
- * of 128 integers within pages of up to 65536 integers. Note that it is
- * important, to get good compression and good performance, to use sizeable
- * blocks (greater than 1024 integers). For arrays containing a number of
- * integers that is not divisible by 128, you should use it in conjunction with
- * another CODEC:
- *
- * IntegerCODEC ic = new Composition(new FastPFOR(), new VariableByte()).
- *
- * For details, please see
- *
- *
- * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
- * through vectorization Software: Practice & Experience http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract http://arxiv.org/abs/1209.2137
- *
- *
- * For sufficiently compressible and long arrays, it is faster and better than
- * other PFOR schemes.
- *
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, use IntegratedFastPFOR instead.
- *
- * For multi-threaded applications, each thread should use its own FastPFOR
- * object.
- *
- * @author Daniel Lemire
- */
-public final class SkippableFastPFOR implements SkippableIntegerCODEC {
- final static int BLOCK_SIZE = 128;
- final static int OVERHEAD_OF_EACH_EXCEPT = 8;
- final static int DEFAULT_PAGE_SIZE = 65536;
-
- int pageSize;
- final int[][] dataTobePacked = new int[33][];
- final ByteBuffer byteContainer;
-
- // Working area for compress and uncompress.
- int[] dataPointers;
- int[] freqs;
- byte[] bestbbestcexceptmaxb;
-
- /**
- * Construct the FastPFOR CODEC.
- *
- * @param pagesize
- * the desired page size (for expert use)
- */
- public SkippableFastPFOR(int pagesize) {
- pageSize = pagesize;
- // Initiate arrrays.
- byteContainer = ByteBuffer.allocateDirect(3 * pageSize
- / BLOCK_SIZE + pageSize);
- for (int k = 1; k < dataTobePacked.length; ++k)
- dataTobePacked[k] = new int[pageSize / 32 * 4]; // heuristic
- }
-
- /**
- * Construct the fastPFOR CODEC with default parameters.
- */
- public SkippableFastPFOR() {
- this(DEFAULT_PAGE_SIZE);
- }
-
- /**
- * Compress data in blocks of 128 integers (if fewer than 128 integers
- * are provided, nothing is done).
- *
- * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
- */
- @Override
- public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos) {
- inlength = Util.floorBy(inlength, 128);
- if (inlength == 0)
- return;
-
- // Allocate memory for working area.
- dataPointers = new int[33];
- freqs = new int[33];
- bestbbestcexceptmaxb = new byte[3];
-
- final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = Math.min(pageSize,
- finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
- dataPointers = null;
- freqs = null;
- bestbbestcexceptmaxb = null;
- }
-
- private void getBestBFromData(int[] in, int pos) {
- Arrays.fill(freqs, 0);
- for (int k = pos, k_end = pos + BLOCK_SIZE; k < k_end; ++k) {
- freqs[Util.bits(in[k])]++;
- }
- bestbbestcexceptmaxb[0] = 32;
- while (freqs[bestbbestcexceptmaxb[0]] == 0)
- bestbbestcexceptmaxb[0]--;
- bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
- int bestcost = bestbbestcexceptmaxb[0] * BLOCK_SIZE;
- byte cexcept = 0;
- bestbbestcexceptmaxb[1] = cexcept;
- for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
- cexcept += freqs[b + 1];
- if (cexcept < 0)
- break;
- // the extra 8 is the cost of storing maxbits
- int thiscost = cexcept * OVERHEAD_OF_EACH_EXCEPT
- + cexcept * (bestbbestcexceptmaxb[2] - b) + b
- * BLOCK_SIZE + 8;
- if (thiscost < bestcost) {
- bestcost = thiscost;
- bestbbestcexceptmaxb[0] = (byte) b;
- bestbbestcexceptmaxb[1] = cexcept;
- }
- }
- }
-
- private void encodePage(int[] in, IntWrapper inpos, int thissize,
- int[] out, IntWrapper outpos) {
- final int headerpos = outpos.get();
- outpos.increment();
- int tmpoutpos = outpos.get();
-
- // Clear working area.
- Arrays.fill(dataPointers, 0);
- // Arrays.fill(bestbbestcexceptmaxb, (byte)0);//DL:unncessary
- byteContainer.clear();
-
- int tmpinpos = inpos.get();
- for (final int finalinpos = tmpinpos + thissize - BLOCK_SIZE; tmpinpos <= finalinpos; tmpinpos += BLOCK_SIZE) {
- getBestBFromData(in, tmpinpos);
- final int tmpbestb = bestbbestcexceptmaxb[0];
- byteContainer.put(bestbbestcexceptmaxb[0]);
- byteContainer.put(bestbbestcexceptmaxb[1]);
- if (bestbbestcexceptmaxb[1] > 0) {
- byteContainer.put(bestbbestcexceptmaxb[2]);
- final int index = bestbbestcexceptmaxb[2]
- - bestbbestcexceptmaxb[0];
- if (dataPointers[index]
- + bestbbestcexceptmaxb[1] >= dataTobePacked[index].length) {
- int newsize = 2 * (dataPointers[index] + bestbbestcexceptmaxb[1]);
- // make sure it is a multiple of 32
- newsize = Util
- .floorBy(newsize + 31, 32);
- dataTobePacked[index] = Arrays.copyOf(
- dataTobePacked[index], newsize);
- }
- for (int k = 0; k < BLOCK_SIZE; ++k) {
- if ((in[k + tmpinpos] >>> bestbbestcexceptmaxb[0]) != 0) {
- // we have an exception
- byteContainer.put((byte) k);
- dataTobePacked[index][dataPointers[index]++] = in[k
- + tmpinpos] >>> tmpbestb;
- }
- }
-
- }
- for (int k = 0; k < 128; k += 32) {
- BitPacking.fastpack(in, tmpinpos + k, out,
- tmpoutpos, tmpbestb);
- tmpoutpos += tmpbestb;
- }
- }
- inpos.set(tmpinpos);
- out[headerpos] = tmpoutpos - headerpos;
- final int bytesize = byteContainer.position();
- while ((byteContainer.position() & 3) != 0)
- byteContainer.put((byte) 0);
- out[tmpoutpos++] = bytesize;
- final int howmanyints = byteContainer.position() / 4;
- byteContainer.flip();
- byteContainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
- tmpoutpos += howmanyints;
- int bitmap = 0;
- for (int k = 1; k <= 32; ++k) {
- if (dataPointers[k] != 0)
- bitmap |= (1 << (k - 1));
- }
- out[tmpoutpos++] = bitmap;
- for (int k = 1; k <= 32; ++k) {
- if (dataPointers[k] != 0) {
- out[tmpoutpos++] = dataPointers[k];// size
- for (int j = 0; j < dataPointers[k]; j += 32) {
- BitPacking.fastpack(dataTobePacked[k],
- j, out, tmpoutpos, k);
- tmpoutpos += k;
- }
- }
- }
- outpos.set(tmpoutpos);
- }
-
- /**
- * Uncompress data in blocks of 128 integers. In this particular case,
- * the inlength parameter is ignored: it is deduced from the compressed
- * data.
- *
- * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
- */
- @Override
- public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos, int num) {
- if (inlength == 0)
- return;
-
- int mynvalue = num / BLOCK_SIZE * BLOCK_SIZE;
-
- dataPointers = new int[33];
-
- int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = Math.min(pageSize,
- finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
-
- dataPointers = null;
- }
-
- private void decodePage(int[] in, IntWrapper inpos, int[] out,
- IntWrapper outpos, int thissize) {
- final int initpos = inpos.get();
- final int wheremeta = in[inpos.get()];
- inpos.increment();
- int inexcept = initpos + wheremeta;
- final int bytesize = in[inexcept++];
- byteContainer.clear();
- byteContainer.asIntBuffer().put(in, inexcept, (bytesize + 3) / 4);
- inexcept += (bytesize + 3)/ 4;
-
- final int bitmap = in[inexcept++];
- for (int k = 1; k <= 32; ++k) {
- if ((bitmap & (1 << (k - 1))) != 0) {
- int size = in[inexcept++];
- if (dataTobePacked[k].length < size)
- dataTobePacked[k] = new int[Util
- .floorBy(size + 31, 32)];
- for (int j = 0; j < size; j += 32) {
- BitPacking.fastunpack(in, inexcept,
- dataTobePacked[k], j, k);
- inexcept += k;
- }
- }
- }
- Arrays.fill(dataPointers, 0);
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
-
- for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
- final byte b = byteContainer.get();
- final byte cexcept = byteContainer.get();
- for (int k = 0; k < 128; k += 32) {
- BitPacking.fastunpack(in, tmpinpos, out,
- tmpoutpos + k, b);
- tmpinpos += b;
- }
- if (cexcept > 0) {
- final byte maxbits = byteContainer.get();
- final int index = maxbits - b;
- for (int k = 0; k < cexcept; ++k) {
- final byte pos = byteContainer.get();
- final int exceptvalue = dataTobePacked[index][dataPointers[index]++];
- out[pos + tmpoutpos] |= exceptvalue << b;
- }
-
- }
- }
- outpos.set(tmpoutpos);
- inpos.set(inexcept);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
deleted file mode 100644
index b3a7af8..0000000
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableNewPFD.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * This is code is released under the
- * Apache License Version 2.0 http://www.apache.org/licenses/.
- *
- * (c) Daniel Lemire, http://lemire.me/en/
- */
-
-package me.lemire.integercompression.skippable;
-
-import me.lemire.integercompression.*;
-
-/**
- * NewPFD/NewPFOR: fast patching scheme by Yan et al.
- *
- * Follows:
- *
- *
- * H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
- * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
- *
- * using Simple16 as the secondary coder.
- *
- * It encodes integers in blocks of 128 integers. For arrays containing an
- * arbitrary number of integers, you should use it in conjunction with another
- * CODEC:
- *
- *
- * IntegerCODEC ic =
- * new Composition(new NewPDF(), new VariableByte()).
- *
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, you must compute the deltas separately. (Yes, this is true even though
- * the "D" at the end of the name probably stands for delta.)
- *
- * For multi-threaded applications, each thread should use its own NewPFD
- * object.
- *
- * @author Daniel Lemire
- */
-public final class SkippableNewPFD implements SkippableIntegerCODEC {
- final int PageSize;
- final static int BlockSize = 128;
-
- int[] exceptbuffer = new int[2 * BlockSize];
-
- /**
- * Constructor for the NewPFD CODEC.
- */
- public SkippableNewPFD() {
- PageSize = 65536;
- }
-
- @Override
- public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos) {
- inlength = inlength / BlockSize * BlockSize;
-
- final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
- }
-
- private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 16, 20, 32 };
- private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16 };
-
- private static void getBestBFromData(int[] in, int pos, IntWrapper bestb,
- IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
- int mini = 0;
- if (mini + 28 < bits[invbits[mb]])
- mini = bits[invbits[mb]] - 28; // 28 is the max for exceptions
- int besti = bits.length - 1;
- int exceptcounter = 0;
- for (int i = mini; i < bits.length - 1; ++i) {
- int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
- if ((in[k] >>> bits[i]) != 0)
- ++tmpcounter;
- if (tmpcounter * 10 <= BlockSize) {
- besti = i;
- exceptcounter = tmpcounter;
- break;
- }
- }
- bestb.set(besti);
- bestexcept.set(exceptcounter);
- }
-
- private void encodePage(int[] in, IntWrapper inpos, int thissize,
- int[] out, IntWrapper outpos) {
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
- IntWrapper bestb = new IntWrapper();
- IntWrapper bestexcept = new IntWrapper();
- for (final int finalinpos = tmpinpos + thissize; tmpinpos + BlockSize <= finalinpos; tmpinpos += BlockSize) {
- getBestBFromData(in, tmpinpos, bestb, bestexcept);
- int tmpbestb = bestb.get();
- int nbrexcept = bestexcept.get();
- int exceptsize = 0;
- int remember = tmpoutpos;
- tmpoutpos++;
- if (nbrexcept > 0) {
- for (int i = 0, c = 0; i < BlockSize; ++i) {
- if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
- exceptbuffer[c + nbrexcept] = i;
- exceptbuffer[c] = in[tmpinpos + i] >>> bits[tmpbestb];
- ++c;
- }
- }
- exceptsize = S16.compress(exceptbuffer, 0, 2 * nbrexcept, out,
- tmpoutpos);
- tmpoutpos += exceptsize;
- }
- out[remember] = tmpbestb | (nbrexcept << 8) | (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
- BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos,
- bits[tmpbestb]);
- tmpoutpos += bits[tmpbestb];
- }
- }
- inpos.set(tmpinpos);
- outpos.set(tmpoutpos);
- }
-
- @Override
- public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos, int num) {
- int mynvalue = num / BlockSize * BlockSize;
- int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
- }
-
- private void decodePage(int[] in, IntWrapper inpos, int[] out,
- IntWrapper outpos, int thissize) {
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
-
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
- final int b = in[tmpinpos] & 0xFF;
- final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
- final int exceptsize = (in[tmpinpos] >>> 16);
- ++tmpinpos;
- S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer, 0,
- 2 * cexcept);
- tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
- BitPacking
- .fastunpack(in, tmpinpos, out, tmpoutpos + k, bits[b]);
- tmpinpos += bits[b];
- }
- for (int k = 0; k < cexcept; ++k) {
- out[tmpoutpos + exceptbuffer[k + cexcept]] |= (exceptbuffer[k] << bits[b]);
- }
- }
- outpos.set(tmpoutpos);
- inpos.set(tmpinpos);
- }
-
- @Override
- public String toString() {
- return this.getClass().getName();
- }
-
-}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java b/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
deleted file mode 100644
index 1807345..0000000
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableOptPFD.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * This is code is released under the
- * Apache License Version 2.0 http://www.apache.org/licenses/.
- *
- * (c) Daniel Lemire, http://lemire.me/en/
- */
-package me.lemire.integercompression.skippable;
-
-import me.lemire.integercompression.*;
-
-/**
- * OptPFD: fast patching scheme by Yan et al.
- *
- * Follows:
- *
- *
- * H. Yan, S. Ding, T. Suel, Inverted index compression and query processing
- * with optimized document ordering, in: WWW 09, 2009, pp. 401-410.
- *
- * using Simple16 as the secondary coder.
- *
- * It encodes integers in blocks of 128 integers. For arrays containing an
- * arbitrary number of integers, you should use it in conjunction with another
- * CODEC:
- *
- *
- * IntegerCODEC ic = new Composition(new OptPFD(), new VariableByte()).
- *
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, you must compute the deltas separately. (Yes, this is true even though
- * the "D" at the end of the name probably stands for delta.)
- *
- * For multi-threaded applications, each thread should use its own OptPFD
- * object.
- *
- * @author Daniel Lemire
- */
-public final class SkippableOptPFD implements SkippableIntegerCODEC {
- final int PageSize;
- final static int BlockSize = 128;
-
- int[] exceptbuffer = new int[2 * BlockSize];
- int[] sillybuffer = new int[2 * BlockSize];
-
- /**
- *
- */
- public SkippableOptPFD() {
- PageSize = 65536;
- }
-
- @Override
- public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos) {
- // Util.assertTrue(inpos.get()+inlength <= in.length);
- inlength = inlength / BlockSize * BlockSize;
-
- final int finalinpos = inpos.get() + inlength;
- // out[outpos.get()] = inlength;
- // outpos.increment();
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
- }
-
- private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 16, 20, 32 };
- private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16 };
-
- void getBestBFromData(int[] in, int pos, IntWrapper bestb,
- IntWrapper bestexcept) {
- final int mb = Util.maxbits(in, pos, BlockSize);
- int mini = 0;
- if (mini + 28 < bits[invbits[mb]])
- mini = bits[invbits[mb]] - 28; // 28 is the max for exceptions
- int besti = bits.length - 1;
- int bestcost = bits[besti] * 4;
- int exceptcounter = 0;
- for (int i = mini; i < bits.length - 1; ++i) {
- int tmpcounter = 0;
- for (int k = pos; k < BlockSize + pos; ++k)
- if ((in[k] >>> bits[i]) != 0) {
- ++tmpcounter;
- }
- if (tmpcounter == BlockSize)
- continue; // no need
- for (int k = pos, c = 0; k < pos + BlockSize; ++k)
- if ((in[k] >>> bits[i]) != 0) {
- exceptbuffer[tmpcounter + c] = k - pos;
- exceptbuffer[c] = in[k] >>> bits[i];
- ++c;
- }
-
- final int thiscost = bits[i] * 4
- + S16.estimatecompress(exceptbuffer, 0, 2 * tmpcounter);
- if (thiscost <= bestcost) {
- bestcost = thiscost;
- besti = i;
- exceptcounter = tmpcounter;
- }
- }
-
- bestb.set(besti);
- bestexcept.set(exceptcounter);
- }
-
- private void encodePage(int[] in, IntWrapper inpos, int thissize,
- int[] out, IntWrapper outpos) {
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
- IntWrapper bestb = new IntWrapper();
- IntWrapper bestexcept = new IntWrapper();
- for (final int finalinpos = tmpinpos + thissize; tmpinpos + BlockSize <= finalinpos; tmpinpos += BlockSize) {
- getBestBFromData(in, tmpinpos, bestb, bestexcept);
- int tmpbestb = bestb.get();
- int nbrexcept = bestexcept.get();
- int exceptsize = 0;
- int remember = tmpoutpos;
- tmpoutpos++;
- if (nbrexcept > 0) {
- int c = 0;
- for (int i = 0; i < BlockSize; ++i) {
- if ((in[tmpinpos + i] >>> bits[tmpbestb]) != 0) {
- exceptbuffer[c + nbrexcept] = i;
- exceptbuffer[c] = in[tmpinpos + i] >>> bits[tmpbestb];
- ++c;
- }
- }
- exceptsize = S16.compress(exceptbuffer, 0, 2 * nbrexcept, out,
- tmpoutpos);
- tmpoutpos += exceptsize;
- }
- out[remember] = tmpbestb | (nbrexcept << 8) | (exceptsize << 16);
- for (int k = 0; k < BlockSize; k += 32) {
- BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos,
- bits[tmpbestb]);
- tmpoutpos += bits[tmpbestb];
- }
- }
- inpos.set(tmpinpos);
- outpos.set(tmpoutpos);
- }
-
- @Override
- public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos, int num) {
- // Util.assertTrue(inpos.get()+inlength <= in.length);
- int mynvalue = num / BlockSize * BlockSize;
- // int mynvalue = in[inpos.get()];
- // inpos.increment();
- int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
- }
-
- private void decodePage(int[] in, IntWrapper inpos, int[] out,
- IntWrapper outpos, int thissize) {
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
-
- for (int run = 0; run < thissize / BlockSize; ++run, tmpoutpos += BlockSize) {
- final int b = in[tmpinpos] & 0xFF;
- final int cexcept = (in[tmpinpos] >>> 8) & 0xFF;
- final int exceptsize = (in[tmpinpos] >>> 16);
- ++tmpinpos;
- S16.uncompress(in, tmpinpos, exceptsize, exceptbuffer, 0,
- 2 * cexcept);
- tmpinpos += exceptsize;
- for (int k = 0; k < BlockSize; k += 32) {
- BitPacking
- .fastunpack(in, tmpinpos, out, tmpoutpos + k, bits[b]);
- tmpinpos += bits[b];
- }
- for (int k = 0; k < cexcept; ++k) {
- out[tmpoutpos + exceptbuffer[k + cexcept]] |= (exceptbuffer[k] << bits[b]);
- }
- }
- outpos.set(tmpoutpos);
- inpos.set(tmpinpos);
- }
-
- @Override
- public String toString() {
- return this.getClass().getName();
- }
-
-}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
deleted file mode 100644
index 932ce49..0000000
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple16.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package me.lemire.integercompression.skippable;
-
-import me.lemire.integercompression.*;
-
-/**
- * This is an implementation of the popular Simple16 scheme. It is limited to
- * 28-bit integers (between 0 and 2^28-1).
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, you must compute the deltas separately.
- *
- *
- * Adapted by D. Lemire from the Apache Lucene project.
- *
- *
- */
-public final class SkippableSimple16 implements SkippableIntegerCODEC {
-
- public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int out[],
- IntWrapper outpos) {
- int i_inpos = inpos.get();
- int i_outpos = outpos.get();
- final int finalin = i_inpos + inlength;
- while (i_inpos < finalin) {
- int inoffset = compressblock(out, i_outpos++, in, i_inpos, inlength);
- if (inoffset == -1)
- throw new RuntimeException("Too big a number");
- i_inpos += inoffset;
- inlength -= inoffset;
- }
- inpos.set(i_inpos);
- outpos.set(i_outpos);
- }
-
- protected static int estimatecompress(int[] in, int currentPos, int inlength) {
- final int finalin = currentPos + inlength;
- int counter = 0;
- while (currentPos < finalin) {
- int inoffset = fakecompressblock(in, currentPos, inlength);
- if (inoffset == -1)
- throw new RuntimeException("Too big a number");
- currentPos += inoffset;
- inlength -= inoffset;
- ++counter;
- }
- return counter;
- }
-
- /**
- * Compress an integer array using Simple16
- *
- * @param out
- * the compressed output
- * @param outOffset
- * the offset of the output in the number of integers
- * @param in
- * the integer 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 compressed integers
- */
- public static final int compressblock(int[] out, int outOffset, int[] in,
- int inOffset, int n) {
- int numIdx, j, num, bits;
- for (numIdx = 0; numIdx < S16_NUMSIZE; numIdx++) {
- out[outOffset] = numIdx << S16_BITSSIZE;
- num = (S16_NUM[numIdx] < n) ? S16_NUM[numIdx] : n;
-
- for (j = 0, bits = 0; (j < num)
- && (in[inOffset + j] < SHIFTED_S16_BITS[numIdx][j]);) {
- out[outOffset] |= (in[inOffset + j] << bits);
- bits += S16_BITS[numIdx][j];
- j++;
- }
-
- if (j == num) {
- return num;
- }
- }
-
- return -1;
- }
-
- protected static final int fakecompressblock(int[] in, int inOffset, int n) {
- int numIdx, j, num;
- for (numIdx = 0; numIdx < S16_NUMSIZE; numIdx++) {
- num = (S16_NUM[numIdx] < n) ? S16_NUM[numIdx] : n;
-
- for (j = 0; (j < num)
- && (in[inOffset + j] < SHIFTED_S16_BITS[numIdx][j]);) {
- j++;
- }
-
- if (j == num) {
- return num;
- }
- }
-
- return -1;
- }
-
- /**
- * 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 decompressblock(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] = (in[inOffset] >>> bits)
- & (0xffffffff >>> (32 - S16_BITS[numIdx][j]));
- bits += S16_BITS[numIdx][j];
- }
- return num;
- }
-
- @Override
- public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos, int num) {
- int i_inpos = inpos.get();
- int i_outpos = outpos.get();
- final int finalpos = i_inpos + inlength;
- while (i_inpos < finalpos) {
- final int howmany = decompressblock(out, i_outpos, in, i_inpos, num);
- num -= howmany;
- i_outpos += howmany;
- i_inpos++;
- }
- inpos.set(i_inpos);
- outpos.set(i_outpos);
- }
-
- /**
- * Uncompress data from an array to another array.
- *
- * Both inpos and outpos parameters are modified to indicate new positions
- * after read/write.
- *
- * @param in
- * array containing data in compressed form
- * @param tmpinpos
- * where to start reading in the array
- * @param inlength
- * length of the compressed data (ignored by some schemes)
- * @param out
- * array where to write the compressed output
- * @param currentPos
- * where to write the compressed output in out
- * @param outlength
- * number of integers we want to decode
- */
- public static void uncompress(int[] in, int tmpinpos, int inlength,
- int[] out, int currentPos, int outlength) {
- final int finalpos = tmpinpos + inlength;
- while (tmpinpos < finalpos) {
- final int howmany = decompressblock(out, currentPos, in, tmpinpos,
- outlength);
- outlength -= howmany;
- currentPos += howmany;
- tmpinpos += 1;
- }
-
- }
-
- private static int[][] shiftme(int[][] x) {
- int[][] answer = new int[x.length][];
- for (int k = 0; k < x.length; ++k) {
- answer[k] = new int[x[k].length];
- for (int z = 0; z < answer[k].length; ++z)
- answer[k][z] = 1 << x[k][z];
- }
- return answer;
- }
-
- private static final int S16_NUMSIZE = 16;
- private static final int S16_BITSSIZE = 28;
- // the possible number of bits used to represent one integer
- private static final int[] S16_NUM = { 28, 21, 21, 21, 14, 9, 8, 7, 6, 6,
- 5, 5, 4, 3, 2, 1 };
- // the corresponding number of elements for each value of the number of bits
- private static final int[][] S16_BITS = {
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1 },
- { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
- { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 },
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2 },
- { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
- { 4, 3, 3, 3, 3, 3, 3, 3, 3 }, { 3, 4, 4, 4, 4, 3, 3, 3 },
- { 4, 4, 4, 4, 4, 4, 4 }, { 5, 5, 5, 5, 4, 4 },
- { 4, 4, 5, 5, 5, 5 }, { 6, 6, 6, 5, 5 }, { 5, 5, 6, 6, 6 },
- { 7, 7, 7, 7 }, { 10, 9, 9, }, { 14, 14 }, { 28 } };
- private static final int[][] SHIFTED_S16_BITS = shiftme(S16_BITS);
-
-}
diff --git a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java b/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
deleted file mode 100644
index cdf061f..0000000
--- a/src/main/java/me/lemire/integercompression/skippable/SkippableSimple9.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/**
- * This is code is released under the
- * Apache License Version 2.0 http://www.apache.org/licenses/.
- *
- * (c) Daniel Lemire, http://lemire.me/en/
- */
-
-package me.lemire.integercompression.skippable;
-
-import me.lemire.integercompression.IntWrapper;
-
-/**
- * This is an implementation of the popular Simple9 scheme. It is limited to
- * 28-bit integers (between 0 and 2^28-1).
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, you must compute the deltas separately.
- *
- * @author Daniel Lemire
- *
- */
-public final class SkippableSimple9 implements SkippableIntegerCODEC {
-
- @Override
- public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int out[],
- IntWrapper outpos) {
- int tmpoutpos = outpos.get();
- int currentPos = inpos.get();
- final int finalin = currentPos + inlength;
- outer: while (currentPos < finalin - 28) {
- mainloop: for (int selector = 0; selector < 8; selector++) {
-
- int res = 0;
- int compressedNum = codeNum[selector];
- int b = bitLength[selector];
- int max = 1 << b;
- int i = 0;
- for (; i < compressedNum; i++) {
- if (max <= in[currentPos + i])
- continue mainloop;
- res = (res << b) + in[currentPos + i];
- }
- res |= selector << 28;
- out[tmpoutpos++] = res;
- currentPos += compressedNum;
- continue outer;
- }
- final int selector = 8;
- if (in[currentPos] >= 1 << bitLength[selector])
- throw new RuntimeException("Too big a number");
- out[tmpoutpos++] = in[currentPos++] | (selector << 28);
- }
- outer: while (currentPos < finalin) {
- mainloop: for (int selector = 0; selector < 8; selector++) {
- int res = 0;
- int compressedNum = codeNum[selector];
- if (finalin <= currentPos + compressedNum - 1)
- compressedNum = finalin - currentPos;
- int b = bitLength[selector];
- int max = 1 << b;
- int i = 0;
- for (; i < compressedNum; i++) {
- if (max <= in[currentPos + i])
- continue mainloop;
- res = (res << b) + in[currentPos + i];
- }
-
- if (compressedNum != codeNum[selector])
- res <<= (codeNum[selector] - compressedNum) * b;
- res |= selector << 28;
- out[tmpoutpos++] = res;
- currentPos += compressedNum;
- continue outer;
- }
- final int selector = 8;
- // Util.assertTrue(codeNum[selector] == 1);
- if (in[currentPos] >= 1 << bitLength[selector])
- throw new RuntimeException("Too big a number");
- out[tmpoutpos++] = in[currentPos++] | (selector << 28);
- }
- // Util.assertTrue(currentPos == finalin);
- inpos.set(currentPos);
- outpos.set(tmpoutpos);
- }
-
- @Override
- public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos, int num) {
- int currentPos = outpos.get();
- int tmpinpos = inpos.get();
- final int finalout = currentPos + num;
- while (currentPos < finalout - 28) {
- int val = in[tmpinpos++];
- int header = val >>> 28;
- switch (header) {
- case 0: { // number : 28, bitwidth : 1
- out[currentPos++] = (val << 4) >>> 31;
- out[currentPos++] = (val << 5) >>> 31;
- out[currentPos++] = (val << 6) >>> 31;
- out[currentPos++] = (val << 7) >>> 31;
- out[currentPos++] = (val << 8) >>> 31;
- out[currentPos++] = (val << 9) >>> 31;
- out[currentPos++] = (val << 10) >>> 31;
- out[currentPos++] = (val << 11) >>> 31;
- out[currentPos++] = (val << 12) >>> 31;
- out[currentPos++] = (val << 13) >>> 31; // 10
- out[currentPos++] = (val << 14) >>> 31;
- out[currentPos++] = (val << 15) >>> 31;
- out[currentPos++] = (val << 16) >>> 31;
- out[currentPos++] = (val << 17) >>> 31;
- out[currentPos++] = (val << 18) >>> 31;
- out[currentPos++] = (val << 19) >>> 31;
- out[currentPos++] = (val << 20) >>> 31;
- out[currentPos++] = (val << 21) >>> 31;
- out[currentPos++] = (val << 22) >>> 31;
- out[currentPos++] = (val << 23) >>> 31; // 20
- out[currentPos++] = (val << 24) >>> 31;
- out[currentPos++] = (val << 25) >>> 31;
- out[currentPos++] = (val << 26) >>> 31;
- out[currentPos++] = (val << 27) >>> 31;
- out[currentPos++] = (val << 28) >>> 31;
- out[currentPos++] = (val << 29) >>> 31;
- out[currentPos++] = (val << 30) >>> 31;
- out[currentPos++] = (val << 31) >>> 31;
- break;
- }
- case 1: { // number : 14, bitwidth : 2
- out[currentPos++] = (val << 4) >>> 30;
- out[currentPos++] = (val << 6) >>> 30;
- out[currentPos++] = (val << 8) >>> 30;
- out[currentPos++] = (val << 10) >>> 30;
- out[currentPos++] = (val << 12) >>> 30;
- out[currentPos++] = (val << 14) >>> 30;
- out[currentPos++] = (val << 16) >>> 30;
- out[currentPos++] = (val << 18) >>> 30;
- out[currentPos++] = (val << 20) >>> 30;
- out[currentPos++] = (val << 22) >>> 30; // 10
- out[currentPos++] = (val << 24) >>> 30;
- out[currentPos++] = (val << 26) >>> 30;
- out[currentPos++] = (val << 28) >>> 30;
- out[currentPos++] = (val << 30) >>> 30;
- break;
- }
- case 2: { // number : 9, bitwidth : 3
- out[currentPos++] = (val << 5) >>> 29;
- out[currentPos++] = (val << 8) >>> 29;
- out[currentPos++] = (val << 11) >>> 29;
- out[currentPos++] = (val << 14) >>> 29;
- out[currentPos++] = (val << 17) >>> 29;
- out[currentPos++] = (val << 20) >>> 29;
- out[currentPos++] = (val << 23) >>> 29;
- out[currentPos++] = (val << 26) >>> 29;
- out[currentPos++] = (val << 29) >>> 29;
- break;
- }
- case 3: { // number : 7, bitwidth : 4
- out[currentPos++] = (val << 4) >>> 28;
- out[currentPos++] = (val << 8) >>> 28;
- out[currentPos++] = (val << 12) >>> 28;
- out[currentPos++] = (val << 16) >>> 28;
- out[currentPos++] = (val << 20) >>> 28;
- out[currentPos++] = (val << 24) >>> 28;
- out[currentPos++] = (val << 28) >>> 28;
- break;
- }
- case 4: { // number : 5, bitwidth : 5
- out[currentPos++] = (val << 7) >>> 27;
- out[currentPos++] = (val << 12) >>> 27;
- out[currentPos++] = (val << 17) >>> 27;
- out[currentPos++] = (val << 22) >>> 27;
- out[currentPos++] = (val << 27) >>> 27;
- break;
- }
- case 5: { // number : 4, bitwidth : 7
- out[currentPos++] = (val << 4) >>> 25;
- out[currentPos++] = (val << 11) >>> 25;
- out[currentPos++] = (val << 18) >>> 25;
- out[currentPos++] = (val << 25) >>> 25;
- break;
- }
- case 6: { // number : 3, bitwidth : 9
- out[currentPos++] = (val << 5) >>> 23;
- out[currentPos++] = (val << 14) >>> 23;
- out[currentPos++] = (val << 23) >>> 23;
- break;
- }
- case 7: { // number : 2, bitwidth : 14
- out[currentPos++] = (val << 4) >>> 18;
- out[currentPos++] = (val << 18) >>> 18;
- break;
- }
- case 8: { // number : 1, bitwidth : 28
- out[currentPos++] = (val << 4) >>> 4;
- break;
- }
- default: {
- throw new RuntimeException("shouldn't happen");
- }
- }
- }
- while (currentPos < finalout) {
- int val = in[tmpinpos++];
- int header = val >>> 28;
- switch (header) {
- case 0: { // number : 28, bitwidth : 1
- final int howmany = finalout - currentPos;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (k + 4)) >>> 31;
- }
- break;
- }
- case 1: { // number : 14, bitwidth : 2
- final int howmany = finalout - currentPos < 14 ? finalout
- - currentPos : 14;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (2 * k + 4)) >>> 30;
- }
- break;
- }
- case 2: { // number : 9, bitwidth : 3
- final int howmany = finalout - currentPos < 9 ? finalout
- - currentPos : 9;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (3 * k + 5)) >>> 29;
- }
- break;
- }
- case 3: { // number : 7, bitwidth : 4
- final int howmany = finalout - currentPos < 7 ? finalout
- - currentPos : 7;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (4 * k + 4)) >>> 28;
- }
- break;
- }
- case 4: { // number : 5, bitwidth : 5
- final int howmany = finalout - currentPos < 5 ? finalout
- - currentPos : 5;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (5 * k + 7)) >>> 27;
- }
- break;
- }
- case 5: { // number : 4, bitwidth : 7
- final int howmany = finalout - currentPos < 4 ? finalout
- - currentPos : 4;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (7 * k + 4)) >>> 25;
- }
- break;
- }
- case 6: { // number : 3, bitwidth : 9
- final int howmany = finalout - currentPos < 3 ? finalout
- - currentPos : 3;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (9 * k + 5)) >>> 23;
- }
- break;
- }
- case 7: { // number : 2, bitwidth : 14
- final int howmany = finalout - currentPos < 2 ? finalout
- - currentPos : 2;
- for (int k = 0; k < howmany; ++k) {
- out[currentPos++] = (val << (14 * k + 4)) >>> 18;
- }
- break;
- }
- case 8: { // number : 1, bitwidth : 28
- out[currentPos++] = (val << 4) >>> 4;
- break;
- }
- default: {
- throw new RuntimeException("shouldn't happen");
- }
- }
- }
- outpos.set(currentPos);
- inpos.set(tmpinpos);
-
- }
-
- private final static int bitLength[] = { 1, 2, 3, 4, 5, 7, 9, 14, 28 };
-
- private final static int codeNum[] = { 28, 14, 9, 7, 5, 4, 3, 2, 1 };
-
- @Override
- public String toString() {
- return this.getClass().getName();
- }
-
-}
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index 383f407..81a07e9 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -53,6 +53,7 @@ public void varyingLengthTest() {
for (int k = 0; k < N; ++k)
data[k] = k;
for (IntegerCODEC c : codecs) {
+ System.out.println("[BasicTest.varyingLengthTest] codec = "+c);
for (int L = 1; L <= 128; L++) {
int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
int[] answer = TestUtils.uncompress(c, comp, L);
@@ -80,6 +81,7 @@ public void varyingLengthTest2() {
int[] data = new int[N];
data[127] = -1;
for (IntegerCODEC c : codecs) {
+ System.out.println("[BasicTest.varyingLengthTest2] codec = "+c);
try {
// CODEC Simple9 is limited to "small" integers.
if (c.getClass().equals(
@@ -374,6 +376,7 @@ private static void test(IntegerCODEC c, IntegerCODEC co, int N, int nbr) {
private static void test(int N, int nbr) {
ClusteredDataGenerator cdg = new ClusteredDataGenerator();
+ System.out.println("[BasicTest.test] N = "+N+" "+nbr);
for (int sparsity = 1; sparsity < 31 - nbr; sparsity += 4) {
int[][] data = new int[N][];
int max = (1 << (nbr + sparsity));
diff --git a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
index ee2162d..df081e8 100644
--- a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
+++ b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
@@ -2,8 +2,6 @@
import java.util.Arrays;
-import me.lemire.integercompression.skippable.*;
-
import org.junit.Test;
@@ -18,11 +16,15 @@ public class SkippableBasicTest {
new JustCopy(),
new VariableByte(),
new SkippableComposition(new BinaryPacking(), new VariableByte()),
- new SkippableComposition(new SkippableNewPFD(), new VariableByte()),
- new SkippableComposition(new SkippableOptPFD(), new VariableByte()),
- new SkippableComposition(new SkippableFastPFOR(), new VariableByte()),
- new SkippableSimple9(),
- new SkippableSimple16() };
+ /* new SkippableComposition(new NewPFD(), new VariableByte()),
+ new SkippableComposition(new NewPFDS9(), new VariableByte()),
+ new SkippableComposition(new NewPFDS16(), new VariableByte()),
+ new SkippableComposition(new OptPFD(), new VariableByte()),
+ new SkippableComposition(new OptPFDS9(), new VariableByte()),
+ new SkippableComposition(new OptPFDS16(), new VariableByte()),*/
+ new SkippableComposition(new FastPFOR(), new VariableByte()),
+ new Simple9(),
+ new Simple16() };
/**
*
@@ -34,16 +36,17 @@ public void varyingLengthTest() {
for (int k = 0; k < N; ++k)
data[k] = k;
for (SkippableIntegerCODEC c : codecs) {
+ System.out.println("[SkippeableBasicTest.varyingLengthTest] codec = "+c);
for (int L = 1; L <= 128; L++) {
- int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
+ int[] comp = TestUtils.compressHeadless(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompressHeadless(c, comp, L);
for (int k = 0; k < L; ++k)
if (answer[k] != data[k])
throw new RuntimeException("bug "+c.toString()+" "+k+" "+answer[k]+" "+data[k]);
}
for (int L = 128; L <= N; L *= 2) {
- int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
+ int[] comp = TestUtils.compressHeadless(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompressHeadless(c, comp, L);
for (int k = 0; k < L; ++k)
if (answer[k] != data[k])
throw new RuntimeException("bug");
@@ -61,10 +64,12 @@ public void varyingLengthTest2() {
int[] data = new int[N];
data[127] = -1;
for (SkippableIntegerCODEC c : codecs) {
+ System.out.println("[SkippeableBasicTest.varyingLengthTest2] codec = "+c);
+
try {
// CODEC Simple9 is limited to "small" integers.
if (c.getClass().equals(
- Class.forName("me.lemire.integercompression.skippable.SkippableSimple9")))
+ Class.forName("me.lemire.integercompression.Simple9")))
continue;
} catch (ClassNotFoundException e) {
e.printStackTrace();
@@ -72,21 +77,21 @@ public void varyingLengthTest2() {
try {
// CODEC Simple16 is limited to "small" integers.
if (c.getClass().equals(
- Class.forName("me.lemire.integercompression.skippable.SkippableSimple16")))
+ Class.forName("me.lemire.integercompression.Simple16")))
continue;
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
for (int L = 1; L <= 128; L++) {
- int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
+ int[] comp = TestUtils.compressHeadless(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompressHeadless(c, comp, L);
for (int k = 0; k < L; ++k)
if (answer[k] != data[k])
throw new RuntimeException("bug at k = "+k+" "+answer[k]+" "+data[k]+" for "+c.toString());
}
for (int L = 128; L <= N; L *= 2) {
- int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
- int[] answer = TestUtils.uncompress(c, comp, L);
+ int[] comp = TestUtils.compressHeadless(c, Arrays.copyOf(data, L));
+ int[] answer = TestUtils.uncompressHeadless(c, comp, L);
for (int k = 0; k < L; ++k)
if (answer[k] != data[k])
throw new RuntimeException("bug");
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index 6403fa6..413654f 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -2,8 +2,6 @@
import java.util.Arrays;
-import me.lemire.integercompression.skippable.SkippableIntegerCODEC;
-
import org.junit.Test;
import static org.junit.Assert.*;
@@ -109,7 +107,7 @@ protected static int[] uncompress(ByteIntegerCODEC codec, byte[] data, int len)
return Arrays.copyOf(outBuf, outPos.get());
}
- protected static int[] compress(SkippableIntegerCODEC codec, int[] data) {
+ protected static int[] compressHeadless(SkippableIntegerCODEC codec, int[] data) {
int[] outBuf = new int[data.length * 4];
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
@@ -117,7 +115,7 @@ protected static int[] compress(SkippableIntegerCODEC codec, int[] data) {
return Arrays.copyOf(outBuf, outPos.get());
}
- protected static int[] uncompress(SkippableIntegerCODEC codec, int[] data, int len) {
+ protected static int[] uncompressHeadless(SkippableIntegerCODEC codec, int[] data, int len) {
int[] outBuf = new int[len + 1024];
IntWrapper inPos = new IntWrapper();
IntWrapper outPos = new IntWrapper();
From 9eac6bc85b78a2b58e9469c1d60d5ca39c59f7b3 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Tue, 16 Sep 2014 22:30:09 -0400
Subject: [PATCH 037/266] Cleaning up code.
---
.../lemire/integercompression/FastPFOR.java | 10 +++----
.../lemire/integercompression/Kamikaze.java | 6 ++--
.../me/lemire/integercompression/NewPFD.java | 21 ++++----------
.../lemire/integercompression/NewPFDS16.java | 27 +++++------------
.../lemire/integercompression/NewPFDS9.java | 29 ++++++-------------
.../me/lemire/integercompression/OptPFD.java | 28 +++++-------------
.../lemire/integercompression/OptPFDS16.java | 24 +++++----------
.../lemire/integercompression/OptPFDS9.java | 24 +++++----------
.../me/lemire/integercompression/Util.java | 7 ++---
.../differential/IntegratedFastPFOR.java | 6 ++--
10 files changed, 58 insertions(+), 124 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/FastPFOR.java b/src/main/java/me/lemire/integercompression/FastPFOR.java
index 0c4ddd2..14e37b5 100644
--- a/src/main/java/me/lemire/integercompression/FastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/FastPFOR.java
@@ -82,7 +82,7 @@ public FastPFOR() {
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
@@ -158,7 +158,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
int newsize = 2 * (dataPointers[index] + bestbbestcexceptmaxb[1]);
// make sure it is a multiple of 32
newsize = Util
- .floorBy(newsize + 31, 32);
+ .greatestMultiple(newsize + 31, 32);
dataTobePacked[index] = Arrays.copyOf(
dataTobePacked[index], newsize);
}
@@ -219,7 +219,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
dataPointers = new int[33];
@@ -250,7 +250,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int size = in[inexcept++];
if (dataTobePacked[k].length < size)
dataTobePacked[k] = new int[Util
- .floorBy(size + 31, 32)];
+ .greatestMultiple(size + 31, 32)];
for (int j = 0; j < size; j += 32) {
BitPacking.fastunpack(in, inexcept,
dataTobePacked[k], j, k);
@@ -287,7 +287,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
out[outpos.get()] = inlength;
diff --git a/src/main/java/me/lemire/integercompression/Kamikaze.java b/src/main/java/me/lemire/integercompression/Kamikaze.java
index 9f422d8..fd1ac82 100644
--- a/src/main/java/me/lemire/integercompression/Kamikaze.java
+++ b/src/main/java/me/lemire/integercompression/Kamikaze.java
@@ -18,7 +18,7 @@ public class Kamikaze implements SkippableIntegerCODEC, IntegerCODEC {
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength > 0) {
int[] out2 = PForDelta.compressOneBlockOpt(in, inlength);
inpos.add(inlength);
@@ -30,7 +30,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out
@Override
public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos, int num) {
- num = Util.floorBy(num, BLOCK_SIZE);
+ num = Util.greatestMultiple(num, BLOCK_SIZE);
if (num > 0) {
int d = PForDelta.decompressOneBlock(out, in, num);
inpos.add(d / 32);
@@ -46,7 +46,7 @@ public String toString() {
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
out[outpos.get()] = inlength;
diff --git a/src/main/java/me/lemire/integercompression/NewPFD.java b/src/main/java/me/lemire/integercompression/NewPFD.java
index 0ea6cc3..ec0adbd 100644
--- a/src/main/java/me/lemire/integercompression/NewPFD.java
+++ b/src/main/java/me/lemire/integercompression/NewPFD.java
@@ -35,7 +35,6 @@
* @author Daniel Lemire
*/
public final class NewPFD implements IntegerCODEC,SkippableIntegerCODEC {
- final int PageSize;
final static int BLOCK_SIZE = 128;
int[] exceptbuffer = new int[2 * BLOCK_SIZE];
@@ -44,22 +43,16 @@ public final class NewPFD implements IntegerCODEC,SkippableIntegerCODEC {
* Constructor for the NewPFD CODEC.
*/
public NewPFD() {
- PageSize = 65536;
}
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
+ encodePage(in, inpos, finalinpos, out, outpos);
}
protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
@@ -136,13 +129,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ decodePage(in, inpos, out, outpos, finalout);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
@@ -173,7 +162,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
out[outpos.get()] = inlength;
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS16.java b/src/main/java/me/lemire/integercompression/NewPFDS16.java
index fc6599b..48b3a70 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS16.java
@@ -34,7 +34,6 @@
* @author Daniel Lemire
*/
public final class NewPFDS16 implements IntegerCODEC,SkippableIntegerCODEC {
- final int PageSize;
final static int BLOCK_SIZE= 128;
int[] exceptbuffer = new int[2 * BLOCK_SIZE];
@@ -43,31 +42,25 @@ public final class NewPFDS16 implements IntegerCODEC,SkippableIntegerCODEC {
* Constructor for the NewPFDS16 CODEC.
*/
public NewPFDS16() {
- PageSize = 65536;
}
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
+ encodePage(in, inpos, finalinpos, out, outpos);
}
- protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 16, 20, 32 };
- protected static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16 };
- protected static void getBestBFromData(int[] in, int pos,
+ private static void getBestBFromData(int[] in, int pos,
IntWrapper bestb, IntWrapper bestexcept) {
final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
@@ -135,13 +128,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ decodePage(in, inpos, out, outpos, finalout);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
@@ -172,7 +161,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
out[outpos.get()] = inlength;
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS9.java b/src/main/java/me/lemire/integercompression/NewPFDS9.java
index 7a15ed4..89a8b4c 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS9.java
@@ -33,7 +33,6 @@
* @author Daniel Lemire
*/
public final class NewPFDS9 implements IntegerCODEC,SkippableIntegerCODEC {
- final int PageSize;
final static int BLOCK_SIZE = 128;
int[] exceptbuffer = new int[2 * BLOCK_SIZE];
@@ -42,31 +41,25 @@ public final class NewPFDS9 implements IntegerCODEC,SkippableIntegerCODEC {
* Constructor for the NewPFDS9 CODEC.
*/
public NewPFDS9() {
- PageSize = 65536;
}
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
+ encodePage(in, inpos, finalinpos, out, outpos);
}
- protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 16, 20, 32 };
- protected static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16 };
- protected static void getBestBFromData(int[] in, int pos,
+ private static void getBestBFromData(int[] in, int pos,
IntWrapper bestb, IntWrapper bestexcept) {
final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
@@ -134,13 +127,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
- int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
+ final int finalout = outpos.get() + mynvalue;
+ decodePage(in, inpos, out, outpos, finalout);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
@@ -171,7 +160,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
IntWrapper outpos) {
- inlength = Util.floorBy(inlength, BLOCK_SIZE);
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
out[outpos.get()] = inlength;
diff --git a/src/main/java/me/lemire/integercompression/OptPFD.java b/src/main/java/me/lemire/integercompression/OptPFD.java
index 051b11f..c51545d 100644
--- a/src/main/java/me/lemire/integercompression/OptPFD.java
+++ b/src/main/java/me/lemire/integercompression/OptPFD.java
@@ -33,41 +33,33 @@
* @author Daniel Lemire
*/
public final class OptPFD implements IntegerCODEC,SkippableIntegerCODEC {
- final int PageSize;
final static int BLOCK_SIZE = 128;
int[] exceptbuffer = new int[2 * BLOCK_SIZE];
- int[] sillybuffer = new int[2 * BLOCK_SIZE];
-
+
/**
* Constructor for the OptPFD CODEC.
*/
public OptPFD() {
- PageSize = 65536;
}
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
-
+ encodePage(in, inpos, finalinpos, out, outpos);
}
- protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 16, 20, 32 };
- protected static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16 };
- void getBestBFromData(int[] in, int pos, IntWrapper bestb,
+ private void getBestBFromData(int[] in, int pos, IntWrapper bestb,
IntWrapper bestexcept) {
final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
@@ -152,13 +144,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ decodePage(in, inpos, out, outpos, finalout);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS16.java b/src/main/java/me/lemire/integercompression/OptPFDS16.java
index 8355a59..13da6bf 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS16.java
@@ -33,7 +33,6 @@
* @author Daniel Lemire
*/
public final class OptPFDS16 implements IntegerCODEC,SkippableIntegerCODEC {
- final int PageSize;
final static int BLOCK_SIZE = 128;
int[] exceptbuffer = new int[2 * BLOCK_SIZE];
@@ -41,32 +40,27 @@ public final class OptPFDS16 implements IntegerCODEC,SkippableIntegerCODEC {
* Constructor for the OptPFDS16 CODEC.
*/
public OptPFDS16() {
- PageSize = 65536;
}
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
+ encodePage(in, inpos, finalinpos, out, outpos);
}
- protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 16, 20, 32 };
- protected static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16 };
- protected void getBestBFromData(int[] in, int pos, IntWrapper bestb,
+ private void getBestBFromData(int[] in, int pos, IntWrapper bestb,
IntWrapper bestexcept) {
final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
@@ -150,13 +144,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ decodePage(in, inpos, out, outpos, finalout);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS9.java b/src/main/java/me/lemire/integercompression/OptPFDS9.java
index 6b890aa..64981ef 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS9.java
@@ -33,7 +33,6 @@
* @author Daniel Lemire
*/
public final class OptPFDS9 implements IntegerCODEC, SkippableIntegerCODEC {
- final int PageSize;
final static int BLOCK_SIZE = 128;
int[] exceptbuffer = new int[2 * BLOCK_SIZE];
@@ -41,32 +40,27 @@ public final class OptPFDS9 implements IntegerCODEC, SkippableIntegerCODEC {
* Constructor for the OptPFDS9 CODEC.
*/
public OptPFDS9() {
- PageSize = 65536;
}
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / BLOCK_SIZE * BLOCK_SIZE;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
final int finalinpos = inpos.get() + inlength;
- while (inpos.get() != finalinpos) {
- int thissize = finalinpos > PageSize + inpos.get() ? PageSize
- : (finalinpos - inpos.get());
- encodePage(in, inpos, thissize, out, outpos);
- }
+ encodePage(in, inpos, finalinpos, out, outpos);
}
- protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 16, 20, 32 };
- protected static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ private static final int[] invbits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16 };
- protected void getBestBFromData(int[] in, int pos, IntWrapper bestb,
+ private void getBestBFromData(int[] in, int pos, IntWrapper bestb,
IntWrapper bestexcept) {
final int mb = Util.maxbits(in, pos, BLOCK_SIZE);
int mini = 0;
@@ -150,13 +144,9 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int mynvalue) {
if (inlength == 0)
return;
- mynvalue = Util.floorBy(mynvalue, BLOCK_SIZE);
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
final int finalout = outpos.get() + mynvalue;
- while (outpos.get() != finalout) {
- int thissize = finalout > PageSize + outpos.get() ? PageSize
- : (finalout - outpos.get());
- decodePage(in, inpos, out, outpos, thissize);
- }
+ decodePage(in, inpos, out, outpos, finalout);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/Util.java b/src/main/java/me/lemire/integercompression/Util.java
index 573c829..aa19ca4 100644
--- a/src/main/java/me/lemire/integercompression/Util.java
+++ b/src/main/java/me/lemire/integercompression/Util.java
@@ -101,14 +101,13 @@ public static int bits(int i) {
}
/**
- * return floor(value / factor)
+ * return floor(value / factor) * factor
*
* @param value numerator
* @param factor denominator
- * @return result of the division
+ * @return greatest multiple of factor no larger than value
*/
- public static int floorBy(int value, int factor) {
-
+ public static int greatestMultiple(int value, int factor) {
return value - value % factor;
}
}
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
index 4af2f0a..a770226 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
@@ -98,7 +98,7 @@ public IntegratedFastPFOR() {
@Override
public void compress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = Util.floorBy(inlength, 128);
+ inlength = Util.greatestMultiple(inlength, 128);
if (inlength == 0)
return;
@@ -182,7 +182,7 @@ private void encodePage(int[] constin, IntWrapper constinpos,
int newsize = 2 * (dataPointers[index] + bestbbestcexceptmaxb[1]);
// make sure it is a multiple of 32
newsize = Util
- .floorBy(newsize + 31, 32);
+ .greatestMultiple(newsize + 31, 32);
dataTobePacked[index] = Arrays.copyOf(
dataTobePacked[index], newsize);
}
@@ -276,7 +276,7 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int size = in[inexcept++];
if (dataTobePacked[k].length < size)
dataTobePacked[k] = new int[Util
- .floorBy(size + 31, 32)];
+ .greatestMultiple(size + 31, 32)];
for (int j = 0; j < size; j += 32) {
BitPacking.fastunpack(in, inexcept,
dataTobePacked[k], j, k);
From 193e4116358b0ec36204102dbbbde7dd97ceffe3 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 17 Sep 2014 16:10:02 -0400
Subject: [PATCH 038/266] Still buggy...
---
README.md | 2 +-
.../integercompression/VariableByte.java | 14 +-
.../benchmarktools/BenchmarkSkippable.java | 423 ++++++++++++++++++
.../SkippableBasicTest.java | 43 +-
4 files changed, 470 insertions(+), 12 deletions(-)
create mode 100644 src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
diff --git a/README.md b/README.md
index 0e1844d..200d33f 100644
--- a/README.md
+++ b/README.md
@@ -86,6 +86,7 @@ Main contributors
* Muraoka Taro, https://github.com/koron
with contributions by
+* the Terrier team (Matteo Catena, Craig Macdonald and Iadh Ounis)
* Di Wu, http://www.facebook.com/diwu1989
* Stefan Ackermann, https://github.com/Stivo
* Samit Roy, https://github.com/roysamit
@@ -155,7 +156,6 @@ This library was a key ingredient in the best paper at ECIR 2014 :
Matteo Catena, Craig Macdonald, Iadh Ounis, On Inverted Index Compression for Search Engine Efficiency, Lecture Notes in Computer Science 8416 (ECIR 2014), 2014.
http://dx.doi.org/10.1007/978-3-319-06028-6_30
-
We wrote a research paper which documents many of the CODECs implemented here:
Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second through vectorization, Software Pratice & Experience (to appear)
diff --git a/src/main/java/me/lemire/integercompression/VariableByte.java b/src/main/java/me/lemire/integercompression/VariableByte.java
index 73719e9..63de721 100644
--- a/src/main/java/me/lemire/integercompression/VariableByte.java
+++ b/src/main/java/me/lemire/integercompression/VariableByte.java
@@ -123,10 +123,8 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
val = in[p];
int c = (byte) (val >>> s);
s += 8;
- if (s == 32) {
- s = 0;
- p++;
- }
+ p += s>>5;
+ s = s & 31;
v += ((c & 127) << shift);
if ((c & 128) == 128) {
out[tmpoutpos++] = v;
@@ -190,10 +188,8 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] o
val = in[p];
int c = (byte) (val >>> s);
s += 8;
- if (s == 32) {
- s = 0;
- p++;
- }
+ p += s>>5;
+ s = s & 31;
v += ((c & 127) << shift);
if ((c & 128) == 128) {
out[tmpoutpos++] = v;
@@ -203,7 +199,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] o
shift += 7;
}
outpos.set(tmpoutpos);
- inpos.add(inlength);
+ inpos.set(p + (s!=0 ? 1 : 0));
}
}
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
new file mode 100644
index 0000000..c14adb1
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
@@ -0,0 +1,423 @@
+/**
+ * This code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression.benchmarktools;
+
+import com.kamikaze.pfordelta.PForDelta;
+
+import me.lemire.integercompression.BinaryPacking;
+import me.lemire.integercompression.ByteIntegerCODEC;
+import me.lemire.integercompression.Composition;
+import me.lemire.integercompression.DeltaZigzagBinaryPacking;
+import me.lemire.integercompression.DeltaZigzagVariableByte;
+import me.lemire.integercompression.FastPFOR;
+import me.lemire.integercompression.IntWrapper;
+import me.lemire.integercompression.IntegerCODEC;
+import me.lemire.integercompression.JustCopy;
+import me.lemire.integercompression.NewPFD;
+import me.lemire.integercompression.NewPFDS16;
+import me.lemire.integercompression.NewPFDS9;
+import me.lemire.integercompression.OptPFD;
+import me.lemire.integercompression.OptPFDS16;
+import me.lemire.integercompression.OptPFDS9;
+import me.lemire.integercompression.Simple16;
+import me.lemire.integercompression.Simple9;
+import me.lemire.integercompression.SkippableComposition;
+import me.lemire.integercompression.SkippableIntegerCODEC;
+import me.lemire.integercompression.VariableByte;
+import me.lemire.integercompression.differential.Delta;
+import me.lemire.integercompression.differential.IntegratedBinaryPacking;
+import me.lemire.integercompression.differential.IntegratedByteIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedComposition;
+import me.lemire.integercompression.differential.IntegratedFastPFOR;
+import me.lemire.integercompression.differential.IntegratedIntegerCODEC;
+import me.lemire.integercompression.differential.IntegratedVariableByte;
+import me.lemire.integercompression.differential.XorBinaryPacking;
+import me.lemire.integercompression.synth.ClusteredDataGenerator;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ *
+ * Simple class meant to compare the speed of different schemes.
+ *
+ * @author Daniel Lemire
+ *
+ */
+public class BenchmarkSkippable {
+
+ private static int compressWithSkipTable(SkippableIntegerCODEC c, int[] data, int[] output, IntWrapper outpos, int[] metadata, int blocksize) {
+ int metapos = 0;
+ metadata[metapos++] = data.length;
+ IntWrapper inpos = new IntWrapper();
+ int initvalue = 0;
+ while(inpos.get() < data.length) {
+ metadata[metapos++] = outpos.get();
+ metadata[metapos++] = initvalue;
+ if (!(c instanceof IntegratedIntegerCODEC)) {
+ int size = blocksize > data.length - inpos.get() ? data.length - inpos.get() : blocksize;
+ initvalue = Delta.delta(data,inpos.get(),size,initvalue);
+ }
+ c.headlessCompress(data, inpos, blocksize, output, outpos);
+ }
+ return metapos;
+ }
+ private static int decompressFromSkipTable(SkippableIntegerCODEC c, int[] compressed, IntWrapper compressedpos, int[] metadata, int blocksize, int[] data) {
+ int metapos = 0;
+ int length = metadata[metapos++];
+ IntWrapper uncomppos = new IntWrapper();
+ while(uncomppos.get() < length) {
+ int num = blocksize;
+ if(num > length - uncomppos.get()) num = length - uncomppos.get();
+ int location = metadata[metapos++];
+ int initvalue = metadata[metapos++];
+ int outputlocation = uncomppos.get();
+ if(location != compressedpos.get()) throw new RuntimeException("Bug "+location+" "+compressedpos.get());
+ c.headlessUncompress(compressed, compressedpos, compressed.length - uncomppos.get(), data, uncomppos, num);
+ if (!(c instanceof IntegratedIntegerCODEC)) {
+ initvalue = Delta.fastinverseDelta(data, outputlocation, num, initvalue);
+ }
+ }
+ return length;
+ }
+
+ /**
+ * Standard benchmark
+ *
+ * @param csvLog
+ * Writer for CSV log.
+ * @param c
+ * the codec
+ * @param data
+ * arrays of input data
+ * @param repeat
+ * How many times to repeat the test
+ * @param verbose
+ * whether to output result on screen
+ */
+ private static void testCodec(PrintWriter csvLog, int sparsity,
+ SkippableIntegerCODEC c, int[][] data, int repeat, boolean verbose) {
+ if (verbose) {
+ System.out.println("# " + c.toString());
+ System.out
+ .println("# bits per int, compress speed (mis), decompression speed (mis) ");
+ }
+
+ int N = data.length;
+
+ int totalSize = 0;
+ int maxLength = 0;
+ for (int k = 0; k < N; ++k) {
+ totalSize += data[k].length;
+ if (data[k].length > maxLength) {
+ maxLength = data[k].length;
+ }
+ }
+
+ // 4x + 1024 to account for the possibility of some negative
+ // compression.
+ int[] compressBuffer = new int[4 * maxLength + 1024];
+ int[] decompressBuffer = new int[maxLength + 1024];
+ int[] metadataBuffer = new int[maxLength];
+ final int blocksize = 1024;
+
+ // These variables hold time in microseconds (10^-6).
+ double compressTime = 0;
+ double decompressTime = 0;
+ final int times = 5;
+
+ int size = 0;
+
+ for (int r = 0; r < repeat; ++r) {
+ size = 0;
+ for (int k = 0; k < N; ++k) {
+ int[] backupdata = Arrays.copyOf(data[k],
+ data[k].length);
+
+ // compress data.
+ long beforeCompress = System.nanoTime() / 1000;
+ IntWrapper outpos = new IntWrapper();
+ compressWithSkipTable(c, backupdata, compressBuffer, outpos, metadataBuffer,blocksize );
+ long afterCompress = System.nanoTime() / 1000;
+
+ // measure time of compression.
+ compressTime += afterCompress - beforeCompress;
+ final int thiscompsize = outpos.get();
+ size += thiscompsize;
+ // dry run
+ int volume = 0;
+ {
+ IntWrapper compressedpos = new IntWrapper(0);
+ volume = decompressFromSkipTable(c, compressBuffer, compressedpos, metadataBuffer, blocksize, decompressBuffer);
+ }
+ // extract (uncompress) data
+ long beforeDecompress = System.nanoTime() / 1000;
+ for(int t = 0; t maxlength)
+ maxlength = data[k].length;
+ }
+ int[] buffer = new int[maxlength + 1024];
+ /*
+ * 4x + 1024 to account for the possibility of some negative
+ * compression
+ */
+ int size = 0;
+ int comptime = 0;
+ long decomptime = 0;
+ for (int r = 0; r < repeat; ++r) {
+ size = 0;
+ for (int k = 0; k < N; ++k) {
+ int outpos = 0;
+ int[] backupdata = Arrays.copyOf(data[k],
+ data[k].length);
+ //
+ bef = System.nanoTime() / 1000;
+ Delta.delta(backupdata);
+ ArrayList dataout = new ArrayList(
+ data[k].length / 128);
+ for (int K = 0; K < data[k].length; K += 128) {
+ final int[] compressedbuf = PForDelta
+ .compressOneBlockOpt(Arrays
+ .copyOfRange(
+ backupdata, K,
+ K + 128), 128);
+ dataout.add(compressedbuf);
+ outpos += compressedbuf.length;
+ }
+ aft = System.nanoTime() / 1000;
+ //
+ comptime += aft - bef;
+ final int thiscompsize = outpos;
+ size += thiscompsize;
+ //
+ bef = System.nanoTime() / 1000;
+ ArrayList datauncomp = new ArrayList(
+ dataout.size());
+ int deltaoffset = 0;
+
+ for (int[] compbuf : dataout) {
+ int[] tmpbuf = new int[128];
+ PForDelta.decompressOneBlock(tmpbuf,
+ compbuf, 128);
+ tmpbuf[0] += deltaoffset;
+ Delta.fastinverseDelta(tmpbuf);
+ deltaoffset = tmpbuf[127];
+ datauncomp.add(tmpbuf);
+ }
+ aft = System.nanoTime() / 1000;
+ //
+ decomptime += aft - bef;
+ if (datauncomp.size() * 128 != data[k].length)
+ throw new RuntimeException(
+ "we have a bug (diff length) "
+ + " expected "
+ + data[k].length
+ + " got "
+ + datauncomp.size()
+ * 128);
+ for (int m = 0; m < data[k].length; ++m)
+ if (datauncomp.get(m / 128)[m % 128] != data[k][m]) {
+ throw new RuntimeException(
+ "we have a bug (actual difference), expected "
+ + data[k][m]
+ + " found "
+ + buffer[m]
+ + " at " + m);
+ }
+
+ }
+ }
+
+ line += "\t" + df.format(size * 32.0 / totalsize);
+ line += "\t" + dfspeed.format(totalsize * repeat / (comptime));
+ line += "\t"
+ + dfspeed.format(totalsize * repeat / (decomptime));
+ if (verbose)
+ System.out.println(line);
+ }
+
+ /**
+ * Generate test data.
+ *
+ * @param N
+ * How many input arrays to generate
+ * @param nbr
+ * How big (in log2) should the arrays be
+ * @param sparsity
+ * How sparse test data generated
+ */
+ private static int[][] generateTestData(ClusteredDataGenerator dataGen,
+ int N, int nbr, int sparsity) {
+ final int[][] data = new int[N][];
+ final int dataSize = (1 << (nbr + sparsity));
+ for (int i = 0; i < N; ++i) {
+ data[i] = dataGen.generateClustered((1 << nbr),
+ dataSize);
+ }
+ return data;
+ }
+ static SkippableIntegerCODEC[] codecs = {
+ new JustCopy(),
+ new VariableByte(),
+ new SkippableComposition(new BinaryPacking(), new VariableByte()),
+ new SkippableComposition(new NewPFD(), new VariableByte()),
+ new SkippableComposition(new NewPFDS9(), new VariableByte()),
+ new SkippableComposition(new NewPFDS16(), new VariableByte()),
+ new SkippableComposition(new OptPFD(), new VariableByte()),
+ new SkippableComposition(new OptPFDS9(), new VariableByte()),
+ new SkippableComposition(new OptPFDS16(), new VariableByte()),
+ new SkippableComposition(new FastPFOR(), new VariableByte()),
+ new Simple9(),
+ new Simple16() };
+ /**
+ * Generates data and calls other tests.
+ *
+ * @param csvLog
+ * Writer for CSV log.
+ * @param N
+ * How many input arrays to generate
+ * @param nbr
+ * how big (in log2) should the arrays be
+ * @param repeat
+ * How many times should we repeat tests.
+ */
+ private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
+ csvLog.format("\"Algorithm\",\"Sparsity\",\"Bits per int\",\"Compress speed (MiS)\",\"Decompress speed (MiS)\"\n");
+ ClusteredDataGenerator cdg = new ClusteredDataGenerator();
+ final int max_sparsity = 31 - nbr;
+ for (int sparsity = 1; sparsity < max_sparsity; ++sparsity) {
+ System.out.println("# sparsity " + sparsity);
+ System.out.println("# generating random data...");
+ int[][] data = generateTestData(cdg, N, nbr, sparsity);
+ System.out.println("# generating random data... ok.");
+ for(SkippableIntegerCODEC c : codecs) {
+ testCodec(csvLog, sparsity, c, data, sparsity, false);
+ testCodec(csvLog, sparsity, c, data, sparsity, false);
+ testCodec(csvLog, sparsity, c, data, sparsity, true);
+ }
+
+
+ }
+ }
+}
diff --git a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
index df081e8..ee44bc1 100644
--- a/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
+++ b/src/test/java/me/lemire/integercompression/SkippableBasicTest.java
@@ -16,16 +16,55 @@ public class SkippableBasicTest {
new JustCopy(),
new VariableByte(),
new SkippableComposition(new BinaryPacking(), new VariableByte()),
- /* new SkippableComposition(new NewPFD(), new VariableByte()),
+ new SkippableComposition(new NewPFD(), new VariableByte()),
new SkippableComposition(new NewPFDS9(), new VariableByte()),
new SkippableComposition(new NewPFDS16(), new VariableByte()),
new SkippableComposition(new OptPFD(), new VariableByte()),
new SkippableComposition(new OptPFDS9(), new VariableByte()),
- new SkippableComposition(new OptPFDS16(), new VariableByte()),*/
+ new SkippableComposition(new OptPFDS16(), new VariableByte()),
new SkippableComposition(new FastPFOR(), new VariableByte()),
new Simple9(),
new Simple16() };
+
+ /**
+ *
+ */
+ @Test
+ public void consistentTest() {
+ int N = 4096;
+ int[] data = new int[N];
+ int[] rev = new int[N];
+ for (int k = 0; k < N; ++k)
+ data[k] = k % 128;
+ for (SkippableIntegerCODEC c : codecs) {
+ System.out.println("[SkippeableBasicTest.consistentTest] codec = "
+ + c);
+ int[] outBuf = new int[N + 1024];
+ for (int n = 0; n <= N; ++n) {
+ IntWrapper inPos = new IntWrapper();
+ IntWrapper outPos = new IntWrapper();
+ c.headlessCompress(data, inPos, n, outBuf, outPos);
+
+ IntWrapper inPoso = new IntWrapper();
+ IntWrapper outPoso = new IntWrapper();
+ c.headlessUncompress(outBuf, inPoso, outPos.get(), rev,
+ outPoso, n);
+ if (outPoso.get() != n) {
+ throw new RuntimeException("bug "+n);
+ }
+ if (inPoso.get() != outPos.get()) {
+ throw new RuntimeException("bug "+n+" "+inPoso.get()+" "+outPos.get());
+ }
+ for (int j = 0; j < n; ++j)
+ if (data[j] != rev[j]) {
+ throw new RuntimeException("bug");
+ }
+ }
+ }
+ }
+
+
/**
*
*/
From 3fe4aa52c386128ab2121c32c25076d229f49eb9 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 17 Sep 2014 16:43:18 -0400
Subject: [PATCH 039/266] Fixed remaining issues.
---
.../java/me/lemire/integercompression/BinaryPacking.java | 9 +++++----
src/main/java/me/lemire/integercompression/NewPFD.java | 6 ++----
.../java/me/lemire/integercompression/NewPFDS16.java | 6 ++----
src/main/java/me/lemire/integercompression/NewPFDS9.java | 6 ++----
src/main/java/me/lemire/integercompression/OptPFD.java | 6 ++----
.../java/me/lemire/integercompression/OptPFDS16.java | 6 ++----
src/main/java/me/lemire/integercompression/OptPFDS9.java | 7 ++-----
7 files changed, 17 insertions(+), 29 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/BinaryPacking.java b/src/main/java/me/lemire/integercompression/BinaryPacking.java
index 6377c25..9d68d2e 100644
--- a/src/main/java/me/lemire/integercompression/BinaryPacking.java
+++ b/src/main/java/me/lemire/integercompression/BinaryPacking.java
@@ -37,11 +37,12 @@
* @author Daniel Lemire
*/
public final class BinaryPacking implements IntegerCODEC, SkippableIntegerCODEC {
-
+ final static int BLOCK_SIZE = 128;
+
@Override
public void compress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / 128 * 128;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
out[outpos.get()] = inlength;
@@ -52,7 +53,7 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
@Override
public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos) {
- inlength = inlength / 128 * 128;
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
int tmpoutpos = outpos.get();
for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
final int mbits1 = Util.maxbits(in, s, 32);
@@ -91,7 +92,7 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
@Override
public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
int[] out, IntWrapper outpos, int num) {
- final int outlength = num / 128 * 128;
+ final int outlength = Util.greatestMultiple(num, BLOCK_SIZE);
int tmpinpos = inpos.get();
for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
final int mbits1 = (in[tmpinpos] >>> 24);
diff --git a/src/main/java/me/lemire/integercompression/NewPFD.java b/src/main/java/me/lemire/integercompression/NewPFD.java
index ec0adbd..6dd01aa 100644
--- a/src/main/java/me/lemire/integercompression/NewPFD.java
+++ b/src/main/java/me/lemire/integercompression/NewPFD.java
@@ -51,8 +51,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
- final int finalinpos = inpos.get() + inlength;
- encodePage(in, inpos, finalinpos, out, outpos);
+ encodePage(in, inpos, inlength, out, outpos);
}
protected static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
@@ -130,8 +129,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- final int finalout = outpos.get() + mynvalue;
- decodePage(in, inpos, out, outpos, finalout);
+ decodePage(in, inpos, out, outpos, mynvalue);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS16.java b/src/main/java/me/lemire/integercompression/NewPFDS16.java
index 48b3a70..98370d2 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS16.java
@@ -50,8 +50,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
- final int finalinpos = inpos.get() + inlength;
- encodePage(in, inpos, finalinpos, out, outpos);
+ encodePage(in, inpos, inlength, out, outpos);
}
private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
@@ -129,8 +128,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- int finalout = outpos.get() + mynvalue;
- decodePage(in, inpos, out, outpos, finalout);
+ decodePage(in, inpos, out, outpos, mynvalue);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/NewPFDS9.java b/src/main/java/me/lemire/integercompression/NewPFDS9.java
index 89a8b4c..c8389c1 100644
--- a/src/main/java/me/lemire/integercompression/NewPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/NewPFDS9.java
@@ -49,8 +49,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
- final int finalinpos = inpos.get() + inlength;
- encodePage(in, inpos, finalinpos, out, outpos);
+ encodePage(in, inpos, inlength, out, outpos);
}
private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
@@ -128,8 +127,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- final int finalout = outpos.get() + mynvalue;
- decodePage(in, inpos, out, outpos, finalout);
+ decodePage(in, inpos, out, outpos, mynvalue);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/OptPFD.java b/src/main/java/me/lemire/integercompression/OptPFD.java
index c51545d..8c90586 100644
--- a/src/main/java/me/lemire/integercompression/OptPFD.java
+++ b/src/main/java/me/lemire/integercompression/OptPFD.java
@@ -49,8 +49,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
- final int finalinpos = inpos.get() + inlength;
- encodePage(in, inpos, finalinpos, out, outpos);
+ encodePage(in, inpos, inlength, out, outpos);
}
private static final int[] bits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
@@ -145,8 +144,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- final int finalout = outpos.get() + mynvalue;
- decodePage(in, inpos, out, outpos, finalout);
+ decodePage(in, inpos, out, outpos, mynvalue);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS16.java b/src/main/java/me/lemire/integercompression/OptPFDS16.java
index 13da6bf..8574b10 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS16.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS16.java
@@ -49,8 +49,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
- final int finalinpos = inpos.get() + inlength;
- encodePage(in, inpos, finalinpos, out, outpos);
+ encodePage(in, inpos, inlength, out, outpos);
}
@@ -145,8 +144,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- final int finalout = outpos.get() + mynvalue;
- decodePage(in, inpos, out, outpos, finalout);
+ decodePage(in, inpos, out, outpos, mynvalue);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
diff --git a/src/main/java/me/lemire/integercompression/OptPFDS9.java b/src/main/java/me/lemire/integercompression/OptPFDS9.java
index 64981ef..34f4206 100644
--- a/src/main/java/me/lemire/integercompression/OptPFDS9.java
+++ b/src/main/java/me/lemire/integercompression/OptPFDS9.java
@@ -48,9 +48,7 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
if (inlength == 0)
return;
-
- final int finalinpos = inpos.get() + inlength;
- encodePage(in, inpos, finalinpos, out, outpos);
+ encodePage(in, inpos, inlength, out, outpos);
}
@@ -145,8 +143,7 @@ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
if (inlength == 0)
return;
mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- final int finalout = outpos.get() + mynvalue;
- decodePage(in, inpos, out, outpos, finalout);
+ decodePage(in, inpos, out, outpos, mynvalue);
}
private void decodePage(int[] in, IntWrapper inpos, int[] out,
From bea8a0c24a8c446b1300d3aaeec0b81082dbcc00 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Wed, 17 Sep 2014 19:09:21 -0400
Subject: [PATCH 040/266] Skippable integrated binary packing.
---
.../benchmarktools/BenchmarkSkippable.java | 587 ++++++++----------
.../differential/IntegratedBinaryPacking.java | 259 +++++---
.../differential/IntegratedComposition.java | 2 +-
.../differential/IntegratedVariableByte.java | 82 ++-
.../SkippableIntegratedComposition.java | 73 +++
.../SkippableIntegratedIntegerCODEC.java | 73 +++
6 files changed, 645 insertions(+), 431 deletions(-)
create mode 100644 src/main/java/me/lemire/integercompression/differential/SkippableIntegratedComposition.java
create mode 100644 src/main/java/me/lemire/integercompression/differential/SkippableIntegratedIntegerCODEC.java
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
index c14adb1..8db991f 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
@@ -6,16 +6,9 @@
*/
package me.lemire.integercompression.benchmarktools;
-import com.kamikaze.pfordelta.PForDelta;
-
import me.lemire.integercompression.BinaryPacking;
-import me.lemire.integercompression.ByteIntegerCODEC;
-import me.lemire.integercompression.Composition;
-import me.lemire.integercompression.DeltaZigzagBinaryPacking;
-import me.lemire.integercompression.DeltaZigzagVariableByte;
import me.lemire.integercompression.FastPFOR;
import me.lemire.integercompression.IntWrapper;
-import me.lemire.integercompression.IntegerCODEC;
import me.lemire.integercompression.JustCopy;
import me.lemire.integercompression.NewPFD;
import me.lemire.integercompression.NewPFDS16;
@@ -30,19 +23,14 @@
import me.lemire.integercompression.VariableByte;
import me.lemire.integercompression.differential.Delta;
import me.lemire.integercompression.differential.IntegratedBinaryPacking;
-import me.lemire.integercompression.differential.IntegratedByteIntegerCODEC;
-import me.lemire.integercompression.differential.IntegratedComposition;
-import me.lemire.integercompression.differential.IntegratedFastPFOR;
-import me.lemire.integercompression.differential.IntegratedIntegerCODEC;
import me.lemire.integercompression.differential.IntegratedVariableByte;
-import me.lemire.integercompression.differential.XorBinaryPacking;
+import me.lemire.integercompression.differential.SkippableIntegratedComposition;
+import me.lemire.integercompression.differential.SkippableIntegratedIntegerCODEC;
import me.lemire.integercompression.synth.ClusteredDataGenerator;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
import java.util.Arrays;
/**
@@ -53,371 +41,300 @@
*
*/
public class BenchmarkSkippable {
-
- private static int compressWithSkipTable(SkippableIntegerCODEC c, int[] data, int[] output, IntWrapper outpos, int[] metadata, int blocksize) {
+
+ private static int compressWithSkipTable(Object c, int[] data,
+ int[] output, IntWrapper outpos, int[] metadata, int blocksize) {
int metapos = 0;
metadata[metapos++] = data.length;
IntWrapper inpos = new IntWrapper();
int initvalue = 0;
- while(inpos.get() < data.length) {
+ IntWrapper ival = new IntWrapper(initvalue);
+ while (inpos.get() < data.length) {
metadata[metapos++] = outpos.get();
metadata[metapos++] = initvalue;
- if (!(c instanceof IntegratedIntegerCODEC)) {
- int size = blocksize > data.length - inpos.get() ? data.length - inpos.get() : blocksize;
- initvalue = Delta.delta(data,inpos.get(),size,initvalue);
+ if (c instanceof SkippableIntegerCODEC) {
+ int size = blocksize > data.length - inpos.get() ? data.length
+ - inpos.get() : blocksize;
+ initvalue = Delta.delta(data, inpos.get(), size, initvalue);
+
+ ((SkippableIntegerCODEC) c).headlessCompress(data, inpos,
+ blocksize, output, outpos);
+ } else if (c instanceof SkippableIntegratedIntegerCODEC) {
+ ival.set(initvalue);
+ ((SkippableIntegratedIntegerCODEC) c).headlessCompress(data,
+ inpos, blocksize, output, outpos, ival);
+ initvalue = ival.get();
+ } else {
+ throw new RuntimeException("Unrecognized codec " + c);
}
- c.headlessCompress(data, inpos, blocksize, output, outpos);
}
return metapos;
}
- private static int decompressFromSkipTable(SkippableIntegerCODEC c, int[] compressed, IntWrapper compressedpos, int[] metadata, int blocksize, int[] data) {
+
+ private static int decompressFromSkipTable(Object c, int[] compressed,
+ IntWrapper compressedpos, int[] metadata, int blocksize, int[] data) {
int metapos = 0;
int length = metadata[metapos++];
IntWrapper uncomppos = new IntWrapper();
- while(uncomppos.get() < length) {
+ IntWrapper ival = new IntWrapper();
+ while (uncomppos.get() < length) {
int num = blocksize;
- if(num > length - uncomppos.get()) num = length - uncomppos.get();
+ if (num > length - uncomppos.get())
+ num = length - uncomppos.get();
int location = metadata[metapos++];
+ // System.out.println("location = "+location);
int initvalue = metadata[metapos++];
int outputlocation = uncomppos.get();
- if(location != compressedpos.get()) throw new RuntimeException("Bug "+location+" "+compressedpos.get());
- c.headlessUncompress(compressed, compressedpos, compressed.length - uncomppos.get(), data, uncomppos, num);
- if (!(c instanceof IntegratedIntegerCODEC)) {
- initvalue = Delta.fastinverseDelta(data, outputlocation, num, initvalue);
+ if (location != compressedpos.get())
+ throw new RuntimeException("Bug " + location + " "
+ + compressedpos.get()+ " codec "+c);
+ if (c instanceof SkippableIntegerCODEC) {
+ ((SkippableIntegerCODEC) c).headlessUncompress(compressed,
+ compressedpos, compressed.length - uncomppos.get(),
+ data, uncomppos, num);
+ initvalue = Delta.fastinverseDelta(data, outputlocation, num,
+ initvalue);
+ } else if (c instanceof SkippableIntegratedIntegerCODEC) {
+ ival.set(initvalue);
+ ((SkippableIntegratedIntegerCODEC) c).headlessUncompress(
+ compressed, compressedpos, compressed.length
+ - uncomppos.get(), data, uncomppos, num, ival);
+ // System.out.println("compressedpos = "+compressedpos);
+
+ } else {
+ throw new RuntimeException("Unrecognized codec " + c);
}
}
return length;
}
- /**
- * Standard benchmark
- *
- * @param csvLog
- * Writer for CSV log.
- * @param c
- * the codec
- * @param data
- * arrays of input data
- * @param repeat
- * How many times to repeat the test
- * @param verbose
- * whether to output result on screen
- */
- private static void testCodec(PrintWriter csvLog, int sparsity,
- SkippableIntegerCODEC c, int[][] data, int repeat, boolean verbose) {
- if (verbose) {
- System.out.println("# " + c.toString());
- System.out
- .println("# bits per int, compress speed (mis), decompression speed (mis) ");
- }
-
- int N = data.length;
+ /**
+ * Standard benchmark
+ *
+ * @param csvLog
+ * Writer for CSV log.
+ * @param c
+ * the codec
+ * @param data
+ * arrays of input data
+ * @param repeat
+ * How many times to repeat the test
+ * @param verbose
+ * whether to output result on screen
+ */
+ private static void testCodec(PrintWriter csvLog, int sparsity, Object c,
+ int[][] data, int repeat, boolean verbose) {
+ if (verbose) {
+ System.out.println("# " + c.toString());
+ System.out
+ .println("# bits per int, compress speed (mis), decompression speed (mis) ");
+ }
- int totalSize = 0;
- int maxLength = 0;
- for (int k = 0; k < N; ++k) {
- totalSize += data[k].length;
- if (data[k].length > maxLength) {
- maxLength = data[k].length;
- }
- }
+ int N = data.length;
- // 4x + 1024 to account for the possibility of some negative
- // compression.
- int[] compressBuffer = new int[4 * maxLength + 1024];
- int[] decompressBuffer = new int[maxLength + 1024];
- int[] metadataBuffer = new int[maxLength];
- final int blocksize = 1024;
+ int totalSize = 0;
+ int maxLength = 0;
+ for (int k = 0; k < N; ++k) {
+ totalSize += data[k].length;
+ if (data[k].length > maxLength) {
+ maxLength = data[k].length;
+ }
+ }
- // These variables hold time in microseconds (10^-6).
- double compressTime = 0;
- double decompressTime = 0;
- final int times = 5;
+ // 4x + 1024 to account for the possibility of some negative
+ // compression.
+ int[] compressBuffer = new int[4 * maxLength + 1024];
+ int[] decompressBuffer = new int[maxLength + 1024];
+ int[] metadataBuffer = new int[maxLength];
+ final int blocksize = 1024;
- int size = 0;
+ // These variables hold time in microseconds (10^-6).
+ double compressTime = 0;
+ double decompressTime = 0;
+ final int times = 5;
- for (int r = 0; r < repeat; ++r) {
- size = 0;
- for (int k = 0; k < N; ++k) {
- int[] backupdata = Arrays.copyOf(data[k],
- data[k].length);
+ int size = 0;
- // compress data.
- long beforeCompress = System.nanoTime() / 1000;
- IntWrapper outpos = new IntWrapper();
- compressWithSkipTable(c, backupdata, compressBuffer, outpos, metadataBuffer,blocksize );
- long afterCompress = System.nanoTime() / 1000;
+ for (int r = 0; r < repeat; ++r) {
+ size = 0;
+ for (int k = 0; k < N; ++k) {
+ int[] backupdata = Arrays.copyOf(data[k], data[k].length);
- // measure time of compression.
- compressTime += afterCompress - beforeCompress;
- final int thiscompsize = outpos.get();
- size += thiscompsize;
- // dry run
- int volume = 0;
- {
- IntWrapper compressedpos = new IntWrapper(0);
- volume = decompressFromSkipTable(c, compressBuffer, compressedpos, metadataBuffer, blocksize, decompressBuffer);
- }
- // extract (uncompress) data
- long beforeDecompress = System.nanoTime() / 1000;
- for(int t = 0; t maxlength)
- maxlength = data[k].length;
- }
- int[] buffer = new int[maxlength + 1024];
- /*
- * 4x + 1024 to account for the possibility of some negative
- * compression
- */
- int size = 0;
- int comptime = 0;
- long decomptime = 0;
- for (int r = 0; r < repeat; ++r) {
- size = 0;
- for (int k = 0; k < N; ++k) {
- int outpos = 0;
- int[] backupdata = Arrays.copyOf(data[k],
- data[k].length);
- //
- bef = System.nanoTime() / 1000;
- Delta.delta(backupdata);
- ArrayList dataout = new ArrayList(
- data[k].length / 128);
- for (int K = 0; K < data[k].length; K += 128) {
- final int[] compressedbuf = PForDelta
- .compressOneBlockOpt(Arrays
- .copyOfRange(
- backupdata, K,
- K + 128), 128);
- dataout.add(compressedbuf);
- outpos += compressedbuf.length;
- }
- aft = System.nanoTime() / 1000;
- //
- comptime += aft - bef;
- final int thiscompsize = outpos;
- size += thiscompsize;
- //
- bef = System.nanoTime() / 1000;
- ArrayList datauncomp = new ArrayList(
- dataout.size());
- int deltaoffset = 0;
+ if (verbose) {
+ double bitsPerInt = size * 32.0 / totalSize;
+ long compressSpeed = Math
+ .round(totalSize * repeat / (compressTime));
+ long decompressSpeed = Math.round(totalSize * repeat
+ / (decompressTime));
+ System.out.println(String.format("\t%1$.2f\t%2$d\t%3$d",
+ bitsPerInt, compressSpeed, decompressSpeed));
+ csvLog.format("\"%1$s\",%2$d,%3$.2f,%4$d,%5$d\n", c.toString(),
+ sparsity, bitsPerInt, compressSpeed, decompressSpeed);
+ csvLog.flush();
+ }
+ }
- for (int[] compbuf : dataout) {
- int[] tmpbuf = new int[128];
- PForDelta.decompressOneBlock(tmpbuf,
- compbuf, 128);
- tmpbuf[0] += deltaoffset;
- Delta.fastinverseDelta(tmpbuf);
- deltaoffset = tmpbuf[127];
- datauncomp.add(tmpbuf);
- }
- aft = System.nanoTime() / 1000;
- //
- decomptime += aft - bef;
- if (datauncomp.size() * 128 != data[k].length)
- throw new RuntimeException(
- "we have a bug (diff length) "
- + " expected "
- + data[k].length
- + " got "
- + datauncomp.size()
- * 128);
- for (int m = 0; m < data[k].length; ++m)
- if (datauncomp.get(m / 128)[m % 128] != data[k][m]) {
- throw new RuntimeException(
- "we have a bug (actual difference), expected "
- + data[k][m]
- + " found "
- + buffer[m]
- + " at " + m);
- }
+ /**
+ * Main method.
+ *
+ * @param args
+ * command-line arguments
+ * @throws FileNotFoundException
+ * when we fail to create a new file
+ */
+ public static void main(String args[]) throws FileNotFoundException {
+ System.out.println("# benchmark based on the ClusterData model from:");
+ System.out.println("# Vo Ngoc Anh and Alistair Moffat. ");
+ System.out.println("# Index compression using 64-bit words.");
+ System.out
+ .println("# Softw. Pract. Exper.40, 2 (February 2010), 131-147. ");
+ System.out.println();
- }
- }
-
- line += "\t" + df.format(size * 32.0 / totalsize);
- line += "\t" + dfspeed.format(totalsize * repeat / (comptime));
- line += "\t"
- + dfspeed.format(totalsize * repeat / (decomptime));
- if (verbose)
- System.out.println(line);
+ PrintWriter writer = null;
+ try {
+ File csvFile = new File(String.format(
+ "benchmark-%1$tY%1$tm%1$tdT%1$tH%1$tM%1$tS.csv",
+ System.currentTimeMillis()));
+ writer = new PrintWriter(csvFile);
+ System.out.println("# Results will be written into a CSV file: "
+ + csvFile.getName());
+ System.out.println();
+ test(writer, 20, 18, 10);
+ System.out.println();
+ System.out.println("Results were written into a CSV file: "
+ + csvFile.getName());
+ } finally {
+ if (writer != null) {
+ writer.close();
+ }
}
+ }
- /**
- * Generate test data.
- *
- * @param N
- * How many input arrays to generate
- * @param nbr
- * How big (in log2) should the arrays be
- * @param sparsity
- * How sparse test data generated
- */
- private static int[][] generateTestData(ClusteredDataGenerator dataGen,
- int N, int nbr, int sparsity) {
- final int[][] data = new int[N][];
- final int dataSize = (1 << (nbr + sparsity));
- for (int i = 0; i < N; ++i) {
- data[i] = dataGen.generateClustered((1 << nbr),
- dataSize);
- }
- return data;
+ /**
+ * Generate test data.
+ *
+ * @param N
+ * How many input arrays to generate
+ * @param nbr
+ * How big (in log2) should the arrays be
+ * @param sparsity
+ * How sparse test data generated
+ */
+ private static int[][] generateTestData(ClusteredDataGenerator dataGen,
+ int N, int nbr, int sparsity) {
+ final int[][] data = new int[N][];
+ final int dataSize = (1 << (nbr + sparsity));
+ for (int i = 0; i < N; ++i) {
+ data[i] = dataGen.generateClustered((1 << nbr), dataSize);
}
- static SkippableIntegerCODEC[] codecs = {
- new JustCopy(),
- new VariableByte(),
- new SkippableComposition(new BinaryPacking(), new VariableByte()),
- new SkippableComposition(new NewPFD(), new VariableByte()),
- new SkippableComposition(new NewPFDS9(), new VariableByte()),
- new SkippableComposition(new NewPFDS16(), new VariableByte()),
- new SkippableComposition(new OptPFD(), new VariableByte()),
- new SkippableComposition(new OptPFDS9(), new VariableByte()),
- new SkippableComposition(new OptPFDS16(), new VariableByte()),
- new SkippableComposition(new FastPFOR(), new VariableByte()),
- new Simple9(),
- new Simple16() };
- /**
- * Generates data and calls other tests.
- *
- * @param csvLog
- * Writer for CSV log.
- * @param N
- * How many input arrays to generate
- * @param nbr
- * how big (in log2) should the arrays be
- * @param repeat
- * How many times should we repeat tests.
- */
- private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
- csvLog.format("\"Algorithm\",\"Sparsity\",\"Bits per int\",\"Compress speed (MiS)\",\"Decompress speed (MiS)\"\n");
- ClusteredDataGenerator cdg = new ClusteredDataGenerator();
- final int max_sparsity = 31 - nbr;
- for (int sparsity = 1; sparsity < max_sparsity; ++sparsity) {
- System.out.println("# sparsity " + sparsity);
- System.out.println("# generating random data...");
- int[][] data = generateTestData(cdg, N, nbr, sparsity);
- System.out.println("# generating random data... ok.");
- for(SkippableIntegerCODEC c : codecs) {
- testCodec(csvLog, sparsity, c, data, sparsity, false);
- testCodec(csvLog, sparsity, c, data, sparsity, false);
- testCodec(csvLog, sparsity, c, data, sparsity, true);
- }
+ return data;
+ }
+ static Object[] codecs = {
+ new IntegratedBinaryPacking(),
+ new IntegratedVariableByte(),
+ new SkippableIntegratedComposition(new IntegratedBinaryPacking(),
+ new IntegratedVariableByte()),
+ new JustCopy(),
+ new VariableByte(),
+
+ new SkippableComposition(new BinaryPacking(), new VariableByte()),
+ new SkippableComposition(new NewPFD(), new VariableByte()),
+ new SkippableComposition(new NewPFDS9(), new VariableByte()),
+ new SkippableComposition(new NewPFDS16(), new VariableByte()),
+ new SkippableComposition(new OptPFD(), new VariableByte()),
+ new SkippableComposition(new OptPFDS9(), new VariableByte()),
+ new SkippableComposition(new OptPFDS16(), new VariableByte()),
+ new SkippableComposition(new FastPFOR(), new VariableByte()),
+ new Simple9(), new Simple16() };
+
+ /**
+ * Generates data and calls other tests.
+ *
+ * @param csvLog
+ * Writer for CSV log.
+ * @param N
+ * How many input arrays to generate
+ * @param nbr
+ * how big (in log2) should the arrays be
+ * @param repeat
+ * How many times should we repeat tests.
+ */
+ private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
+ csvLog.format("\"Algorithm\",\"Sparsity\",\"Bits per int\",\"Compress speed (MiS)\",\"Decompress speed (MiS)\"\n");
+ ClusteredDataGenerator cdg = new ClusteredDataGenerator();
+ final int max_sparsity = 31 - nbr;
+
+ for (int sparsity = 1; sparsity < max_sparsity; ++sparsity) {
+ System.out.println("# sparsity " + sparsity);
+ System.out.println("# generating random data...");
+ int[][] data = generateTestData(cdg, N, nbr, sparsity);
+ System.out.println("# generating random data... ok.");
+ for (Object c : codecs) {
+ testCodec(csvLog, sparsity, c, data, repeat, false);
+ testCodec(csvLog, sparsity, c, data, repeat, false);
+ testCodec(csvLog, sparsity, c, data, repeat, true);
+ }
- }
}
+ }
}
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java b/src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java
index 82f95b2..7c3bbf9 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedBinaryPacking.java
@@ -11,119 +11,198 @@
import me.lemire.integercompression.Util;
/**
- * Scheme based on a commonly used idea: can be extremely fast.
+ * Scheme based on a commonly used idea: can be extremely fast.
*
* You should only use this scheme on sorted arrays. Use BinaryPacking if you
* have unsorted arrays.
*
- * It encodes integers in blocks of 128 integers. For arrays containing
- * an arbitrary number of integers, you should use it in conjunction
- * with another CODEC:
+ * It encodes integers in blocks of 128 integers. For arrays containing an
+ * arbitrary number of integers, you should use it in conjunction with another
+ * CODEC:
*
- * IntegratedIntegerCODEC is =
+ *
+ * IntegratedIntegerCODEC is =
* new IntegratedComposition(new IntegratedBinaryPacking(),
- * new IntegratedVariableByte())
+ * new IntegratedVariableByte())
+ *
*
*
* For details, please see
*
*
* Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
- * through vectorization Software: Practice & Experience
- * http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract
- * http://arxiv.org/abs/1209.2137
+ * through vectorization Software: Practice & Experience http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract http://arxiv.org/abs/1209.2137
*
*
- * Daniel Lemire, Leonid Boytsov, Nathan Kurz,
- * SIMD Compression and the Intersection of Sorted Integers
- * http://arxiv.org/abs/1401.6399
+ * Daniel Lemire, Leonid Boytsov, Nathan Kurz, SIMD Compression and the
+ * Intersection of Sorted Integers http://arxiv.org/abs/1401.6399
*
*
* @author Daniel Lemire
*
*/
-public class IntegratedBinaryPacking implements IntegratedIntegerCODEC {
+public class IntegratedBinaryPacking implements IntegratedIntegerCODEC,
+ SkippableIntegratedIntegerCODEC {
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- inlength = inlength / 128 * 128;
- if (inlength == 0)
- return;
- out[outpos.get()] = inlength;
- outpos.increment();
- int tmpoutpos = outpos.get();
- int initoffset = 0;
- for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
- final int mbits1 = Util.maxdiffbits(initoffset, in, s,
- 32);
- int initoffset2 = in[s + 31];
- final int mbits2 = Util.maxdiffbits(initoffset2, in,
- s + 32, 32);
- int initoffset3 = in[s + 32 + 31];
- final int mbits3 = Util.maxdiffbits(initoffset3, in,
- s + 2 * 32, 32);
- int initoffset4 = in[s + 2 * 32 + 31];
- final int mbits4 = Util.maxdiffbits(initoffset4, in,
- s + 3 * 32, 32);
- out[tmpoutpos++] = (mbits1 << 24) | (mbits2 << 16)
- | (mbits3 << 8) | (mbits4);
- IntegratedBitPacking.integratedpack(initoffset, in, s,
- out, tmpoutpos, mbits1);
- tmpoutpos += mbits1;
- IntegratedBitPacking.integratedpack(initoffset2, in,
- s + 32, out, tmpoutpos, mbits2);
- tmpoutpos += mbits2;
- IntegratedBitPacking.integratedpack(initoffset3, in,
- s + 2 * 32, out, tmpoutpos, mbits3);
- tmpoutpos += mbits3;
- IntegratedBitPacking.integratedpack(initoffset4, in,
- s + 3 * 32, out, tmpoutpos, mbits4);
- tmpoutpos += mbits4;
- initoffset = in[s + 3 * 32 + 31];
- }
- inpos.add(inlength);
- outpos.set(tmpoutpos);
+ static final int BLOCK_SIZE = 128;
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ int tmpoutpos = outpos.get();
+ int initoffset = 0;
+ for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
+ final int mbits1 = Util.maxdiffbits(initoffset, in, s, 32);
+ int initoffset2 = in[s + 31];
+ final int mbits2 = Util.maxdiffbits(initoffset2, in, s + 32, 32);
+ int initoffset3 = in[s + 32 + 31];
+ final int mbits3 = Util
+ .maxdiffbits(initoffset3, in, s + 2 * 32, 32);
+ int initoffset4 = in[s + 2 * 32 + 31];
+ final int mbits4 = Util
+ .maxdiffbits(initoffset4, in, s + 3 * 32, 32);
+ out[tmpoutpos++] = (mbits1 << 24) | (mbits2 << 16) | (mbits3 << 8)
+ | (mbits4);
+ IntegratedBitPacking.integratedpack(initoffset, in, s, out,
+ tmpoutpos, mbits1);
+ tmpoutpos += mbits1;
+ IntegratedBitPacking.integratedpack(initoffset2, in, s + 32, out,
+ tmpoutpos, mbits2);
+ tmpoutpos += mbits2;
+ IntegratedBitPacking.integratedpack(initoffset3, in, s + 2 * 32,
+ out, tmpoutpos, mbits3);
+ tmpoutpos += mbits3;
+ IntegratedBitPacking.integratedpack(initoffset4, in, s + 3 * 32,
+ out, tmpoutpos, mbits4);
+ tmpoutpos += mbits4;
+ initoffset = in[s + 3 * 32 + 31];
+ }
+ inpos.add(inlength);
+ outpos.set(tmpoutpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ int tmpinpos = inpos.get();
+ int initoffset = 0;
+ for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
+ final int mbits1 = (in[tmpinpos] >>> 24);
+ final int mbits2 = (in[tmpinpos] >>> 16) & 0xFF;
+ final int mbits3 = (in[tmpinpos] >>> 8) & 0xFF;
+ final int mbits4 = (in[tmpinpos]) & 0xFF;
+ ++tmpinpos;
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s, mbits1);
+ tmpinpos += mbits1;
+ initoffset = out[s + 31];
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s + 32, mbits2);
+ tmpinpos += mbits2;
+ initoffset = out[s + 32 + 31];
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s + 2 * 32, mbits3);
+ tmpinpos += mbits3;
+ initoffset = out[s + 2 * 32 + 31];
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s + 3 * 32, mbits4);
+ tmpinpos += mbits4;
+ initoffset = out[s + 3 * 32 + 31];
}
+ outpos.add(outlength);
+ inpos.set(tmpinpos);
+ }
- @Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- if (inlength == 0)
- return;
- final int outlength = in[inpos.get()];
- inpos.increment();
- int tmpinpos = inpos.get();
- int initoffset = 0;
- for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
- final int mbits1 = (in[tmpinpos] >>> 24);
- final int mbits2 = (in[tmpinpos] >>> 16) & 0xFF;
- final int mbits3 = (in[tmpinpos] >>> 8) & 0xFF;
- final int mbits4 = (in[tmpinpos]) & 0xFF;
- ++tmpinpos;
- IntegratedBitPacking.integratedunpack(initoffset, in,
- tmpinpos, out, s, mbits1);
- tmpinpos += mbits1;
- initoffset = out[s + 31];
- IntegratedBitPacking.integratedunpack(initoffset, in,
- tmpinpos, out, s + 32, mbits2);
- tmpinpos += mbits2;
- initoffset = out[s + 32 + 31];
- IntegratedBitPacking.integratedunpack(initoffset, in,
- tmpinpos, out, s + 2 * 32, mbits3);
- tmpinpos += mbits3;
- initoffset = out[s + 2 * 32 + 31];
- IntegratedBitPacking.integratedunpack(initoffset, in,
- tmpinpos, out, s + 3 * 32, mbits4);
- tmpinpos += mbits4;
- initoffset = out[s + 3 * 32 + 31];
- }
- outpos.add(outlength);
- inpos.set(tmpinpos);
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
+
+ @Override
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, IntWrapper initvalue) {
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ int tmpoutpos = outpos.get();
+ int initoffset = initvalue.get();
+ initvalue.set(in[inpos.get()+inlength -1]);
+
+ for (int s = inpos.get(); s < inpos.get() + inlength; s += 32 * 4) {
+ final int mbits1 = Util.maxdiffbits(initoffset, in, s, 32);
+ int initoffset2 = in[s + 31];
+ final int mbits2 = Util.maxdiffbits(initoffset2, in, s + 32, 32);
+ int initoffset3 = in[s + 32 + 31];
+ final int mbits3 = Util
+ .maxdiffbits(initoffset3, in, s + 2 * 32, 32);
+ int initoffset4 = in[s + 2 * 32 + 31];
+ final int mbits4 = Util
+ .maxdiffbits(initoffset4, in, s + 3 * 32, 32);
+ out[tmpoutpos++] = (mbits1 << 24) | (mbits2 << 16) | (mbits3 << 8)
+ | (mbits4);
+ IntegratedBitPacking.integratedpack(initoffset, in, s, out,
+ tmpoutpos, mbits1);
+ tmpoutpos += mbits1;
+ IntegratedBitPacking.integratedpack(initoffset2, in, s + 32, out,
+ tmpoutpos, mbits2);
+ tmpoutpos += mbits2;
+ IntegratedBitPacking.integratedpack(initoffset3, in, s + 2 * 32,
+ out, tmpoutpos, mbits3);
+ tmpoutpos += mbits3;
+ IntegratedBitPacking.integratedpack(initoffset4, in, s + 3 * 32,
+ out, tmpoutpos, mbits4);
+ tmpoutpos += mbits4;
+ initoffset = in[s + 3 * 32 + 31];
}
+ inpos.add(inlength);
+ outpos.set(tmpoutpos);
+ }
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
+ @Override
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int num, IntWrapper initvalue) {
+ final int outlength = num;
+ int tmpinpos = inpos.get();
+ int initoffset = initvalue.get();
+ for (int s = outpos.get(); s < outpos.get() + outlength; s += 32 * 4) {
+ final int mbits1 = (in[tmpinpos] >>> 24);
+ final int mbits2 = (in[tmpinpos] >>> 16) & 0xFF;
+ final int mbits3 = (in[tmpinpos] >>> 8) & 0xFF;
+ final int mbits4 = (in[tmpinpos]) & 0xFF;
+ ++tmpinpos;
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s, mbits1);
+ tmpinpos += mbits1;
+ initoffset = out[s + 31];
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s + 32, mbits2);
+ tmpinpos += mbits2;
+ initoffset = out[s + 32 + 31];
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s + 2 * 32, mbits3);
+ tmpinpos += mbits3;
+ initoffset = out[s + 2 * 32 + 31];
+ IntegratedBitPacking.integratedunpack(initoffset, in, tmpinpos,
+ out, s + 3 * 32, mbits4);
+ tmpinpos += mbits4;
+ initoffset = out[s + 3 * 32 + 31];
}
+ outpos.add(outlength);
+ initvalue.set(out[outpos.get()-1]);
+ inpos.set(tmpinpos);
+
+ }
}
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java b/src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java
index 4843497..c7c3af5 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedComposition.java
@@ -64,7 +64,7 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
@Override
public String toString() {
- return F1.toString() + " + " + F2.toString() + " (Integrated)";
+ return F1.toString() + " + " + F2.toString();
}
}
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
index 9d3d925..74de784 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedVariableByte.java
@@ -21,7 +21,8 @@
*
* @author Daniel Lemire
*/
-public class IntegratedVariableByte implements IntegratedIntegerCODEC, IntegratedByteIntegerCODEC {
+public class IntegratedVariableByte implements IntegratedIntegerCODEC, IntegratedByteIntegerCODEC,
+SkippableIntegratedIntegerCODEC {
private static byte extract7bits(int i, long val) {
return (byte)((val >> (7 * i)) & ((1 << 7) - 1));
@@ -123,10 +124,8 @@ public void uncompress(int[] in, IntWrapper inpos, int inlength,
val = in[p];
int c = (byte) (val >>> s);
s += 8;
- if (s == 32) {
- s = 0;
- p++;
- }
+ p += s>>5;
+ s = s & 31;
v += ((c & 127) << shift);
if ((c & 128) == 128) {
out[tmpoutpos] = v + initoffset;
@@ -181,4 +180,77 @@ public String toString() {
return this.getClass().getSimpleName();
}
+ @Override
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, IntWrapper initvalue) {
+ if (inlength == 0)
+ return;
+ int initoffset = initvalue.get();
+ initvalue.set(in[inpos.get()+inlength -1]);
+ ByteBuffer buf = ByteBuffer.allocateDirect(inlength * 8);
+ buf.order(ByteOrder.LITTLE_ENDIAN);
+ for (int k = inpos.get(); k < inpos.get() + inlength; ++k) {
+ final long val = (in[k] - initoffset) & 0xFFFFFFFFL; // To be consistent with unsigned integers in C/C++
+ initoffset = in[k];
+ if (val < (1 << 7)) {
+ buf.put((byte) (val | (1 << 7)));
+ } else if (val < (1 << 14)) {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) (extract7bitsmaskless(1, (val)) | (1 << 7)));
+ } else if (val < (1 << 21)) {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) extract7bits(1, val));
+ buf.put((byte) (extract7bitsmaskless(2, (val)) | (1 << 7)));
+ } else if (val < (1 << 28)) {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) extract7bits(1, val));
+ buf.put((byte) extract7bits(2, val));
+ buf.put((byte) (extract7bitsmaskless(3, (val)) | (1 << 7)));
+ } else {
+ buf.put((byte) extract7bits(0, val));
+ buf.put((byte) extract7bits(1, val));
+ buf.put((byte) extract7bits(2, val));
+ buf.put((byte) extract7bits(3, val));
+ buf.put((byte) (extract7bitsmaskless(4, (val)) | (1 << 7)));
+ }
+ }
+ while (buf.position() % 4 != 0)
+ buf.put((byte) 0);
+ final int length = buf.position();
+ buf.flip();
+ IntBuffer ibuf = buf.asIntBuffer();
+ ibuf.get(out, outpos.get(), length / 4);
+ outpos.add(length / 4);
+ inpos.add(inlength);
+ }
+
+ @Override
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int num, IntWrapper initvalue) {
+ int s = 0;
+ int val = 0;
+ int p = inpos.get();
+ int initoffset = initvalue.get();
+ int tmpoutpos = outpos.get();
+ int finaloutpos = num + tmpoutpos;
+ for (int v = 0, shift = 0; tmpoutpos < finaloutpos;) {
+ val = in[p];
+ int c = (byte) (val >>> s);
+ s += 8;
+ p += s>>5;
+ s = s & 31;
+ v += ((c & 127) << shift);
+ if ((c & 128) == 128) {
+ out[tmpoutpos++] = (initoffset = initoffset + v);
+ v = 0;
+ shift = 0;
+ } else
+ shift += 7;
+ }
+ initvalue.set(out[tmpoutpos-1]);
+ outpos.set(tmpoutpos);
+
+ inpos.set(p + (s!=0 ? 1 : 0));
+ }
+
}
diff --git a/src/main/java/me/lemire/integercompression/differential/SkippableIntegratedComposition.java b/src/main/java/me/lemire/integercompression/differential/SkippableIntegratedComposition.java
new file mode 100644
index 0000000..2dd79a4
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/differential/SkippableIntegratedComposition.java
@@ -0,0 +1,73 @@
+/**
+ * This code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.IntWrapper;
+
+/**
+ * Helper class to compose schemes.
+ *
+ * @author Daniel Lemire
+ */
+public class SkippableIntegratedComposition implements
+ SkippableIntegratedIntegerCODEC {
+ SkippableIntegratedIntegerCODEC F1, F2;
+
+ /**
+ * Compose a scheme from a first one (f1) and a second one (f2). The first
+ * one is called first and then the second one tries to compress whatever
+ * remains from the first run.
+ *
+ * By convention, the first scheme should be such that if, during decoding,
+ * a 32-bit zero is first encountered, then there is no output.
+ *
+ * @param f1
+ * first codec
+ * @param f2
+ * second codec
+ */
+ public SkippableIntegratedComposition(SkippableIntegratedIntegerCODEC f1,
+ SkippableIntegratedIntegerCODEC f2) {
+ F1 = f1;
+ F2 = f2;
+ }
+
+
+
+ @Override
+ public String toString() {
+ return F1.toString() + " + " + F2.toString();
+ }
+
+ @Override
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, IntWrapper initvalue) {
+ if (inlength == 0)
+ return;
+ final int init = inpos.get();
+ F1.headlessCompress(in, inpos, inlength, out, outpos, initvalue);
+ if (outpos.get() == 0) {
+ out[0] = 0;
+ outpos.increment();
+ }
+ inlength -= inpos.get() - init;
+ F2.headlessCompress(in, inpos, inlength, out, outpos, initvalue);
+ }
+
+ @Override
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int num, IntWrapper initvalue) {
+ if (inlength == 0)
+ return;
+ int init = inpos.get();
+ F1.headlessUncompress(in, inpos, inlength, out, outpos,num,initvalue);
+ inlength -= inpos.get() - init;
+ num -= outpos.get();
+ F2.headlessUncompress(in, inpos, inlength, out, outpos,num,initvalue);
+ }
+
+}
diff --git a/src/main/java/me/lemire/integercompression/differential/SkippableIntegratedIntegerCODEC.java b/src/main/java/me/lemire/integercompression/differential/SkippableIntegratedIntegerCODEC.java
new file mode 100644
index 0000000..99e5f9d
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/differential/SkippableIntegratedIntegerCODEC.java
@@ -0,0 +1,73 @@
+/**
+ * This is code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+
+package me.lemire.integercompression.differential;
+
+import me.lemire.integercompression.IntWrapper;
+
+
+/**
+ * Interface describing a standard CODEC to compress integers. This is a
+ * variation on the IntegerCODEC interface meant to be used for random access
+ * and with integrated differential coding.
+ *
+ * The main differences are that we must specify the number of integers we wish to
+ * decode as well as the initial value (for differential coding). This information
+ * might be stored elsewhere.
+ *
+ *
+ * @author Daniel Lemire
+ *
+ */
+public interface SkippableIntegratedIntegerCODEC {
+ /**
+ * Compress data from an array to another array.
+ *
+ * Both inpos and outpos are modified to represent how much data was read
+ * and written to if 12 ints (inlength = 12) are compressed to 3 ints, then
+ * inpos will be incremented by 12 while outpos will be incremented by 3 we
+ * use IntWrapper to pass the values by reference.
+ *
+ * @param in
+ * input array
+ * @param inpos
+ * location in the input array
+ * @param inlength
+ * how many integers to compress
+ * @param out
+ * output array
+ * @param outpos
+ * where to write in the output array
+ * @param initvalue initial value for the purpose of differential coding, the value is automatically updated
+ */
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, IntWrapper initvalue);
+
+ /**
+ * Uncompress data from an array to another array.
+ *
+ * Both inpos and outpos parameters are modified to indicate new positions
+ * after read/write.
+ *
+ * @param in
+ * array containing data in compressed form
+ * @param inpos
+ * where to start reading in the array
+ * @param inlength
+ * length of the compressed data (ignored by some schemes)
+ * @param out
+ * array where to write the compressed output
+ * @param outpos
+ * where to write the compressed output in out
+ * @param num
+ * number of integers we want to decode, the actual number of integers decoded can be less
+ * @param initvalue initial value for the purpose of differential coding, the value is automatically updated
+ */
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos, int num, IntWrapper initvalue);
+
+}
From db9cc1e2ff1f36cb302cf6db8ea27c4cbfc9d70e Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 00:58:04 -0400
Subject: [PATCH 041/266] Saving...
---
.../lemire/integercompression/FastPFOR.java | 38 ++++-----
.../me/lemire/integercompression/Util.java | 84 +++++++++++++++++++
.../benchmarktools/Benchmark.java | 32 ++++---
.../benchmarktools/BenchmarkSkippable.java | 23 +++--
.../differential/IntegratedFastPFOR.java | 26 +++---
.../lemire/integercompression/BasicTest.java | 10 ++-
.../lemire/integercompression/TestUtils.java | 52 +++++++++++-
7 files changed, 205 insertions(+), 60 deletions(-)
diff --git a/src/main/java/me/lemire/integercompression/FastPFOR.java b/src/main/java/me/lemire/integercompression/FastPFOR.java
index 14e37b5..0907f74 100644
--- a/src/main/java/me/lemire/integercompression/FastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/FastPFOR.java
@@ -11,10 +11,10 @@
/**
* This is a patching scheme designed for speed.
- * It encodes integers in blocks of 128 integers within pages of
+ * It encodes integers in blocks of integers within pages of
* up to 65536 integers. Note that it is important, to get good
* compression and good performance, to use sizeable blocks (greater than 1024 integers).
- * For arrays containing a number of integers that is not divisible by 128, you should use
+ * For arrays containing a number of integers that is not divisible by BLOCK_SIZE, you should use
* it in conjunction with another CODEC:
*
* IntegerCODEC ic = new Composition(new FastPFOR(), new VariableByte()).
@@ -38,7 +38,7 @@
* @author Daniel Lemire
*/
public final class FastPFOR implements IntegerCODEC,SkippableIntegerCODEC {
- final static int BLOCK_SIZE = 128;
+ final static int BLOCK_SIZE = 256;
final static int OVERHEAD_OF_EACH_EXCEPT = 8;
final static int DEFAULT_PAGE_SIZE = 65536;
@@ -49,7 +49,7 @@ public final class FastPFOR implements IntegerCODEC,SkippableIntegerCODEC {
// Working area for compress and uncompress.
int[] dataPointers;
int[] freqs;
- byte[] bestbbestcexceptmaxb;
+ int[] bestbbestcexceptmaxb = new int[3];
/**
* Construct the FastPFOR CODEC.
@@ -74,7 +74,7 @@ public FastPFOR() {
}
/**
- * Compress data in blocks of 128 integers (if fewer than 128 integers
+ * Compress data in blocks of BLOCK_SIZE integers (if fewer than BLOCK_SIZE integers
* are provided, nothing is done).
*
* @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
@@ -90,7 +90,6 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
// Allocate memory for working area.
dataPointers = new int[33];
freqs = new int[33];
- bestbbestcexceptmaxb = new byte[3];
final int finalinpos = inpos.get() + inlength;
while (inpos.get() != finalinpos) {
@@ -101,7 +100,6 @@ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
dataPointers = null;
freqs = null;
- bestbbestcexceptmaxb = null;
}
private void getBestBFromData(int[] in, int pos) {
@@ -114,11 +112,11 @@ private void getBestBFromData(int[] in, int pos) {
bestbbestcexceptmaxb[0]--;
bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
int bestcost = bestbbestcexceptmaxb[0] * BLOCK_SIZE;
- byte cexcept = 0;
+ int cexcept = 0;
bestbbestcexceptmaxb[1] = cexcept;
for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
cexcept += freqs[b + 1];
- if (cexcept < 0)
+ if (cexcept == BLOCK_SIZE)
break;
// the extra 8 is the cost of storing maxbits
int thiscost = cexcept * OVERHEAD_OF_EACH_EXCEPT
@@ -126,7 +124,7 @@ private void getBestBFromData(int[] in, int pos) {
* BLOCK_SIZE + 8;
if (thiscost < bestcost) {
bestcost = thiscost;
- bestbbestcexceptmaxb[0] = (byte) b;
+ bestbbestcexceptmaxb[0] = b;
bestbbestcexceptmaxb[1] = cexcept;
}
}
@@ -140,17 +138,17 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
// Clear working area.
Arrays.fill(dataPointers, 0);
- // Arrays.fill(bestbbestcexceptmaxb, (byte)0);//DL:unncessary
byteContainer.clear();
int tmpinpos = inpos.get();
for (final int finalinpos = tmpinpos + thissize - BLOCK_SIZE; tmpinpos <= finalinpos; tmpinpos += BLOCK_SIZE) {
- getBestBFromData(in, tmpinpos);
+
+ getBestBFromData(in, tmpinpos);
final int tmpbestb = bestbbestcexceptmaxb[0];
- byteContainer.put(bestbbestcexceptmaxb[0]);
- byteContainer.put(bestbbestcexceptmaxb[1]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[0]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[1]);
if (bestbbestcexceptmaxb[1] > 0) {
- byteContainer.put(bestbbestcexceptmaxb[2]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[2]);
final int index = bestbbestcexceptmaxb[2]
- bestbbestcexceptmaxb[0];
if (dataPointers[index]
@@ -208,7 +206,7 @@ private void encodePage(int[] in, IntWrapper inpos, int thissize,
}
/**
- * Uncompress data in blocks of 128 integers. In this particular case,
+ * Uncompress data in blocks of integers. In this particular case,
* the inlength parameter is ignored: it is deduced from the compressed
* data.
*
@@ -263,18 +261,18 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpinpos = inpos.get();
for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
- final byte b = byteContainer.get();
- final byte cexcept = byteContainer.get();
+ final int b = byteContainer.get();
+ final int cexcept = byteContainer.get() & 0xFF;
for (int k = 0; k < BLOCK_SIZE; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, b);
tmpinpos += b;
}
if (cexcept > 0) {
- final byte maxbits = byteContainer.get();
+ final int maxbits = byteContainer.get();
final int index = maxbits - b;
for (int k = 0; k < cexcept; ++k) {
- final byte pos = byteContainer.get();
+ final int pos = byteContainer.get() &0xFF;
final int exceptvalue = dataTobePacked[index][dataPointers[index]++];
out[pos + tmpoutpos] |= exceptvalue << b;
}
diff --git a/src/main/java/me/lemire/integercompression/Util.java b/src/main/java/me/lemire/integercompression/Util.java
index aa19ca4..0c584e1 100644
--- a/src/main/java/me/lemire/integercompression/Util.java
+++ b/src/main/java/me/lemire/integercompression/Util.java
@@ -6,6 +6,8 @@
*/
package me.lemire.integercompression;
+import java.util.Arrays;
+
/**
* Routine utility functions.
*
@@ -99,7 +101,89 @@ public static int maxdiffbits(int initoffset, int[] i, int pos, int length) {
public static int bits(int i) {
return 32 - Integer.numberOfLeadingZeros(i);
}
+
+ protected static int packsize(int num, int b) {
+ if(b>16) return num;
+ int howmanyfit = 32/b;
+ return (num + howmanyfit - 1)/ howmanyfit;
+ }
+
+ protected static int pack(int[] outputarray, int arraypos, int[] data,
+ int num, int b) {
+ if(num == 0) return arraypos;
+ if (b > 16) {
+ System.arraycopy(data, 0, outputarray, arraypos, num);
+ return num + arraypos;
+ }
+ for(int k = 0 ; k < packsize(num, b); ++k) outputarray[k+arraypos] = 0;
+ int inwordpointer = 0;
+ for (int k = 0; k < num; ++k) {
+ outputarray[arraypos] |= (data[k] << inwordpointer);
+ inwordpointer += b;
+ final int increment = ((inwordpointer + b - 1 ) >> 5);
+ arraypos += increment;
+ inwordpointer &= ~(-increment);
+ }
+ return arraypos + (inwordpointer>0?1:0);
+ }
+
+ protected static int unpack(int[] sourcearray, int arraypos, int[] data,
+ int num, int b) {
+ if (b > 16) {
+ System.arraycopy(sourcearray, arraypos, data, 0, num);
+ return num + arraypos;
+ }
+ final int mask = (1 << b) - 1;
+ int inwordpointer = 0;
+ for (int k = 0; k < num; ++k) {
+ data[k] = (sourcearray[arraypos] & mask);
+ sourcearray[arraypos] >>>= b;
+ inwordpointer += b;
+ final int increment = ((inwordpointer + b - 1) >> 5);
+ arraypos += increment;
+ inwordpointer &= ~(-increment);
+ }
+ return arraypos + (inwordpointer>0?1:0);
+ }
+ protected static int packsizew(int num, int b) {
+ int howmanyfit = 32/b;
+ if (num <= howmanyfit) return 1;
+ return num;
+ }
+
+ protected static int packw(int[] outputarray, int arraypos, int[] data,
+ int num, int b) {
+ int howmanyfit = 32/b;
+ if (num > howmanyfit) {
+ System.arraycopy(data, 0, outputarray, arraypos, num);
+ return num + arraypos;
+ }
+ outputarray[arraypos] = 0;
+ int inwordpointer = 0;
+ for (int k = 0; k < num; ++k) {
+ outputarray[arraypos] |= (data[k] << inwordpointer);
+ inwordpointer += b;
+ }
+ return arraypos + 1;
+ }
+
+ protected static int unpackw(int[] sourcearray, int arraypos, int[] data,
+ int num, int b) {
+ int howmanyfit = 32/b;
+ if (num > howmanyfit) {
+ System.arraycopy(sourcearray, arraypos, data, 0, num);
+ return num + arraypos;
+ }
+ final int mask = (1 << b) - 1;
+ int val = sourcearray[arraypos];
+ for (int k = 0; k < num; ++k) {
+ data[k] = (val & mask);
+ val >>>= b;
+ }
+ return arraypos + 1;
+ }
+
/**
* return floor(value / factor) * factor
*
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
index 7ca21da..e987bde 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
@@ -24,6 +24,7 @@
import me.lemire.integercompression.OptPFDS16;
import me.lemire.integercompression.OptPFDS9;
import me.lemire.integercompression.Simple9;
+import me.lemire.integercompression.SkippableFastPFOR;
import me.lemire.integercompression.VariableByte;
import me.lemire.integercompression.differential.Delta;
import me.lemire.integercompression.differential.IntegratedBinaryPacking;
@@ -145,6 +146,7 @@ private static void testCodec(PrintWriter csvLog, int sparsity,
// verify: compare original array with
// compressed and
// uncompressed.
+
for (int m = 0; m < outpos.get(); ++m) {
if (decompressBuffer[m] != data[k][m]) {
throw new RuntimeException(
@@ -486,6 +488,25 @@ private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
int[][] data = generateTestData(cdg, N, nbr, sparsity);
System.out.println("# generating random data... ok.");
+
+ testCodec(csvLog, sparsity, new Composition(
+ new FastPFOR(), new VariableByte()), data,
+ repeat, false);
+ testCodec(csvLog, sparsity, new Composition(
+ new FastPFOR(), new VariableByte()), data,
+ repeat, false);
+ testCodec(csvLog, sparsity, new Composition(
+ new FastPFOR(), new VariableByte()), data,
+ repeat, true);
+ System.out.println();
+
+ testCodec(csvLog, sparsity, new Composition(new SkippableFastPFOR(), new VariableByte()), data, repeat,
+ false);
+ testCodec(csvLog, sparsity, new Composition(new SkippableFastPFOR(), new VariableByte()), data, repeat,
+ false);
+ testCodec(csvLog, sparsity, new Composition(new SkippableFastPFOR(), new VariableByte()), data, repeat,
+ true);
+
// TODO: support CSV log output.
testKamikaze(data, repeat, false);
testKamikaze(data, repeat, false);
@@ -623,17 +644,6 @@ private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
System.out.println();
}
- testCodec(csvLog, sparsity, new Composition(
- new FastPFOR(), new VariableByte()), data,
- repeat, false);
- testCodec(csvLog, sparsity, new Composition(
- new FastPFOR(), new VariableByte()), data,
- repeat, false);
- testCodec(csvLog, sparsity, new Composition(
- new FastPFOR(), new VariableByte()), data,
- repeat, true);
- System.out.println();
-
testCodec(csvLog, sparsity, new Simple9(), data,
repeat, false);
testCodec(csvLog, sparsity, new Simple9(), data,
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
index 8db991f..9782e92 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
@@ -19,6 +19,7 @@
import me.lemire.integercompression.Simple16;
import me.lemire.integercompression.Simple9;
import me.lemire.integercompression.SkippableComposition;
+import me.lemire.integercompression.SkippableFastPFOR;
import me.lemire.integercompression.SkippableIntegerCODEC;
import me.lemire.integercompression.VariableByte;
import me.lemire.integercompression.differential.Delta;
@@ -82,12 +83,12 @@ private static int decompressFromSkipTable(Object c, int[] compressed,
if (num > length - uncomppos.get())
num = length - uncomppos.get();
int location = metadata[metapos++];
- // System.out.println("location = "+location);
+ // System.out.println("location = "+location);
int initvalue = metadata[metapos++];
int outputlocation = uncomppos.get();
if (location != compressedpos.get())
throw new RuntimeException("Bug " + location + " "
- + compressedpos.get()+ " codec "+c);
+ + compressedpos.get() + " codec " + c);
if (c instanceof SkippableIntegerCODEC) {
((SkippableIntegerCODEC) c).headlessUncompress(compressed,
compressedpos, compressed.length - uncomppos.get(),
@@ -99,7 +100,7 @@ private static int decompressFromSkipTable(Object c, int[] compressed,
((SkippableIntegratedIntegerCODEC) c).headlessUncompress(
compressed, compressedpos, compressed.length
- uncomppos.get(), data, uncomppos, num, ival);
- // System.out.println("compressedpos = "+compressedpos);
+ // System.out.println("compressedpos = "+compressedpos);
} else {
throw new RuntimeException("Unrecognized codec " + c);
@@ -184,7 +185,7 @@ private static void testCodec(PrintWriter csvLog, int sparsity, Object c,
throw new RuntimeException(
"Bad output size with codec " + c);
for (int j = 0; j < volume; ++j) {
- if (data[k][j] != decompressBuffer[j])
+ if (data[k][j] != decompressBuffer[j])
throw new RuntimeException("bug in codec " + c);
}
}
@@ -208,7 +209,7 @@ private static void testCodec(PrintWriter csvLog, int sparsity, Object c,
// verify: compare original array with
// compressed and
// uncompressed.
- for (int m = 0; m < outpos.get(); ++m) {
+ for (int m = 0; m < outpos.get(); ++m) {
if (decompressBuffer[m] != data[k][m]) {
throw new RuntimeException(
"we have a bug (actual difference), expected "
@@ -290,12 +291,10 @@ private static int[][] generateTestData(ClusteredDataGenerator dataGen,
}
static Object[] codecs = {
- new IntegratedBinaryPacking(),
- new IntegratedVariableByte(),
- new SkippableIntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()),
- new JustCopy(),
- new VariableByte(),
+ new SkippableIntegratedComposition(new IntegratedBinaryPacking(),
+ new IntegratedVariableByte()),
+ new SkippableComposition(new SkippableFastPFOR(),
+ new VariableByte()), new JustCopy(), new VariableByte(),
new SkippableComposition(new BinaryPacking(), new VariableByte()),
new SkippableComposition(new NewPFD(), new VariableByte()),
@@ -323,7 +322,7 @@ private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
csvLog.format("\"Algorithm\",\"Sparsity\",\"Bits per int\",\"Compress speed (MiS)\",\"Decompress speed (MiS)\"\n");
ClusteredDataGenerator cdg = new ClusteredDataGenerator();
final int max_sparsity = 31 - nbr;
-
+
for (int sparsity = 1; sparsity < max_sparsity; ++sparsity) {
System.out.println("# sparsity " + sparsity);
System.out.println("# generating random data...");
diff --git a/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
index a770226..b0f880e 100644
--- a/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
+++ b/src/main/java/me/lemire/integercompression/differential/IntegratedFastPFOR.java
@@ -53,7 +53,10 @@
* @author Daniel Lemire
*/
public final class IntegratedFastPFOR implements IntegratedIntegerCODEC {
- final static int BLOCK_SIZE = 128;
+ /**
+ *
+ */
+ public final static int BLOCK_SIZE = 128;
final static int OVERHEAD_OF_EACH_EXCEPT = 8;
final static int DEFAULT_PAGE_SIZE = 65536;
@@ -65,7 +68,7 @@ public final class IntegratedFastPFOR implements IntegratedIntegerCODEC {
// Working area for compress and uncompress.
int[] dataPointers;
int[] freqs;
- byte[] bestbbestcexceptmaxb;
+ int[] bestbbestcexceptmaxb = new int[3];
/**
* Construct the FastPFOR CODEC.
@@ -109,7 +112,6 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
// Allocate memory for working area.
dataPointers = new int[33];
freqs = new int[33];
- bestbbestcexceptmaxb = new byte[3];
final int finalinpos = inpos.get() + inlength;
while (inpos.get() != finalinpos) {
@@ -120,7 +122,6 @@ public void compress(int[] in, IntWrapper inpos, int inlength,
dataPointers = null;
freqs = null;
- bestbbestcexceptmaxb = null;
}
private void getBestBFromData(int[] in, int pos) {
@@ -133,7 +134,7 @@ private void getBestBFromData(int[] in, int pos) {
bestbbestcexceptmaxb[0]--;
bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
int bestcost = bestbbestcexceptmaxb[0] * BLOCK_SIZE;
- byte cexcept = 0;
+ int cexcept = 0;
bestbbestcexceptmaxb[1] = cexcept;
for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
cexcept += freqs[b + 1];
@@ -160,7 +161,6 @@ private void encodePage(int[] constin, IntWrapper constinpos,
// Clear working area.
Arrays.fill(dataPointers, 0);
- // Arrays.fill(bestbbestcexceptmaxb, (byte)0);//DL:unncessary
byteContainer.clear();
int tmpconstinpos = constinpos.get();
@@ -170,11 +170,11 @@ private void encodePage(int[] constin, IntWrapper constinpos,
BLOCK_SIZE, initoffset.intValue(), buffer));
getBestBFromData(buffer, 0);
final int tmpbestb = bestbbestcexceptmaxb[0];
- byteContainer.put(bestbbestcexceptmaxb[0]);
- byteContainer.put(bestbbestcexceptmaxb[1]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[0]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[1]);
if (bestbbestcexceptmaxb[1] > 0) {
- byteContainer.put(bestbbestcexceptmaxb[2]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[2]);
final int index = bestbbestcexceptmaxb[2]
- bestbbestcexceptmaxb[0];
if (dataPointers[index]
@@ -289,18 +289,18 @@ private void decodePage(int[] in, IntWrapper inpos, int[] out,
int tmpinpos = inpos.get();
for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
- final byte b = byteContainer.get();
- final byte cexcept = byteContainer.get();
+ final int b = byteContainer.get();
+ final int cexcept = byteContainer.get() & 0xFF;
for (int k = 0; k < 128; k += 32) {
BitPacking.fastunpack(in, tmpinpos, out,
tmpoutpos + k, b);
tmpinpos += b;
}
if (cexcept > 0) {
- final byte maxbits = byteContainer.get();
+ final int maxbits = byteContainer.get();
final int index = maxbits - b;
for (int k = 0; k < cexcept; ++k) {
- final byte pos = byteContainer.get();
+ final int pos = byteContainer.get() & 0xFF;
final int exceptvalue = dataTobePacked[index][dataPointers[index]++];
out[pos + tmpoutpos] |= exceptvalue << b;
}
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index 81a07e9..2153ab6 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -24,6 +24,7 @@
@SuppressWarnings({ "static-method" })
public class BasicTest {
IntegerCODEC[] codecs = {
+ new Composition(new SkippableFastPFOR(), new VariableByte()),
new IntegratedComposition(new IntegratedBinaryPacking(),
new IntegratedVariableByte()),
new JustCopy(),
@@ -65,8 +66,11 @@ public void varyingLengthTest() {
int[] comp = TestUtils.compress(c, Arrays.copyOf(data, L));
int[] answer = TestUtils.uncompress(c, comp, L);
for (int k = 0; k < L; ++k)
- if (answer[k] != data[k])
+ if (answer[k] != data[k]) {
+ System.out.println(Arrays.toString(Arrays.copyOf(answer, L)));
+ System.out.println(Arrays.toString(Arrays.copyOf(data, L)));
throw new RuntimeException("bug");
+ }
}
}
@@ -596,7 +600,7 @@ public void fastPforTest() {
// proposed by Stefan Ackermann (https://github.com/Stivo)
FastPFOR codec1 = new FastPFOR();
FastPFOR codec2 = new FastPFOR();
- int N = 128;
+ int N = FastPFOR.BLOCK_SIZE;
int[] data = new int[N];
for (int i = 0; i < N; i++)
data[i] = 0;
@@ -617,7 +621,7 @@ public void ifastPforTest() {
// inspired by Stefan Ackermann (https://github.com/Stivo)
IntegratedFastPFOR codec1 = new IntegratedFastPFOR();
IntegratedFastPFOR codec2 = new IntegratedFastPFOR();
- int N = 128;
+ int N = IntegratedFastPFOR.BLOCK_SIZE;
int[] data = new int[N];
for (int i = 0; i < N; i++)
data[i] = 0;
diff --git a/src/test/java/me/lemire/integercompression/TestUtils.java b/src/test/java/me/lemire/integercompression/TestUtils.java
index 413654f..fb8039f 100644
--- a/src/test/java/me/lemire/integercompression/TestUtils.java
+++ b/src/test/java/me/lemire/integercompression/TestUtils.java
@@ -10,11 +10,61 @@
* Static utility methods for test.
*/
public class TestUtils {
+
/**
*
*/
@Test
- public void bogus() {}// to avoid useless complaining.
+ public void testPacking() {
+ int[] outputarray = new int[32];
+ for(int b = 1; b < 32; ++b) {
+ int[] data = new int[32];
+ int[] newdata = new int[32];
+ int mask = (1<
Date: Thu, 18 Sep 2014 00:59:28 -0400
Subject: [PATCH 042/266] Missing file
---
.../integercompression/SkippableFastPFOR.java | 255 ++++++++++++++++++
.../me/lemire/integercompression/Util.java | 1 -
2 files changed, 255 insertions(+), 1 deletion(-)
create mode 100644 src/main/java/me/lemire/integercompression/SkippableFastPFOR.java
diff --git a/src/main/java/me/lemire/integercompression/SkippableFastPFOR.java b/src/main/java/me/lemire/integercompression/SkippableFastPFOR.java
new file mode 100644
index 0000000..4d47103
--- /dev/null
+++ b/src/main/java/me/lemire/integercompression/SkippableFastPFOR.java
@@ -0,0 +1,255 @@
+/**
+ * This code is released under the
+ * Apache License Version 2.0 http://www.apache.org/licenses/.
+ *
+ * (c) Daniel Lemire, http://lemire.me/en/
+ */
+package me.lemire.integercompression;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+
+/**
+ * This is a patching scheme designed for speed. It encodes integers in blocks
+ * integers. For arrays containing a number of
+ * integers that is not divisible by BLOCK_SIZE, you should use it in conjunction with
+ * another CODEC:
+ *
+ * IntegerCODEC ic = new Composition(new SkippableFastPFOR(), new
+ * VariableByte()).
+ *
+ * For details, please see
+ *
+ *
+ * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
+ * through vectorization Software: Practice & Experience http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract http://arxiv.org/abs/1209.2137
+ *
+ *
+ * For sufficiently compressible and long arrays, it is faster and better than
+ * other PFOR schemes.
+ *
+ *
+ * Note that this does not use differential coding: if you are working on sorted
+ * lists, use IntegratedFastPFOR instead.
+ *
+ * For multi-threaded applications, each thread should use its own FastPFOR
+ * object.
+ *
+ * @author Daniel Lemire
+ */
+public final class SkippableFastPFOR implements IntegerCODEC,
+ SkippableIntegerCODEC {
+ /**
+ *
+ */
+ final public static int BLOCK_SIZE = 256;
+ final static int OVERHEAD_OF_EACH_EXCEPT = 8;
+
+ ByteBuffer byteContainer = null;
+
+ // Working area for compress and uncompress.
+ int[] freqs = new int[33];
+ int[] bestbbestcexceptmaxb = new int[3];
+ int[] exceptionbuffer = new int[BLOCK_SIZE];
+
+ /**
+ * Construct the fastPFOR CODEC with default parameters.
+ */
+ public SkippableFastPFOR() {
+ }
+
+ /**
+ * Compress data in blocks of integers (if fewer than BLOCK_SIZE integers are
+ * provided, nothing is done).
+ *
+ * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
+ */
+ @Override
+ public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos) {
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
+ if (inlength == 0)
+ return;
+ encodePage(in, inpos, inlength, out, outpos);
+ }
+
+ private void getBestBFromData(int[] in, int pos) {
+ Arrays.fill(freqs, 0);
+ for (int k = pos, k_end = pos + BLOCK_SIZE; k < k_end; ++k) {
+ freqs[Util.bits(in[k])]++;
+ }
+ bestbbestcexceptmaxb[0] = 32;
+ while (freqs[bestbbestcexceptmaxb[0]] == 0)
+ bestbbestcexceptmaxb[0]--;
+ bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
+ int bestcost = bestbbestcexceptmaxb[0] * BLOCK_SIZE;
+ int cexcept = 0;
+ bestbbestcexceptmaxb[1] = cexcept;
+ for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
+ cexcept += freqs[b + 1];
+ if (cexcept == BLOCK_SIZE)
+ break;
+ // the extra 8 is the cost of storing maxbits
+ int thiscost = cexcept
+ * OVERHEAD_OF_EACH_EXCEPT
+ + Util.packsizew((int) cexcept, bestbbestcexceptmaxb[2] - b)
+ + b * BLOCK_SIZE + 8;
+ if (thiscost < bestcost) {
+ bestcost = thiscost;
+ bestbbestcexceptmaxb[0] = b;
+ bestbbestcexceptmaxb[1] = cexcept;
+ }
+ }
+ }
+
+ private void encodePage(int[] in, IntWrapper inpos, int thissize,
+ int[] out, IntWrapper outpos) {
+
+ final int headerpos = outpos.get();
+ outpos.increment();
+ int tmpoutpos = outpos.get();
+ final int bytesrequired = 3 * thissize / BLOCK_SIZE + thissize;
+ if ((byteContainer == null)
+ || (byteContainer.capacity() < bytesrequired))
+ byteContainer = ByteBuffer.allocateDirect(bytesrequired);
+ else
+ byteContainer.clear();
+
+ int tmpinpos = inpos.get();
+
+ for (final int finalinpos = tmpinpos + thissize - BLOCK_SIZE; tmpinpos <= finalinpos; tmpinpos += BLOCK_SIZE) {
+ getBestBFromData(in, tmpinpos);
+ final int tmpbestb = bestbbestcexceptmaxb[0];
+ byteContainer.put((byte)bestbbestcexceptmaxb[0]);
+ byteContainer.put((byte)bestbbestcexceptmaxb[1]);
+ if (bestbbestcexceptmaxb[1] > 0) {
+ byteContainer.put((byte)bestbbestcexceptmaxb[2]);
+ for (int k = 0, ek = 0; k < BLOCK_SIZE; ++k) {
+ if ((in[k + tmpinpos] >>> bestbbestcexceptmaxb[0]) != 0) {
+ // we have an exception
+ byteContainer.put((byte) k);
+ exceptionbuffer[ek++] = in[k + tmpinpos] >>> tmpbestb;
+ }
+ }
+
+ }
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
+ BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos, tmpbestb);
+ tmpoutpos += tmpbestb;
+ }
+ final int index = bestbbestcexceptmaxb[2] - bestbbestcexceptmaxb[0];
+ if (bestbbestcexceptmaxb[1] > 0)
+ tmpoutpos = Util.packw(out, tmpoutpos, exceptionbuffer,
+ bestbbestcexceptmaxb[1], index);
+
+ }
+ inpos.set(tmpinpos);
+ out[headerpos] = tmpoutpos - headerpos;
+ final int bytesize = byteContainer.position();
+ while ((byteContainer.position() & 3) != 0)
+ byteContainer.put((byte) 0);
+ out[tmpoutpos++] = bytesize;
+ final int howmanyints = byteContainer.position() / 4;
+ byteContainer.flip();
+ byteContainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
+ tmpoutpos += howmanyints;
+ outpos.set(tmpoutpos);
+
+ }
+
+ /**
+ * Uncompress data in blocks integers. In this particular case, the
+ * inlength parameter is ignored: it is deduced from the compressed data.
+ *
+ * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
+ */
+ @Override
+ public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
+ int[] out, IntWrapper outpos, int mynvalue) {
+ if (inlength == 0)
+ return;
+ mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
+ if (mynvalue == 0)
+ return;
+ decodePage(in, inpos, out, outpos, mynvalue);
+ }
+
+ private void decodePage(int[] in, IntWrapper inpos, int[] out,
+ IntWrapper outpos, int thissize) {
+
+ final int initpos = inpos.get();
+ final int wheremeta = in[inpos.get()];
+ inpos.increment();
+ int inexcept = initpos + wheremeta;
+ final int bytesize = in[inexcept++];
+ if ((byteContainer == null) || (byteContainer.capacity() < bytesize))
+ byteContainer = ByteBuffer.allocateDirect(bytesize);
+ else
+ byteContainer.clear();
+ byteContainer.asIntBuffer().put(in, inexcept, (bytesize + 3) / 4);
+ inexcept += (bytesize + 3) / 4;
+
+ int tmpoutpos = outpos.get();
+ int tmpinpos = inpos.get();
+
+ for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
+ final int b = byteContainer.get();
+ final int cexcept = byteContainer.get() & 0xFF;
+ int nexttmpinpos = tmpinpos + b * BLOCK_SIZE / 32;
+ if (cexcept > 0) {
+ final int maxbits = byteContainer.get();
+ final int index = maxbits - b;
+ nexttmpinpos = Util.unpackw(in, nexttmpinpos, exceptionbuffer,
+ cexcept, index);
+
+ }
+
+ for (int k = 0; k < BLOCK_SIZE; k += 32) {
+ BitPacking.fastunpack(in, tmpinpos + b * (k / 32), out,
+ tmpoutpos + k, b);
+
+ }
+ tmpinpos = nexttmpinpos;
+ for (int k = 0; k < cexcept; ++k) {
+ final int pos = byteContainer.get() & 0xFF;
+ out[pos + tmpoutpos] |= exceptionbuffer[k] << b;
+ }
+
+ }
+ outpos.set(tmpoutpos);
+ inpos.set(inexcept);
+ }
+
+ @Override
+ public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+
+ inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
+
+ if (inlength == 0) {
+ return;
+ }
+
+ out[outpos.get()] = inlength;
+ outpos.increment();
+ headlessCompress(in, inpos, inlength, out, outpos);
+ }
+
+ @Override
+ public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
+ IntWrapper outpos) {
+ if (inlength == 0)
+ return;
+ final int outlength = in[inpos.get()];
+ inpos.increment();
+ headlessUncompress(in, inpos, inlength, out, outpos, outlength);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
+}
diff --git a/src/main/java/me/lemire/integercompression/Util.java b/src/main/java/me/lemire/integercompression/Util.java
index 0c584e1..a5c34c2 100644
--- a/src/main/java/me/lemire/integercompression/Util.java
+++ b/src/main/java/me/lemire/integercompression/Util.java
@@ -6,7 +6,6 @@
*/
package me.lemire.integercompression;
-import java.util.Arrays;
/**
* Routine utility functions.
From 9520e70075435b2c24e733a6ad31ee1d1a0e59d3 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 01:07:32 -0400
Subject: [PATCH 043/266] More cleaning.
---
.../integercompression/SkippableFastPFOR.java | 255 ------------------
.../me/lemire/integercompression/Util.java | 53 ++--
.../benchmarktools/Benchmark.java | 7 -
.../benchmarktools/BenchmarkSkippable.java | 5 +-
.../lemire/integercompression/BasicTest.java | 1 -
5 files changed, 31 insertions(+), 290 deletions(-)
delete mode 100644 src/main/java/me/lemire/integercompression/SkippableFastPFOR.java
diff --git a/src/main/java/me/lemire/integercompression/SkippableFastPFOR.java b/src/main/java/me/lemire/integercompression/SkippableFastPFOR.java
deleted file mode 100644
index 4d47103..0000000
--- a/src/main/java/me/lemire/integercompression/SkippableFastPFOR.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/**
- * This code is released under the
- * Apache License Version 2.0 http://www.apache.org/licenses/.
- *
- * (c) Daniel Lemire, http://lemire.me/en/
- */
-package me.lemire.integercompression;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-/**
- * This is a patching scheme designed for speed. It encodes integers in blocks
- * integers. For arrays containing a number of
- * integers that is not divisible by BLOCK_SIZE, you should use it in conjunction with
- * another CODEC:
- *
- * IntegerCODEC ic = new Composition(new SkippableFastPFOR(), new
- * VariableByte()).
- *
- * For details, please see
- *
- *
- * Daniel Lemire and Leonid Boytsov, Decoding billions of integers per second
- * through vectorization Software: Practice & Experience http://onlinelibrary.wiley.com/doi/10.1002/spe.2203/abstract http://arxiv.org/abs/1209.2137
- *
- *
- * For sufficiently compressible and long arrays, it is faster and better than
- * other PFOR schemes.
- *
- *
- * Note that this does not use differential coding: if you are working on sorted
- * lists, use IntegratedFastPFOR instead.
- *
- * For multi-threaded applications, each thread should use its own FastPFOR
- * object.
- *
- * @author Daniel Lemire
- */
-public final class SkippableFastPFOR implements IntegerCODEC,
- SkippableIntegerCODEC {
- /**
- *
- */
- final public static int BLOCK_SIZE = 256;
- final static int OVERHEAD_OF_EACH_EXCEPT = 8;
-
- ByteBuffer byteContainer = null;
-
- // Working area for compress and uncompress.
- int[] freqs = new int[33];
- int[] bestbbestcexceptmaxb = new int[3];
- int[] exceptionbuffer = new int[BLOCK_SIZE];
-
- /**
- * Construct the fastPFOR CODEC with default parameters.
- */
- public SkippableFastPFOR() {
- }
-
- /**
- * Compress data in blocks of integers (if fewer than BLOCK_SIZE integers are
- * provided, nothing is done).
- *
- * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
- */
- @Override
- public void headlessCompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos) {
- inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
- if (inlength == 0)
- return;
- encodePage(in, inpos, inlength, out, outpos);
- }
-
- private void getBestBFromData(int[] in, int pos) {
- Arrays.fill(freqs, 0);
- for (int k = pos, k_end = pos + BLOCK_SIZE; k < k_end; ++k) {
- freqs[Util.bits(in[k])]++;
- }
- bestbbestcexceptmaxb[0] = 32;
- while (freqs[bestbbestcexceptmaxb[0]] == 0)
- bestbbestcexceptmaxb[0]--;
- bestbbestcexceptmaxb[2] = bestbbestcexceptmaxb[0];
- int bestcost = bestbbestcexceptmaxb[0] * BLOCK_SIZE;
- int cexcept = 0;
- bestbbestcexceptmaxb[1] = cexcept;
- for (int b = bestbbestcexceptmaxb[0] - 1; b >= 0; --b) {
- cexcept += freqs[b + 1];
- if (cexcept == BLOCK_SIZE)
- break;
- // the extra 8 is the cost of storing maxbits
- int thiscost = cexcept
- * OVERHEAD_OF_EACH_EXCEPT
- + Util.packsizew((int) cexcept, bestbbestcexceptmaxb[2] - b)
- + b * BLOCK_SIZE + 8;
- if (thiscost < bestcost) {
- bestcost = thiscost;
- bestbbestcexceptmaxb[0] = b;
- bestbbestcexceptmaxb[1] = cexcept;
- }
- }
- }
-
- private void encodePage(int[] in, IntWrapper inpos, int thissize,
- int[] out, IntWrapper outpos) {
-
- final int headerpos = outpos.get();
- outpos.increment();
- int tmpoutpos = outpos.get();
- final int bytesrequired = 3 * thissize / BLOCK_SIZE + thissize;
- if ((byteContainer == null)
- || (byteContainer.capacity() < bytesrequired))
- byteContainer = ByteBuffer.allocateDirect(bytesrequired);
- else
- byteContainer.clear();
-
- int tmpinpos = inpos.get();
-
- for (final int finalinpos = tmpinpos + thissize - BLOCK_SIZE; tmpinpos <= finalinpos; tmpinpos += BLOCK_SIZE) {
- getBestBFromData(in, tmpinpos);
- final int tmpbestb = bestbbestcexceptmaxb[0];
- byteContainer.put((byte)bestbbestcexceptmaxb[0]);
- byteContainer.put((byte)bestbbestcexceptmaxb[1]);
- if (bestbbestcexceptmaxb[1] > 0) {
- byteContainer.put((byte)bestbbestcexceptmaxb[2]);
- for (int k = 0, ek = 0; k < BLOCK_SIZE; ++k) {
- if ((in[k + tmpinpos] >>> bestbbestcexceptmaxb[0]) != 0) {
- // we have an exception
- byteContainer.put((byte) k);
- exceptionbuffer[ek++] = in[k + tmpinpos] >>> tmpbestb;
- }
- }
-
- }
- for (int k = 0; k < BLOCK_SIZE; k += 32) {
- BitPacking.fastpack(in, tmpinpos + k, out, tmpoutpos, tmpbestb);
- tmpoutpos += tmpbestb;
- }
- final int index = bestbbestcexceptmaxb[2] - bestbbestcexceptmaxb[0];
- if (bestbbestcexceptmaxb[1] > 0)
- tmpoutpos = Util.packw(out, tmpoutpos, exceptionbuffer,
- bestbbestcexceptmaxb[1], index);
-
- }
- inpos.set(tmpinpos);
- out[headerpos] = tmpoutpos - headerpos;
- final int bytesize = byteContainer.position();
- while ((byteContainer.position() & 3) != 0)
- byteContainer.put((byte) 0);
- out[tmpoutpos++] = bytesize;
- final int howmanyints = byteContainer.position() / 4;
- byteContainer.flip();
- byteContainer.asIntBuffer().get(out, tmpoutpos, howmanyints);
- tmpoutpos += howmanyints;
- outpos.set(tmpoutpos);
-
- }
-
- /**
- * Uncompress data in blocks integers. In this particular case, the
- * inlength parameter is ignored: it is deduced from the compressed data.
- *
- * @see IntegerCODEC#compress(int[], IntWrapper, int, int[], IntWrapper)
- */
- @Override
- public void headlessUncompress(int[] in, IntWrapper inpos, int inlength,
- int[] out, IntWrapper outpos, int mynvalue) {
- if (inlength == 0)
- return;
- mynvalue = Util.greatestMultiple(mynvalue, BLOCK_SIZE);
- if (mynvalue == 0)
- return;
- decodePage(in, inpos, out, outpos, mynvalue);
- }
-
- private void decodePage(int[] in, IntWrapper inpos, int[] out,
- IntWrapper outpos, int thissize) {
-
- final int initpos = inpos.get();
- final int wheremeta = in[inpos.get()];
- inpos.increment();
- int inexcept = initpos + wheremeta;
- final int bytesize = in[inexcept++];
- if ((byteContainer == null) || (byteContainer.capacity() < bytesize))
- byteContainer = ByteBuffer.allocateDirect(bytesize);
- else
- byteContainer.clear();
- byteContainer.asIntBuffer().put(in, inexcept, (bytesize + 3) / 4);
- inexcept += (bytesize + 3) / 4;
-
- int tmpoutpos = outpos.get();
- int tmpinpos = inpos.get();
-
- for (int run = 0, run_end = thissize / BLOCK_SIZE; run < run_end; ++run, tmpoutpos += BLOCK_SIZE) {
- final int b = byteContainer.get();
- final int cexcept = byteContainer.get() & 0xFF;
- int nexttmpinpos = tmpinpos + b * BLOCK_SIZE / 32;
- if (cexcept > 0) {
- final int maxbits = byteContainer.get();
- final int index = maxbits - b;
- nexttmpinpos = Util.unpackw(in, nexttmpinpos, exceptionbuffer,
- cexcept, index);
-
- }
-
- for (int k = 0; k < BLOCK_SIZE; k += 32) {
- BitPacking.fastunpack(in, tmpinpos + b * (k / 32), out,
- tmpoutpos + k, b);
-
- }
- tmpinpos = nexttmpinpos;
- for (int k = 0; k < cexcept; ++k) {
- final int pos = byteContainer.get() & 0xFF;
- out[pos + tmpoutpos] |= exceptionbuffer[k] << b;
- }
-
- }
- outpos.set(tmpoutpos);
- inpos.set(inexcept);
- }
-
- @Override
- public void compress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos) {
-
- inlength = Util.greatestMultiple(inlength, BLOCK_SIZE);
-
- if (inlength == 0) {
- return;
- }
-
- out[outpos.get()] = inlength;
- outpos.increment();
- headlessCompress(in, inpos, inlength, out, outpos);
- }
-
- @Override
- public void uncompress(int[] in, IntWrapper inpos, int inlength, int[] out,
- IntWrapper outpos) {
- if (inlength == 0)
- return;
- final int outlength = in[inpos.get()];
- inpos.increment();
- headlessUncompress(in, inpos, inlength, out, outpos, outlength);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/src/main/java/me/lemire/integercompression/Util.java b/src/main/java/me/lemire/integercompression/Util.java
index a5c34c2..5ad2ff1 100644
--- a/src/main/java/me/lemire/integercompression/Util.java
+++ b/src/main/java/me/lemire/integercompression/Util.java
@@ -6,7 +6,6 @@
*/
package me.lemire.integercompression;
-
/**
* Routine utility functions.
*
@@ -72,7 +71,9 @@ protected static int maxbits32(int[] i, int pos) {
/**
* Compute the maximum of the integer logarithms (ceil(log(x+1)) of a the
* successive differences (deltas) of a range of value
- * @param initoffset initial vallue for the computation of the deltas
+ *
+ * @param initoffset
+ * initial vallue for the computation of the deltas
* @param i
* source array
* @param pos
@@ -100,30 +101,33 @@ public static int maxdiffbits(int initoffset, int[] i, int pos, int length) {
public static int bits(int i) {
return 32 - Integer.numberOfLeadingZeros(i);
}
-
+
protected static int packsize(int num, int b) {
- if(b>16) return num;
- int howmanyfit = 32/b;
- return (num + howmanyfit - 1)/ howmanyfit;
+ if (b > 16)
+ return num;
+ int howmanyfit = 32 / b;
+ return (num + howmanyfit - 1) / howmanyfit;
}
-
+
protected static int pack(int[] outputarray, int arraypos, int[] data,
int num, int b) {
- if(num == 0) return arraypos;
+ if (num == 0)
+ return arraypos;
if (b > 16) {
System.arraycopy(data, 0, outputarray, arraypos, num);
return num + arraypos;
}
- for(int k = 0 ; k < packsize(num, b); ++k) outputarray[k+arraypos] = 0;
+ for (int k = 0; k < packsize(num, b); ++k)
+ outputarray[k + arraypos] = 0;
int inwordpointer = 0;
for (int k = 0; k < num; ++k) {
outputarray[arraypos] |= (data[k] << inwordpointer);
inwordpointer += b;
- final int increment = ((inwordpointer + b - 1 ) >> 5);
+ final int increment = ((inwordpointer + b - 1) >> 5);
arraypos += increment;
inwordpointer &= ~(-increment);
}
- return arraypos + (inwordpointer>0?1:0);
+ return arraypos + (inwordpointer > 0 ? 1 : 0);
}
protected static int unpack(int[] sourcearray, int arraypos, int[] data,
@@ -138,22 +142,24 @@ protected static int unpack(int[] sourcearray, int arraypos, int[] data,
data[k] = (sourcearray[arraypos] & mask);
sourcearray[arraypos] >>>= b;
inwordpointer += b;
- final int increment = ((inwordpointer + b - 1) >> 5);
+ final int increment = ((inwordpointer + b - 1) >> 5);
arraypos += increment;
inwordpointer &= ~(-increment);
}
- return arraypos + (inwordpointer>0?1:0);
+ return arraypos + (inwordpointer > 0 ? 1 : 0);
}
+
protected static int packsizew(int num, int b) {
- int howmanyfit = 32/b;
- if (num <= howmanyfit) return 1;
+ int howmanyfit = 32 / b;
+ if (num <= howmanyfit)
+ return 1;
return num;
}
-
+
protected static int packw(int[] outputarray, int arraypos, int[] data,
int num, int b) {
- int howmanyfit = 32/b;
- if (num > howmanyfit) {
+ int howmanyfit = 32 / b;
+ if (num > howmanyfit) {
System.arraycopy(data, 0, outputarray, arraypos, num);
return num + arraypos;
}
@@ -168,8 +174,8 @@ protected static int packw(int[] outputarray, int arraypos, int[] data,
protected static int unpackw(int[] sourcearray, int arraypos, int[] data,
int num, int b) {
- int howmanyfit = 32/b;
- if (num > howmanyfit) {
+ int howmanyfit = 32 / b;
+ if (num > howmanyfit) {
System.arraycopy(sourcearray, arraypos, data, 0, num);
return num + arraypos;
}
@@ -182,12 +188,13 @@ protected static int unpackw(int[] sourcearray, int arraypos, int[] data,
return arraypos + 1;
}
-
/**
* return floor(value / factor) * factor
*
- * @param value numerator
- * @param factor denominator
+ * @param value
+ * numerator
+ * @param factor
+ * denominator
* @return greatest multiple of factor no larger than value
*/
public static int greatestMultiple(int value, int factor) {
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
index e987bde..625a3d1 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/Benchmark.java
@@ -24,7 +24,6 @@
import me.lemire.integercompression.OptPFDS16;
import me.lemire.integercompression.OptPFDS9;
import me.lemire.integercompression.Simple9;
-import me.lemire.integercompression.SkippableFastPFOR;
import me.lemire.integercompression.VariableByte;
import me.lemire.integercompression.differential.Delta;
import me.lemire.integercompression.differential.IntegratedBinaryPacking;
@@ -500,12 +499,6 @@ private static void test(PrintWriter csvLog, int N, int nbr, int repeat) {
repeat, true);
System.out.println();
- testCodec(csvLog, sparsity, new Composition(new SkippableFastPFOR(), new VariableByte()), data, repeat,
- false);
- testCodec(csvLog, sparsity, new Composition(new SkippableFastPFOR(), new VariableByte()), data, repeat,
- false);
- testCodec(csvLog, sparsity, new Composition(new SkippableFastPFOR(), new VariableByte()), data, repeat,
- true);
// TODO: support CSV log output.
testKamikaze(data, repeat, false);
diff --git a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
index 9782e92..b738eff 100644
--- a/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
+++ b/src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkSkippable.java
@@ -19,7 +19,6 @@
import me.lemire.integercompression.Simple16;
import me.lemire.integercompression.Simple9;
import me.lemire.integercompression.SkippableComposition;
-import me.lemire.integercompression.SkippableFastPFOR;
import me.lemire.integercompression.SkippableIntegerCODEC;
import me.lemire.integercompression.VariableByte;
import me.lemire.integercompression.differential.Delta;
@@ -292,9 +291,7 @@ private static int[][] generateTestData(ClusteredDataGenerator dataGen,
static Object[] codecs = {
new SkippableIntegratedComposition(new IntegratedBinaryPacking(),
- new IntegratedVariableByte()),
- new SkippableComposition(new SkippableFastPFOR(),
- new VariableByte()), new JustCopy(), new VariableByte(),
+ new IntegratedVariableByte()), new JustCopy(), new VariableByte(),
new SkippableComposition(new BinaryPacking(), new VariableByte()),
new SkippableComposition(new NewPFD(), new VariableByte()),
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index 2153ab6..3449f52 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -24,7 +24,6 @@
@SuppressWarnings({ "static-method" })
public class BasicTest {
IntegerCODEC[] codecs = {
- new Composition(new SkippableFastPFOR(), new VariableByte()),
new IntegratedComposition(new IntegratedBinaryPacking(),
new IntegratedVariableByte()),
new JustCopy(),
From 223bf3cd5cc0894ffd012422fb672ed1b00e496f Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 10:32:48 -0400
Subject: [PATCH 044/266] New timings...
---
.../benchmarkresults_haswell_18sept2014.txt | 861 ++++++++++++++++++
...rkresults_skippable_haswell_18sept2014.txt | 513 +++++++++++
2 files changed, 1374 insertions(+)
create mode 100644 benchmarkresults/benchmarkresults_haswell_18sept2014.txt
create mode 100644 benchmarkresults/benchmarkresults_skippable_haswell_18sept2014.txt
diff --git a/benchmarkresults/benchmarkresults_haswell_18sept2014.txt b/benchmarkresults/benchmarkresults_haswell_18sept2014.txt
new file mode 100644
index 0000000..43fa98b
--- /dev/null
+++ b/benchmarkresults/benchmarkresults_haswell_18sept2014.txt
@@ -0,0 +1,861 @@
+# benchmark based on the ClusterData model from:
+# Vo Ngoc Anh and Alistair Moffat.
+# Index compression using 64-bit words.
+# Softw. Pract. Exper.40, 2 (February 2010), 131-147.
+
+# Results will be written into a CSV file: benchmark-20140918T011257.csv
+
+# sparsity 1
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.56 246 1061
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.21 66 275
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.96 838 1679
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1276 1805
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.00 490 509
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.00 582 774
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.96 765 1193
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.88 139 896
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.90 166 905
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.88 139 898
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.87 25 938
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.90 29 960
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.87 25 882
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.63 274 1015
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.83 280 771
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.84 444 837
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.27 498 652
+
+# sparsity 2
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.51 244 1048
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.18 55 247
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.93 862 1611
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1286 1816
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.01 486 508
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.01 575 763
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.93 774 1159
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.83 118 865
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.86 141 875
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.83 118 867
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.82 18 881
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.85 22 887
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.82 18 838
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.58 273 990
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.82 201 656
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.90 442 819
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.50 494 640
+
+# sparsity 3
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.28 244 1030
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.95 51 247
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.71 850 1577
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1252 1769
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.02 478 504
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.02 573 762
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.71 770 1139
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.60 107 850
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.63 127 863
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.60 107 853
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.59 14 865
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.62 18 882
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.59 14 844
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.34 268 969
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.72 170 610
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.68 434 783
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.33 472 624
+
+# sparsity 4
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.03 239 1004
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.73 47 251
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.48 846 1556
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1274 1799
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.12 439 486
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.12 537 715
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.48 769 1134
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.36 95 817
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.39 115 838
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.36 96 827
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.34 12 842
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.37 16 871
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.34 12 803
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.09 268 963
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.57 150 587
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.47 432 800
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.16 491 635
+
+# sparsity 5
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.00 236 999
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.70 43 242
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.45 863 1584
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1236 1792
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.40 369 452
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.40 486 617
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.45 777 1132
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.33 86 808
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.36 103 828
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.33 86 813
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.31 9 825
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.34 13 858
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.31 9 819
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.06 265 945
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.65 139 546
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.45 442 804
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.18 493 635
+
+# sparsity 6
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.76 238 998
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.45 42 251
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.20 854 1525
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1177 1663
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.10 259 362
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.10 380 450
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.20 718 1098
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.08 79 786
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.11 95 821
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.08 81 814
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.06 8 836
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.09 11 860
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.06 8 822
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.81 268 962
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.56 129 509
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.19 433 789
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.93 491 632
+
+# sparsity 7
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.05 236 985
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.75 39 247
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.50 861 1526
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1279 1788
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.11 190 305
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.11 311 355
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.50 753 1092
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.37 71 792
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.40 83 804
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.37 72 805
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.35 7 808
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.38 10 835
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.35 7 796
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.10 259 920
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.16 111 447
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.52 435 784
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.32 485 622
+
+# sparsity 8
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.73 234 972
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.44 37 250
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.19 848 1493
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1279 1858
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.04 167 307
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.04 309 353
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.19 751 1095
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.06 67 770
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.09 78 781
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.06 68 792
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.03 6 795
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.07 9 824
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.03 6 787
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.78 266 936
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.34 101 427
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.21 437 794
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.01 488 626
+
+# sparsity 9
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.75 234 980
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.48 36 242
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.21 844 1474
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1262 1795
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.18 145 300
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.18 302 340
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.21 761 1096
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.08 63 786
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.12 72 752
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.08 63 783
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.05 6 787
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.09 8 798
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.05 6 779
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.80 264 930
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.77 92 410
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.23 438 789
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.05 486 624
+
+# sparsity 10
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.73 235 979
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.46 35 239
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.18 840 1456
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1248 1746
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.14 135 312
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.14 309 354
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.18 761 1097
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.09 59 802
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.13 69 814
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.09 59 771
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.04 5 783
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.08 8 816
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.04 5 776
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.78 265 934
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.98 89 415
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.20 436 787
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.02 483 620
+
+# sparsity 11
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.79 232 950
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.68 34 256
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.23 842 1450
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1292 1826
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.00 127 324
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.00 308 369
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.23 760 1092
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.35 56 795
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.38 65 829
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.35 57 822
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.13 5 706
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.17 7 750
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.13 5 712
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.83 261 919
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.17 85 401
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.25 436 781
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.08 489 623
+
+# sparsity 12
+# generating random data...
+# generating random data... ok.
+# FastPFOR + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.70 226 932
+
+# kamikaze PForDelta
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.76 34 261
+
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.16 849 1453
+
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1208 1804
+
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.84 117 307
+
+# IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.84 260 352
+
+# BinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.16 762 1095
+
+# NewPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.46 56 899
+
+# NewPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.48 63 915
+
+# NewPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.46 56 897
+
+# OptPFD + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.20 5 681
+
+# OptPFDS9 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.24 7 735
+
+# OptPFDS16 + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.20 5 699
+
+# IntegratedFastPFOR + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.75 260 914
+
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 15.51 80 359
+
+# XorBinaryPacking + VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.18 435 781
+
+# DeltaZigzagBinaryPacking + DeltaZigzagVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.00 489 626
+
+
+Results were written into a CSV file: benchmark-20140918T011257.csv
diff --git a/benchmarkresults/benchmarkresults_skippable_haswell_18sept2014.txt b/benchmarkresults/benchmarkresults_skippable_haswell_18sept2014.txt
new file mode 100644
index 0000000..4159637
--- /dev/null
+++ b/benchmarkresults/benchmarkresults_skippable_haswell_18sept2014.txt
@@ -0,0 +1,513 @@
+# benchmark based on the ClusterData model from:
+# Vo Ngoc Anh and Alistair Moffat.
+# Index compression using 64-bit words.
+# Softw. Pract. Exper.40, 2 (February 2010), 131-147.
+
+# Results will be written into a CSV file: benchmark-20140918T011322.csv
+
+# sparsity 1
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.04 840 1619
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1169 1698
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.00 195 369
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.04 651 1148
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.96 129 865
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.98 158 877
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.96 130 879
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.95 25 930
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.97 27 951
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.95 25 935
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.82 235 928
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.93 255 740
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 2.77 147 395
+# sparsity 2
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.82 831 1555
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1183 1800
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.00 220 372
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.82 659 1139
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.72 116 855
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.75 136 851
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.72 115 853
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.71 19 895
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.74 22 917
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.71 19 900
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.59 230 908
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.74 195 654
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 3.49 111 366
+# sparsity 3
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.78 817 1519
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1019 1759
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.02 238 370
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.78 680 1121
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.67 98 825
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.70 123 840
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.67 102 834
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.66 15 861
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.69 18 895
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.66 14 871
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.54 231 904
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.84 153 589
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 4.40 83 339
+# sparsity 4
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.65 788 1505
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1142 1757
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.09 242 363
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.65 636 1113
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.52 92 828
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.56 112 826
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.52 94 826
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.51 12 854
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.54 15 883
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.51 12 858
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.39 218 886
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.80 136 566
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 5.32 68 319
+# sparsity 5
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.31 804 1490
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1105 1860
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.40 245 330
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.31 673 1121
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.19 87 832
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.22 107 844
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.19 88 830
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.17 10 851
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.20 14 883
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.17 10 852
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.07 217 875
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.51 130 513
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.13 60 307
+# sparsity 6
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.99 742 1431
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1163 1660
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.99 205 290
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.99 637 1107
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.87 82 821
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.90 100 830
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.87 82 818
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.85 9 834
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.88 12 865
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.85 9 836
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.75 224 877
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 7.33 118 485
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 6.98 54 296
+# sparsity 7
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.31 770 1463
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1074 1832
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.01 203 240
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.31 664 1105
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.18 73 796
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.22 88 808
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.18 73 792
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.16 7 819
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.20 10 849
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.16 7 810
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.05 217 851
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.01 103 430
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.61 47 277
+# sparsity 8
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.88 800 1414
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1078 1718
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.91 211 227
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.88 671 1083
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.76 70 804
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.80 84 814
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.76 70 800
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.73 7 807
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.77 9 792
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.73 7 801
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 8.64 211 837
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.94 96 417
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.51 44 268
+# sparsity 9
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.19 834 1442
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1200 1632
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.16 206 212
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.19 675 1092
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.07 64 804
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.10 76 814
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.07 63 802
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.04 6 810
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.08 9 841
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.04 6 808
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 9.94 222 858
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.79 88 397
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.40 38 253
+# sparsity 10
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.10 814 1406
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1215 1820
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.07 207 208
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.10 681 1073
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.00 60 800
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.04 72 809
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 11.00 60 796
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.95 6 785
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.99 8 815
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.95 6 782
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 10.84 226 860
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.93 84 389
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.58 36 245
+# sparsity 11
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.31 814 1392
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1171 1846
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.14 172 201
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.31 668 1071
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.42 56 825
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.45 67 832
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.42 56 821
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.22 5 729
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.27 8 758
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.22 5 731
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.07 222 836
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.31 81 377
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.05 33 238
+# sparsity 12
+# generating random data...
+# generating random data... ok.
+# IntegratedBinaryPacking + IntegratedVariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.97 805 1375
+# JustCopy
+# bits per int, compress speed (mis), decompression speed (mis)
+ 32.00 1160 1737
+# VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 14.72 186 193
+# BinaryPacking+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.97 656 1037
+# NewPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.22 56 886
+# NewPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.24 67 891
+# NewPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.22 56 883
+# OptPFD+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.98 5 704
+# OptPFDS9+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 13.02 8 740
+# OptPFDS16+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.98 5 704
+# FastPFOR+VariableByte
+# bits per int, compress speed (mis), decompression speed (mis)
+ 12.73 223 845
+# Simple9
+# bits per int, compress speed (mis), decompression speed (mis)
+ 15.35 78 347
+# Simple16
+# bits per int, compress speed (mis), decompression speed (mis)
+ 15.15 31 225
+
+Results were written into a CSV file: benchmark-20140918T011322.csv
From 8d12202daa207965612879ee31770b7c07848748 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 10:34:55 -0400
Subject: [PATCH 045/266] [maven-release-plugin] prepare release
JavaFastPFOR-0.0.16
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a457116..d083375 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.16-SNAPSHOT
+ 0.0.16
jar
From f5e08a66a609935485a4fb85e8ec66ec1aa73be8 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 10:36:09 -0400
Subject: [PATCH 046/266] Preparing a new version.
---
CHANGELOG | 2 +-
README.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index e6db188..8337abc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-0.1.0 (upcoming)
+0.1.0 (September 18th 2014)
- Introduced skippable versions (for use in a search engine like Terrier)
0.0.15 (September 9th 2014)
diff --git a/README.md b/README.md
index 200d33f..c8ca41b 100644
--- a/README.md
+++ b/README.md
@@ -57,7 +57,7 @@ the following code in your pom.xml file:
me.lemire.integercompression
JavaFastPFOR
- 0.0.15
+ 0.1.0
From 14d5df675c82628f94f08d6ff5af390b3d9c948d Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 10:38:32 -0400
Subject: [PATCH 047/266] [maven-release-plugin] prepare release
JavaFastPFOR-0.1.0
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index d083375..cd2e395 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.0.16
+ 0.1.0
jar
From c3c792df0caa147b2e2e963a0de1949b2cf5b6b4 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 10:38:34 -0400
Subject: [PATCH 048/266] [maven-release-plugin] prepare for next development
iteration
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index cd2e395..0d7509d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
me.lemire.integercompression
JavaFastPFOR
- 0.1.0
+ 0.1.1-SNAPSHOT
jar
From cb7f39ba75935358b1bc954d430420efa0e350c4 Mon Sep 17 00:00:00 2001
From: Daniel Lemire
Date: Thu, 18 Sep 2014 22:01:55 -0400
Subject: [PATCH 049/266] Removing binaries
---
prebuiltbinaries/JavaFastPFOR-0.0.1.jar | Bin 2454 -> 0 bytes
prebuiltbinaries/JavaFastPFOR-0.0.2.jar | Bin 78024 -> 0 bytes
prebuiltbinaries/JavaFastPFOR-0.0.5.jar | Bin 122081 -> 0 bytes
prebuiltbinaries/JavaFastPFOR-0.0.6.jar | Bin 122284 -> 0 bytes
prebuiltbinaries/JavaFastPFOR-0.0.7.jar | Bin 147151 -> 0 bytes
5 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 prebuiltbinaries/JavaFastPFOR-0.0.1.jar
delete mode 100644 prebuiltbinaries/JavaFastPFOR-0.0.2.jar
delete mode 100644 prebuiltbinaries/JavaFastPFOR-0.0.5.jar
delete mode 100644 prebuiltbinaries/JavaFastPFOR-0.0.6.jar
delete mode 100644 prebuiltbinaries/JavaFastPFOR-0.0.7.jar
diff --git a/prebuiltbinaries/JavaFastPFOR-0.0.1.jar b/prebuiltbinaries/JavaFastPFOR-0.0.1.jar
deleted file mode 100644
index 6ba32b147e23f637239c839d58ca261bca88c7dc..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 2454
zcmWIWW@h1H00Do7L?7Xb)7iapDYQRBBp&n
zrDErt?jT|Bpx~0ZT5CmQxP>Mg2Z`1QpAPyAl<_hy_B!y$a^=pMt}6v5io~v;k~86B
zS{2*JV{Ln4_QWv29ERzBeq@K`CYGhTtz(8(j4Km4OVPKHtWni$Uz|;buKPqx_
z_J-fjzilQ^x9vZdlK<^y*W130hc2{~MP6R&F>Qfo+dkGUE~me!1Sx19e;2?1F@NBc
z#Z112YZ?OY-Ywtrxcs>CWV4_*8S5@CT({%b+nm*b+VbvS>{P
z--;CXZz;}G^30r;?O?VPS2DdlA*T6}@c})?vhvE`sz)atRQzry=Hf4=`OYQ1#rBW0
z*Rj(%?h0=Dzs@X><82jPS;UtYUG{%M&S5PrVb!RamvbiW@%^~t6duTpdS?W#Rx9We!b>?e*e-CdP(>(9Nz`M1~c?q1z>
z%_m64Je(;_SZl|vrDwLq?RIl_jk;jF*2ht=&TipG)0&NM>uQr(X1u=`C#bOIM9dVC
z%}N=$cmFHQxyTh;z4>+Px~Ex(wBG;RXVT;;5q18Rb;uPXzFAj9b_rLT*>FX1DAjJ>
ztY)lR(z!3dwe!sO7ff0{4}b6)B=_|PYOMIDcJkzf*M?mhuBH~-+|K#fENeU?68-at
z%nE7q!~1r&-CudvQ!!#yr0;%Czs-^|Zxl+dU0ir+!=J*Q6TL^)sHx7`eZGAD8O8et
zDk9E_ci*2cmOuUEI?abKtnW`ali9FhYLAkTEQ8gu#?9=)sWXBDl^*JI>c$;a^`a6D(UxlSX?LeSv~@ovF#W*Yi>blqWa{=vEfng0QnN%r)Aqt0
zzar7_<>B+M@U-{hizUl`m!%vPgX}o1(jD`D^=UCv4}{H7s)7)Z#ld^
zzf0hq_*1=YbsRgmD}T)4{r)lgn1B7}Lmc5dQ+mDMdMPgxXuN(kN~qE$O5yXpDIfkg
zwTQ2Hx>rNhQcJ~*BhMy^X=etPi2TILMJg{C`X
zgj`*p;jbmpy5ZCp4wv1ffvYuE`AB?t^x~}0+L>XUvbO_weN!^7=S#g@&j>4#Ayvgj
zlPfGGz|yM*h}|eG#R`h@3sQ?pGE<9rPaWi9QWR)-xZ7XxO|0AQBZuUSxfZR6OSlwi
zXqGVd;u^``UwUuDo$Y{udKW4{+p_RM%G6Y-QdZ+?#SbM$I5$
zjn|?3UqzN5ke@u`vQwk-Omnk2g{xnmSrm{p&+y8=xx0VAGq2yf+CIRWkx7IZcU=ke
z91sXFymbW8NHr%+8}_;rq!#xWkGD@
cdkJJ2A|(fSvjWXxU|?Ns7!1%qK1McGBLC6(&oAijqrAA9Fuk;b1f$Y_(x8C!ziBT$%g>hI
z!~Wk5?cZtg!V1z7;;L#4@)E!0XQt(3=@}N`W$9_=X6Bn!m{wR1PF(0@<|gQ5=|!L*
zk4rRCF=z+KygGAZRZwMBRNeAuYSHjuQBqh{(EU)SRepbu$gsM~3>n*sly3|nJ+Yg=O<^Zy?z
z=KrKRSvb0wncKM;|Jx+U|6xJU?@9LmF7_zC@taJItElgKz!c<{$a*{
z8R_4yT*A>s>>oBzcW^Q`wPj}E(v)_yl6G(taksEAcVRHKGj?@t&D4!E6UQE}F7KXi
z?Vi85UH+5LJ?-y_k!g;Z9^N8E@C
zjW{M2Pa!~s0)i;;ViXrm{2+{4A00hLRI}gfQ^HKdHThcg*HF`4J?~D_P*d@#B7c
zu2b|@G#a<-3Wd`NauH9&l|LJI0Z+n}G@I1QLBy3cyVxqBuoHaNnJvd^FY@%$%0Yey
z+EaJ6GZwR&0Tgt8bYYjEi>*goA=5F^LD!L}G^WWg*1OKBPQ{D18jUBH$
zeoDb#_iL8z9CLZx{m#F3o@*8PUJfqC6Z1#LX1m)87bV*X-e1-}6NT!NeDNzf7Ioc*
z4VEr>s_|R4h^zG-TXAbVHf%U`ZlYElsyd|lUW4il&Z;5(pOWec+Af9nZw`_pa66rc
z(;O6s^+Qfo*fI(`@n+Gj>cm{pvwN+c3$-Pi31?TW>V#eCv*Fnwck&nfe;f*&D`@N-
zs-6+*5l2|NQvbZhYgA^^&ZZzw@`HcO+)|VpgEZ
z{kAZk_b%||vGOM7s^`^QREm(NS3Z~@+7=7Q;APz%T@QByx`HDWo$Bgp-!tt_DRe`A
zmnKlJbFh{RsC+3m09UZ8B;l*2-
zc6WC}+}Z807KN)P$h6ySg2`rPx2P7!nS)?@ZD%*!wB0R*)~W0IXcNCDb$VWB^^t8=
z2YZA6y7w$U{@=3#StLB~VRB
zYW2du*XL#^?~1+Z+Nd>Ql}8=420{(K5l4l6$VO~6SLb+#tek_JbE;CEVb%nNIW|me
zh=e@3$tuaJ!3tp2WR+~yI3Z<5=Yql=%Mr~Hix7B4jdP
zB4sjRB4#pTB4;vVB4RRRB4aXTk~TsU%Z_48Cxdb_m#0{N?cJr3)&D?E_`Xuxb9mX{
z`&Zi=qsXUH{K-7Z2I}OuK-Ij9+9U+twvegrJ~Ue!u{yg;Fa)Lvx|JI-PcWims5lif
zl%JO?Mq|KxDg7^3*$=pI0PZ_OCS%!aeF(xxIKWPAIk}V8##-+d;%#0Wnr74LTT6==#yWv1H-n@WZ^P
z7v0ke9lD4f{%IIBr80b=`Z%7YN{R=Ik_!&v%)>@PhTWYd6WJUfBiU>w1B)uGPOL}tB##I>udJs|4JSn`pHQK=(
zJwF7#a@?ShnrH}YnE;YWOMGR)Rhqx>MHiiwk2;x
zGAgKuQl8XAfxtv{Y(g+VV2)K^_dy@8{h%To$Z{O$sD9fyW747F_z*c`lS$$&v2pU@
z;3)%T#vvW{J_;_%ji)#A^U+NWl?_G?duke18ICvY-FEH=+
zd!7M{v6D)|f~cw)HZ02pRq~g2A+BH9#z-cYg#;WJToHzqB^YI;bZFsNK-msiW`^aI
zds*(Rl8bMNtPffkuY9jqUa7^6vt$Lz*_XefdZ5S%`I~H
zJWsr|PC2ynWtb4#NIV~#UpYHqt&)uUG3$7#H0xNM$fN+d5j?8|{KQ@$1<$`+EXf`Q
z6MbI1XSj+%5`p#<#KRe=J5!&Skd=<4)1?7L?2Tr46pW-#>a~LIU`Zou0y%^-!d=*^
zNGONx7z}yx{86n9BPINWr4un~20e8OM1oWfxzPRM{*|aoR;z>tmK#;<83Q%+vlMtgN5RJXh$Jy(>3wKEjTIl5z8ES4cxxH%2h
zy5VspU7@42&0~oEDb{ky=mEa}1^Cc7meA(1(r3ZxVK#h})KOmdL+qjw$3b4t&(`>1
zLU$S?v8VOpNEYBfzYQzv&5O`;!?`Db*mI(^cjeuEwRI{>nPc)P2^JG7EI0p6+MUfXJi<6en_G`a2^$uESi+(CGUd9$
z41}1HAe5T)Tn{=)rB$W(|~i#>w-0Iz(is@ymw_
z+#Lj5JqO$!DBQME{yo;-$1O8i4s2XjB=Y$bUz}(d@-P59u8S7D&fr8g5t%(&De38L(1-LUeuUdezMDanUok#HqNR6~x_5e>jT>
zgW(7UHg|K_g^SJ%Y;SqN#~`yp&5raA$?O7_;@WUgOIT4-hb(x0au2(6bpVswZKTAO
zi=dly(|t>CM{1j?&^Eiowq|e}Lh5#YTk{>dz1jAV-bGd@n7YsD*aV)#@>1rozrN2o
z%#1g@y|8vI1w2?+x=e&Zz;krs`S7|L1JH)(k&11~gtCs$U#9UiSRfkbQsqn|2P#aU
zFui;g21fW{wgn0?5{MSPAY>J_;WY)ZrP}I8I+HO+l`%&6$+A8|lBVdaCcPl#W-V*6
zw)+KYdU%E(nmGAcy@kw;Ys%7kCPmY>YsNA)>@AZt(p;Qdoq^&}mb~px8D!lA^Yx6Q
zzm*4m>%7}z|~>&aNW){X5_r?WR+Hd9AM
zKrB&8v!{^q47+FRCT~$kGUniU17_iO(>`y)rLNzYh4Pg)gwRIBv8j&{
z;NtRvu3^jlGB90Gp2u8j4vEX?Q>gdnv`b?-$vxP?Fw8{#<>!d$be2cA+22{X>%to1
zdhLrK#^yg?@VP^^+@%L!>~Z^%{E{%9hy(EP`xVIsU-Sk4265R?MT7fFjv&YF|Ncn|
z;KvOVff>8oevz^y94CBvKwb_`Nc@4|^ifDi7>$4Ql3m@`!lua&Jwl*lQq4~Ej6$^b
zHEef+|22HwOOk#ab)9(~cAa`nv&r5>zR54*wGWl?wGW5{COo3Xi>6JQ#y2<_DcwX!
z$>|^HvKcJWSAJ@A0Wb>@F)@+B353@!B-eY{FgbBS~y`AyTyznKAVlwkzu^%hduZ
zo-Gx(lb9%*B{$^=|6t(V9wD76ZRm7^8Y3REa=kzaV9Mw#kZsKA@B1Y<&N$vY#?sh%K#_T%R~Ep~fnLUyp)QEI16$3N!Tyh2vk+Yq#dFV*r9iB@p39wn;QtDj{~710j;SQne8>3_s6as9q2B)%=gEmG{a2*-
z&zNpjbK4cy5?%1B*TxgS9xc$?T(;HKvqXymdb36P5{Z{u`AV#CYF3&^gKkuV#4zb(
zje1OaP!9%;DpeNrWpMZadjgbt!6#GUE2xik8196H?;fOQc|q)B&c?kFRq<^JoA1|M
zcivs@Z{B^+x!XR^uRnJviv(|3(#$vr3kXvz$8rPc5y%nB5qyk#CwuHEFl-h}T=Mr$
zfWzN>blGg;!uqGe1~cnB17~
zOgaXYAf(_}LgyBS76zT7fKANv`bw5F$XOK2mM+Zp2Nq@hQP}mRWL8uPI#)9I($b}d
z>|DP_Ueu^r4R}(h<<1V^D^ak=5et5sdF?=(k0%faxIDhfQYsLhVM~)t7f4gi6Q)UV
z2XKAjjYLq6QM{Mc>rJAQFCm++G&6)q>QI$RIGyV9**B)wX3}Er#m4DZ%P8n#;&bg%$EE%=
zz@X^K9rEq%SE-wEQP`8vs61nC9%8c5eu8<7wg79Cr=W}(dd72WhZlq>yFOk*-_?bF
zotQ@kCdXgPtTl*Ocokeij@~J+ZJjahhzCg;AxcgavD9W1@pS=IMcso@lfG0@u`(J?
zGVLsmm`=Gi7ThY2O^H>}p9fBZ)9^X@CFOQolDzgYthpug8>vMBId513k{Na`-iLH~
z%NMj9{%L(>%j@<&;eE!-zf;?+lMd0lN|rh8-!OWsmfP*$5cC%=x;c6!_M0!>AG_p5
zSL&A$y-u`q0;B|&F2*@}h1>1kpr=1l4Kl1yMV4LZS=0N|y{Xq(z0Hd|uVNq`ML`8W7IkYF#>(oV2>yvl|SU9i4!vE?d>ubsn+mLwhg^*?3N?*csC1Cw3}4M6n=`Kb^8a~JE*8Y>XxXK(eIzM>+kCBYWFmM96x
zA5%0j+6PmnXAWu4s4p@eAxJ{4zx3>%TZRGIKA$H@EgXfbCJ+0{s_yT^Z>jx%X)4i#
ze4pe2Ct{8(>PN_K55Ag{6zS5=>Vrnhkf$FM=Aen;wD|UmyL6n*oKD#SM;;
zpe`Hf;capj8)BF|y#kQ)7KMq#eisq<;8fD{Z=3g+X07qh8P42?zT2^N%N$p3Go3Kw
zvgSfk`ubz)nhwe6DH)SGMW4Kl%-P|BHHS=kANqV~I0P5Yx$Sz=@d%5_T_bd1Asc`1Zee|cRVSZI1(&Zt`EpUULtWLbvD6&S?VDY_*p
zK62&VNB70&9*FwW|HWu^0x))6
zVwc;ZUmO%*2Je2&y;kZixU?4LYv8(9rX7HWQkwQN^vt(*Jx-%!zeEtgN|O$)0pcer
z_5e)EMX-QgGYoj@4-Ta$SoFz8fpCinb$*hsCA2Js)SYVxjV#wLNG
z3wW`j%C^G>JBU2;mVU}$Aa%$E?8kT$>Sl5QoloWzlR@-Fq&I0r#l&aDxwWt@pnbQ;
zvH0S7DjCupJeq<##&ggm@@w#PX)xPjO!@{k4CU!8H(BBy3LE
zg?Z83H$-*{*8=TDSn1WD)@vE=!>KtlZVP8~+y8~sx=l4>NYuCGnrSNNTih<=ZCDX8E_OD%}w
zyB)u|=W$1j6iX4ta#dwOKUS*GxT2+oE#vhwD+iCo3n>_~9XC}r?IYsX%y{|EkLlHQ
zi3{pGmz0$ouzhAob8hwus!CyXd3YNg8>MyC(1>IlH#SI8NlzvZxJXM71t2RPiUk+C
zA2%BV7UkF-bIw8Z3bYH(B$fL~*LHSnK<+rU%Xt`?PCR_Lk$kwE8xl!Vc4Sn}rV!>1
zH9zL!@$C-FxHkr8yAFsQbV4{goJEX{m{uU*!ncC2M3IebsbJ6wDT8oD>~0#BDDNK@
zB#gLPpf@nK;Or3Xfh9zAgBKS#4p0kk1`?Do8=9fj;-=o2KN0`C$H$soQ8MwJ*$1Nq
z0%H8%J-&bWd;iMp|EJ@ZsaruNi9K#Rr}xIfzst|c|0ip?J7@bg->iP}G#^zSDMTtv
z4EYxzWwt73_d23OdGTjL(v!5(0#OvB4FL{-@N}agdd=t=cu#6NBmLXSPU2L{F5;AngR+4;diG{xCwP|H
z?snvq!R~hKl)&zG^i;s^cKj6Bj-$~VDd*2he5XgP1B=x`7e?kEh||Js>s`<1p-oxD
z6}iuYLd12spM|lC1;BT(nEBg0{&f~Zp^ALJMo1G6iswu-2A+az&j|K?F8LmzE9RLy
zn)4bE-xIEOp?i5NJ=?E#@qIjH?rvAQyB}{Ipu)a>F?;&%?B+YQQ|{hS_wpYa@H%Un
zj9CCO-Bl?p2sz#xxr1imH+G_CNTR;8%T5xIxOw%3A)pg>Nw{H_-WyhT(4Y*KHNy
z-b5g%|qlnju$TSy;#i*tY|%5snMj
zV^9$Dw>f3TAPxOh1vV>pj(kjrefsa4V@DH}Ylm+?9*%#kc6^*4LhRcA^k3fNyz!sj
zYrpn4x&!qk+4MFMVgr@y+{U#A|jzX>;d
zFmEe3ou;-LuCQ+{sGt0R%<15
zRBJQY)k>3Ori(uH)+{4+-Uw$#o(xA`PDZMYN@hAqYId_+Kv`f;V+=)+|*ex=hNF
zHj_Lf<)L*7pa+0K(ggzeCy}Hf%!ZnhYLd*vrf!5clDO!pj8lBIl!lVhz{zLC6{Om<
z6{O4PEXlg*&d6ZXVF9G+S7haMvH;j|+1@St+T#=ZgA<4o@^Bqw(RxAOo)2emM%-A8
zOsR%RG~5Z{(*|g1YxM@2BpxGmD%yRTL5mrdq$m0ru;WCsudH7v6YE&$uXxQQ`>0yS
zp_OzZfGjgDDd
z$*G8Q(o>L_WGA6l-;I2-)3jLmMnSXb0iwaFxXBrD1%(TzmL3n+_A_v1Y>Wg56_%uw
z1SFISpM<$GT_bUcSS1O@oU>I1Dfv=~hEh1zH*8Au!e|gg$*1K}i-n#vJsJpTGriv-
z85(zov@~vVoJD{1#2iw74$v{!rRj4Zr_I8pBvcgPSCcf70izg(-md0FQiEJNglhai
z!^j&jMh8t?0TS9l9=IEV#@QKpLN#|{>I#6K2A^b@b_a;2lTT*-tkAycX^kmv1>x$F
z=I%n|k{L)RkPHo+S{x$*TgJ%cK&O-&Df>xHe9~4RKfau))`9s$J{$&is%#i~bLY`(
zN?W2!($0qunmGps{T3u=DwQ5H2Z2)VsBBzykOfr?tSst7zw2xfMLHQSLn_9s2QC>-
ziz)@RSMjAI3uQwX0)lF=$gbrVsx-vcAC_RBHGX$vI
zh+4}SUWez0lSl@EvVMBuEsty>6}J=}I<2n7H-*kb7O^sfoRmFO1Z9e_K~G%%Hrbk3
z+rY!@gbuq7d3w*lAYDca&m~brc2os8wh@UQUpGlv%2xJoka*4R0fQ;IS!Gyj<6p+K
z1`d#RHz#9q*~fY95flY<MFsN>EXkLi3LNvR5
zQo1)!XwcYOgp@V*bv&Cxj>$5-7^zFD%aWT|jC=&ahHJN-*sGGKQNZKIBB};&puV&s+#{ZvPaoV9HRyYf2qjO{~i`w1Fcs4QS&^XA~$S;yZ
zS*twy`cUSYfzF7-f71e4B0Pg5&bfZk=NgeVWC`i~AqqEM=a+&__f7nL4BIld$}i(f
z7p@}U+{l{r32?6QuVLk;hc2`a
zSRijQBf*l(gC<5TBU!8@;zP}Y9b$D(88jO*bK5bCiz3U5YfNwHf}~K8xRj4LVO^cf
zq_%O7w2Vnf_D(T=opEEKE6B=;13WG~U~BRk>Q0_{AN+3k^-6QU3I0x=I8S?rR$ye>
z(CLKZl`CQl#itOt?G+b#2q9y;aKJEQJp|y!2hQ*&b404W*9|f!g5+K+wCnAdy_8K>
zn;sZOQ$>EsRY;l^GHhxYO3o)Yj$x;{=T1|__NA}AQQ|r2+Jz8kZipmf=*rg^9th4k
zKtOt#fk_DlZBMcF5?$h7oS|FUT@mM`IA!aBzUZ?O!N`zXTgk8((Id+{ErDGOqr0{7
z7By@-IPKs9g=CP61Z~&9@pB;WFa&bqMBB*#+9B9b^ga-HR|th|gKzu35d;H4rl-Js
z5<$$KS)g1848a6MtcXU`HCf|~WkkP$86K0cA3~+tA7>&pVl7V>;>m$5G)R%GUfaoe
zRrygZ2%6DE6f6g37PC8$eAex!vxZxXiP3cMSP9iOBUmMEFGaAD86L5+A3~!s24;}6
zjiEX*L&VwEkxs#KA{vO`iQV*}(iiGr3(54kL{e=dQw`Be&`(g`Y6$FS~%3y(Gr7(#4lvXxH?Mz6^%oN;6c
zw}DNz)(jf2A4(63sSn)CO16Gj*GOq1D}p`1RG9s)uCp}Y^$-5E&Fp`
z*CEzq1=ytq%O@93ON>i{x@Bd+EpG+y>fD-4ML)RGewh+sSiz-egFWKqRyRER2EvBG
z2AUl(2Pm)6hOhs)Pv2}Vqi^zsWC275?xIj@Rv`SlBA)
zS6+~ug-zl>3UZ|&xygNUvzmRD%;bK>)Z@1+e#$SQ%glo{@~zq?c?wIRRB{=^
zoR4I?;f@oTvrMF)L{Vb=FaSp6EhKtpj}EV78EC%OTH!glHjP3y%D{|@P_8b9g#7Dt
zvUf7#g#0mODF3KzF8U$=Xj3U75xnqNQ!z9OncqPls6|LeSY2FnYohU{5-3Ml)_Cdn
z$YabN&RQ$uD3Rg*an5pjcG4Xh2K4XzEO4X_QS4Od2#MzY^$-v{OfZZp(bovI_gw)eWc7ULfDkelksCH45`
zniOT3)^wl4o0y!?8xqrz2s9oJs1@ElP|jg4lX$mWSI7+g@ZUi7C0
za;TWgN$262WegPEEoH%VHQ1duQ`yFHuJMx$HQZw@PRyGptpk~B`f?urwWe~Vv6FT6
zD5hIyCQZ|JgkvrHqh=YKe+O!tyq})yHEWyRpiTcm{P&>HCoL)A?7Lj95CI5?{C^J$
zRjuuv?97=t{uv66rcXQKs-undPx9T)c-blD%59S&_zOEPtz3Y@aoHD2>oT>l17ykD
zrOa>;({#t%@E}2|kfIonP`*H?%5ogGWT=l?O@~9k0}*Yw3vPOJ!kVH`D9=3aIukqh
zxzBu#1q=Ru@CK>A42%*b@L&yqIm;1W8KI1$D|9qCt&B;xl}D}H^*E4P{)G2&?DB&3
z#)K%-+w|5Uu62?)tclRN5W7vGCDdm?uQOcufzCE!iSrchq2*`@Ya5%)Ao-5N$B@II
zNAHY3zJ#OZSRK)a+ca;WUnJZ=2z=$%YG6N&?PGDB4PjcQ9DO_xj@p?u=GTl)PZyQZ
zsZ2EySjaS1EPLa0J9pCH&EBIOOD2E~I5{isY=ytQgs4+&DQaNRw`bI|YdLmXOw#sE
z_xGt==}*7VvQ=H)6kzI(H)+^t%3
zlxNhiO{*w1b_)IV5&U-KSJ;&LhbbQWsAq)RnYVs0H;LMMbwpk{J)@ZMplGO@U{7>#
z_#G`}Ff-y4W%W4Esn3V#WHR|x?N+*WXQPTBBUbK`EV{5So
zZ(A!h`as39Y%B9aNv&Pn7i~^a8hyxuwMvr>Z(7esprx`AGs0(aYRs+dK5*Hidl4Tn
zVrHPn)tY@a8$w1e@6*~v^_NlDMHw)A>(dFNse7mw7V2UNc`}EMB@x7*L=wFo>3@W1
ze;;|GI7Rnqtf8Z$dRp=}6ngX|TkY)j0o@XLUwgN-~okMwZRP!>w(hpAJ>PE=o%DKp@=B&Sjtj7<3RWGNo(j;fnUA;(YxM2k^
zo)Kcz?tESfm$z_?Y0}>5VV?YQu6y}g@1Xr>d9>*eao6@U{
z)qDEF#lneG+&vfinbr^*S^Sad{38Y?gv?@asH75&WXv8TQ4*pvXw4(3new}CZL)C+%>Nqi
ziehdDVAEV$xk6<`Arl~Tw#&!0%9~%N7TiY%kch(}g`TdBRMe(g!)6_Vri3XzqEed#
zVXd@NjNQg0<2p=$bB@w6lUw{AT7I~A#a}-Z_zx-T-%|FgQ}E2ANK|J~R4>KZ-w-O4
zuR6UA;P;{2{7Uaqvkgj*!_A_yOwxOmmi(tr*H6&RPMkyV_6CcF)2Wc84c@-^bFrV%CT6$P`qG*rG>pNzlVqFa>bmdYM
z6QygIM;^@A)zQ`wjNToVoYOhT?d#eY1Yb|!R5a{$v2Sf|vk*SK@7&b>m;vyMRL|G8
zGwKDj`rkY~znbG2$iNAPOV$|!sJ9hOOiuPXRHtSr54t=H9=EHW3)>uYJWA`pcg0?8;L`~X=6
zN*E9Wik#pBkEG{{kyS8sFx2ka320~azd2f69i98-cR^v55?9t~vSco@a_|@0bH3
zfxfCnUy-8Q6+rD&TPzKUgKao}h#j@peiH_t6|MQy{7G2!*S$I`L
z3luEufXPK8^jhpf%w_W>1h#e<=ve&VKhTm30`H!@rV!*2Ajid(&k*b4@2y*;eXK|d
zH-SwscCrH=bzVBohuU1>chZTz6-jYqNqzjI^vH%j*og?KG!wfvPIYOW`Wrlx$%TVC
zob0S-*A1s6Z1IS=S++@2pS5=U!Y&rzU8J$Yxf#8y
zP|K<-Cjn*9mjs6lq&|NQb`8P7bWm994KWDqCKkOGOT7M(`fZo2sJ%
zyGUK?TLqh&b?C!F;?#4-!c}Fhb!(pnt~G=gMmQfbY}SCC^GDseTCxd7S8+wQcvV3h
zQH*RI5+;SjYydB4Kx*Qmi6JNZ9cYNWKv7QU0N>QLYe>QJ|r}
zqkcnRB4NTYkTBrTAEEWW}y2N#@8&
z5KxfMP?0fFkTFq_r^QA}#YRrVM$*JaR=JLxd=)w2V~3yMo>xwdoIAWjU1`Ya5ZcY0
z48rFG2oD2r&Y)t4(;#G9S+(#SRu7tFpks$?vGvpoo2hpAcjtRSrp1D%qd_!L!3h-5
zI?|~cG&G6ao2-r>;3wk+u#L-FtY*~9*w(IWYs55)5Hzc^6O`VAd6radotrVX7pAjY
zV-|I|Lp!%}abin+)7|EMZ^Z+t8hw+U2+4M)!``a~r~KvJ$utQl<0Kzhki8$_Ep(2>
zjvKS@t#TV8Cu8!CQ5B{jVBKSoITS47P3G!gHkMM4#@)
zV2EwD7e#}IW_7V3X?W9Y@-A8h7MtCO4byfNlTgi$n8M&z{Y23p`^CK-O}R;`bUC!%
zy;jNa(GB~hQc&P|=z`g|8ou6jj}p-L>!cVm5`1svfnIWd<@eozfA-;@j7NF?KoWmd
z!Z+rPcLVu8
zudZswO~d|8q!-sH25Ab`@lR(6#V${u;c1=HF4thcTEUs)X|?(8GIEAr1^3iCEn%PY*8U;}1-$$z>Kj0olfgd{2CX1)l
z0BBh(+GTPAM5=szu>VwZ>?`D-S@_rw{C}&`d*s;Jo;KA#*~N|1Lc9PEP}riats?~Q=X{buzA00
z4f`HO<8$6Hje%1Z1);nhD+m(@c}Y(q|Mt-1)_O}u)Ou&Ykq(;|vNM*fXJ^R4wCK6C
zh_JNeHwi3qvjF2yp=vrUqUEhYGLfAS3MDz}3=V=fbZ%gAB*=3e=fFLcT>6;#v3xVL
z__9KZKj&nn%f!m$%0$X!D9BjlEW+gCXQ;B6S=`InBbjNKD;5V&O-whqIE1?@n>9`B
zP(=R^19!BedlHUXWs8qRAPX-mNN#VJmDw(Fs$@!00zjQiol==p+0~6Y?5SF&Zx(@v
zF)77D&SK7j&Z6$?X%dDJ%DXcNfBR42xcNK)9~F20?6Z`~Wax?G8-7$$`8+3TNc4Yb
zJ_otFkthUzcT#2uua8_o+WA?rk|}ctKKT#bNGityN^E-E97xzV!n_`B{AwfWwh^#1
z9z$F%OsKidxU$BHshF^fLXw>)nOI5=ovEg9#RaH;Ng?Ab-FJYY$Nd0-7WuiA
zsHwPkURaL#?mYbpWcMj(d(i*i1Nq&*P>3gxKtPh;E4<$x>i<^H_pjC6f4ZdM8r!a@
zXa7;n*E&|+DkzkWHqAyRG3FvQB+{{o!6gn(hXOp9gaK>a7-lY=b~2*0-cjlMiV1+U
zxV(V#KOkPfKC;Hn=k>nRecuphy`xuE3bZ7jJ_W25zxucT&fD({xN(Z8DW`r3@?EFvx0A!X@F@AsIg4pH;+0Q
z%e-aNrrYK9acioWzUDFt_8A3(p=>Fm89AWgT0py&j?E=)tW?i?F%%nZymmPSwVXn*
zkHh@|@6Jsc&F;=@S(C!sR*&RlN9;LHY^zbFbcKsJnXlyz#Y0g8Heamw_0q5QmY&Xx
z#-K`XcHZ0u{yWWBeeo#JR>ZqKadI|yVuR_jKAo@dPVNG;H=SWb?{JT=w|PO&CiA;9
z!n29~1ih(r+d#LP(L{maq*tdHEW@ozW+jEu=e1MK+QY{AZ+rq=yVz%no4*Iz_%F@eoZ?KZ!2CvT7;)(;k+EaBHlz6y2
ze{LJeKfO(>2xJTrkxO4!8&+z%x)tGtn&8BX?>M1K#q0)YhcRAx!WkU;dUmN(#i&m{
zw-_`coys&Bhq3#{NYKYGM25Ay0IEiPdD?Wz<@(KEj0k>`7EPtEI-5UX5E$^BIDL_-
zJto^@`fx4FdD7w%cKA+){l6G5FlpI)U?BJS;UqCWU)Nxrq9Gm}DDIytR_4JIwFTpq
z0Ax5Pk}-ROZv$;l-CF(a_MZZ4ke|N08>0I_h^FX6RE>KhoMik&e_vwWbSXcOL(8i*o%^AUSg-DFnh&6
zp$mo9T-Zlf!{^%9t)W5}Qj|6X*uscg+*!h1^swsM%4Gj!2P%j;uko}0Vy{U$r(%+k
zLEWvmaFYZ05&1|6OZ&XYe>%
zL6-%;FoctiEzy!n@-teGi0!S@6p|yd$)s(`CkYa_SVysWZ*y$u1UV94q(RE7N%x{j
zgPjhdZKoWRz`{EfJ`aPSDD-8uM84qhI7(WHYF=`#A^uVFM%R;zWTA3?bsVN1SXEe-
z>-!jB8+|O6gcay21{RiO%x3XI*K}RZ5He%F27(fn^vsS5)(>0l5{5W?9AnP_9cpXK
zj;fI+hE|)5Jf^>euMr+mbWn8>&YaEE`5mtrjcHl@JkUq-84}jc#9hHea7cR%V9B36W76*r3~jChcm#zZT?__^07>#L0T-YNVefRc?i
zDqCsOu|<1u^^W~3WQ0K+W`}Rvwy|28_XEL-cQT+4Je?Ik(Bcz<5+}BA=&kGyK=KH`
z6;4?>Ie5@^13?wQgybd_>j$`m-eU6OHFHFiSy9+L{GTo(W4C|NR{Fb*?KJAQCq
zJ{h&Y8IUoqBVRaUw7#!pFw1xDgtHR9f)A1`tct&Ga&GNVhoq8*C2{WIC<`%2^dY#2
zF-x>;w=fvh=tnYCMis54LN)C*cO*jXqzJ=~JS=-$pP}&@AJM3cFb(Xf3Baob>Tl(-Aoa$|M+XT==Rfij3EzV*Tbk?I<_z;x!UV;GOvhDBQHXi%)4
zSzhXF5a#KA0UzhUSkfvkGJgS|z>X3Qj{8$+JQ~P1kE&rl8aVtngj4yjU3V^*Q#&gZ
z9ItQC=iHwlqMMWxVH5;rOzsc{pnh^~l!!I-H}g^NN%lE^IU(yCvEi#qZ@FMRzF|2X$W
z4R03*`
zY$Gbln>9RnZmLs^FbfZc!TZbdwDRF^YKWQvBKJZK{mP8$C)$(I)eRAp(Sh<7M3`md
z6Jc?Y7|?)14#J<4om)$_
zCtl{^!JK}rN>o4MlK>S4`Q6@~ezskF-BI2&29=uWQ%@avjPiZb4&auUwyvBxX*xN(
z>(iV+`JwfH`;zY2wCZzjs;Cf^x|~c;J-wksI5K$COsSy;h8Xb
z6@RFE`!(w6V||&m#sGd+wsyW~^r}=Jk(b%F7H&=rDS20Pb+O?xE>HgP^MXZq`BAtZ
z3A}MPED$p6G!bcxWz5uqmdH3Jn|9*Wqf$E#``{u=je$Q7VS316>-;Rir)l{klCd>Z
z*}qdopNroGJmC=p!kgYXe$AvC}-az9dlX6Q_K$#f04xhpgDk2u`I)mWNx
z?~bU^A7D8Vj6Exdd7|XdEACm*WM~T!-r^gG<3yWA1}z3uJ7JPk9g16#OUMQp{tx1)
z0v4S)IS8G(f=#biG1%F&J7ahVN0PEZ9|Q)|`G#%9LCH2^t_8Dqxbgk5Co-12R+0Qk
z4x^Q%jlu;J#%LlG=0J2s%08H6EVTU@t`k|tD@i}<>fF}4_>Emi
zcQZFC&lN|^d-&WQc$n|T|3la}M_1M@`^MO@(XnmYwylnBCmq|i-AOvOopfy5w(;`a
z^KkF`1F3*%+oU!Zb$B#@t0pSG|
z9lNGt^X!R)%}5HmOa$yW7K9%?feHrgEK3Ezf$l$S!A!|n#C@tyrg9skkq0_mU_Pqg
zp*u+kdtaw&k9x5FwtZoOhq`$^!b!~4FFOmxnA}md;6{8Mr`9J1ySZXB_&c6s@#G&|
z1Yxh*OuS!ki_&s)k;<0(&dF)3V_aj{BYHXFZ50`lEA%6|x0hQ~aAy3xsO521aq>*n
z-X`qq0Ul5vcfb_xnyh)oe{z$Smf!*Hg%1?Rw-|14(vd%E`W3WKdL|RMHe`qo=h!>&
z_>;cxGj>-Ql!Z<+X2#mL%6#=@$rI#e^!N!^_F$?vK2G=oP-?$jj>NP2dS6LS0rFLu
zo9ua>OoN6ht#e`|iMR}=R2)ev-a432mmEluEaIFLeT;oikwtQCK`mO_AaJ}p2uYCK
z7pY)lv@PLBHf_xkerR7IE0DufExnCI0_`1uDwuIKPfIB}EjukdEj=xs2mK2Dh;&Yl
zNq|W*a&08yM#5MYUkJ_eL$-jkC^PFzR7ND)`=K#>60sc&PcWf}Tq1nwXPtiN3G1b?
z9*#fJG1)QUG3hbNND%SO>1F4s91
z{Y=q%B3?SQ4cca=Q=
zL))1{5-DF4Lt%fWFPvyr4uZ#}lpt#^J#e;_VNwo1&!@&>ms;E!t`TRF&gh)EuNL*`)K04_*`uowiKb
zZ6(^c3C>x*#)JX+G!#CDgYp!46ZDwk%tLgINX%M7EQo?bCvW^gL19Fzjo`cRO
ziarlRCBtp6Q1FSe!_%s6U?!&X6P;pJrwoB?=xQ&Gt*y9H&RJbpG#))OIe
zMJ%+lSqX;?{>U0mnu4H)I&Wx|P
z6Dd>oZ~|-NHff>EbBeYr=#s>)F%r#pJP`Sm0S
z`p{_d<>k6v=5yz`d~BDL2PWu3^?X43H(HZjz0Ajy7?B;Agxgv3yJBEC+zyzf`fT`)
z>tz`%bcNQHd1iPf;$)zb(wAG25X3v~>ny&rKnTWJ!haweZL2s=rMt~U
zNxcF=32n)T@xZ~ZSb8Sr#3M9!gRBL3oBx_mnX^L*5&ZN}R`GhqM%%D71CE#gPwlcW
z!d2%6yQ*W&7tN(z;o|I~*wP~)y6@M}YjTlBd$k14XUwlc14UMkqev*ty8(3dZjo=+El;d<6zTn=<
zAXkCd1ZM@M9xiwiSVQT&E-C>^8-{DS&FDu2E|QM<8D>gb!Gln?o=)QgnktIr{eU#0
z7%6lgA{jJ#JUI#*t>p16_Gx9@w7Rnte5&iJUmNnyk3m_YDhz{np;p`-q7U`-?|3IV
z`Ird?PY=A7#yJcXUts`MOhIjBVUxF+mKSh5$oRze>NW2F6s4~Itge`EF}nT^K~eoD
zQTkU#3FrToA~jj-AEKzALwZ-|)k~LTH*7A}c5_N2@@qj#_LNl$(#M1a^JP^L>wvJt
zO61gKIb2Ba@=zQ{fiP)$oH(j^l|JOsraTo8FbSyg-LPkrW}@nKL}b~-Ytzmc_P_;v
z>H7Aq@wdaym(9EJ_nObaB_Q}+a8QSP?B(DME+cm#o=1D0@*PT0r2AluQ5o1LD@??u
zK!`^p{9)f1!WcscpAHS~lax}+IoN!dLRjwtrjwiudd4#G$OEGb(GdHu9!?08APCHc
za4CzX)5!_OtgCJY&$@m1sg`1+1zfrmtIH&9n-~o0gPj@2iw8?X*TpJ4EFW0y9Xi(%
zwKVs)g}(EZzUQbj(e>UNmOw^*+u*zfDl^LkBaaBe8Gid)qn+%&Yngl=*7ajvA#`za
z(+-!kW1#?31_z+2v}2J_Xc$~rUfRWz7so0MM|m2VmU>n|L@$?i`F#vVsV7Y5!OLum
zHrgBx%MDFVVQ=fn*!#F~>z_q#S|a+)kzK^$J2Low!{xgk@Lb9iQ?vDc7FlY)^=DDH
zf+2=$hH{Z5iOT~NVpyM83Tjfvu_}*~BA&I6FLmi-yc`rZsjo61Y$P#LfY3=b?X72a
z(Is1X_HVnVt)tNm+
zm|ienvd5N$m>SAt!Dn|gF`|mDoF=i}!<6Rt%KBpE{XP>Pw3&-`bAw4zzvdo#UlU(a
z^kx9jW{FWI%!&rbkLEpBXDlCAYkJ1LpTbM|i}8(c*iT+Vbwf&73+%pyavM_gG^TJ{
zr8aTO+*~OK57AGl&ULLqS%kq^8mrTNtOH#lBwOX15MM*3)6d9e!r7}v)m;v9VC_-4
z?8KeeVe^X}t;wTj3vJ=O)MM4hXMCotO)5^W6Fn;b|uJvo%df3g1Z%U%|M5aWi~#v|fJe#)rm&*UB2Bhq!KTnoq2Hl|~vYVvCS`8NRwhPVS;1c~eO$y+y(1
zpI8g&{Vd`70Ed!Se#;(uQvR*bE_Tsg(#EA<C~{gnMb|S$=l_v~y7u
zr&0(GC2>p=u(;BCJgO^+D6XWSxYBq$sw0UgjwGQ
zTeSOlktf|-CO6?Mb5e+;q%%rL;pUXUEF=pXiX^q%_p9g}(-U-xibP9_Sgd;~5teQ|
z?2#lThl-MpX*o`IxGH)FoTdBRr2AZ9hHCSsMXegEbQ
z+qiYb;VwVHD|iL2iqHEN^D+otuv+3Pv->QGIx8VY`B_a`3^r?Q)IY|
zKP&66c(tj!qRO6B#RnoF%hF{ngC^+&UA=GdT^{uUDU#
z&|Z4PB178~U$i=G*_lPY^~`Fv@8Q2kYYUt`cSi`HNz7VwgeXT<)!C^#xS^@5Iar{T
zsyn>*(4FZY=d(ruP_k>i>@NxD9kSwx6t0BhTq?s|dGU~KDMw&&zNj*;{}ill0}7}a
z?4B38obKv8!)*(9kF;LZ#rP`sZ>305W6N4Q#+*E=4{kF=@lz~M?)TNQa-7pge8k)+
zVgTF^C
zFO_Z+&u=&PZM)`1PSu`~Ss?EUC8n_j_gWOY3ydixfir4QRm`VI1r^JAhwB)TJL1gO
z3iE>#!$_yfRS5)SU-gbb3hYjKg%b*Mjy}C^K6&`MU2QDsKd{4>SF3RQ5hI@;6Y(pN^Y-Q+xTFg>>0@qstcLGX;LsPqjL$Zr+^l^dGDYnlVph5m#a4vZo`I+R^T8;f~d6*pg51m-NtVUwmyjk&zVWW3cYO|nnhOWp?VN*f-
z+Om}}D4l%0CF7f_pW+?)d=Ew09WdU3(AlEe8N91sT(w>}CUldg6(7-f%DvC;-%a(K
zeZ;r*Gql9f@RC7!m{`h$0(~StF=m51gy$Oa|Jecmz#PuyX&i@s&y?No<3F0z-;ja-
zAQ}qGi--#UYvyo2*e&rvKtTM2fOmypbA@mfgNWIGUk@ml-!&2op@=q@&s|sf$eLdt
zFHrdy??{-xpC?N5HucTvGSicES2Pk7w2W^ghqh$x$HZ!pxOtJb5pdfJ*NzKs-eb^9(lErK|de4
zn3MzSCdu9eAd4Z}9cIbSKs_|87qR&E6b^0Eb(9ZW?e*owXUJbFflD0Y6kz>=2Bx}HbG)vaF
zk@P{RGV&s)ZX;Z-x(9cu+l8Ore5T+rV}(C8Ggr>DD3J-jkz`@5V=`+Mh|wglXc0Ng
z9kVC+gfA=1N)!`?yGyH^mKC<&1;jk+wzsvlxiX1r#+E<9=~W`wEVzloaX~V5k?yTA
z;pKNG=iS0$oYaow`LcqmV2^vuLX14a2aftx%7mwUqw7t76yH4Q(jRZWOi*nC2aL8gyhr8hM{fMC
zFc`b+VIyqdHXs8Y5@qbC*2xs7?L@$8jJYGgfG){e4XY4g>J)DWknjtdLzmuoEaDSU
z9(k^f$lWfb@(s!T{S2OyRAYM6K<+XJb!6ukRjTriEdSdbVoGU9^&QZycJqVIH?ov;
ze*Dnzul;(|Kord51C}tEqEuP?7!>TWSF|7AGVeM*R0y%xBUpi0#}uzEJXRW6m+?|LNyewlNFf}LPwR!g?vQ$`DMdodleIB+!)$w
z5DQL|M%Ej`hYmF+3gc=x&3f`kHC~ZHiIKaWM78;4g3hJr^6(b!1SRBVkbS=
zDTUx?=axpW9EKj;ji@(97o9r&$C7&Ov}z)kyp(2O&8~(M?3>7xT+O`imXK?BN||tSvq$SgmLy7|tfQP}b2<4%=k&$T=#5;@N4q|VmRq+E
z!?r`fhjr6&mxTh89LVj2P4S_$8JXoUytOd3hQaL1}@xNR#V$zCBOlakDMadO-Y
zoX*xH-_jzkn`4-noEkn_=U9$Ll+ADba#lrh*%udUt=3P+d3`i36DH2pCFruoJ)aF+
z90YV>UOnpRqZscjP54?WNd{t$+ON_O;vUrx21-qbmAaTyfo#@8P)=ap9M817gStkK
znG?n~=I@kfZ_MX7irQ%eC|?mLGd}M5fiuzMi-(UC$!cgq^HXU8Yk5H+PyI}q<@=iY
z&G5w~wZj*j?dJ&3*^OQ{;>dT_8Do@k6GDDd!X;O*jLlM*`9%WpvAcNZuq{QD$63N8
zuLvD9#c8($bA=>|t^juQco%+*%@@3@QK(U?@SUc>%kq&7kW68Hr&X6c1tMp*`;w^I_I8vwbhI}vfU77xa@WR4xc;1
zVJJ?w^_Tet{#mXl1YBZ|L?6_J2IF*^EoyHc(mG#D(JDIHu>KIeaU!bZlwkD^T7L94
zE;wDzgv_nU3EM^Fg67Da_F@9JaA7uI-4?5=;5LLNQY`c87JQ{y#Qo22k-a>McDneX
zi1Ai)CtMiku)0^^?^I`rp9e%`pq~*McvNl!m}-;c8bbVN2iG{FzoUR(RZDmL#l=L1
z&=N>YAYRJ;Vixg*Zx5s@GRc0esiT37$}Cbzx?(B5lI9ZIOU`k?EZljY2kW>4r44QV
z)IAU8H81I3_5}M|)W7_W9I9DY#9(0(>Ofnb!B(E4d<`4BA1fm_NKdwD
z6S}g%62z>*LMyqXxYo1XfbuD1pueze=u>zu_Mj}gC9?o?BxWk1%YSw!%yJGQHeG
zt%@p|m8Z}YX2Jewyh*F-5ig5$M=WcqDlQ0eW>ro6ZdT~5(X(n2uycN))p;>%+J@G~
zI?IN|v&4cDTC(7z5n4iS26E%Y?9kxJxzD=KXFz*Fu()q^kAuz|J7vxrnp65@t><}y
z{re!Qct(s+>muKjjjr;m(nRd*VDSFeojECG_s@oaF=odARZ}o4jLWFc1@8~)VG!vc
zEp`H)msk2AuI;D86aCQ~1+jzCEtoCEtR%(I$b&0Akv9-Da5PcJj2W*Vk#>f)%rw7y
zf=D|SEh>Z61dg4i)4K^>+pZZrnJlkN%HJYd?`)Ln%(oZeYI1G;sN=`ifgTt34~yEI
zkuQ?=oY+@{T@9aT{=mhq=#6_#>-T%vPMvceG#~nM?UFuf8D4E*I9_+!<3+Cu)y16{
zmKS`)%Qr7wqQtQ1tua&0y}0KHT0x7jiD%mc3^0`%mO=>5YOsgHbA@EHT!1HP$S(x%
zx$DBOKUh``Y$fk)34}!6dIO&BI@xBA2R+LAKD_Cv!+2D7e7ly&v_#o8*~~14Z(ezF
z)y=Y}x`U&5!Ld?ozp3OXJBpDS=QHn58{>7oIKz|0m-o~-2XVoWV(p{5E0VqH09fhf
z!#jPc5cb0t)XOQ)=+$CjaU5oL@(KffKx$OdJz%ve^T5QMe#I8_^Z#@A$Sec4U%%1I
ziN15m{wWCixAAc0{}aDUT8sRliZlF++==r@rf$umZMdN)&7{U^A
zT`B4WpT>zGXa7*eNL!33E
zHBZ$p3bksr&zd8yV&2k1olIu!Lu}2ahsSMUAznO7lm8sN?dfe`Nxp-xZ`mOXZJ2(U
zuy0kvg~DeXddk(F-E$F_E}yi^{l%hn5|kg@SVD>*T6xfx>n9~>sus;`zbu=x>#X%b
zq08@sh`mDs
zLHlh>sPbmSg{>R%MWP;oJ68s3st`XE@6mT!Q5m^Gv$vv7>~267^Cgnm#P
zjQbPP1X9kZq^uu_O%7E>8F63N^B5X62+{eU@mb
zC}^%9MGPAIH2AHYF`eb{;hyc)@$oRI7|K+(7?FwyU1N2S>}u!}RbI6jxZ_x>(6Y%I
zTq1xWWcdRBAiAe_SH`rNhrTFJPsh>8>qSIGTm&z#dnpN}^Vv4!5-FtM}Kcg><*u<g77e*|BqIdz#URU4j|tl04=VfHlW8jKxvV)H`gm*dgC5nkUQ`7`j;4i%x<
zR-Yp2K4#r8Vx(H@mqxlBo%+jHBi9|KJM7iTOXAl~=(BoU?9W^LsEC49G}U_Q3|n<)
zOLdBR>hXc_@=P2r8XPZE({sCvfueI+nL@@NOzz6yn`8_*RxsUG&_J4dM8skul=-?!zvtVObJH;Z4hauf)f*@Z
z1O!TdCqqaXt@fg+;Lh7G^uppVDWJ7{{=w=~qnGGAtfGMT{Btz}rMQl4uO6T-ScN-K
zrS;Q-R7VcX6hX5*2Lc1T83O|hB4-ht41p3%atnac3DjmHdgDlc9>mCq@~i5aA$%3&
zMXqKuDu-7)0$D3XGaqjLOvn6i8k+$n5Pg4jGG(S{!cMJMb>=GYUnYY`+l_#0z5bEfm|@y%(Q4HVvH3
z&%AYm#JMiBeICw#H*d(moWadB{Re9kt6BLMZwQWkiqIKvbSh&%
z;eN}s_}t)#VnGvYEFsOyK(%hwXB7P9QYiIB@N=&{va#2;JCuez+c@-IAhn$i;(
zN?kqPi}H7aN%Y9Mvc1fsQ`!u*FSc9Rbawp|ieqg1UR7IA*&eXx`9wj>gKh;eI1--8
zBqj$>B^u=wW^tnyH^!69%Dl8D7TB+qzb}tN%&dktFnd3Lq{R58gM|7&0<@JV
z5(%PhDZL;|62=~RqaU^p1=GL`899izrbbe3q-Q(+WU-8%kWYNY@4wODlcT*#rpu9?
z7}v@*su2Cu8r=%Q9`51$_*y|0CykM$h{t;M)Aa`T{cpjff5c>lc^~Rh5C~}h9teo`
zKZ%Kuh4cTAj0GQ$4qA29!&Z-@EUr7ASR_aSv4r(hXsqfmKSd;l0HRf7f*}bgMh}VU
zQ?9UpdZ@_=X2)!BK|vKnaU6j`Xtcq6^3ar~3pH(Q{iRheAFC=|GxgQ2sqS%lw{BjQ
zi+ZanyDHvA_3l@CJ74KyrB?Ubld3TcmCv@JSDjpSP|5U1fcICr^c%rC<;Ked;nLg~B{JK_S7w
z05Wh|z$&UU#W5Lq=a6K#YU_@%zzHEZF<=N)h9XUgq0m6CHz0r%oEor*YE7}MR8#nU
zmC2~yh~NkX+kuqNhycE%0EEKrUR0i-fKVlSG;n;m-UU=|F!1k2Y(RDKHWxsSvPGiz
z0d-xVHyU+aq;~?9Co3SfXd4NYCm}#w@!A|PN%2epz!UBjSH9K&@Pz~nD_*+;as+yZ
zmF!`_@x^udEx`)i?$_EzbhF^6|N;mN2^9h$#YdsV>|9Hx#@XdiyU_d5qwr9
zi(i+I_>UeF$M)-O+plJMn|a?_={xRb&G^5-Q*+$be5N`ti)Ot?m~C50zjCXibRDs$
zx-h4@_;P%NdESQHA7yXOGxt^y_{(K}#=6=_e!7spl#;$+NZ2g
zqZ_67*qlo^;-&rfUy-C!Uhxdk-aq(RZz9QjJHxjOcG)wYWyyT&!;fsNM(uR1P?lB(
z%4KyL!q04WAu?NL$ZYGvGi~~sw&(xtr@#i-qChqrV|}8Hp?r?Og;7EmzsMF!i5;Rm
zGhlu~kjhSd`2Drf@V1S?1DlLKWb~|mAI|W0h`~cSt%Fl0q>2kp+XcJnl*M|%V!2|j
zMzz%Nw_Lwk_WxxVEmuSu{-)ES(WSW|!Vvz@v$8&1ZTSJ|_zve0@J71C=wjEIWX5;X
zWWVVs~WCEvRuY@Ijda5!z_De=CXO+`qb+nX(JolS;9W8aC`laRJP
zQo3dX_{Id}mTqHEJc|N+!vpk7wl7fM0pQ(Iy?+$1&rmx81KgCZf1tjTfp?4cwo^RY
z0DMCOwu-l(D4u-)o3g$53fG~i??~WR`P;G7^nB$!$4<6y9c$ICXHD%_Er%)Xmu(+0
zYnPtmoo*f59?e@mCk{{iZ;xJd8!zwe@>KPun?74Gm#s%HPkL=1oa%gMlhW#4*ONy&
zujio$Q$Dv*atBjobys=Y+?3CBfUeAd?}5H2H$C{D{OzoOZvlLxdA>dE(_8G;q
zC!otez^-UJlj7MF&=nkDSG=u?>iq+JORm>T5(~k1^I~b;@o*rDYx$C$~x|yGzJz(v!
z^Qj4g_wD7W{#j67
zb+ah_bO`4)Ae^h#N{8R{OECDez0gr8B|cO$2mA0VXa8%l+VkhZzRP6*nZ*D`E>Dxv
zACZ*5no?nrFDh|FDZ-1S=bU(ark$ka_e%b7QvEBZHRAIT
zh^AmGSxz%TiIAmWD_%}AVvd-gU@KkDGJ=VqrD!TzPB5a5sG?{pSTFxWImSIyzjAg
zn}qAp^j%sZpHnzh^=o!vp~FzFMz4%@gas*nQM3pS$wFFW6)FBvqzDx0L_&lMDSlF<
z2nOjyN~8@b{xV8JpNQxK7X3t7D1K41sJhW5k5&-oM?iiX3pJ88OA({&j0bfRBB@n5
zhCSM?tVltH-b}O5nd!kdXf1bNT&V0RnX8)`+}_{J~io2rco0DH%
zmA3F61k3bkgnS5L9$NDiejr-H2we!5p+LD%3aRQWVx>Z_3CtY1iuMpAUF(2V5;@z;
zbvFDaI&Xt|6Gq3F<^Pyb=xj32_N#l+{Pox$Q;t>@a|VLi9(j3{PrN`A={L1tAit
zvk0`XVxLS>4V#pEImM2zTAyw{GQ_SZ*K{A0mWBWf(Hlf$R}7@gz$c8HCz+Ijf3wE6
z4Ud{Q>Jr+`J(#u+Ix~zq(v=GfvSgI#5=#8B%4&8`@%(ZzNkOpMfX@`zXY~$To7W(m
ze&Nm!i)S_LuEdb58GG{`lY(INI&?j?=>U#2yat9~^np;4E;P8FF1pw_C{%#0u8(D6
z{tEI-@D5(o~YcY*r|&WN-_(vDG9)GAJ
zx{j~@JTpqaeF(EXtzP|sb>2~x#;u$}o!J!8>kIPCl(GhYEcLOt_X5zXrbeSqFueJvHX5fUiUmk^jWO#$I8ewZkYNCk@9jtX7YXs}bOy}~iX
zdop#aW0iUv{#FZhv*UqW_4=Mv*pswq#~+iMt~P>AvH|V@_a#KTji1x-UA&fOAOR#n
zo_z}R&M?AAZLdk_+lwKJXhR3eihjFo!!4Kn_K`z1sJ-nZ9x+HX<}~g!QOj^)rLeo{
z%cnYdv3#JG*N5?**{Y%@w2CVl@5xRife=aJ6RUkJZo5N|){_OD^e7jd{*6yQ;1`W~
zozM-<^{c;&gZ)1x=1YBqv$c~(m@&9eRkcv0ta?Y*W?y5%$o(lfPn-$Aa*ms)o()y8
zep-ez%8Hn9t4^go=%?XF4b-t!frsJ-l$Zel;&9iOf{w)t&TXsWhmr%)zE$y
z0w6RE2MPx2(_wo)(H4a*5&95?K+7HcOfLn&n1Wv#DIrd^MRkY;0k?J+NC|)R3&QRF)MPx?APl=2=
zHL5R#aIRV9|Hh7Fy;O0ahM2;({llT|;A=fyVAXs+;tDdx`$nR8p&n+rHB#}>8(_(;
za6zPC)Bl^TwVNY)MPq@iQu9j%Gvh~a9jmKIwxt*CaXTC-IvEF7*XgbN!+z=Ot#aV*
z_8;O!i}h_Nezu`lG*kYe7ulC3(_1U2k4DpcjPo#LjEXcgUz=!s>hb9JKaKeVU{coK
zAVFf``jk@dR%*LmFjD72;lBmKUH%OCn>&CUcsM--4py|R<(MlDyF>pF&2P?%z|*ap
zxNIU@T*Zj4z`KYV3v4Hs8$7EWwjHEw!DC#iI&~f~Wkr6D9ei?^joI<(gI-b?U%=dq
zg0qAFW!65ssHk31m>ciD+iB@CQKFd^!->ImEN}&?=&g&&&ld4TrTG4)aq~-2!5blB
zOJk6{@@esdOPSfz&b<@CIVDd_+suHYbBXBVoKC?TPB|ooLeIzUM^`gLEc5H7&=#+G
z*%VW7O0>z-KwWfW45so=!CsM^Wh+;ZPT7NeGs|h(bTwy9ms<7PWh)Qs
zKdY=c?F?}DQyXX(%^Gjv6u*pF_6>M}C%?Jax`Hf(p)CJ?4Yf8W
z1|HGa5J8d4%fXwVTdMe=Y;Q>yFs~k36+^g;YMc(9QazD=&PdL)rj41U_JNbfn&cb4
zjL7LJ_*+v3O%novPLGjm|D%7m99#pI2D`dK8lAviRk%*%qVi5K&qD2vK!Gmvfk1^q
z`<6h3Nc&D;!KBh7j|#hWz4ovPP(SNmVRYztl(9y6KLU#OJa$mc+N_?I{<_Y0aH(^N
z*NXVG6o%%ThVg{LvAKDaWf|jktm;N4RON?^N~wYn=rqMS)`Tb_^tI}7mGu-qDcJ%Air+OBCC|F=QPn%qAIUew)2Km!WmHD>xW
zX&%7_hg3u3)qd%Ue(8GHwmuUe;|&pWd#XSgo}LYqO)vt=(v1jaMJ#z0Wb3d^e}R(F
zQD@M3PUk)BdE6fD&&pvrsOm%=QUx_;;=M>`_NGU|P`L!R>E=S|(pUeK4=^T=LTjC)Uy&mm_c6vt1lBh~v;M%6L?l6HDP0wa$A|e#^$lho`(404xTI3owOKGQvZ97Pcp%&6}Te8PZ8cSzcNX`
zGC8f~p>+)rU;35`p*V-@u-GzBdjw{a^MiLyLYl@KX+QcXObakI
z3uuF7)%TPZ*HfaKOh~q|7~E00yJ&y*%7HGQV4izt8ysmyWtXDWFvHc%$-%TYdPQbi
zdaAbY7^@R>2%e7B_(86dcQId?PQ71Nxl)v=(7m*$W7Oh!>A+Q;#;diA-gj3_meS?CGcl@KWT>H?6!N_
zyeh-X;AlfjCy%;D)lNli2QZ7r(V+Wpz-9+=4%DVrkM`R3#TmF=GxKJSUe6j$k2ZC(
zj|DwmpR)~WR=
z>ki}6u?*p2#WeIx+Y&GHO`2ylO@I39T)E4dluobKjk{9SmkU&bjx@sVcL@@>8H{YG
z`>pf%=`bhDx`VdHhw2b(*a7d?Y%;+kF3Gxh<@g_pf1Y1e>}*@vcL?^`3aJ}}p3EG6
zumxpR4x}fa8!!%~6N64%*_I4;`qY!nhMqCP|8d&ChVXnh$LK@Q{&FQbaO0maf)ii|
z)+@C)^JM4=q~pNqsrI5UKgW-qd<1YcvuB*P0{hv5-)a7i%!0xm7N_R40?%IKlzmVU
z%;862cmx_M0p4Q=VB$|0@X-1>Aow5K9JkC9p#CU_kE;k+TI)xZLX
zh7~rYOS0zPCaPE+wWa~KCaK7=qtBpxSi=%j+Qk*ni@mtmC#6PgN?4&KpsKH!++)M4
z0^2s$VIZ!aoa3S@fH`S$4PvR>wpgvX12V#8PoV3%a5x`QARA+o7QDgd<$HG2Htbtn
z?tVv}GrL<3&y0&x@5XSZ59;8g@m2S;juJ<1XFSxw$jQ~nG>e@N?+6YpM4Ce^3kn#v
z^M|qbDb=tTAr?)HELyzwvt1U(C=5Et0#aTEW|?ojz(YG`g}%PuDV3ikZ*n~eL_iKfcYKca%o{T+JGrV#%8Z}v4!nqV#7obD#XSLDu
zpbb`SXWH^90bFebqwYLg4^-uCJM^P4ukp{B3q%zPo&Xt8Isa1@dhEQlaKl)Vi6YQ%
zSb|~j8dqgr2hgadyyvF2mXzmj=s}&ywNUe_l1H8xU~2gN<&9cC@6en2&Y%2iY8|gA
zOXYaWz_2sCbd)J)}{83921}&lR(L>o`>N;9@ZhLJ!c?IwLuuHWdZ0S<$in7gNzVR
zkwC-V5)v3L_MQamG7W!&+5pRb(I@UMd27=!kA0F*`a`E=1J%}^w1DZs8zSytTj4NM
zq*~e-jL5LXZr7RFoTdh94LydGM8sOyDOo7>tcQlZiEZly-B;YgV$*O35?c)EDAx~@
zh?L2OVif~Xe09S9Ir8$
z#eijS;zf8=J<>2AcH+k+n6M440i&!M0AeJH;vG<}Y&!>K*x>FygMc;vLcbEQkvJxM
z16mz4PZHMdsT?4r#WZAJzey@GwEU6K`?p1nBjs^&@?R6+4o7!eH6Z#JtrcM?pL>WQ
zq^DS12X!Q#AcO%$8UlB)r@g!^ihvJoz4A(Hke*F>=DOd(PFexRoTVmY>zBAS_Rrkh
zc%K=y6~BaO7L;{>?f})ky4Q79?wa-It;k6~R}$Mt8}qz#P6_{X7!XtFGmc$6@2-Iz
zTp1>PnF1ehN8V~##{2?4;P`9=2vJk217Z<_PGS+Ix3Q
zScjs?E=x;;uOOH5`p>cb&9ni6mM-yggAAEhg?0mf`mG|D0=&UXPB@z;A0oBCp)3Z
zPJnB+(S&{i^g0BBdsbr=>7)s&jb=a>x}5@^M!r+SRY%Q7-_w!4%IpYn$U!p9Cuz7T
z7wDoD+*&yo1H*7t(o4uS$O%7l)6h+S*@@rw)LZLyMZFw)?ZsgX*%0gZyVe!zCu5)k
zcIBSj0BlXnU)}?iaf6IgLY_Py2$IQ#=E*_W!<`;42bSwYIWtPr8kvVMyy-3wSLjEG
z^G}y2l@t&E2RMdKldB1hr$2qAj^6ZBTj6l$%McYq5M9FXcRqyphhF~60<3o}Q$4H-
z6ZRFA89NuxmLV=JmSlgvfn0e7Q-*`x2x9;GTHs+^`t#704&Jt0BkVhH5`QxSzZs)7
zJajx@9y*iehYmYLBYS;fal^r}-;6g|4;>EZ+m;&SeTN;=k-b|sYdj3w03N#Y@7~Yf
z3AB}*i}zI)-=EmstkGNPL->q1-rvBvOImWyRVH!99nRUKKgJ|W#PbtmR^St4
zrUXdScX%Y2guUX7LtY3*$F=Ju)y96srH)#ZlAxdm@z{nTGW7??86TP}Ct!&M4QL>c
zCSeec!mCe*cQE2xO_{nkiVbem?4An~}f9bRAPk9frB-_1tgc3LNKE4;ReB`!!QitvF@2u#S)E
zc+)FpA@hd0SbCv8re(N~CH&Mi+;Kb%3M*!wP-eMU8Q;x%w5w(z=Z3k-*SsBCEbnxS
z*YxEfQyTqd>2-WrCQ|SADU?tBnrcE{ajAa5M6svw8TI4W0$J(4vB)OYh$^7#XPPBh
zh-T@WY)&ayreXD!NjL#HQ)j98(`Tu<)6_}$GryB^8Hdn%3zvv1!>1eOaA-L385h5!sDK{Q
zhstPDz^8kt9>*m+DNYj`I696b#qS!lFAAHwQ^IR@04*Eld_=w
zK|1J;N&f0AcsD$#TjCQ9s_rA*O+vd23F+*m)V&OwQE&0eN_i+zvsVrp>)V=#vpof8
z7d5ASm+jv!QT%S)?b~93v(5O%2R){H*ZsR)t!l3x_1d@f4YIom?uI*Kko7lUWTAt=
zvAE(2?DQ|OQ0NY_gA^>4krr%(QOfZpq9<%BRpCgU(6n(2OtHLcIa3>~dRQS=Qe3LI
zPPhz(ZbcMdAix2=UzdUfn@&}%c!&NV7@!Urw=ET<)?X}D&Z<+m()v~k%%W3~WZDlC
zzJ!}~4@RXzl=Op6RjPfb;Tr}=E<6CIjaIJr#s?uN3r1iP+*SlGoC6mUjgd689dM_a
zN>O;2Cxnw_k1=LGSv+RW^d%jhV>
zzZ>!F3_K`kuyeboLUPHJSAifYLLs?+<%OCL%xHHefC_9i=xNg{d2E
zH_Tuz9@Qj*&C~>!4h9#ln3hLcpGV3_g|d}kGM#`~9Nu7Tqg@BBg58N8uYap)CopNDQVk>ox7Q@$4JI3H7Xc~7}7e~260m;s%{r9d4y~@B}
zw#y2pF%0!ET)Xet>gy291i@{PhMe!`5WKuoB0`B4)sD=)mPAn;^!;8V@l0ePxIHPU
z6T|QS#v2ldMGR%n7ti;~ex({1?bv9YINymEXpC_clb#HA2HrJHttj@U4w4K(z$Z#<
zh#EDGM~BTy6r2kS0a4(#=g~og`i{8H^&X(d?O871=q!qEn3BK#(-CVd`ueYeYn0K@
zfw+dLj&GFt5ZXYCsg7Wj?KgpG_Dwi{6Yl>Ip5MgsKZM^m!C|h`iv%|j8!`M$^oU8X
z@}M(9B*WrCH)4Kko)sHXZ77w&gKbuvZzUije8XgmO$EveH~1IRvJCdfg;H-!IT0hE
zBBYwySRhP&H{s%X1MRoYa5-emrvIx!jnawDtv
zzZiSxDBFQ|TeNN4wr$(CZQJhNZTD{5wr%dVZ5z9>8*lx_z2n_?&bVWo_eWM{YJOQ&
zseDOQDwX+Z4Ec+C9_SrT5LQRA?00N-qT(K?$;U#Dv;Y3rfE>RxvhH*~=}b{A6e+3_
z<8s)r&j(WN<54^jJ3RCRRg>jjMIwj*#?=fG+j!gnW-7*wbg&r7B#{n^TvrQaS_0Ty
zjb@U_9VX#3ne*NO?UCZBGDil<<-^3|L5o{DSAs^(S7K8rOG!_?znJGQSe`sGuiSWf-GER@o3zfm}{vvCp6Dml}*Y5EU9RKQhHIy`-Yx_oc|M@_|oCy
zOh$TqRmdSu?c1SEkjo{CL3;ZjALH`sbj8Ql>CFs5*up4r$T}q5PLhC#!_@>I+xYGT
zY6^%5w7<;8ByklAF_z)42Wol@NSNYal6V*fSbP=)>n;sots&xgiM>Ag3?AuXC)8{5
z9X99>ys^r#B!0&x*Mz-V9>*8rtNzU6_dszTHv2Gx6euUBIRP!`7Xagsd-P}p2GF?d
z%}~n9dAMgZMIdFgQ^n3>MLk3^I%2QC?=h5-D`FnKsC|+3H6@J1%=ej!yr|=p4YbD0
z#9q^qu$8gjVgYn1fF83EGe0cP*5+qr8VU$V(GyXO`tB01({1qL6pD-
zuOg)Z-AYPnj}3thlPsYEta2m)hjN3Q7W^JrKqAGMNQm4Q^bGQYtd3kN^Z_mWF^zSR
zUoYioj*L;l$Egq|2CmFNR&|zv5Oo#BOyVrBtU^{rHx(21VX`b$!88_sOcRStRyc$u
zi9!>*K-LLkDkojRB=I{8#?()`ZV1a9klaWC;GL7JnZ|Mf$C>p9GM?n5C
zlr*3*fc!&~L6T5gY2a5QR^WKLIP^+f0i*;a4K1lVNwB1MuGXot4JC$e>P{3nA-R{y
zf$wqivniV*-8a?}D&Tu--;g&`KSiXUsYt=GkCDR!WI^Fi=3B~0L5Ux*2SR3{FEY4;
zp>5ou@HQL~&X`1@lTKxV3O+#vaB*;D4l0^R6cJ@$u0nv<(5o3}jKPVkrzVLiYhw$d
zrKKs0DPwCD0Vw7FQ0M?^K^#Dt0;nVj0B}T03+9Q=QrBwGs6M|8aSs-XuA(|h1QZ{K
znugXi8E_(&6l7ARZGsh}Qxlw(gH-^$X&Qhx0q{q^i<+={m$OUT-zabCza`>I(#5gL
z9=E9`)$$0>GK)f}R?yJJHp(grVx6L=WVp&JdX+b+_l~Ka(As%q1V-T#9u=LpiqX`p
z0%F5q{v;qNcb<-SRCK&E^U$yfj!A`|j!RX}e_}DBXAu^ci9C^BtJS?ThtN0##1;e0
z7t{*hnaco{5*h%@x2pM167v;BX-#KPPjp0e+JTrkU|aP(T=Kf9r=x9kHKfvdK#4-p
z(NmMO0EeD{4yYb&Wo_teboAhPnuK&0ofC8O77cG@>}K>80|^IlbMsFPfX6rk0G%cP
zxB-A30El>siyQTj5ThxqRmD9wv+Py_oZ=(ehS9ViP%$8MfQlLTPYnWq=@0<0(9y&^
z7=N{7%*WY@XjVeQH$jnWFwf}(M
z01);ckO=@S05FszE>3=|T@ptX_*+vdRb={#Y^rF~CJM#6(V|FCM@b=80d^{i*+!U~
zS%sd8a;zHsWTc|CAP1`(BNdf&J;cQXPghAH%mQ|bn#KMrc749qPE=6|7bj$uxS`M(
z<75j^s8n6=fK+$dxdar)lXvrNU2kRTFO0M_W+yjcL31;kBtWaSpUZc0HED5(bF0{m6f4`0l>*iSvhv>
zir&TR!=>~TLGh;-YdyRr%X`?R#DGElNbOJQWlmMM+EC?4DNc?}$1+el!e=X}9^btt
zqSJd&y(7ua^99BteZB+f&fg1!Mg06*lAV_ef<^xPThg7^3*bf2d;${w=L_UT(tH9^
z{=XN{i>Uc|B>XQI*o&!;l+(9FP7L`kR~K$*@($lqxTi+DRimM%Cjs0*t!96J&UmKxe4P
z3f~8ub-*+C;^#SR$@@aO)KhVN;;Ez|>7Rr?;VeS`7&gHV1b_kmB5(N6oWKA;zjjgB
zq(SL*GOKE@RD4h#kpBS#J#4Yp$?p*_1&K)4#?0`?mFmTqcKasgQrSly@o^8|^;7M}SF
zoE+VAa5hr=zOcBDk^g`=X=jnPuT>k6G|b&*E_Xo%W{B=sEhf&L$MCRCXSJ|yZt26U
z<}cob-NUlI99toiGeXxb?GhIbV(D2TavDX)Vp;!AXwfDI7$iPBNi0fgk>z5OB_+<$
zrSb^a^X9U`mWC^GMo(O@x?En0&9a1&4V`NPl>%ErrCQ`H&;XUr3Rzb-3xXEx;AbOQ=|{$V5R+^;PhFMTE>jLvRxqs=IbywEIPnz`oM9U|^xG$iX9Mwidtu
zr>YT0x~RL2)H*q9{zA%GQq6IS7qSMPOI@dlm~T~MR`DF<7D}u)8Nx}WDT@Y~%_Nqr
z0&?*~hqaQw)QTo3O-?hDrnjARS>YN1Q*0KG*JuW4NLnyz!-D@|`m`ixL-Pf8=ZsW4k7g5TmGo3F$3YDB+iJKKxV2{DeSD1^*qZ#
zWB{*oNf_V;siAfO({cg~W?{Z~*9@j3zy&FYB+@VRXUH?|4c@1j?w7>j4bZ<9=8$@!
zV!Dhmm{GhXT4u{?5NgAQk{I_np0gB95026f%D`&dPU4WtCZ21+WM;0@b^c?Nx*z2|
zKF-Cqydk%(i~Kx+Ecl*4_9hlGi(v&zLY<{T7=;#Rhm{6d2nR|bomG-^D7jh!McjUQ
zCKH-`7;WgM9`?VtMZcPs$8A7J;5w
zpk!9Yv|T!7uCt_m*OiuScwGmXtV-t4APl_m2b`9qC;UYjbD6jZ6@tH0f8Ie0xQ@Pr
zfr<=Q$a`sOUbx9RyhAiz#+gx@HT-xBJh|RPDj+W03`MBv4>rgo_G;v(1kk+t$rV^4
z{w$KvEVIFxe#i#~s7GMoVPg#5;E~8qJ^`oEYkFik*hex_f-JUe^YEn|^ZKc5u%rv4
zG?WwpKXVEfXbQhDNgm3V8A^z2ZQmcfkYA3nV5I`Kku{Udw+NZs6rhT^R5GX#4n^NA
z!Jgo%j{2NN^GlR4OA!Bt#Q4jw5T%T4yY`0mx(=o}li7uT@2B_(9Q>=fgn$i1`^C5?
zyQ-G-L5nyLl1$o4NYpxv9kLw$y!#;m<+=9-R0TSVRN>H4uK-e$Jo7=UMTv#EDqjqi
zzeodqE^@G*SjWeFgW@MMj8?$czV!QLrlXcIubG%0H$z#+aGo1#tE@rHvZ@vr6fo02
z%H7T1Jx_S8l0HX!-~~N@a}2zI#9mKFb5&D}V_{5VevEy9)P5T(rzB2ya`XOgecJ+X
z6MhSza#6vL>tTot=Ysg!gSH`qu3aL4T+(0&eRn{T?Ys$zTtdW|_~*|t2S44T#|d1(
z68NY~Etf=f&oBQHbCoYLUQN4hGv1B<8e+Z`wF8NwO#dUJAKE))kV7?x`vOWwzXM_k
z*@wwV!y4`nT)CxI8F6(f&0MloO)1||owVCli7)Wl<{NGo`gLo-Z+-rZ!qwY3P#-sq
zIUczUX*&P=j^b~$;ddW{CA3{`4A`BOI_2W$g-V|vt+s5AGM8xjDbV&oym>v)tyet*
z&^J5qeFAfkp((H*22jU1Hi(fyx^c1z=st#_wZ-%!cT|Kp6Z;)q*gaS^l^+T5h6#3f
zJsJ>VA}P?RH(XRL22nElR>9CWgsqQm*+S6
z8ZvmhQDu<~f_`{fh49+gAF(2Wfj>fJtV{6Ize;(c_kN>a4RuYhx_8rK3GpUgPk}tj
zJ#1NQz_j=C4=h8Mbf?u|BP>RG;RkhV^!OepdIj$pVt#(Z9KBl71t0n(RI1r{owb@U0~DL@>`E+KvOQ;M<|M&=byj
zGwiKs_Zpz&iRTBO4p&@A3I&IW$P;2Uh*`vHY1z@x`!1Y>?>CYIS6Mj`amPp1#JepH
zqp}5KCvhq4d@~nb`sm+QH`I0Z=eD5X_B}w-=nH{c^f5p{^icrxY5^T%C3KmztIFJB
zW6`vu%-lj@uA=-Jg2Uub(Cy79VEW5r5IG+kPhnkgx@`(ug8%HVr1j;
z7YLE2z@l&wBO$B_gcjgqGokn8H_o66`>8XKs9-n|-ZDRGET23ZtOQkd;Tg%li|zjcBU>M^<;QOFi0T{+L{(TR-v+U>1PeQc0cjFw
z;pq-ot1w@X7pl?ms(-!$p#vK995<|bJ2f^(NYjbD4W{#_Ev_*9Aei)?ZV(j+J>3e~
z;xVjQAFIL5#|5784q#1g&Im6&!fsjO{9-KFQEQ|rK<`hi8TXJiuMYA^w1Yf+*>}JN
zrY&(tt6<54HX=3ye~BliGcmwQp!ursHm|lM>qV)V;$0%SY$ZZ1+Lf9mS#ca*Pg@Q~
ze^GGZs6@%7gt;M(!I}S-5B_V&)DpNS(rr=5Z()_+CW`I#1C
zFVMzP)ntommSBdPnHCrN0dE*elD*e9&M6MpHp#yX;$+Id^8^REPLTCd+~?!eA8=f)
zY-XBu>t>9FKhM3~1hk1IdFsV{ch3=w>1BR2v_ZSZ0_!UN5>?