Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Celio_A_
Beginner
97 Views

Add SPS and VPS Information (UltraHD compatible)

Hi, i like to know how can i add SPS and VPS information to be compatible with UltraHD specification, follow strict requirements

The following fields in SPS shall have the following pre-determined values.

 general_profile_space shall be set to “0”.

 sps_temporal_id_nesting_flag shall be set to “1”.

 colour_description_present_flag shall be set to “1”.

 chroma_format_idc shall be set to “1”.

 vui_parameters_present_flag shall be set to “1” (VUI parameters shall be present).

 aspect_ratio_info_present_flag in VUI parameters shall be set to “1”.

 vui_hrd_parameters_present_flag in VUI parameters shall be set to “1”.

 vui_timing_info_present_flag in VUI parameters shall be set to “1”.

 nal_hrd_parameters_present_flag in VUI parameters shall be set to “1”.

 sub_pic_hrd_params_present_flag in VUI parameters shall be set to “0”.

 fixed_pic_rate_general_flag in HRD parameters shall be set to “1”.

 overscan_appropriate_flag should be set to “0” if overscan_info_present_flag is set to 1.

 bit_depth_luma_minus8 shall be set to “2”.

 bit_depth_chroma_minus8 shall be set to “2”.

• The following fields in PPS shall have the following pre-determined values.

 dependent_slice_segments_enabled_flag shall be set to “0”. • Only progressive source is used and all pictures shall be encoded as a frame.

 general_progressive_source_flag in SPS shall be set to “1”.

 general_interlaced_source_flag in SPS shall be set to “0”.

 general_frame_only_constraint_flag in SPS shall be set to “1”.

• The no_output_of_prior_pics_flag shall be set to “0”. • The following fields in VPS shall have the following pre-determined values.

 vps_temporal_id_nesting_flag shall be set to 1.

 general_profile_space shall be set to 0.

 general_profile_idc shall be set to 2.

 general_tier_flag shall be set to 1.

 general_level_idc shall be set to 153.

 general_progressive_source_flag shall be set to “1”.

 general_interlace_source_flag shall be set to “0”.

 general_frame_only_constraint_flag shall be set to “1”.

 fixed_pic_rate_general_flag in HRD parameters, if present, shall be set to “1”

Thats all if someone from Intel can help me out

0 Kudos
5 Replies
Mark_L_Intel1
Moderator
97 Views

Hi Celio,

Is this for H.264 or HEVC?

Mark

Celio_A_
Beginner
97 Views

These are needed for UltraHD and HD Hevc encoding

Mark_L_Intel1
Moderator
97 Views

Hi Celio,

This are operations happen at the hardware level, I have to check internally and get back to you.

Please don't hesitate to ping me from forum if you didn't get the answer.

Mark

Dmitry_E_Intel
Employee
97 Views

If you need VPS/SPS/PPS have some specific values then there are two options.

1) You may adjust values in mfxVideoParam passed to MFXVideoENCODE_Init() function so that the encoder generates VPS/SPS/PPS which you need. Here is the code how HEVC encoder builds VPS/SPS/PPS from mfxVideoParams:  https://github.com/Intel-Media-SDK/MediaSDK/blob/ac85bb6730bbd7b19a81e598a18e702fe1c7d898/_studio/he...

2) The second option (I guess it will suite better) is to use mfxExtCodingOptionVPS/mfxExtCodingOptionSPSPPS. 

From MediaSDK manual:

mfxExtCodingOptionSPSPPS
Definition

struct {

  mfxExtBuffer Header;
  mfxU8 *SPSBuffer;
  mfxU8 *PPSBuffer;
  mfxU16 SPSBufSize;
  mfxU16 PPSBufSize;
  mfxU16 SPSId;
  mfxU16 PPSId;
} mfxExtCodingOptionSPSPPS;

Description
Attach this structure as part of the extended buffers to configure the SDK encoder during MFXVideoENCODE_Init. ... 

The SDK encoder imports parameters from these buffers. If the encoder does not support the specified parameters, the encoder does not initialize and returns the status code MFX_ERR_INCOMPATIBLE_VIDEO_PARAM.

 

In other words if you needs VPS/SPS/PPS have some specific pre-defined values you can provide VPS/SPS/PPS in a bitstream format to MFXVideoENCODE_Init functions, then MediaSDK encoder will initialize from these provided buffers and final encoded bistream will contain VPS/SPS/PPS with values you prefer. You can use example of code from https://github.com/Intel-Media-SDK/MediaSDK/blob/ac85bb6730bbd7b19a81e598a18e702fe1c7d898/_studio/he... to generate VPS/SPS/PPS. 

 

Regards,

Dmitry

VASILY_V_
Beginner
97 Views

Hi, Dmitry E.

We've tried to use MFXVideoENCODE_Init with SPS VPS PPS from other source but getting MFX_ERR_INCOMPATIBLE_VIDEO_PARAM. Also this functions works perfectly with structures already generated from Media SDK.

Is there any way how to deal with it? Maybe to find out which parameters are not accepted by MediaSDK or maybe ask MediaSDK to fix some of them? So to generate stream close enough to original, but not identical.

Thanks