maropu/vpacker
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
A simple integer compression library for C/C++/Java
=================
Overview
-----------
Released vpacker-0.1.0, which compresses a 32-bit or 64-bit
integer array. It is assumed to encode a sequence of integers
with highly positive skewness. The skewness is a distribution
where the mass of the distribution is concentrated on the
left, i.e., an element of the sequence is rarely a large
integer. The main aspects of vpacker are;
- Low heap requirements for compression & decompression
- Fast decompression against legacy algorithms (e.g., gamma codes)
- Optimize compression ratios by Dynamic Programming
- Easy to use for C++; just include a header file
For example, your code just includes vpacker32.hpp for 32-bit
integer compression such as the following;
----
#include <vpacker32.hpp>
int main() {
uint32_t src[N]; /* src[N] stores N 32-bit integers */
char *dst; /* dst is a output buffer */
*dst = new char[vpacker32::CompressBound(N)];
size_t nwrite = vpacker32::Compress(src, dst, N);
/* nwrite is the number of written bytes in dst */
...
uint32_t orig[N];
vpacker32::Uncompress(dst, orig, N);
...
}
In case of 64-bit integers to compress, you need to include
vpacker64.hpp. For C codes, you compile a shared library for
vpacker, and include vpacker-c.h, and for Java, you need to
use vpacker via JNI (Java Native Interface).
Currently, vpacker is much slower than other state-of-the-art
techniques for integer compression according to a journal
(http://arxiv.org/abs/1209.2137). However, this first release
focuses on low heap usages, usability, and portability.
Some optimization techniques (architecture-aware designs and
SIMD optimization) are future ToDo items for a next release.
License
-----------
Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
History
-----------
2013-02-24 version 0.1.0:
* Basic functions implemented, and a first release.
Authors
-----------
* Takeshi Yamamuro, linguin.m.s_at_gmail.com