Skip to content

Commit

Permalink
[Encode] BT2020 enabling on HEVC/AV1 Encode
Browse files Browse the repository at this point in the history
Enable BT2020 support for VDEnc
  • Loading branch information
zhijie-zh authored and intel-mediadev committed Nov 3, 2023
1 parent 5e00dab commit c72d78c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ typedef struct _CODEC_AV1_ENCODE_SEQUENCE_PARAMS
uint32_t DisplayFormatSwizzle : 1; //[0]
uint32_t bLookAheadPhase : 1;
uint32_t HierarchicalFlag : 1;
uint32_t Reserved0 : 26;
uint32_t RGBInputStudioRange : 1; // [0, 1]
uint32_t ConvertedYUVStudioRange : 1; // [0, 1]
uint32_t Reserved0 : 24;
} fields;
uint32_t value;
} SeqFlags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,9 @@ typedef struct _CODEC_HEVC_ENCODE_SEQUENCE_PARAMS
uint32_t RGBEncodingEnable : 1;
uint32_t PrimaryChannelForRGBEncoding : 2;
uint32_t SecondaryChannelForRGBEncoding : 2;
uint32_t : 15; // [0]
uint32_t RGBInputStudioRange : 1;
uint32_t ConvertedYUVStudioRange : 1;
uint32_t : 13; // [0]
};
uint32_t EncodeTools;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,10 @@ MHW_SETPAR_DECL_SRC(VDENC_PIPE_MODE_SELECT, Av1BasicFeature)
params.streamIn = false;
params.randomAccess = !m_ref.IsLowDelay();

params.rgbEncodingMode = m_rgbEncodingEnable;
params.rgbEncodingMode = m_rgbEncodingEnable;
params.bt2020RGB2YUV = m_av1SeqParams->InputColorSpace == ECOLORSPACE_P2020;
params.rgbInputStudioRange = params.bt2020RGB2YUV ? m_av1SeqParams->SeqFlags.fields.RGBInputStudioRange : 0;
params.convertedYUVStudioRange = params.bt2020RGB2YUV ? m_av1SeqParams->SeqFlags.fields.ConvertedYUVStudioRange : 0;
if (m_captureModeEnable)
{
params.captureMode = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ MHW_SETPAR_DECL_SRC(VDENC_PIPE_MODE_SELECT, HevcBasicFeature)
params.chromaType = m_hevcSeqParams->chroma_format_idc;
params.wirelessSessionId = 0;
params.randomAccess = !m_ref.IsLowDelay();
params.bt2020RGB2YUV = m_hevcSeqParams->InputColorSpace == ECOLORSPACE_P2020;
params.rgbInputStudioRange = params.bt2020RGB2YUV ? m_hevcSeqParams->RGBInputStudioRange : 0;
params.convertedYUVStudioRange = params.bt2020RGB2YUV ? m_hevcSeqParams->ConvertedYUVStudioRange : 0;

if (m_captureModeEnable)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ struct _MHW_PAR_T(VDENC_PIPE_MODE_SELECT)
uint8_t wirelessSessionId = 0;
uint8_t tailPointerReadFrequency = 0;
uint8_t streamingBufferConfig = 0;
bool bt2020RGB2YUV = 0;
uint8_t rgbInputStudioRange = 0;
uint8_t convertedYUVStudioRange = 0;
uint8_t VdencPipeModeSelectPar0 = 0;
uint8_t VdencPipeModeSelectPar1 = 0;
uint8_t VdencPipeModeSelectPar2 = 0;
Expand Down

0 comments on commit c72d78c

Please sign in to comment.