This class of functions performs the first step of encoding process – motion estimation, intra prediction and mode decision. These functions are declared in mfxenc.h file.

Member Functions

 

MFXVideoENC_Query

Queries the feature capability

MFXVideoENC_QueryIOSurf

Queries the number of input surface frames required for encoding

MFXVideoENC_Init

Initializes the encoding operation

MFXVideoENC_Reset

Resets the current encoding operation and prepares for the next encoding operation

MFXVideoENC_Close

Terminates the encoding operation and de-allocates any internal memory

MFXVideoENC_ProcessFrameAsync

Performs the first step of encoding process and returns intermediate data.

 

 

Syntax

 

mfxStatus MFXVideoENC_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out);

Parameters

 

session

SDK session handle

 

in

Pointer to the mfxVideoParam structure as input

 

out

Pointer to the mfxVideoParam structure as output

Description

 

This function works in either of two modes:

  1. If the in pointer is zero, the function returns the class configurability in the output mfxVideoParam structure. A non-zero value in each field of the output structure indicates that the SDK implementation can configure the field with Init.

  2. If the in parameter is non-zero, the function checks the validity of the fields in the input mfxVideoParam structure. Then the function returns the corrected values in the output mfxVideoParam structure. If there is insufficient information to determine the validity or correction is impossible, the function zeroes the fields. This feature can verify whether the SDK implementation supports certain profiles, levels or bitrates.

The application can call this function before or after it initializes the ENC.

Return Status

 

MFX_ERR_NONE

The function completed successfully.

 

MFX_ERR_UNSUPPORTED

The function failed to identify a specific implementation for the required features.

 

MFX_WRN_INCOMPATIBLE_VIDEO_PARAM

The function detected some video parameters were incompatible with others; incompatibility resolved.

Change History

 

This function is available since SDK API 1.10.

 

 

 

Syntax

 

mfxStatus MFXVideoENC_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request);

Parameters

 

session

SDK session handle

 

par

Pointer to the mfxVideoParam structure as input

 

request

Pointer to the mfxFrameAllocRequest structure as output

Description

 

This function returns minimum and suggested numbers of the input frame surfaces required for ENC initialization and their type.

This function does not validate I/O parameters except those used in calculating the number of input surfaces.

Return Status

 

MFX_ERR_NONE

The function completed successfully.

 

MFX_ERR_INVALID_VIDEO_PARAM

The function detected invalid video parameters. These parameters may be out of the valid range, or the combination of them resulted in incompatibility. Incompatibility not resolved.

 

MFX_WRN_INCOMPATIBLE_VIDEO_PARAM

The function detected some video parameters were incompatible with others; incompatibility resolved.

Change History

 

This function is available since SDK API 1.10.

 

 

 

Syntax

 

mfxStatus MFXVideoENC_Init(mfxSession session, mfxVideoParam *par);

Parameters

 

session

SDK session handle

 

par

Pointer to the mfxVideoParam structure

Description

 

This function performs ENC initialization.

Return Status

 

MFX_ERR_NONE

The function completed successfully.

 

MFX_ERR_INVALID_VIDEO_PARAM

The function detected invalid video parameters. These parameters may be out of the valid range, or the combination of them resulted in incompatibility. Incompatibility not resolved.

 

MFX_WRN_INCOMPATIBLE_VIDEO_PARAM

The function detected some video parameters were incompatible with others; incompatibility resolved.

 

MFX_ERR_UNDEFINED_BEHAVIOR

The function is called twice without a close;

Change History

 

This function is available since SDK API 1.10.

 

 

 

Syntax

 

mfxStatus MFXVideoENC_Reset(mfxSession session, mfxVideoParam *par);

Parameters

 

session

SDK session handle

 

par

Pointer to the mfxVideoParam structure

Description

 

This function stops the current encoding operation and restores internal structures or parameters for a new encoding operation, possibly with new parameters.

Return Status

 

MFX_ERR_NONE

The function completed successfully.

 

MFX_ERR_INVALID_VIDEO_PARAM

The function detected that video parameters are wrong or they conflict with initialization parameters. Reset is impossible.

 

MFX_ERR_INCOMPATIBLE_VIDEO_PARAM

The function detected that provided by the application video parameters are incompatible with initialization parameters. Reset requires additional memory allocation and cannot be executed. The application should close the SDK component and then reinitialize it.

 

MFX_WRN_INCOMPATIBLE_VIDEO_PARAM

The function detected some video parameters were incompatible with others; incompatibility resolved.

Change History

 

This function is available since SDK API 1.10.

 

 

 

Syntax

 

mfxStatus MFXVideoENC_Close(mfxSession session);

Parameters

 

session

SDK session handle

Description

 

This function terminates the current encoding operation and de-allocates any internal tables or structures.

Return Status

 

MFX_ERR_NONE

The function completed successfully.

Change History

 

This function is available since SDK API 1.10.

 

 

 

Syntax

 

mfxStatus MFXVideoENC_GetVideoParam(mfxSession session, mfxVideoParam *par);

Parameters

 

session

SDK session handle

 

par

Pointer to the corresponding parameter structure

Description

 

This function retrieves current working parameters to the specified output structure. If extended buffers are to be returned, the application must allocate those extended buffers and attach them as part of the output structure.

Returned information

 

MFX_ERR_NONE

The function completed successfully.

Change History

 

This function is available since SDK API 1.19.

Syntax

 

mfxStatus MFXVideoENC_ProcessFrameAsync(mfxSession session, mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp);

Parameters

 

Session

SDK session handle

 

in

Input parameters for ENC operation.

 

out

Output parameters of encoding operation.

 

syncp

Pointer to the returned sync point associated with this operation

Description

 

This function performs the first step of encoding process – motion estimation, intra prediction and mode decision. Its exact operation, input and output parameters depend on usage model.

This function is stateless, i.e. each function call is independent from other calls.

This function is asynchronous.

Return Status

 

MFX_ERR_NONE

The function completed successfully.

Change History

 

This function is available since SDK API 1.10.

 

有关编译器优化的更完整信息,请参阅优化通知