NVDEC BT.2020 on h.264 video has bad black/white points

We have a solid NVDEC (cuvid) decoding pipeline that works across hevc and h.264 material.

We have noticed, however, that the Yuv2Rgb conversion matrix when using h.264, 8bit, material that’s has BT.2020 NCL color is rendering incorrectly resulting in more contrast than there should be - most likely because it’s being interpreted in another space.

While I think it’s silly the client has rendered in this space without a 10bit+ environment it’s not an option to re-render it in 709. It’s worth noting that if we disable our hardware pipeline, ffmpeg’s software decode is producing the correct RGB components. Even if that means it’s “wrong.”

We’ve modeled our color conversion after the CUVID examples and notice there, perhaps, wasn’t a means of handling this extended gamma within the 8bit realm? The matrix_coefficients of the video stream come up as ColorSpaceStandard_Unspecified by default when building the video details from the decode session. I’ve tested adjusting that to no success.

I’m posting here in hopes that we just have something backwards in our minds. Any help would be welcome!

Cheers

Well, yes BT.2020-NCL matrix ideally would be using 10 bit color, and then it just works. Still, there is no much issues with using software ffmpeg implementation or even better ffmpeg zscale. 8 bit bt.2020-ncl then works as well.