09.11.2012 Views

Video and Image Processing Up Conversion Example Design

Video and Image Processing Up Conversion Example Design

Video and Image Processing Up Conversion Example Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

October 2007, ver 4.0<br />

Introduction<br />

<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong><br />

<strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong><br />

<strong>Design</strong><br />

Application Note 427<br />

The Altera ® video <strong>and</strong> image processing up conversion example design<br />

demonstrates up conversion from a st<strong>and</strong>ard definition video stream in<br />

national television system committee (NTSC) format to a high definition<br />

output resolution (1024×768).<br />

The example design provides a framework for rapid development of<br />

video <strong>and</strong> image processing designs using the library of parameterizable<br />

MegaCore ® functions available in the Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong><br />

Suite. These functions can be used to perform the following common<br />

video functions:<br />

■ Color Space <strong>Conversion</strong><br />

■ Gamma Correction<br />

■ Chroma Resampling<br />

■ Deinterlacing<br />

■ Alpha Blended Mixing<br />

■ 2D FIR Filtering<br />

■ 2D Median Filtering<br />

■ Scaling<br />

■ Line Buffer Compilation<br />

1 For more information about these MegaCore functions, refer to<br />

the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite User Guide.<br />

In the example design, video source is input through an analog composite<br />

port on an Altera <strong>Video</strong> Input Daughtercard. The daughtercard generates<br />

a digital output in BT656 format, <strong>and</strong> connects to an Altera Cyclone ® II<br />

DSP development board via a daughtercard connector.<br />

The processed video stream is output via the VGA connector which is<br />

available on the Altera Cyclone II DSP development board. In the FPGA,<br />

a number of common video functions are performed on the input stream<br />

including chroma resampling, deinterlacing, color space conversion <strong>and</strong><br />

scaling.<br />

The design shows by example, how to use DSP Builder for modeling <strong>and</strong><br />

simulating the data path for an imaging application. The combined<br />

MATLAB <strong>and</strong> Simulink environment provide an easy interface to import<br />

<strong>and</strong> export data to <strong>and</strong> from the DSP Builder design to read <strong>and</strong> write<br />

video files, while verifying the functionality of the Cyclone II design.<br />

Altera Corporation 1<br />

AN-427-4.0 Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

In addition, an easy path to system integration of the video processing<br />

data path with NTSC video input, VGA output <strong>and</strong> an external DDR2<br />

memory controller is demonstrated with SOPC Builder.<br />

The video up conversion design is implemented using a combination of<br />

Altera MegaCore functions from the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite.<br />

The video functions use common Avalon ® Streaming (Avalon-ST) data<br />

interfaces <strong>and</strong> Avalon Memory-Mapped (Avalon-MM) control interfaces<br />

to facilitate connection of a chain of video functions <strong>and</strong> video system<br />

modeling.<br />

f Refer to the Interfaces chapter in the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite User<br />

Guide for a full description of how these interfaces are implemented.<br />

f For more information about the Avalon-MM <strong>and</strong> Avalon-ST interfaces,<br />

refer to the Avalon Memory-Mapped Interface Specification <strong>and</strong> the Avalon<br />

Streaming Interface Specification.<br />

DSP Builder is a digital signal processing (DSP) development tool that<br />

interfaces The MathWorks industry-leading system-level DSP tool<br />

Simulink ® with the Altera Quartus ® II development software.<br />

DSP Builder provides a seamless design flow in which you can perform<br />

algorithmic design <strong>and</strong> system integration using MATLAB ® <strong>and</strong><br />

Simulink <strong>and</strong> then port the design to hardware description language<br />

(HDL) files for use in the Quartus II software. The automatically<br />

generated HDL files are at the register transfer level (RTL). They are<br />

optimized for use in the Quartus II software for rapid prototyping.<br />

f For more information on DSP Builder, refer to the DSP Builder User<br />

Guide.<br />

SOPC Builder is a system development tool, allowing the user to create<br />

hardware <strong>and</strong> software system modules with a customized set of system<br />

peripherals. SOPC Builder automatically creates the bus arbitration logic<br />

connecting the individual components together to create an overall<br />

system.<br />

f For more information on SOPC Builder, refer to the SOPC Builder User<br />

Guide.<br />

2 Altera Corporation<br />

Preliminary


Installing the<br />

<strong>Example</strong> <strong>Design</strong><br />

Installing the <strong>Example</strong> <strong>Design</strong><br />

The example design files are included on the <strong>Video</strong> Development Kit,<br />

Cyclone II Edition CD-ROM or can be downloaded as a zip file from the<br />

Altera website.<br />

Figure 1 shows the directory structure for the example design files when<br />

they have been extracted from the zip file.<br />

Figure 1. <strong>Example</strong> <strong>Design</strong> Directory Structure<br />

<strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>_<br />

Contains top level block design file (<strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.bdf), Quartus II settings file<br />

(<strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.qsf), Quartus II project file (<strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.qpf),<br />

DSP Builder model file (example_design_data_path.mdl), SOPC Builder project file<br />

(video_system_SOPC.sopc), <strong>and</strong> PLL files for the DDR2 Controller (ddr_pll_cycloneii*.*).<br />

altera_avalon_i2c<br />

Contains SOPC Builder components (_hw.tcl <strong>and</strong> VHDL files) for the<br />

I 2 C controller that communicates with the digital composite input card.<br />

example_design_controller<br />

Contains SOPC Builder components (_hw.tcl <strong>and</strong> VHDL files) for the<br />

Avalon master used by the I 2 C controller <strong>and</strong> NTSC composite input module.<br />

frame_buffer_beta<br />

Contains a beta version of the Frame Buffer MegaCore function. The frame buffer block<br />

can perform a double or triple buffering function <strong>and</strong> is inserted between the other <strong>Video</strong><br />

<strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite MegaCore functions <strong>and</strong> the VGA output.<br />

ntsc_composite_input<br />

Contains SOPC Builder components (_hw.tcl <strong>and</strong> VHDL files) which<br />

decode the video signal from the digital composite input card.<br />

vga_output<br />

Contains SOPC Builder components (_hw.tcl <strong>and</strong> VHDL files) for the VGA<br />

output driver.<br />

docs<br />

Contains this document (AN-427.pdf).<br />

Notes to Figure 1:<br />

(1) The <strong>Video</strong>_Ip_<strong>Example</strong>_<strong>Design</strong>_ directory also includes other files that<br />

are included for convenience but can be regenerated using the tools described in<br />

this application note.<br />

(2) If you want to use the Frame Buffer MegaCore function in other designs, you can<br />

copy the frame_buffer_beta directory to your Altera IP v7.2 installation directory<br />

(C:\altera\72\ip by default). The Frame Buffer MegaCore function will then be<br />

accessible in the Quartus II software using the MegaWizard Plug-In Manager or<br />

from the System Contents tab in SOPC Builder.<br />

The top level directory <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>_ contains a<br />

Quartus II project file (<strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.qpf), DSP Builder<br />

model file (example_design_data_path.mdl), <strong>and</strong> SOPC Builder project<br />

file (video_system_sopc.sopc). These files can be opened to explore the<br />

design as described in “Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong>” on<br />

page 16.<br />

Altera Corporation 3<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Possible <strong>Video</strong><br />

System<br />

Configurations<br />

Many new <strong>and</strong> exciting innovations, such as high definition television<br />

(HDTV) <strong>and</strong> digital cinema, revolve around video <strong>and</strong> image processing<br />

<strong>and</strong> this technology's rapid evolution. Leaps forward in image capture<br />

<strong>and</strong> display resolutions, advanced compression techniques, <strong>and</strong> video<br />

intelligence are the driving forces behind the technological innovation.<br />

The move from st<strong>and</strong>ard definition (SD) to high definition (HD)<br />

represents a 6× increase in data that needs to be processed. <strong>Video</strong><br />

surveillance is also moving from common intermediate format (CIF)<br />

(352×288) to D1 format (704×576) as a st<strong>and</strong>ard requirement, with some<br />

industrial cameras even moving to HD at 1280×720. Military surveillance,<br />

medical imaging, <strong>and</strong> machine vision applications are also moving to<br />

very high resolution images.<br />

With exp<strong>and</strong>ing resolutions there is a need for high performance while<br />

keeping architectures flexible to allow for quick upgradeability.<br />

All of the processing functions within the Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong><br />

<strong>Processing</strong> Suite are configurable to allow the user to satisfy common<br />

performance <strong>and</strong> cost requirements over a wide range of SD <strong>and</strong> HD<br />

resolutions. In addition, the processing functions have common data <strong>and</strong><br />

control interfaces, providing a flexible <strong>and</strong> extendible framework for<br />

