https://github.com/lofcz/toydct
A toy implementation of the JPEG encoder & decoder
https://github.com/lofcz/toydct
Last synced: 8 months ago
JSON representation
A toy implementation of the JPEG encoder & decoder
- Host: GitHub
- URL: https://github.com/lofcz/toydct
- Owner: lofcz
- License: mit
- Created: 2024-06-05T14:26:37.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-05T14:55:53.000Z (over 1 year ago)
- Last Synced: 2025-02-15T18:58:25.214Z (8 months ago)
- Language: C#
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Toy DCT
A toy implementation of the JPEG encoder & decoder in .NET sans file (de)serialization - (Run-length + Huffman).The implementation sacrifices performance for simplicity intentionally and shouldn't be used for anything but admiring the beautiful math behind JPEG, MP3, and many other formats. Interestingly, many ideas in the plain old JPEG are used in ML even today - what else are VAEs but energy compaction functions? Quantization, another concept used in JPEG, is one of the pillars enabling cost-efficient LLMs deployment and inferring with models often too computationally intensive for consumer hardware.
![]()
![]()
![]()
DCT components retained in a 8x8 block: 1, 2, 8, 64.
If this sparked your interest, but the terms used above sound unfamiliar, I recommend the following videos:
- https://www.youtube.com/watch?v=0me3guauqOU
- https://www.youtube.com/watch?v=Kv1Hiv3ox8I