Interactive 3D visualization comparing RGBA and NV12 pixel memory layouts for graphics programming
Each pixel's 4 channels are tightly packed together, requiring only one contiguous memory access to read a single pixel.
Luminance (Y) and chrominance (UV) are stored separately. UV is downsampled 2x2, with 4 pixels sharing one set of chroma values.
The Memory Layout Visualizer is an educational tool designed for graphics programmers, video engineers, and developers working with image and video processing. It provides an interactive 3D visualization of how pixel data is organized in memory for two common formats: RGBA and NV12.
RGBA (Red-Green-Blue-Alpha) is a pixel-packed format where all four color channels for each pixel are stored together sequentially. This makes it straightforward to access individual pixels but requires more memory bandwidth. NV12 is a planar format that separates luminance (Y) and chrominance (UV) data, with the chroma channels downsampled by a factor of 2 in both dimensions.
Understanding these memory layouts is crucial for optimizing graphics pipelines, video codecs, and image processing algorithms. The NV12 format can save up to 62.5% bandwidth compared to RGBA by exploiting the human visual system's lower sensitivity to color detail, making it ideal for video streaming and mobile applications where memory bandwidth is limited.