Skip to content

Commit f4c18ed

Browse files
oneVPL Spec update to version 2.4 (#329)
Co-authored-by: Igor Belyakov <[email protected]>
1 parent 70393b5 commit f4c18ed

30 files changed

+1038
-398
lines changed

oneapi-doc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"version": "1.1-provisional-rev-1",
3-
"vpl_version": "2.3.1",
3+
"vpl_version": "2.4.0",
44
"art_version": "0.5-rev-1"
55
}

source/elements/oneVPL/include/vpl/mfxcommon.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@ MFX_PACK_END()
431431
/* The mfxImplCapsDeliveryFormat enumerator specifies delivery format of the implementation capability. */
432432
typedef enum {
433433
MFX_IMPLCAPS_IMPLDESCSTRUCTURE = 1, /*!< Deliver capabilities as mfxImplDescription structure. */
434-
MFX_IMPLCAPS_IMPLEMENTEDFUNCTIONS = 2 /*!< Deliver capabilities as mfxImplementedFunctions structure. */
434+
MFX_IMPLCAPS_IMPLEMENTEDFUNCTIONS = 2, /*!< Deliver capabilities as mfxImplementedFunctions structure. */
435+
MFX_IMPLCAPS_IMPLPATH = 3 /*!< Deliver pointer to the null-terminated string with the path to the
436+
implementation. String is delivered in a form of buffer of
437+
mfxChar type. */
435438
} mfxImplCapsDeliveryFormat;
436439

437440
MFX_PACK_BEGIN_STRUCT_W_PTR()

source/elements/oneVPL/include/vpl/mfxdefs.h

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*############################################################################
2-
# Copyright (C) 2019-2020 Intel Corporation
2+
# Copyright (C) 2019-2021 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
############################################################################*/
@@ -8,7 +8,7 @@
88
#define __MFXDEFS_H__
99

1010
#define MFX_VERSION_MAJOR 2
11-
#define MFX_VERSION_MINOR 3
11+
#define MFX_VERSION_MINOR 4
1212

1313
// MFX_VERSION - version of API that 'assumed' by build may be provided externally
1414
// if it omitted then latest stable API derived from Major.Minor is assumed
@@ -176,20 +176,35 @@ MFX_PACK_END()
176176

177177
#define MFX_VARIANT_VERSION MFX_STRUCT_VERSION(1, 0)
178178

