Source Frame Format - 2024.1 English

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

Document ID
PG252
Release Date
2024-05-30
Version
2024.1 English

The source frame buffer contains the input frame pixels. It contains two parts: luminance pixels (Luma) followed by chrominance pixels (Chroma). Luma pixels are stored in pixel raster scan order, shown in the following figure. Chroma pixels are stored in an U/V-interleaved pixel raster scan order. Therefore, the Chroma portion is half the size of the Luma portion when using a 4:2:0 format and the same size as the Luma portion when using a 4:2:2 format. The encoder picture buffer must be one contiguous memory region.

Note: The VCU accepts semi-planar data.
Figure 1. Frame Layout

Two packing formats are supported in external memory: 8 bits per component or 10 bits per component, shown in the following tables. The 8-bit format can only be used for an 8-bit component depth and the 10-bit format can only be used for a 10-bit component depth.

Table 1. Source Frame Buffer Format with 8-bit Component Format
255 248 ... 31 24 23 16 15 8 7 0
Yx+31,y ... Yx+3,y Yx+2,y Yx+1,y Yx,y
...(all Luma in pixel raster scan order)...
255 248 247 240 ... 31 24 23 16 15 8 7 0
Vx+15,y Ux+15,y ... Vx+1,y Ux+1,y Vx,y Ux,y
...(all interleaved Chroma in pixel raster scan order)...
Table 2. Source Frame Buffer Format with 10-bit Component Format
255 254 253 244   31 30 29 20 19 10 9 0
0 0 Vx+23,y   0 0 Yx+2,y Yx+1,y Yx,y
...(all Luma in pixel raster scan order)...
255 254 253 244 ... 63 62 61 52 51 42 41 32 31 30 29 20 19 10 9 0
0 0 Vx+11,y ... 0 0 Vx+2,y Ux+2,y Vx+1,y 0 0 Ux+1,y Vx,y Ux,y
...(all interleaved Chroma in pixel raster scan order)...

The encoder buffer must be one contiguous memory region and should be aligned to a 32-byte boundary.

The frame buffer width (pitch) can be larger than the frame width. When the pitch is greater than the frame width, pixels in each line beyond the picture width are ignored, as illustrated in the following figure.

Figure 2. Frame Buffer Pitch

Note: Encoder input buffers width and height should be in multiple of 32. Decoder output buffers width is in multiple of 256-byte. Height is in multiples of 64. For example, for 1920x1080 resolution, the decoder output is 2048x1088.