developing complex video pre- <strong>and</strong> post-processing data paths.<br />

This section describes a number of video systems that could be<br />

constructed using the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite MegaCore<br />

functions.<br />

Single <strong>Video</strong> Channel Input<br />

The video up conversion example design is a good starting point for<br />

developing single video stream input applications.<br />

The example design demonstrates how to construct a video data path that<br />

performs deinterlacing, chroma resampling, color space conversion <strong>and</strong><br />

scaling.<br />

The Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite MegaCore functions all<br />

have common data <strong>and</strong> control interfaces. These common interfaces<br />

make it easy to extend the data path in the example design to perform<br />

additional functions such as filtering, gamma correction or picture in<br />

picture mixing with a static image from memory.<br />

4 Altera Corporation<br />

Preliminary


Figure 2. Single <strong>Video</strong> Channel Input System<br />

Composite<br />

<strong>Video</strong> Input<br />

(NTSC)<br />

Deinterlacing<br />

Nios II<br />

Processor<br />

Static<br />

<strong>Image</strong><br />

NTSC<br />

Interface<br />

Possible <strong>Video</strong> System Configurations<br />

Figure 2 shows a block diagram of a single video channel input system.<br />

Chroma<br />

Resampling<br />

Color Space<br />

<strong>Conversion</strong><br />

(YCbCr->RGB)<br />

Picture-in-<br />

Picture<br />

Mixing<br />

Triple<br />

Buffer<br />

Gamma<br />

Correction<br />

External Memory<br />

The system uses a Nios ® II processor for control processes such as writing<br />

gamma values to the gamma corrector look up table <strong>and</strong> writing the<br />

relative location of a static image in on-chip memory to the picture-inpicture<br />

mixing function.<br />

The st<strong>and</strong>ardization on Avalon-MM control interface ports makes Nios II<br />

a convenient choice for run-time control.<br />

Multiple <strong>Video</strong> Channel Input<br />

Avalon-ST data interface<br />

Avalon-MM control interface<br />

VGA<br />

Controller<br />

Scaling<br />

<strong>Video</strong><br />

Output<br />

(VGA)<br />

2D 5x5 FIR<br />

Filter<br />

(Sharpening)<br />

<strong>Video</strong> systems frequently contain multiple video streams, which are<br />

processing in parallel <strong>and</strong> synchronized. The video up conversion<br />

example design is a good starting point for developing multiple video<br />

stream input applications.<br />

You could extend the example design to process two video stream inputs<br />

via the dual composite <strong>Video</strong> Input Daughtercard. Like the “Single <strong>Video</strong><br />

Channel Input”, the Avalon-MM control interface on the picture-in-<br />

picture mixer makes it easy to control the run time parameterization<br />

using a Nios II processor. Control parameters include foreground image<br />

location relative to the background image.<br />

Altera Corporation 5<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Figure 3. Multiple <strong>Video</strong> Channel Input System<br />

Composite<br />

<strong>Video</strong> Input<br />

(Interlaced)<br />

NTSC<br />

Interface<br />

Composite<br />

<strong>Video</strong> Input<br />

(Interlaced)<br />

NTSC<br />

Interface<br />

Deinterlacing<br />

Figure 3 shows a block diagram of a two video channel input system.<br />

Nios II<br />

Processor<br />

Chroma<br />

Resampling<br />

Avalon-ST data interface<br />

Avalon-MM control interface<br />

Color Space<br />

<strong>Conversion</strong><br />

(YCbCr->RGB)<br />

Picture-in-<br />

Picture<br />

Mixing<br />

VGA<br />

Controller<br />

Note that the two triple buffer blocks perform frame synchronization for<br />

the two video streams.<br />

Other <strong>Video</strong> Interface St<strong>and</strong>ards<br />

Gamma<br />

Correction<br />

External<br />

Memory<br />

Deinterlacing Chroma Color Space Gamma<br />

Resampling <strong>Conversion</strong><br />

(YCbCr->RGB)<br />

Correction<br />

<strong>Video</strong><br />

Output<br />

(VGA)<br />

Scaling<br />

Scaling<br />

2D 5x5 FIR<br />

Filter<br />

(Sharpening)<br />

Triple<br />

Buffer<br />

Triple<br />

Buffer<br />

2D 5x5 FIR<br />

Filter<br />

(Sharpening)<br />

The up conversion example design provides a framework to develop<br />

video systems with NTSC video input <strong>and</strong> VGA video output. This<br />

requires appropriate hardware ports on the DSP development board,<br />

analog to digital conversion <strong>and</strong> FPGA hardware interface components.<br />

However, a variety of different hardware interface st<strong>and</strong>ards <strong>and</strong><br />

protocols are seen in applications throughout the broadcast, consumer,<br />

automotive, surveillance, medical <strong>and</strong> document imaging markets.<br />

6 Altera Corporation<br />

Preliminary


Figure 4. System with Different <strong>Video</strong> Interface St<strong>and</strong>ards<br />

SDI <strong>Video</strong><br />

Source<br />

SDI<br />

Deinterlacing Chroma<br />

Resampling<br />

Possible <strong>Video</strong> System Configurations<br />

These interfaces include phase alternation line (PAL), digital video<br />

interface (DVI), high definition multimedia interface (HDMI), component<br />

or YCbCr (with separate luminance <strong>and</strong> chrominance signals), S-<strong>Video</strong> or<br />

Y/C (with separate luminance <strong>and</strong> color signals), serial digital interface<br />

(SDI) <strong>and</strong> high definition SDI (HD-SDI).<br />

The programmable nature of the FPGA lends itself well to migrating<br />

systems that support different interfaces.<br />

The example design could be used as a framework for development of<br />

such FPGA hardware interface components. This can be achieved by<br />

implementing SOPC Builder components with Avalon-ST interfaces as<br />

used in the example design.<br />

The DSP Builder tool also allows development <strong>and</strong> test of video<br />

processing data paths independent of FPGA hardware interface<br />

development.<br />

For example, you could develop a video system with SDI video input <strong>and</strong><br />

output ports using the Stratix II GX board, <strong>and</strong> the Altera SDI/HD-SDI<br />

MegaCore function.<br />

Figure 4 shows a block diagram of a system with different video interface<br />

st<strong>and</strong>ards.<br />

Color Space<br />

<strong>Conversion</strong><br />

(YCbCr->RGB)<br />

Avalon-ST data interface<br />

Avalon-MM control interface<br />

Scaling<br />

Triple<br />

Buffer<br />

External Memory<br />

SDI<br />

<strong>Video</strong><br />

Altera Corporation 7<br />

Preliminary<br />

SDI


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Functional<br />

Description<br />

Figure 5. <strong>Example</strong> <strong>Design</strong> Block Diagram<br />

NTSC <strong>Video</strong> Input -<br />

Composite Input on<br />

<strong>Video</strong> Daughtercard<br />

Figure 5 shows a simple block diagram for the video <strong>and</strong> image<br />

processing up conversion example design.<br />

<strong>Video</strong> <strong>Up</strong><br />

<strong>Conversion</strong><br />

DSP Builder<br />

DDR2<br />

SDRAM<br />

SOPC Builder<br />

Frame Buffer<br />

HD <strong>Video</strong> Output<br />

- VGA Controller<br />

The video <strong>and</strong> image processing up conversion example design is<br />

implemented using hardware interface components <strong>and</strong> parameterizable<br />

hardware processing blocks from the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite.<br />

A video stream is input via one of the composite input ports on the <strong>Video</strong><br />

Input Daughtercard. The main block of the example design performs an<br />

up conversion of the st<strong>and</strong>ard definition video input (NTSC format<br />

640×480) <strong>and</strong> outputs a high definition video stream (1024×768),<br />

displaying the results through the VGA connector.<br />

DDR2 SDRAM memory is used to buffer the video frames from both a<br />

frame buffer block <strong>and</strong> the deinterlacing hardware component of the<br />

video up conversion data path.<br />

The up conversion block demonstrates how to connect together video<br />

processing functions from the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite.<br />

8 Altera Corporation<br />

Preliminary


NTSC <strong>Video</strong> Input<br />

Figure 6. NTSC <strong>Video</strong> Input Block Diagram<br />

Y/C<br />

Syncs<br />

Functional Description<br />

Figure 6 shows a simple block diagram of the three components of the<br />

NTSC video input subsystem.<br />

I 2 C<br />

Controller<br />

<strong>Video</strong> Data<br />

Capture<br />

<strong>Example</strong><br />

<strong>Design</strong><br />

Controller<br />

Daughtercard Clock<br />

(~25 MHz)<br />

SOPC System Clock<br />

(130 MHz)<br />

Dual-Clock FIFO<br />

