Skip to content

Incorrect clipping for high dynamic range mastering display color volume metadata #372

@palexander-14

Description

@palexander-14

inline mfxStatus CheckAndFixMasteringDisplayColourVolumeInfo(mfxExtMasteringDisplayColourVolume* pMDCV)
{
mfxU32 changed = 0;
changed += CheckOrZero<mfxU16, MFX_PAYLOAD_OFF, MFX_PAYLOAD_IDR>(pMDCV->InsertPayloadToggle);
changed += CheckMaxOrClip(pMDCV->WhitePointX, 50000u);
changed += CheckMaxOrClip(pMDCV->WhitePointY, 50000u);
changed += CheckMaxOrClip(pMDCV->DisplayPrimariesX[0], 50000u);
changed += CheckMaxOrClip(pMDCV->DisplayPrimariesX[1], 50000u);
changed += CheckMaxOrClip(pMDCV->DisplayPrimariesX[2], 50000u);
changed += CheckMaxOrClip(pMDCV->DisplayPrimariesY[0], 50000u);
changed += CheckMaxOrClip(pMDCV->DisplayPrimariesY[1], 50000u);
changed += CheckMaxOrClip(pMDCV->DisplayPrimariesY[2], 50000u);
return changed ? MFX_WRN_INCOMPATIBLE_VIDEO_PARAM : MFX_ERR_NONE;
}

The implemented clipping of primary_chromaticity/display_primaries parameters is incorrect as it limits primary_chromaticity_y to the value of 0.762940, but it must be the 0.840000 (according to the range derived from AVC/HEVC/VVC specs).
To meet this requirement the upper limit of DisplayPrimariesY must be at least 55050.

Related specs:
https://aomediacodec.github.io/av1-spec/#metadata-high-dynamic-range-mastering-display-color-volume-semantics
D.2.29 of Rec. ITU-T H.264 (V15) (08/2024), dl link

BTW, AV1 specification does not set limits for HDR MDCV values (other than those determined by syntax).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions