File: README.md

package info (click to toggle)
htscodecs 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,640 kB
  • sloc: ansic: 15,651; javascript: 2,907; makefile: 330; sh: 184
file content (88 lines) | stat: -rw-r--r-- 2,016 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Reference implementation files
==============================

This directory contains javascript implementations of the custom
codecs using in CRAM 3.1, capable of being run under node.js.

These is not written for speed, but for clarity and as an exercise in
checking the pseudocode in the CRAM specification.  It is written as
close to this pseudocode as is possible.


Prerequisites: minimist package for command line parsing and bzip2 for
part of the arith_gen.js code.

    npm install minimist
    npm install bzip2


iostream.js
-----------

Makes a buffer appear to be a stream with ReadByte, ReadITF8, etc
functions.


rans.js
-------

Implements the order-0 and order-1 rans (4x8) decoder as used in CRAM3.0.


main_rans.js
------------

A command line tool to exercise the rans.js code, included for debug
purposes.


rans4x16.js, main_rans4x16.js
-----------------------------

A 16-bit renormalising variant of rANS above.  This also includes
transforms for RLE, bit-packing and 4-way interleaving.


arith_sh.js
-----------

Arithmetic (range) coding with Schindler carry handling.

byte_model.js
-------------

An adaptive model for keeping track of symbol frequencies.

arith_gen.js, main_arith_gen.js
-------------------------------

Wrapper around arith_sh.js to perform order-0/1 encoding with RLE and
bit-packing.  Plus debug command line tool


fqzcomp.js, main_fqzcomp.js
---------------------------

Implements the fqzcomp quality compression codec. Plus debug command
line tool.


tok3.js, main_tok3.js
---------------------

Implements the tokenise_name3 read identifier compression codec.
Plus debug command line tool.


Testing
=======

The various main js files can be used for adhoc testing.  There is
also a Makefile which performs checks against known defined data
streams and does round-trip testing in both Javascript and if compiled
the C variant.  You can set CORPUS make variable to a larger data set
such htscodecs-corpus.

eg.

    make check CORPUS=../tests/htscodecs-corpus/