NTSC Composite Input<br />

The NTSC input into the system requires three SOPC Builder components<br />

to work together: the I 2 C Controller, the <strong>Example</strong> <strong>Design</strong> Controller <strong>and</strong><br />

the NTSC Composite Input block. These are shown in Figure 6, with a<br />

dotted line delineating each SOPC Builder component.<br />

The NTSC Composite Input block operates similarly to its counterpart the<br />

VGA Output block. It is written in VHDL which can be found in the<br />

\ntsc_composite_input folder.<br />

<strong>Video</strong> data in YCbCr 4:2:2 format <strong>and</strong> associated synchronization signals<br />

are input into the <strong>Video</strong> Data Capture block from the <strong>Video</strong> Input<br />

Daughtercard. This block identifies active video parts of the picture <strong>and</strong><br />

inserts just this data into the Dual-Clock FIFO. A st<strong>and</strong>ard flow controlled<br />

interface on the output of the FIFO allows this data to be read by the next<br />

part of the system (the video processing data path in the case of the<br />

example design) at the system clock rate of 130 MHz.<br />

Altera Corporation 9<br />

Preliminary<br />

8<br />

Ready<br />

Valid<br />

Data


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

If the FIFO becomes empty, then the interface will not assert valid <strong>and</strong> the<br />

rest of the system will wait. The FIFO should never become full - if this<br />

were to happen then data from the video data capture block would be lost<br />

<strong>and</strong> unpleasant visual artefacts would result.<br />

The TVP5146 video decoder chip on the <strong>Video</strong> Input Daughtercard<br />

performs analog-to-digital conversion of the video input signals <strong>and</strong><br />

needs to be configured before it can be used. An I 2 C interface is provided<br />

for this purpose. The I 2 C Controller is an Avalon-MM slave which, when<br />

controlled by an Avalon-MM master, performs I2C reads <strong>and</strong> writes on an<br />

external bus as requested by that master.<br />

The <strong>Example</strong> <strong>Design</strong> Controller is an Avalon-MM master which directs<br />

the OpenCores I 2 C Controller to perform the necessary start-up sequence<br />

for the TI5146 chip, <strong>and</strong> then sends a signal to the NTSC Composite Input<br />

block telling it to start inputting data. The NTSC Composite Input block<br />

provides an Avalon-MM slave port for this purpose. The slave port has<br />

one register, one bit of which is significant: The least significant bit is a GO<br />

bit - when this is logic '1' the NTSC Composite Input block tries to input<br />

data, when it is logic '0' the NTSC Composite Input block does nothing.<br />

The I 2 C master is written in VHDL which can be found in the directory<br />

\altera_avalon_i2c. The example design controller VHDL<br />

can be found in \example_design_controller.<br />

<strong>Video</strong> <strong>Up</strong> <strong>Conversion</strong><br />

Figure 7. <strong>Video</strong> <strong>Up</strong> <strong>Conversion</strong> Data Path Block Diagram<br />

640 x 480<br />

Interlaced 60 Hz<br />

YCbCr 4:2:2<br />

8<br />

Deinterlacer<br />

MegaCore<br />

Figure 7 shows a block diagram of the video up conversion data path<br />

subsystem.<br />

640 x 480<br />

Progressive 30 Hz<br />

YCbCr 4:2:2<br />

Chroma<br />

Resampler<br />

MegaCore<br />

640 x 480<br />

Progressive 30 Hz<br />

YCbCr 4:4:4<br />

Color<br />

Space<br />

Converter<br />

MegaCore<br />

Two Avalon-MM master interfaces<br />

640 x 480<br />

Progressive 30 Hz<br />

RGB<br />

Scaler<br />

MegaCore<br />

1024 x 768<br />

Progressive 30 Hz<br />

RGB<br />

10 Altera Corporation<br />

Preliminary<br />

8<br />

Ready<br />

Valid<br />

Data


Figure 8. Data Stream Adapter Block Diagram<br />

Functional Description<br />

The video up conversion data path performs all of the video processing<br />

required to convert from an NTSC format input to a 1024×768 VGA<br />

output. It is composed entirely of Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong><br />

MegaCore functions <strong>and</strong> is assembled in DSP Builder, where it can be<br />

simulated independently of the rest of the system (see “Simulate the Data<br />

Path Component in DSP Builder” on page 30). The entire data path is<br />

exported from DSP Builder as a single SOPC Builder component, with<br />

st<strong>and</strong>ard Avalon-ST input <strong>and</strong> output interfaces <strong>and</strong> two Avalon-MM<br />

master ports.<br />

The data path makes use of four MegaCore functions connected in<br />

sequence to perform conversion. First a Deinterlacer converts from 60 Hz<br />

interlaced to 30 Hz progressive. Next a Chroma Resampler interpolates to<br />

convert from 4:2:2 subsampled color data to full 4:4:4 color data. This is<br />

followed by a Color Space Converter which transforms between the<br />

YCbCr <strong>and</strong> RGB color spaces. Finally a Scaler scales the 640×480 input<br />

image up to 1024×768 using bicubic interpolation.<br />

Timing <strong>and</strong> Data Format Adapters<br />

The next set of components in the data path is a set of adapters. The video<br />

up conversion subsystem processes an 8-bit wide data stream, one color<br />

plane every sample, but the frame buffer expects a 24-bit wide data<br />

stream, one pixel every sample.<br />

An Avalon-ST Data Format Adapter SOPC Builder block is used to<br />

transform the incoming 1×8-bit stream, into a 3×8-bit stream. The Avalon-<br />

ST Data Format Adapter block is a ready-latency 0 block whereas the rest<br />

of the data path is built with ready-latency 1 components. The Avalon-ST<br />

Data Format Adapter block is therefore connected using two Avalon-ST<br />

Timing Adapter blocks that convert between the ready-latency 1 stream<br />

<strong>and</strong> ready-latency 0 streams as shown in Figure 8.<br />

Ready<br />

Ready<br />

Ready<br />

Ready<br />

Avalon-ST<br />

Avalon-ST<br />

Avalon-ST<br />

Valid<br />

Valid<br />

Valid<br />

Valid<br />

Timing<br />

Data Format<br />

Timing<br />

Data<br />

Data<br />

Data<br />

Data<br />

Adapter<br />

Adapter<br />

Adapter<br />

8 8 24<br />

24<br />

ready-latency 1<br />

rules<br />

ready-latency 0<br />

rules<br />

ready-latency 0<br />

rules<br />

ready-latency 1<br />

rules<br />

Altera Corporation 11<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Frame Buffer Component<br />

Figure 9 shows a simple block diagram of the Frame Buffer component<br />

<strong>and</strong> its connections to external RAM via SOPC Builder.<br />

Figure 9. Frame Buffer Component Block Diagram<br />

Ready<br />

Valid<br />

Data<br />

24<br />

Memory<br />

Writer<br />

Memory<br />

Reader<br />

SOPC Builder Arbitration Logic<br />

DDR2<br />

The Frame Buffer block is a beta version of a new <strong>Video</strong> <strong>and</strong> <strong>Image</strong><br />

<strong>Processing</strong> Suite MegaCore function which can be found in the directory<br />

\frame_buffer_beta.<br />

The purpose of this block is to provide a triple buffering function which<br />

allows the input <strong>and</strong> output sides to run asynchronously <strong>and</strong> at different<br />

frame rates. In the example design, this is necessary because the output of<br />

the video data path is 1024×768 progressive video @ 30 fps, but the VGA<br />

output cannot run slower than 60 fps.<br />

The Frame Buffer block inputs <strong>and</strong> outputs flow-controlled streams of<br />

video data over st<strong>and</strong>ard interfaces of the type described in “Data <strong>and</strong><br />

Flow Control Signals” on page 18.<br />

The input <strong>and</strong> output data interfaces have 24-bit wide data ports <strong>and</strong><br />

output all three color planes in parallel, with blue on the least significant<br />

bits <strong>and</strong> red on the most significant bits. This makes the output interface<br />

compatible with the input interface on the VGA Output block.<br />

The block uses three equal-sized frame buffers stored in external memory.<br />

The base address of this memory in the Avalon-MM address space is set<br />

at 0x10000000. There must be 8MByte of free memory at this address.<br />

12 Altera Corporation<br />

Preliminary<br />

24<br />

Ready<br />

Valid<br />

Data


Functional Description<br />

The external memory is a double data rate (DDR) RAM in the example<br />

design, <strong>and</strong> is accessed via SOPC Builder arbitration logic as shown in<br />

Figure 9. SOPC Builder is responsible for sharing access time to the DDR<br />

between the frame buffer block <strong>and</strong> other blocks in the design. The block<br />

