Video and Image Processing Suite User Guide

ID 683416
Date 2/12/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

16.2. Triple Buffering

For triple-buffering, the IP core uses three frame buffers in external RAM.

  • The writer uses one buffer to store input pixels.
  • The reader locks the second buffer that reads the output pixels from the memory.
  • The third buffer is a spare buffer that allows the input and the output sides to swap buffers asynchronously. The spare buffer can be clean or dirty.
    • Considered clean if it contains a fresh frame that has not been sent.
    • Considered dirty if it contains an old frame that has already been sent by the reader component.

When the writer completes 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 becomes the new spare buffer and is clean because it contains a fresh frame.
  • If the spare buffer is already clean when the writer completes writing the current input frame:
    • If dropping frames is allowed—the writer drops the newly received frame and overwrites its buffer with the next incoming frame.
    • If dropping frames is not allowed—the writer stalls until the reader completes its frame and replaces the spare buffer with a dirty buffer.

When the reader completes reading and produces a frame from memory, it swaps its buffer with the spare buffer if the spare buffer is clean.

  • The buffer locked by the reader 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 completes the current output frame:
    • If repeating frames is allowed—the reader immediately repeats the frame that has just been sent.
    • If repeating frames is not allowed—the reader stalls until the writer completes its frame and replaces the spare buffer with a clean buffer.