mfxExtCodingOption2

Definition

 

typedef struct {

    mfxExtBuffer Header;

 

    mfxU16      IntRefType;

    mfxU16      IntRefCycleSize;

    mfxI16      IntRefQPDelta;

 

    mfxU32      MaxFrameSize;

    mfxU32      MaxSliceSize;

 

    mfxU16      BitrateLimit;           /* tri-state option */

    mfxU16      MBBRC;                  /* tri-state option */

    mfxU16      ExtBRC;                 /* tri-state option */

    mfxU16      LookAheadDepth;

    mfxU16      Trellis;

    mfxU16      RepeatPPS;              /* tri-state option */

    mfxU16      BRefType;

    mfxU16      AdaptiveI;              /* tri-state option */

    mfxU16      AdaptiveB;              /* tri-state option */

    mfxU16      LookAheadDS;

    mfxU16      NumMbPerSlice;

    mfxU16      SkipFrame;

    mfxU8       MinQPI;                 /* 1..51, 0 = default */

    mfxU8       MaxQPI;                 /* 1..51, 0 = default */

    mfxU8       MinQPP;                 /* 1..51, 0 = default */

    mfxU8       MaxQPP;                 /* 1..51, 0 = default */

    mfxU8       MinQPB;                 /* 1..51, 0 = default */

    mfxU8       MaxQPB;                 /* 1..51, 0 = default */

    mfxU16      FixedFrameRate;         /* tri-state option */

    mfxU16      DisableDeblockingIdc;

    mfxU16      DisableVUI;

    mfxU16      BufferingPeriodSEI;

    mfxU16      EnableMAD;              /* tri-state option */

    mfxU16      UseRawRef;              /* tri-state option */

} mfxExtCodingOption2;

Description

 

The mfxExtCodingOption2 structure together with mfxExtCodingOption structure specifies additional options for encoding.

The application can attach this extended buffer to the mfxVideoParam structure to configure initialization and to the mfxEncodeCtrl during runtime.

Members

 

Header.BufferId

Must be MFX_EXTBUFF_CODING_OPTION2.

 

IntRefType

Specifies intra refresh type. The major goal of intra refresh is improvement of error resilience without significant impact on encoded bitstream size caused by I frames. The SDK encoder achieves this by encoding part of each frame in refresh cycle using intra MBs. Zero value means no refresh. One means vertical refresh, by column of MBs. This parameter is valid only during initialization. When used with temporal scalability, intra refresh applied only to base layer.

 

IntRefCycleSize

Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are invalid values. This parameter is valid only during initialization

 

IntRefQPDelta

Specifies QP difference for inserted intra MBs. This is signed value in [-51, 51] range. This parameter is valid during initialization and runtime. 

 

MaxFrameSize

Specify maximum encoded frame size in byte. This parameter is used in AVBR and VBR bitrate control modes and ignored in others. The SDK encoder tries to keep frame size below specified limit but minor overshoots are possible to preserve visual quality. This parameter is valid during initialization and runtime. 

 

MaxSliceSize

Specify maximum slice size in bytes. If this parameter is specified other controls over number of slices are ignored.

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

 

BitrateLimit

Turn off this flag to remove bitrate limitations imposed by the SDK encoder. This flag is intended for special usage models and usually the application should not set it. Setting this flag may lead to violation of HRD conformance and severe visual artifacts. See the CodingOptionValue enumerator for values of this option. The default value is ON, i.e. bitrate is limitted. This parameter is valid only during initialization. 

 

MBBRC

Setting this flag enables macroblock level bitrate control that generally improves subjective visual quality. Enabling this flag may have negative impact on performance and objective visual quality metric. See the CodingOptionValue enumerator for values of this option. The default value depends on target usage settings.

 

ExtBRC

Deprecated.

 

LookAheadDepth

Specifies the depth of look ahead rate control algorithm. It is the number of frames that SDK encoder analyzes before encoding. Valid value range is from 10 to 100 inclusive. To instruct the SDK encoder to use the default value the application should zero this field.

 

Trellis

This option is used to control trellis quantization in AVC encoder. See TrellisControl enumerator for possible values of this option. This parameter is valid only during initialization.

 

RepeatPPS

This flag controls picture parameter set repetition in AVC encoder. Turn ON this flag to repeat PPS with each frame. See the CodingOptionValue enumerator for values of this option. The default value is ON. This parameter is valid only during initialization.

 

BRefType

This option controls usage of B frames as reference. See BRefControl enumerator for possible values of this option. This parameter is valid only during initialization.

 

AdaptiveI

This flag controls insertion of I frames by the SDK encoder. Turn ON this flag to allow changing of frame type from P and B to I. This option is ignored if GopOptFlag in mfxInfoMFX structure is equal to MFX_GOP_STRICT. See the CodingOptionValue enumerator for values of this option. This parameter is valid only during initialization.

 

AdaptiveB

This flag controls changing of frame type from B to P. Turn ON this flag to allow such changing. This option is ignored if GopOptFlag in mfxInfoMFX structure is equal to MFX_GOP_STRICT. See the CodingOptionValue enumerator for values of this option. This parameter is valid only during initialization.

 

LookAheadDS

This option controls down sampling in look ahead bitrate control mode. See LookAheadDownSampling enumerator for possible values of this option. This parameter is valid only during initialization.

 

NumMbPerSlice

This option specifies suggested slice size in number of macroblocks. The SDK can adjust this number based on platform capability. If this option is specified, i.e. if it is not equal to zero, the SDK ignores mfxInfoMFX::NumSlice parameter.

 

SkipFrame

This option enables usage of mfxEncodeCtrl::SkipFrame parameter. See the SkipFrame enumerator for values of this option.

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

 

MinQPI, MaxQPI

MinQPP, MaxQPP

MinQPB, MinQPB

Minimum and maximum allowed QP values for different frame types. Valid range is 1..51 inclusive. Zero means default value, i.e.no limitations on QP.

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

 

FixedFrameRate

This option sets fixed_frame_rate_flag in VUI.

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

 

DisableDeblockingIdc

This option disable deblocking.

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

 

DisableVUI

This option completely disables VUI in output bitstream.

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

 

BufferingPeriodSEI

This option controls insertion of buffering period SEI in the encoded bitstream. It should be one of the following values:

MFX_BPSEI_DEFAULT – encoder decides when to insert BP SEI,

MFX_BPSEI_IFRAME – BP SEI should be inserted with every I frame.

 

EnableMAD

Turn ON this flag to enable per-frame reporting of Mean Absolute Difference. This parameter is valid only during initialization.

 

UseRawRef

Turn ON this flag to use raw frames for reference instead of reconstructed frames. This parameter is valid during initialization and runtime (only if was turned ON during initialization).

Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported.

Change History

 

This structure is available since SDK API 1.6.

The SDK API 1.7 added LookAheadDepth and Trellis fields.

The SDK API 1.8 adds RepeatPPS, BRefType, AdaptiveI, AdaptiveB, LookAheadDS and NumMbPerSlice fields.

The SDK API 1.9 adds MaxSliceSize, SkipFrame, MinQPI, MaxQPI, MinQPP, MaxQPP, MinQPB, MinQPB, FixedFrameRate and DisableDeblockingIdc fields.

The SDK API 1.10 adds DisableVUIfields and BufferingPeriodSEI fields.

The SDK API 1.11 adds EnableMAD field.

The SDK API 1.13 adds UseRawRef field.

The SDK API 1.17 deprecates ExtBRC field.

 

 

For more complete information about compiler optimizations, see our Optimization Notice.