179-
/*! The mfxVariantType enumerator data types for mfxVarianf type. */
179+
/*! The mfxDataType enumerates data type for mfxDataType. */
180+
typedef enum {
181+
MFX_DATA_TYPE_UNSET = 0, /*!< Undefined type. */
182+
MFX_DATA_TYPE_U8, /*!< 8-bit unsigned integer. */
183+
MFX_DATA_TYPE_I8, /*!< 8-bit signed integer. */
184+
MFX_DATA_TYPE_U16, /*!< 16-bit unsigned integer. */
185+
MFX_DATA_TYPE_I16, /*!< 16-bit signed integer. */
186+
MFX_DATA_TYPE_U32, /*!< 32-bit unsigned integer. */
187+
MFX_DATA_TYPE_I32, /*!< 32-bit signed integer. */
188+
MFX_DATA_TYPE_U64, /*!< 64-bit unsigned integer. */
189+
MFX_DATA_TYPE_I64, /*!< 64-bit signed integer. */
190+
MFX_DATA_TYPE_F32, /*!< 32-bit single precision floating point. */
191+
MFX_DATA_TYPE_F64, /*!< 64-bit double precision floating point. */
192+
}mfxDataType;
193+
194+
/*! The mfxVariantType enumerator data types for mfxVariantType. */
180195
typedef enum {
181-
MFX_VARIANT_TYPE_UNSET = 0, /*!< Undefined type. */
182-
MFX_VARIANT_TYPE_U8 = 1, /*!< 8-bit unsigned integer. */
183-
MFX_VARIANT_TYPE_I8, /*!< 8-bit signed integer. */
184-
MFX_VARIANT_TYPE_U16, /*!< 16-bit unsigned integer. */
185-
MFX_VARIANT_TYPE_I16, /*!< 16-bit signed integer. */
186-
MFX_VARIANT_TYPE_U32, /*!< 32-bit unsigned integer. */
187-
MFX_VARIANT_TYPE_I32, /*!< 32-bit signed integer. */
188-
MFX_VARIANT_TYPE_U64, /*!< 64-bit unsigned integer. */
189-
MFX_VARIANT_TYPE_I64, /*!< 64-bit signed integer. */
190-
MFX_VARIANT_TYPE_F32, /*!< 32-bit single precision floating point. */
191-
MFX_VARIANT_TYPE_F64, /*!< 64-bit double precision floating point. */
192-
MFX_VARIANT_TYPE_PTR, /*!< Generic type pointer. */
196+
MFX_VARIANT_TYPE_UNSET = MFX_DATA_TYPE_UNSET, /*!< Undefined type. */
197+
MFX_VARIANT_TYPE_U8 = MFX_DATA_TYPE_U8, /*!< 8-bit unsigned integer. */
198+
MFX_VARIANT_TYPE_I8 = MFX_DATA_TYPE_I8, /*!< 8-bit signed integer. */
199+
MFX_VARIANT_TYPE_U16 = MFX_DATA_TYPE_U16, /*!< 16-bit unsigned integer. */
200+
MFX_VARIANT_TYPE_I16 = MFX_DATA_TYPE_I16, /*!< 16-bit signed integer. */
201+
MFX_VARIANT_TYPE_U32 = MFX_DATA_TYPE_U32, /*!< 32-bit unsigned integer. */
202+
MFX_VARIANT_TYPE_I32 = MFX_DATA_TYPE_I32, /*!< 32-bit signed integer. */
203+
MFX_VARIANT_TYPE_U64 = MFX_DATA_TYPE_U64, /*!< 64-bit unsigned integer. */
204+
MFX_VARIANT_TYPE_I64 = MFX_DATA_TYPE_I64, /*!< 64-bit signed integer. */
205+
MFX_VARIANT_TYPE_F32 = MFX_DATA_TYPE_F32, /*!< 32-bit single precision floating point. */
206+
MFX_VARIANT_TYPE_F64 = MFX_DATA_TYPE_F64, /*!< 64-bit double precision floating point. */
207+
MFX_VARIANT_TYPE_PTR, /*!< Generic type pointer. */
193208
} mfxVariantType;
194209

195210
MFX_PACK_BEGIN_STRUCT_W_PTR()
@@ -294,6 +309,17 @@ typedef enum
294309
} mfxStatus;
295310

296311

312+
MFX_PACK_BEGIN_USUAL_STRUCT()
313+
/*! Represents Globally Unique Identifier (GUID) with memory layout
314+
compliant to RFC 4122. See https://www.rfc-editor.org/info/rfc4122 for details. */
315+
typedef struct
316+
{
317+
mfxU8 Data[16]; /*!< Array to keep GUID. */
318+
} mfxGUID;
319+
MFX_PACK_END()
320+
321+
322+
297323
// Application
298324
#if defined(MFX_DISPATCHER_EXPOSED_PREFIX)
299325

source/elements/oneVPL/include/vpl/mfxdispatcher.h

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct _mfxConfig *mfxConfig;
2727
2828
@since This function is available since API version 2.0.
2929
*/
30-
mfxLoader MFX_CDECL MFXLoad();
30+
mfxLoader MFX_CDECL MFXLoad(void);
3131

