HEIF Codec Technology: HEVC and AV1 Compression
The reason HEIF achieves nearly double the compression efficiency of JPEG lies in its use of video coding technology to compress still images. This article explores the two major coding technologies behind HEIF: HEVC (H.265) and AV1.
Why Use Video Codecs for Images?
Video coding technology is more advanced than traditional image coding because video compression must handle massive amounts of sequential frames, driving researchers to develop more efficient algorithms. HEIF's ingenuity lies in applying intra-frame compression techniques — originally designed for video — to compress single still images.
HEVC (H.265) Compression
HEVC (High Efficiency Video Coding), also known as H.265, is a video coding standard jointly developed by ITU-T and ISO/IEC. It is the successor to H.264/AVC.
Key Technical Improvements
- Larger Coding Tree Units (CTU) — HEVC uses CTUs up to 64x64 pixels, compared to H.264's 16x16 macroblocks. Larger blocks handle large smooth areas more efficiently.
- Quadtree partitioning — CTUs can be recursively split from 64x64 down to 4x4, allowing the encoder to precisely adapt to different image content.
- Improved intra prediction — HEVC offers 35 intra prediction directions (H.264 has only 9), enabling more accurate pixel value prediction and reducing residual data.
- Improved quantization and transforms — More flexible transform sizes and improved quantization matrices.
| Technology | H.264/AVC | HEVC/H.265 |
|---|---|---|
| Maximum block size | 16x16 | 64x64 |
| Intra prediction directions | 9 | 35 |
| Transform sizes | 4x4, 8x8 | 4x4, 8x8, 16x16, 32x32 |
| Efficiency vs H.264 | Baseline | ~50% improvement |
Key Takeaway: HEVC improves compression efficiency by approximately 50% compared to H.264. This is why HEIC (encoded with HEVC) produces files roughly half the size of JPEG.
AV1: The Royalty-Free Alternative
While HEVC offers excellent compression, it has a significant issue: patent licensing fees. HEVC involves multiple patent pools with complex and expensive licensing requirements.
The Alliance for Open Media (AOMedia) developed AV1 as a completely royalty-free video coding standard. AOMedia members include Google, Mozilla, Netflix, Amazon, Apple, Microsoft, and other technology leaders.
AV1 Technical Features
- Superblocks — Up to 128x128 pixels, larger than HEVC's 64x64
- More prediction modes — Over 50 intra prediction directions
- CDEF filter — Constrained Directional Enhancement Filter designed to reduce compression artifacts
- Loop Restoration — Adaptive loop restoration filter for enhanced decoded quality
AVIF: HEIF with AV1 Encoding
When a HEIF container uses AV1 as its codec, the resulting file is AVIF (AV1 Image File Format). AVIF is viewed as the royalty-free alternative to HEIC and an advanced replacement for WebP.
| Format | Container | Codec | License |
|---|---|---|---|
| HEIC | HEIF | HEVC (H.265) | Paid license required |
| AVIF | HEIF | AV1 | Royalty-free |
| JPEG | JFIF/EXIF | DCT | Royalty-free |
| WebP | RIFF | VP8/VP8L | Royalty-free |
Looking Ahead
The future of image formats is converging with video coding technology. As AVIF browser support grows and JPEG XL (another emerging format) develops, the competition among image formats will continue to evolve. Regardless of how formats change, understanding the underlying compression principles will help you make better format choices.
Convert HEIC to JPG Now →Conclusion
HEIF's high compression efficiency comes from the powerful video coding technology behind it. Whether HEVC or AV1, these codecs represent decades of image compression research. Understanding these technical principles enables you to better appreciate the strengths and trade-offs of different image formats.
References
- ITU-T. "H.265: High efficiency video coding." International Telecommunication Union, 2021. https://www.itu.int/rec/T-REC-H.265
- Alliance for Open Media. "AV1 Bitstream & Decoding Process Specification." AOMedia, 2024. https://aomedia.org/av1-features/get-started/
- Sullivan, G. J., Ohm, J.-R., Han, W.-J., & Wiegand, T. "Overview of the High Efficiency Video Coding (HEVC) Standard." IEEE Transactions on Circuits and Systems for Video Technology, vol. 22, no. 12, 2012. https://ieeexplore.ieee.org/document/6316136
- Chen, Y., et al. "An Overview of Core Coding Tools in the AV1 Video Codec." IEEE PCS, 2018. https://ieeexplore.ieee.org/document/8456249