From 97aeffdb8823954cb0bd74c8dad62d0fcf3710e6 Mon Sep 17 00:00:00 2001 From: Thaddeus Letnes Date: Fri, 31 Mar 2023 12:41:36 -0700 Subject: [PATCH] OneVPL v2.9 (#483) --- oneapi-doc.json | 2 +- .../elements/oneVPL/include/vpl/mfxadapter.h | 18 +- .../elements/oneVPL/include/vpl/mfxcommon.h | 76 ++++--- source/elements/oneVPL/include/vpl/mfxdefs.h | 2 +- .../oneVPL/include/vpl/mfxdispatcher.h | 32 ++- .../oneVPL/include/vpl/mfxstructures.h | 121 +++++++++-- .../elements/oneVPL/include/vpl/mfxvideo++.h | 190 +++++++++++++++++- .../source/API_ref/VPL_disp_api_enum.rst | 6 + .../source/API_ref/VPL_disp_api_struct.rst | 8 + .../oneVPL/source/API_ref/VPL_enums.rst | 103 +++------- .../API_ref/VPL_structs_cross_component.rst | 16 ++ .../source/API_ref/VPL_structs_decode_vpp.rst | 2 +- .../API_ref/VPL_structs_impl_manage.rst | 8 + .../oneVPL/source/API_ref/VPL_structs_vpp.rst | 8 + .../elements/oneVPL/source/Experimental.rst | 65 +++++- .../elements/oneVPL/source/VPL_change_log.rst | 21 ++ .../oneVPL/source/VPL_deprecation.rst | 155 ++++++++++++++ .../oneVPL/source/VPL_intel_media_sdk.rst | 2 +- .../source/programming_guide/VPL_prg_hw.rst | 12 +- .../programming_guide/VPL_prg_session.rst | 35 ++++ .../source/programming_guide/VPL_prg_vpp.rst | 15 +- .../oneVPL/source/snippets/prg_disp.c | 40 ++++ .../elements/oneVPL/source/snippets/prg_vpp.c | 26 +++ .../oneVPL/source/spelling_wordlist_vpl.txt | 13 ++ 24 files changed, 838 insertions(+), 138 deletions(-) diff --git a/oneapi-doc.json b/oneapi-doc.json index 067dfe20c9..79c3616a29 100644 --- a/oneapi-doc.json +++ b/oneapi-doc.json @@ -1,5 +1,5 @@ { "version": "1.2-rev-1", - "vpl_version": "2.8.0", + "vpl_version": "2.9.0", "art_version": "1.0-rev-1" } diff --git a/source/elements/oneVPL/include/vpl/mfxadapter.h b/source/elements/oneVPL/include/vpl/mfxadapter.h index 5d0679f436..f3b6ed54aa 100644 --- a/source/elements/oneVPL/include/vpl/mfxadapter.h +++ b/source/elements/oneVPL/include/vpl/mfxadapter.h @@ -31,8 +31,12 @@ extern "C" 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. + + @deprecated Deprecated in API version 2.9. Use MFXEnumImplementations and MFXSetConfigFilterProperty to query adapter capabilities and + to select a suitable adapter for the input workload. + Use MFX_DEPRECATED_OFF macro to turn off the deprecation message visualization. */ -mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapters); +MFX_DEPRECATED mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapters); /*! @brief @@ -49,8 +53,12 @@ mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersIn 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. + + @deprecated Deprecated in API version 2.9. Use MFXEnumImplementations and MFXSetConfigFilterProperty to query adapter capabilities and + to select a suitable adapter for the input workload. + Use MFX_DEPRECATED_OFF macro to turn off the deprecation message visualization. */ -mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAdaptersInfo* adapters); +MFX_DEPRECATED mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAdaptersInfo* adapters); /*! @brief @@ -63,8 +71,12 @@ mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec MFX_ERR_NULL_PTR num_adapters pointer is NULL. @since This function is available since API version 1.31. + + @deprecated Deprecated in API version 2.9. Use MFXEnumImplementations and MFXSetConfigFilterProperty to query adapter capabilities and + to select a suitable adapter for the input workload. + Use MFX_DEPRECATED_OFF macro to turn off the deprecation message visualization. */ -mfxStatus MFX_CDECL MFXQueryAdaptersNumber(mfxU32* num_adapters); +MFX_DEPRECATED mfxStatus MFX_CDECL MFXQueryAdaptersNumber(mfxU32* num_adapters); #ifdef __cplusplus } // extern "C" #endif diff --git a/source/elements/oneVPL/include/vpl/mfxcommon.h b/source/elements/oneVPL/include/vpl/mfxcommon.h index b966739db0..a7aa4d9b23 100644 --- a/source/elements/oneVPL/include/vpl/mfxcommon.h +++ b/source/elements/oneVPL/include/vpl/mfxcommon.h @@ -237,35 +237,34 @@ typedef struct { } mfxExtThreadsParam; MFX_PACK_END() -/*! The PlatformCodeName enumerator itemizes product code names for platforms. - For details about Intel code names, see ark.intel.com. */ +/*! Deprecated. */ enum { - MFX_PLATFORM_UNKNOWN = 0, /*!< Unknown platform. */ - MFX_PLATFORM_SANDYBRIDGE = 1, /*!< Intel(r) microarchitecture code name Sandy Bridge. */ - MFX_PLATFORM_IVYBRIDGE = 2, /*!< Intel(r) microarchitecture code name Ivy Bridge. */ - MFX_PLATFORM_HASWELL = 3, /*!< Code name Haswell. */ - MFX_PLATFORM_BAYTRAIL = 4, /*!< Code name Bay Trail. */ - MFX_PLATFORM_BROADWELL = 5, /*!< Intel(r) microarchitecture code name Broadwell. */ - MFX_PLATFORM_CHERRYTRAIL = 6, /*!< Code name Cherry Trail. */ - MFX_PLATFORM_SKYLAKE = 7, /*!< Intel(r) microarchitecture code name Skylake. */ - MFX_PLATFORM_APOLLOLAKE = 8, /*!< Code name Apollo Lake. */ - MFX_PLATFORM_KABYLAKE = 9, /*!< Code name Kaby Lake. */ - MFX_PLATFORM_GEMINILAKE = 10, /*!< Code name Gemini Lake. */ - MFX_PLATFORM_COFFEELAKE = 11, /*!< Code name Coffee Lake. */ - MFX_PLATFORM_CANNONLAKE = 20, /*!< Code name Cannon Lake. */ - MFX_PLATFORM_ICELAKE = 30, /*!< Code name Ice Lake. */ - MFX_PLATFORM_JASPERLAKE = 32, /*!< Code name Jasper Lake. */ - MFX_PLATFORM_ELKHARTLAKE = 33, /*!< Code name Elkhart Lake. */ - MFX_PLATFORM_TIGERLAKE = 40, /*!< Code name Tiger Lake. */ - MFX_PLATFORM_ROCKETLAKE = 42, /*!< Code name Rocket Lake. */ - MFX_PLATFORM_ALDERLAKE_S = 43, /*!< Code name Alder Lake S. */ - MFX_PLATFORM_ALDERLAKE_P = 44, /*!< Code name Alder Lake P. */ - MFX_PLATFORM_ARCTICSOUND_P = 45, - MFX_PLATFORM_XEHP_SDV = 45, /*!< Code name XeHP SDV. */ - MFX_PLATFORM_DG2 = 46, /*!< Code name DG2. */ - MFX_PLATFORM_ATS_M = 46, /*!< Code name ATS-M, same media functionality as DG2. */ - MFX_PLATFORM_ALDERLAKE_N = 55, /*!< Code name Alder Lake N. */ - MFX_PLATFORM_KEEMBAY = 50, /*!< Code name Keem Bay. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_UNKNOWN) = 0, /*!< Unknown platform. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_SANDYBRIDGE) = 1, /*!< Intel(r) microarchitecture code name Sandy Bridge. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_IVYBRIDGE) = 2, /*!< Intel(r) microarchitecture code name Ivy Bridge. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_HASWELL) = 3, /*!< Code name Haswell. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_BAYTRAIL) = 4, /*!< Code name Bay Trail. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_BROADWELL) = 5, /*!< Intel(r) microarchitecture code name Broadwell. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_CHERRYTRAIL) = 6, /*!< Code name Cherry Trail. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_SKYLAKE) = 7, /*!< Intel(r) microarchitecture code name Skylake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_APOLLOLAKE) = 8, /*!< Code name Apollo Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_KABYLAKE) = 9, /*!< Code name Kaby Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_GEMINILAKE) = 10, /*!< Code name Gemini Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_COFFEELAKE) = 11, /*!< Code name Coffee Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_CANNONLAKE) = 20, /*!< Code name Cannon Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ICELAKE) = 30, /*!< Code name Ice Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_JASPERLAKE) = 32, /*!< Code name Jasper Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ELKHARTLAKE) = 33, /*!< Code name Elkhart Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_TIGERLAKE) = 40, /*!< Code name Tiger Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ROCKETLAKE) = 42, /*!< Code name Rocket Lake. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ALDERLAKE_S) = 43, /*!< Code name Alder Lake S. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ALDERLAKE_P) = 44, /*!< Code name Alder Lake P. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ARCTICSOUND_P) = 45, + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_XEHP_SDV) = 45, /*!< Code name XeHP SDV. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_DG2) = 46, /*!< Code name DG2. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ATS_M) = 46, /*!< Code name ATS-M, same media functionality as DG2. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_ALDERLAKE_N) = 55, /*!< Code name Alder Lake N. */ + MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLATFORM_KEEMBAY) = 50, /*!< Code name Keem Bay. */ }; /*! The mfxMediaAdapterType enumerator itemizes types of graphics adapters. */ @@ -279,7 +278,7 @@ typedef enum MFX_PACK_BEGIN_USUAL_STRUCT() /*! Contains information about hardware platform for the Legacy mode. */ typedef struct { - mfxU16 CodeName; /*!< Microarchitecture code name. See the PlatformCodeName enumerator for a list of possible values. */ + MFX_DEPRECATED mfxU16 CodeName; /*!< Deprecated. */ mfxU16 DeviceId; /*!< Unique identifier of graphics device. */ mfxU16 MediaAdapterType; /*!< Description of graphics adapter type. See the mfxMediaAdapterType enumerator for a list of possible values. */ mfxU16 reserved[13]; /*!< Reserved for future use. */ @@ -559,11 +558,27 @@ typedef struct { mfxU32 DRMPrimaryNodeNum; /*!< Number of the DRM primary node from the path /dev/dri/card\. Value equals to 0x7FFFFFFF means that this field doesn't contain valid DRM Primary Node number.*/ - mfxU8 reserved1[20]; /*!< Reserved for future use. */ + mfxU16 RevisionID; /*!< PCI revision ID. The value contains microarchitecture version. */ + mfxU8 reserved1[18]; /*!< Reserved for future use. */ mfxChar DeviceName[MFX_STRFIELD_LEN]; /*!< Null-terminated string in utf-8 with the name of the device. */ } mfxExtendedDeviceId; MFX_PACK_END() +MFX_PACK_BEGIN_USUAL_STRUCT() +/*! Cross domain structure to define device UUID. It is defined here to check backward compatibility.*/ +typedef struct { + mfxU16 vendor_id; /*!< PCI vendor ID. Same as mfxExtendedDeviceId::VendorID. */ + mfxU16 device_id; /*!< PCI device ID. Same as mfxExtendedDeviceId::DeviceID. */ + mfxU16 revision_id; /*!< PCI revision ID. Same as mfxExtendedDeviceId::RevisionID. */ + mfxU16 pci_domain; /*!< PCI bus domain. Same as mfxExtendedDeviceId::PCIDomain. */ + mfxU8 pci_bus; /*!< The number of the bus that the physical device is located on. Same as mfxExtendedDeviceId::PCIBus. */ + mfxU8 pci_dev; /*!< The index of the physical device on the bus. Same as mfxExtendedDeviceId::PCIDevice. */ + mfxU8 pci_func; /*!< The function number of the device on the physical device. Same as mfxExtendedDeviceId::PCIFunction. */ + mfxU8 reserved[4]; /*!< Reserved for future use. */ + mfxU8 sub_device_id; /*!< SubDevice ID.*/ +} extDeviceUUID; +MFX_PACK_END() + #endif /* The mfxImplCapsDeliveryFormat enumerator specifies delivery format of the implementation capability. */ @@ -608,4 +623,3 @@ MFX_PACK_END() #endif /* __cplusplus */ #endif - diff --git a/source/elements/oneVPL/include/vpl/mfxdefs.h b/source/elements/oneVPL/include/vpl/mfxdefs.h index 5e726f4601..2e8ad55df8 100644 --- a/source/elements/oneVPL/include/vpl/mfxdefs.h +++ b/source/elements/oneVPL/include/vpl/mfxdefs.h @@ -8,7 +8,7 @@ #define __MFXDEFS_H__ #define MFX_VERSION_MAJOR 2 -#define MFX_VERSION_MINOR 8 +#define MFX_VERSION_MINOR 9 // 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 diff --git a/source/elements/oneVPL/include/vpl/mfxdispatcher.h b/source/elements/oneVPL/include/vpl/mfxdispatcher.h index 73736d594e..6a5edb0293 100644 --- a/source/elements/oneVPL/include/vpl/mfxdispatcher.h +++ b/source/elements/oneVPL/include/vpl/mfxdispatcher.h @@ -81,11 +81,13 @@ mfxStatus MFX_CDECL MFXSetConfigFilterProperty(mfxConfig config, const mfxU8* na /*! @brief Iterates over filtered out implementations to gather their details. This function allocates memory to store - mfxImplDescription structure instance. Use the MFXDispReleaseImplDescription function to free memory allocated to the mfxImplDescription structure. + a structure or string corresponding to the type specified by format. For example, if format is set to + MFX_IMPLCAPS_IMPLDESCSTRUCTURE, then idesc will return a pointer to a structure of type mfxImplDescription. + Use the MFXDispReleaseImplDescription function to free memory allocated to this structure or string. @param[in] loader Loader handle. @param[in] i Index of the implementation. @param[in] format Format in which capabilities need to be delivered. See the mfxImplCapsDeliveryFormat enumerator for more details. - @param[out] idesc Pointer to the mfxImplDescription structure. + @param[out] idesc Pointer to the structure or string corresponding to the requested format. @return MFX_ERR_NONE The function completed successfully. The idesc contains valid information.\n MFX_ERR_NULL_PTR If loader is NULL. \n @@ -147,6 +149,32 @@ mfxStatus MFX_CDECL MFXCreateSession(mfxLoader loader, mfxU32 i, mfxSession* ses */ mfxStatus MFX_CDECL MFXDispReleaseImplDescription(mfxLoader loader, mfxHDL hdl); +#ifdef ONEVPL_EXPERIMENTAL +/*! + @brief + Macro help to return UUID in the common oneAPI format. + + @param[in] devinfo Handle to mfxExtendedDeviceId. + @param[in] sub_device_id SubDevice number. Can be obtained from mfxDeviceDescription::SubDevices::Index. Set to zero if no SubDevices. + @param[out] uuid Pointer to UUID. + +*/ +#define MFX_UUID_COMPUTE_DEVICE_ID(devinfo, sub_device_id, uuid) \ +{ \ + extDeviceUUID t_uuid = { 0 }; \ + extDeviceUUID* shared_uuid = (extDeviceUUID*)uuid; \ + t_uuid.vendor_id = devinfo->VendorID; \ + t_uuid.device_id = devinfo->DeviceID; \ + t_uuid.revision_id = devinfo->RevisionID; \ + t_uuid.pci_domain = devinfo->PCIDomain; \ + t_uuid.pci_bus = (mfxU8)devinfo->PCIBus; \ + t_uuid.pci_dev = (mfxU8)devinfo->PCIDevice; \ + t_uuid.pci_func = (mfxU8)devinfo->PCIFunction; \ + t_uuid.sub_device_id = (mfxU8)sub_device_id; \ + *shared_uuid = t_uuid; \ +} +#endif + /* Helper macro definitions to add config filter properties. */ /*! Adds single property of mfxU32 type. diff --git a/source/elements/oneVPL/include/vpl/mfxstructures.h b/source/elements/oneVPL/include/vpl/mfxstructures.h index bc1abd86ae..75689702dc 100644 --- a/source/elements/oneVPL/include/vpl/mfxstructures.h +++ b/source/elements/oneVPL/include/vpl/mfxstructures.h @@ -1374,8 +1374,10 @@ typedef struct { This parameter is valid only during initialization. Flag works with MFX_CODEC_AVC only, it is ignored with other codecs. See the CodingOptionValue enumerator for values of this option. + + @deprecated Deprecated in API version 2.9 */ - mfxU16 BitrateLimit; + MFX_DEPRECATED mfxU16 BitrateLimit; /* Deprecated */ /*! Setting this flag enables macroblock level bitrate control that generally improves subjective visual quality. Enabling this flag may have negative impact on performance and objective visual quality metric. See the CodingOptionValue enumerator for values of this option. @@ -1732,9 +1734,9 @@ typedef struct { union { MFX_DEPRECATED mfxU16 ExtBrcAdaptiveLTR; /* Deprecated */ - + /*! - If this flag is set to ON, encoder will mark, modify, or remove LTR frames based on encoding parameters and content + If this flag is set to ON, encoder will mark, modify, or remove LTR frames based on encoding parameters and content properties. Turn OFF to prevent Adaptive marking of Long Term Reference Frames. */ mfxU16 AdaptiveLTR; @@ -2195,6 +2197,22 @@ enum { See the mfxExtAllocationHints structure for more details. */ MFX_EXTBUFF_ALLOCATION_HINTS = MFX_MAKEFOURCC('A','L','C','H'), + +#ifdef ONEVPL_EXPERIMENTAL + /*! + See the mfxExtSyncSubmission structure for more details. + */ + MFX_EXTBUFF_SYNCSUBMISSION = MFX_MAKEFOURCC('S','Y','N','C'), + + /*! + See the mfxExtVPPPercEncPrefilter structure for details. + */ + MFX_EXTBUFF_VPP_PERC_ENC_PREFILTER = MFX_MAKEFOURCC('V','P','E','F'), + /*! + See the mfxExtTuneEncodeQuality structure for details. + */ + MFX_EXTBUFF_TUNE_ENCODE_QUALITY = MFX_MAKEFOURCC('T','U','N','E'), +#endif }; /* VPP Conf: Do not use certain algorithms */ @@ -2888,28 +2906,28 @@ MFX_PACK_BEGIN_USUAL_STRUCT() the decoder will parse the HDR SEI message if the bitstream include HDR SEI message per frame. The parsed HDR SEI will be attached to the ExtendBuffer of surface_out parameter of MFXVideoDECODE_DecodeFrameAsync() with flag `InsertPayloadToggle` to indicate if there is valid HDR SEI message in the clip. - `InsertPayloadToggle` will be set to `MFX_PAYLOAD_IDR` if OneVPL get valid HDR SEI, otherwise it will be set to `MFX_PAYLOAD_OFF`. + `InsertPayloadToggle` will be set to `MFX_PAYLOAD_IDR` if oneVPL gets valid HDR SEI, otherwise it will be set to `MFX_PAYLOAD_OFF`. This function is support for HEVC only now. - Field semantics are defined in ITU-T* H.265 Annex D. + Encoding or Decoding, Field semantics are defined in ITU-T* H.265 Annex D, AV1 6.7.4 Metadata OBU semantics. + + Video processing, `DisplayPrimariesX[3]` and `WhitePointX` are in increments of 0.00002, in the range of [5, 37000]. `DisplayPrimariesY[3]` + and `WhitePointY` are in increments of 0.00002, in the range of [5, 42000]. `MaxDisplayMasteringLuminance` is in units of 1 candela per square meter. + `MinDisplayMasteringLuminance` is in units of 0.0001 candela per square meter. */ typedef struct { mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME. */ mfxU16 reserved[15]; mfxU16 InsertPayloadToggle; /*!< InsertHDRPayload enumerator value. */ - mfxU16 DisplayPrimariesX[3]; /*!< Color primaries for a video source in increments of 0.00002. Consist of RGB x coordinates and - define how to convert colors from RGB color space to CIE XYZ color space. Fields range is - 0 to 50000. */ - mfxU16 DisplayPrimariesY[3]; /*!< Color primaries for a video source in increments of 0.00002. Consists of RGB y coordinates and - defines how to convert colors from RGB color space to CIE XYZ color space. Field range is - 0 to 50000. */ + mfxU16 DisplayPrimariesX[3]; /*!< Color primaries for a video source. Consist of RGB x coordinates and + define how to convert colors from RGB color space to CIE XYZ color space. */ + mfxU16 DisplayPrimariesY[3]; /*!< Color primaries for a video source. Consists of RGB y coordinates and + defines how to convert colors from RGB color space to CIE XYZ color space.*/ mfxU16 WhitePointX; /*!< White point X coordinate. */ mfxU16 WhitePointY; /*!< White point Y coordinate. */ - mfxU32 MaxDisplayMasteringLuminance; /*!< Specify maximum luminance of the display on which the content was authored in units of 0.00001 - candelas per square meter. Field range is 1 to 65535. */ - mfxU32 MinDisplayMasteringLuminance; /*!< Specify minimum luminance of the display on which the content was authored in units of 0.00001 - candelas per square meter. Field range is 1 to 65535. */ + mfxU32 MaxDisplayMasteringLuminance; /*!< Specify maximum luminance of the display on which the content was authored.*/ + mfxU32 MinDisplayMasteringLuminance; /*!< Specify minimum luminance of the display on which the content was authored. */ } mfxExtMasteringDisplayColourVolume; MFX_PACK_END() @@ -2929,10 +2947,10 @@ MFX_PACK_BEGIN_USUAL_STRUCT() the decoder will parse the HDR SEI message if the bitstream include HDR SEI message per frame. The parsed HDR SEI will be attached to the ExtendBuffer of surface_out parameter of MFXVideoDECODE_DecodeFrameAsync() with flag `InsertPayloadToggle` to indicate if there is valid HDR SEI message in the clip. - `InsertPayloadToggle` will be set to `MFX_PAYLOAD_IDR` if OneVPL get valid HDR SEI, otherwise it will be set to `MFX_PAYLOAD_OFF`. + `InsertPayloadToggle` will be set to `MFX_PAYLOAD_IDR` if oneVPL gets valid HDR SEI, otherwise it will be set to `MFX_PAYLOAD_OFF`. This function is support for HEVC only now. - Field semantics are defined in ITU-T* H.265 Annex D. + Field semantics are defined in ITU-T* H.265 Annex D, AV1 6.7.3 Metadata high dynamic range content light level semantics. */ typedef struct { mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to EXTBUFF_CONTENT_LIGHT_LEVEL_INFO. */ @@ -3483,6 +3501,8 @@ MFX_PACK_BEGIN_USUAL_STRUCT() Members of this structure define the location of chroma samples information. See Annex E of the ISO*\/IEC* 14496-10 specification for the definition of these parameters. + + @note Not all implementations of the encoder support this structure. The application must use the Query API function to determine if it is supported. */ typedef struct { mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_CHROMA_LOC_INFO. */ @@ -3789,6 +3809,8 @@ enum { MFX_PACK_BEGIN_USUAL_STRUCT() /*! Attached to the mfxVideoParam structure during HEVC encoder initialization. Specifies the region to encode. + + @note Not all implementations of the encoder support this structure. The application must use the Query API function to determine if it is supported. */ typedef struct { mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_HEVC_REGION. */ @@ -4816,6 +4838,71 @@ typedef struct { } mfxExtTemporalLayers; MFX_PACK_END() +#ifdef ONEVPL_EXPERIMENTAL +MFX_PACK_BEGIN_STRUCT_W_PTR() +/*! The structure is used to get a synchronization object which signalizes about submission of a task to GPU. */ +typedef struct { + mfxExtBuffer Header; /*! Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_SYNCSUBMISSION. */ + mfxSyncPoint *SubmissionSyncPoint; /*!< SyncPoint object to get a moment of a submission task to GPU. */ + mfxU32 reserved1[8]; /*!< Reserved for future use. */ +} mfxExtSyncSubmission; +MFX_PACK_END() +#endif + +#ifdef ONEVPL_EXPERIMENTAL +MFX_PACK_BEGIN_USUAL_STRUCT() +/*! The structure is used to configure perceptual encoding prefilter in VPP. */ +typedef struct { + mfxExtBuffer Header; /*! Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_VPP_PERC_ENC_PREFILTER. */ + mfxU16 reserved[252]; +} mfxExtVPPPercEncPrefilter; +MFX_PACK_END() +#endif + +#ifdef ONEVPL_EXPERIMENTAL +/*! The TuneQuality enumerator specifies tuning option for encode. Multiple tuning options can be combined using bit mask. */ +enum { + MFX_ENCODE_TUNE_DEFAULT = 0, /*!< The balanced option to keep quality balanced across all metrics. */ + MFX_ENCODE_TUNE_PSNR = 0x1, /*!< The encoder optimizes quality according to Peak Signal-to-Noise Ratio (PSNR) metric. */ + MFX_ENCODE_TUNE_SSIM = 0x2, /*!< The encoder optimizes quality according to Structural Similarity Index Measure (SSIM) metric. */ + MFX_ENCODE_TUNE_MS_SSIM = 0x4, /*!< The encoder optimizes quality according to Multi-Scale Structural Similarity Index Measure (MS-SSIM) metric. */ + MFX_ENCODE_TUNE_VMAF = 0x8, /*!< The encoder optimizes quality according to Video Multi-Method Assessment Fusion (VMAF) metric. */ + MFX_ENCODE_TUNE_PERCEPTUAL = 0x10, /*!< The encoder makes perceptual quality optimization. */ +}; + +MFX_PACK_BEGIN_STRUCT_W_PTR() +/*! The structure specifies type of quality optimization used by the encoder. The buffer can also be attached for VPP functions to make correspondent pre-filtering. */ +typedef struct { + mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_TUNE_ENCODE_QUALITY. */ + mfxU32 TuneQuality; /*!< The control to specify type of encode quality metric(s) to optimize; See correspondent enum. */ + mfxExtBuffer** ExtParam; /*!< Points to an array of pointers to the extra configuration structures; see the ExtendedBufferID enumerator for a list of extended configurations. */ + mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to the structure. */ + mfxU16 reserved[11]; +} mfxExtTuneEncodeQuality; +MFX_PACK_END() +#endif + +#ifdef ONEVPL_EXPERIMENTAL +/* The mfxAutoSelectImplType enumerator specifies the method for automatically selecting an implementation. */ +typedef enum { + MFX_AUTO_SELECT_IMPL_TYPE_UNKNOWN = 0, /*!< Unspecified automatic implementation selection. */ + MFX_AUTO_SELECT_IMPL_TYPE_DEVICE_HANDLE = 1, /*!< Select implementation corresponding to device handle. */ +} mfxAutoSelectImplType; + +MFX_PACK_BEGIN_STRUCT_W_PTR() +/*! Specifies that an implementation should be selected which matches the device handle provided by the application. */ +typedef struct { + mfxAutoSelectImplType AutoSelectImplType; /*!< Must be set to MFX_AUTO_SELECT_IMPL_TYPE_DEVICE_HANDLE. */ + + mfxAccelerationMode AccelMode; /*!< Hardware acceleration mode of provided device handle. */ + mfxHandleType DeviceHandleType; /*!< Type of provided device handle. */ + mfxHDL DeviceHandle; /*!< System handle to hardware device. */ + + mfxU16 reserved[8]; /*!< Reserved for future use. */ +} mfxAutoSelectImplDeviceHandle; +MFX_PACK_END() +#endif + #ifdef __cplusplus } // extern "C" #endif diff --git a/source/elements/oneVPL/include/vpl/mfxvideo++.h b/source/elements/oneVPL/include/vpl/mfxvideo++.h index afcfa3d2b6..c3b7111cc0 100644 --- a/source/elements/oneVPL/include/vpl/mfxvideo++.h +++ b/source/elements/oneVPL/include/vpl/mfxvideo++.h @@ -7,7 +7,12 @@ #ifndef __MFXVIDEOPLUSPLUS_H #define __MFXVIDEOPLUSPLUS_H +#ifdef MFXVIDEO_CPP_ENABLE_MFXLOAD +#include "vpl/mfx.h" +#define MFX_IMPL_ACCELMODE(x) (0xff00 & (x)) +#else #include "mfxvideo.h" +#endif class MFXVideoSessionBase { public: @@ -111,23 +116,53 @@ class MFXVideoVPPBase { class MFXVideoSession : public MFXVideoSessionBase { public: MFXVideoSession(void) { - m_session = (mfxSession)0; + m_session = (mfxSession)0; +#ifdef MFXVIDEO_CPP_ENABLE_MFXLOAD + m_loader = (mfxLoader)0; +#endif } virtual ~MFXVideoSession(void) { Close(); } virtual mfxStatus Init(mfxIMPL impl, mfxVersion *ver) override { +#ifdef MFXVIDEO_CPP_ENABLE_MFXLOAD + mfxInitParam par = {}; + par.Implementation = impl; + par.Version = *ver; + return InitSession(par); +#else return MFXInit(impl, ver, &m_session); +#endif } virtual mfxStatus InitEx(mfxInitParam par) override { +#ifdef MFXVIDEO_CPP_ENABLE_MFXLOAD + return InitSession(par); +#else return MFXInitEx(par, &m_session); +#endif } virtual mfxStatus Close(void) override { +#ifdef MFXVIDEO_CPP_ENABLE_MFXLOAD + if (m_session) { + mfxStatus mfxRes; + mfxRes = MFXClose(m_session); + m_session = (mfxSession)0; + if (m_loader) { + MFXUnload(m_loader); + m_loader = (mfxLoader)0; + } + return mfxRes; + } + else { + return MFX_ERR_NONE; + } +#else mfxStatus mfxRes; mfxRes = MFXClose(m_session); m_session = (mfxSession)0; return mfxRes; +#endif } virtual mfxStatus QueryIMPL(mfxIMPL *impl) override { @@ -189,6 +224,155 @@ class MFXVideoSession : public MFXVideoSessionBase { protected: mfxSession m_session; // (mfxSession) handle to the owning session + +#ifdef MFXVIDEO_CPP_ENABLE_MFXLOAD + mfxLoader m_loader; + + inline void InitVariant(mfxVariant *var, mfxU32 data) { + var->Version.Version = (mfxU16)MFX_VARIANT_VERSION; + var->Type = MFX_VARIANT_TYPE_U32; + var->Data.U32 = data; + } + + inline void InitVariant(mfxVariant *var, mfxU16 data) { + var->Version.Version = (mfxU16)MFX_VARIANT_VERSION; + var->Type = MFX_VARIANT_TYPE_U16; + var->Data.U16 = data; + } + + inline void InitVariant(mfxVariant *var, mfxHDL data) { + var->Version.Version = (mfxU16)MFX_VARIANT_VERSION; + var->Type = MFX_VARIANT_TYPE_PTR; + var->Data.Ptr = data; + } + + template + mfxStatus CreateConfig(varDataType data, const char *propertyName) { + mfxConfig cfg = MFXCreateConfig(m_loader); + if (cfg == nullptr) + return MFX_ERR_NULL_PTR; + + mfxVariant variant; + InitVariant(&variant, data); + + return MFXSetConfigFilterProperty(cfg, (mfxU8 *)propertyName, variant); + } + + mfxStatus InitSession(mfxInitParam par) { + // already initialized + if (m_session) + return MFX_ERR_NONE; + + m_loader = MFXLoad(); + if (!m_loader) + return MFX_ERR_NOT_FOUND; + + mfxStatus mfxRes = MFX_ERR_NONE; + + mfxU32 implBaseType = MFX_IMPL_BASETYPE(par.Implementation); + + // select implementation type + switch (implBaseType) { + case MFX_IMPL_AUTO: + case MFX_IMPL_AUTO_ANY: + break; + + case MFX_IMPL_SOFTWARE: + mfxRes = CreateConfig(MFX_IMPL_TYPE_SOFTWARE, "mfxImplDescription.Impl"); + break; + + case MFX_IMPL_HARDWARE: + case MFX_IMPL_HARDWARE_ANY: + case MFX_IMPL_HARDWARE2: + case MFX_IMPL_HARDWARE3: + case MFX_IMPL_HARDWARE4: + mfxRes = CreateConfig(MFX_IMPL_TYPE_HARDWARE, "mfxImplDescription.Impl"); + break; + + default: + mfxRes = MFX_ERR_UNSUPPORTED; + break; + } + + if (MFX_ERR_NONE != mfxRes) + return MFX_ERR_UNSUPPORTED; + + // select adapter index (if specified) + // see notes below about how VendorImplID is interpreted for each acceleration mode + switch (implBaseType) { + case MFX_IMPL_HARDWARE: + mfxRes = CreateConfig(0, "mfxImplDescription.VendorImplID"); + break; + case MFX_IMPL_HARDWARE2: + mfxRes = CreateConfig(1, "mfxImplDescription.VendorImplID"); + break; + case MFX_IMPL_HARDWARE3: + mfxRes = CreateConfig(2, "mfxImplDescription.VendorImplID"); + break; + case MFX_IMPL_HARDWARE4: + mfxRes = CreateConfig(3, "mfxImplDescription.VendorImplID"); + break; + } + + if (MFX_ERR_NONE != mfxRes) + return MFX_ERR_UNSUPPORTED; + + mfxU32 implAccelMode = MFX_IMPL_ACCELMODE(par.Implementation); + if (implAccelMode == MFX_IMPL_VIA_D3D9) { + // D3D9 - because VendorImplID corresponds to DXGI adapter index (DX11 enumeration), + // this may not map directly to D3D9 index in multi-adapter/multi-monitor configurations + mfxRes = CreateConfig(MFX_ACCEL_MODE_VIA_D3D9, + "mfxImplDescription.AccelerationMode"); + } + else if (implAccelMode == MFX_IMPL_VIA_D3D11) { + // D3D11 - VendorImplID corresponds to DXGI adapter index + mfxRes = CreateConfig(MFX_ACCEL_MODE_VIA_D3D11, + "mfxImplDescription.AccelerationMode"); + } + else if (implAccelMode == MFX_IMPL_VIA_VAAPI) { + // VAAPI - in general MFXInitEx treats any HARDWAREn the same way (relies on application to pass + // correct VADisplay via SetHandle), but 2.x RT only reports actual number of adapters + mfxRes = CreateConfig(MFX_ACCEL_MODE_VIA_VAAPI, + "mfxImplDescription.AccelerationMode"); + } + + if (MFX_ERR_NONE != mfxRes) + return MFX_ERR_UNSUPPORTED; + + // set required API level + mfxRes = + CreateConfig(par.Version.Version, "mfxImplDescription.ApiVersion.Version"); + if (MFX_ERR_NONE != mfxRes) + return MFX_ERR_UNSUPPORTED; + + // set GPUCopy parameter + if (par.GPUCopy) { + mfxRes = CreateConfig(par.GPUCopy, "DeviceCopy"); + if (MFX_ERR_NONE != mfxRes) + return MFX_ERR_UNSUPPORTED; + } + + // ExternalThreads was deprecated in API 2.x along with MFXDoWork() + if (par.ExternalThreads) { + return MFX_ERR_UNSUPPORTED; + } + + // pass extBufs + if (par.NumExtParam) { + for (mfxU32 idx = 0; idx < par.NumExtParam; idx++) { + mfxRes = CreateConfig(par.ExtParam[idx], "ExtBuffer"); + if (MFX_ERR_NONE != mfxRes) + return MFX_ERR_UNSUPPORTED; + } + } + + // create session with highest priority implementation remaining after filters + mfxRes = MFXCreateSession(m_loader, 0, &m_session); + + return mfxRes; + } +#endif + private: MFXVideoSession(const MFXVideoSession &); void operator=(MFXVideoSession &); @@ -353,7 +537,9 @@ class MFXVideoVPP : public MFXVideoVPPBase { class MFXVideoDECODE_VPP { public: - explicit MFXVideoDECODE_VPP(mfxSession session) { m_session = session; } + explicit MFXVideoDECODE_VPP(mfxSession session) { + m_session = session; + } virtual ~MFXVideoDECODE_VPP(void) { Close(); } diff --git a/source/elements/oneVPL/source/API_ref/VPL_disp_api_enum.rst b/source/elements/oneVPL/source/API_ref/VPL_disp_api_enum.rst index 3744a70ed0..306671d0aa 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_disp_api_enum.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_disp_api_enum.rst @@ -27,3 +27,9 @@ mfxImplType .. doxygenenum:: mfxImplType :project: oneVPL + +mfxAutoSelectImplType +--------------------- + +.. doxygenenum:: mfxAutoSelectImplType + :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 cd70dab15b..73401433d6 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 @@ -98,3 +98,11 @@ mfxPoolPolicyDescription :project: oneVPL :members: :protected-members: + +extDeviceUUID +------------- + +.. doxygenstruct:: extDeviceUUID + :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 5fbb388afe..c823b4f2b9 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_enums.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_enums.rst @@ -1119,6 +1119,15 @@ extended buffers or video processing algorithm identifiers. .. doxygenenumvalue:: MFX_EXTBUFF_ENCODESTATS :project: oneVPL +.. doxygenenumvalue:: MFX_EXTBUFF_SYNCSUBMISSION + :project: oneVPL + +.. doxygenenumvalue:: MFX_EXTBUFF_TUNE_ENCODE_QUALITY + :project: oneVPL + +.. doxygenenumvalue:: MFX_EXTBUFF_VPP_PERC_ENC_PREFILTER + :project: oneVPL + ---------------- ExtMemBufferType ---------------- @@ -1894,101 +1903,45 @@ The PicType enumerator itemizes picture type. .. doxygenenumvalue:: MFX_PICTYPE_BOTTOMFIELD :project: oneVPL ----------------- -PlatformCodeName ----------------- - -.. doxygenenumvalue:: MFX_PLATFORM_UNKNOWN - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_SANDYBRIDGE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_IVYBRIDGE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_HASWELL - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_BAYTRAIL - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_BROADWELL - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_CHERRYTRAIL - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_SKYLAKE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_APOLLOLAKE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_KABYLAKE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_GEMINILAKE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_COFFEELAKE - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_CANNONLAKE - :project: oneVPL +-------- +PRefType +-------- -.. doxygenenumvalue:: MFX_PLATFORM_ICELAKE - :project: oneVPL +The PRefType enumerator itemizes models of reference list construction and DPB +management when GopRefDist=1. -.. doxygenenumvalue:: MFX_PLATFORM_JASPERLAKE +.. doxygenenumvalue:: MFX_P_REF_DEFAULT :project: oneVPL -.. doxygenenumvalue:: MFX_PLATFORM_ELKHARTLAKE +.. doxygenenumvalue:: MFX_P_REF_SIMPLE :project: oneVPL -.. doxygenenumvalue:: MFX_PLATFORM_TIGERLAKE +.. doxygenenumvalue:: MFX_P_REF_PYRAMID :project: oneVPL -.. doxygenenumvalue:: MFX_PLATFORM_ROCKETLAKE - :project: oneVPL +----------- +TuneQuality +----------- -.. doxygenenumvalue:: MFX_PLATFORM_ALDERLAKE_S - :project: oneVPL +The TuneQuality enumerator specifies tuning option for encode. Multiple tuning options +can be combined using bit mask. -.. doxygenenumvalue:: MFX_PLATFORM_ALDERLAKE_P +.. doxygenenumvalue:: MFX_ENCODE_TUNE_DEFAULT :project: oneVPL -.. doxygenenumvalue:: MFX_PLATFORM_ALDERLAKE_N +.. doxygenenumvalue:: MFX_ENCODE_TUNE_PSNR :project: oneVPL -.. doxygenenumvalue:: MFX_PLATFORM_XEHP_SDV - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_DG2 - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_ATS_M - :project: oneVPL - -.. doxygenenumvalue:: MFX_PLATFORM_KEEMBAY +.. doxygenenumvalue:: MFX_ENCODE_TUNE_SSIM :project: oneVPL - - --------- -PRefType --------- - -The PRefType enumerator itemizes models of reference list construction and DPB -management when GopRefDist=1. - -.. doxygenenumvalue:: MFX_P_REF_DEFAULT +.. doxygenenumvalue:: MFX_ENCODE_TUNE_MS_SSIM :project: oneVPL -.. doxygenenumvalue:: MFX_P_REF_SIMPLE +.. doxygenenumvalue:: MFX_ENCODE_TUNE_VMAF :project: oneVPL -.. doxygenenumvalue:: MFX_P_REF_PYRAMID +.. doxygenenumvalue:: MFX_ENCODE_TUNE_PERCEPTUAL :project: oneVPL --------- diff --git a/source/elements/oneVPL/source/API_ref/VPL_structs_cross_component.rst b/source/elements/oneVPL/source/API_ref/VPL_structs_cross_component.rst index b18efb6919..63a1094a7b 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_structs_cross_component.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_structs_cross_component.rst @@ -314,3 +314,19 @@ mfxExtContentLightLevelInfo :project: oneVPL :members: :protected-members: + +mfxExtSyncSubmission +-------------------- + +.. doxygenstruct:: mfxExtSyncSubmission + :project: oneVPL + :members: + :protected-members: + +mfxExtTuneEncodeQuality +----------------------- + +.. doxygenstruct:: mfxExtTuneEncodeQuality + :project: oneVPL + :members: + :protected-members: diff --git a/source/elements/oneVPL/source/API_ref/VPL_structs_decode_vpp.rst b/source/elements/oneVPL/source/API_ref/VPL_structs_decode_vpp.rst index 65744f9412..cb64e623d7 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_structs_decode_vpp.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_structs_decode_vpp.rst @@ -6,7 +6,7 @@ .. _struct_decode_vpp: ====================== -DECODDE_VPP Structures +DECODE_VPP Structures ====================== .. _struct_decode_vpp_begin: diff --git a/source/elements/oneVPL/source/API_ref/VPL_structs_impl_manage.rst b/source/elements/oneVPL/source/API_ref/VPL_structs_impl_manage.rst index 4fcecadb02..44c9df19f0 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_structs_impl_manage.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_structs_impl_manage.rst @@ -84,4 +84,12 @@ mfxInitializationParam :project: oneVPL :members: :protected-members: + +mfxAutoSelectImplDeviceHandle +----------------------------- + +.. doxygenstruct:: mfxAutoSelectImplDeviceHandle + :project: oneVPL + :members: + :protected-members: \ No newline at end of file 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 1ccf2f53d3..9b5ff07f4c 100644 --- a/source/elements/oneVPL/source/API_ref/VPL_structs_vpp.rst +++ b/source/elements/oneVPL/source/API_ref/VPL_structs_vpp.rst @@ -271,3 +271,11 @@ mfxVPPStat :project: oneVPL :members: :protected-members: + +mfxExtVPPPercEncPrefilter +------------------------- + +.. doxygenstruct:: mfxExtVPPPercEncPrefilter + :project: oneVPL + :members: + :protected-members: diff --git a/source/elements/oneVPL/source/Experimental.rst b/source/elements/oneVPL/source/Experimental.rst index c4aa107695..752c170e67 100644 --- a/source/elements/oneVPL/source/Experimental.rst +++ b/source/elements/oneVPL/source/Experimental.rst @@ -79,4 +79,67 @@ The following is a list of experimental interfaces, starting from API version - 2.8 - - - + * - :cpp:struct:`mfxExtSyncSubmission` + - 2.9 + - + - + * - :cpp:struct:`mfxExtVPPPercEncPrefilter` + - 2.9 + - + - + * - :cpp:member:`mfxExtendedDeviceId::RevisionID` + - 2.9 + - + - + * - :cpp:struct:`extDeviceUUID` + - 2.9 + - + - + * - :cpp:struct:`mfxExtTuneEncodeQuality` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_ENCODE_TUNE_DEFAULT` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_ENCODE_TUNE_PSNR` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_ENCODE_TUNE_SSIM` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_ENCODE_TUNE_MS_SSIM` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_ENCODE_TUNE_VMAF` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_ENCODE_TUNE_PERCEPTUAL` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_EXTBUFF_TUNE_ENCODE_QUALITY` + - 2.9 + - + - + * - :cpp:struct:`mfxAutoSelectImplDeviceHandle` + - 2.9 + - + - + * - :cpp:type:`mfxAutoSelectImplType` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_AUTO_SELECT_IMPL_TYPE_UNKNOWN` + - 2.9 + - + - + * - :cpp:enumerator:`MFX_AUTO_SELECT_IMPL_TYPE_DEVICE_HANDLE` + - 2.9 + - + - diff --git a/source/elements/oneVPL/source/VPL_change_log.rst b/source/elements/oneVPL/source/VPL_change_log.rst index 4f61526c00..9d49a63923 100644 --- a/source/elements/oneVPL/source/VPL_change_log.rst +++ b/source/elements/oneVPL/source/VPL_change_log.rst @@ -12,6 +12,27 @@ This section describes the API evolution from version to version. :local: :depth: 1 +----------- +Version 2.9 +----------- + +New in this release: + +* Deprecated :cpp:member:`mfxExtCodingOption2::BitrateLimit`. +* Added note that applications must call MFXVideoENCODE_Query() to check for support of :cpp:struct:`mfxExtChromaLocInfo` and :cpp:struct:`mfxExtHEVCRegion` extension buffers. +* Added AV1 HDR metadata description and further clarified :cpp:struct:`mfxExtMasteringDisplayColourVolume` and :cpp:struct:`mfxExtContentLightLevelInfo`. +* Added deprecation messages to the functions :cpp:func:`MFXQueryAdapters`, :cpp:func:`MFXQueryAdaptersDecode`, and :cpp:func:`MFXQueryAdaptersNumber`. + Applications should use the process described in :ref:`oneVPL Dispatcher ` to enumerate and select adapters. +* Fixed multiple spelling errors. +* Added extension buffer :cpp:struct:`mfxExtSyncSubmission` to return submission synchronization sync point. +* Added extension buffer :cpp:struct:`mfxExtVPPPercEncPrefilter` to control perceptual encoding prefilter. +* Deprecated :cpp:member:`mfxPlatform::CodeName` and corresponding enum values. +* Added :cpp:member:`mfxExtendedDeviceId::RevisionID` and :cpp:struct:`extDeviceUUID` to be aligned across multiple domains including compute and specify device UUID accordingly. +* Added extension buffer :cpp:struct:`mfxExtTuneEncodeQuality` and correspondent enumeration to specify encoding tuning option. +* Updated description of :cpp:func:`MFXEnumImplementations` to clarify that the input :cpp:type:`mfxImplCapsDeliveryFormat` determines the type of structure returned. +* Updated mfxvideo++.h to use MFXLoad API. +* Added :cpp:struct:`mfxAutoSelectImplDeviceHandle` and :cpp:type:`mfxAutoSelectImplType` for automatically selecting a suitable implementation based on application-provided device handle. + ----------- Version 2.8 ----------- diff --git a/source/elements/oneVPL/source/VPL_deprecation.rst b/source/elements/oneVPL/source/VPL_deprecation.rst index 1a0c29192c..2f96b7d19f 100644 --- a/source/elements/oneVPL/source/VPL_deprecation.rst +++ b/source/elements/oneVPL/source/VPL_deprecation.rst @@ -18,6 +18,161 @@ The following is a list of deprecated interfaces, starting from API version 2.0. - **Removed in API Version** - **Alternatives** - **Behaviour change of deprecated API** + * - :cpp:func:`MFXQueryAdapters` + - 2.9 + - + - :cpp:func:`MFXEnumImplementations` + :cpp:func:`MFXSetConfigFilterProperty` + - No change + * - :cpp:func:`MFXQueryAdaptersDecode` + - 2.9 + - + - :cpp:func:`MFXEnumImplementations` + :cpp:func:`MFXSetConfigFilterProperty` + - No change + * - :cpp:func:`MFXQueryAdaptersNumber` + - 2.9 + - + - :cpp:func:`MFXEnumImplementations` + :cpp:func:`MFXSetConfigFilterProperty` + - No change + * - :cpp:member:`mfxExtCodingOption2::BitrateLimit` + - 2.9 + - + - Flag is ignored on VDEnc + - No change + * - :cpp:enumerator:`MFX_PLATFORM_UNKNOWN` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_SANDYBRIDGE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_IVYBRIDGE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_HASWELL` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_BAYTRAIL` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_BROADWELL` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_CHERRYTRAIL` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_SKYLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_APOLLOLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_KABYLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_GEMINILAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_COFFEELAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_CANNONLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ICELAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_JASPERLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ELKHARTLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_TIGERLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ROCKETLAKE` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ALDERLAKE_S` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ALDERLAKE_P` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ARCTICSOUND_P` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_XEHP_SDV` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_DG2` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ATS_M` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_ALDERLAKE_N` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:enumerator:`MFX_PLATFORM_KEEMBAY` + - 2.9 + - + - Field :cpp:member:`mfxPlatform::CodeName` is not filled by the library + - No change + * - :cpp:member:`mfxPlatform::CodeName` + - 2.9 + - + - Field is not filled by the library + - No change * - :cpp:func:`MFXInit` - 2.3 - diff --git a/source/elements/oneVPL/source/VPL_intel_media_sdk.rst b/source/elements/oneVPL/source/VPL_intel_media_sdk.rst index 6c5c3e8534..f0c99a8b74 100644 --- a/source/elements/oneVPL/source/VPL_intel_media_sdk.rst +++ b/source/elements/oneVPL/source/VPL_intel_media_sdk.rst @@ -102,7 +102,7 @@ included in oneVPL: - **Raw Acceleration.** |msdk_full_name| RAW acceleration (Camera API) which is implemented as plugin is obsolete, replaced by oneVPL and oneVPL runtime implementation. - OneVPL reused most of |msdk_full_name| Camera API, but oneVPL camera API is not backward + oneVPL reused most of |msdk_full_name| Camera API, but oneVPL camera API is not backward compatible with |msdk_full_name| camera API due to obsolete plugin mechanism in oneVPL and a few difference between oneVPL and |msdk_full_name|. The major difference between oneVPL and |msdk_full_name| are listed: 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 bee68b97d3..4e6d112030 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_hw.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_hw.rst @@ -50,8 +50,16 @@ Work with Multiple Media Devices If your system has multiple graphics adapters, you may need hints on which adapter is better suited to process a particular workload. The legacy mode of oneVPL provides a helper API to select the most suitable adapter for your -workload based on the provided workload description. The following example shows -workload initialization on a discrete adapter: +workload based on the provided workload description. + +.. important:: :cpp:func:`MFXQueryAdapters`, :cpp:func:`MFXQueryAdaptersDecode`, + and :cpp:func:`MFXQueryAdaptersNumber` are deprecated starting + from API 2.9. Applications should use :cpp:func:`MFXEnumImplementations` + and :cpp:func:`MFXSetConfigFilterProperty` to query adapter + capabilities and to select a suitable adapter for the input workload. + +The following example shows workload initialization on a discrete adapter +in legacy mode: .. literalinclude:: ../snippets/prg_hw.cpp 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 89a4dd54bb..ced557181d 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_session.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_session.rst @@ -110,6 +110,8 @@ will vary according to the OS. #. SDK installation folder. +.. _onevpl-dispatcher: + ----------------- oneVPL Dispatcher ----------------- @@ -439,6 +441,10 @@ left to right from column to column and concatenate strings by using `.` (dot) a | | | | | to | | | | | | IDXGIFactory::EnumAdapters| +---------------------------------------+----------------------------+----------------------+---------------------------+ + | N/A | | AutoSelectImpl | MFX_VARIANT_TYPE_PTR | Pointer to a struct for | + | | | | | automatic implementation | + | | | | | :ref:`selection`| + +---------------------------------------+----------------------------+----------------------+---------------------------+ .. important:: DXGIAdapterIndex property is available for Windows only and filters only hardware implementations. @@ -820,6 +826,35 @@ This code illustrates VPP mirror filter implementation search procedure: :end-before: /*end4*/ :lineno-start: 1 +.. _auto_sel: + +------------------------------------------------------------- +How To Select Implementation Automatically From Device Handle +------------------------------------------------------------- + +Starting from API 2.9 applications may request the dispatcher to load an implementation +corresponding to a hardware acceleration device which has already been initialized +by the application. The application must initialize a structure of type +:cpp:struct:`mfxAutoSelectImplDeviceHandle` with the appropriate acceleration mode, +handle type, and hardware device handle. Then this structure must be passed to the +dispatcher by calling :cpp:func:`MFXSetConfigFilterProperty` with property name +'AutoSelectImpl' and property value of type MFX_VARIANT_TYPE_PTR, pointing to the +:cpp:struct:`mfxAutoSelectImplDeviceHandle` structure. + +This is currently an experimental API. Backward compatibility and future presence is +not guaranteed. Applications should check the error codes returned from +:cpp:func:`MFXSetConfigFilterProperty` and :cpp:func:`MFXCreateSession` to check +whether the feature is supported and a suitable implementation was found. + +This code illustrates automatic implementation selection using an application-provided +hardware device handle: + +.. literalinclude:: ../snippets/prg_disp.c + :language: c++ + :start-after: /*beg5*/ + :end-before: /*end5*/ + :lineno-start: 1 + ------------------------------------------------------------- How To Get Path to the Shared Library With the Implementation ------------------------------------------------------------- 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 32d47c9a99..e24884690d 100644 --- a/source/elements/oneVPL/source/programming_guide/VPL_prg_vpp.rst +++ b/source/elements/oneVPL/source/programming_guide/VPL_prg_vpp.rst @@ -275,4 +275,17 @@ The following pseudo code shows camera raw processing. :language: c++ :start-after: /*beg9*/ :end-before: /*end9*/ - :lineno-start: 1 \ No newline at end of file + :lineno-start: 1 + +------------------------------- +Task submission synchronization +------------------------------- + +oneVPL can return synchronization object - syncpoint to notify application about +submission a task to the GPU. The following example demonstrates the approach. + +.. literalinclude:: ../snippets/prg_vpp.c + :language: c++ + :start-after: /*beg10*/ + :end-before: /*end10*/ + :lineno-start: 1 diff --git a/source/elements/oneVPL/source/snippets/prg_disp.c b/source/elements/oneVPL/source/snippets/prg_disp.c index 527631d52b..6424c7ca71 100644 --- a/source/elements/oneVPL/source/snippets/prg_disp.c +++ b/source/elements/oneVPL/source/snippets/prg_disp.c @@ -88,3 +88,43 @@ MFXSetConfigFilterProperty(cfg2, MFXCreateSession(loader,0,&session); /*end4*/ } + +void prg_dispatcher5 () { +/*beg5*/ +mfxLoader loader = MFXLoad(); + +// In actual code, application should initialize deviceHandle to a +// hardware device handle of the type indicated in the following table. +// +// AccelMode DeviceHandleType DeviceHandle native type +// ----------------------------------------------------------------------------------- +// MFX_ACCEL_MODE_VIA_D3D9 MFX_HANDLE_D3D9_DEVICE_MANAGER IDirect3DDeviceManager9* +// MFX_ACCEL_MODE_VIA_D3D11 MFX_HANDLE_D3D11_DEVICE ID3D11Device* +// MFX_ACCEL_MODE_VIA_VAAPI MFX_HANDLE_VA_DISPLAY VADisplay +// +// Example: +// ID3D11Device *pD3D11Device; +// D3D11CreateDevice(... , &pD3D11Device , ...); +// mfxHDL deviceHandle = (mfxHDL)pD3D11Device; + +mfxHDL deviceHandle = NULL; + +mfxAutoSelectImplDeviceHandle autoSelectStruct; +autoSelectStruct.AutoSelectImplType = MFX_AUTO_SELECT_IMPL_TYPE_DEVICE_HANDLE; +autoSelectStruct.AccelMode = MFX_ACCEL_MODE_VIA_D3D11; +autoSelectStruct.DeviceHandleType = MFX_HANDLE_D3D11_DEVICE; +autoSelectStruct.DeviceHandle = deviceHandle; + +mfxConfig cfg1 = MFXCreateConfig(loader); +mfxVariant ImplValue; +ImplValue.Type = MFX_VARIANT_TYPE_PTR; +ImplValue.Data.Ptr = &autoSelectStruct; + +MFXSetConfigFilterProperty(cfg1, (const mfxU8 *)"AutoSelectImpl", ImplValue); + +// Create session with implementation corresponding to deviceHandle. +// It is not required to call MFXVideoCORE_SetHandle() in this case, +// since the implementation already has the necessary deviceHandle. +MFXCreateSession(loader, 0, &session); +/*end5*/ +} diff --git a/source/elements/oneVPL/source/snippets/prg_vpp.c b/source/elements/oneVPL/source/snippets/prg_vpp.c index a414d458bc..db9a772046 100644 --- a/source/elements/oneVPL/source/snippets/prg_vpp.c +++ b/source/elements/oneVPL/source/snippets/prg_vpp.c @@ -398,3 +398,29 @@ MFXVideoVPP_Init(session, &VPPParams); #endif /*end9*/ } + +static void run_your_GPU_kernel(mfxFrameSurface1 *surface) +{ + UNUSED_PARAM(surface); + return; +} + +static void prg_vpp10() { +/*beg10*/ +#ifdef ONEVPL_EXPERIMENTAL +mfxExtSyncSubmission syncSubmit = {}; +syncSubmit.Header.BufferId = MFX_EXTBUFF_SYNCSUBMISSION; +syncSubmit.Header.BufferSz = sizeof(mfxExtSyncSubmission); + +mfxFrameSurface1 in; +mfxFrameSurface1 out; +out.Data.ExtParam = (mfxExtBuffer **)&syncSubmit; +out.Data.NumExtParam=1; +sts=MFXVideoVPP_RunFrameVPPAsync(session,&in,&out,NULL,&syncp); +if (MFX_ERR_NONE == sts) { + MFXVideoCORE_SyncOperation(session, *syncSubmit.SubmissionSyncPoint, INFINITE); + run_your_GPU_kernel(&out); +} +#endif +/*end10*/ +} diff --git a/source/elements/oneVPL/source/spelling_wordlist_vpl.txt b/source/elements/oneVPL/source/spelling_wordlist_vpl.txt index efd575e84e..afc1479ea7 100644 --- a/source/elements/oneVPL/source/spelling_wordlist_vpl.txt +++ b/source/elements/oneVPL/source/spelling_wordlist_vpl.txt @@ -4,12 +4,14 @@ # additional entries for oneVPL AllocationPolicy +AutoSelectImpl altref BitDepthChroma BitDepthLuma Bitfield bitrates BitstreamParam +candela cbr ChannelId ChromaFormat @@ -40,6 +42,7 @@ DLutVideoBuffer doesn Downscaling dri +extDeviceUUID FeatureEnabled FFFFFFF FilmGrainParam @@ -60,6 +63,7 @@ IDR Ign Impl impls +isn itu Kbps Keem @@ -75,6 +79,8 @@ mfxAccelerationMode mfxAccelerationModeDescription mfxAdapterInfo mfxAdaptersInfo +mfxAutoSelectImplType +mfxAutoSelectImplDeviceHandle mfxAV mfxBitstream mfxBRCFrameCtrl @@ -179,9 +185,11 @@ mfxExtPartialBitstreamParam mfxExtPictureTimingSEI mfxExtPredWeightTable mfxExtRefListCtrl +mfxExtSyncSubmission mfxExtTemporalLayers mfxExtThreadsParam mfxExtTimeCode +mfxExtTuneEncodeQuality mfxExtVideoSignalInfo mfxExtVP mfxExtVPP @@ -198,6 +206,7 @@ mfxExtVPPFrameRateConversion mfxExtVPPImageStab mfxExtVppMctf mfxExtVPPMirroring +mfxExtVPPPercEncPrefilter mfxExtVPPProcAmp mfxExtVPPRotation mfxExtVPPScaling @@ -264,6 +273,7 @@ nLx nRepack nRx NumBit +NumSubDevices NumUnitsEncoded Nx NxN @@ -272,6 +282,7 @@ NxnT OR'ed piecewise pred +prefilter Qm QP quantizer @@ -290,11 +301,13 @@ SkipFrame structs subblock subblocks +syncpoint TargetUsage TemporalLayer TemporalLayers TileParam tri +TuneQuality Typedefs utf vaCreateSurfaces