Pixel Stream Aligner
Align two streams of pixel data
Libraries:
Vision HDL Toolbox /
Utilities
Description
The Pixel Stream Aligner block synchronizes two pixel streams by delaying one stream to match the timing of a reference stream. Many Vision HDL Toolbox™ algorithms delay the pixel stream, and the amount of delay can change as you adjust algorithm parameters. You can use this block to align streams for overlaying, comparing, or combining two streams such as in a Gaussian blur operation. Connect the delayed stream to the refPixel and refCtrl input ports, and the earlier stream to the pixel and ctrl input ports.
This waveform diagram shows the input streams, pixelIn
and
refPixelIn
, and their associated control signals. The reference
input frame starts later than the pixelIn
frame. The output signals
show that the block delays pixelIn
to match the reference stream, and
that both output streams share control signals. The waveform shows the short latency
between the input refCtrl
and the output refCtrl
.
In this simulation, to accommodate the delay of four lines between the input streams,
the Maximum number of lines parameter must be set to at least
4.
Examples
Ports
Input
Output
Parameters
Algorithms
The block stores the data from the pixel input port to a circular buffer and then reads the lines out to align with the reference control signals. The block also stores the address of the start of each line. To match the added processing delay of the buffer data path, the block delays the reference pixel data and control signals for around 10 cycles.
The diagram shows the architecture of the block. The RAM Circular Buffer is a memory of
2m pixels, where
m is Maximum number of lines +
log2(Line buffer size). The Line Address
Buffer has Maximum number of lines locations. If the number of
ctrl.Hstart
assertions before the first
refCtrl.Hstart
assertion is greater than the size of the Line
Address Buffer, the block overwrites both buffers and corrupts the output. In this
diagram, Maximum number of lines is four, so four locations exist
to store a line address in the buffer. The Frame Start Buffer is a single location to
store ctrl.Vstart
. The delay between the two streams must be less
than the time between frame starts.
When the input pixel is a vector or a matrix, the block replicates the RAM Circular Buffer for each element. The diagram shows three RAM Circular Buffers, to represent a three-component pixel stream. Each RAM Circular Buffer is 2m memory locations. For multipixel streaming, the block adjusts the line buffer size to store 1/Number of pixels pixels. For instance, with a 4-by-3 input stream, each buffer stores ¼ of the pixels for a line, and there are 12 RAM Circular Buffers, each with 2m-2 locations. The line address buffer remains the same size.