Skip to content

v1.1.2.0

Choose a tag to compare

@kpchoi kpchoi released this 29 Sep 08:14
1a06cad

v1.1.2.0: faster decoding and hardening

A maintenance release of API set 1. No public function was added, removed or changed, and the ABI is unchanged.

Performance

VLC coefficient decoding was reworked:

  • The exp-Golomb prefix is read with a count-leading-zeros instead of bit by bit.
  • The bit buffer is topped up with whole bytes before each symbol, so the prefix and suffix of a normal code are read in one step. The buffer end is never read past.
  • The separate k = 0 readers were removed; all run and level codes go through one reader.

Decoding is about 20–30% faster at high bitrates and about 8% faster at low bitrates, measured on x86 with both single- and multi-threaded decoding. The decoded output is bit-exact with v1.1.1.0.

Correctness and robustness

  • Dequantization no longer left-shifts negative values or overflows int at high QP; the SIMD paths now saturate correctly
  • The exp-Golomb prefix sum no longer wraps u32 on malformed input, so builds with -fsanitize=unsigned-integer-overflow (such as Android) no longer abort
  • The exp-Golomb prefix length is bounded to keep decoded values within int
  • Metadata payload_type and payload_size are checked against u32 wraparound
  • OAPV_MAX_NUM_META_PAYLOADS is enforced per access unit in oapvm_set()
  • Encoder error paths release the input and reconstruction image references
  • Reconstructed AC coefficients are checked against the 16-bit range
  • The encoder enforces the minimum tile width and height of the constrained profiles
  • Decoder API hardening: output stride and plane count validation, NULL argument checks

Code cleanup

  • Include guards renamed to non-reserved OPENAPV_<FILE>_H_ names
  • static inline helpers use force_inline
  • Quantization and dequantization matrices renamed to q_mat and dq_mat
  • Comments explain why the VLC prefix loops have no per-bit range check
  • Unused bitstream reader code removed

Tools and documentation

  • ImHex pattern: tile, access unit info, gain map and ICC parsing, bit-exact frame header size
  • README: related projects section

Upgrading from v1.1.1.0

Applications only need to relink. Two things to note:

  • The include guard of oapv.h changed from __OAPV_H__... to OPENAPV_OAPV_H_. Code that tested the old guard macro must be updated.
  • The encoder now rejects tile_w / tile_h values that are not a multiple of 16 when set directly in oapve_param_t. Some of these were silently accepted before. The string parameter parser already rejected them.