CCSDS 122.0-B Image Data Compression
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 93.3%
Dune 1.8%
Other 4.9%
20 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-idc https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-idc
git@git.recoil.org:gazagnaire.org/ocaml-idc git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-idc

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

idc#

CCSDS 122.0-B Image Data Compression in pure OCaml.

Overview#

Wavelet-based image compression following the CCSDS 122.0-B standard, used for space image data systems. The algorithm applies a 2D discrete wavelet transform followed by a bit-plane encoder for progressive quality coding.

Features#

  • Integer 5/3 wavelet (Le Gall) for lossless compression
  • Float 9/7 wavelet (CDF 9/7) for lossy compression
  • Multi-level 2D discrete wavelet transform via lifting scheme
  • Bit-plane encoder with significance and refinement passes
  • Progressive quality: partial bitstreams yield lower-quality reconstructions

Installation#

Install with opam:

$ opam install idc

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install idc

Usage#

(* Compress + decompress a 256x256 grayscale image. *)
let image_data = Bytes.make (256 * 256) '\x00'

let compressed = Idc.compress ~wavelet:`Int_5_3 ~width:256 ~height:256 image_data
let restored = Idc.decompress ~width:256 ~height:256 compressed
let () = assert (Bytes.equal restored image_data)

Licence#

ISC License. See LICENSE.md for details.