mfxInfoMFX

Definition

 

 

typedef struct {

    mfxU32  reserved[7];

 

    mfxU16  LowPower;

    mfxU16  BRCParamMultiplier;

 

    mfxFrameInfo    FrameInfo;

    mfxU32  CodecId;

    mfxU16  CodecProfile;

    mfxU16  CodecLevel;

    mfxU16  NumThread;

 

    union {

        struct {   /* Encoding Options */

            mfxU16  TargetUsage;

 

            mfxU16  GopPicSize;

            mfxU16  GopRefDist;

            mfxU16  GopOptFlag;

            mfxU16  IdrInterval;

 

            mfxU16  RateControlMethod;

            union {

                mfxU16  InitialDelayInKB;

                mfxU16  QPI;

                mfxU16  Accuracy;

            };

            mfxU16  BufferSizeInKB;

            union {

                mfxU16  TargetKbps;

                mfxU16  QPP;

                mfxU16  ICQQuality;

            };

            union {

                mfxU16  MaxKbps;

                mfxU16  QPB;

                mfxU16  Convergence;

            };

 

            mfxU16  NumSlice;

            mfxU16  NumRefFrame;

            mfxU16  EncodedOrder;

        };

        struct {   /* Decoding Options */

            mfxU16  DecodedOrder;

            mfxU16  ExtendedPicStruct;

            mfxU16  TimeStampCalc;

            mfxU16  SliceGroupsPresent;

            mfxU16  MaxDecFrameBuffering;

            mfxU16  EnableReallocRequest;

            mfxU16  reserved2[7];

        };

        struct {   /* JPEG Decoding Options */

            mfxU16  JPEGChromaFormat;

            mfxU16  Rotation;

            mfxU16  JPEGColorFormat;

            mfxU16  InterleavedDec;

            mfxU8   SamplingFactorH[4];

            mfxU8   SamplingFactorV[4];

            mfxU16  reserved3[5];

        };

        struct {   /* JPEG Encoding Options */

            mfxU16  Interleaved;

            mfxU16  Quality;

            mfxU16  RestartInterval;

            mfxU16  reserved5[10];

        };

    };

} mfxInfoMFX;

 

Description

 

 

This structure specifies configurations for decoding, encoding and transcoding processes. A zero value in any of these fields indicates that the field is not explicitly specified.

 

Members

 

 

LowPower

For encoders set this flag to ON to reduce power consumption and GPU usage. See the CodingOptionValue enumerator for values of this option. Use Query function to check if this feature is supported.

 

 

BRCParamMultiplier

Specifies a multiplier for bitrate control parameters. Affects next four variables InitialDelayInKB, BufferSizeInKB, TargetKbps, MaxKbps. If this value is not equal to zero encoder calculates BRC parameters as value * BRCParamMultiplier.   

 

 

FrameInfo

mfxFrameInfo structure that specifies frame parameters

 

 

CodecId

Specifies the codec format identifier in the FOURCC code; see the CodecFormatFourCC enumerator for details. This is a mandated input parameter for QueryIOSurf and Init functions.

 

 

CodecProfile

Specifies the codec profile; see the CodecProfile enumerator for details. Specify the codec profile explicitly or the SDK functions will determine the correct profile from other sources, such as resolution and bitrate.

 

 

CodecLevel

Codec level; see the CodecLevel enumerator for details. Specify the codec level explicitly or the SDK functions will determine the correct level from other sources, such as resolution and bitrate.

 

 

GopPicSize

Number of pictures within the current GOP (Group of Pictures); if GopPicSize=0, then the GOP size is unspecified. If GopPicSize=1, only I-frames are used. See Example 14 for pseudo-code that demonstrates how SDK uses this parameter.

 

 

GopRefDist

Distance between I- or P (or GPB) - key frames; if it is zero, the GOP structure is unspecified. Note: If GopRefDist = 1, there are no regular B-frames used (only P or GPB); if mfxExtCodingOption3::GPB is ON, GPB frames (B without backward references) are used instead of P. See Example 14 for pseudo-code that demonstrates how SDK uses this parameter.

 

 

GopOptFlag

ORs of the GopOptFlag enumerator indicate the additional flags for the GOP specification; see Example 14 for an example of pseudo-code that demonstrates how to use this parameter.

 

 

IdrInterval

For H.264, IdrInterval specifies IDR-frame interval in terms of I-frames; if IdrInterval=0, then every I-frame is an IDR-frame. If IdrInterval=1, then every other I-frame is an IDR-frame, etc.

For HEVC, if IdrInterval=0, then only first I-frame is an IDR-frame. If IdrInterval=1, then every I-frame is an IDR-frame. If IdrInterval=2, then every other I-frame is an IDR-frame, etc.

For MPEG2, IdrInterval defines sequence header interval in terms of I-frames. If IdrInterval=N, SDK inserts the sequence header before every Nth I-frame. If IdrInterval=0 (default), SDK inserts the sequence header once at the beginning of the stream.

 

If GopPicSize or GopRefDist is zero, IdrInterval is undefined.

 

 

TargetUsage

Target usage model that guides the encoding process; see the TargetUsage enumerator for details.

 

 

RateControlMethod

Rate control method; see the RateControlMethod enumerator for details.

 

 

