Huffman Module

Submodules

ac_cr_rom module

MyHDL implementation of AC Chrominance ROM

jpegenc.subblocks.huffman.ac_cr_rom.ac_cr_rom

build ac ROM for chrominance

ac_rom module

MyHDL implementaton of Luminance AC ROM

jpegenc.subblocks.huffman.ac_rom.ac_rom

Build AC ROM here

dc_cr_rom module

MyHDL implementation of Chrominance DC ROM

jpegenc.subblocks.huffman.dc_cr_rom.dc_cr_rom

Build Chrominance ROM for Huffman Tables

dc_rom module

MyHDL implementation of DC ROM used for Huffman Encoder

jpegenc.subblocks.huffman.dc_rom.dc_rom

build dc rom here

doublebuffer module

The above module is a double buffer to store huffman encoded data

jpegenc.subblocks.huffman.doublebuffer.doublefifo

I/O ports:

dfifo_bus : A FIFOBus connection interace buffer_sel : select a buffer

Constants :

depth : depth of the fifo used width_data : width of the data to be stored in FIFO

huffman module

MyHDL implementation of Huffman Encoder Module

class jpegenc.subblocks.huffman.huffman.HuffBufferDataBus(width_packed_byte)

Bases: object

Output Interface of the Huffman module read_req : access to read the output data stored in FIFO fifo_empty : output fifo is empty buffer_sel : select a buffer from Double Fifo huf_packed_byte : Huffman Encoded Output

class jpegenc.subblocks.huffman.huffman.HuffmanCntrl

Bases: object

These are the control signals for Huffman block start : start sending block ready : request for next block color_component : select the component to be processed sof : start of frame

class jpegenc.subblocks.huffman.huffman.HuffmanDataStream(width_runlength, width_size, width_amplitude, width_addr)

Bases: object

Input interface bus to the Huffman module runlength : runlength of the data byte vli_size : number of bits required to store vli vli : amplitude of the data data_valid : input data is valid

class jpegenc.subblocks.huffman.huffman.ImgSize(width=8, height=8)

Bases: object

Indicates dimensions of the Image width : width of the image height : height of the image

class jpegenc.subblocks.huffman.huffman.VLControl

Bases: object

Contains the four states in which the FSM Operates

jpegenc.subblocks.huffman.huffman.huffman

HDL Implementation of Huffman Module. This module takes Variable Length Encoded Inputs and serialise them to VLC using Huffman Rom Tables

Args: huffmancntrl : control signals interface huffmandatastream : Input Interface img_size : Image data class rle_fifo_empty : asserts when Input buffer is empty

Returns: bufferdatabus : Output FIFO Interface

Constants: block_size : size of each block vlcontrol : contains the states used to run huff_fsm image_size.width : width of image image_size.heigth : height of image bits_block_count : width to store number of blocks in image width_word : maximum width of the word register

tablebuilder module

Used to build Huffman Tables

jpegenc.subblocks.huffman.tablebuilder.build_huffman_rom_tables(csvfile)

build huffman tables