A Power and Area Efficient Lepton Hardware Encoder with Hash-based Memory Optimization

Xiao Yan, Zhixiong Di, Bowen Huang, Minjiang Li, Wenqiang Wang, Xiaoyang Zeng, Yibo FanarXiv 2021

Introduction

Despite the emergence of newer image formats, JPEG remains the dominant standard for web content and cloud storage. To optimize storage costs without losing image quality, Dropbox developed Lepton, a lossless "re-compression" algorithm that achieves an additional 23% reduction in file size compared to standard JPEGs. However, Lepton's computational complexity is significant. It utilizes massive probability models with over 720,000 "bins" to predict data patterns, a task traditionally handled by high-power CPUs in data centers.

The Lepton workflow within a data center environment, showing the transformation from JPEG to Lepton files and back.

The primary barrier to deploying Lepton on dedicated hardware (ASIC or FPGA) has been the sheer size of these probability models. Storing nearly a million bins in on-chip memory is prohibitively expensive in terms of silicon area. This research presents the first hardware implementation of the Lepton encoder, overcoming these memory constraints through a novel hash-based optimization strategy.

Hash-based Memory Optimization

The core innovation lies in a hardware-friendly memory management system that exploits the statistical sparsity of Lepton’s probability models. The researchers observed that while the algorithm defines hundreds of thousands of bins, only a small fraction are frequently accessed during typical encoding tasks.

1. Access Probability-based Hashing

The team developed a hash function based on the Cumulative Distribution Function (CDF) of bin access probabilities. By "weighting" memory allocation, the system provides dedicated physical space for high-frequency bins while allowing rare bins to share memory locations. This approach effectively shrinks the required memory footprint without sacrificing performance for the vast majority of data.

2. N-way Set-Associative Units

To manage the hashed memory efficiently, the design employs N-way set-associative units, a structure similar to CPU caches. This allows multiple data indexes to map to the same physical memory block, significantly reducing the total bit count required for the probability models.

Comparison of 4-way and 2-way set-associative memory units used to optimize the storage of probability bins.

3. Hardware-Software Co-design

To maintain a small hardware footprint, the system is designed to handle the "common case" perfectly. In the rare event that an image's data distribution causes a memory "overflow" (too many unique rare bins accessed simultaneously), the hardware triggers an interrupt. A software-based encoder then takes over for that specific file, ensuring 100% reliability while keeping the hardware simple and efficient.

Performance and Results

The proposed encoder was evaluated using the DIV2K and Kaggle4K datasets, which provided a diverse range of high-resolution imagery for testing. Synthesized using a 60nm process, the hardware demonstrated transformative improvements over traditional software solutions running on Intel Xeon CPUs:

  • Area Efficiency: The memory optimization strategy reduced the silicon area required for probability models by 70.97%.
  • Throughput: The hardware achieves a throughput of 317.69 Full HD images per second, representing a 55.25x increase over the software baseline.
  • Energy Savings: Most impressively, the dedicated hardware is 4,899 times more energy-efficient than a general-purpose CPU.

Conclusion

This work proves that complex, memory-intensive lossless compression algorithms like Lepton can be successfully ported to dedicated hardware. By prioritizing frequently accessed data through statistical hashing and set-associative memory, the researchers achieved massive gains in efficiency and throughput. Future iterations may explore dynamic hash boundaries to further reduce overflow rates across even more diverse datasets, paving the way for widespread hardware acceleration of cloud storage optimization.

Summary updated

BibTeX
@misc{yan2021power,
  author = {Xiao Yan and Zhixiong Di and Bowen Huang and Minjiang Li and Wenqiang Wang and Xiaoyang Zeng and Yibo Fan},
  title = {{A Power and Area Efficient Lepton Hardware Encoder with Hash-based Memory Optimization}},
  year = {2021},
  eprint = {2105.01415},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.01415},
}
Figure