includes a writer, which writes the input stream into one of the buffers,<br />

<strong>and</strong> a reader, which reads the output stream from another (never the<br />

same) buffer. There is always one buffer which is neither being written to<br />

nor read from. This "spare" buffer is required to allow the input <strong>and</strong><br />

output to run at differing frame rates.<br />

The frame buffer operates by swapping frames according to the following<br />

algorithms.<br />

Each time the input finishes writing a frame of data into a buffer:<br />

Wait until the spare buffer has data that has already been displayed,<br />

then start writing the next input frame into the spare buffer. The<br />

buffer just written into then becomes the new spare buffer. No frame<br />

is dropped in this configuration.<br />

Each time the output finishes reading a frame of data from a buffer:<br />

If the spare buffer has data which has not yet been displayed then<br />

start reading the next output frame from the spare buffer. The frame<br />

buffer just read from then becomes the new spare buffer. Otherwise,<br />

start reading the next output frame from the same buffer (a frame is<br />

repeated).<br />

VGA Output<br />

Figure 10 shows a simple block diagram of the VGA Output component.<br />

Figure 10. VGA Output Component<br />

Ready<br />

Valid<br />

Data<br />

24<br />

SOPC System Clock<br />

(130 MHz)<br />

Dual-Clock FIFO<br />

VGA Clock<br />

(65 MHz)<br />

VGA Syncs<br />

Generator<br />

R<br />

G<br />

B<br />

Syncs<br />

The VGA Output is an SOPC Builder component written in Verilog HDL.<br />

The source code can be found in the directory \vga_output.<br />

Altera Corporation 13<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

System<br />

Requirements<br />

A stream of video data is input into the block over a st<strong>and</strong>ard flow<br />

controlled interface. This interface includes a 24-bit wide data port<br />

because red, green, <strong>and</strong> blue data is input into the block in parallel, so that<br />

all of the data for a pixel can be input in a single clock cycle. The least<br />

significant eight bits form the blue channel, the green is in the middle <strong>and</strong><br />

the most significant eight bits carry the red channel. The interface also<br />

includes ready <strong>and</strong> valid lines for flow control.<br />

f Refer to “Data <strong>and</strong> Flow Control Signals” on page 18 for details of the<br />

flow controlled interface.<br />

The video data is input via a flow controlled interface, so data is not<br />

transferred on every clock cycle, only those clock cycles where valid = '1',<br />

<strong>and</strong> the clock therefore need not be the same rate as the VGA output<br />

clock. The clock actually used at this end is therefore the SOPC System<br />

clock, which runs at 130MHz in the example design.<br />

Data is input into a dual-clock FIFO which provides clock domain<br />

crossing to the 65MHz VGA clock <strong>and</strong> also provides a queue where pixels<br />

can wait when the VGA output is in blanking <strong>and</strong> does not need pixel<br />

data.<br />

If this FIFO ever becomes full, then the flow controlled interface will<br />

indicate that the VGA output is not ready for data <strong>and</strong> earlier parts of the<br />

pipe will stop.<br />

The FIFO should never become empty while the system is running. If it<br />

does, then the situation could arise that there is no pixel data available<br />

when the VGA Syncs Generator needs it. In this case, the VGA output<br />

module will generate red pixels on its outputs (R:255, G:0, B:0) as an<br />

indication of data starvation.<br />

Synchronization <strong>and</strong> blanking signals for VGA running the st<strong>and</strong>ard<br />

video electronics st<strong>and</strong>ards association (VESA) 1024×768 resolution are<br />

calculated <strong>and</strong> output by the VGA Syncs Generator block. This block also<br />

pulls data out of the dual-clock FIFO <strong>and</strong> presents it on R, G, <strong>and</strong> B<br />

outputs when the syncs indicate the VGA should output active picture<br />

data. Signals from the VGA Syncs Generator form the output of the VGA<br />

Output block, <strong>and</strong> are wired directly to pins connected to the 2C35<br />

board's VGA digital-to-analog converter (DAC) in the example design.<br />

This section describes the hardware <strong>and</strong> software requirements to run the<br />

video up conversion example design.<br />

14 Altera Corporation<br />

Preliminary


Hardware Requirements<br />

System Requirements<br />

The video <strong>and</strong> image processing up conversion example design requires<br />

the following hardware components:<br />

■ Cyclone II EP2C70 DSP Development Board.<br />

■ NTSC video source with composite output.<br />

● The example design has been verified using:<br />

An Apple <strong>Video</strong> iPod. (An Apple TV out cable is required<br />

to connect an Apple <strong>Video</strong> iPod to the composite input.)<br />

An IBM Thinkpad T41 laptop with ATI v8.133 drivers<br />

generating the NTSC video source. (A S-<strong>Video</strong> to phono<br />

cable, S-<strong>Video</strong> to RCA, or a S-<strong>Video</strong> lead -> SVHS-Phono<br />

Adapter -> phono lead connection is required to connect a<br />

Thinkpad T41 to the Altera <strong>Video</strong> Input Daughtercard<br />

composite input.)<br />

A Sony H<strong>and</strong>ycam DCR HC-46<br />

● Other video sources outputting NTSC can be used including<br />

video cameras.<br />

■ An Altera <strong>Video</strong> Input Daughtercard (with two separate input<br />

channels of composite input).<br />

■ A monitor or display with a VGA connector supporting 1024×768<br />

resolution.<br />

■ A VGA cable to connect the Cyclone II VGA output to the monitor<br />

1 The Cyclone II EP2C70 DSP Development Board, <strong>Video</strong> Input<br />

Daughtercard <strong>and</strong> reference design are included in the Altera<br />

<strong>Video</strong> Development Kit, Cyclone II Edition.<br />

Software Requirements<br />

The up conversion example design is supported on Windows XP only.<br />

Ensure that the software provided with the development kit is installed<br />

onto your PC.<br />

f For more information on the software installation, refer to the DSP<br />

Development Kit, Cyclone II Edition, Getting Started User Guide.<br />

You must have the following software installed on your PC:<br />

■ Quartus II software, version 7.2<br />

■ MegaCore IP Library, version 7.2<br />

■ The MathWorks release R14 SP3, R2006a, R2006b, or R2007a<br />

■ DSP Builder version 7.2<br />

1 This application note assumes that you have installed the<br />

software into the default locations.<br />

Altera Corporation 15<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Review <strong>and</strong><br />

Simulate the<br />

<strong>Example</strong> <strong>Design</strong><br />

This section reviews the Data Path component in DSP Builder <strong>and</strong><br />

describes how to simulate the Data Path component in DSP Builder.<br />

Review the Data Path Component in DSP Builder<br />

To review the video <strong>and</strong> image processing up conversion data path<br />

design perform the following steps:<br />

1. Run the MATLAB software.<br />

Figure 11. Top Level Model of the <strong>Example</strong> <strong>Design</strong><br />

2. In the Current Directory browser, browse to the top level install<br />

directory.<br />

3. Choose Open (File menu) <strong>and</strong> select the file<br />

example_design_data_path.mdl<br />

4. Review the top level DSP Builder model, as shown in Figure 11.<br />

The example design shows how to connect together a chain of video<br />

functions for simulation within the DSP Builder environment. The next<br />

section describes each of the components <strong>and</strong> the connectivity of the data<br />

<strong>and</strong> flow control signals.<br />

16 Altera Corporation<br />

Preliminary


Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> MegaCore Functions<br />

The example design contains four Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong><br />

MegaCore functions: Deinterlacer, Chroma Resampler, Color Space<br />

Converter <strong>and</strong> Scaler.<br />

After installing any of the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite MegaCore<br />

functions, you should run the alt_dspbuilder_setup_megacore<br />

comm<strong>and</strong> in the MATLAB comm<strong>and</strong> window.<br />

The MegaCore functions are available from the Altera DSP Builder<br />

Blockset in the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> library as displayed in<br />

Figure 12.<br />

Figure 12. <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite in DSP Builder<br />

Altera Corporation 17<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

<strong>Video</strong> functions can be added to a DSP Builder model design by simply<br />

dragging <strong>and</strong> dropping the MegaCore function blocks to the model<br />

window.<br />

Data <strong>and</strong> Flow Control Signals<br />

All of the MegaCore functions support processing of images with from<br />

one to three color planes using Avalon-ST <strong>and</strong> Avalon-MM interfaces.<br />

f Refer to the Interfaces chapter in the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite User<br />

Guide for a full description of these data <strong>and</strong> flow control signals.<br />

Two MegaCore functions can therefore be connected together by<br />

connecting the common signal types valid to valid, ready to ready<br />

<strong>and</strong> data to data.<br />

The model based view in DSP Builder of the connection between the<br />

