JPEG Encoder :: Overview


Name: mkjpeg
Created: Mar 7, 2009
Updated: Sep 25, 2014
SVN Updated: Oct 3, 2012
SVN: Browse
Latest version: download
Statistics: View

Other project properties

Category: Video controller
Language: VHDL
Development status: Stable
Additional info: Design done, FPGA proven, Specification done
WishBone Compliant: No
License: LGPL


21 AUG 2011
New revision 70. contains new BUF_FIFO contributed Ahmet Tekyildiz which needs circa 9.5 line buffer but achieves performance very close to old design with ~16 lines (8 extra lines). So it heavily reduces on-chip RAM utilization without performance sacrifice.
Also this version contains nearest integer rounding in DCT-2D instead of truncation when bit growth/precision is reduced. Truncation caused 8x8 block artifacts easily visible in very high quality modes (>95% quantization tables). Rounding alleviates this problem.


Warning! WebSVN does not work correctly for project, use link below to download latest rev: • DOWNLOAD LATEST REVISION 61 • EV_JPEG_ENC core is intended to encode raw bitmap images into JPEG compliant coded bit stream. JPEG baseline encoding method is used. • LICENSE: GNU LGPL v3.0


• JPEG baseline encoding JPEG ITU-T T.81 | ISO/IEC 10918-1
• Standard JFIF header v 1.01 automatic generation
• Color images only (3 components, RGB 24 or 16 bit, YUV input)
• Two programmable Quantization tables
• Hardcoded Huffman tables (luminance and chrominance)
• 2.3 to 2.7 clock cycles per one input 24 bit pixel @ 50% Quality
• OPB programming and data Host interface
• 4:2:2 subsampling
• Source code target independent, synthesizable RTL VHDL code
• Detailed documentation


Example throughput

Measured from JPEG encoding start till encoding done:

• Input image 640x480 24 bit RGB color. New sample loaded every cycle until FIFO full.
• Quantization tables at 50% quality setting
• 7.3 ms processing time @ 100 MHz clock
• 1000/7.3=136 frames per second @ 100 MHz
• Input file size = 921 kB. Output file size = 44 kB (depends on image)

Compression stats (from JPEGSnoop software):
• Compression Ratio: 21.31:1
• Bits per pixel: 1.13:1

100 MHz is achievable under Stratix II S90 for example. Optimization set to performance.


• replace OPB interface used for programming with PLB or WishBone



Low Level Design

Here is a quite detailed low level design document for the Core: Low Level Design Document


EV_JPEG_ENC is software released under Lesser GPL license and can be used freely for commercial and noncommercial purposes under NO WARRANTY.


Device Utilization Summary for Stratix II S90 (mkjpeg revision 57)

6135 ALUTs
3095 registers
3858 ALMs
4 DSP9
55 M4K

Performance: above 100 MHz

Build configured for maximum image width 640 pixels and highest performance and memory usage (settable in JPEG_PKG.VHD)

© copyright 1999-2015, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.