3232
/*!
3333
@brief Destroys the dispatcher.
@@ -65,66 +65,6 @@ mfxConfig MFX_CDECL MFXCreateConfig(mfxLoader loader);
6565
@note Each new call with the same parameter name will overwrite the previously set value. This may invalidate other properties.
6666
@note Each new call with another parameter name will delete the previous property and create a new property based on new name's value.
6767
68-
Simple usage example:
69-
@code
70-
mfxLoader loader = MFXLoad();
71-
mfxConfig cfg = MFXCreateConfig(loader);
72-
mfxVariant ImplValue;
73-
ImplValue.Type = MFX_VARIANT_TYPE_U32;
74-
ImplValue.Data.U32 = MFX_IMPL_TYPE_HARDWARE;
75-
MFXSetConfigFilterProperty(cfg,"mfxImplDescription.Impl",ImplValue);
76-
MFXCreateSession(loader,0,&session);
77-
@endcode
78-
79-
Usage example with two sessions (multiple loaders):
80-
@code
81-
// Create session with software based implementation
82-
mfxLoader loader1 = MFXLoad();
83-
mfxConfig cfg1 = MFXCreateConfig(loader1);
84-
mfxVariant ImplValueSW;
85-
ImplValueSW.Type = MFX_VARIANT_TYPE_U32;
86-
ImplValueSW.Data.U32 = MFX_IMPL_TYPE_SOFTWARE;
87-
MFXSetConfigFilterProperty(cfg1,"mfxImplDescription.Impl",ImplValueSW);
88-
MFXCreateSession(loader1,0,&sessionSW);
89-
90-
// Create session with hardware based implementation
91-
mfxLoader loader2 = MFXLoad();
92-
mfxConfig cfg2 = MFXCreateConfig(loader2);
93-
mfxVariant ImplValueHW;
94-
ImplValueHW.Type = MFX_VARIANT_TYPE_U32;
95-
ImplValueHW.Data.U32 = MFX_IMPL_TYPE_HARDWARE;
96-
MFXSetConfigFilterProperty(cfg2,"mfxImplDescription.Impl",ImplValueHW);
97-
MFXCreateSession(loader2,0,&sessionHW);
98-
99-
// use both sessionSW and sessionHW
100-
// ...
101-
// Close everything
102-
MFXClose(sessionSW);
103-
MFXClose(sessionHW);
104-
MFXUnload(loader1); // cfg1 will be destroyed here.
105-
MFXUnload(loader2); // cfg2 will be destroyed here.
106-
@endcode
107-
108-
Usage example with two decoders (multiple config objects):
109-
@code
110-
mfxLoader loader = MFXLoad();
111-
112-
mfxConfig cfg1 = MFXCreateConfig(loader);
113-
mfxVariant ImplValue;
114-
val.Type = MFX_VARIANT_TYPE_U32;
115-
val.Data.U32 = MFX_CODEC_AVC;
116-
MFXSetConfigFilterProperty(cfg1,"mfxImplDescription.mfxDecoderDescription.decoder.CodecID",ImplValue);
117-
118-
mfxConfig cfg2 = MFXCreateConfig(loader);
119-
mfxVariant ImplValue;
120-
val.Type = MFX_VARIANT_TYPE_U32;
121-
val.Data.U32 = MFX_CODEC_HEVC;
122-
MFXSetConfigFilterProperty(cfg2,"mfxImplDescription.mfxDecoderDescription.decoder.CodecID",ImplValue);
123-
124-
MFXCreateSession(loader,0,&sessionAVC);
125-
MFXCreateSession(loader,0,&sessionHEVC);
126-
@endcode
127-
12868
@param[in] config Config handle.
12969
@param[in] name Name of the parameter (see mfxImplDescription structure and example).
13070
@param[in] value Value of the parameter.

source/elements/oneVPL/include/vpl/mfxstructures.h

Lines changed: 133 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ enum {
166166
MFX_FOURCC_I010 = MFX_MAKEFOURCC('I', '0', '1', '0'), /*!< 10-bit YUV 4:2:0, each component has its own plane. */
167167
MFX_FOURCC_I420 = MFX_FOURCC_IYUV, /*!< Alias for the IYUV color format. */
168168
MFX_FOURCC_BGRA = MFX_FOURCC_RGB4, /*!< Alias for the RGB4 color format. */
169+
/*! BGR 24 bit planar layout (3 separate channels, 8-bits per sample each). This format should be mapped to VA_FOURCC_BGRP. */
170+
MFX_FOURCC_BGRP = MFX_MAKEFOURCC('B','G','R','P'),
169171
};
170172