Color Space Converter <strong>and</strong> the Scaler block is show in Figure 13.<br />

Figure 13. Connections Between the Color Space Converter <strong>and</strong> Scaler<br />

<strong>Video</strong> Input Block - <strong>Video</strong> Source<br />

The example design uses a DSP Builder Simulation-only block to drive a<br />

video stream through the video processing functions for simulation.<br />

Figure 14 shows the <strong>Video</strong> Source block.<br />

18 Altera Corporation<br />

Preliminary


Figure 14. <strong>Video</strong> Source Block<br />

Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

The <strong>Video</strong> Source block extracts video frames from a multimedia file<br />

(vip_car.avi) <strong>and</strong> transmits them using the image streaming protocol<br />

described in the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite User Guide.<br />

f For more information on the <strong>Video</strong> Source block, refer to the DSP Builder<br />

Reference Manual.<br />

The <strong>Video</strong> Source block has one input signal <strong>and</strong> two output signals:<br />

■ Input: ready<br />

■ Data output: data<br />

■ Valid output: valid<br />

The block produces valid output data one clock cycle after the ready<br />

input signal is driven high. The valid output signal is driven high when<br />

the clock is valid.<br />

In this example, the <strong>Video</strong> Source block is configured to output 8-bit wide<br />

data in sequence, one color plane every clock cycle, over the data output<br />

port as shown in Figure 15.<br />

Figure 15. YCbCr Format Pixel Data at a 4:2:2 Sampling Rate<br />

Y Cb Y Cr Y Cb Y Cr<br />

1 The file name <strong>and</strong> location of the input file is a parameter of the<br />

<strong>Video</strong> Source block. Before running the simulation, you should<br />

check that the input file vip_car.avi is in the current MATLAB<br />

directory. Alternatively, you can change the Input file name<br />

parameter of the <strong>Video</strong> Source block to the absolute path of the<br />

multimedia file of your choice. The <strong>Video</strong> Source block can<br />

extract video frames from a wide range of multimedia file types,<br />

including still bitmap pictures, provided that the proper codecs<br />

are installed on your system.<br />

Altera Corporation 19<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

<strong>Video</strong> Output Block - <strong>Video</strong> Sink<br />

The example design uses a DSP Builder Simulation-only block to write<br />

video streams of data to an audio-video interleaved (AVI) file during<br />

simulation. Figure 16 shows the <strong>Video</strong> Sink block.<br />

Figure 16. <strong>Video</strong> Sink Block<br />

The <strong>Video</strong> Sink block builds video frames from the incoming stream of<br />

data <strong>and</strong> uses an user-specified encoder to store them in an AVI file. The<br />

<strong>Video</strong> Sink block is configured to output the file vip_car_out.avi in the<br />

current MATLAB directory by default.<br />

1 For more information on the <strong>Video</strong> Sink block, refer to the DSP<br />

Builder Reference Manual.<br />

<strong>Video</strong> Frame Counter<br />

The example design contains Simulink based blocks that provide a runtime<br />

count of the number of frames processed at any point in the data<br />

path during a simulation. Figure 17 shows the output Frame Counter<br />

blocks at the end of the data path.<br />

Figure 17. Frame Counter Blocks<br />

When running a simulation, the Input Frames <strong>and</strong> Output Frames blocks<br />

display the number of frames processed in decimal mode.<br />

5. Double-click on the Frame Counter - Output block to display the<br />

Function Block Parameters dialog box as shown in Figure 18 on<br />

page 21.<br />

20 Altera Corporation<br />

Preliminary


Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

Figure 18. Frame Counter - Output Block Parameters Dialog Box<br />

To count frames correctly, the frame width <strong>and</strong> frame height are set to the<br />

resolution of the video at the point in the data path where the frame<br />

counter is connected. The number of channels in sequence is set to the<br />

number of color planes transported in sequence at that point on the data<br />

path.<br />

For the frame counter placed after the Scaler block, the frame width,<br />

frame height, <strong>and</strong> number of channels in sequence are set to the format<br />

output by the Scaler block.<br />

1 The number of channels in sequence for the frame counter<br />

placed at the beginning of the data path is not 3 because the<br />

frame counter is counting 4:2:2 subsampled frames <strong>and</strong> in this<br />

case the number of color planes in sequence is 2.<br />

6. Click Cancel to close the Frame Counter - Output Block Parameters<br />

dialog box.<br />

Altera Deinterlacer MegaCore Function<br />

The example design deinterlaces the interlaced video input using the<br />

Deinterlacer MegaCore function provided with the Altera <strong>Video</strong> <strong>and</strong><br />

<strong>Image</strong> <strong>Processing</strong> Suite.<br />

Figure 19 on page 22 shows the data <strong>and</strong> control ports on the Deinterlacer<br />

block.<br />

Altera Corporation 21<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Figure 19. Deinterlacer Block<br />

7. Double-click on the Deinterlacer block to display the MegaWizard<br />

Plug-In Manager Parameter Settings page (Figure 20).<br />

Figure 20. Parameters for the Deinterlacer MegaCore Function<br />

22 Altera Corporation<br />

Preliminary


Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

The deinterlacer is parameterized to process an interleaved image of<br />

resolution 640×480 pixels, with 2 color planes in sequence due to the 4:2:2<br />

sampling rate of the interleaved input image. Weave deinterlacing is<br />

applied in this example <strong>and</strong> requires a frame buffer stored in off-chip<br />

memory so that lines from different fields can be woven together. For this<br />

reason, the weave deinterlacer has a built in double-buffering function.<br />

When in weave mode, the deinterlacer has two 64-bit Avalon-MM master<br />

ports. These must be connected to an external memory with enough space<br />

to store four full fields of video data.<br />

The base address of frame buffers represents the address in the<br />

Avalon-MM address space where the base of the frame buffer memory is<br />

to be located <strong>and</strong> there must be at least 1.2MByte of free RAM at this<br />

location. (7.4MByte is used by the frame buffer block at a base address of<br />

0x10000000.)<br />

8. Click Cancel to close the Deinterlacer MegaWizard page.<br />

External Memory Simulation Block<br />

The example design uses a DSP Builder Simulation-only block to allow<br />

simulation of an external RAM memory. The memory model is designed<br />

for use with the Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> MegaCore functions,<br />

but can be used for other purposes.<br />

Data can be written to (or read from) the RAM model via Avalon-MM<br />

read <strong>and</strong> write master ports. In the example design, the RAM model is<br />

connected to the Deinterlacer function.<br />

1 Note that the external RAM model can be used for simulation<br />

only <strong>and</strong> will not generate HDL if the design is compiled with<br />

Signal Compiler.<br />

Figure 21 shows the External RAM memory block in DSP Builder.<br />

Figure 21. External RAM Memory Block<br />

Altera Corporation 23<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

9. Double-click on the External RAM block to view the parameter<br />

options as shown in Figure 22.<br />

Figure 22. Function Block Parameters for the External RAM<br />

10. Click Cancel to close the External RAM Function Block Parameters<br />

dialog box.<br />

Chroma Resampler<br />

The example design resamples the subsampled video input using the<br />

Chroma Resampler MegaCore function provided with the Altera <strong>Video</strong><br />

<strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite. Figure 23 on page 25 shows the data <strong>and</strong><br />

control ports on the Chroma Resampler block.<br />

24 Altera Corporation<br />

Preliminary


Figure 23. Chroma Resampler Block<br />

Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

11. Double-click on the Chroma Resampler block to display the<br />

MegaWizard Plug-In Manager Parameter Settings page (Figure 24).<br />

Figure 24. Parameters for the Chroma Resampler MegaCore Function<br />

In this example, the Chroma Resampler converts the YCbCr 4:2:2<br />

subsampled pixel stream to a 4:4:4 sampled stream.<br />

12. Click Cancel to close the Chroma Resampler MegaWizard page.<br />

Altera Corporation 25<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Color Space Converter<br />

The example design converts the YCbCr color space to the RGB color<br />

space using the Color Space Converter MegaCore function provided with<br />

the Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite. Figure 25 shows the data<br />

<strong>and</strong> control ports on the Color Space Converter block.<br />

Figure 25. Color Space Converter Block<br />

13. Double-click on the Color Space Converter block to display the<br />

MegaWizard Plug-In Manager Parameter Settings page (Figure 26).<br />

Figure 26. Parameters for the Color Space Converter MegaCore Function<br />

26 Altera Corporation<br />

Preliminary


Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

14. Select the Oper<strong>and</strong>s tab to display the coefficients used to convert<br />

between the YCbCr <strong>and</strong> RGB color spaces. See Figure 27.<br />

Figure 27. Oper<strong>and</strong>s for the Color Space Converter MegaCore Function<br />

