diff --git a/oneapi-doc.json b/oneapi-doc.json index fa211ab834..40742a07f4 100644 --- a/oneapi-doc.json +++ b/oneapi-doc.json @@ -1,5 +1,5 @@ { "version": "1.0-rev-2", - "vpl_version": "2.1.0", + "vpl_version": "2.2.0", "art_version": "0.5-rev-1" } diff --git a/requirements.txt b/requirements.txt index f64d88e07a..5e69bff139 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,3 +20,4 @@ sphinxcontrib-spelling sphinxcontrib-svg2pdfconverter graphviz lxml +sphinxcontrib.plantuml diff --git a/source/conf/common_conf.py b/source/conf/common_conf.py index 048bd1cde9..f678812c4a 100644 --- a/source/conf/common_conf.py +++ b/source/conf/common_conf.py @@ -17,6 +17,9 @@ sys.path.insert( 0, abspath(join(repo_root, 'source', 'elements', 'oneDAL')) # noqa: F821 ) +sys.path.insert( + 0, abspath(join(repo_root, 'source', 'elements', 'oneVPL')) # noqa: F821 +) extensions = [ 'notfound.extension', @@ -34,7 +37,9 @@ 'sphinxcontrib.inkscapeconverter', 'sphinx-prompt', 'sphinx_substitution_extensions', + 'sphinxcontrib.plantuml', 'breathe', + # 'vplapi', 'dalapi', # oneDAL API generator ] diff --git a/source/elements/oneVPL/include/onevpl/mfxvp9.h b/source/elements/oneVPL/include/onevpl/mfxvp9.h deleted file mode 100644 index 8b7818e667..0000000000 --- a/source/elements/oneVPL/include/onevpl/mfxvp9.h +++ /dev/null @@ -1,40 +0,0 @@ -/*############################################################################ - # Copyright (C) 2018-2020 Intel Corporation - # - # SPDX-License-Identifier: MIT - ############################################################################*/ - -#ifndef __MFXVP9_H__ -#define __MFXVP9_H__ - -#include "mfxdefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_VP9_DECODED_FRAME_INFO = MFX_MAKEFOURCC('9','D','F','I') -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 DisplayWidth; - mfxU16 DisplayHeight; - mfxU16 reserved[58]; -} mfxExtVP9DecodedFrameInfo; -MFX_PACK_END() - -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif - diff --git a/source/elements/oneVPL/include/onevpl/mfxadapter.h b/source/elements/oneVPL/include/vpl/mfxadapter.h similarity index 94% rename from source/elements/oneVPL/include/onevpl/mfxadapter.h rename to source/elements/oneVPL/include/vpl/mfxadapter.h index 5f1f9091c4..4d040a06ec 100644 --- a/source/elements/oneVPL/include/onevpl/mfxadapter.h +++ b/source/elements/oneVPL/include/vpl/mfxadapter.h @@ -29,6 +29,8 @@ extern "C" @p input_info or adapters pointer is NULL. \n MFX_ERR_NOT_FOUND No suitable adapters found. \n MFX_WRN_OUT_OF_RANGE Not enough memory to report back entire list of adapters. In this case as many adapters as possible will be returned. + + @since This function is available since API version 1.31. */ mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapters); @@ -45,6 +47,8 @@ mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersIn MFX_ERR_NULL_PTR bitstream or @p adapters pointer is NULL. \n MFX_ERR_NOT_FOUND No suitable adapters found. \n MFX_WRN_OUT_OF_RANGE Not enough memory to report back entire list of adapters. In this case as many adapters as possible will be returned. + + @since This function is available since API version 1.31. */ mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAdaptersInfo* adapters); @@ -57,6 +61,8 @@ mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec @return MFX_ERR_NONE The function completed successfully. \n MFX_ERR_NULL_PTR num_adapters pointer is NULL. + + @since This function is available since API version 1.31. */ mfxStatus MFX_CDECL MFXQueryAdaptersNumber(mfxU32* num_adapters); #ifdef __cplusplus diff --git a/source/elements/oneVPL/include/onevpl/mfxbrc.h b/source/elements/oneVPL/include/vpl/mfxbrc.h similarity index 99% rename from source/elements/oneVPL/include/onevpl/mfxbrc.h rename to source/elements/oneVPL/include/vpl/mfxbrc.h index a8e18de22d..9ddd69fb2e 100644 --- a/source/elements/oneVPL/include/onevpl/mfxbrc.h +++ b/source/elements/oneVPL/include/vpl/mfxbrc.h @@ -76,7 +76,7 @@ enum { MFX_BRC_PANIC_SMALL_FRAME = 4 /*!< Coded frame is too small, no further recoding possible - required padding to mfxBRCFrameStatus::MinFrameSize. */ }; -MFX_PACK_BEGIN_USUAL_STRUCT() +MFX_PACK_BEGIN_STRUCT_W_PTR() /*! Specifies instructions for the encoder provided by external BRC after each frame encoding. See the BRCStatus enumerator for details. */ diff --git a/source/elements/oneVPL/include/onevpl/mfxcommon.h b/source/elements/oneVPL/include/vpl/mfxcommon.h similarity index 93% rename from source/elements/oneVPL/include/onevpl/mfxcommon.h rename to source/elements/oneVPL/include/vpl/mfxcommon.h index 06509a3887..90a2f3d1e8 100644 --- a/source/elements/oneVPL/include/onevpl/mfxcommon.h +++ b/source/elements/oneVPL/include/vpl/mfxcommon.h @@ -52,9 +52,6 @@ enum { MFX_IMPL_HARDWARE4 = 0x0007, /*!< Hardware accelerated implementation (4th device). */ MFX_IMPL_RUNTIME = 0x0008, /*!< This value cannot be used for session initialization. It may be returned by the MFXQueryIMPL function to show that the session has been initialized in run-time mode. */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_IMPL_SINGLE_THREAD= 0x0009, -#endif MFX_IMPL_VIA_ANY = 0x0100, /*!< Hardware acceleration can go through any supported OS infrastructure. This is the default value. The default value is used by the legacy Intel(r) Media SDK if none of the MFX_IMPL_VIA_xxx flags are specified by the application. */ MFX_IMPL_VIA_D3D9 = 0x0200, /*!< Hardware acceleration goes through the Microsoft* Direct3D* 9 infrastructure. */ @@ -62,10 +59,6 @@ enum { MFX_IMPL_VIA_VAAPI = 0x0400, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure. */ MFX_IMPL_VIA_HDDLUNITE = 0x0500, /*!< Hardware acceleration goes through the HDDL* Unite*. */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_IMPL_EXTERNAL_THREADING = 0x10000, -#endif - MFX_IMPL_UNSUPPORTED = 0x0000 /*!< One of the MFXQueryIMPL returns. */ }; @@ -368,9 +361,16 @@ typedef enum { MFX_ACCEL_MODE_VIA_D3D9 = 0x0200, /*!< Hardware acceleration goes through the Microsoft* Direct3D9* infrastructure. */ MFX_ACCEL_MODE_VIA_D3D11 = 0x0300, /*!< Hardware acceleration goes through the Microsoft* Direct3D11* infrastructure. */ MFX_ACCEL_MODE_VIA_VAAPI = 0x0400, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure. */ + MFX_ACCEL_MODE_VIA_VAAPI_DRM_RENDER_NODE = MFX_ACCEL_MODE_VIA_VAAPI, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with DRM RENDER MODE as default acceleration access point. */ + MFX_ACCEL_MODE_VIA_VAAPI_DRM_MODESET = 0x0401, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with DRM MODESET as default acceleration access point. */ + MFX_ACCEL_MODE_VIA_VAAPI_GLX = 0x0402, /*! Hardware acceleration goes through the Linux* VA-API infrastructure with OpenGL Extension to the X Window System + as default acceleration access point. */ + MFX_ACCEL_MODE_VIA_VAAPI_X11 = 0x0403, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with X11 as default acceleration access point. */ + MFX_ACCEL_MODE_VIA_VAAPI_WAYLAND = 0x0404, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with Wayland as default acceleration access point. */ MFX_ACCEL_MODE_VIA_HDDLUNITE = 0x0500, /*!< Hardware acceleration goes through the HDDL* Unite*. */ } mfxAccelerationMode; + #define MFX_ACCELERATIONMODESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 0) MFX_PACK_BEGIN_STRUCT_W_PTR() @@ -393,7 +393,7 @@ typedef struct { mfxAccelerationMode AccelerationMode; /*!< Default Hardware acceleration stack to use. OS dependent parameter. Use VA for Linux* and DX* for Windows*. */ mfxVersion ApiVersion; /*!< Supported API version. */ mfxChar ImplName[MFX_IMPL_NAME_LEN]; /*!< Null-terminated string with implementation name given by vendor. */ - mfxChar License[MFX_STRFIELD_LEN]; /*!< Null-terminated string with license name of the implementation. */ + mfxChar License[MFX_STRFIELD_LEN]; /*!< Null-terminated string with comma-separated list of license names of the implementation. */ mfxChar Keywords[MFX_STRFIELD_LEN]; /*!< Null-terminated string with comma-separated list of keywords specific to this implementation that dispatcher can search for. */ mfxU32 VendorID; /*!< Standard vendor ID 0x8086 - Intel. */ mfxU32 VendorImplID; /*!< Vendor specific number with given implementation ID. */ @@ -415,9 +415,19 @@ typedef struct { } mfxImplDescription; MFX_PACK_END() +MFX_PACK_BEGIN_STRUCT_W_PTR() +/*! This structure represents the list of names of implemented functions. */ +typedef struct { + mfxU16 NumFunctions; /*!< Number of function names in the FunctionsName array. */ + mfxChar** FunctionsName; /*!< Array of the null-terminated strings. Each string contains name of the implemented function. */ +} mfxImplementedFunctions; +MFX_PACK_END() + + /* The mfxImplCapsDeliveryFormat enumerator specifies delivery format of the implementation capability. */ typedef enum { - MFX_IMPLCAPS_IMPLDESCSTRUCTURE = 1 /*!< Deliver capabilities as mfxImplDescription structure. */ + MFX_IMPLCAPS_IMPLDESCSTRUCTURE = 1, /*!< Deliver capabilities as mfxImplDescription structure. */ + MFX_IMPLCAPS_IMPLEMENTEDFUNCTIONS = 2 /*!< Deliver capabilities as mfxImplementedFunctions structure. */ } mfxImplCapsDeliveryFormat; MFX_PACK_BEGIN_STRUCT_W_PTR() @@ -428,7 +438,8 @@ typedef struct { mfxU16 reserved[3]; /*!< Reserved for future use. */ mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to this structure. */ mfxExtBuffer **ExtParam; /*!< Points to an array of pointers to the extra configuration structures; see the ExtendedBufferID enumerator for a list of extended configurations. */ - mfxU32 reserved2[4]; /*!< Reserved for future use. */ + mfxU32 VendorImplID; /*!< Vendor specific number with given implementation ID. Represents the same filed from mfxImplDescription. */ + mfxU32 reserved2[3]; /*!< Reserved for future use. */ } mfxInitializationParam; MFX_PACK_END() diff --git a/source/elements/oneVPL/include/onevpl/mfxdefs.h b/source/elements/oneVPL/include/vpl/mfxdefs.h similarity index 95% rename from source/elements/oneVPL/include/onevpl/mfxdefs.h rename to source/elements/oneVPL/include/vpl/mfxdefs.h index f39a942df5..d987345d40 100644 --- a/source/elements/oneVPL/include/onevpl/mfxdefs.h +++ b/source/elements/oneVPL/include/vpl/mfxdefs.h @@ -8,25 +8,18 @@ #define __MFXDEFS_H__ #define MFX_VERSION_MAJOR 2 -#define MFX_VERSION_MINOR 1 - -// MFX_VERSION_NEXT is always +1 from last public release -// may be enforced by MFX_VERSION_USE_LATEST define -// if MFX_VERSION_USE_LATEST is defined MFX_VERSION is ignored - -#define MFX_VERSION_NEXT (MFX_VERSION_MAJOR * 1000 + MFX_VERSION_MINOR + 1) +#define MFX_VERSION_MINOR 2 // MFX_VERSION - version of API that 'assumed' by build may be provided externally // if it omitted then latest stable API derived from Major.Minor is assumed #if !defined(MFX_VERSION) - #if defined(MFX_VERSION_USE_LATEST) - #define MFX_VERSION MFX_VERSION_NEXT - #else #define MFX_VERSION (MFX_VERSION_MAJOR * 1000 + MFX_VERSION_MINOR) - #endif #else + #undef MFX_VERSION_MAJOR + #define MFX_VERSION_MAJOR ((MFX_VERSION) / 1000) + #undef MFX_VERSION_MINOR #define MFX_VERSION_MINOR ((MFX_VERSION) % 1000) #endif @@ -82,9 +75,6 @@ extern "C" #error Unknown packing #endif - #define __INT64 long long - #define __UINT64 unsigned long long - #ifdef _WIN32 #define MFX_CDECL __cdecl #define MFX_STDCALL __stdcall @@ -110,8 +100,8 @@ typedef int mfxL32; /*!< Signed integer, 32 bit type. */ #endif typedef float mfxF32; /*!< Single-precision floating point, 32 bit type. */ typedef double mfxF64; /*!< Double-precision floating point, 64 bit type. */ -typedef __UINT64 mfxU64; /*!< Unsigned integer, 64 bit type. */ -typedef __INT64 mfxI64; /*!< Signed integer, 64 bit type. */ +typedef unsigned long long mfxU64; /*!< Unsigned integer, 64 bit type. */ +typedef long long mfxI64; /*!< Signed integer, 64 bit type. */ typedef void* mfxHDL; /*!< Handle type. */ typedef mfxHDL mfxMemId; /*!< Memory ID type. */ typedef void* mfxThreadTask; /*!< Thread task type. */ diff --git a/source/elements/oneVPL/include/onevpl/mfxdispatcher.h b/source/elements/oneVPL/include/vpl/mfxdispatcher.h similarity index 94% rename from source/elements/oneVPL/include/onevpl/mfxdispatcher.h rename to source/elements/oneVPL/include/vpl/mfxdispatcher.h index 9287dc0b43..fa0a401369 100644 --- a/source/elements/oneVPL/include/onevpl/mfxdispatcher.h +++ b/source/elements/oneVPL/include/vpl/mfxdispatcher.h @@ -24,12 +24,16 @@ typedef struct _mfxConfig *mfxConfig; /*! @brief Creates the loader. @return Loader Loader handle or NULL if failed. + + @since This function is available since API version 2.0. */ mfxLoader MFX_CDECL MFXLoad(); /*! @brief Destroys the dispatcher. @param[in] loader Loader handle. + + @since This function is available since API version 2.0. */ void MFX_CDECL MFXUnload(mfxLoader loader); @@ -50,6 +54,8 @@ void MFX_CDECL MFXUnload(mfxLoader loader); @endcode @param[in] loader Loader handle. @return Config handle or NULL pointer is failed. + + @since This function is available since API version 2.0. */ mfxConfig MFX_CDECL MFXCreateConfig(mfxLoader loader); @@ -128,6 +134,8 @@ mfxConfig MFX_CDECL MFXCreateConfig(mfxLoader loader); MFX_ERR_NULL_PTR If name is NULL. \n MFX_ERR_NOT_FOUND If name contains unknown parameter name. MFX_ERR_UNSUPPORTED If value data type does not equal the parameter with provided name. + + @since This function is available since API version 2.0. */ mfxStatus MFX_CDECL MFXSetConfigFilterProperty(mfxConfig config, const mfxU8* name, mfxVariant value); @@ -144,6 +152,8 @@ mfxStatus MFX_CDECL MFXSetConfigFilterProperty(mfxConfig config, const mfxU8* na MFX_ERR_NULL_PTR If idesc is NULL. \n MFX_ERR_NOT_FOUND Provided index is out of possible range. \n MFX_ERR_UNSUPPORTED If requested format is not supported. + + @since This function is available since API version 2.0. */ mfxStatus MFX_CDECL MFXEnumImplementations(mfxLoader loader, mfxU32 i, mfxImplCapsDeliveryFormat format, mfxHDL* idesc); @@ -176,6 +186,8 @@ mfxStatus MFX_CDECL MFXEnumImplementations(mfxLoader loader, mfxU32 i, mfxImplCa MFX_ERR_NULL_PTR If loader is NULL. \n MFX_ERR_NULL_PTR If session is NULL. \n MFX_ERR_NOT_FOUND Provided index is out of possible range. + + @since This function is available since API version 2.0. */ mfxStatus MFX_CDECL MFXCreateSession(mfxLoader loader, mfxU32 i, mfxSession* session); @@ -190,6 +202,8 @@ mfxStatus MFX_CDECL MFXCreateSession(mfxLoader loader, mfxU32 i, mfxSession* ses MFX_ERR_NONE The function completed successfully. \n MFX_ERR_NULL_PTR If loader is NULL. \n MFX_ERR_INVALID_HANDLE Provided hdl handle is not associated with this loader. + + @since This function is available since API version 2.0. */ mfxStatus MFX_CDECL MFXDispReleaseImplDescription(mfxLoader loader, mfxHDL hdl); diff --git a/source/elements/oneVPL/include/onevpl/mfxdispatcherprefixedfunctions.h b/source/elements/oneVPL/include/vpl/mfxdispatcherprefixedfunctions.h similarity index 98% rename from source/elements/oneVPL/include/onevpl/mfxdispatcherprefixedfunctions.h rename to source/elements/oneVPL/include/vpl/mfxdispatcherprefixedfunctions.h index c0e5626af0..8bfdeabb7e 100644 --- a/source/elements/oneVPL/include/onevpl/mfxdispatcherprefixedfunctions.h +++ b/source/elements/oneVPL/include/vpl/mfxdispatcherprefixedfunctions.h @@ -142,6 +142,7 @@ #define MFXVideoDECODE_VPP_DecodeFrameAsync disp_MFXVideoDECODE_VPP_DecodeFrameAsync #define MFXVideoDECODE_VPP_Reset disp_MFXVideoDECODE_VPP_Reset #define MFXVideoDECODE_VPP_GetChannelParam disp_MFXVideoDECODE_VPP_GetChannelParam +#define MFXVideoDECODE_VPP_Close disp_MFXVideoDECODE_VPP_Close #define MFXVideoVPP_ProcessFrameAsync disp_MFXVideoVPP_ProcessFrameAsync diff --git a/source/elements/oneVPL/include/onevpl/mfximplcaps.h b/source/elements/oneVPL/include/vpl/mfximplcaps.h similarity index 92% rename from source/elements/oneVPL/include/onevpl/mfximplcaps.h rename to source/elements/oneVPL/include/vpl/mfximplcaps.h index 996e52e017..793f6390f3 100644 --- a/source/elements/oneVPL/include/onevpl/mfximplcaps.h +++ b/source/elements/oneVPL/include/vpl/mfximplcaps.h @@ -26,6 +26,8 @@ extern "C" @return Array of handles to the capability report or NULL in case of unsupported format or NULL num_impls pointer. Length of array is equal to num_impls. + + @since This function is available since API version 2.0. */ mfxHDL* MFX_CDECL MFXQueryImplsDescription(mfxImplCapsDeliveryFormat format, mfxU32* num_impls); @@ -39,6 +41,8 @@ mfxHDL* MFX_CDECL MFXQueryImplsDescription(mfxImplCapsDeliveryFormat format, mfx @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 2.0. */ mfxStatus MFX_CDECL MFXReleaseImplDescription(mfxHDL hdl); diff --git a/source/elements/oneVPL/include/onevpl/mfxjpeg.h b/source/elements/oneVPL/include/vpl/mfxjpeg.h similarity index 100% rename from source/elements/oneVPL/include/onevpl/mfxjpeg.h rename to source/elements/oneVPL/include/vpl/mfxjpeg.h diff --git a/source/elements/oneVPL/include/onevpl/mfxmvc.h b/source/elements/oneVPL/include/vpl/mfxmvc.h similarity index 100% rename from source/elements/oneVPL/include/onevpl/mfxmvc.h rename to source/elements/oneVPL/include/vpl/mfxmvc.h diff --git a/source/elements/oneVPL/include/onevpl/mfxpcp.h b/source/elements/oneVPL/include/vpl/mfxpcp.h similarity index 100% rename from source/elements/oneVPL/include/onevpl/mfxpcp.h rename to source/elements/oneVPL/include/vpl/mfxpcp.h diff --git a/source/elements/oneVPL/include/onevpl/mfxsession.h b/source/elements/oneVPL/include/vpl/mfxsession.h similarity index 87% rename from source/elements/oneVPL/include/onevpl/mfxsession.h rename to source/elements/oneVPL/include/vpl/mfxsession.h index fb7197c08f..781cefac5a 100644 --- a/source/elements/oneVPL/include/onevpl/mfxsession.h +++ b/source/elements/oneVPL/include/vpl/mfxsession.h @@ -20,7 +20,9 @@ typedef struct _mfxSession *mfxSession; /*! @brief - Creates and initializes a session in legacy mode. + Creates and initializes a session in the legacy mode for compatibility with Intel(r) Media SDK applications. + This function is deprecated starting from API version 2.0, applications must use MFXLoad with mfxCreateSession + to select the implementation and initialize the session. Call this function before calling any other API function. If the desired implementation specified by ``impl`` is MFX_IMPL_AUTO, @@ -45,12 +47,17 @@ typedef struct _mfxSession *mfxSession; @return MFX_ERR_NONE The function completed successfully. The output parameter contains the handle of the session.\n MFX_ERR_UNSUPPORTED The function cannot find the desired legacy Intel(r) Media SDK implementation or version. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session); /*! @brief - Creates and initializes a session in legacy mode. + Creates and initializes a session in the legacy mode for compatibility with Intel(r) Media SDK applications. + This function is deprecated starting from API version 2.0, applications must use MFXLoad with mfxCreateSession + to select the implementation and initialize the session. + Call this function before calling any other API functions. If the desired implementation specified by ``par`` is MFX_IMPL_AUTO, the function will search for @@ -73,6 +80,8 @@ mfxStatus MFX_CDECL MFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session); @return MFX_ERR_NONE The function completed successfully. The output parameter contains the handle of the session.\n MFX_ERR_UNSUPPORTED The function cannot find the desired implementation or version. + + @since This function is available since API version 1.14. */ mfxStatus MFX_CDECL MFXInitEx(mfxInitParam par, mfxSession *session); @@ -89,6 +98,8 @@ mfxStatus MFX_CDECL MFXInitEx(mfxInitParam par, mfxSession *session); @return MFX_ERR_NONE The function completed successfully. The output parameter contains the handle of the session.\n MFX_ERR_UNSUPPORTED The function cannot find the desired implementation or version. + + @since This function is available since API version 2.0. */ mfxStatus MFX_CDECL MFXInitialize(mfxInitializationParam par, mfxSession *session); @@ -100,6 +111,8 @@ mfxStatus MFX_CDECL MFXInitialize(mfxInitializationParam par, mfxSession *sessio @param[in] session session handle. @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXClose(mfxSession session); @@ -110,6 +123,8 @@ mfxStatus MFX_CDECL MFXClose(mfxSession session); @param[out] impl Pointer to the implementation type @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXQueryIMPL(mfxSession session, mfxIMPL *impl); @@ -120,6 +135,8 @@ mfxStatus MFX_CDECL MFXQueryIMPL(mfxSession session, mfxIMPL *impl); @param[out] version Pointer to the returned implementation version. @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXQueryVersion(mfxSession session, mfxVersion *version); @@ -144,6 +161,8 @@ mfxStatus MFX_CDECL MFXQueryVersion(mfxSession session, mfxVersion *version); MFX_WRN_IN_EXECUTION Active tasks are executing or in queue in one of the sessions. Call this function again after all tasks are completed. \n MFX_ERR_UNSUPPORTED The child session cannot be joined with the current session. + + @since This function is available since API version 1.1. */ mfxStatus MFX_CDECL MFXJoinSession(mfxSession session, mfxSession child); @@ -158,6 +177,8 @@ mfxStatus MFX_CDECL MFXJoinSession(mfxSession session, mfxSession child); MFX_WRN_IN_EXECUTION Active tasks are executing or in queue in one of the sessions. Call this function again after all tasks are completed. \n MFX_ERR_UNDEFINED_BEHAVIOR The session is independent, or this session is the parent of all joined sessions. + + @since This function is available since API version 1.1. */ mfxStatus MFX_CDECL MFXDisjoinSession(mfxSession session); @@ -171,6 +192,8 @@ mfxStatus MFX_CDECL MFXDisjoinSession(mfxSession session); @param[out] clone Pointer to the cloned session handle. @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.1. */ mfxStatus MFX_CDECL MFXCloneSession(mfxSession session, mfxSession *clone); @@ -181,6 +204,8 @@ mfxStatus MFX_CDECL MFXCloneSession(mfxSession session, mfxSession *clone); @param[in] priority Priority value. @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.1. */ mfxStatus MFX_CDECL MFXSetPriority(mfxSession session, mfxPriority priority); @@ -191,6 +216,8 @@ mfxStatus MFX_CDECL MFXSetPriority(mfxSession session, mfxPriority priority); @param[out] priority Pointer to the priority value. @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.1. */ mfxStatus MFX_CDECL MFXGetPriority(mfxSession session, mfxPriority *priority); diff --git a/source/elements/oneVPL/include/onevpl/mfxstructures.h b/source/elements/oneVPL/include/vpl/mfxstructures.h similarity index 96% rename from source/elements/oneVPL/include/onevpl/mfxstructures.h rename to source/elements/oneVPL/include/vpl/mfxstructures.h index 34946d656b..f2859797cc 100644 --- a/source/elements/oneVPL/include/onevpl/mfxstructures.h +++ b/source/elements/oneVPL/include/vpl/mfxstructures.h @@ -1,5 +1,5 @@ /*############################################################################ - # Copyright (C) 2018-2020 Intel Corporation + # Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT ############################################################################*/ @@ -228,7 +228,7 @@ enum { }; MFX_PACK_BEGIN_USUAL_STRUCT() -/*! Specifies "pixel" in Y410 color format */ +/*! Specifies "pixel" in Y410 color format. */ typedef struct { mfxU32 U : 10; /*!< U component. */ @@ -238,6 +238,17 @@ typedef struct } mfxY410; MFX_PACK_END() +MFX_PACK_BEGIN_USUAL_STRUCT() +/*! Specifies "pixel" in Y416 color format. */ +typedef struct +{ + mfxU32 U : 16; /*!< U component. */ + mfxU32 Y : 16; /*!< Y component. */ + mfxU32 V : 16; /*!< V component. */ + mfxU32 A : 16; /*!< A component. */ +} mfxY416; +MFX_PACK_END() + MFX_PACK_BEGIN_USUAL_STRUCT() /*! Specifies "pixel" in A2RGB10 color format */ typedef struct @@ -303,6 +314,7 @@ typedef struct { mfxU16 *U16; /*!< U16 channel. */ mfxU8 *G; /*!< G channel. */ mfxY410 *Y410; /*!< T410 channel for Y410 format (merged AVYU). */ + mfxY416 *Y416; /*!< This format is a packed 16-bit representation that includes 16 bits of alpha. */ }; union { mfxU8 *Cr; /*!< Cr channel. */ @@ -881,6 +893,12 @@ enum { MFX_LEVEL_AVC_51 =51, MFX_LEVEL_AVC_52 =52, /*! @} */ + /*! @{ */ + /* H.264 level 6-6.2 */ + MFX_LEVEL_AVC_6 =60, + MFX_LEVEL_AVC_61 =61, + MFX_LEVEL_AVC_62 =62, + /*! @} */ /*! @{ */ /* MPEG2 Profiles. */ @@ -1438,31 +1456,6 @@ enum { DPB by a sliding window. */ }; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* QuantScaleType */ -enum { - MFX_MPEG2_QUANT_SCALE_TYPE_DEFAULT = 0, - MFX_MPEG2_QUANT_SCALE_TYPE_LINEAR = 1, /* q_scale_type = 0 */ - MFX_MPEG2_QUANT_SCALE_TYPE_NONLINEAR = 2 /* q_scale_type = 1 */ -}; - -/* IntraVLCFormat */ -enum { - MFX_MPEG2_INTRA_VLC_FORMAT_DEFAULT = 0, - MFX_MPEG2_INTRA_VLC_FORMAT_B14 = 1, /* use table B.14 */ - MFX_MPEG2_INTRA_VLC_FORMAT_B15 = 2 /* use table B.15 */ -}; - -/* ScanType */ -enum { - MFX_MPEG2_SCAN_TYPE_DEFAULT = 0, - MFX_MPEG2_SCAN_TYPE_ZIGZAG = 1, /* alternate_scan = 0 */ - MFX_MPEG2_SCAN_TYPE_ALTERNATE = 2 /* alternate_scan = 1 */ -}; - -#endif - MFX_PACK_BEGIN_USUAL_STRUCT() /*! Used with mfxExtCodingOption and mfxExtCodingOption2 structures to specify additional options for encoding. @@ -1569,12 +1562,7 @@ Values are in the 1 to 51 range, See the CodingOptionValue enumerator for values of this option. */ mfxU16 MotionVectorsOverPicBoundaries; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 Log2MaxMvLengthHorizontal; /* 0..16 */ - mfxU16 Log2MaxMvLengthVertical; /* 0..16 */ -#else mfxU16 reserved1[2]; -#endif mfxU16 ScenarioInfo; /*!< Provides a hint to encoder about the scenario for the encoding session. See the ScenarioInfo enumerator for values of this option. */ mfxU16 ContentInfo; /*!< Provides a hint to encoder about the content for the encoding session. See the ContentInfo enumerator for values of this option. */ @@ -1585,12 +1573,7 @@ Values are in the 1 to 51 range, unless application provided mfxExtPredWeightTable for this frame. See the CodingOptionValue enumerator for values of this option. */ mfxU16 FadeDetection; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxI16 DeblockingAlphaTcOffset; /* -12..12 (slice_alpha_c0_offset_div2 << 1) */ - mfxI16 DeblockingBetaOffset; /* -12..12 (slice_beta_offset_div2 << 1) */ -#else mfxU16 reserved2[2]; -#endif /*! Set this flag to OFF to make HEVC encoder use regular P-frames instead of GPB. See the CodingOptionValue enumerator for values of this option. */ @@ -1627,11 +1610,7 @@ Values are in the 1 to 51 range, mfxU16 NumRefActiveBL0[8]; /*!< Max number of active references for B-frames in reference picture list 0. Array index is pyramid layer. */ mfxU16 NumRefActiveBL1[8]; /*!< Max number of active references for B-frames in reference picture list 1. Array index is pyramid layer. */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 ConstrainedIntraPredFlag; -#else mfxU16 reserved6; -#endif /*! For HEVC if this option is turned ON, the transform_skip_enabled_flag will be set to 1 in PPS. OFF specifies that transform_skip_enabled_flag will be set to 0. */ @@ -1677,13 +1656,7 @@ Values are in the 1 to 51 range, MFX_CODINGOPTION_ON forces encoder to favor quality and MFX_CODINGOPTION_OFF forces encoder to favor performance. */ mfxU16 RepartitionCheckEnable; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 QuantScaleType; /* For MPEG2, specifies mapping between quantiser_scale_code and quantiser_scale (see QuantScaleType enum). */ - mfxU16 IntraVLCFormat; /* For MPEG2, specifies which table shall be used for coding of DCT coefficients of intra macroblocks (see IntraVLCFormat enum) */ - mfxU16 ScanType; /* For MPEG2, specifies transform coefficients scan pattern (see ScanType enum) */ -#else mfxU16 reserved5[3]; -#endif mfxU16 EncodedUnitsInfo; /*!< Set this flag to ON to make encoded units info available in mfxExtEncodedUnitsInfo. */ /*! If this flag is set to ON, the HEVC encoder uses the NAL unit type provided by the application in the mfxEncodeCtrl::MfxNalUnitType field. @@ -1697,7 +1670,15 @@ Values are in the 1 to 51 range, mfxFrameData::FrameOrder for correct operation of LTR. */ mfxU16 ExtBrcAdaptiveLTR; /* Tri-state option for ExtBRC. */ - mfxU16 reserved[163]; + /*! + If this flag is set to ON, encoder adaptively selects one of implementation-defined quantization matrices for each frame. + Non-default quantization matrices aim to improve subjective visual quality under certain conditions. + Their number and definitions are API implementation specific. + If this flag is set to OFF, default quantization matrix is used for all frames. + This parameter is valid only during initialization. + */ + mfxU16 AdaptiveCQM; + mfxU16 reserved[162]; } mfxExtCodingOption3; MFX_PACK_END() @@ -1764,10 +1745,11 @@ enum { */ MFX_EXTBUFF_VPP_AUXDATA = MFX_MAKEFOURCC('A','U','X','D'), /*! - The extended buffer defines control parameters for the VPP denoise filter algorithm. See the mfxExtVPPDenoise structure for details. + The extended buffer defines control parameters for the VPP denoise filter algorithm. See the mfxExtVPPDenoise2 structure for details. The application can attach this buffer to the mfxVideoParam structure for video processing initialization. */ - MFX_EXTBUFF_VPP_DENOISE = MFX_MAKEFOURCC('D','N','I','S'), + MFX_EXTBUFF_VPP_DENOISE2 = MFX_MAKEFOURCC('D','N','I','2'), + MFX_EXTBUFF_VPP_DENOISE = MFX_MAKEFOURCC('D','N','I','S'), /*!< Deprecated in 2.2 API version.*/ MFX_EXTBUFF_VPP_SCENE_ANALYSIS = MFX_MAKEFOURCC('S','C','L','Y'), MFX_EXTBUFF_VPP_SCENE_CHANGE = MFX_EXTBUFF_VPP_SCENE_ANALYSIS, /* Deprecated */ /*! @@ -1995,14 +1977,6 @@ enum { This extended buffer configures HDR SEI message. See the mfxExtMasteringDisplayColourVolume structure for details. */ MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME = MFX_MAKEFOURCC('D', 'C', 'V', 'S'), - /*! - This extended buffer allow to specify multi-frame submission parameters. - */ - MFX_EXTBUFF_MULTI_FRAME_PARAM = MFX_MAKEFOURCC('M', 'F', 'R', 'P'), - /*! - This extended buffer allow to manage multi-frame submission in runtime. - */ - MFX_EXTBUFF_MULTI_FRAME_CONTROL = MFX_MAKEFOURCC('M', 'F', 'R', 'C'), /*! See the mfxExtEncodedUnitsInfo structure for details. */ @@ -2027,13 +2001,6 @@ enum { See the mfxExtAVCRoundingOffset structure for details. */ MFX_EXTBUFF_AVC_ROUNDING_OFFSET = MFX_MAKEFOURCC('R','N','D','O'), -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_EXTBUFF_DPB = MFX_MAKEFOURCC('E','D','P','B'), - MFX_EXTBUFF_TEMPORAL_LAYERS = MFX_MAKEFOURCC('T','M','P','L'), - MFX_EXTBUFF_AVC_SCALING_MATRIX = MFX_MAKEFOURCC('A','V','S','M'), - MFX_EXTBUFF_MPEG2_QUANT_MATRIX = MFX_MAKEFOURCC('M','2','Q','M'), - MFX_EXTBUFF_TASK_DEPENDENCY = MFX_MAKEFOURCC('S','Y','N','C'), -#endif /*! See the mfxExtPartialBitstreamParam structure for details. */ @@ -2057,6 +2024,11 @@ enum { See the mfxExtInCrops structure for details. */ MFX_EXTBUFF_CROPS = MFX_MAKEFOURCC('C', 'R', 'O', 'P'), + + /*! + See the mfxExtAV1FilmGrainParam structure for more details. + */ + MFX_EXTBUFF_AV1_FILM_GRAIN_PARAM = MFX_MAKEFOURCC('A','1','F','G') }; @@ -2077,6 +2049,7 @@ MFX_PACK_END() MFX_PACK_BEGIN_USUAL_STRUCT() /*! A hint structure that configures the VPP denoise filter algorithm. + This extension buffer is deprecated. Use mfxExtVPPDenoise2 instead. */ typedef struct { mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_VPP_DENOISE. */ @@ -2084,6 +2057,37 @@ typedef struct { } mfxExtVPPDenoise; MFX_PACK_END() +/*! The mfxDenoiseMode enumerator specifies the mode of denoise. */ +typedef enum { + MFX_DENOISE_MODE_DEFAULT = 0, /*!< Default denoise mode. The library selects the most appropriate denoise mode. */ + MFX_DENOISE_MODE_VENDOR = 1000, /*!< The enumeration to separate common denoise mode above and vendor specific. */ + + MFX_DENOISE_MODE_INTEL_HVS_AUTO_BDRATE = MFX_DENOISE_MODE_VENDOR + 1, /*!< Indicates auto BD rate improvement in pre-processing before video encoding, + ignore Strength.*/ + MFX_DENOISE_MODE_INTEL_HVS_AUTO_SUBJECTIVE = MFX_DENOISE_MODE_VENDOR + 2, /*!< Indicates auto subjective quality improvement in pre-processing before video encoding, + ignore Strength.*/ + MFX_DENOISE_MODE_INTEL_HVS_AUTO_ADJUST = MFX_DENOISE_MODE_VENDOR + 3, /*!< Indicates auto adjust subjective quality in post-processing (after decoding) for video playback, + ignore Strength.*/ + MFX_DENOISE_MODE_INTEL_HVS_PRE_MANUAL = MFX_DENOISE_MODE_VENDOR + 4, /*!< Indicates manual mode for pre-processing before video encoding, + allow to adjust the denoise strength manually.*/ + MFX_DENOISE_MODE_INTEL_HVS_POST_MANUAL = MFX_DENOISE_MODE_VENDOR + 5, /*!< Indicates manual mode for post-processing for video playback, + allow to adjust the denoise strength manually.*/ +} mfxDenoiseMode; + +MFX_PACK_BEGIN_USUAL_STRUCT() +/*! + A hint structure that configures the VPP denoise filter algorithm. +*/ +typedef struct { + mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_VPP_DENOISE2. */ + mfxDenoiseMode Mode; /*!< Indicates the mode of denoise. mfxDenoiseMode enumerator. */ + mfxU16 Strength; /*!< Denoise strength in manaul mode. Value of 0-100 (inclusive) indicates the strength of denoise. + The strength of denoise controls degree of possible changes of pixel values; the bigger the strength + the larger the change is. */ + mfxU16 reserved[15]; +} mfxExtVPPDenoise2; +MFX_PACK_END() + MFX_PACK_BEGIN_USUAL_STRUCT() /*! A hint structure that configures the VPP detail/edge enhancement filter algorithm. @@ -2102,7 +2106,7 @@ MFX_PACK_BEGIN_STRUCT_W_L_TYPE() buffer is submitted for processing. */ typedef struct { - mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to FX_EXTBUFF_VPP_PROCAMP. */ + mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_VPP_PROCAMP. */ mfxF64 Brightness; /*!< The brightness parameter is in the range of -100.0F to 100.0F, in increments of 0.1F. Setting this field to 0.0F will disable brightness adjustment. */ mfxF64 Contrast; /*!< The contrast parameter in the range of 0.0F to 10.0F, in increments of 0.01F, is used for manual @@ -2351,11 +2355,7 @@ typedef struct { mfxU32 reserved[3]; mfxMemId *mids; /*!< Pointer to the array of the returned memory IDs. The application allocates or frees this array. */ mfxU16 NumFrameActual; /*!< Number of frames actually allocated. */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 MemType; -#else mfxU16 reserved2; -#endif } mfxFrameAllocResponse; MFX_PACK_END() @@ -3376,25 +3376,6 @@ typedef struct { } mfxExtMBDisableSkipMap; MFX_PACK_END() -#if (MFX_VERSION >= MFX_VERSION_NEXT) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 DPBSize; - mfxU16 reserved[11]; - - struct { - mfxU32 FrameOrder; - mfxU16 PicType; - mfxU16 LongTermIdx; - mfxU16 reserved[4]; - } DPB[32]; -} mfxExtDPB; -MFX_PACK_END() - -#endif - /*! The GeneralConstraintFlags enumerator uses bit-ORed values to itemize HEVC bitstream indications for specific profiles. Each value indicates for format range extensions profiles. */ enum { @@ -3559,29 +3540,6 @@ typedef struct { } mfxExtAVCRoundingOffset; MFX_PACK_END() -#if (MFX_VERSION >= MFX_VERSION_NEXT) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[12]; - - struct { - mfxU16 Scale; - mfxU16 QPI; - mfxU16 QPP; - mfxU16 QPB; - mfxU32 TargetKbps; - mfxU32 MaxKbps; - mfxU32 BufferSizeInKB; - mfxU32 InitialDelayInKB; - mfxU16 reserved1[20]; - } Layer[8]; -} mfxExtTemporalLayers; -MFX_PACK_END() - -#endif - MFX_PACK_BEGIN_USUAL_STRUCT() /*! Used by the application to specify dirty regions within a frame during encoding. It may be used at initialization or at runtime. @@ -3651,50 +3609,6 @@ typedef struct { } mfxExtMoveRect; MFX_PACK_END() -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* ScalingMatrixType */ -enum { - MFX_SCALING_MATRIX_SPS = 1, - MFX_SCALING_MATRIX_PPS = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Type; - mfxU16 reserved[5]; - - /* [4x4_Intra_Y, 4x4_Intra_Cb, 4x4_Intra_Cr, - 4x4_Inter_Y, 4x4_Inter_Cb, 4x4_Inter_Cr, - 8x8_Intra_Y, 8x8_Inter_Y, 8x8_Intra_Cb, - 8x8_Inter_Cb, 8x8_Intra_Cr, 8x8_Inter_Cr] */ - mfxU8 ScalingListPresent[12]; - - /* [Intra_Y, Intra_Cb, Intra_Cr, - Inter_Y, Inter_Cb, Inter_Cr] */ - mfxU8 ScalingList4x4[6][16]; - - /* [Intra_Y, Inter_Y, Intra_Cb, - Inter_Cb, Intra_Cr, Inter_Cr] */ - mfxU8 ScalingList8x8[6][64]; -} mfxExtAVCScalingMatrix; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[28]; - - mfxU8 LoadMatrix[4]; // [LumaIntra, LumaInter, ChromaIntra, ChromaInter] - mfxU8 Matrix[4][64]; // [LumaIntra, LumaInter, ChromaIntra, ChromaInter] -} mfxExtMPEG2QuantMatrix; -MFX_PACK_END() - -#endif - /*! The Angle enumerator itemizes valid rotation angles. */ enum { MFX_ANGLE_0 = 0, /*!< 0 degrees. */ @@ -3745,7 +3659,15 @@ enum { MFX_SCALING_MODE_DEFAULT = 0, /*!< Default scaling mode. The library selects the most appropriate scaling method. */ MFX_SCALING_MODE_LOWPOWER = 1, /*!< Low power scaling mode which is applicable for library implementations. The exact scaling algorithm is defined by the library. */ - MFX_SCALING_MODE_QUALITY = 2 /*!< The best quality scaling mode */ + MFX_SCALING_MODE_QUALITY = 2, /*!< The best quality scaling mode. */ + + + MFX_SCALING_MODE_VENDOR = 1000, /*!< The enumeration to separate common scaling controls above and vendor specific. */ + + + MFX_SCALING_MODE_INTEL_GEN_COMPUTE = MFX_SCALING_MODE_VENDOR + 1, /*! The mode to run scaling operation on Execution Units (EUs). */ + MFX_SCALING_MODE_INTEL_GEN_VDBOX = MFX_SCALING_MODE_VENDOR + 2, /*! The special optimization mode where scaling operation running on SFC (Scaler & Format Converter) is coupled with VDBOX (also known as Multi-Format Codec fixed-function engine). This mode is applicable for DECODE_VPP domain functions. */ + MFX_SCALING_MODE_INTEL_GEN_VEBOX = MFX_SCALING_MODE_VENDOR + 3 /*! The special optimization mode where scaling operation running on SFC is coupled with VEBOX (HW video processing pipe). */ }; /*! The InterpolationMode enumerator specifies type of interpolation method used by VPP scaling filter. */ @@ -3771,26 +3693,6 @@ typedef struct { } mfxExtVPPScaling; MFX_PACK_END() -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* SceneChangeType */ -enum { - MFX_SCENE_NO_CHANGE = 0, - MFX_SCENE_START = 1, - MFX_SCENE_END = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Type; - mfxU16 reserved[11]; -} mfxExtSceneChange; -MFX_PACK_END() - -#endif - typedef mfxExtAVCRefListCtrl mfxExtHEVCRefListCtrl; typedef mfxExtAVCRefLists mfxExtHEVCRefLists; typedef mfxExtAvcTemporalLayers mfxExtHEVCTemporalLayers; @@ -4042,13 +3944,7 @@ typedef struct { sequence header will be zero. It is the responsibility of the application to update the NumFrame field with the correct value. See the CodingOptionValue enumerator for values of this option. */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxI16 LoopFilterRefDelta[4]; /* Contains the adjustment needed for the filter level based on the chosen reference frame. See - the P9ReferenceFrame enumerator for array IDs. */ - mfxI16 LoopFilterModeDelta[2]; /* Contains the adjustment needed for the filter level based on the chosen mode. */ -#else // API 1.26 mfxI16 reserved1[6]; -#endif mfxI16 QIndexDeltaLumaDC; /*!< Specifies an offset for a particular quantization parameter. */ mfxI16 QIndexDeltaChromaAC; /*!< Specifies an offset for a particular quantization parameter. */ mfxI16 QIndexDeltaChromaDC; /*!< Specifies an offset for a particular quantization parameter. */ @@ -4136,17 +4032,6 @@ typedef struct { MFX_PACK_END() -#if (MFX_VERSION >= MFX_VERSION_NEXT) -/*! The MCTFTemporalMode enumerator itemizes temporal filtering modes. */ -enum { - MFX_MCTF_TEMPORAL_MODE_UNKNOWN = 0, - MFX_MCTF_TEMPORAL_MODE_SPATIAL = 1, - MFX_MCTF_TEMPORAL_MODE_1REF = 2, - MFX_MCTF_TEMPORAL_MODE_2REF = 3, - MFX_MCTF_TEMPORAL_MODE_4REF = 4 -}; -#endif - MFX_PACK_BEGIN_USUAL_STRUCT() /*! Provides setup for the Motion-Compensated Temporal Filter (MCTF) during the VPP initialization and for control @@ -4164,25 +4049,7 @@ typedef struct { If the field value is in the range of 1 to 20 inclusive, MCTF operates in fixed-strength mode with the given strength of MCTF process. At runtime, values of 0 and greater than 20 are ignored. */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 Overlap; /* Turn off or turn on overlap during motion estimation/compensation. See the CodingOptionValue enumerator for - values of this option. */ - mfxU32 BitsPerPixelx100k; /* Carries information of a compressed bitstream that is the result of an encoding process following - MCTF (if any). Actual average number of bits spent per pixel in the compressed bitstream is derived as - BitsPerPixelx100k divided by 100000.0. The MCTF process may use this information as an additional hint to - optimize the filtering process for a particular encoding applied afterwards. */ - mfxU16 Deblocking; /* Turn the deblocking filter off or on within MCTF process. See the CodingOptionValue enumerator for - values of this option. */ - mfxU16 TemporalMode; /* See the MCTFTemporalMode enumerator for values of this option. These modes are all different in - terms of quality improvements and performance. In general, 4-reference filtering provides the highest quality - and 1-reference filtering provides highest speed. The spatial filtering process is different - as it does not use any processing between frames. Thus spatial filtering provides the smallest memory footprint. */ - mfxU16 MVPrecision; /* Determines how precise the motion compensation process is. See the MVPrecision enumerator for values of this option. - Integer and quarter-pixel are supported. */ - mfxU16 reserved[21]; -#else mfxU16 reserved[27]; -#endif } mfxExtVppMctf; MFX_PACK_END() diff --git a/source/elements/oneVPL/include/vpl/mfxvideo++.h b/source/elements/oneVPL/include/vpl/mfxvideo++.h new file mode 100644 index 0000000000..1b10390813 --- /dev/null +++ b/source/elements/oneVPL/include/vpl/mfxvideo++.h @@ -0,0 +1,222 @@ +/*########################################################################### + # Copyright (C) 2017-2020 Intel Corporation + # + # SPDX-License-Identifier: MIT + ###########################################################################*/ + +#ifndef __MFXVIDEOPLUSPLUS_H +#define __MFXVIDEOPLUSPLUS_H + +#include "mfxvideo.h" + +class MFXVideoSession { +public: + MFXVideoSession(void) { + m_session = (mfxSession)0; + } + virtual ~MFXVideoSession(void) { + Close(); + } + + virtual mfxStatus Init(mfxIMPL impl, mfxVersion *ver) { + return MFXInit(impl, ver, &m_session); + } + virtual mfxStatus InitEx(mfxInitParam par) { + return MFXInitEx(par, &m_session); + } + virtual mfxStatus Close(void) { + mfxStatus mfxRes; + mfxRes = MFXClose(m_session); + m_session = (mfxSession)0; + return mfxRes; + } + + virtual mfxStatus QueryIMPL(mfxIMPL *impl) { + return MFXQueryIMPL(m_session, impl); + } + virtual mfxStatus QueryVersion(mfxVersion *version) { + return MFXQueryVersion(m_session, version); + } + + virtual mfxStatus JoinSession(mfxSession child_session) { + return MFXJoinSession(m_session, child_session); + } + virtual mfxStatus DisjoinSession() { + return MFXDisjoinSession(m_session); + } + virtual mfxStatus CloneSession(mfxSession *clone) { + return MFXCloneSession(m_session, clone); + } + virtual mfxStatus SetPriority(mfxPriority priority) { + return MFXSetPriority(m_session, priority); + } + virtual mfxStatus GetPriority(mfxPriority *priority) { + return MFXGetPriority(m_session, priority); + } + + virtual mfxStatus SetFrameAllocator(mfxFrameAllocator *allocator) { + return MFXVideoCORE_SetFrameAllocator(m_session, allocator); + } + virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) { + return MFXVideoCORE_SetHandle(m_session, type, hdl); + } + virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *hdl) { + return MFXVideoCORE_GetHandle(m_session, type, hdl); + } + virtual mfxStatus QueryPlatform(mfxPlatform *platform) { + return MFXVideoCORE_QueryPlatform(m_session, platform); + } + + virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) { + return MFXVideoCORE_SyncOperation(m_session, syncp, wait); + } + + virtual operator mfxSession(void) { + return m_session; + } + +protected: + mfxSession m_session; // (mfxSession) handle to the owning session +private: + MFXVideoSession(const MFXVideoSession &); + void operator=(MFXVideoSession &); +}; + +class MFXVideoENCODE { +public: + explicit MFXVideoENCODE(mfxSession session) { + m_session = session; + } + virtual ~MFXVideoENCODE(void) { + Close(); + } + + virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { + return MFXVideoENCODE_Query(m_session, in, out); + } + virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) { + return MFXVideoENCODE_QueryIOSurf(m_session, par, request); + } + virtual mfxStatus Init(mfxVideoParam *par) { + return MFXVideoENCODE_Init(m_session, par); + } + virtual mfxStatus Reset(mfxVideoParam *par) { + return MFXVideoENCODE_Reset(m_session, par); + } + virtual mfxStatus Close(void) { + return MFXVideoENCODE_Close(m_session); + } + + virtual mfxStatus GetVideoParam(mfxVideoParam *par) { + return MFXVideoENCODE_GetVideoParam(m_session, par); + } + virtual mfxStatus GetEncodeStat(mfxEncodeStat *stat) { + return MFXVideoENCODE_GetEncodeStat(m_session, stat); + } + + virtual mfxStatus EncodeFrameAsync(mfxEncodeCtrl *ctrl, + mfxFrameSurface1 *surface, + mfxBitstream *bs, + mfxSyncPoint *syncp) { + return MFXVideoENCODE_EncodeFrameAsync(m_session, ctrl, surface, bs, syncp); + } + +protected: + mfxSession m_session; // (mfxSession) handle to the owning session +}; + +class MFXVideoDECODE { +public: + explicit MFXVideoDECODE(mfxSession session) { + m_session = session; + } + virtual ~MFXVideoDECODE(void) { + Close(); + } + + virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { + return MFXVideoDECODE_Query(m_session, in, out); + } + virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxVideoParam *par) { + return MFXVideoDECODE_DecodeHeader(m_session, bs, par); + } + virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) { + return MFXVideoDECODE_QueryIOSurf(m_session, par, request); + } + virtual mfxStatus Init(mfxVideoParam *par) { + return MFXVideoDECODE_Init(m_session, par); + } + virtual mfxStatus Reset(mfxVideoParam *par) { + return MFXVideoDECODE_Reset(m_session, par); + } + virtual mfxStatus Close(void) { + return MFXVideoDECODE_Close(m_session); + } + + virtual mfxStatus GetVideoParam(mfxVideoParam *par) { + return MFXVideoDECODE_GetVideoParam(m_session, par); + } + + virtual mfxStatus GetDecodeStat(mfxDecodeStat *stat) { + return MFXVideoDECODE_GetDecodeStat(m_session, stat); + } + virtual mfxStatus GetPayload(mfxU64 *ts, mfxPayload *payload) { + return MFXVideoDECODE_GetPayload(m_session, ts, payload); + } + virtual mfxStatus SetSkipMode(mfxSkipMode mode) { + return MFXVideoDECODE_SetSkipMode(m_session, mode); + } + virtual mfxStatus DecodeFrameAsync(mfxBitstream *bs, + mfxFrameSurface1 *surface_work, + mfxFrameSurface1 **surface_out, + mfxSyncPoint *syncp) { + return MFXVideoDECODE_DecodeFrameAsync(m_session, bs, surface_work, surface_out, syncp); + } + +protected: + mfxSession m_session; // (mfxSession) handle to the owning session +}; + +class MFXVideoVPP { +public: + explicit MFXVideoVPP(mfxSession session) { + m_session = session; + } + virtual ~MFXVideoVPP(void) { + Close(); + } + + virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { + return MFXVideoVPP_Query(m_session, in, out); + } + virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest request[2]) { + return MFXVideoVPP_QueryIOSurf(m_session, par, request); + } + virtual mfxStatus Init(mfxVideoParam *par) { + return MFXVideoVPP_Init(m_session, par); + } + virtual mfxStatus Reset(mfxVideoParam *par) { + return MFXVideoVPP_Reset(m_session, par); + } + virtual mfxStatus Close(void) { + return MFXVideoVPP_Close(m_session); + } + + virtual mfxStatus GetVideoParam(mfxVideoParam *par) { + return MFXVideoVPP_GetVideoParam(m_session, par); + } + virtual mfxStatus GetVPPStat(mfxVPPStat *stat) { + return MFXVideoVPP_GetVPPStat(m_session, stat); + } + virtual mfxStatus RunFrameVPPAsync(mfxFrameSurface1 *in, + mfxFrameSurface1 *out, + mfxExtVppAuxData *aux, + mfxSyncPoint *syncp) { + return MFXVideoVPP_RunFrameVPPAsync(m_session, in, out, aux, syncp); + } + +protected: + mfxSession m_session; // (mfxSession) handle to the owning session +}; + +#endif //__MFXVIDEOPLUSPLUS_H diff --git a/source/elements/oneVPL/include/onevpl/mfxvideo.h b/source/elements/oneVPL/include/vpl/mfxvideo.h old mode 100644 new mode 100755 similarity index 94% rename from source/elements/oneVPL/include/onevpl/mfxvideo.h rename to source/elements/oneVPL/include/vpl/mfxvideo.h index d007ab34dc..fc1ba28b9b --- a/source/elements/oneVPL/include/onevpl/mfxvideo.h +++ b/source/elements/oneVPL/include/vpl/mfxvideo.h @@ -111,6 +111,8 @@ MFX_PACK_END() @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoCORE_SetFrameAllocator(mfxSession session, mfxFrameAllocator *allocator); @@ -130,6 +132,9 @@ mfxStatus MFX_CDECL MFXVideoCORE_SetFrameAllocator(mfxSession session, mfxFrameA MFX_ERR_UNDEFINED_BEHAVIOR The same handle is redefined. For example, the function has been called twice with the same handle type or an internal handle has been created before this function call. + MFX_ERR_DEVICE_FAILED The SDK cannot initialize using the handle. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoCORE_SetHandle(mfxSession session, mfxHandleType type, mfxHDL hdl); @@ -147,6 +152,8 @@ mfxStatus MFX_CDECL MFXVideoCORE_SetHandle(mfxSession session, mfxHandleType typ @return MFX_ERR_NONE The function completed successfully. \n MFX_ERR_UNDEFINED_BEHAVIOR Specified handle type not found. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoCORE_GetHandle(mfxSession session, mfxHandleType type, mfxHDL *hdl); @@ -159,6 +166,8 @@ mfxStatus MFX_CDECL MFXVideoCORE_GetHandle(mfxSession session, mfxHandleType typ @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.19. */ mfxStatus MFX_CDECL MFXVideoCORE_QueryPlatform(mfxSession session, mfxPlatform* platform); @@ -176,6 +185,8 @@ mfxStatus MFX_CDECL MFXVideoCORE_QueryPlatform(mfxSession session, mfxPlatform* MFX_ERR_NONE_PARTIAL_OUTPUT The function completed successfully, bitstream contains a portion of the encoded frame according to required granularity. \n MFX_WRN_IN_EXECUTION The specified asynchronous function is in execution. \n MFX_ERR_ABORTED The specified asynchronous function aborted due to data dependency on a previous asynchronous function that did not complete. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoCORE_SyncOperation(mfxSession session, mfxSyncPoint syncp, mfxU32 wait); @@ -199,6 +210,8 @@ mfxStatus MFX_CDECL MFXVideoCORE_SyncOperation(mfxSession session, mfxSyncPoint MFX_ERR_NOT_INITIALIZED If VPP was not initialized (allocator needs to know surface size from somewhere). \n MFX_ERR_MEMORY_ALLOC In case of any other internal allocation error. + @since This function is available since API version 2.0. + */ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForVPP(mfxSession session, mfxFrameSurface1** surface); @@ -220,6 +233,8 @@ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForVPP(mfxSession session, mfxFrameSurfa MFX_ERR_NOT_INITIALIZED If VPP was not initialized (allocator needs to know surface size from somewhere). \n MFX_ERR_MEMORY_ALLOC In case of any other internal allocation error. + @since This function is available since API version 2.1. + */ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForVPPOut(mfxSession session, mfxFrameSurface1** surface); @@ -245,6 +260,8 @@ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForVPPOut(mfxSession session, mfxFrameSu MFX_ERR_NOT_INITIALIZED If the encoder was not initialized (allocator needs to know surface size from somewhere).\n MFX_ERR_MEMORY_ALLOC In case of any other internal allocation error. + @since This function is available since API version 2.0. + */ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForEncode(mfxSession session, mfxFrameSurface1** surface); @@ -271,6 +288,8 @@ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForEncode(mfxSession session, mfxFrameSu MFX_ERR_NOT_INITIALIZED If the decoder was not initialized (allocator needs to know surface size from somewhere).\n MFX_ERR_MEMORY_ALLOC Other internal allocation error. + @since This function is available since API version 2.0. + */ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForDecode(mfxSession session, mfxFrameSurface1** surface); @@ -308,6 +327,8 @@ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForDecode(mfxSession session, mfxFrameSu MFX_WRN_PARTIAL_ACCELERATION The underlying hardware does not fully support the specified video parameters. The encoding may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); @@ -335,6 +356,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_Query(mfxSession session, mfxVideoParam *in, MFX_WRN_PARTIAL_ACCELERATION The underlying hardware does not fully support the specified video parameters. The encoding may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request); @@ -356,6 +379,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_QueryIOSurf(mfxSession session, mfxVideoParam The encoding may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. \n MFX_ERR_UNDEFINED_BEHAVIOR The function is called twice without a close; + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_Init(mfxSession session, mfxVideoParam *par); @@ -374,6 +399,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_Init(mfxSession session, mfxVideoParam *par); Reset requires additional memory allocation and cannot be executed. The application should close the component and then reinitialize it. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_Reset(mfxSession session, mfxVideoParam *par); @@ -385,6 +412,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_Reset(mfxSession session, mfxVideoParam *par) @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_Close(mfxSession session); @@ -401,6 +430,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_Close(mfxSession session); @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_GetVideoParam(mfxSession session, mfxVideoParam *par); @@ -412,6 +443,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_GetVideoParam(mfxSession session, mfxVideoPar @param[in] stat Pointer to the mfxEncodeStat structure. @return MFX_ERR_NONE The function completed successfully. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_GetEncodeStat(mfxSession session, mfxEncodeStat *stat); @@ -451,8 +484,10 @@ mfxStatus MFX_CDECL MFXVideoENCODE_GetEncodeStat(mfxSession session, mfxEncodeSt See the :ref:`Working with Microsoft* DirectX* Applications section` for further information. \endverbatim \n - MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again in a few milliseconds. \n + MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again after MFXVideoCORE_SyncOperation or in a few milliseconds. \n MFX_ERR_INCOMPATIBLE_VIDEO_PARAM Inconsistent parameters detected not conforming to Configuration Parameter Constraints. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp); @@ -480,6 +515,8 @@ mfxStatus MFX_CDECL MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncod MFX_WRN_PARTIAL_ACCELERATION The underlying hardware does not fully support the specified video parameters. The decoding may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); @@ -508,6 +545,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_Query(mfxSession session, mfxVideoParam *in, - MFX_ERR_UNSUPPORTED ``CodecId`` field of the mfxVideoParam structure indicates some unsupported codec. \n - MFX_ERR_INVALID_HANDLE Session is not initialized. \n - MFX_ERR_NULL_PTR @p bs or @p par pointer is NULL. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_DecodeHeader(mfxSession session, mfxBitstream *bs, mfxVideoParam *par); @@ -535,6 +574,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_DecodeHeader(mfxSession session, mfxBitstream MFX_WRN_PARTIAL_ACCELERATION The underlying hardware does not fully support the specified video parameters. The encoding may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request); @@ -556,6 +597,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_QueryIOSurf(mfxSession session, mfxVideoParam The encoding may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. \n MFX_ERR_UNDEFINED_BEHAVIOR The function is called twice without a close. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_Init(mfxSession session, mfxVideoParam *par); @@ -581,6 +624,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_Init(mfxSession session, mfxVideoParam *par); Reset requires additional memory allocation and cannot be executed. The application should close the component and then reinitialize it. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_Reset(mfxSession session, mfxVideoParam *par); @@ -592,6 +637,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_Reset(mfxSession session, mfxVideoParam *par) @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_Close(mfxSession session); @@ -608,6 +655,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_Close(mfxSession session); @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_GetVideoParam(mfxSession session, mfxVideoParam *par); @@ -620,6 +669,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_GetVideoParam(mfxSession session, mfxVideoPar @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_GetDecodeStat(mfxSession session, mfxDecodeStat *stat); @@ -636,6 +687,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_GetDecodeStat(mfxSession session, mfxDecodeSt @return MFX_ERR_NONE The function completed successfully and the output surface is ready for decoding \n MFX_WRN_VALUE_NOT_CHANGED The skip mode is not affected as the maximum or minimum skip range is reached. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_SetSkipMode(mfxSession session, mfxSkipMode mode); @@ -656,6 +709,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_SetSkipMode(mfxSession session, mfxSkipMode m @return MFX_ERR_NONE The function completed successfully and the output buffer is ready for decoding. \n MFX_ERR_NOT_ENOUGH_BUFFER The payload buffer size is insufficient. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_GetPayload(mfxSession session, mfxU64 *ts, mfxPayload *payload); @@ -705,10 +760,12 @@ mfxStatus MFX_CDECL MFXVideoDECODE_GetPayload(mfxSession session, mfxU64 *ts, mf See the :ref:`Working with Microsoft* DirectX* Applications section` for further information. \endverbatim \n - MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again in a few milliseconds. \n + MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again after MFXVideoCORE_SyncOperation or in a few milliseconds. \n MFX_WRN_VIDEO_PARAM_CHANGED The decoder detected a new sequence header in the bitstream. Video parameters may have changed. \n MFX_ERR_INCOMPATIBLE_VIDEO_PARAM The decoder detected incompatible video parameters in the bitstream and failed to follow them. \n MFX_ERR_REALLOC_SURFACE Bigger surface_work required. May be returned only if mfxInfoMFX::EnableReallocRequest was set to ON during initialization. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoDECODE_DecodeFrameAsync(mfxSession session, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp); @@ -736,6 +793,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_DecodeFrameAsync(mfxSession session, mfxBitst MFX_WRN_PARTIAL_ACCELERATION The underlying hardware does not fully support the specified video parameters. The video processing may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); @@ -763,6 +822,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_Query(mfxSession session, mfxVideoParam *in, mfx MFX_WRN_PARTIAL_ACCELERATION The underlying hardware does not fully support the specified video parameters. The video processing may be partially accelerated. Only hardware implementations may return this status code. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest request[2]); @@ -785,6 +846,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_QueryIOSurf(mfxSession session, mfxVideoParam *p MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. \n MFX_ERR_UNDEFINED_BEHAVIOR The function is called twice without a close. \n MFX_WRN_FILTER_SKIPPED The VPP skipped one or more filters requested by the application. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_Init(mfxSession session, mfxVideoParam *par); @@ -802,6 +865,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_Init(mfxSession session, mfxVideoParam *par); Reset requires additional memory allocation and cannot be executed. The application should close the component and then reinitialize it. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_Reset(mfxSession session, mfxVideoParam *par); @@ -813,6 +878,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_Reset(mfxSession session, mfxVideoParam *par); @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_Close(mfxSession session); @@ -828,6 +895,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_Close(mfxSession session); @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_GetVideoParam(mfxSession session, mfxVideoParam *par); @@ -840,6 +909,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_GetVideoParam(mfxSession session, mfxVideoParam @return MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_GetVPPStat(mfxSession session, mfxVPPStat *stat); @@ -873,7 +944,9 @@ mfxStatus MFX_CDECL MFXVideoVPP_GetVPPStat(mfxSession session, mfxVPPStat *stat) See the :ref:`Working with Microsoft* DirectX* Applications section` for further information. \endverbatim \n - MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again in a few milliseconds. + MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again after MFXVideoCORE_SyncOperation or in a few milliseconds. + + @since This function is available since API version 1.0. */ mfxStatus MFX_CDECL MFXVideoVPP_RunFrameVPPAsync(mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp); @@ -898,7 +971,9 @@ mfxStatus MFX_CDECL MFXVideoVPP_RunFrameVPPAsync(mfxSession session, mfxFrameSur See the :ref:`Working with Microsoft* DirectX* Applications section` for further information. \endverbatim \n - MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again in a few milliseconds. + MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again after MFXVideoCORE_SyncOperation or in a few milliseconds. + + @since This function is available since API version 2.1. */ mfxStatus MFX_CDECL MFXVideoVPP_ProcessFrameAsync(mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 **out); @@ -923,6 +998,8 @@ mfxStatus MFX_CDECL MFXVideoVPP_ProcessFrameAsync(mfxSession session, mfxFrameSu resolved. \n MFX_ERR_UNDEFINED_BEHAVIOR The component is already initialized. \n MFX_WRN_FILTER_SKIPPED The VPP skipped one or more filters requested by the application. + + @since This function is available since API version 2.1. */ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_Init(mfxSession session, mfxVideoParam* decode_par, mfxVideoChannelParam** vpp_par_array, mfxU32 num_vpp_par); @@ -950,10 +1027,12 @@ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_Init(mfxSession session, mfxVideoParam* See the :ref:`Working with Microsoft* DirectX* Applications section` for further information. \endverbatim \n - MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again in a few milliseconds. \n + MFX_WRN_DEVICE_BUSY Hardware device is currently busy. Call this function again after MFXVideoCORE_SyncOperation or in a few milliseconds. \n MFX_WRN_VIDEO_PARAM_CHANGED The decoder detected a new sequence header in the bitstream. Video parameters may have changed. \n MFX_ERR_INCOMPATIBLE_VIDEO_PARAM The decoder detected incompatible video parameters in the bitstream and failed to follow them. \n MFX_ERR_NULL_PTR num_skip_channels doesn't equal to 0 when skip_channels is NULL. + + @since This function is available since API version 2.1. */ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_DecodeFrameAsync(mfxSession session, mfxBitstream *bs, mfxU32* skip_channels, mfxU32 num_skip_channels, mfxSurfaceArray **surf_array_out); @@ -980,6 +1059,8 @@ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_DecodeFrameAsync(mfxSession session, mfx component and then reinitialize it. \n MFX_WRN_INCOMPATIBLE_VIDEO_PARAM The function detected some video parameters were incompatible with others; incompatibility resolved. MFX_ERR_NULL_PTR Both pointers decode_par and vpp_par_array` equal to zero. + + @since This function is available since API version 2.1. */ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_Reset(mfxSession session, mfxVideoParam* decode_par, mfxVideoChannelParam** vpp_par_array, mfxU32 num_vpp_par); @@ -996,15 +1077,28 @@ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_Reset(mfxSession session, mfxVideoParam* MFX_ERR_NONE The function completed successfully. \n MFX_ERR_NULL_PTR par pointer is NULL. \n MFX_ERR_NOT_FOUND the library is not able to find VPP channel with such channel_id. + + @since This function is available since API version 2.1. */ mfxStatus MFX_CDECL MFXVideoDECODE_VPP_GetChannelParam(mfxSession session, mfxVideoChannelParam *par, mfxU32 channel_id); +/*! + @brief + This function is similar to MFXVideoDECODE_Close. It terminates the current decoding and vpp operation and de-allocates any internal tables or structures. + + @param[in] session Session handle. + + @return + MFX_ERR_NONE The function completed successfully. \n + + @since This function is available since API version 2.1. +*/ + +mfxStatus MFX_CDECL MFXVideoDECODE_VPP_Close(mfxSession session); + /*! Alias for MFXVideoDECODE_DecodeHeader function. */ #define MFXVideoDECODE_VPP_DecodeHeader MFXVideoDECODE_DecodeHeader -/*! Alias for MFXVideoDECODE_Close function. */ -#define MFXVideoDECODE_VPP_Close MFXVideoDECODE_Close - /*! Alias for MFXVideoDECODE_GetVideoParam function. */ #define MFXVideoDECODE_VPP_GetVideoParam MFXVideoDECODE_GetVideoParam diff --git a/source/elements/oneVPL/include/onevpl/mfxvp8.h b/source/elements/oneVPL/include/vpl/mfxvp8.h similarity index 100% rename from source/elements/oneVPL/include/onevpl/mfxvp8.h rename to source/elements/oneVPL/include/vpl/mfxvp8.h diff --git a/source/elements/oneVPL/source/API_ref/VPL_defines.rst b/source/elements/oneVPL/source/API_ref/VPL_defines.rst index b48102dca6..f58df20dd6 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_defines.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_defines.rst @@ -50,9 +50,6 @@ API .. doxygendefine:: MFX_VERSION_MINOR :project: oneVPL -.. doxygendefine:: MFX_VERSION_NEXT - :project: oneVPL - .. doxygendefine:: MFX_VPPDESCRIPTION_VERSION :project: oneVPL diff --git a/source/elements/oneVPL/source/API_ref/VPL_disp_api_struct.rst b/source/elements/oneVPL/source/API_ref/VPL_disp_api_struct.rst index 6921c66f12..ba1f84ad42 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_disp_api_struct.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_disp_api_struct.rst @@ -74,3 +74,11 @@ mfxAccelerationModeDescription :project: oneVPL :members: :protected-members: + +mfxImplementedFunctions +----------------------- + +.. doxygenstruct:: mfxImplementedFunctions + :project: oneVPL + :members: + :protected-members: diff --git a/source/elements/oneVPL/source/API_ref/VPL_enums.rst b/source/elements/oneVPL/source/API_ref/VPL_enums.rst index 7ca108f2b5..94c9c37f90 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_enums.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_enums.rst @@ -1,4 +1,4 @@ -.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation +.. SPDX-FileCopyrightText: 2019-2021 Intel Corporation .. .. SPDX-License-Identifier: CC-BY-4.0 @@ -151,6 +151,8 @@ specify the desired location. .. doxygenenumvalue:: MFX_CHROMA_SITING_HORIZONTAL_CENTER :project: oneVPL +.. _codec-format-fourcc: + ----------------- CodecFormatFourCC ----------------- @@ -253,6 +255,18 @@ H.264 Level 5-5.2 .. doxygenenumvalue:: MFX_LEVEL_AVC_52 :project: oneVPL +H.264 Level 6-6.2 +----------------- + +.. doxygenenumvalue:: MFX_LEVEL_AVC_6 + :project: oneVPL + +.. doxygenenumvalue:: MFX_LEVEL_AVC_61 + :project: oneVPL + +.. doxygenenumvalue:: MFX_LEVEL_AVC_62 + :project: oneVPL + MPEG2 Levels ------------ @@ -793,6 +807,9 @@ extended buffers or video processing algorithm identifiers. .. doxygenenumvalue:: MFX_EXTBUFF_VPP_DENOISE :project: oneVPL +.. doxygenenumvalue:: MFX_EXTBUFF_VPP_DENOISE2 + :project: oneVPL + .. doxygenenumvalue:: MFX_EXTBUFF_VPP_SCENE_ANALYSIS :project: oneVPL @@ -937,12 +954,6 @@ extended buffers or video processing algorithm identifiers. .. doxygenenumvalue:: MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME :project: oneVPL -.. doxygenenumvalue:: MFX_EXTBUFF_MULTI_FRAME_PARAM - :project: oneVPL - -.. doxygenenumvalue:: MFX_EXTBUFF_MULTI_FRAME_CONTROL - :project: oneVPL - .. doxygenenumvalue:: MFX_EXTBUFF_ENCODED_UNITS_INFO :project: oneVPL @@ -997,6 +1008,10 @@ extended buffers or video processing algorithm identifiers. .. doxygenenumvalue:: MFX_EXTBUFF_CROPS :project: oneVPL +.. doxygenenumvalue:: MFX_EXTBUFF_AV1_FILM_GRAIN_PARAM + :project: oneVPL + + ---------------- ExtMemBufferType ---------------- @@ -1591,6 +1606,15 @@ The MirroringType enumerator itemizes mirroring types. .. doxygenenumvalue:: MFX_MIRRORING_VERTICAL :project: oneVPL +----------- +DenoiseMode +----------- + +The mfxDenoiseMode enumerator itemizes denoise modes. + +.. doxygenenum:: mfxDenoiseMode + :project: oneVPL + --------------- MPEG-2 Profiles --------------- @@ -1926,6 +1950,18 @@ The ScalingMode enumerator itemizes variants of scaling filter implementation. .. doxygenenumvalue:: MFX_SCALING_MODE_QUALITY :project: oneVPL +.. doxygenenumvalue:: MFX_SCALING_MODE_VENDOR + :project: oneVPL + +.. doxygenenumvalue:: MFX_SCALING_MODE_INTEL_GEN_COMPUTE + :project: oneVPL + +.. doxygenenumvalue:: MFX_SCALING_MODE_INTEL_GEN_VDBOX + :project: oneVPL + +.. doxygenenumvalue:: MFX_SCALING_MODE_INTEL_GEN_VEBOX + :project: oneVPL + ------------ ScenarioInfo ------------ diff --git a/source/elements/oneVPL/source/API_ref/VPL_func_vid_decode_vpp.rst b/source/elements/oneVPL/source/API_ref/VPL_func_vid_decode_vpp.rst index c8c996804a..29f51c8c56 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_func_vid_decode_vpp.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_func_vid_decode_vpp.rst @@ -43,3 +43,20 @@ MFXVideoDECODE_VPP_GetChannelParam .. doxygenfunction:: MFXVideoDECODE_VPP_GetChannelParam :project: oneVPL + +MFXVideoDECODE_VPP_DecodeFrameAsync +----------------------------------- + +.. doxygenfunction:: MFXVideoDECODE_VPP_DecodeFrameAsync + :project: oneVPL + +.. important:: The :cpp:func:`MFXVideoDECODE_VPP_DecodeFrameAsync` is mandatory when implementing a combined decode plus vpp. + +MFXVideoDECODE_VPP_Close +------------------------ + +.. doxygenfunction:: MFXVideoDECODE_VPP_Close + :project: oneVPL + +.. important:: The :cpp:func:`MFXVideoDECODE_VPP_Close` is mandatory when implementing a combined decode plus vpp. + diff --git a/source/elements/oneVPL/source/API_ref/VPL_structs_memory.rst b/source/elements/oneVPL/source/API_ref/VPL_structs_memory.rst index e34cad2301..72b0befbd0 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_structs_memory.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_structs_memory.rst @@ -62,6 +62,11 @@ mfxFrameData :members: :protected-members: +.. doxygenstruct:: mfxY416 + :project: oneVPL + :members: + :protected-members: + .. doxygenstruct:: mfxA2RGB10 :project: oneVPL :members: diff --git a/source/elements/oneVPL/source/API_ref/VPL_structs_vpp.rst b/source/elements/oneVPL/source/API_ref/VPL_structs_vpp.rst index 815198d3b3..6abe6155c9 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_structs_vpp.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_structs_vpp.rst @@ -107,6 +107,15 @@ mfxExtVPPDenoise :protected-members: :undoc-members: +mfxExtVPPDenoise2 +----------------- + +.. doxygenstruct:: mfxExtVPPDenoise2 + :project: oneVPL + :members: + :protected-members: + :undoc-members: + mfxExtVPPDetail --------------- diff --git a/source/elements/oneVPL/source/appendix/VPL_intel_media_sdk.rst b/source/elements/oneVPL/source/VPL_intel_media_sdk.rst similarity index 87% rename from source/elements/oneVPL/source/appendix/VPL_intel_media_sdk.rst rename to source/elements/oneVPL/source/VPL_intel_media_sdk.rst index 65b575f059..e1c47f203e 100644 --- a/source/elements/oneVPL/source/appendix/VPL_intel_media_sdk.rst +++ b/source/elements/oneVPL/source/VPL_intel_media_sdk.rst @@ -9,6 +9,8 @@ oneVPL for |msdk_full_name| Users oneVPL is source compatible with |msdk_full_name|. Applications can use |msdk_full_name| to target older hardware and oneVPL to target everything else. Some obsolete features of |msdk_full_name| have been omitted from oneVPL. +Hereinafter the term "Legacy" will be used to describe a behavior when oneVPL +is called by |msdk_full_name| applications. ------------------------------- oneVPL Ease of Use Enhancements @@ -24,12 +26,16 @@ enhancements include the following: - New memory management and components (session) interoperability. See :ref:`internal-mem-manage` and :ref:`decoding-proc` for more details. +.. _new-api: + ------------------ New APIs in oneVPL ------------------ oneVPL introduces new functions that are not available in |msdk_full_name|. +.. _dispatcher-api: + New oneVPL dispatcher functions: - :cpp:func:`MFXLoad` @@ -56,9 +62,9 @@ New oneVPL session initialization: - :cpp:func:`MFXInitialize` ------------------------------------------ +--------------------------------- |msdk_full_name| Feature Removals ------------------------------------------ +--------------------------------- The following |msdk_full_name| features are considered obsolete and are not included in oneVPL: @@ -92,9 +98,11 @@ included in oneVPL: - **Surface Type Neutral Transcoding.** Opaque memory support is removed and replaced with internal memory allocation concept. ------------------------------------------ +.. _deprecated-api: + +----------------------------- |msdk_full_name| API Removals ------------------------------------------ +----------------------------- The following |msdk_full_name| functions are not included in oneVPL: @@ -173,3 +181,16 @@ is not supported by oneVPL: - Code previously compiled with |msdk_full_name| and executed using a oneVPL runtime will generate an :cpp:enumerator:`MFX_ERR_NOT_IMPLEMENTED` error when calling a removed function. + +--------------------------- +|msdk_full_name| Legacy API +--------------------------- + +oneVPL contains following header files from |msdk_full_name| included for the +simplification of existing applications migration to oneVPL: + +- mfxvideo++.h + +.. important:: |msdk_full_name| obsolette API removed from those header files. + Code compiled with the oneVPL API headers will generate a compile and/or + link error when attempting to use a removed API. diff --git a/source/elements/oneVPL/source/VPL_summary.rst b/source/elements/oneVPL/source/VPL_summary.rst index 062dc884c1..c65c8caf5f 100644 --- a/source/elements/oneVPL/source/VPL_summary.rst +++ b/source/elements/oneVPL/source/VPL_summary.rst @@ -55,15 +55,15 @@ must not return :cpp:enumerator:`mfxStatus::MFX_ERR_NOT_IMPLEMENTED`. * - :cpp:func:`MFXQueryVersion` - 1.0 * - :cpp:func:`MFXJoinSession` - - 1.0 + - 1.1 * - :cpp:func:`MFXDisjoinSession` - - 1.0 + - 1.1 * - :cpp:func:`MFXCloneSession` - - 1.0 + - 1.1 * - :cpp:func:`MFXSetPriority` - - 1.0 + - 1.1 * - :cpp:func:`MFXGetPriority` - - 1.0 + - 1.1 * - :cpp:func:`MFXVideoCORE_SetFrameAllocator` - 1.0 * - :cpp:func:`MFXVideoCORE_SetHandle` @@ -128,6 +128,12 @@ must not return :cpp:enumerator:`mfxStatus::MFX_ERR_NOT_IMPLEMENTED`. - 1.0 * - :cpp:func:`MFXVideoCORE_QueryPlatform` - 1.19 + * - :cpp:func:`MFXQueryAdapters` + - 1.31 + * - :cpp:func:`MFXQueryAdaptersDecode` + - 1.31 + * - :cpp:func:`MFXQueryAdaptersNumber` + - 1.31 * - :cpp:func:`MFXMemory_GetSurfaceForVPP` - 2.0 * - :cpp:func:`MFXMemory_GetSurfaceForEncode` @@ -144,6 +150,16 @@ must not return :cpp:enumerator:`mfxStatus::MFX_ERR_NOT_IMPLEMENTED`. - 2.1 * - :cpp:func:`MFXVideoVPP_ProcessFrameAsync` - 2.1 + * - :cpp:func:`MFXVideoDECODE_VPP_Init` + - 2.1 + * - :cpp:func:`MFXVideoDECODE_VPP_DecodeFrameAsync` + - 2.1 + * - :cpp:func:`MFXVideoDECODE_VPP_Reset` + - 2.1 + * - :cpp:func:`MFXVideoDECODE_VPP_GetChannelParam` + - 2.1 + * - :cpp:func:`MFXVideoDECODE_VPP_Close` + - 2.1 -------------- Mandatory APIs @@ -170,10 +186,11 @@ All implementations must implement the APIs listed in the - Required function for synchronization of asynchronous operations. -If the implementation implements any encoder, decoder, or VPP filter, it must +If the implementation exposes any encoder, decoder, or VPP filter, it must implement the corresponding mandatory APIs, as described in the -:ref:`Mandatory Encode `, :ref:`Decode ` and -:ref:`VPP ` APIs tables: +:ref:`Mandatory Encode `, :ref:`Decode `, +:ref:`VPP ` abd :ref:`Decode+VPP ` APIs +tables: .. _mandatory-enc-apis-table: @@ -217,6 +234,19 @@ implement the corresponding mandatory APIs, as described in the | :cpp:func:`MFXVideoVPP_RunFrameVPPAsync` or :cpp:func:`MFXVideoVPP_ProcessFrameAsync` - Required functions if the implementation implements any VPP filter. +.. _mandatory-dec-vpp-apis-table: + +.. list-table:: Mandatory Decode+VPP APIs + :header-rows: 1 + :widths: 50 50 + + * - **Functions** + - **Description** + * - | :cpp:func:`MFXVideoDECODE_VPP_Init` + | :cpp:func:`MFXVideoDECODE_VPP_DecodeFrameAsync` + | :cpp:func:`MFXVideoDECODE_VPP_Close` + - Required functions if the implementation implements any Decode+VPP component. + .. note:: Mandatory functions must not return the :cpp:enumerator:`MFX_ERR_NOT_IMPLEMENTED` status. @@ -225,6 +255,11 @@ the :cpp:func:`MFXQueryImplsDescription` function must return a valid :cpp:struct:`mfxImplDescription` structure instance with mandatory capabilities of the implementation, including decoder, encoder, or VPP capabilities information. +If the implementation supports internal memory allocation by exposing at least one of the +function from that family: :ref:`internal memory allocation and management API ` then +implementation of whole scope of the :cpp:struct:`mfxFrameSurfaceInterface` structure as a part of +the :cpp:struct:`mfxFrameSurface1` is mandatory. + Any other functions or extension buffers are optional for the implementation. diff --git a/source/elements/oneVPL/source/Versioning.rst b/source/elements/oneVPL/source/Versioning.rst index f0da440ec9..c2aad41df0 100644 --- a/source/elements/oneVPL/source/Versioning.rst +++ b/source/elements/oneVPL/source/Versioning.rst @@ -10,8 +10,3 @@ oneVPL is the successor to |msdk_full_name|. oneVPL API versioning starts from 2.0. There is a correspondent version of |msdk_full_name| API which is used as a basis for oneVPL and defined as the ``MFX_LEGACY_VERSION`` macro. -Experimental APIs in oneVPL are protected with the following macro:: - - #if (MFX_VERSION >= MFX_VERSION_NEXT) - -To use the API, define the ``MFX_VERSION_USE_LATEST`` macro. \ No newline at end of file diff --git a/source/elements/oneVPL/source/appendix/index.rst b/source/elements/oneVPL/source/appendix/index.rst index 489ca06162..4000195eb1 100644 --- a/source/elements/oneVPL/source/appendix/index.rst +++ b/source/elements/oneVPL/source/appendix/index.rst @@ -10,7 +10,6 @@ Appendices :titlesonly: :maxdepth: 1 - VPL_intel_media_sdk VPL_apnds_a VPL_apnds_b VPL_apnds_c diff --git a/source/elements/oneVPL/source/index.rst b/source/elements/oneVPL/source/index.rst index 1fa033c3e3..9d097ed68d 100644 --- a/source/elements/oneVPL/source/index.rst +++ b/source/elements/oneVPL/source/index.rst @@ -16,15 +16,14 @@ buffer sharing. oneVPL is backwards and cross-architecture compatible to ensure optimal execution on current and next generation hardware without source code changes. -============================ -oneVPL Specification Version -============================ +.. rubric:: oneVPL Specification Version Latest oneVPL specification version is |vpl_version|. .. toctree:: :titlesonly: + VPL_intel_media_sdk architecture/index programming_guide/index VPL_summary diff --git a/source/elements/oneVPL/source/programming_guide/VPL_prg_err.rst b/source/elements/oneVPL/source/programming_guide/VPL_prg_err.rst index d66327035b..cdfcd11455 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_err.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_err.rst @@ -39,9 +39,13 @@ errors or other warnings overwriting :cpp:enumerator:`mfxStatus::MFX_WRN_PARTIAL_ACCELERATION`, as it is a lower priority warning.) oneVPL functions return :cpp:enumerator:`mfxStatus::MFX_WRN_DEVICE_BUSY` to indicate that the -hardware device is busy and unable to take commands at this time. Resume the -operation by waiting for a few milliseconds and resubmitting the request. -The following example shows the decoding pseudo-code: +hardware device is busy and unable to receive commands at this time. The recommended approach is: + + * If the asynchronous operation returns synchronization point along with :cpp:enumerator:`mfxStatus::MFX_WRN_DEVICE_BUSY` - call the :cpp:func:`MFXVideoCORE_SyncOperation` with it. + * If application has buffered synchronization point(s) obtained from previous asynchronous operations - call :cpp:func:`MFXVideoCORE_SyncOperation` with the oldest one. + * If no synchronization point(s) available - wait for a few milliseconds. + * Resume the operation by resubmitting the request. + .. literalinclude:: ../snippets/prg_err.c :language: c++ diff --git a/source/elements/oneVPL/source/programming_guide/VPL_prg_hw.rst b/source/elements/oneVPL/source/programming_guide/VPL_prg_hw.rst index c44669fff8..bee68b97d3 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_hw.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_hw.rst @@ -30,6 +30,16 @@ This approach simplifies the oneVPL initialization, making calls to the or :cpp:func:`MFXVideoVPP_QueryIOSurf` functions optional. See :ref:`Internal Memory Management `. +.. note:: Applications can set device handle before session creation through :cpp:func:`MFXSetConfigFilterProperty` + like shown in the code below: + +.. literalinclude:: ../snippets/prg_hw.cpp + :language: c++ + :start-after: /*beg3*/ + :end-before: /*end3*/ + :lineno-start: 1 + + ---------------------------------------------- Work with Hardware Acceleration in Legacy Mode ---------------------------------------------- diff --git a/source/elements/oneVPL/source/programming_guide/VPL_prg_session.rst b/source/elements/oneVPL/source/programming_guide/VPL_prg_session.rst index 8504d25243..5dc49182f6 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_session.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_session.rst @@ -22,6 +22,15 @@ a session. The :cpp:func:`MFXClose` function closes (de-initializes) the session. To avoid memory leaks, always call :cpp:func:`MFXClose` after :cpp:func:`MFXInit`. +.. important:: :cpp:func:`MFXInit` and :cpp:func:`MFXInitEx` are deprecated + starting from API 2.0. Applications must use :cpp:func:`MFXLoad` + and :cpp:func:`MFXCreateSession` to initialize implementations. + +.. important:: For backward compatibility with existent |msdk_full_name| + applications oneVPL session can be created and initialized by + the legacy dispacther through :cpp:func:`MFXInit` or + :cpp:func:`MFXInitEx` calls. + The application can initialize a session as a software-based session (:cpp:enumerator:`MFX_IMPL_SOFTWARE`) or a hardware-based session (:cpp:enumerator:`MFX_IMPL_HARDWARE`). In a software-based session, the SDK @@ -200,7 +209,585 @@ Internally, the dispatcher works as follows: .. note:: For backward compatibility with |msdk_full_name|, the dispatcher will first try to load |msdk_full_name| if API version 1.x was requested. - If loading fails, the dispatcher will search for the implementation with highest 2.x API version and load that version. + If loading fails, the dispatcher will search for the implementation with + highest 2.x API version and load that version. + +------------------------------------------ +oneVPL Dispatcher Configuration Properties +------------------------------------------ + +The :ref:`Dispatcher Configuration Properties Table ` shows property strings +supported by the dispatcher. Table organized in the hierarchy way, to create the string, go from the +left to right from column to column and concatenate strings by using `.` (dot) as the separator. + +.. _dsp-conf-prop-table: + +.. table:: Dispatcher Configuration Properties + :widths: 25 25 30 20 + + +---------------------------------------+----------------------------+----------------------+---------------------------+ + | Structure name | Property | Value Data Type | Comment | + +=======================================+============================+======================+===========================+ + | :cpp:struct:`mfxImplDescription` | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .Impl | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .AccelerationMode | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .ApiVersion | | | + | | | .Version | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U16 | | + | | | .ApiVersion | | | + | | | .Major | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U16 | | + | | | .ApiVersion | | | + | | | .Minor | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .ImplName | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .License | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .Keywords | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .VendorImplID | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .AccelerationMode | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U16 | | + | | | .mfxDeviceDescription | | | + | | | .device | | | + | | | .DeviceID | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .decoder | | | + | | | .CodecID | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U16 | | + | | | .mfxDecoderDescription | | | + | | | .decoder | | | + | | | .MaxcodecLevel | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .decoder | | | + | | | .decprofile | | | + | | | .Profile | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .decoder | | | + | | | .decprofile | | | + | | | .Profile | | | + | | | .decmemdesc | | | + | | | .MemHandleType | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_PTR | Pointer to the | + | | | .mfxDecoderDescription | | :cpp:struct:`mfxRange32U` | + | | | .decoder | | object | + | | | .decprofile | | | + | | | .Profile | | | + | | | .decmemdesc | | | + | | | .Width | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_PTR | Pointer to the | + | | | .mfxDecoderDescription | | :cpp:struct:`mfxRange32U` | + | | | .decoder | | object | + | | | .decprofile | | | + | | | .Profile | | | + | | | .decmemdesc | | | + | | | .Height | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .decoder | | | + | | | .decprofile | | | + | | | .Profile | | | + | | | .decmemdesc | | | + | | | .ColorFormats | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxEncoderDescription | | | + | | | .encoder | | | + | | | .CodecID | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U16 | | + | | | .mfxEncoderDescription | | | + | | | .encoder | | | + | | | .MaxcodecLevel | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U16 | | + | | | .mfxEncoderDescription | | | + | | | .encoder | | | + | | | .BiDirectionalPrediction | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxEncoderDescription | | | + | | | .encoder | | | + | | | .encprofile | | | + | | | .Profile | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxEncoderDescription | | | + | | | .encoder | | | + | | | .encprofile | | | + | | | .Profile | | | + | | | .encmemdesc | | | + | | | .MemHandleType | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_PTR | Pointer to the | + | | | .mfxEncoderDescription | | :cpp:struct:`mfxRange32U` | + | | | .encoder | | object | + | | | .encprofile | | | + | | | .Profile | | | + | | | .encmemdesc | | | + | | | .Width | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_PTR | Pointer to the | + | | | .mfxEncoderDescription | | :cpp:struct:`mfxRange32U` | + | | | .encoder | | object | + | | | .encprofile | | | + | | | .Profile | | | + | | | .encmemdesc | | | + | | | .Height | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxImplDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxEncoderDescription | | | + | | | .encoder | | | + | | | .encprofile | | | + | | | .Profile | | | + | | | .encmemdesc | | | + | | | .ColorFormats | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .filter | | | + | | | .FilterFourCC | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_U16 | | + | | | .mfxDecoderDescription | | | + | | | .filter | | | + | | | .MaxDelayInFrames | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .filter | | | + | | | .memdesc | | | + | | | .MemHandleType | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_PTR | Pointer to the | + | | | .mfxDecoderDescription | | :cpp:struct:`mfxRange32U` | + | | | .filter | | object | + | | | .memdesc | | | + | | | .Width | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_PTR | Pointer to the | + | | | .mfxDecoderDescription | | :cpp:struct:`mfxRange32U` | + | | | .filter | | object | + | | | .memdesc | | | + | | | .Height | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .filter | | | + | | | .memdesc | | | + | | | .format | | | + | | | .InFormat | | | + | +----------------------------+----------------------+---------------------------+ + | | | mfxVPPDescription | MFX_VARIANT_TYPE_U32 | | + | | | .mfxDecoderDescription | | | + | | | .filter | | | + | | | .memdesc | | | + | | | .format | | | + | | | .OutFormats | | | + +---------------------------------------+----------------------------+----------------------+---------------------------+ + | :cpp:struct:`mfxImplementedFunctions` | | mfxImplementedFunctions | MFX_VARIANT_TYPE_PTR | Pointer to the buffer | + | | | .FunctionsName | | with string | + +---------------------------------------+----------------------------+----------------------+---------------------------+ + +Examples of the property name strings: + +- mfxImplDescription.mfxDecoderDescription.decoder.decprofile.Profile +- mfxImplDescription.mfxDecoderDescription.decoder.decprofile.decmemdesc.MemHandleType +- mfxImplementedFunctions.FunctionsName + +Following properties are supported in a special manner: they are used to send +additional data to the implementation through the dispatcher. Application needs +to use :cpp:func:`MFXSetConfigFilterProperty` to set them up but they don't +influence on the implementation selection. They are used during the +:cpp:func:`MFXCreateSession` function call to fine tune the implementation. + +.. list-table:: Dispatcher's Special Properties + :header-rows: 1 + :widths: 50 50 + + * - **Property** + - **Value data type** + * - :cpp:enum:`mfxHandleType` + - :cpp:enumerator:`mfxVariantType::MFX_VARIANT_TYPE_U32` + * - :cpp:type:`mfxHDL` + - :cpp:enumerator:`mfxVariantType::MFX_VARIANT_TYPE_PTR` + +------------------------------ +oneVPL Dispatcher Interactions +------------------------------ + +This sequence diagram visualize how application communcates with implementations +via the dispacher. + +Dispatcher API + This API is implemented in the dispatcher. + +Implementation API + This API is provided by the any implementation. + +.. uml:: + + @startuml + actor Application as A + participant "oneVPL Dispatcher" as D + participant "oneVPL Implementation 1" as I1 + participant "oneVPL Implementation 2" as I2 + participant "oneVPL Implementation 3" as I3 + + ref over A, D : Dispatcher API + ref over D, I1, I2, I3 : Implementation API + + activate A + == Initialization == + group Dispatcher API [Enumerate and load implementations] + A -> D: mfxLoad() + activate D + + D -> D: Search for the available runtimes + + A -> D: MFXCreateConfig() + A -> D: MFXSetConfigProperty() + A -> D: MFXCreateConfig() + A -> D: MFXSetConfigProperty() + A -> D: MFXEnumImplementations() + + Activate I1 + + D -> I1: MFXQueryImplsDescription() + I1 --> D: mfxImplDescription + + Activate I2 + D -> I2: MFXQueryImplsDescription() + I2 --> D: mfxImplDescription + + Activate I3 + D -> I3: MFXQueryImplsDescription() + I3 --> D: mfxImplDescription + + D --> A: list of mfxImplDescription structures es for all implementations + + A -> D: MFXCreateSession(i=0) + D -> I1: MFXInitilize() + Activate I1 #DarkSalmon + I1 --> D: mfxSession1 + D --> A: mfxSession1 + + A -> D: MFXCreateSession(i=1) + D -> I2: MFXInitilize() + Activate I2 #DarkSalmon + I2 --> D: mfxSession2 + D --> A: mfxSession2 + + A -> D: MFXCreateSession(i=2) + D -> I3: MFXInitilize() + I3 --> D: mfxSession3 + Activate I3 #DarkSalmon + D --> A: mfxSession3 + + A -> D: MFXDispReleaseImplDescription(hdl=0) + D -> I1: MFXReleaseImplDescription() + + A -> D: MFXDispReleaseImplDescription(hdl=1) + D -> I2: MFXReleaseImplDescription() + + A -> D: MFXDispReleaseImplDescription(hdl=2) + D -> I3: MFXReleaseImplDescription() + end + == Processing == + group Implementation API [Process the data] + A -> I1: MFXVideoDECODE_Init() + A -> I1: MFXVideoDECODE_Query() + A -> I1: MFXVideoDECODE_DecodeFrameAsync() + ... + A -> I1: MFXVideoDECODE_Close() + ||| + deactivate I1 + + A -> I2: MFXVideoENCODE_Init() + A -> I2: MFXVideoENCODE_Query() + A -> I2: MFXVideoENCODE_EncodeFrameAsync() + ... + A -> I2: MFXVideoENCODE_Close() + ||| + deactivate I2 + + A -> I3: MFXVideoENCODE_Init() + A -> I3: MFXVideoENCODE_Query() + A -> I3: MFXVideoENCODE_EncodeFrameAsync() + ... + A -> I3: MFXVideoENCODE_Close() + ||| + deactivate I3 + end + == Finalization == + group Implementation API [Release the implementations] + A -> I1: MFXClose() + deactivate I1 + A -> I2: MFXClose() + deactivate I2 + A -> I3: MFXClose() + deactivate I3 + group Dispatcher API [Release the dispatcher's instance] + A -> D: MFXUnload() + end + + deactivate D + @enduml + +The oneVPL dispacther is capable to load and initialize |msdk_full_name| legacy +library. The sequence diagram below demonstrates the approach. + +.. uml:: + + @startuml + actor Application as A + participant "oneVPL Dispatcher" as D + participant "MediaSDK (legacy)" as M + A -> D: MFXLoad + activate D + D -> D: Search for the avialable runtimes + A -> D: MFXCreateConfig + + note left of D + Setting properties to filter implementation. + MediaSDK supports only general parameters, + no filtering for Decode/VPP/Encoder details. + end note + + group MediaSDK LegacyAPI + D -> M: MFXInitEx + activate M + + M --> D: mfxSession + D -> M: MFXQueryIMPL + M --> D: Implementation speciefic + + D -> M: MFXQueryVersion + M --> D: mfxVersion + end + + D -> D: Fill mfxImplDescription for MediaSDK impl + + A -> D: mfxEnumImplementations + D --> A: MediaSDK caps description + + A -> D: MFXCreateSession + D --> A: mfxSession + + A -> M: MFXVideoDECODE_Init() + A -> M: MFXVideoDECODE_Query() + A -> M: MFXVideoDECODE_DecodeFrameAsync() + ... + A -> M: MFXVideoDECODE_Close() + A -> M: MFXClose() + + deactivate M + + A -> D: MFXUnload() + deactivate D + @enduml + +.. important:: The dispacther doesn't filter and report + :cpp:struct:`mfxDeviceDescription`, + :cpp:struct:`mfxDecoderDescription`, + :cpp:struct:`mfxEncoderDescription`, + :cpp:struct:`mfxVPPDescription` when enumerates or creates + |msdk_full_name| implementation. Once |msdk_full_name| is loaded + applications have to use legacy approach to query capabilities. + +--------------------------------------- +How To Check If Function is Implemented +--------------------------------------- + +There are two ways to check if particular function is implemented or not by the +implementation. + +This code illustrates how application can iterate through the whole list of +implemented functions: + +.. literalinclude:: ../snippets/prg_session.cpp + :language: c++ + :start-after: /*beg1*/ + :end-before: /*end1*/ + :lineno-start: 1 + +This code illustrates how application can check that specific functions are +implemented: + +.. literalinclude:: ../snippets/prg_session.cpp + :language: c++ + :start-after: /*beg2*/ + :end-before: /*end2*/ + :lineno-start: 1 + +-------------------------------------------------------------- +How To Search For The Avialable encoder/decoder implementation +-------------------------------------------------------------- + +The :ref:`CodecFormatFourCC ` enum specifies codec's FourCC +values. Application needs to assign this value to the field of +:cpp:member:`mfxDecoderDescription::decoder::CodecID` to search for the decoder +or :cpp:member:`mfxEncoderDescription::encoder::CodecID` to search for the +encoder. + +This code illustrates decoder's implementation search procedure: + +.. literalinclude:: ../snippets/prg_session.cpp + :language: c++ + :start-after: /*beg3*/ + :end-before: /*end3*/ + :lineno-start: 1 + +--------------------------------------------------------- +How To Search For The Avialable VPP Filter implementation +--------------------------------------------------------- + +Each VPP filter identified by the filter ID. Filter ID is defined by +corresponding to the filter extension buffer ID value which is defined in a form +of fourCC value. +Filter ID values are subset of the general :ref:`ExtendedBufferID ` +enum. The :ref:`table ` references avialable IDs of VPP filters +to search. Application needs to assign this value to the field of +:cpp:member:`mfxVPPDescription::filter::FilterFourCC` to search for the needed +VPP filter. + +.. _vpp-filters-ids: + +.. list-table:: VPP Filters ID + :header-rows: 1 + :widths: 58 42 + + * - **Filter ID** + - **Description** + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DENOISE` + - Denoise filter (deprecated in 2.2) + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DENOISE2` + - Denoise filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_MCTF` + - Motion-Compensated Temporal Filter (MCTF). + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DETAIL` + - Detail/edge enhancement filter. + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION` + - Frame rate conversion filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_IMAGE_STABILIZATION` + - Image stabilization filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_PROCAMP` + - ProcAmp filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_FIELD_PROCESSING` + - Field processing filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_COLOR_CONVERSION` + - Color Conversion filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_SCALING` + - Resize filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_COMPOSITE` + - Surfaces composition filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DEINTERLACING` + - Deinterlace filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_ROTATION` + - Rotation filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_MIRRORING` + - Mirror filter + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_COLORFILL` + - ColorFill filter + +This code illustrate VPP mirror filter implementation search procedure: + +.. literalinclude:: ../snippets/prg_session.cpp + :language: c++ + :start-after: /*beg4*/ + :end-before: /*end4*/ + :lineno-start: 1 + +----------------------------------------------------------------------------------------------------------- +oneVPL implementation on |intel_r| platforms with X\ :sup:`e` architecture and |msdk_full_name| Coexistence +----------------------------------------------------------------------------------------------------------- + +oneVPL supersedes |msdk_full_name| and partially binary compartible with +|msdk_full_name|. Both oneVPL and |msdk_full_name| includes own dispatcher and +implementation. Coexistance of oneVPL and |msdk_full_name| dispatchers and +implementations on single system is allowed until |msdk_full_name| is not EOL. + +Usage of the following combinations of dispatchers and implementations within +the single application is permitted for the legacy purposes only. In that +scenario legacy applications developed with |msdk_full_name| will continue to +work on any HW supported either by |msdk_full_name| or by the oneVPL. + +.. attention:: Any application to work with the oneVPL API starting from version + 2.0 must use only oneVPL dispatcher. + +|msdk_full_name| API + |msdk_full_name| API of 1.x version. + +Removed API + |msdk_full_name| :ref:`API ` which is removed from oneVPL. + +Core API + |msdk_full_name| API without removed API. + +oneVPL API + New :ref:`API ` introduced in oneVPL only started from API 2.0 + version. + +oneVPL Dispatcher API + Dispatcher :ref:`API ` introduced in oneVPL in 2.0 + API version. This is subset of oneVPL API. + +.. list-table:: oneVPL for |intel_r| platforms with X\ :sup:`e` architecture and |msdk_full_name| + :header-rows: 1 + :widths: 25 25 25 25 + + * - **Dispatcher** + - **Installed on the system** + - **Loaded** + - **Allowed API** + * - oneVPL + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture + - Usage of any API except removed API is allowed. + * - oneVPL + - |msdk_full_name| + - |msdk_full_name| + - Usage of core API plus dispatcher API is allowed only. + * - oneVPL + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture and |msdk_full_name| + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture + - Usage of any API except removed API is allowed. + * - |msdk_full_name| + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture + - Usage of core API is allowed only. + * - |msdk_full_name| + - oneVPL for |intel_r| platforms with X\ :sup:`e` architecture and |msdk_full_name| + - |msdk_full_name| + - Usage of |msdk_full_name| API is allowed. + * - |msdk_full_name| + - |msdk_full_name| + - |msdk_full_name| + - Usage of |msdk_full_name| API is allowed. ----------------- Multiple Sessions @@ -210,25 +797,22 @@ Each oneVPL session can run exactly one instance of the DECODE, ENCODE, and VPP functions. This is adequate for a simple transcoding operation. If the application needs more than one instance of DECODE, ENCODE, or VPP in a complex transcoding setting or needs more simultaneous transcoding -operations to balance CPU/GPU workloads, the application can initialize multiple -oneVPL sessions. Each independent oneVPL session can be a software-based session or -hardware-based session. +operations, the application can initialize multiple +oneVPL sessions created from one or several oneVPL implementations. The application can use multiple oneVPL sessions independently or run a “joined” -session. Independently operated oneVPL sessions cannot share data unless the -application explicitly synchronizes session operations. This is to ensure that -data is valid and complete before passing from the source to the destination -session. - -To join two sessions together, the application can use the function +session. To join two sessions together, the application can use the function :cpp:func:`MFXJoinSession`. Alternatively, the application can use the :cpp:func:`MFXCloneSession` function to duplicate an existing session. Joined -oneVPL sessions work together as a single session, sharing all session resources, -threading control, and prioritization operations except hardware acceleration -devices and external allocators. When joined, the first session (first join) -serves as the parent session and will schedule execution resources with all -other child sessions. Child sessions rely on the parent session for resource -management. +oneVPL sessions work together as a single session, sharing all session +resources, threading control, and prioritization operations except hardware +acceleration devices and external allocators. When joined, the first session +(first join) serves as the parent session and will schedule execution resources +with all other child sessions. Child sessions rely on the parent session for +resource management. + +.. important:: Applications can join sessions created from the same oneVPL + implementation only. With joined sessions, the application can set the priority of session operations through the :cpp:func:`MFXSetPriority` function. A lower priority session @@ -237,5 +821,5 @@ processing. After the completion of all session operations, the application can use the :cpp:func:`MFXDisjoinSession` function to remove the joined state of a session. -Do not close the parent session until all child sessions are disjoined or closed. - +Do not close the parent session until all child sessions are disjoined or +closed. diff --git a/source/elements/oneVPL/source/programming_guide/VPL_prg_vpp.rst b/source/elements/oneVPL/source/programming_guide/VPL_prg_vpp.rst index 20ac7838c6..b050a4fb10 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_vpp.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_vpp.rst @@ -95,6 +95,8 @@ list of configurable filters. - **Configuration Structure** * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DENOISE` - :cpp:struct:`mfxExtVPPDenoise` + * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DENOISE2` + - :cpp:struct:`mfxExtVPPDenoise2` * - :cpp:enumerator:`MFX_EXTBUFF_VPP_MCTF` - :cpp:struct:`mfxExtVppMctf` * - :cpp:enumerator:`MFX_EXTBUFF_VPP_DETAIL` diff --git a/source/elements/oneVPL/source/snippets/prg_err.c b/source/elements/oneVPL/source/snippets/prg_err.c index c59d1a6c28..4a2c37d4bd 100644 --- a/source/elements/oneVPL/source/snippets/prg_err.c +++ b/source/elements/oneVPL/source/snippets/prg_err.c @@ -17,9 +17,14 @@ mfxSession session; mfxBitstream *bitstream; mfxFrameSurface1 *surface_work, *surface_disp; -mfxSyncPoint syncp; +mfxSyncPoint buffered_syncp, syncp; /* end of internal stuff */ +static void prg_handle_device_busy (mfxSession session, mfxSyncPoint sp) { + sp ? MFXVideoCORE_SyncOperation(session, sp, INFINITE) : sleep(5); +} + + static void prg_err () { /*beg1*/ @@ -27,7 +32,9 @@ mfxStatus sts=MFX_ERR_NONE; for (;;) { // do something sts=MFXVideoDECODE_DecodeFrameAsync(session, bitstream, surface_work, &surface_disp, &syncp); - if (sts == MFX_WRN_DEVICE_BUSY) sleep(5); + if (sts == MFX_ERR_NONE) buffered_syncp = syncp; + else if (sts == MFX_WRN_DEVICE_BUSY) prg_handle_device_busy(session, syncp ? syncp : buffered_syncp); + } /*end1*/ } \ No newline at end of file diff --git a/source/elements/oneVPL/source/snippets/prg_hw.cpp b/source/elements/oneVPL/source/snippets/prg_hw.cpp index 6ad204a63d..199599bc27 100644 --- a/source/elements/oneVPL/source/snippets/prg_hw.cpp +++ b/source/elements/oneVPL/source/snippets/prg_hw.cpp @@ -13,6 +13,7 @@ #include "mfxdefs.h" #include "mfxvideo.h" #include "mfxadapter.h" +#include "mfxdispatcher.h" /* these macro requires code complilation*/ @@ -21,6 +22,9 @@ /* end of internal stuff */ +static void* vaDisplay; + + static int prg_hw1 () { /*beg1*/ mfxU32 num_adapters_available; @@ -134,4 +138,28 @@ case 3: // Initialize mfxSession in regular way with obtained implementation /*end2*/ return 0; -} \ No newline at end of file +} + +static int prg_hw3 () { +/*beg3*/ +mfxLoader loader = MFXLoad(); +mfxConfig config1 = MFXCreateConfig(loader); +mfxConfig config2 = MFXCreateConfig(loader); +mfxSession session; + +mfxVariant HandleType; +HandleType.Type = MFX_VARIANT_TYPE_U32; +HandleType.Data.U32 = MFX_HANDLE_VA_DISPLAY; +MFXSetConfigFilterProperty(config1, (mfxU8*)"mfxHandleType", HandleType); + +mfxVariant DisplayHandle; +DisplayHandle.Type = MFX_VARIANT_TYPE_PTR; +HandleType.Data.Ptr = vaDisplay; +MFXSetConfigFilterProperty(config2, (mfxU8*)"mfxHDL", DisplayHandle); + +MFXCreateSession(loader, 0, &session); + +/*end3*/ +return 0; +} + diff --git a/source/elements/oneVPL/source/snippets/prg_mem.c b/source/elements/oneVPL/source/snippets/prg_mem.c index 128f948fcc..cfb2cf5002 100644 --- a/source/elements/oneVPL/source/snippets/prg_mem.c +++ b/source/elements/oneVPL/source/snippets/prg_mem.c @@ -99,22 +99,28 @@ static int prg_mem2 () { sts = MFXVideoDECODE_DecodeFrameAsync(session, NULL, NULL, &outsurface, &syncp); if (MFX_ERR_NONE == sts) { - outsurface->FrameInterface->GetDeviceHandle(outsurface, &device_handle, &device_type); - // if application or component is familar with mfxHandleType and it's possible to share memory created by device_handle. - if (isDeviceTypeCompatible(device_type) && isPossibleForMemorySharing(device_handle)) { + mfxStatus s = outsurface->FrameInterface->GetDeviceHandle(outsurface, + &device_handle, &device_type); + // if application or component is familar with mfxHandleType and it's + // possible to share memory created by device_handle. + if (MFX_ERR_NONE == s && isDeviceTypeCompatible(device_type) + && isPossibleForMemorySharing(device_handle)) { // get native handle and type - outsurface->FrameInterface->GetNativeHandle(outsurface, &resource, &resource_type); + outsurface->FrameInterface->GetNativeHandle(outsurface, + &resource, &resource_type); if (isResourceTypeCompatible(resource_type)) { //use memory directly ProcessNativeMemory(resource); outsurface->FrameInterface->Release(outsurface); } + } else { + // Application or component is not aware about such DeviceHandle or + // Resource type need to map to system memory. + outsurface->FrameInterface->Map(outsurface, MFX_MAP_READ); + ProcessSystemMemory(outsurface); + outsurface->FrameInterface->Unmap(outsurface); + outsurface->FrameInterface->Release(outsurface); } - // Application or component is not aware about such DeviceHandle or Resource type need to map to system memory. - outsurface->FrameInterface->Map(outsurface, MFX_MAP_READ); - ProcessSystemMemory(outsurface); - outsurface->FrameInterface->Unmap(outsurface); - outsurface->FrameInterface->Release(outsurface); } +/*end2*/ } -/*end2*/ \ No newline at end of file diff --git a/source/elements/oneVPL/source/snippets/prg_session.cpp b/source/elements/oneVPL/source/snippets/prg_session.cpp new file mode 100644 index 0000000000..61f437485d --- /dev/null +++ b/source/elements/oneVPL/source/snippets/prg_session.cpp @@ -0,0 +1,110 @@ +/*############################################################################ + # Copyright (C) 2020 Intel Corporation + # + # SPDX-License-Identifier: MIT + ############################################################################*/ + +#include "mfxdefs.h" +#include "mfxdispatcher.h" +#include "mfxstructures.h" + +#include +#include + +mfxLoader loader = 0; +int idx = 0; + +static void prg_session1 () { +/*beg1*/ +mfxHDL h; +// request pointer to the list. Assume that implementation supports that. +// Assume that `loader` is configured before. +mfxStatus sts = MFXEnumImplementations(loader, idx, MFX_IMPLCAPS_IMPLEMENTEDFUNCTIONS, &h); +// break if no idx +if (sts != MFX_ERR_NOT_FOUND) { + // Cast typeless handle to structure pointer + mfxImplementedFunctions *implemented_functions = (mfxImplementedFunctions*)h; + + // print out list of functions' name + std::for_each(implemented_functions->FunctionsName, implemented_functions->FunctionsName + + implemented_functions->NumFunctions, + [](mfxChar* functionName) { + std::cout << functionName << " is implemented" << std::endl; + }); + // Release resource + MFXDispReleaseImplDescription(loader, h); +} +/*end1*/ +} + +static void prg_session2 () { +/*beg2*/ +mfxSession session_handle; +loader = mfxLoader(); + +// We want to search for the implementation with Decode+VPP domain functions support. +// i.e we search for the MFXVideoDECODE_VPP_Init and MFXVideoDECODE_VPP_DecodeFrameAsync +// implemented functions +mfxConfig init_funct_prop = MFXCreateConfig(loader); +mfxVariant value; + +// Filter property for the Init function +value.Type = mfxVariantType::MFX_VARIANT_TYPE_PTR; +value.Data.Ptr = (mfxHDL)"MFXVideoDECODE_VPP_Init"; +MFXSetConfigFilterProperty(init_funct_prop, (const mfxU8*)"mfxImplementedFunctions.FunctionsName", + value); + +// Filter property for the Process function +mfxConfig process_func_prop = MFXCreateConfig(loader); +value.Data.Ptr = (mfxHDL)"MFXVideoDECODE_VPP_DecodeFrameAsync"; +MFXSetConfigFilterProperty(process_func_prop, (const mfxU8*)"mfxImplementedFunctions.FunctionsName", + value); + +// create session from first matched implementation +MFXCreateSession(loader, 0, &session_handle); +/*end2*/ +} + +static void prg_session3 () { +/*beg3*/ +mfxSession hevc_session_handle; +loader = mfxLoader(); + +// We want to search for the HEVC decoder implementation +mfxConfig hevc_decoder_config = MFXCreateConfig(loader); +mfxVariant value; + +// Filter property for the implementations with HEVC decoder +value.Type = MFX_VARIANT_TYPE_U32; +value.Data.U32 = MFX_CODEC_HEVC; + +MFXSetConfigFilterProperty(hevc_decoder_config + , (const mfxU8*)"mfxImplDescription.mfxDecoderDescription.decoder.CodecID" + , value); + +// create session from first matched implementation +MFXCreateSession(loader, 0, &hevc_session_handle); +/*end3*/ +} + +static void prg_session4 () { +/*beg4*/ +mfxSession mirror_session_handle; +loader = mfxLoader(); + +// We want to search for the VPP mirror implementation +mfxConfig mirror_flt_config = MFXCreateConfig(loader); +mfxVariant value; + +// Filter property for the implementations with VPP mirror +value.Type = MFX_VARIANT_TYPE_U32; +value.Data.U32 = MFX_EXTBUFF_VPP_MIRRORING; + +MFXSetConfigFilterProperty(mirror_flt_config + , (const mfxU8*)"mfxImplDescription.mfxVPPDescription.filter.FilterFourCC" + , value); + +// create session from first matched implementation +MFXCreateSession(loader, 0, &mirror_session_handle); +/*end4*/ +} \ No newline at end of file diff --git a/source/elements/oneVPL/vplapi.py b/source/elements/oneVPL/vplapi.py new file mode 100644 index 0000000000..552ac02a2c --- /dev/null +++ b/source/elements/oneVPL/vplapi.py @@ -0,0 +1,75 @@ +# SPDX-FileCopyrightText: 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT + +__version__ = '0.0.1' + +import re + +from docutils import nodes +from docutils.parsers.rst import Directive + +from sphinx.locale import _ +from sphinx.util.docutils import SphinxDirective + +from sphinx.util import logging + +logger = logging.getLogger(__name__) + +def type_of_node(n): + return type(n).__name__ + +# --> def_node +# --> def_node[0] +# Since --> def_node[0][0].astext() +# +# --> def_node[1] +# her 1.0 her. --> def_node[1][0].astext() +# +# + +def check_definition_list_item(def_node): + if type_of_node(def_node[0]) == 'term' and type_of_node(def_node[1]) == 'definition': + if(def_node[0][0].astext() == 'Since'): + potential_ver_str = def_node[1][0].astext() + potential_m = re.search(r'since API version (\d+\.\d+)\.',potential_ver_str) + if potential_m: + return potential_m.group(1) + + return None + +def process_function_nodes(app, doctree, fromdocname): + for section in doctree.traverse(nodes.section, descend=True): + for n in section: + type_of_section = type_of_node(n) + if type_of_section == 'title': + title_text = n[0] + if(title_text.startswith("MFX")): # this is function description section + # lets search for the `Since` term + isFunction = False + hasVersion = False + version = None + functionName = title_text + for k in n.traverse(condition=None, include_self=True, descend=True, siblings=True): + node_type = type_of_node(k) + if node_type == 'desc': + if k.hasattr('desctype'): + if k.get('desctype') == 'function': + isFunction = True + else: + continue + if node_type == 'definition_list_item': + tmp = check_definition_list_item(k) + if tmp: + version = tmp + hasVersion = True + if isFunction and not hasVersion: + logger.warning("Function {} doesn't have min API version defined".format(functionName)) + +def setup(app): + app.connect('doctree-resolved', process_function_nodes) + return { + 'version': __version__, + 'parallel_read_safe': True, + 'parallel_write_safe': True + } diff --git a/ubuntu-packages.txt b/ubuntu-packages.txt index 9a1bcb5b98..35d6a0d5b5 100644 --- a/ubuntu-packages.txt +++ b/ubuntu-packages.txt @@ -4,6 +4,7 @@ git graphviz inkscape latexmk +plantuml texlive-fonts-extra texlive-fonts-recommended texlive-latex-base