Input
Read supported baseline JPEG coefficients
Parse a supported baseline JPEG, retain its DCT-domain information and reject input modes that the transcode contract cannot represent safely.
JPEG coefficients / HTJ2K / Rust
j2k-transcode converts supported baseline JPEG inputs to HTJ2K from their DCT coefficients—without first decoding the image to pixels.
01 / Pipeline
The transcode crate owns the CPU pipeline and shared contracts used by optional CUDA and Metal adapters. The HTJ2K codestream is assembled by the core crate.
Input
Parse a supported baseline JPEG, retain its DCT-domain information and reject input modes that the transcode contract cannot represent safely.
Transform
Run the coefficient-domain transform and HT block-coding stages without materializing an intermediate decoded pixel image.
Output
Produce the ordered codestream and per-input results. Applications can wrap suitable output in JPH or place it in another supported container.
02 / Execution
The default batch pipeline uses the current Rayon pool, keeps host memory bounded and returns outputs and tile errors in input order.
Adapter types describe resident DCT grids, wavelet subbands and codestream buffers. Constructors validate the associated geometry and metadata.
The coefficient-domain route is deliberately narrower than general JPEG decoding. Unsupported types and modes do not fall back to a hidden pixel round trip.
03 / Run it
Use the library to integrate transcode stages, or use the J2K CLI for a direct smoke test with an explicit HTJ2K request.
$ cargo add j2k-transcodeAdd j2k-transcode-cuda or j2k-transcode-metal for supported accelerator stages.
$ cargo install j2k-cli $ j2k transcode input.jpg output.j2k --htj2k --lossless-53
The output is an HTJ2K codestream; choose the required wrapper in the surrounding workflow.