Fast Non-Uniform Quantization via Two-Level Lookup
We present a practical and reusable software technique for quantizing real-valued inputs into m non-uniform bins at high speed, specifically optimized for embedded and real-time systems. Traditional approaches rely on binary search to map each input to its quantization bin, incurring O ( log m ) time per value. Our method introduces a two-level binning strategy that uses a lightweight preprocessing step to construct a uniform reference grid, a histogram, and a prefix sum array. Each query then performs a constant-time lookup followed by a short local refinement, achieving effective O(1) average-case performance in practice. Implemented in C and evaluated on both x86 and ARM Cortex-M platforms, the technique delivers up to a 4× speedup over binary search across a variety of input distributions, including real-world µ -law encoded audio streams. The approach requires minimal memory, is easily portable, and integrates well into embedded software stacks for signal processing, audio codecs, and telemetry systems.
Authors
- Oswaldo Cadenas (ORCID: https://orcid.org/0000-0003-4152-6458)
- Graham M. Megson
Institutions
- London South Bank University (GB)
Publication Details
- Published
- 2025-09-12
- DOI
- https://doi.org/10.22541/au.175770196.65861923/v1
- Primary Topic
- Algorithms and Data Compression
- Type
- article
- Field-Weighted Citation Impact
- 0.00