Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

[Decode] Add flag for HEVCd HDR SEI parsing result #2914

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions _studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,12 +1395,23 @@ void VideoDECODEH265::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
dispaly_colour->WhitePointY = (mfxU16)pFrame->m_mastering_display.SEI_messages.mastering_display.white_point[1];
dispaly_colour->MaxDisplayMasteringLuminance = (mfxU32)pFrame->m_mastering_display.SEI_messages.mastering_display.max_luminance;
dispaly_colour->MinDisplayMasteringLuminance = (mfxU32)pFrame->m_mastering_display.SEI_messages.mastering_display.min_luminance;
dispaly_colour->InsertPayloadToggle = MFX_PAYLOAD_IDR;
}
else if (dispaly_colour)
{
dispaly_colour->InsertPayloadToggle = MFX_PAYLOAD_OFF;
}

mfxExtContentLightLevelInfo* content_light = (mfxExtContentLightLevelInfo*)GetExtendedBuffer(surface_out->Data.ExtParam, surface_out->Data.NumExtParam, MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO);
if (content_light && pFrame->m_content_light_level_info.payLoadSize > 0)
{
content_light->MaxContentLightLevel = (mfxU16)pFrame->m_content_light_level_info.SEI_messages.content_light_level_info.max_content_light_level;
content_light->MaxPicAverageLightLevel = (mfxU16)pFrame->m_content_light_level_info.SEI_messages.content_light_level_info.max_pic_average_light_level;
content_light->InsertPayloadToggle = MFX_PAYLOAD_IDR;
}
else if (content_light)
{
content_light->InsertPayloadToggle = MFX_PAYLOAD_OFF;
}

}
Expand Down
2 changes: 2 additions & 0 deletions doc/mediasdk-man.md
Original file line number Diff line number Diff line change
Expand Up @@ -5229,6 +5229,7 @@ typedef struct {
**Description**

The `mfxExtMasteringDisplayColourVolume` configures the HDR SEI message. If application attaches this structure to the [mfxEncodeCtrl](#mfxEncodeCtrl) at [runtime](#MFXVideoENCODE_EncodeFrameAsync), the encoder inserts the HDR SEI message for current frame and ignores `InsertPayloadToggle`. If application attaches this structure to the [mfxVideoParam](#mfxVideoParam) during [initialization](#MFXVideoENCODE_Init) or [reset](#MFXVideoENCODE_Reset), the encoder inserts HDR SEI message based on `InsertPayloadToggle`. Fields semantic defined in ITU-T* H.265 Annex D.
If application attaches this structure to the [mfxFrameSurface1](#mfxFrameSurface) at [runtime](#MFXVideoDECODE_DecodeFrameAsync) for HDR SEI parsing, the decoder sets `InsertPayloadToggle` to `MFX_PAYLOAD_IDR` if there exist MasteringDisplayColourVolume in the current frame. Otherwise the decoder sets `InsertPayloadToggle` to `MFX_PAYLOAD_OFF`.

**Members**

Expand Down Expand Up @@ -5261,6 +5262,7 @@ typedef struct {
**Description**

The `mfxExtContentLightLevelInfo` structure configures the HDR SEI message. If application attaches this structure to the [mfxEncodeCtrl](#mfxEncodeCtrl) structure at [runtime](#MFXVideoENCODE_EncodeFrameAsync), the encoder inserts the HDR SEI message for current frame and ignores `InsertPayloadToggle`. If application attaches this structure to the [mfxVideoParam](#mfxVideoParam) structure during [initialization](#MFXVideoENCODE_Init) or [reset](#MFXVideoENCODE_Reset), the encoder inserts HDR SEI message based on `InsertPayloadToggle`. Fields semantic defined in ITU-T* H.265 Annex D.
If application attaches this structure to the [mfxFrameSurface1](#mfxFrameSurface) at [runtime](#MFXVideoDECODE_DecodeFrameAsync) for HDR SEI parsing, the decoder sets `InsertPayloadToggle` to `MFX_PAYLOAD_IDR` if there exist MasteringDisplayColourVolume in the current frame. Otherwise the decoder sets `InsertPayloadToggle` to `MFX_PAYLOAD_OFF`.

**Members**

Expand Down