User guide
Table Of Contents
- Contents
- 1. About This MegaCore Function Suite
- Release Information
- Device Family Support
- Features
- Design Example
- Performance and Resource Utilization
- 2D FIR Filter
- 2D Median Filter
- Alpha Blending Mixer
- Avalon-ST Video Monitor
- Chroma Resampler
- Clipper
- Clocked Video Input
- Clocked Video Output
- Color Plane Sequencer
- Color Space Converter
- Control Synchronizer
- Deinterlacer
- Deinterlacer II
- Frame Buffer
- Gamma Corrector
- Interlacer
- Scaler
- Scaler II
- Switch
- Test Pattern Generator
- Trace System
- 2. Getting Started with Altera IP Cores
- 3. Interfaces
- Interface Types
- Avalon-ST Video Protocol
- Avalon-MM Slave Interfaces
- Avalon-MM Master Interfaces
- Buffering of Non-Image Data Packets in Memory
- 4. 2D FIR Filter MegaCore Function
- 5. 2D Median Filter MegaCore Function
- 6. Alpha Blending MegaCore Function
- 7. Avalon-ST Video Monitor MegaCore Function
- 8. Chroma Resampler MegaCore Function
- 9. Clipper MegaCore Function
- 10. Clocked Video Input MegaCore Function
- 11. Clocked Video Output MegaCore Function
- 12. Color Plane Sequencer MegaCore Function
- 13. Color Space Converter MegaCore Function
- 14. Control Synchronizer MegaCore Function
- 15. Deinterlacer MegaCore Function
- Core Overview
- Functional Description
- Parameter Settings
- Signals
- Control Register Maps
- 16. Deinterlacer II MegaCore Function
- 17. Frame Reader MegaCore Function
- 18. Frame Buffer MegaCore Function
- 19. Gamma Corrector MegaCore Function
- 20. Interlacer MegaCore Function
- 21. Scaler MegaCore Function
- 22. Scaler II MegaCore Function
- 23. Switch MegaCore Function
- 24. Test Pattern Generator MegaCore Function
- 25. Trace System MegaCore Function
- A. Avalon-ST Video Verification IP Suite
- B. Choosing the Correct Deinterlacer
- Additional Information

24–2 Chapter 24: Test Pattern Generator MegaCore Function
Functional Description
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
The actual numerical values are given in Table 24–1 (assuming 8 bits per color
samples). If the output is requested in a different number of bits per color sample
these values are converted by truncation or promotion.
The choice of a specific resolution and subsampling for the output leads to natural
constraints on the test pattern. If the format has a horizontal subsampling period of
two for the Cb and Cr components when the output is in the Y’CbCr color space, the
black borders at the left and right are two pixels wide. Similarly, the top and bottom
borders are two pixels wide when the output is vertically subsampled.
The width and the horizontal subsampling might also have an effect on the width of
each color bar. When the output is horizontally subsampled, the pixel-width of each
color bar is a multiple of two. When the width of the image (excluding the left and
right borders) cannot be exactly divided by eight, then the last black bar is larger than
the others. For example, when producing a 640×480 frame in the Y’CbCr color space
with 4:2:2 subsampling, the left and right black borders are two pixels wide each, the
seven initial color bars are 78 pixels wide ((640–4)/8 truncated down to the nearest
multiple of 2) and the final black color bar is 90 pixels wide (640–7×78–4).
Generation of Avalon-ST Video Control Packets and Run-Time Control
The Test Pattern Generator MegaCore function outputs a valid Avalon-ST Video
control packet before each image data packet it generates, whether it is a progressive
frame or an interlaced field. When the output is interlaced, the Test Pattern Generator
MegaCore function produces a sequence of pairs of field, starting with F0 if the output
is F1 synchronized of with F1 if the output is F0 synchronized.
When the Avalon Slave run-time controller is enabled, the resolution of the output can
be changed at run-time at a frame boundary, that is, before the first field of a pair
when the output is interlaced.
Because the Test Pattern Generator does not accept an input stream, the pseudo-code
in “Avalon-MM Slave Interfaces” on page 3–17 is slightly modified:
go = 0;
while (true)
{
status = 0;
while (go != 1 )
wait();
read_control(); //Copies control to internal register
status = 1;
Table 24–1. Test Pattern Color Values
Color R’G’B’ Y’CbCr
White/Grey (180,180,180) (180,128,128)
Yellow (180,180,16) (162,44,142)
Cyan (16,180,180) (131,156,44)
Green (16,180,16) (112,72,58)
Magenta (180,16,180) (84,184,198)
Red (180,16,16) (65,100,212)
Blue (16,16,180) (35,212,114)
Black (16,16,16) (16,128,128)