Why does Windows decode AVIF 4:4:4 with matrix_coefficients=0 correctly at 8 bpc but incorrectly at 10/12 bpc?

luoye-cpu 0 Reputation points
2026-11-13T19:58:50.34+00:00

Question

Why does the Windows AVIF decoder handle matrix_coefficients = 0 (MC_IDENTITY, full range) correctly at 8 bits per channel, but produce wrong colours at 10 and 12 bpc? Is the identity path above 8 bpc simply not implemented, or is there a specific input format I should use instead?

What I see

The same image content, encoded twice with identical settings except the bit depth:

  • 8 bpc: correct in Photos, WIC (CopyPixels) and WinRT (BitmapDecoder.GetSoftwareBitmapAsync with Rgba16).
  • 10/12 bpc: a saturated red (255,0,0) comes back as (0,0,126), green (0,255,0) as (254,0,0), blue (0,0,255) as (0,126,0).
  • PSNR against the exact 16-bit source: 7.55 dB (10 bpc) and 7.11 dB (12 bpc), versus 57.16 dB and bit-exact at 8 bpc on the same machine.

What I already ruled out

  • The bitstream is legal. AV1 6.4.2 requires subsampling_x = subsampling_y = 0 when mc = MC_IDENTITY; trace_headers confirms mc=0, ss=0/0, full range, and AVIF adds no identity depth restriction. 10 bpc and 12 bpc 4:4:4 use different profiles (1, and 2 with twelve_bit=1), both legal.
  • The samples are intact. Decoding the 10 bpc file with dav1d to gbrp10le matches the source with max|diff| = 0, exact = 100%.
  • It is not an encoder artefact. avifenc/libyuv and ffmpeg/libaom reproduce it identically.
  • It is not the colour tag. The two files carry different nclx values (1/13/0 and 2/2/0) and fail the same way.

What the wrong output looks like

Single-plane staircase probes decoded as Rgba16 suggest two differences in the path above 8 bpc:

  • plane order: the 8 bpc path maps R=plane2, G=plane0, B=plane1, while the deeper path emits planes in storage order (plane0 to R, plane1 to G, plane2 to B);
  • chroma handling: Cb/Cr behave as signed differences,
out = clamp(v - 2^(bd-1), 0) * 65535 / kmax     // bd = 10 or 12

with the measured intercept exactly at 512 for 10 bpc and 2048 for 12 bpc.

Question

Should 4:4:4 with identity and full range work above 8 bpc on Windows, and if so, is the RGB assembly path for deep bit depths expected to route mc == 0 the same way the 8 bpc path does? I can provide the test files (3.5 KB at 10 bpc, 3.8 KB at 12 bpc) and the exact encoder commands if that helps reproduce.

Environment: Windows 11 Enterprise 10.0.26300 build 26300.9818, AV1 Video Extension 2.0.35.0, HEIF Image Extension 1.2.65.0, Photos 2026.11090.22001.0; software decode on x64.

Windows development | Windows API - Win32

1 answer

Sort by: Newest
  1. Harry Nguyen (WICLOUD CORPORATION) 690 Reputation points Microsoft External Staff Moderator
    2026-11-16T06:20:56.2066667+00:00

    Hi @luoye-cpu , 

    Thank you for the detailed investigation and for providing the additional findings regarding the different AV1 profile signalling paths at 10-bit and 12-bit. 

    1. AV1/AVIF Specifications

    Based on the AV1 specification, the 10-bit and 12-bit 4:4:4 configurations you described use different profile and bit-depth signalling paths. The specification also defines specific color component handling when matrix_coefficients = MC_IDENTITY. 

    For further technical details, you may refer to the AV1 Bitstream Specification, particularly Sections 5.5.2 and 6.4.2, and the AVIF Specification v1.1.0. 

    Please note that these specifications are published by the Alliance for Open Media (AOMedia), an external standards organization. They are provided for technical reference and do not constitute Microsoft's confirmation of Windows decoder capabilities or implementation behavior. 

    2. Windows Decoder Documentation

    On the Windows side, the HEIF extension codec documentation describes the integration with Windows Imaging Component (WIC). However, it does not explicitly document the expected behavior or support limitations for AVIF 4:4:4 with MC_IDENTITY at 10-bit and 12-bit depths. 

    Additionally, Microsoft's IWICBitmapSourceTransform::GetClosestPixelFormat and IWICBitmapSource::GetPixelFormat documentation explain how WIC exposes decoder output pixel formats. However, these APIs do not establish whether a particular AV1 color configuration is fully supported or how its color components are handled internally. 

    Therefore, based on the available public Microsoft documentation, I cannot confirm whether the behavior you observed represents an implementation issue or an unsupported configuration. 

    3. Additional Information for Investigation

    Your findings regarding the channel ordering and chroma offset are particularly helpful, especially since you have already verified lossless decoding using independent decoders and reproduced the behavior with different encoders. 

    To help me investigate this further, please share the following: 

    1. One 10-bit and one 12-bit AVIF sample that reproduce the issue. 
    2. The exact encoder commands used to generate these samples. 
    3. If readily available, the corresponding source image or expected pixel values for comparison. 

    There is no need to repeat the validation steps you have already completed. Having the sample files and encoding parameters would help me examine the reported behavior more closely and determine the appropriate next steps. 

    I hope this helps. If you found my response helpful or informative, you can follow this guidance so others with a similar question can find it more easily. 

    Thank you. 

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.