UCR CS122B, Winter 2001, T. Givargis and F. Vahid

This will be a two week lab. A lecture on the Trimedia chip and how to proceed will be given during the first hour of the first week. Do not miss it!

Lab prepared by J. Villarreal and T. Givargis.

Setup Documentation

Click Here

Problem

The NTSC (National Television Standards Committee) is a standard protocol for TV signals in the US. An NTSC TV image has 525 horizontal lines per frame, which are scanned from left to right, and from top to bottom. To reduce the amount of data that must be sent, each frame is sent and displayed in two halves, the odd lines, followed by the even lines. Each halve-frame scans in approximately 1/60 of a second, so a complete frame is scanned every 1/30 second. Such interlacing occurs so quickly that humans can't see it happening.

However, PC monitors do not perform such interlacing, instead displaying progressive pictures where each frame contains all the lines, so one must perform scan rate conversion if one wants to display a standard video signal onto a PC monitor. In order to display an NTSC picture on the PC monitor, first the picture must be de-interlaced.

The algorithm that you will be using to de-interlace the picture so it can be displayed on the monitor is the median filter algorithm. In this algorithm, pixels in the missing lines are filled in by taking the median of two pixels from the neighboring lines in the current field and one pixel from the same vertical position from the previous frame.

A simple median filter algorithm is given to you to begin with in the file median.c below. The simple algorithm generates the correct output, but is too slow, and so doesn't display the picture properly. This is an example of a real-time algorithm. You need to be optimize the algorithm to display fast enough. Your job will be to optimize this function for the TriMedia (www.trimedia.com) processor so that an interlaced picture from a DVD player can be displayed on the PC monitor correctly. You'll be using the TriMedia development tools, and testing your algorithms on a real TriMedia processor. Details of the TriMedia environment will be given in lab.

The algorithm is an example of media processing, a class of applications becoming extremely common with the growth of audio and video business and consumer electronics applications. Special microprocessors, known as media processors , have evolved to meet the unique needs of media processing, which different from general-purpose PC processing needs. Among other things, media processors contain special hardware to perform common media processing operations much more quickly. These sped-up operations can be accessed by C-level library calls. Trimedia, a spinoff of Philips, licenses one of the most popular such media processors.

Procedure

  1. Think
  2. Modify median.c to run faster.
  3. Compile and test
  4. Go back to step 1

Function

The function that you will need to modify is as follows:

      void median_filter(pixel_t* input, pixel* prev_input, 
                         pixel_t* output, const int pixelsPerLine,
			 const int linesPerField, const int field)  
    

The arguments are as follows:

Things to consider

Custom Operations

All of custom operations use "unsigned int" as arguments. The following are all of the operations you might find useful:

File

median.c

median.h

ooti.tar.gz