- •Contents
- •1. Video and Image Processing Suite Overview
- •Release Information
- •Device Family Support
- •Latency
- •In-System Performance and Resource Guidance
- •Stall Behavior and Error Recovery
- •2. Interfaces
- •Video Formats
- •Avalon-ST Video Protocol
- •Video Data Packets
- •Static Parameters of Video Data Packets
- •Control Data Packets
- •Ancillary Data Packets
- •User-Defined and Altera-Reserved Packets
- •Packet Propagation
- •Transmission of Avalon-ST Video Over Avalon-ST Interfaces
- •Packet Transfer Examples
- •Avalon-MM Slave Interfaces
- •Specification of the Type of Avalon-MM Slave Interfaces
- •Avalon-MM Master Interfaces
- •Specification of the Type of Avalon-MM Master Interfaces
- •Buffering of Non-Image Data Packets in Memory
- •3. Getting Started
- •IP Catalog and Parameter Editor
- •Specifying IP Core Parameters and Options
- •Installing and Licensing IP Cores
- •OpenCore Plus IP Evaluation
- •4. Clocked Video Interface IP Cores
- •Control Port
- •Clocked Video Input Format Detection
- •Interrupts
- •Clocked Video Output Video Modes
- •Interrupts
- •Generator Lock
- •Underflow and Overflow
- •Timing Constraints
- •Handling Ancillary Packets
- •Modules for Clocked Video Input II IP Core
- •Clocked Video Interface Parameter Settings
- •Clocked Video Interface Signals
- •Clocked Video Interface Control Registers
- •5. 2D FIR Filter IP Core
- •Calculation Precision
- •Coefficient Precision
- •Result to Output Data Type Conversion
- •2D FIR IP Core Parameter Settings
- •2D FIR Filter Signals
- •2D FIR Filter Control Registers
- •6. Video Mixing IP Cores
- •Alpha Blending
- •Video Mixing Parameter Settings
- •Video Mixing Signals
- •Video Mixing Control Registers
- •7. Chroma Resampler IP Core
- •Horizontal Resampling (4:2:2)
- •Vertical Resampling (4:2:0)
- •Chroma Resampler Parameter Settings
- •Chroma Resampler Signals
- •8. Video Clipping IP Cores
- •Video Clipping Parameter Settings
- •Video Clipping Signals
- •Video Clipping Control Registers
- •9. Color Plane Sequencer IP Core
- •Combining Color Patterns
- •Rearranging Color Patterns
- •Splitting and Duplicating
- •Subsampled Data
- •Color Plane Sequencer Parameter Settings
- •Color Plane Sequencer Signals
- •10. Color Space Conversion IP Cores
- •Input and Output Data Types
- •Color Space Conversion
- •Result of Output Data Type Conversion
- •Color Space Conversion Parameter Settings
- •Color Space Conversion Signals
- •Color Space Conversion Control Registers
- •11. Control Synchronizer IP Core
- •Using the Control Synchronizer IP Core
- •Control Synchronizer Parameter Settings
- •Control Synchronizer Signals
- •Control Synchronizer Control Registers
- •12. Deinterlacing IP Cores
- •Deinterlacing Methods
- •Bob with Scanline Duplication
- •Bob with Scanline Interpolation
- •Weave
- •Motion-Adaptive
- •Sobel-Based HQ Mode
- •Pass-Through Mode for Progressive Frames
- •Frame Buffering
- •Frame Rate Conversion
- •Bandwidth Requirement Calculations for 10-bit YCbCr Video
- •Behavior When Unexpected Fields are Received
- •Handling of Avalon-ST Video Control Packets
- •Deinterlacing Parameter Settings
- •Deinterlacing Signals
- •Deinterlacing Control Registers
- •Design Guidelines for Broadcast Deinterlacer IP Core
- •13. Frame Reader IP Core
- •Single-Cycle Color Patterns
- •Frame Reader Output Pattern and Memory Organization
- •Frame Reader Parameter Settings
- •Frame Reader Signals
- •Frame Reader Control Registers
- •14. Frame Buffer IP Cores
- •Double Buffering
- •Triple Buffering
- •Locked Frame Rate Conversion
- •Handling of Avalon-ST Video Control Packets
- •Color Format
- •Frame Buffer Parameter Settings
- •Frame Buffer Signals
- •Frame Buffer Control Registers
- •15. Gamma Corrector IP Core
- •Gamma Corrector Parameter Settings
- •Gamma Corrector Signals
- •Gamma Corrector Control Registers
- •16. Interlacer IP Core
- •Interlacer Parameter Settings
- •Interlacer Signals
- •Interlacer Control Registers
- •17. Scaler II IP Core
- •Nearest Neighbor Algorithm
- •Bilinear Algorithm
- •Bilinear Algorithmic Description
- •Polyphase and Bicubic Algorithm
- •Double-Buffering
- •Polyphase Algorithmic Description
- •Choosing and Loading Coefficients
- •Edge-Adaptive Scaling Algorithm
- •Scaler II Parameter Settings
- •Scaler II Signals
- •Scaler II Control Registers
- •18. Video Switching IP Cores
- •Mixer Layer Switching
- •Video Switching Parameter Settings
- •Video Switching Signals
- •Video Switching Control Registers
- •19. Test Pattern Generator IP Cores
- •Test Pattern
- •Generation of Avalon-ST Video Control Packets and Run-Time Control
- •Test Pattern Generator Parameter Settings
- •Test Pattern Generator Signals
- •Test Pattern Generator Control Registers
- •20. Trace System IP Core
- •Trace System Parameter Settings
- •Trace System Signals
- •Operating the Trace System from System Console
- •Loading the Project and Connecting to the Hardware
- •Trace Within System Console
- •TCL Shell Commands
- •21. Avalon-ST Video Monitor IP Core
- •Packet Visualization
- •Monitor Settings
- •Avalon-ST Video Monitor Parameter Settings
- •Avalon-ST Video Monitor Signals
- •Avalon-ST Video Monitor Control Registers
- •Avalon-ST Video Class Library
- •Running the Tests
- •Video File Reader Test
- •Example Test Environment
- •Video Field Life Cycle
- •Constrained Random Test
- •Complete Class Reference
- •c_av_st_video_control
- •c_av_st_video_data
- •c_av_st_video_file_io
- •c_av_st_video_item
- •c_av_st_video_source_sink_base
- •c_av_st_video_sink_bfm_’SINK
- •c_av_st_video_source_bfm_’SOURCE
- •c_av_st_video_user_packet
- •c_pixel
- •Raw Video Data Format
- •Cadence Detection and Reverse Pulldown in the Deinterlacer II IP Core
- •Document Revision History
- •How to Contact Altera
A-28 |
c_pixel |
UG-VIPSUITE |
|
2015.01.23 |
|||
|
|
c_pixel
The declaration for the c_pixel class:
class c_pixel#(parameters BITS_PER_CHANNEL=8, CHANNELS_PER_PIXEL=3);
Table A-18: Method Calls for c_pixel Class
Method Call |
|
Description |
|
|
|
function new(); |
|
Constructor. |
|
|
|
function void copy(c_pixel #(BITS_PER_CHANNEL, |
|
Copies object pixel into this object. |
CHANNELS_PER_PIXEL) pix); |
|
|
|
|
|
function bit[BITS_PER_CHANNEL-1:0] get_ |
|
Returns pixel data for channel id. |
data(int id); |
|
|
|
|
|
function void set_data(int id, bit [BITS_PER_ |
|
Sets pixel data for channel id. |
CHANNEL-1:0] data); |
|
|
|
|
|
Raw Video Data Format
Altera provides and recommends two Microsoft Windows utilities for translating between .avi and .raw file formats.
You can use the following examples to translate file formats.
Altera Corporation |
Avalon-ST Video Verification IP Suite |
|
|
Send Feedback
UG-VIPSUITE 2015.01.23
Raw Video Data Format |
A-29 |
• Convert .raw to .avi files.
>avi2raw.exe vip_car_0.avi vip_car_0.raw
"dshow" decoder created Information on the input file: filename: vip_car_0.avi fourcc = ARGB32
width = 160 height = 120 stride = 640 inversed = yes
endianness = little_endian frame_rate = 25
Choose output dimensions, 0 to keep original values (this will apply a crop/pad, not a scaling):
width (160) = 0 height (120) = 0
Choose output colorspace: 1.RGB
2.YCbCr
3.MONO
1
Choose output bps (8, 10) 8
Choose output interlacing: 1.progressive 2.interlaced F0 first 3.interlaced F1 first
1
Choose a number of frames to skip at the start of the sequence (use 0 to start t he decoding from the beginning) :
0
Choose the maximum number of frames to decode (use 0 to decode up to the end of the video) :
0
"raw" encoder created Decoding in progress.......
7 fields extracted deleting decoding chain deleting encoder
press a key to exit 1
• Produce a .raw file and an.spc file that contains the FOURCC information.
> more vip_car_0.spc
fourcc = RGB32 width = 160 height = 120 stride = 640 frame_rate = 25
•To decode the data, the file I/O class reader must see both the .raw and .spc files. The file I/O class reader writes a .raw/.spc file pair that you can view using the .avi encoder utility.
> raw2avi.exe vip_car_1.raw vip_car_1.avi |
|
"raw" decoder created |
|
vip_car_1.raw: |
|
RGB32 160*120, progressive, 25fps |
|
"dshow" encoder created |
|
AVI encoder created |
|
Encoding in progress....... |
|
7 frames encoded |
|
deleting conversion chain |
|
deleting encoder |
|
press a key to exit |
Altera Corporation |
Avalon-ST Video Verification IP Suite |
|
1 |
|
Send Feedback |
|
A-30 |
Raw Video Data Format |
UG-VIPSUITE |
|
2015.01.23 |
|||
|
|
If you don't have a no Windows machine available to run the utilities, you must then provide the video data in the correct format by some other means.
Figure A-7: Supported FOURCC Codes and Data Format
The figure below shows an example of the data format required by the file I/O class for each of the supported FOURCC codes.
YUY 2
|
|
|
|
V |
|
|
|
Y |
|
|
|
U |
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RGB 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
B |
|
|
|
|
|
|
|
G |
|
|
|
|
|
|
|
R |
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
Byte |
0 |
|
|
|
|
Byte |
1 |
|
|
|
|
Byte |
2 |
|
|
|
|
Byte |
3 |
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||||||||||||||||||
|
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Altera Corporation |
Avalon-ST Video Verification IP Suite |
|
|
Send Feedback
Choosing the Correct Deinterlacer |
B |
2015.01.23
UG-VIPSUITE |
Subscribe |
Send Feedback |
You should choose the right deinterlacer based on the quality of the output needed.
The simple Bob deinterlacing option produces the lowest quality outputs; and the motion adaptive high quality (HQ) option produces the highest quality outputs.
Figure B-1: Bob Deinterlacing Option
The figure below shows an example output from Bob deinterlacing option.
To enable this option, select Bob Scanline Interpolation in the Deinterlacer IP core parameter editor. With this moving Dial test sequence, a Bob deinterlacer produces the characteristic staircasing effect on the edges of these diagonal lines. The area is 454 look-up tables (LUTs).
© 2015 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
ISO 9001:2008 Registered
101 Innovation Drive, San Jose, CA 95134
B-2 |
Choosing the Correct Deinterlacer |
UG-VIPSUITE |
|
2015.01.23 |
|||
|
|
Figure B-2: Motion Adaptive Deinterlacing Option
The figure below shows an example output from Motion Adaptive deinterlacing option.
To enable this option, select Motion Adaptive in the Deinterlacer or Deinterlacer II IP core parameter. If you are using the Deinterlacer IP core parameter editor, you need to select Triple buffering with rate conversion for the buffering mode.
With the moving Dial test sequence, a motion-adaptive interlacer detects the motion, preventing incoming artifacts that would otherwise appear. The motion-adaptive interlacer performs a Bob interpo lation and operates on a 3x3 kernel of pixels, therefore has the ability to interpolate along the diagonal and reduce the staircasing effect. The area is 5,188 LUTs for the Deinterlacer IP core and 3, 696 LUTs for the Deinterlacer II IP core.
Figure B-3: Motion Adaptive High Quality Deinterlacing Option
The figure below shows an example output from Motion Adaptive High Quality deinterlacing option.
To enable this option, select Motion Adaptive High Quality in the Deinterlacer II IP core parameter.
Altera Corporation |
Choosing the Correct Deinterlacer |
|
|
Send Feedback