arXiv:2611.23108cs.CVNov 2026

Manuscript Offprint

arXiv:2611.23108

FMT: Lossless Image Compression in a Fixed Number of Parallel Steps

Ammar Ali

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Learned lossless codecs make smaller files than common classical codecs, yet the images we archive and train on still use classical codecs. A main reason is time: a learned codec takes seconds to decode a photo that a classical codec opens in milliseconds, and their faster variants give up most of their gain in size. We argue that much of this time is spent waiting, not computing: the network waits for the values it conditions on, and the arithmetic decoder reads them one at a time. We introduce FMT (Fixed-step Multiscale Tree), a lossless image format whose decoding order and entropy coder are designed together so that neither wait grows with the image. FMT stores an image as a coarse-to-fine tree whose steps hold independent values: a GPU predicts each step at once and decodes it in parallel rANS lanes that carry their states from step to step, so an image of any size decodes in a fixed number of sequential steps. On this tree we build a family of bit-exact codecs, from a rule with no network to large networks, and no codec we ran on the same GPU beats any of them on both size and speed. Without a network, FMT beats NVIDIA’s HTJ2K on size and speed; with a large one, it decodes Kodak photos 9 to 61×\times faster than learned codecs we ran on the same A100, at the same size or smaller.

1 Introduction

Many images must be stored without losing a single pixel: originals in archives, frames in editing pipelines, and the training data of models that restore images. Such images are written once and read many times, so how fast they decode matters as much as how small they are. Classical lossless codecs, such as PNG, JPEG-LS, JPEG XL and HTJ2K, predict or transform pixels with hand-designed rules [63, 60, 11, 2, 51] and decode a photo in milliseconds. Learned codecs replace these rules with neural networks and make clearly smaller files [33, 4, 69, 28, 27], but they take seconds per photo, tens to hundreds of times longer (Fig. 4), and their faster designs give up most of the gain in size [28, 23]. One must still choose between size and speed.

Decoding orderStepsCoder chainA value sees
Value by value [56]1,179,6481,179,648above and left
JPEG XL groups [48]196,608196,608its block
HTJ2K blocks [51]54,096its block
Interpolation [22]about 151,179,648all sides
Patch groups [28]94–earlier groups
FMT tree36 or 72≤\leq 7,410all sides

Table 1: Sequential work of decoding a 768×\times512 photo, 1,179,648 values. Steps: runs of the predictor that must follow one another (Kamisli’s: 5 scales ×\times 3 interpolators; HTJ2K: 5 wavelet levels). Coder chain: the most values one entropy decoder decodes one after another (JPEG XL, HTJ2K: per 256×256256\times 256 group and 64×6464\times 64 code-block, decoded independently; Kamisli: one CPU coder; HPAC: one bitstream, decoding not described; FMT: our 512×\times4 on Kodak, at most T=8,192T=8{,}192 plus one per step, Sec. 3.4).

Why are learned codecs so slow? We argue that much of their time goes to waiting rather than computing (Tab. 1). An entropy decoder can recover a value only once it knows the value’s probability, and a learned codec computes it from values decoded before it. Decoding is therefore a chain with two links. First, the network waits for the values it conditions on: once per value in a pixel-by-pixel model [56], and still many times in codecs that predict groups of values [41, 8, 43, 22, 28]. Second, the arithmetic decoder reads one value after another, often on the CPU. FNLIC [68] reports 13 ms of network inference per photo, yet in our runs it took half a second per photo, two fifths of it in such a coder; LC-FDNet [43] took a second, a fifth of it in its coder on the CPU. No number of GPU cores shortens this chain (a).

In FMT, every pixel is the end of a path from a coarse root (b), as every weight is in state trees [3]: each level adds the pixels halfway between those already decoded, predicts them from their decoded neighbours and stores only a correction (the residual), so neighbouring pixels share the top of their paths, the coarser pixels they are predicted from. Each correction is in turn binarised into a short path of decisions: its size, then its bits.

This tree is what lets the decoder run in parallel. A pixel depends only on pixels of earlier steps, so the values of one step do not depend on each other: the GPU predicts them all at once, and interleaved streams of rANS [12, 14], a fast entropy coder, which we call lanes, decode their corrections in parallel, each lane carrying its state from one step to the next. Coarse-to-fine orders have long been used in image coding [44, 25, 22]; what we add is an entropy coder designed together with the order, with lanes sized by the image, not by the step as in vectorised ANS [55], so that neither link of the chain grows with the image. Since the root’s spacing is fixed in pixels, a photo of any size decodes in at most 72 steps, and no lane decodes more than a set number of values (Tab. 1): the depth is fixed, though a larger photo has larger steps.

The tree also hosts classical and learned lossless coding in one format. It fixes which values are decoded together, but not how each is predicted or how its path is paid for, so hand-designed rules and neural networks become modes of the same format: a fast mode stores the corrections of a reversible wavelet at fixed widths, with no entropy coder; a dense mode predicts each pixel by the mean of four neighbours and codes the paths with histograms learned once, with no network; and neural modes, with networks from 16 neurons in 2 layers (16×\times2) to 768 in 4 (768×\times4), give every possible correction its own probability, and the encoder tunes them to each photo. All decode bit-exactly on the GPU, and on other GPU types with our portable kernels.

Across this family, no codec we ran on the same GPU beats any FMT mode on both size and speed, on Kodak or on two sets of large photos (Figs. 4 and 3). Without a network, FMT beats NVIDIA’s HTJ2K in both size and speed. With a small network, it makes smaller files than JPEG XL and decodes them faster on one GPU than JPEG XL does on a 32-thread CPU. With a large network, it decodes a Kodak photo 9 to 61×\times faster than the learned codecs we ran from their authors’ code on an A100, at the same size or smaller (Tab. 4). At full load, the fast mode decodes more pixels per second than any other codec we ran (Tab. 6).

In summary, we make three contributions:

  1. Where the time of learned lossless decoding goes. Profiles of three released codecs, and our own networks decoded with longer coder chains or more steps, show that much of it goes to waiting, not computing (Sec. 4.4, Sec. S6.6).
  2. A decoding schedule whose sequential work does not grow with the image. The order and the entropy coder are designed together: a coarse-to-fine tree of corrections, each a short path of decisions, fixes the number of steps by its root’s spacing, and rANS lanes whose number grows with the image carry their states across steps, so prediction and entropy decoding both run in parallel on the GPU. Neither half suffices alone: with one coder, the same order still takes most of a second [22]; with fresh lanes at every step, files grow by up to 14% (about 24% in the dense mode; Secs. 3.1, 3.2, 3.4 and 3.5, Sec. S3.3).
  3. Bit-exact codecs, measured end to end. GPU decoders for every mode, portable kernels whose streams decode alike on different GPUs (also with 8-bit tensor-core layers) and CPU decoders, compared from compressed bytes to verified pixels with classical codecs on one GPU and one CPU and with learned codecs run from their authors’ code, including where they still win (Secs. 4 and 5).

References (33)