A source frame is:
- 8, 10, or 12-bit semi-planar YCbCr, for 4:2:0 and 4:2:2, in raster order.
- 8, 10 or 12-bit planar YCbCr, for 4:4:4, in raster order.
- 8, 10, or 12-bit 32x4 or 64x4 uncompressed tiled format (semi-planar for 4:2:0 and 4:2:2, planar for 4:4:4).
10, 12-bit pixel components in raster order are stored as little endian in 2 bytes, can be left aligned (highest bit aligning to bit position 15, or right aligned (lowest bit aligning to bit position 0).
Pixel components are packed in tiled formats per 4x4 block.
Separate buffer pointers are to be provided for luma and chroma pixel components. For semi-planar, U and V components are interleaved, first U then V. For 4:2:2 the luma buffer and interleaved chroma buffer are the same size; with a U and V sample for two Y samples horizontally. For 4:2:0 the interleaved chroma buffer is half the size, as it is vertically subsampled also. For 4:4:4 there are separate buffers for U and V that are the same size as the luma buffer.
Source frame buffers must be aligned to a 32-byte boundary.
The frame buffer width in number of bytes (pitch) can be larger than the frame width. When the pitch is greater than the frame width, pixel components in each line beyond the picture width are ignored, as illustrated in preceding figure. The pitch must be a multiple of 32 bytes. For tiled formats, the pitch is the address offset between two consecutive rows of tiles and must be a multiple of 32 (the control software always uses 64).
The tiles are either 32x4 or 64x4. 64x4 tiles provide slightly better bandwidth savings than 32x4 tiles, or slightly better quality in lossy compression mode. Tiles can be either compressed or uncompressed, but the start address of a tile is the same in each case. Each tile would be compressed independently. An additional map buffer is used holding metadata for each tile.
Pixel components in tiles are fully packed resulting in:
- 128 bytes for an 8-bit 32x4 tile and 256 bytes for 64x4
- 160 bytes for a 10-bit 32x4 tile and 320 bytes for 64x4
- 192 bytes for a 12-bit 32 x4 tile and 384 bytes for 64x4
The packing is shown in the following figure. With 10-bit pixel components, for 4 pixels, 5 bytes are used for a component, after which the packing pattern repeats. With 12-bit pixel components, for 4 pixels, 6 bytes are used for a component; the packing pattern repeats every 3 bytes.
For 10-bit and 12-bit, pixel components are stored in little endian order in memory. The first byte of a tile has the lower 8-bit of the sample, and the second byte the 2 (or 4) upper bits.