15. Click Cancel to close the Color Space Converter MegaWizard page.<br />

Scaler<br />

The example design scales the input video from st<strong>and</strong>ard definition (SD)<br />

NTSC resolution of 640×480 pixels to the high definition (HD) resolution<br />

1024×768 pixels using the Scaler MegaCore function provided with the<br />

Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite.<br />

Altera Corporation 27<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Figure 28 shows the data <strong>and</strong> control ports on the scaler block.<br />

Figure 28. Scaler Block<br />

16. Double-click on the Scaler block to display the MegaWizard Plug-In<br />

Manager Parameter Settings page (Figure 29).<br />

Figure 29. Resolution Parameters for the Scaler MegaCore Function<br />

The scaler convert from st<strong>and</strong>ard definition (640×480) to high definition<br />

(1024×768) image resolution. The clipping feature is not used.<br />

28 Altera Corporation<br />

Preliminary


Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

17. Select the Algorithms <strong>and</strong> Precision tab (Figure 30).<br />

Figure 30. Algorithm <strong>and</strong> Precision Page for the Scaler MegaCore Function<br />

The scaler uses the Bicubic scaling algorithm with 16 vertical <strong>and</strong><br />

horizontal phases.<br />

1 The Coefficients tab is only used when you select the Polyphase<br />

scaling algorithm <strong>and</strong> is not used in the example design.<br />

18. Click Cancel to close the Scaler MegaWizard page.<br />

Altera Corporation 29<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Simulate the Data Path Component in DSP Builder<br />

The simulation of video systems is a computationally expensive task, <strong>and</strong><br />

can take several hours to perform a gate level simulation of a frame of<br />

high resolution video. However, DSP Builder can accelerate simulation of<br />

the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite MegaCore functions (by a factor of<br />

approximately 30) using transaction level simulation.<br />

This increase opens the door to rapid prototyping <strong>and</strong> experimentation<br />

leading to higher image quality. This section describes how to simulate<br />

the design using both fast functional simulation <strong>and</strong> traditional cycle<br />

accurate simulation.<br />

For convenience, the example design contains pre-generated sample<br />

input <strong>and</strong> output video files in .avi format. The vip_car_out.avi file<br />

contains several frames of simulated video. To view the image input <strong>and</strong><br />

output files, open the .avi files in Windows Media Player.<br />

You can change a parameter for any of the MegaCore functions described<br />

in the previous section by double-clicking the appropriate block in DSP<br />

Builder to display the MegaWizard interface. The associated files are<br />

regenerated with the new parameters when you click Finish in the<br />

MegaWizard interface.<br />

Fast Functional Simulation<br />

The example model contains a Simulation Accelerator block. When this<br />

block displays Bit-accurate simulation (faster), all <strong>Video</strong> <strong>and</strong><br />

<strong>Image</strong> <strong>Processing</strong> Suite blocks are simulated at the transaction level,<br />

resulting in significant simulation acceleration compared to traditional<br />

cycle-accurate simulation (Figure 31).<br />

Figure 31. Simulation Accelerator Block set for Bit-Accurate Simulation<br />

f For more information about fast functional simulation, refer to the Using<br />

the Simulation Accelerator chapter in the DSP Builder User Guide.<br />

algebraic_loop_cut_dil Block<br />

This block is used to prevent Simulink from detecting an algebraic loop<br />

between the Deinterlacer <strong>and</strong> the two Avalon-MM master interfaces.<br />

30 Altera Corporation<br />

Preliminary


Review <strong>and</strong> Simulate the <strong>Example</strong> <strong>Design</strong><br />

f This issue is discussed in the DSP Builder Release Notes <strong>and</strong> Errata as an<br />

errata: Deinterlacer Ports Cannot Be Simulated with Avalon-MM Master<br />

Block. The design can be synthesized but it cannot be simulated correctly<br />

if the External RAM Wait States Per Write parameter is set to anything<br />

other than 0.<br />

1. To simulate the design, select Start from the Simulation menu in the<br />

example_design_data_path model window.<br />

1 Any existing vip_car_out.avi file is overwritten when you run a<br />

new simulation. You may want to archive the previous video<br />

files before you run a simulation. Simulation may fail to start if<br />

the previous video output file is open in your video player.<br />

2. Allow the simulation to run for at least one output frame. The frame<br />

counter blocks provides run time feedback on simulation progress.<br />

1 The output file is locked while the simulation is running or<br />

paused, <strong>and</strong> it is usually not possible to view the output video<br />

until the simulation has finished or is stopped manually.<br />

However, it is possible to make a copy of the output file while<br />

the simulation is running. Depending on the encoder chosen in<br />

the <strong>Video</strong> Sink block, this incomplete file might be readable by<br />

your media player.<br />

c If you stop the simulation, you will not be able to resume from<br />

the same point <strong>and</strong> the simulation must be restarted from the<br />

beginning.<br />

Cycle Accurate Simulation<br />

Switching between fast functional <strong>and</strong> cycle-accurate simulation is very<br />

simple. To perform a traditional cycle accurate simulation of the design,<br />

double-click the Simulation Accelerator block to set Cycle-accurate<br />

simulation mode (Figure 32).<br />

Figure 32. Simulation Accelerator Block set for Cycle-Accurate Simulation<br />

You can then simulate the design in exactly the same way as for fast<br />

functional simulation.<br />

Altera Corporation 31<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Review the<br />

System<br />

Integration<br />

Using SOPC<br />

Builder<br />

Figure 33. Avalon-ST Sink Block<br />

This section covers the following steps:<br />

■ Review the Data, Control <strong>and</strong> SOPC Builder Interfaces<br />

■ Review the Final System using SOPC Builder<br />

Review the Data, Control <strong>and</strong> SOPC Builder Interfaces<br />

To integrate the example design data path block into the overall system as<br />

a SOPC Builder component, the system must include Avalon-ST <strong>and</strong><br />

Avalon-MM interface blocks.<br />

The Avalon Memory-Mapped Interface Specification defines the transfer<br />

interaction between a peripheral <strong>and</strong> the interconnect logic that connects<br />

the component to the rest of the system. The interconnect logic, also<br />

known as the system interconnect fabric, is generated automatically by<br />

SOPC Builder.<br />

DSP Builder is closely integrated with SOPC Builder. SOPC Builder can<br />

automatically detect a DSP Builder model XML file (.mdlxml), <strong>and</strong><br />

include it in the component list for integration into a larger system.<br />

The design contains two data interfaces: Avalon-ST Sink <strong>and</strong> Avalon-ST<br />

Source. The former h<strong>and</strong>les the streaming data into the data path, <strong>and</strong> the<br />

latter h<strong>and</strong>les the output data from the data path.<br />

The sink <strong>and</strong> source blocks bound the synthesizable region of the design,<br />

<strong>and</strong> tell DSP Builder which interfaces to expose in SOPC Builder.<br />

The Avalon-ST Sink block is shown in Figure 33.<br />

32 Altera Corporation<br />

Preliminary


Figure 35. Avalon-MM Master Interface Blocks<br />

Review the System Integration Using SOPC Builder<br />

The Avalon-ST Source block is shown in Figure 34.<br />

Figure 34. Avalon-ST Source Block<br />

In addition, the design contains two Avalon-MM Master interface blocks<br />

as shown in Figure 35.<br />

The Read <strong>and</strong> Write Avalon-MM masters bound the synthesizable region<br />

in a similar way to the Avalon-ST data interface bus limiters.<br />

Altera Corporation 33<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

The External RAM block is for simulation only, <strong>and</strong> is not synthesizable.<br />

The connection of the Deinterlacer to the external DDR2 memory is<br />

performed in SOPC Builder.<br />

The data <strong>and</strong> control interface's port blocks define the synthesizable<br />

boundary of the data path design that will interface to other system<br />

components in SOPC Builder.<br />

A description of your model is written out as a .mdlxml file when you run<br />

Signal Compiler.<br />

f Refer to these DSP Builder User Guide for information about compiling<br />

your design.<br />

A full compilation is not strictly necessary for integration of the design<br />

within SOPC Builder. You can alternatively use the DSPBuilder comm<strong>and</strong><br />

alt_dspbuilder_mdl2xml to write the .mdlxml file by performing the<br />

following steps:<br />

1. Save your example_design_data_path.mdl model file<br />

2. At the MATLAB prompt, type the comm<strong>and</strong>:<br />

alt_dspbuilder_mdl2xml(gcs)<br />

Review the Final System using SOPC Builder<br />

In this section, you will review the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong><br />

<strong>Conversion</strong> example design using SOPC Builder, analyzing the<br />

individual modules that make up the system in the Quartus II software.<br />

