Altera Home Page
Literature Licensing
Buy On-Line Download

  Home   |   Products   |   Support   |   End Markets   |   Technology Center   |   Education & Events   |   Corporate   |   Buy On-Line  
  Knowledge Database   |   Devices   |   Design Software   |   Intellectual Property   |   Reference Designs   |   Design Examples   |   mySupport  

 Products
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 Functionality
      Arithmetic
      Memory
      Bus & I/O
      Logic
      Interfaces & Peripherals
      DSP
      Communications
      PLL & Clocking
  
 Design Entry
      Quartus II Project
      Tcl
      VHDL
      Verilog HDL
      C Code Examples
      DSP Builder
      TimeQuest
   On-Chip Debugging
  
 Simulation Tools
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 Legacy Examples
      Graphic Editor
      AHDL
  

Deinterlacer Using Weave Mode

This design example shows you how to convert interlaced video into a non-interlaced format in DSP Builder. Interlaced video is composed of a sequence of fields and must be converted to a sequence of frames before display in certain applications.

The Altera® Deinterlacer MegaCore® function supports two deinterlacing methods: bob and weave. In this example with weave deinterlacing, the Deinterlacer MegaCore function stitches the consecutive fields together into a frame. Weave deinterlacer works well when changes are minimal between two adjacent frames. When changes are visible, the pixels in one frame do not line up with the pixels in the other, resulting in jagged vertical edges, commonly known as the "mouse teeth" artifact.

The model consists of an image stream source block, a deinterlacing_weave block, an external RAM block, and an image stream sink block. The image stream source block reads the input binary file and feeds the data stream to the deinterlacing_weave block. The external RAM block stores the previous field's data and writes back to the deinterlacing_weave block to combine with the current field's data. The image stream sink block writes the deinterlaced data stream to an output binary file. The package also includes the utility to convert an avi video file format to and from a binary file format.

Download the files used in this example:

The use of this design is governed by, and subject to, the terms and conditions of the Altera Hardware Reference Design License Agreement.

Files in the zip download include:

  • example.mdl - DSP Builder design file
  • deinterlacer_weave.vhd - Wrapper file to generate the Deinterlacer intellectual property (IP) MegaCore function
  • avi-is-avi.exe - DOS executable to convert an avi file to and from a binary file (also includes some necessary .dll files)

Figure 1 shows the top-level diagram of the Deinterlacer MegaCore function using the weave mode design example in DSP Builder.

Figure 1. Deinterlacer Using Weave Mode Design Example

Figure 1. Deinterlacer Using Weave Mode Design Example
View Full Size

Table 1 lists the ports and gives a description for each.

Table 1. Deinterlacer Using Weave Mode Port Listing
Port Name Type Description
din_data[7:0] Input Data input bus
din_valid Input Data valid signal that indicates the validity of the input data signals
dout_ready Input Data output ready signal
reset Input Reset signal
read_master_av_readdata[63:0] Input Avalon® read data bus
read_master_av_readdatavalid Input Avalon read data valid signal
read_master_av_waitrequest Input Avalon read wait request signal
write_master_av_waitrequest Input Avalon write wait request signal
din_ready Output Data input ready signal
dout_data[7:0] Output Data output bus
dout_valid Output Data valid signal that indicates the validity of the output data signals
read_master_av_address[31:0] Output Avalon read address bus
read_master_av_read Output Avalon read signal
write_master_av_address[31:0] Output Avalon write address bus
write_master_av_write Output Avalon write signal
write_master_av_writedata[63:0] Output Avalon write data bus

Related Links

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.

  Please Give Us Feedback