Skip to content

Commit eb41770

Browse files
FurongZhanggfxVPLsdm
authored andcommitted
[API] Add mfxExtVPPAIFrameInterpolation vpp filter
1 parent c900f92 commit eb41770

File tree

1 file changed

+59
-6
lines changed

1 file changed

+59
-6
lines changed

api/vpl/mfxstructures.h

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,6 +2427,12 @@ enum {
24272427
*/
24282428
MFX_EXTBUFF_VPP_AI_SUPER_RESOLUTION = MFX_MAKEFOURCC('V','A','S','R'),
24292429
#endif
2430+
#ifdef ONEVPL_EXPERIMENTAL
2431+
/*!
2432+
See the mfxExtVPPAIFrameInterpolation structure for details.
2433+
*/
2434+
MFX_EXTBUFF_VPP_AI_FRAME_INTERPOLATION = MFX_MAKEFOURCC('V', 'A', 'F', 'I'),
2435+
#endif
24302436
#ifdef ONEVPL_EXPERIMENTAL
24312437
/*!
24322438
See the mfxExtQualityInfoMode structure for details.
@@ -3075,12 +3081,19 @@ MFX_PACK_END()
30753081

30763082
/*! The FrcAlgm enumerator itemizes frame rate conversion algorithms. See description of mfxExtVPPFrameRateConversion structure for more details. */
30773083
enum {
3078-
MFX_FRCALGM_PRESERVE_TIMESTAMP = 0x0001, /*!< Frame dropping/repetition based frame rate conversion algorithm with preserved original
3079-
time stamps. Any inserted frames will carry MFX_TIMESTAMP_UNKNOWN. */
3080-
MFX_FRCALGM_DISTRIBUTED_TIMESTAMP = 0x0002, /*!< Frame dropping/repetition based frame rate conversion algorithm with distributed time stamps.
3081-
The algorithm distributes output time stamps evenly according to the output frame rate. */
3082-
MFX_FRCALGM_FRAME_INTERPOLATION = 0x0004 /*!< Frame rate conversion algorithm based on frame interpolation. This flag may be combined with
3083-
MFX_FRCALGM_PRESERVE_TIMESTAMP or MFX_FRCALGM_DISTRIBUTED_TIMESTAMP flags. */
3084+
MFX_FRCALGM_PRESERVE_TIMESTAMP = 0x0001, /*!< Frame dropping/repetition based frame rate conversion algorithm with preserved original
3085+
time stamps. Any inserted frames will carry MFX_TIMESTAMP_UNKNOWN. */
3086+
MFX_FRCALGM_DISTRIBUTED_TIMESTAMP = 0x0002, /*!< Frame dropping/repetition based frame rate conversion algorithm with distributed time stamps.
3087+
The algorithm distributes output time stamps evenly according to the output frame rate. */
3088+
MFX_FRCALGM_FRAME_INTERPOLATION = 0x0004, /*!< Frame rate conversion algorithm based on frame interpolation. This flag may be combined with
3089+
MFX_FRCALGM_PRESERVE_TIMESTAMP or MFX_FRCALGM_DISTRIBUTED_TIMESTAMP flags. */
3090+
#ifdef ONEVPL_EXPERIMENTAL
3091+
MFX_FRCALGM_AI_FRAME_INTERPOLATION = 0x0008 /*!< Frame rate conversion algorithm based on AI powered frame interpolation. This flag may be combined with
3092+
MFX_FRCALGM_PRESERVE_TIMESTAMP or MFX_FRCALGM_DISTRIBUTED_TIMESTAMP flags. This flag can not be combined
3093+
with MFX_FRCALGM_FRAME_INTERPOLATION. If application sets this flag, the application needs to attach
3094+
MFX_EXTBUFF_VPP_AI_FRAME_INTERPOLATION for the details of frame interpolation to mfxVideoParam. Refer to
3095+
mfxExtVPPAIFrameInterpolation for more details.*/
3096+
#endif
30843097
};
30853098

30863099
MFX_PACK_BEGIN_USUAL_STRUCT()
@@ -5154,6 +5167,46 @@ typedef struct {
51545167
MFX_PACK_END()
51555168
#endif
51565169

5170+
#ifdef ONEVPL_EXPERIMENTAL
5171+
/* The mfxAIFrameInterpolationMode enumerator specifies the mode of AI based frame interpolation. */
5172+
typedef enum {
5173+
MFX_AI_FRAME_INTERPOLATION_MODE_DISABLE = 0, /*!< AI based frame interpolation is disabled. The library duplicates the frame if AI frame interpolation is disabled.*/
5174+
MFX_AI_FRAME_INTERPOLATION_MODE_DEFAULT = 1, /*!< Default AI based frame interpolation mode. The library selects the most appropriate AI based frame interpolation mode.*/
5175+
} mfxAIFrameInterpolationMode;
5176+
5177+
/*!
5178+
A hint structure that configures AI based frame interpolation VPP filter.
5179+
AI powered frame interpolation feature can reconstruct one or more intermediate frames between two consecutive frames by AI method.
5180+
On some platforms this filter is not supported. To query its support, the application should use the same approach that it uses to configure VPP filters:
5181+
Attaching the mfxExtVPPAIFrameInterpolation structure directly to the mfxVideoParam structure and setting the frame rate of input and output (FrameRateExtN and FrameRateExtD),
5182+
then calling the Query API function. If the filter is supported, the Query function returns a MFX_ERR_NONE status; otherwise, the function returns MFX_ERR_UNSUPPORTED.
5183+
As a new method of frame interpolation, the application can attach mfxExtVPPAIFrameInterpolation to mfxVideoParam during initialization for frame interpolation, or attach both
5184+
mfxExtVPPAIFrameInterpolation and mfxExtVPPFrameRateConversion to mfxVideoParam and use which mfxExtVPPAIFrameInterpolation is regarded as a new algorithm of mfxExtVPPFrameRateConversion
5185+
(MFX_FRCALGM_AI_FRAME_INTERPOLATION).
5186+
The applications should follow video processing procedures and call the API mfxStatus MFXVideoVPP_RunFrameVPPAsync(Session, Input, Output, Auxdata, Syncp) to process the frames one by one.
5187+
The below is detailed explanation of video processing procedures in this AI frame interpolation case. If the application does not follow the below input/output sequence, the application could
5188+
get the unexpected output and get an error return value.
5189+
Input: Frame0 Frame1 Frame2 Frame3 FrameN
5190+
Output: Frame0 Frame0.5 Frame1 Frame1.5 Frame2 Frame2.5 Frame3 FrameX.5 FrameN
5191+
#0 API call: Input Frame0, Output Frame0, Return MFX_ERR_NONE.
5192+
#1 API call: Input Frame1, Output Frame0.5 and Return MFX_ERR_MORE_SURFACE.
5193+
#2 API call: Input Frame1, Output Frame1, Return MFX_ERR_NONE.
5194+
#3 API call: Input Frame2, Output Frame1.5, Return MFX_ERR_MORE_SURFACE.
5195+
#4 API call: Input Frame2, Output Frame2, Return MFX_ERR_NONE.
5196+
*/
5197+
MFX_PACK_BEGIN_STRUCT_W_PTR()
5198+
typedef struct {
5199+
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_VPP_AI_FRAME_INTERPOLATION.*/
5200+
mfxAIFrameInterpolationMode FIMode; /*!< Indicates frame interpolation mode. The mfxAIFrameInterpolationMode enumerator.*/
5201+
mfxU16 EnableScd; /*!< Indicates if enabling scene change detection(SCD) of the library. Recommend to enable this flag for
5202+
better quality. Value 0 means disable SCD, Value 1 means enable SCD.*/
5203+
5204+
mfxU32 reserved1[24]; /*!< Reserved for future use. */
5205+
mfxHDL reserved2[8]; /*!< Reserved for future use. */
5206+
} mfxExtVPPAIFrameInterpolation;
5207+
MFX_PACK_END()
5208+
#endif
5209+
51575210
#ifdef ONEVPL_EXPERIMENTAL
51585211
/*! The mfxQualityInfoMode enumerator specifies the mode of Quality information. */
51595212
typedef enum {

0 commit comments

Comments
 (0)