The final system includes the following modules:<br />

■ <strong>Example</strong> <strong>Design</strong> Controller<br />

■ OpenCores I 2 C Master<br />

■ NTSC Composite Input<br />

■ <strong>Example</strong> <strong>Design</strong> Data Path (DSP Builder design)<br />

■ Timing <strong>and</strong> Data Format Adapters<br />

■ Frame Buffer<br />

■ VGA Output<br />

■ Pipeline Bridges<br />

■ DDR2 SDRAM Controller<br />

34 Altera Corporation<br />

Preliminary


Review the System Integration Using SOPC Builder<br />

To review the Quartus II project that describes the up conversion system,<br />

perform the following steps:<br />

1. Run the Quartus II design software by choosing Quartus II 7.2 from<br />

the Programs section of the Windows Start menu.<br />

2. Choose Open Project from the File menu. Browse to the directory<br />

where you installed the <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong> <strong>and</strong> select the<br />

<strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.qpf file. (This file contains project<br />

definitions for the video up conversion example design.)<br />

3. Choose Open from the File menu in the Quartus II software <strong>and</strong><br />

select the file <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.bdf. Click on Open to<br />

display this top-level file as shown in Figure 36.<br />

Figure 36. Top Level <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.bdf file in Quartus II<br />

4. In the Quartus II software, confirm that the Quartus II Fitter<br />

Physical Synthesis options are enabled (Assignments -> Settings -><br />

Fitter Settings -> Physical Synthesis Optimizations) <strong>and</strong> the<br />

Physical Synthesis Effort is set to Extra.<br />

This is required to meet the system timing requirements.<br />

5. Choose SOPC Builder from the Tools menu.<br />

Altera Corporation 35<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

The SOPC Builder window appears as shown in Figure 37.<br />

Figure 37. Final System with example_design_data_path from DSP Builder Integrated into a <strong>Video</strong> System<br />

SOPC Builder automatically detects the DSP Builder generated data path<br />

module because the .mdlxml file (example_design_data_path.mdlxml)<br />

is located in the same directory as the SOPC Builder component file<br />

(video_system_SOPC.sopc).<br />

1 You can specify the location of a DSP Builder system in another<br />

directory by adding this directory to the global libraries in the<br />

Quartus II project (Assignments -> Settings -> Libraries -><br />

Global libraries).<br />

36 Altera Corporation<br />

Preliminary


Review the System Integration Using SOPC Builder<br />

The video up conversion data path module (which is located in<br />

DSPBuilder Systems > example_design_data_path_Interface) refers to<br />

the synthesizable section of the DSP Builder system described in the<br />

previous section. (see Figure 38).<br />

It provides the following interfaces:<br />

■ Two Avalon-ST data interfaces:<br />

● The Avalon_ST_Sink interface inputs the image pixels into<br />

the data path<br />

● The Avalon_ST_Source interface outputs the processed<br />

image stream<br />

■ Two Avalon-MM control interfaces:<br />

● The read master interface (Avalon_MM_Read_Master) to read<br />

data from the external DDR2 memory<br />

● The write master interface (Avalon_MM_Write_Master) to<br />

write data to the external DDR2 memory<br />

Figure 38. Custom Hardware in the <strong>Video</strong> <strong>Up</strong> <strong>Conversion</strong> System<br />

Altera Corporation 37<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

1 The DSP Builder up conversion subsystem could be built<br />

directly in SOPC Builder by wiring up MegaCore function<br />

blocks from the list of <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> modules.<br />

However, DSP Builder is required to simulate the data path <strong>and</strong><br />

perform early design verification.<br />

The custom hardware components: example_design_controller,<br />

ntsc_composite_input, openCores_I2c_master, <strong>and</strong> vga_output appear in<br />

the <strong>Video</strong> IP <strong>Example</strong> <strong>Design</strong> module list. The Frame Buffer BETA<br />

MegaCore function block is available in the list of <strong>Video</strong> <strong>and</strong> <strong>Image</strong><br />

<strong>Processing</strong> modules. These components are described in the “Functional<br />

Description” on page 8.<br />

The Frame Buffer BETA block is added to the design <strong>and</strong> configured in<br />

SOPC Builder.<br />

6. Click on the my_alt_vip_vfb instance in the SOPC Builder Module<br />

Name column to open the parameterization interface for the Frame<br />

Buffer BETA block (Figure 39).<br />

Figure 39. Parameters for the Frame Buffer MegaCore Function<br />

38 Altera Corporation<br />

Preliminary


Review the System Integration Using SOPC Builder<br />

Most of the parameters are self explanatory: The input resolution is<br />

1024×768 with the RGB color samples streamed as 3×8-bits in parallel.<br />

The triple buffering function is configured to repeat frames. This is<br />

necessary because the VGA output cannot run slower than 60 fps <strong>and</strong> the<br />

output of the upscaling video data path is progressive video @ 30 fps but<br />

frame dropping is not necessary <strong>and</strong> is consequently not allowed. To<br />

perform its function, the frame buffer uses 7.4Mbyte of memory at base<br />

address 0x10000000.<br />

The FIFO depth <strong>and</strong> burst target parameters configure the behavior of the<br />

Memory Writer <strong>and</strong> Memory Reader components shown in Figure 9 on<br />

page 12. To transmit <strong>and</strong> receive data to <strong>and</strong> from the memory in bursts,<br />

the Reader <strong>and</strong> the Writer components each have a small FIFO to store<br />

read <strong>and</strong> write data. The two FIFO depth parameters control the sizes of<br />

these FIFOs.<br />

Write requests from the Memory Writer are issued in sequence to the<br />

SOPC Builder arbitration logic layer when the write master FIFO has<br />

buffered at least as many words as specified by the burst target<br />

parameter. The Memory Writer then keeps issuing write requests until its<br />

FIFO is empty. The Memory Writer also starts a write burst when it<br />

reaches the end of a line of pixels regardless of the number of data words<br />

currently stored in the FIFO.<br />

Read requests from the Memory Reader are issued when the read master<br />

FIFO contains at least as many available spaces as specified by the burst<br />

target parameter. Read requests that have been issued but have not yet<br />

been fulfilled have a reserved place in the FIFO <strong>and</strong> do not count as<br />

available space. The Memory Reader stops issuing read requests when<br />

the FIFO is full, including pending read requests.<br />

7. Click Cancel to close the Frame Buffer BETA block dialog box.<br />

Two Avalon-MM Pipeline Bridge components are used between the<br />

memory master interfaces of the Deinterlacer <strong>and</strong> Frame Buffer Megacore<br />

functions <strong>and</strong> the DDR2 SDRAM Controller Megacore function.<br />

8. Double-click on pipeline_bridge to open the parameterization<br />

interface for the first Pipeline Bridge component (Figure 40 on<br />

page 40).<br />

9. Click Cancel to close the Avalon-MM Pipeline Bridge dialog box.<br />

10. Double-click on pipeline_bridge_1 to open the parameterization<br />

interface for the second Pipeline Bridge component.<br />

Altera Corporation 39<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Figure 40. Parameters for pipeline_bridge<br />

Notice that the sizes of the data ports for the Pipeline Bridge components<br />

are different. The data width is 128 for the Pipeline Bridge connected to<br />

the Frame Buffer <strong>and</strong> 64 for the Pipeline Bridge connected to the up<br />

conversion subsystem built with DSP Builder. This is consistent with the<br />

parameterization of the Deinterlacer <strong>and</strong> Frame Buffer MegaCore<br />

functions.<br />

11. Click Cancel to close the second Avalon-MM Pipeline Bridge dialog<br />

box.<br />

12. Click Exit to close SOPC Builder after you review the components<br />

within the system but leave the Quartus II project open for the next<br />

section.<br />

Adding Files to the Quartus II Project<br />

Generating the SOPC Builder system, automatically adds all the HDL<br />

files associated with the custom hardware modules to the Quartus II<br />

software for compilation.<br />

1 It may be necessary to regenerate the SOPC Builder system if the<br />

project is moved. See the Troubleshooting section “DDR2 Fails<br />

in Analysis <strong>and</strong> Synthesis or In Timing Analysis” on page 43.<br />

40 Altera Corporation<br />

Preliminary


Set <strong>Up</strong> the<br />

Hardware <strong>and</strong><br />

Configure the<br />

FPGA<br />

'This section covers the following steps:<br />

Set <strong>Up</strong> the Hardware <strong>and</strong> Configure the FPGA<br />

■ Set <strong>Up</strong> the Cyclone II <strong>Video</strong> Development Board<br />

■ Configure the Cyclone II Device<br />

Set <strong>Up</strong> the Cyclone II <strong>Video</strong> Development Board<br />

