User Tools

This is an old revision of the document!


YUV 4:4:4 UVC Gamma Correction

At this stage of the imaging pipeline the pixel data is already represented in full-range YCbCr 4:4:4 color space with 12-bit precision per component, as produced by the RGB-to-YCbCr conversion stage (gen5-rgb-to-yuv).

The purpose of this block is to apply UVC gamma correction to the luma component while leaving chroma components unmodified.

This block is intended to be implemented in FPGA logic and therefore avoids runtime floating-point arithmetic.

Input format

The input consists of YCbCr pixels with the following properties:

\[ Y12 \in [0..4095]\\ C_b12 \in [0..4095]\text{, neutral at }2048\\ C_r12 \in [0..4095]\text{, neutral at }2048 \]

All values are unsigned 12-bit integers.

Output format

The output format is identical to the input format:

\[ Y12^{\gamma} \in [0..4095]\\ C_b12^{\gamma} = C_b12\\ C_r12^{\gamma} = C_r12 \]

Only the luma component is modified by the gamma correction stage.

Step 1: UVC gamma transfer function

Gamma correction is applied only to the luma component \(Y12\). The chroma components \(C_b12\) and \(C_r12\) are passed through unchanged.

The UVC gamma transfer function is defined in the following document: UVC Gamma Correction Specification

No additional interpretation or modification of the transfer function is performed at this stage.

Step 2: LUT-based FPGA implementation

For FPGA implementation, the UVC gamma correction shall be realized using a LUT with 4096 entries, indexed by the 12-bit luma value.

Each LUT entry maps a 12-bit input luma value to a 12-bit output luma value:

Y_in  = i                       // i in range [0..4095]
Y_out = LUT[i]                  // gamma-corrected luma

Step 3: LUT generation tool

To simplify and standardize LUT generation, the following online tool may be used: Sub2r Gamma LUT Generator

The tool generates FPGA-ready gamma tables compatible with a 12-bit input and 12-bit output pipeline.

Step 4: pixel reconstruction

For each pixel, the output components are constructed as:

\[ Y12^{\gamma} = LUT[Y12]\\ C_b12^{\gamma} = C_b12\\ C_r12^{\gamma} = C_r12 \]

No additional scaling, offsetting, or clamping is required beyond the LUT bounds.

Notes

* This block operates entirely in YCbCr space. * Gamma correction is applied only to luma. * Chroma components are passed through unchanged. * The LUT-based design ensures deterministic, low-latency FPGA implementation. * This stage assumes full-range (computer-range) YCbCr coding.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information