Hi Satyajit,

On Mon, Aug 10, 2026 at 12:50 AM Satyajit Roy <[email protected]> wrote:
> Add a separate output CSC matrix for BT2020 YCbCr limited range. Scale
> luma by 219/255 and chroma by 224/255 while retaining the appropriate
> limited-range offsets. Keep the existing matrix unchanged for full
> range.

I submitted a patch series about a week ago addressing the same issue:
https://lists.freedesktop.org/archives/amd-gfx/2026-August/149741.html

The patch specifically addressing the same matrix as yours is:
https://lists.freedesktop.org/archives/amd-gfx/2026-August/149739.html

This issue also affects DCE as the incorrect matrix was copied there
too. The full-range matrix that was retained is incorrect because
it has a limited-range offset for luma (0x0201).

Why did you use 8-bit normalization?  Other similar nearby matrices
have been derived for 10-bit quantization with 1023 as the denominator:

COLOR_SPACE_RGB_LIMITED_TYPE
COLOR_SPACE_YCBCR601_TYPE
COLOR_SPACE_YCBCR709_TYPE

and in DCE:

COLOR_SPACE_2020_RGB_LIMITEDRANGE

As an example, COLOR_SPACE_YCBCR601_TYPE and COLOR_SPACE_YCBCR709_TYPE
both use 0x0E04 for the R-to-Cr and B-to-Cb coefficients:
  Round((0.5 * 896 / 1023) * 8192) = 0x0E04

Your matrix using 8-bit normalization:
  Round((0.5 * 224 / 255) * 8192)  = 0x0E0E

Thanks,
Nathan

Reply via email to