Team 3FM  - JPEG Decoder

CS 179J: Senior Design Project in Architecture / Embedded Systems

Team Members: RJ Jareno, Miguel Carrillo, Jerome Pasion, Jectofer Dumpit


Group Proposal


Project Description (RJ Jareno)

This quarter, we will attempt to implement Joint Photographic Expert Group (JPEG) file Decoder.  This device will have the ability to take any JPEG file as input (via RS-232) and output the file to any VGA monitor.  For our project specifically, a PocketPC (PPC) running Windows Mobile 2003 will provide the JPEG files.  The user will have the ability to view a slide show or single JPEGs based on his or her input to the PPC program.

Project Options  (RJ Jareno)

Different options for input to the decoder were considered.

Using a Desktop PC to upload JPEG files onto the decoder would be a simple solution.   The user would have the ability to upload any JPEG file desired to the device.  The problem with this solution is that it creates a memory constraint for the 8051.  Picture files can become quite large, so there would be a limit as to how many pictures the device could hold.  Assuming that our device is being designed for a person “on the go,”  it would be a hassle to have to go back to one’s desktop PC to upload a different set of files.

Because of this memory constraint, we considered using some kind of memory card to hold the picture files.  This way, the device would only need to handle one JPEG at a time.  Pretty much all digital cameras use some kind of memory card, be it SmartMedia, Compact Flash, Secure Digital, etc.  So as long as a person’s camera uses the type of memory card that our device supports, he/she may use the decoder.  Unfortunately, this design is limited to consumers with digital cameras.

To provide more flexibility we chose to design the device such that anyone with a PPC running Windows Mobile 2003 and our upload software could “feed” any JPEG file (in a specific folder) to the JPEG decoder.  The upload software will allow the user to control the output of the decoder.  If the user would like create a slideshow that consists only of a subset of the JPEGs on the PPC, he/she would simply move unwanted JPEGs to a different folder.  With this design, our device would have the flexibility that a desktop PC implementation offers (ability to upload any JPEG located on the PC) as well as the mobility that a memory card implemenation offers (no need for numerous uploads).

 

Different options for our device’s output were also considered:

Most of our team has had experience with the E5 and the XS40 from previous courses, so we definitely were biased to these devices.  We considered using an ARM/FPGA combination development board; although it provides superfluous performance compared to the E5 and XS40, its cost is out of the question ($1,000+).  So we analyzed the pros and cons of the E5 and XS40 as well as what is already available as open source for the two boards.  We found many examples of projects on the web that utilized the XS40 and took advantage of its built in VGA-out port, so we decided on using the XS40.

Implementation Plan (RJ Jareno)

      Since some of us have had PPC programming experience, the PPC implementation was chosen.  Also, we recognize that a group size of 4 engineers would require a more advanced project so hopefully the PPC addition fulfills that expectation.  The project will be divided up as follows:

JPEG Decoder (Jectofer Dumpit, Jerome Pasion)

            JPEG decoding consists of many steps.  Our team is hoping to use a DCT-based JPEG decoding using 8051 microcontroller.  First step is to take a compressed JPEG image and use an Entropy decoder to decode the Huffman Encoding since most JPEG uses Huffman encoding.  The next step is to dequantized the decoded file and then finally take the inverse Discrete Cosine Transform (IDCT) of the file and converts the data to normal space domain.

            After performing the JPEG decoding, we are going to convert JPEG to Bitmap.  For JPEG to Bitmap conversion, after running inverse Discrete Cosine Transform, we are going to use a YCbCr-RGB Converter to reconstruct the image from JPEG to Bitmap.  We have not thoroughly researched the YCbCr-RGB converter yet because we are hoping to focus working more on JPEG decoder.  We will work on it later this quarter after our first prototype and hopefully have it ready for our second prototype for testing.

            Our goal is to be able to handle any kind of jpeg (.jpg) picture and decode it into bitmap format.  To get started on our jpeg project, my partner and I first want to decode a simple drawing in jpeg format, such as a circle, using C.  After the decoded image is saved, we can compare the decoded image with the structure of a bitmap file using a program called Dump Hex.  If our decoded image matches to the bitmap structure, we can then continue on decoding more complex graphics and try to implement a picture from the PDA.  In order for this process to work, we first have to connect the PDA and the micro-controller using a RS 232 connection and send the data serially.  That means we have to send the data through a UART.  Once the jpeg format is on the micro-controller, we can then convert jpeg to bitmap format.  After the conversion, we can then store the bitmap file to RAM, which then starts our testing phase of the decoded file onto the FPGA.

VGA Controller  (Miguel Carrillo)

In order to be able to output to the VGA monitor we must first implement the VGA controller. A VGA monitor in composed of three signals red, green, and blue. These signals are projected onto the screen by an electron gun. Anolog levels between 0-0.7V control the Brightness of the signal. There is also a specific timing sequence that is followed with each pixel projected onto the screen.

            Our task is to Implement the VGA controller to output bitmap images onto the VGA monitor. We have been doing some research on this topic and have found some useful code that we will be modifying to meet our specifications. The VGA controller will be implemented in VHDL and will run on the Xilinx FPGA contained on the XS40 board. In this part of the project a Bitmap file will be taken apart and organized in a fashion suitable for the VGA controller to process. The algorithm will extract the pixels placement and its color and Finally displaying out to the VGA monitor.

 

Software and Parts List (All provided by UCR):

  1. Active-HDL software
  2. XS40 board
  3. Xilinx Foundation Project Manager

4.   Compiler for on-board uC

 

Schedule

Week

JPEG Decoder

VGA Controller

PocketPC

3-5

 

Finish most of the JPEG decoding and have some test cases to see if the decoder works (i.e. comparing data between the actual JPEG image and the decoded JPEG image).

 

 

The first prototype will consist of a working algorithm

 

 Communication/upload program should be complete by prototype 1

5-7

 

Have the decoder be able to handle small pictures.  Start interfacing small pictures with the XS40 board.

 

 

The second prototype will consist of a working algorithm downloaded onto the Xilinx FPGA located on the XS40 board. Small graphics will be displayed to a VGA monitor.

 

 

If the above is not complete, finish here for sure.

7-9

 

Handle any kind of pictures with everything working properly with XS40 and VGA monitor

 

The third prototype will consist of the VGA controller displaying full bitmap images onto the monitor.

 

Completed last week.