Encoder Buffer - 2023.1 English

H.264/H.265 Video Codec Unit v1.2 Solutions LogiCORE IP Product Guide (PG252)

Document ID
PG252
Release Date
2023-05-16
Version
2023.1 English

The buffer memory controller of the encoder block manages the read and write access to the encoder buffer, which stores pixel data from the reference frames. It pre-fetches data blocks from the reference frames in the system memory and stores them in the encoder buffer. The encoder buffer stores Luma and Chroma pixels from the reference frames so that they are present in the buffer when needed by the encoder. The encoder buffer must be one contiguous memory access (CMA) buffer and should be aligned to a 32-byte boundary. Refer to the Zynq UltraScale+ MPSoC Data Sheet: Overview (DS891) to see the device memory available per EV device.

Calculate the system bandwidth in total derated based on memory controller efficiency for the required access pattern. Enable the Encoder Buffer if the calculated bandwidth is insufficient.

The optional encoder buffer can be used to reduce the memory bandwidth. This option can slightly reduce the video quality. See the CacheLevel2 in Table 1 for more information. Aside from the size, there are no user controls for tuning the Encoder buffer usage.

Note: To enable the Encoder buffer, pass the prefetch-buffer parameter into the GStreamer pipeline that utilizes the hardware. For example:
gst-launch-1.0 videotestsrc ! omxh265enc prefetch-buffer=true ! fakesink
Table 1. Available Device Memory
  ZU4EV ZU5EV ZU7EV
Block RAM (MB) 0.56 0.63 1.37
UltraRam (MB) 1.68 2.25 3.37
Important: Using the Encoder block buffer reduces the external DDR memory bandwidth requirement. Refer to Customizing and Generating the Core for more information regarding memory bandwidth requirements.

The required encoder buffer memory size for 4:2:0 and 4:2:2 sampling formats are shown in the following tables.

Table 2. Encoder Buffer Memory Requirements for 4:2:0 Sampling
Encoder Configuration 1920×1080 3840×2160
8 bpc 8 bpc 10 bpc
B-frame=NONE Motion Vector Range=LOW 105 KB 291 KB 364 KB
B-frame=STANDARD Motion Vector Range=MEDIUM 395 KB 1,128 KB 1,410 KB
B-frame=HIERARCHICAL Motion Vector Range=HIGH 761 KB 2,250 KB 2,813 KB
Table 3. Encoder Buffer Memory Requirements for 4:2:2 Sampling
Encoder Configuration 1920×1080 3840×2160
8 bpc 8 bpc 10 bpc
B-frame=NONE Motion Vector Range=LOW 139 KB 388 KB 485 KB
B-frame=STANDARD Motion Vector Range=MEDIUM 526 KB 1,504 KB 1,880 KB
B-frame=HIERARCHICAL Motion Vector Range=HIGH 1,014 KB 3,000 KB 3,750 KB
Note: To find the most precise frame buffer size, use the Advance Configuration > Resource Summary menu option in the VCU GUI.