Main Content

Pixel Stream FIFO

Buffer input stream to create image lines that have contiguous valid pixels

  • Library:
  • Vision HDL Toolbox / Utilities

  • Pixel Stream FIFO block


The Pixel Stream FIFO block stores incoming valid pixels and accompanying control signals and returns the same pixel stream without gaps between the valid pixels of each line. The block preserves the total line size and total frame size of the video stream, including invalid cycles.

Use the Pixel Stream FIFO block to buffer video sources. The waveform shows a direct memory access (DMA) video source, where pixels are read in bursts, and a Camera Link® video source, where pixels are valid every second clock cycle. To create contiguous video lines, a Pixel Stream FIFO block buffers the input pixels and control signals of each source.


This block uses a streaming pixel interface with a bus for frame control signals. This interface enables the block to operate independently of image size and format. The pixel ports on this block support single pixel streaming or multipixel streaming. Single pixel streaming accepts and returns a single pixel value each clock cycle. Multipixel streaming accepts and returns 4 or 8 pixels per clock cycle to support high-frame-rate or high-resolution formats. Along with the pixel, the block accepts and returns a pixelcontrol bus that contains five control signals. The control signals indicate the validity of each pixel and their location in the frame. For multipixel streaming, one set of control signals applies to all four or eight pixels in the vector. To convert a frame (pixel matrix) into a serial pixel stream and control signals, use the Frame To Pixels block. For a full description of the interface, see Streaming Pixel Interface.

This block also supports multipixel-multicomponent streams, where the pixel input is a matrix of M-by-N values, where M is number of pixels and N is number of components. These values correspond to the Number of pixels and Number of components parameters of the Frame To Pixels block.


expand all

For scalar pixel streams, specify pixel as a scalar or a vector of 1-by-Number of components values. For multipixel streams, specify pixel as a matrix of Number of pixels-by-Number of components pixel intensity values.

double and single data types are supported for simulation, but not for HDL code generation.

Data Types: fixed point | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | double | single

The pixelcontrol bus contains five signals. The signals describe the validity of the pixel and its location in the frame. For more information, see Pixel Control Bus.

For multipixel streaming, each vector of pixel values has one set of control signals. Because the vector has only one valid signal, the pixels in the vector must be either all valid or all invalid. The hStart and vStart signals apply to the pixel with the lowest index in the vector. The hEnd and vEnd signals apply to the pixel with the highest index in the vector.

Data Types: bus


expand all

Each line of the output stream has contiguous valid pixels. The dimensions and data type of the output pixel stream match those of the input pixel stream. The block returns the output pixel stream as a scalar, a vector of 1-by-Number of components values, or a matrix of Number of pixels-by-Number of components values.

Control signals accompanying pixel stream, returned as a pixelcontrol bus containing five signals. The signals indicate the validity of the pixel and its location in the frame. For more information on the signal protocol, see Pixel Control Bus.

The Pixel Stream FIFO block returns each line of pixels with the ctrl.valid signal continuously true between ctrl.hStart and ctrl.hEnd. The block buffers the entire input line before it returns the modified line.

Data Types: bus


expand all

Specify a power of two that accommodates the number of active pixels in a single horizontal line. If you specify a value that is not a power of two, the block uses the next largest power of two.


The Pixel Stream FIFO block contains a memory controller, read and write counters, and two RAMs. One RAM stores the incoming control signals, and the other stores the incoming pixel stream. The block stores valid pixels and their accompanying control signals for each line, as determined by the input ctrl.hStart and ctrl.hEnd signals. The buffering removes any bursty behavior of the input stream. Once a full line of valid pixels is stored, the block returns the new continuous version of the line.

When the input pixel is a vector or a matrix, the block replicates the Pixel RAM for each element. The diagram shows three Pixel RAMs, to represent a three-component pixel stream. 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, so there are 12 Pixel RAMs, each with 2m-2 locations.

Extended Capabilities

Introduced in R2018a