Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Ezra committed Dec 15, 2013
1 parent 08ca3ce commit b9fcc3c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
13 changes: 13 additions & 0 deletions README.md
@@ -0,0 +1,13 @@
slimfastq
=========

A very efficient lossless compression for fastq files.

Usage
-----

<pre>
% slimfastq *fastq-file* *new-sfq-file* : compress *fastq-file* to *new-sfq-file*
% slimfastq *sfq-file* : decompress *sfq-file* to stdout
% slimfastq -h : get help
</pre>
2 changes: 1 addition & 1 deletion coder.hpp
Expand Up @@ -24,7 +24,7 @@ class RCoder {
enum { TOP =(1ULL<<24) };
UINT64 low;
UINT64 code;
UINT32 range;
UINT32 range;

FilerLoad* m_in;
FilerSave* m_out;
Expand Down
31 changes: 14 additions & 17 deletions qlts.cpp
Expand Up @@ -85,14 +85,13 @@ void QltSave::save_2(const UCHAR* buf, size_t size) {
for (const UCHAR* p = buf ; p < buf + size; p++) {
UCHAR b = UCHAR(*p-'!');

rarely_if(b >= LAST_QLT) {
PREFETCH(ranger + last);
likely_if(b < LAST_QLT)
ranger[last].put(&rcoder, b);
else {
ranger[last].put(&rcoder, LAST_QLT);
exranger.put(&rcoder, b);
continue;
}

PREFETCH(ranger + last);
ranger[last].put(&rcoder, b);
last = calc_last_2(last, b);
}
}
Expand All @@ -106,15 +105,14 @@ void QltSave::save_3(const UCHAR* buf, size_t size) {
for (const UCHAR* p = buf ; p < buf + size; p++) {
UCHAR b = UCHAR(*p-'!');

rarely_if(b >= LAST_QLT) {
PREFETCH(ranger + last);
likely_if(b < LAST_QLT)
ranger[last].put(&rcoder, b);
else {
ranger[last].put(&rcoder, LAST_QLT);
exranger.put(&rcoder, b);
continue;
}

PREFETCH(ranger + last);
ranger[last].put(&rcoder, b);

if (++ di & 1) {
last = calc_last_delta(delta, b, q1, q2);
q2 = b;
Expand Down Expand Up @@ -176,13 +174,12 @@ UINT32 QltLoad::load_2(UCHAR* buf, const size_t size) {
PREFETCH(ranger + last);
UCHAR b = ranger[last].get(&rcoder);

rarely_if(b == LAST_QLT) {
likely_if(b < LAST_QLT)
*p = UCHAR('!' + b);
else {
b = exranger.get(&rcoder);
*p = UCHAR('!' + b);
continue;
}

*p = UCHAR('!' + b);
last = calc_last_2(last, b);
}
return m_valid ? size : 0;
Expand All @@ -199,12 +196,12 @@ UINT32 QltLoad::load_3(UCHAR* buf, const size_t size) {
PREFETCH(ranger + last);
UCHAR b = ranger[last].get(&rcoder);

rarely_if(b == LAST_QLT) {
likely_if(b < LAST_QLT)
*p = UCHAR('!' + b);
else {
b = exranger.get(&rcoder);
*p = UCHAR('!' + b);
continue;
}

*p = UCHAR('!' + b);

if (++di & 1) {
Expand Down

0 comments on commit b9fcc3c

Please sign in to comment.