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

18–2 Chapter 18: Frame Buffer MegaCore Function
Functional Description
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
A double-buffer is typically used when the frame rate is the same both at the input
and at the output sides but the pixel rate is highly irregular at one or both sides.
A double-buffer is often used when a frame has to be received or sent in a short period
of time compared with the overall frame rate. For example, after the Clipper
MegaCore function or before one of the foreground layers of the Alpha Blending
Mixer MegaCore function.
When triple-buffering is in use, three frame buffers are used in external RAM. As was
the case in double-buffering, the reader and the writer components are always locking
one buffer to respectively store input pixels to memory and read output pixels from
memory. The third frame buffer is a spare buffer that allows the input and the output
sides to swap buffers asynchronously. The spare buffer is considered clean if it
contains a fresh frame that has not been output, or dirty if it contains an old frame that
has already been sent by the reader component.
When the writer has finished storing a frame in memory, it swaps its buffer with the
spare buffer if the spare buffer is dirty. The buffer locked by the writer component
becomes the new spare buffer and is clean because it contains a fresh frame. If the
spare buffer is already clean when the writer has finished writing the current input
frame and if dropping frames is allowed, then the writer drops the frame that has just
been received and overwrites its buffer with the next incoming frame. If dropping
frames is not allowed, the writer component stalls until the reader component has
finished its frame and replaced the spare buffer with a dirty buffer.
Similarly, when the reader has finished reading and has output a frame from memory,
it swaps its buffer with the spare buffer if the spare buffer is clean. The buffer locked
by the reader component becomes the new spare buffer and is dirty because it
contains an old frame that has been sent previously. If the spare buffer is already dirty
when the reader has finished the current output frame and if repeating frames are
allowed, the reader immediately repeats the frame that has just been sent. If repeating
frames is not allowed, the reader component stalls until the writer component has
finished its frame and replaced the spare buffer with a clean buffer.
Triple-buffering therefore allows simple frame rate conversion to be performed when
the input and the output are pushing and pulling frames at different rates.
Locked Frame Rate Conversion
With the triple-buffering algorithm described previously, the decision to drop and
repeat frames is based on the status of the spare buffer. Because the input and output
sides are not tightly synchronized, the behavior of the Frame Buffer is not completely
deterministic and can be affected by the burstiness of the data in the video system.
This may cause undesirable glitches or jerky motion in the video output, especially if
the data path contains more than one triple buffer.
By controlling the dropping/repeating behavior, the input and output can be kept
synchronized. To control the dropping/repeating behavior and to synchronize the
input and output sides, you must select triple-buffering mode and turn on Run-time
control for locked frame rate conversion in the Parameter Settings tab of the
parameter editor. The input and output rates can be selected and changed at run time.
Using the slave interface, it is also possible to enable or disable synchronization at run
time to switch between the user-controlled and flow-controlled triple-buffering
algorithms as necessary.