User guide

Table Of Contents
3–18 Chapter 3: Interfaces
Avalon-MM Slave Interfaces
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
Most Video and Image Processing Suite MegaCore functions with a slave interface
read and propagate non-image data packets from the input stream until the image
data header (0) of an image data packet has been received. The status bit is then set to
0 and the MegaCore function waits until the
Go
bit is set to 1 if it is not already. Once
the
Go
bit is set to 1, the MegaCore function buffers control data, sets its status bit back
to 1 and starts processing image data.
1 There is a small amount of buffering at the input of each Video and Image Processing
Suite MegaCore function and you must expect that a few samples are read and stored
past the image data header even if the function is stalled.
You can use the
Go
and
Status
registers in combination to synchronize changes in
control data to the start and end of frames. For example, suppose you want to build a
system with a Gamma Corrector MegaCore function where the gamma look-up table
is updated between each video frame.
You can build logic (or program a Nios
®
II processor) to control the gamma corrector
as follows:
1. Set the
Go
bit to zero. This causes the MegaCore function to stop processing at the
end of the current frame.
2. Poll the
Status
bit until the MegaCore function sets it to zero. This occurs at the
end of the current frame, after the MegaCore function has stopped processing
data.
3. Update the gamma look-up table.
4. Set the
Go
bit to one. This causes the MegaCore function to start processing the
next frame.
5. Poll the
Status
bit until the MegaCore function sets it to one. This occurs when the
MegaCore function has started processing the next frame (and therefore setting
the
Go
bit to zero causes it to stop processing at the end of the next frame).
6. Repeat steps 1 to 5 until all frames are processed.
This procedure ensures that the update is performed exactly once per frame and that
the MegaCore function is not processing data while the update is performed. When
using MegaCore functions which double-buffer control data, such as the Alpha
Blending Mixer, a more simple process may be sufficient:
1. Set the
Go
bit to zero. This causes the MegaCore function to stop if it gets to the end
of a frame while the update is in progress.
2. Update the control data.
3. Set the
Go
bit to one.
The next time a new frame is started after the
Go
bit is set to one, the new control
data is loaded into the MegaCore function.
The reading on non-video packets is performed by handling any packet until one
arrives with type 0. This means that when the
Go
bit is checked, the non-video type
has been taken out of the stream but the video is retained.