171173
/* PicStruct */
@@ -567,8 +569,27 @@ typedef struct mfxFrameSurfaceInterface {
567569
568570
*/
569571
void (MFX_CDECL *OnComplete)(mfxStatus sts);
572+
573+
/*! @brief
574+
Returns an interface defined by the GUID. If the returned interface is a reference
575+
counted object the caller should release the obtained interface to avoid memory leaks.
570576
571-
mfxHDL reserved2[3];
577+
@param[in] surface Valid surface.
578+
@param[in] guid GUID of the requested interface.
579+
@param[out] iface Interface.
580+
581+
582+
@return
583+
MFX_ERR_NONE If no error. \n
584+
MFX_ERR_NULL_PTR If interface or surface is NULL. \n
585+
MFX_ERR_UNSUPPORTED If requested interface is not supported. \n
586+
MFX_ERR_NOT_IMPLEMENTED If requested interface is not implemented. \n
587+
MFX_ERR_NOT_INITIALIZED If requested interface is not available (not created or already deleted). \n
588+
MFX_ERR_UNKNOWN Any internal error.
589+
*/
590+
mfxStatus (MFX_CDECL *QueryInterface)(mfxFrameSurface1* surface, mfxGUID guid, mfxHDL* iface);
591+
592+
mfxHDL reserved2[2];
572593
} mfxFrameSurfaceInterface;
573594
MFX_PACK_END()
574595

@@ -1663,12 +1684,16 @@ typedef struct {
16631684
@note Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported.
16641685
*/
16651686
mfxU16 EnableNalUnitType;
1666-
/*!
1667-
Turn OFF to prevent Adaptive marking of Long Term Reference Frames when using ExtBRC. When set to ON and using ExtBRC, encoders will mark,
1668-
modify, or remove LTR frames based on encoding parameters and content properties. The application must set each input frame's
1669-
mfxFrameData::FrameOrder for correct operation of LTR.
1670-
*/
1671-
mfxU16 ExtBrcAdaptiveLTR; /* Tri-state option for ExtBRC. */
1687+
1688+
union {
1689+
mfxU16 ExtBrcAdaptiveLTR; /* Deprecated */
1690+
1691+
/*!
1692+
If this flag is set to ON, encoder will mark, modify, or remove LTR frames based on encoding parameters and content
1693+
properties. Turn OFF to prevent Adaptive marking of Long Term Reference Frames.
1694+
*/
1695+
mfxU16 AdaptiveLTR;
1696+
};
16721697
/*!
16731698
If this flag is set to ON, encoder adaptively selects one of implementation-defined quantization matrices for each frame.
16741699
Non-default quantization matrices aim to improve subjective visual quality under certain conditions.
@@ -1677,8 +1702,13 @@ typedef struct {
16771702
This parameter is valid only during initialization.
16781703
*/
16791704
mfxU16 AdaptiveCQM;
1680-
1681-
mfxU16 reserved[162];
1705+
/*!
1706+
If this flag is set to ON, encoder adaptively selects list of reference frames to imrove encoding quality.
1707+
Enabling of the flag can increase computation complexity and introduce additional delay.
1708+
If this flag is set to OFF, regular reference frames are used for encoding.
1709+
*/
1710+
mfxU16 AdaptiveRef;
1711+
mfxU16 reserved[161];
16821712
} mfxExtCodingOption3;
16831713
MFX_PACK_END()
16841714