InitialDelayInKB

TargetKbps

MaxKbps

These parameters are for the constant bitrate (CBR), variable bitrate control (VBR) and CQP HRD algorithms.

The SDK encoders follow the Hypothetical Reference Decoding (HRD) model. The HRD model assumes that data flows into a buffer of the fixed size BufferSizeInKB with a constant bitrate TargetKbps. (Estimate the targeted frame size by dividing the framerate by the bitrate.)

The decoder starts decoding after the buffer reaches the initial size InitialDelayInKB, which is equivalent to reaching an initial delay of InitialDelayInKB*8000/TargetKbps ms. Note: In this context, KB is 1000 bytes and Kbps is 1000 bps.

If InitialDelayInKB or BufferSizeInKB is equal to zero, the value is calculated using bitrate, frame rate, profile, level, and so on.

TargetKbps must be specified for encoding initialization.

For variable bitrate control, the MaxKbps parameter specifies the maximum bitrate at which the encoded data enters the Video Buffering Verifier (VBV) buffer. If MaxKbps is equal to zero, the value is calculated from bitrate, frame rate, profile, level, and so on.

 

 

QPI, QPP, QPB

Quantization Parameters (QP) for I, P and B frames, respectively, for the constant QP (CQP) mode.

 

 

TargetKbps

Accuracy

Convergence

These parameters are for the average variable bitrate control (AVBR) algorithm. The algorithm focuses on overall encoding quality while meeting the specified bitrate, TargetKbps, within the accuracy range Accuracy, after a Convergence period. This method does not follow HRD and the instant bitrate is not capped or padded.

The Accuracy value is specified in the unit of tenth of percent.

The Convergence value is specified in the unit of 100 frames.

The TargetKbps value is specified in the unit of 1000 bits per second.

 

 

ICQQuality

This parameter is for Intelligent Constant Quality (ICQ) bitrate control algorithm. It is value in the 1…51 range, where 1 corresponds the best quality.

 

 

BufferSizeInKB

 

BufferSizeInKB represents the maximum possible size of any compressed frames.

 

 

NumSlice

Number of slices in each video frame; each slice contains one or more macro-block rows. If NumSlice equals zero, the encoder may choose any slice partitioning allowed by the codec standard.

See also mfxExtCodingOption2::NumMbPerSlice.

 

 

NumRefFrame

Number of reference frames; if NumRefFrame = 0, this parameter is not specified.

 

 

EncodedOrder

If not zero, EncodedOrder specifies that ENCODE takes the input surfaces in the encoded order and uses explicit frame type control. Application still must provide GopRefDist and mfxExtCodingOption2::BRefType so SDK can pack headers and build reference lists correctly.

 

 

NumThread

Deprecated; Used to represent the number of threads the underlying implementation can use on the host processor. Always set this parameter to zero.

 

 

DecodedOrder

Deprecated; Used to instruct the decoder to decoded output in the decoded order. Always set this parameter to zero.

 

 

ExtendedPicStruct

Instructs DECODE to output extended picture structure values for additional display attributes. See the PicStruct description for details.

 

 

TimeStampCalc

Time stamp calculation method; see the TimeStampCalc description for details.

 

 

SliceGroupsPresent

Nonzero value indicates that slice groups are present in the bitstream. Only AVC decoder uses this field.

 

 

MaxDecFrameBuffering

Nonzero value specifies the maximum required size of the decoded picture buffer in frames for AVC and HEVC decoders.

 

 

EnableReallocRequest

For decoders supporting dynamic resolution change (VP9), set this option to ON to allow MFXVideoDECODE_DecodeFrameAsync return MFX_ERR_REALLOC_SURFACE.

See the CodingOptionValue enumerator for values of this option. Use Query function to check if this feature is supported.

 

Change History

 

This structure is available since SDK API 1.0.

SDK API 1.1 extended the QPI, QPP, QPB fields.

SDK API 1.3 extended the Accuracy, Convergence, TimeStampCalc, ExtendedPicStruct and BRCParamMultiplier fields.

SDK API 1.6 added SliceGroupsPresent field.

SDK API 1.8 added ICQQuality field.

SDK API 1.15 adds LowPower field.

SDK API 1.16 adds MaxDecFrameBuffering field.

SDK API 1.19 adds EnableReallocRequest field.

 

 

 

 

 

Text Box: mfxU16 get_gop_sequence (…) { pos=display_frame_order; if (pos == 0) return MFX_FRAMETYPE_I | MFX_FRAMETYPE_IDR | MFX_FRAMETYPE_REF; /* Only I-frames */ If (GopPicSize == 1) return MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF; if (GopPicSize == 0) frameInGOP = pos; //Unlimited GOP else frameInGOP = pos%GopPicSize; if (frameInGOP == 0) return MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF; if (GopRefDist == 1 || GopRefDist == 0) // Only I,P frames return MFX_FRAMETYPE_P | MFX_FRAMETYPE_REF; frameInPattern = (frameInGOP-1)%GopRefDist; if (frameInPattern == GopRefDist - 1) return MFX_FRAMETYPE_P | MFX_FRAMETYPE_REF; return MFX_FRAMETYPE_B; }

Example 14: Pseudo-Code for GOP Structure Parameters

 

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