The hardware analysis requires the Cyclone II DSP Development Board,<br />

<strong>Video</strong> Input Daughtercard, power cable <strong>and</strong> USB Blaster cable included<br />

in the <strong>Video</strong> Development Kit, Cyclone II Edition.<br />

In addition, you require a composite input cable, VGA output cable,<br />

NTSC video source (for example, DVD player, ThinkPad T41, <strong>Video</strong> iPod,<br />

or video camera), <strong>and</strong> monitor with VGA input capable of displaying<br />

1024×768 resolutions.<br />

To set up the Cyclone II DSP development board, perform the following<br />

steps:<br />

1. Remove power from the Cyclone II DSP Development Board by<br />

disconnecting the power cable.<br />

2. Connect one end of the USB cable to the USB port on your PC.<br />

3. Connect the other end to the 10-pin header labeled (J21) on the<br />

Cyclone II DSP Development Board.<br />

4. Connect the <strong>Video</strong> Input Daughtercard to the daughtercard<br />

connector on the Cyclone II DSP Development Board.<br />

5. Connect the video source composite in cable to the input connector<br />

marked J41 on the video daughter card.<br />

6. Connect one end of the VGA cable to a VGA monitor, capable of<br />

1024×768 @ 60Hz. Connect the other end to the VGA connector<br />

labeled (J35) on the Cyclone II DSP Development Board.<br />

7. Re-apply power to the Cyclone II DSP Development Board.<br />

f For details of installing the USB Blaster software driver on the host PC<br />

(located at \drivers\usb-blaster), refer to the<br />

USB-Blaster Download Cable User Guide.<br />

f For details of the Cyclone II DSP Development Board, refer to the DSP<br />

Development kit, Cyclone II Edition Getting Started User Guide.<br />

Altera Corporation 41<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Configure the Cyclone II Device<br />

You can configure the Cyclone II device by downloading the SOF image<br />

to the DSP development board. To do so, perform the following steps:<br />

1. In the Quartus II software, choose Programmer (Tools menu).<br />

2. Choose Save As (File menu).<br />

3. In the Save As dialog box, type <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.cdf<br />

in the File Name box.<br />

4. In the Save As type list, make sure you select Chain Description<br />

File.<br />

5. Click Save.<br />

6. In the Mode list of the Programming window, make sure JTAG is<br />

selected.<br />

7. Click Hardware Setup to configure the programming hardware.<br />

Confirm that the Hardware Setup dialog box appears.<br />

8. From the Hardware column, select USB Blaster.<br />

9. Click Close to exit the Hardware Setup window.<br />

10. In the Programming window, turn on the Program/Configure check<br />

box on the same line as <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.sof.<br />

11. Click Start.<br />

The programmer begins to download the configuration data to the<br />

FPGA. The Progress field displays the percentage of data that is<br />

downloaded. A message appears when the configuration is<br />

complete.<br />

1 If you are not using a licensed version of the <strong>Video</strong> <strong>and</strong> <strong>Image</strong><br />

<strong>Processing</strong> Suite, a message appears indicating that you are<br />

running a time-limited configuration file on your target<br />

hardware.<br />

12. Press the USER RESET button on the board <strong>and</strong> confirm that a<br />

scaled video stream is displayed on the monitor.<br />

You have now successfully completed the <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong><br />

<strong>Up</strong> <strong>Conversion</strong> design example walkthrough.<br />

42 Altera Corporation<br />

Preliminary


Conclusion<br />

Conclusion<br />

The <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> example design<br />

provides a convenient framework for rapid development of video <strong>and</strong><br />

image processing designs using the library of parameterizable MegaCore<br />

functions available in the Altera <strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> Suite.<br />

The FPGA supports high levels of parallel processing data flow structures<br />

that are important for efficient implementation of image processing<br />

algorithms. The suite of development tools that include DSP Builder <strong>and</strong><br />

SOPC Builder allows you to build an image processing data path <strong>and</strong><br />

integrate into a video system.<br />

Troubleshooting This section contains troubleshooting information for the following<br />

issues:<br />

■ DDR2 Fails in Analysis <strong>and</strong> Synthesis or In Timing Analysis<br />

■ Quartus II Compilation fails to meet F Max of 130MHz<br />

DDR2 Fails in Analysis <strong>and</strong> Synthesis or In Timing Analysis<br />

The example design makes use of the DDR2 MegaCore function. The<br />

Quartus II project includes an absolute path specifying the installed<br />

locations of this product <strong>and</strong> assumes that it has been installed in its<br />

default location (starting with c:\altera\72\ip).<br />

The DDR MegaCore function scripts include absolute file paths which are<br />

created when the MegaCore function variation is generated. For these<br />

reasons, it may be necessary to regenerate the MegaCore function if the<br />

project is moved in a different directory or a different computer.<br />

Use the following procedure to regenerate the MegaCore function<br />

variation if compilation fails because of DDR related errors:<br />

1. Open <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>.bdf.<br />

2. Double-click on <strong>Video</strong>_IP_<strong>Example</strong>_<strong>Design</strong>_SOPC_Component to<br />

open the SOPC System in SOPC Builder.<br />

3. Make sure that the Quartus II user <strong>and</strong> global library paths are<br />

correct for the project (see “Review the Final System using SOPC<br />

Builder” on page 34).<br />

4. Click Generate in SOPC Builder.<br />

5. Close SOPC Builder <strong>and</strong> recompile the Quartus II project.<br />

Altera Corporation 43<br />

Preliminary


<strong>Video</strong> <strong>and</strong> <strong>Image</strong> <strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong><br />

Figure 41. Quartus II Physical Synthesis Assignments<br />

Quartus II Compilation fails to meet F Max of 130MHz<br />

Ensure that the physical synthesis effort (Assignments -> Settings -><br />

Fitter Settings -> Physical Synthesis Optimizations) is set to Extra in the<br />

Quartus II software as shown in Figure 41.<br />

44 Altera Corporation<br />

Preliminary


101 Innovation Drive<br />

San Jose, CA 95134<br />

www.altera.com<br />

Literature Services:<br />

literature@altera.com<br />

Revision History<br />

Revision History Table 1 shows the revision history for the AN-427: <strong>Video</strong> <strong>and</strong> <strong>Image</strong><br />

<strong>Processing</strong> <strong>Up</strong> <strong>Conversion</strong> <strong>Example</strong> <strong>Design</strong> application note.<br />

Table 1. AN-427 Revision History<br />

Version Date Errata Summary<br />

4.0 October 2007 <strong>Up</strong>dated for Quartus version 7.2. The design now uses DSP Builder <strong>Video</strong> Source<br />

<strong>and</strong> <strong>Video</strong> Sink blocks <strong>and</strong> the triple buffer block has been replaced by a Frame<br />

Buffer MegaCore function. Removed obsolete troubleshooting issue “Compilation<br />

Fails in Analysis <strong>and</strong> Synthesis”.<br />

3.0 May 2007 <strong>Up</strong>dated for Quartus version 7.1.<br />

2.0 December 2006 <strong>Up</strong>dated for Quartus version 6.1.<br />

1.2 July 2006 Added troubleshooting issues “Compilation Fails in Analysis <strong>and</strong> Synthesis” <strong>and</strong><br />

“DDR2 Fails in Analysis <strong>and</strong> Synthesis or In Timing Analysis”.<br />

1.1 July 2006 <strong>Up</strong>dated algorithm used by the triple buffer block, effects of VGA starvation,<br />

description of the image stream frame counter block, <strong>and</strong> other minor edits.<br />

1.0 June 2006 First release of this application note.<br />

Copyright © 2007 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company,<br />

the stylized Altera logo, specific device designations, <strong>and</strong> all other words <strong>and</strong> logos that are identified as<br />

trademarks <strong>and</strong>/or service marks are, unless noted otherwise, the trademarks <strong>and</strong> service marks of Altera<br />

Corporation in the U.S. <strong>and</strong> other countries. All other product or service names are the property of their respective<br />

holders. Altera products are protected under numerous U.S. <strong>and</strong> foreign patents <strong>and</strong> pending<br />

applications, maskwork rights, <strong>and</strong> copyrights. Altera warrants performance of its semiconductor products<br />

to current specifications in accordance with Altera's st<strong>and</strong>ard warranty, but reserves the right to make changes<br />

to any products <strong>and</strong> services at any time without notice. Altera assumes no responsibility or liability<br />

arising out of the application or use of any information, product, or service described<br />

herein except as expressly agreed to in writing by Altera Corporation. Altera customers<br />

are advised to obtain the latest version of device specifications before relying on any published<br />

information <strong>and</strong> before placing orders for products or services.<br />

Altera Corporation 45<br />

Preliminary

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!