@@ -2033,7 +2063,12 @@ enum {
20332063
/*!
20342064
See the mfxExtHyperModeParam structure for more details.
20352065
*/
2036-
MFX_EXTBUFF_HYPER_MODE_PARAM = MFX_MAKEFOURCC('H', 'Y', 'P', 'M')
2066+
MFX_EXTBUFF_HYPER_MODE_PARAM = MFX_MAKEFOURCC('H', 'Y', 'P', 'M'),
2067+
2068+
/*!
2069+
See the mfxExtVPP3DLut structure for more details.
2070+
*/
2071+
MFX_EXTBUFF_VPP_3DLUT = MFX_MAKEFOURCC('T','D','L','T'),
20372072
};
20382073

20392074
/* VPP Conf: Do not use certain algorithms */
@@ -2091,6 +2126,94 @@ typedef struct {
20912126
} mfxExtVPPDenoise2;
20922127
MFX_PACK_END()
20932128

2129+
/*! The mfx3DLutChannelMapping enumerator specifies the channel mapping of 3DLUT. */
2130+
typedef enum {
2131+
MFX_3DLUT_CHANNEL_MAPPING_DEFAULT = 0, /*!< Default 3DLUT channel mapping. The library selects the most appropriate 3DLUT channel mapping. */
2132+
MFX_3DLUT_CHANNEL_MAPPING_RGB_RGB = 1, /*!< 3DLUT RGB channels map to RGB channels. */
2133+
MFX_3DLUT_CHANNEL_MAPPING_YUV_RGB = 2, /*!< 3DLUT YUV channels map to RGB channels. */
2134+
MFX_3DLUT_CHANNEL_MAPPING_VUY_RGB = 3, /*!< 3DLUT VUY channels map to RGB channels. */
2135+
} mfx3DLutChannelMapping;
2136+
2137+
/*! The mfx3DLutMemoryLayout enumerator specifies the memory layout of 3DLUT. */
2138+
typedef enum {
2139+
MFX_3DLUT_MEMORY_LAYOUT_DEFAULT = 0, /*!< Default 3DLUT memory layout. The library selects the most appropriate 3DLUT memory layout.*/
2140+
2141+
MFX_3DLUT_MEMORY_LAYOUT_VENDOR = 0x1000, /*!< The enumeration to separate default above and vendor specific.*/
2142+
/*!
2143+
Intel specific memory layout. The enumerator indicates the attributes and memory layout of 3DLUT.
2144+
3DLUT size is 17(the number of elements per dimension), 4 channels(3 valid channels, 1 channel is reserved), every channel must be 16-bit unsigned integer.
2145+
3DLUT contains 17x17x32 entries with holes that are not filled. Take RGB as example, the nodes RxGx17 to RxGx31 are not filled, are "don't care" bits, and not accessed for the 17x17x17 nodes.
2146+
*/
2147+
MFX_3DLUT_MEMORY_LAYOUT_INTEL_17LUT = MFX_3DLUT_MEMORY_LAYOUT_VENDOR + 1,
2148+
/*!
2149+
Intel specific memory layout. The enumerator indicates the attributes and memory layout of 3DLUT.
2150+
3DLUT size is 33(the number of elements per dimension), 4 channels(3 valid channels, 1 channel is reserved), every channel must be 16-bit unsigned integer.
2151+
3DLUT contains 33x33x64 entries with holes that are not filled. Take RGB as example, the nodes RxGx33 to RxGx63 are not filled, are "don't care" bits, and not accessed for the 33x33x33 nodes.
2152+
*/
2153+
MFX_3DLUT_MEMORY_LAYOUT_INTEL_33LUT = MFX_3DLUT_MEMORY_LAYOUT_VENDOR + 2,
2154+
/*!
2155+
Intel specific memory layout. The enumerator indicates the attributes and memory layout of 3DLUT.
2156+
3DLUT size is 65(the number of elements per dimension), 4 channels(3 valid channels, 1 channel is reserved), every channel must be 16-bit unsigned integer.
2157+
3DLUT contains 65x65x128 entries with holes that are not filled. Take RGB as example, the nodes RxGx65 to RxGx127 are not filled, are "don't care" bits, and not accessed for the 65x65x65 nodes.
2158+
*/
2159+
MFX_3DLUT_MEMORY_LAYOUT_INTEL_65LUT = MFX_3DLUT_MEMORY_LAYOUT_VENDOR + 3,
2160+
} mfx3DLutMemoryLayout;
2161+
2162+
MFX_PACK_BEGIN_STRUCT_W_PTR()
2163+
/*!
2164+
A hint structure that configures the data channel.
2165+
*/
2166+
typedef struct {
2167+
mfxDataType DataType; /*!< Data type, mfxDataType enumerator.*/
2168+
mfxU32 Size; /*!< Size of Look up table, the number of elements per dimension.*/
2169+
union
2170+
{
2171+
mfxU8* Data; /*!< The pointer to 3DLUT data, 8 bit unsigned integer.*/
2172+
mfxU16* Data16; /*!< The pointer to 3DLUT data, 16 bit unsigned integer.*/
2173+
};
2174+
mfxU32 reserved[4]; /*!< Reserved for future extension.*/
2175+
} mfxChannel;
2176+
MFX_PACK_END()
2177+
2178+
MFX_PACK_BEGIN_USUAL_STRUCT()
2179+
/*!
2180+
A hint structure that configures 3DLUT system buffer.
2181+
*/
2182+
typedef struct {
2183+
mfxChannel Channel[3]; /*!< 3 Channels, can be RGB or YUV, mfxChannel structure.*/
2184+
mfxU32 reserved[8]; /*!< Reserved for future extension.*/
2185+
} mfx3DLutSystemBuffer;
2186+
MFX_PACK_END()
2187+
2188+
MFX_PACK_BEGIN_USUAL_STRUCT()
2189+
/*!
2190+
A hint structure that configures 3DLUT video buffer.
2191+
*/
2192+
typedef struct {
2193+
mfxDataType DataType; /*!< Data type, mfxDataType enumerator.*/
2194+
mfx3DLutMemoryLayout MemLayout; /*!< Indicates 3DLUT memory layout. mfx3DLutMemoryLayout enumerator.*/
2195+
mfxMemId MemId; /*!< Memory ID for holding the lookup table data. One MemID is dedicated for one instance of VPP.*/
2196+
mfxU32 reserved[8]; /*!< Reserved for future extension.*/
2197+
} mfx3DLutVideoBuffer;
2198+
MFX_PACK_END()
2199+
2200+
MFX_PACK_BEGIN_USUAL_STRUCT()
2201+
/*!
2202+
A hint structure that configures 3DLUT filter.
2203+
*/
2204+
typedef struct {
2205+
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_VPP_3DLUT..*/
2206+
mfx3DLutChannelMapping ChannelMapping; /*!< Indicates 3DLUT channel mapping. mfx3DLutChannelMapping enumerator.*/
2207+
mfxResourceType BufferType; /*!< Indicates 3DLUT buffer type. mfxResourceType enumerator, can be system memory, VA surface, DX11 texture/buffer etc.*/
2208+
union
2209+
{
2210+
mfx3DLutSystemBuffer SystemBuffer; /*!< The 3DLUT system buffer. mfx3DLutSystemBuffer structure describes the details of the buffer.*/
2211+
mfx3DLutVideoBuffer VideoBuffer; /*!< The 3DLUT video buffer. mfx3DLutVideoBuffer describes the details of 3DLUT video buffer.*/
2212+
};
2213+
mfxU32 reserved[4]; /*!< Reserved for future extension.*/
2214+
} mfxExtVPP3DLut;
2215+
MFX_PACK_END()
2216+
20942217
MFX_PACK_BEGIN_USUAL_STRUCT()
20952218
/*!
20962219
A hint structure that configures the VPP detail/edge enhancement filter algorithm.

0 commit comments

Comments
 (0)