mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
qsv: Update oneVPL SDK version to v2023.3.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5032>
This commit is contained in:
parent
a9e725bc3b
commit
1bc5dc778c
20 changed files with 1022 additions and 181 deletions
|
@ -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
|
||||
|
|
|
@ -53,15 +53,15 @@ typedef struct {
|
|||
initial_cpb_removal_delay==0 && initial_cpb_removal_offset == 0 && HRD control is switched on. */
|
||||
mfxU32 reserved1[7];
|
||||
mfxU32 MaxFrameSize; /*!< Max frame size in bytes. Option for repack feature. Driver calls PAK until current frame size is
|
||||
less than or equal to maxFrameSize, or number of repacking for this frame is equal to maxNumRePak. Repack is available
|
||||
if there is driver support, MaxFrameSize !=0, and MaxNumRePak != 0. Ignored if maxNumRePak == 0. */
|
||||
mfxU8 DeltaQP[8]; /*!< Option for repack feature. Ignored if maxNumRePak == 0 or maxNumRePak==0. If current
|
||||
frame size > maxFrameSize and/or number of repacking (nRepack) for this frame <= maxNumRePak,
|
||||
less than or equal to MaxFrameSize, or number of repacking for this frame is equal to MaxNumRePak. Repack is available
|
||||
if there is driver support, MaxFrameSize !=0, and MaxNumRePak != 0. Ignored if MaxNumRePak == 0. */
|
||||
mfxU8 DeltaQP[8]; /*!< Option for repack feature. Ignored if MaxNumRePak == 0 or MaxNumRePak==0. If current
|
||||
frame size > MaxFrameSize and/or number of repacking (nRepack) for this frame <= MaxNumRePak,
|
||||
PAK is called with QP = mfxBRCFrameCtrl::QpY + Sum(DeltaQP[i]), where i = [0,nRepack].
|
||||
Non zero DeltaQP[nRepack] are ignored if nRepack > maxNumRePak.
|
||||
If repacking feature is on ( maxFrameSize & maxNumRePak are not zero), it is calculated by the encoder. */
|
||||
mfxU16 MaxNumRepak; /*!< Number of possible repacks in driver if current frame size > maxFrameSize. Ignored if maxFrameSize==0.
|
||||
See maxFrameSize description. Possible values are in the range of 0 to 8. */
|
||||
Non zero DeltaQP[nRepack] are ignored if nRepack > MaxNumRePak.
|
||||
If repacking feature is on ( MaxFrameSize & MaxNumRePak are not zero), it is calculated by the encoder. */
|
||||
mfxU16 MaxNumRepak; /*!< Number of possible repacks in driver if current frame size > MaxFrameSize. Ignored if MaxFrameSize==0.
|
||||
See MaxFrameSize description. Possible values are in the range of 0 to 8. */
|
||||
mfxU16 NumExtParam; /*!< Reserved for future use. */
|
||||
mfxExtBuffer** ExtParam; /*!< Reserved for future use. */
|
||||
} mfxBRCFrameCtrl;
|
||||
|
|
406
subprojects/gst-plugins-bad/sys/qsv/libmfx/api/vpl/mfxcamera.h
Normal file
406
subprojects/gst-plugins-bad/sys/qsv/libmfx/api/vpl/mfxcamera.h
Normal file
|
@ -0,0 +1,406 @@
|
|||
/*############################################################################
|
||||
# Copyright Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
############################################################################*/
|
||||
#ifndef __MFXCAMERA_H__
|
||||
#define __MFXCAMERA_H__
|
||||
|
||||
#include "mfxcommon.h"
|
||||
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
|
||||
#if !defined(__GNUC__)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*!
|
||||
The ExtendedBufferID enumerator itemizes and defines identifiers (BufferId) for extended buffers in camera processing.
|
||||
The application should attach these extended buffers to the mfxVideoParam structure to configure camera processing through VideoVPP functions.
|
||||
And Implementation capabilities of camera processing features can be delivered by the function MFXQueryImplsDescription via VPP configuration
|
||||
mfxVPPDescription.
|
||||
*/
|
||||
enum {
|
||||
/*!
|
||||
This extended buffer is mandatory for camera raw acclerator initialization. See the mfxExtCamPipeControl structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_PIPECONTROL = MFX_MAKEFOURCC('C', 'P', 'P', 'C'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera White Balance filter algorithm. See mfxExtCamWhiteBalance structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_WHITE_BALANCE = MFX_MAKEFOURCC('C', 'W', 'B', 'L'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Hot Pixel Removal filter algorithm. See mfxExtCamHotPixelRemoval structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_HOT_PIXEL_REMOVAL = MFX_MAKEFOURCC('C', 'H', 'P', 'R'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Black Level Correction filter algorithm. See mfxExtCamBlackLevelCorrection structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_BLACK_LEVEL_CORRECTION = MFX_MAKEFOURCC('C', 'B', 'L', 'C'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Vignette Correction filter algorithm. See mfxCamVignetteCorrectionParam structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_VIGNETTE_CORRECTION = MFX_MAKEFOURCC('C', 'V', 'G', 'T'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Bayer Denoise filter algorithm. See mfxExtCamBayerDenoise structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_BAYER_DENOISE = MFX_MAKEFOURCC('C', 'D', 'N', 'S'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Color Correction filter algorithm. See mfxExtCamColorCorrection3x3 structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_COLOR_CORRECTION_3X3 = MFX_MAKEFOURCC('C', 'C', '3', '3'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Padding. See mfxExtCamPadding structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_PADDING = MFX_MAKEFOURCC('C', 'P', 'A', 'D'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Forward Gamma Correction filter algorithm. See mfxExtCamFwdGamma structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_FORWARD_GAMMA_CORRECTION =
|
||||
MFX_MAKEFOURCC('C', 'F', 'G', 'C'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Lens Geometry Distortion and Chroma Aberration Correction filter algorithm. See mfxExtCamLensGeomDistCorrection structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_LENS_GEOM_DIST_CORRECTION =
|
||||
MFX_MAKEFOURCC('C', 'L', 'G', 'D'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera 3DLUT filter algorithm. See mfxExtCam3DLut structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_3DLUT = MFX_MAKEFOURCC('C', 'L', 'U', 'T'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera Total Color Control algorithm. See mfxExtCamTotalColorControl structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_TOTAL_COLOR_CONTROL = MFX_MAKEFOURCC('C', 'T', 'C', 'C'),
|
||||
/*!
|
||||
This extended buffer defines control parameters for the Camera YUV to RGB conversion algorithm. See mfxExtCamCscYuvRgb structure for details.
|
||||
The application should attach this extended buffer to the mfxVideoParam structure to configure camera processing initialization.
|
||||
*/
|
||||
MFX_EXTBUF_CAM_CSC_YUV_RGB = MFX_MAKEFOURCC('C', 'C', 'Y', 'R')
|
||||
};
|
||||
|
||||
/*!
|
||||
A enumeration that defines white balance mode.
|
||||
*/
|
||||
typedef enum {
|
||||
MFX_CAM_WHITE_BALANCE_MANUAL = 0x0001, /*!< White balance manual mode.*/
|
||||
MFX_CAM_WHITE_BALANCE_AUTO = 0x0002 /*!< White balance auto mode.*/
|
||||
} mfxCamWhiteBalanceMode;
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera White Balance filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_WHITE_BALANCE. */
|
||||
mfxU32
|
||||
Mode; /*!< Specifies one of White Balance operation modes defined in enumeration mfxCamWhiteBalanceMode. */
|
||||
mfxF64 R; /*!< White Balance Red correction..*/
|
||||
mfxF64 G0; /*!< White Balance Green Top correction..*/
|
||||
mfxF64 B; /*!< White Balance Blue correction.*/
|
||||
mfxF64 G1; /*!< White Balance Green Bottom correction..*/
|
||||
mfxU32 reserved[8]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamWhiteBalance;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera Total Color Control filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_TOTAL_COLOR_CONTROL. */
|
||||
mfxU16 R; /*!< Red element.*/
|
||||
mfxU16 G; /*!< Green element.*/
|
||||
mfxU16 B; /*!< Blue element.*/
|
||||
mfxU16 C; /*!< Cyan element.*/
|
||||
mfxU16 M; /*!< Magenta element.*/
|
||||
mfxU16 Y; /*!< Yellow element.*/
|
||||
mfxU16 reserved[6]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamTotalColorControl;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera YUV to RGB format conversion.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_CSC_YUV_RGB. */
|
||||
mfxF32 PreOffset
|
||||
[3]; /*!< Specifies offset for conversion from full range RGB input to limited range YUV for input color coordinate.*/
|
||||
mfxF32 Matrix[3]
|
||||
[3]; /*!< Specifies conversion matrix with CSC coefficients.*/
|
||||
mfxF32 PostOffset
|
||||
[3]; /*!< Specifies offset for conversion from full range RGB input to limited range YUV for output color coordinate.*/
|
||||
mfxU16 reserved[30]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamCscYuvRgb;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera Hot Pixel Removal filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_HOT_PIXEL_REMOVAL. */
|
||||
mfxU16 PixelThresholdDifference; /*!< Threshold for Hot Pixel difference. */
|
||||
mfxU16 PixelCountThreshold; /*!< Count pixel detection.*/
|
||||
mfxU16 reserved[32]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamHotPixelRemoval;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
typedef struct {
|
||||
/*!
|
||||
A hint structure that configures Camera black level correction.
|
||||
*/
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_BLACK_LEVEL_CORRECTION. */
|
||||
mfxU16 R; /*!< Black Level Red correction.*/
|
||||
mfxU16 G0; /*!< Black Level Green Top correction.*/
|
||||
mfxU16 B; /*!< Black Level Blue correction.*/
|
||||
mfxU16 G1; /*!< Black Level Green Bottom correction.*/
|
||||
mfxU32 reserved[4]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamBlackLevelCorrection;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A structure that defines Camera Vignette Correction Element.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxU8 integer; /*!< Integer part of correction element.*/
|
||||
mfxU8 mantissa; /*!< Fractional part of correction element.*/
|
||||
mfxU8 reserved[6]; /*!< Reserved for future extension.*/
|
||||
} mfxCamVignetteCorrectionElement;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A structure that defines Camera Vignette Correction Parameters.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxCamVignetteCorrectionElement R; /*!< Red correction element.*/
|
||||
mfxCamVignetteCorrectionElement G0; /*!< Green top correction element.*/
|
||||
mfxCamVignetteCorrectionElement B; /*!< Blue Correction element.*/
|
||||
mfxCamVignetteCorrectionElement G1; /*!< Green bottom correction element.*/
|
||||
mfxU32 reserved[4]; /*!< Reserved for future extension.*/
|
||||
} mfxCamVignetteCorrectionParam;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_PTR()
|
||||
/*!
|
||||
A hint structure that configures Camera Vignette Correction filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_VIGNETTE_CORRECTION. */
|
||||
mfxU32
|
||||
Width; /*!< Width of Correction Map 2D buffer in mfxCamVignetteCorrectionParam elements. */
|
||||
mfxU32
|
||||
Height; /*!< Height of Correction Map 2D buffer in mfxCamVignetteCorrectionParam elements. */
|
||||
mfxU32
|
||||
Pitch; /*!< Pitch of Correction Map 2D buffer in mfxCamVignetteCorrectionParam elements. */
|
||||
mfxU32 reserved[7]; /*!< Reserved for future extension.*/
|
||||
|
||||
union {
|
||||
mfxCamVignetteCorrectionParam*
|
||||
CorrectionMap; /*!< 2D buffer of mfxCamVignetteCorrectionParam elements.*/
|
||||
mfxU64 reserved1; /*!< Reserved for alignment on 32bit and 64bit.*/
|
||||
};
|
||||
} mfxExtCamVignetteCorrection;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera Bayer denoise filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_BAYER_DENOISE. */
|
||||
mfxU16 Threshold; /*!< Level of denoise, legal values: [0:63].*/
|
||||
mfxU16 reserved[27]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamBayerDenoise;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
|
||||
/*!
|
||||
A hint structure that configures Camera Color correction filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_COLOR_CORRECTION_3X3. */
|
||||
mfxF32 CCM
|
||||
[3]
|
||||
[3]; /*!< 3x3 dimension matrix providing RGB Color Correction coefficients.*/
|
||||
mfxU32 reserved[32]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamColorCorrection3x3;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera Padding.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_PADDING. */
|
||||
mfxU16
|
||||
Top; /*!< Specify number of padded columns respectively. Currently only 8 pixels supported for all dimensions..*/
|
||||
mfxU16
|
||||
Bottom; /*!< Specify number of padded columns respectively. Currently only 8 pixels supported for all dimensions..*/
|
||||
mfxU16
|
||||
Left; /*!< Specify number of padded rows respectively. Currently only 8 pixels supported for all dimensions..*/
|
||||
mfxU16
|
||||
Right; /*!< Specify number of padded rows respectively. Currently only 8 pixels supported for all dimensions..*/
|
||||
mfxU32 reserved[4]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamPadding;
|
||||
MFX_PACK_END()
|
||||
|
||||
/*!
|
||||
A enumeration that defines Bayer mode.
|
||||
*/
|
||||
typedef enum {
|
||||
/*!
|
||||
Pixel Representation BG
|
||||
GR.
|
||||
*/
|
||||
MFX_CAM_BAYER_BGGR = 0x0000,
|
||||
/*!
|
||||
Pixel Representation RG
|
||||
GB.
|
||||
*/
|
||||
MFX_CAM_BAYER_RGGB = 0x0001,
|
||||
/*!
|
||||
Pixel Representation GB
|
||||
RG.
|
||||
*/
|
||||
MFX_CAM_BAYER_GBRG = 0x0002,
|
||||
/*!
|
||||
Pixel Representation GR
|
||||
BG.
|
||||
*/
|
||||
MFX_CAM_BAYER_GRBG = 0x0003
|
||||
} mfxCamBayerFormat;
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures camera pipe control.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_PIPECONTROL. */
|
||||
mfxU16
|
||||
RawFormat; /*!< Specifies one of the four Bayer patterns defined in mfxCamBayerFormat enumeration.*/
|
||||
mfxU16 reserved1; /*!< Reserved for future extension.*/
|
||||
mfxU32 reserved[5]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamPipeControl;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A structure that specifies forward gamma segment.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxU16 Pixel; /*!< Pixel value.*/
|
||||
mfxU16 Red; /*!< Corrected Red value.*/
|
||||
mfxU16 Green; /*!< Corrected Green value.*/
|
||||
mfxU16 Blue; /*!< Corrected Blue value.*/
|
||||
} mfxCamFwdGammaSegment;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
|
||||
/*!
|
||||
A hint structure that configures Camera Forward Gamma Correction filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_FORWARD_GAMMA_CORRECTION. */
|
||||
|
||||
mfxU16 reserved[19]; /*!< Reserved for future extension.*/
|
||||
mfxU16 NumSegments; /*!< Number of Gamma segments.*/
|
||||
union {
|
||||
mfxCamFwdGammaSegment* Segment; /*!< Pointer to Gamma segments array.*/
|
||||
mfxU64 reserved1; /*!< Reserved for future extension.*/
|
||||
};
|
||||
} mfxExtCamFwdGamma;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A hint structure that configures Camera Lens Geometry Distortion and Chroma Aberration Correction filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_LENS_GEOM_DIST_CORRECTION. */
|
||||
|
||||
mfxF32 a[3]; /*!< Polynomial coefficients a for R/G/B*/
|
||||
mfxF32 b[3]; /*!< Polynomial coefficients b for R/G/B*/
|
||||
mfxF32 c[3]; /*!< Polynomial coefficients c for R/G/B*/
|
||||
mfxF32 d[3]; /*!< Polynomial coefficients d for R/G/B*/
|
||||
mfxU16 reserved[36]; /*!< Reserved for future extension.*/
|
||||
} mfxExtCamLensGeomDistCorrection;
|
||||
MFX_PACK_END()
|
||||
|
||||
/*!
|
||||
A enumeration that defines 3DLUT size.
|
||||
*/
|
||||
enum {
|
||||
MFX_CAM_3DLUT17_SIZE = (17 * 17 * 17), /*!< 17^3 LUT size*/
|
||||
MFX_CAM_3DLUT33_SIZE = (33 * 33 * 33), /*!< 33^3 LUT size*/
|
||||
MFX_CAM_3DLUT65_SIZE = (65 * 65 * 65) /*!< 65^3 LUT size*/
|
||||
};
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
A structure that defines 3DLUT entry.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxU16 R; /*!< R channel*/
|
||||
mfxU16 G; /*!< G channel*/
|
||||
mfxU16 B; /*!< B channel*/
|
||||
mfxU16 Reserved; /*!< Reserved for future extension.*/
|
||||
} mfxCam3DLutEntry;
|
||||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
|
||||
/*!
|
||||
A hint structure that configures Camera 3DLUT filter.
|
||||
*/
|
||||
typedef struct {
|
||||
mfxExtBuffer
|
||||
Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUF_CAM_3DLUT. */
|
||||
|
||||
mfxU16 reserved[10]; /*!< Reserved for future extension.*/
|
||||
mfxU32
|
||||
Size; /*!< LUT size, defined in MFX_CAM_3DLUT17/33/65_SIZE enumeration.*/
|
||||
union {
|
||||
mfxCam3DLutEntry*
|
||||
Table; /*!< Pointer to mfxCam3DLutEntry, size of each dimension depends on LUT size, e.g. LUT[17][17][17] for 17x17x17 look up table.*/
|
||||
mfxU64 reserved1; /*!< Reserved for future extension.*/
|
||||
};
|
||||
} mfxExtCam3DLut;
|
||||
MFX_PACK_END()
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // ONEVPL_EXPERIMENTAL
|
||||
#endif // __MFXCAMERA_H__
|
|
@ -34,7 +34,7 @@ MFX_PACK_END()
|
|||
#define MFX_REFINTERFACE_VERSION MFX_STRUCT_VERSION(1, 0)
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_PTR()
|
||||
/*! The structure respresents reference counted interface structure.
|
||||
/*! The structure represents reference counted interface structure.
|
||||
The memory is allocated and released by the implementation.
|
||||
*/
|
||||
typedef struct mfxRefInterface {
|
||||
|
@ -191,7 +191,10 @@ enum {
|
|||
MFX_GPUCOPY_DEFAULT = 0, /*!< Use default mode for the legacy Intel(r) Media SDK implementation. */
|
||||
MFX_GPUCOPY_ON = 1, /*!< The hint to enable GPU accelerated copying when it is supported by the library.
|
||||
If the library doesn't support GPU accelerated copy the operation will be made by CPU. */
|
||||
MFX_GPUCOPY_OFF = 2 /*!< Disable GPU accelerated copying. */
|
||||
MFX_GPUCOPY_OFF = 2, /*!< Disable GPU accelerated copying. */
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
MFX_GPUCOPY_SAFE = 3 /*!< The hint to disable buffer caching for GPU accelerated copying. Actual when GPU accelerated copying is supported by the library. */
|
||||
#endif
|
||||
};
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_PTR()
|
||||
|
@ -234,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. */
|
||||
|
@ -276,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. */
|
||||
|
@ -534,13 +536,13 @@ MFX_PACK_END()
|
|||
#define MFX_EXTENDEDDEVICEID_VERSION MFX_STRUCT_VERSION(1, 0)
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*! Specifies variouse physical device properties for device matching and identification outside of oneVPL. */
|
||||
/*! Specifies various physical device properties for device matching and identification outside of oneVPL. */
|
||||
typedef struct {
|
||||
mfxStructVersion Version; /*!< Version of the structure. */
|
||||
mfxU16 VendorID; /*!< PCI vendor ID. */
|
||||
mfxU16 DeviceID; /*!< PCI device ID. */
|
||||
mfxU32 PCIDomain; /*!< PCI bus domain. Equals to '0' if OS doesn't support it or
|
||||
has sequential numbering of buses accross domains. */
|
||||
has sequential numbering of buses across domains. */
|
||||
mfxU32 PCIBus; /*!< The number of the bus that the physical device is located on. */
|
||||
mfxU32 PCIDevice; /*!< The index of the physical device on the bus. */
|
||||
mfxU32 PCIFunction; /*!< The function number of the device on the physical device. */
|
||||
|
@ -550,17 +552,33 @@ typedef struct {
|
|||
mfxU32 LUIDValid; /*!< Boolean value that will be 1 if DeviceLUID contains a valid LUID
|
||||
and LUIDDeviceNodeMask contains a valid node mask,
|
||||
and 0 if they do not. */
|
||||
mfxU32 DRMRenderNodeNum; /*!< Number of the DRM render node from the path /dev/dri/RenderD<num>.
|
||||
mfxU32 DRMRenderNodeNum; /*!< Number of the DRM render node from the path /dev/dri/RenderD\<num\>.
|
||||
Value equals to 0 means that this field doesn't contain valid DRM Render
|
||||
Node number.*/
|
||||
mfxU32 DRMPrimaryNodeNum; /*!< Number of the DRM primary node from the path /dev/dri/card<num>.
|
||||
mfxU32 DRMPrimaryNodeNum; /*!< Number of the DRM primary node from the path /dev/dri/card\<num\>.
|
||||
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. */
|
||||
|
@ -605,4 +623,3 @@ MFX_PACK_END()
|
|||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define __MFXDEFS_H__
|
||||
|
||||
#define MFX_VERSION_MAJOR 2
|
||||
#define MFX_VERSION_MINOR 7
|
||||
#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
|
||||
|
@ -68,7 +68,7 @@ extern "C"
|
|||
#define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(4)
|
||||
#define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8)
|
||||
/* 32-bit ILP32 data model Linux* */
|
||||
#elif defined(__ILP32__)
|
||||
#elif defined(__ILP32__) || defined(__arm__)
|
||||
#define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(4)
|
||||
#define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(4)
|
||||
#else
|
||||
|
@ -148,6 +148,9 @@ typedef void* mfxHDL; /*!< Handle type. */
|
|||
typedef mfxHDL mfxMemId; /*!< Memory ID type. */
|
||||
typedef void* mfxThreadTask; /*!< Thread task type. */
|
||||
typedef char mfxChar; /*!< UTF-8 byte. */
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
typedef unsigned short mfxFP16; /*!< Half precision floating point, 16 bit type. */
|
||||
#endif
|
||||
|
||||
/* MFX structures version info */
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
|
@ -189,6 +192,10 @@ typedef enum {
|
|||
MFX_DATA_TYPE_I64, /*!< 64-bit signed integer. */
|
||||
MFX_DATA_TYPE_F32, /*!< 32-bit single precision floating point. */
|
||||
MFX_DATA_TYPE_F64, /*!< 64-bit double precision floating point. */
|
||||
MFX_DATA_TYPE_PTR, /*!< Generic type pointer. */
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
MFX_DATA_TYPE_FP16, /*!< 16-bit half precision floating point. */
|
||||
#endif
|
||||
}mfxDataType;
|
||||
|
||||
/*! The mfxVariantType enumerator data types for mfxVariantType. */
|
||||
|
@ -204,7 +211,10 @@ typedef enum {
|
|||
MFX_VARIANT_TYPE_I64 = MFX_DATA_TYPE_I64, /*!< 64-bit signed integer. */
|
||||
MFX_VARIANT_TYPE_F32 = MFX_DATA_TYPE_F32, /*!< 32-bit single precision floating point. */
|
||||
MFX_VARIANT_TYPE_F64 = MFX_DATA_TYPE_F64, /*!< 64-bit double precision floating point. */
|
||||
MFX_VARIANT_TYPE_PTR, /*!< Generic type pointer. */
|
||||
MFX_VARIANT_TYPE_PTR = MFX_DATA_TYPE_PTR, /*!< Generic type pointer. */
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
MFX_VARIANT_TYPE_FP16 = MFX_DATA_TYPE_FP16, /*!< 16-bit half precision floating point. */
|
||||
#endif
|
||||
} mfxVariantType;
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_PTR()
|
||||
|
@ -224,6 +234,9 @@ typedef struct {
|
|||
mfxI64 I64; /*!< mfxI64 data. */
|
||||
mfxF32 F32; /*!< mfxF32 data. */
|
||||
mfxF64 F64; /*!< mfxF64 data. */
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
mfxFP16 FP16; /*!< mfxFP16 data. */
|
||||
#endif
|
||||
mfxHDL Ptr; /*!< Pointer. When this points to a string the string must be null terminated. */
|
||||
} Data; /*!< Value data member. */
|
||||
} mfxVariant;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -335,7 +335,7 @@ typedef struct {
|
|||
mfxU32 NumCTU; /*!< number of CTUs per frame for H.265. */
|
||||
};
|
||||
|
||||
mfxBlockSize BlockSize; /*! For H.264 it is always 16x16 coresponding to MB size.
|
||||
mfxBlockSize BlockSize; /*! For H.264 it is always 16x16 corresponding to MB size.
|
||||
In H.265 it's normalized to 4x4, so for each CU we calculate number of 4x4 which belongs to the block. */
|
||||
|
||||
mfxU32 NumIntraBlock; /*! Number of intra blocks in the frame. The size of block is defined by BlockSize.
|
||||
|
@ -377,7 +377,7 @@ typedef mfxEncodeSliceStats mfxEncodeTileStats;
|
|||
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_PTR()
|
||||
/*! The structure respresnts reference counted container for output after encoding operation which includes statistics
|
||||
/*! The structure represents reference counted container for output after encoding operation which includes statistics
|
||||
and synchronization primitive for compressed bitstream.
|
||||
The memory is allocated and released by the library.
|
||||
*/
|
||||
|
@ -442,7 +442,7 @@ MFX_PACK_BEGIN_STRUCT_W_PTR()
|
|||
typedef struct {
|
||||
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_ENCODESTATS_BLK. */
|
||||
mfxU16 EncodeStatsFlags; /*! What statistics is required: block/slice/tile/frame level or any combinations.
|
||||
In case of slice or tile output statistics for one slice or tile will be availbale only.*/
|
||||
In case of slice or tile output statistics for one slice or tile will be available only.*/
|
||||
mfxEncodeStatsMode Mode; /*!< What encoding mode should be used to gather statistics. */
|
||||
mfxEncodeStatsContainer *EncodeStatsContainer; /*!< encode output, filled by the implementation. */
|
||||
mfxU32 reserved[8];
|
||||
|
|
|
@ -85,7 +85,7 @@ typedef struct {
|
|||
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_JPEG_QT. */
|
||||
|
||||
mfxU16 reserved[7];
|
||||
mfxU16 NumTable; /*!< Number of quantization tables defined in Qmarray. */
|
||||
mfxU16 NumTable; /*!< Number of quantization tables defined in Qm array. */
|
||||
|
||||
mfxU16 Qm[4][64]; /*!< Quantization table values. */
|
||||
} mfxExtJPEGQuantTables;
|
||||
|
|
|
@ -174,6 +174,9 @@ enum {
|
|||
/*! 8bit per sample 4:4:4 format packed in 32 bits, X=unused/undefined, 'X' channel is 8 MSBs, then 'Y', then 'U', and then 'V' channels. This format should be mapped to VA_FOURCC_XYUV. */
|
||||
MFX_FOURCC_XYUV = MFX_MAKEFOURCC('X','Y','U','V'),
|
||||
#endif
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
MFX_FOURCC_ABGR16F = MFX_MAKEFOURCC('B', 'G', 'R', 'F'), /*!< 16 bits float point ABGR color format packed in 64 bits. 'A' channel is 16 MSBs, then 'B', then 'G' and then 'R' channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_FLOAT or D3DFMT_A16B16G16R16F formats.. */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* PicStruct */
|
||||
|
@ -268,6 +271,19 @@ typedef struct
|
|||
} mfxA2RGB10;
|
||||
MFX_PACK_END()
|
||||
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*! Specifies "pixel" in ABGR 16 bit half float point color format */
|
||||
typedef struct
|
||||
{
|
||||
mfxFP16 R; /*!< R component. */
|
||||
mfxFP16 G; /*!< G component. */
|
||||
mfxFP16 B; /*!< B component. */
|
||||
mfxFP16 A; /*!< A component. */
|
||||
} mfxABGR16FP;
|
||||
MFX_PACK_END()
|
||||
#endif
|
||||
|
||||
/*! Describes frame buffer pointers. */
|
||||
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
|
||||
typedef struct {
|
||||
|
@ -330,6 +346,9 @@ typedef struct {
|
|||
mfxU16 *V16; /*!< V16 channel. */
|
||||
mfxU8 *B; /*!< B channel. */
|
||||
mfxA2RGB10 *A2RGB10; /*!< A2RGB10 channel for A2RGB10 format (merged ARGB). */
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
mfxABGR16FP* ABGRFP16; /*!< ABGRFP16 channel for half float ARGB format (use this merged one due to no separate FP16 Alpha Channel). */
|
||||
#endif
|
||||
};
|
||||
mfxU8 *A; /*!< A channel. */
|
||||
mfxMemId MemId; /*!< Memory ID of the data buffers. Ignored if any of the preceding data pointers is non-zero. */
|
||||
|
@ -703,6 +722,9 @@ typedef struct {
|
|||
mfxU16 InitialDelayInKB;
|
||||
/*! Quantization Parameter (QP) for I-frames for constant QP mode (CQP). Zero QP is not valid and means that the default value is assigned by the library.
|
||||
Non-zero QPI might be clipped to supported QPI range.
|
||||
@note In the HEVC design, a further adjustment to QPs can occur based on bit depth.
|
||||
Adjusted QPI value = QPI - (6 * (BitDepthLuma - 8)) for BitDepthLuma in the range [8,14].
|
||||
For HEVC_MAIN10, we minus (6*(10-8)=12) on our side and continue.
|
||||
@note Default QPI value is implementation dependent and subject to change without additional notice in this document. */
|
||||
mfxU16 QPI;
|
||||
mfxU16 Accuracy; /*!< Specifies accuracy range in the unit of tenth of percent. */
|
||||
|
@ -713,6 +735,9 @@ typedef struct {
|
|||
mfxU16 TargetKbps;
|
||||
/*! Quantization Parameter (QP) for P-frames for constant QP mode (CQP). Zero QP is not valid and means that the default value is assigned by the library.
|
||||
Non-zero QPP might be clipped to supported QPI range.
|
||||
@note In the HEVC design, a further adjustment to QPs can occur based on bit depth.
|
||||
Adjusted QPP value = QPP - (6 * (BitDepthLuma - 8)) for BitDepthLuma in the range [8,14].
|
||||
For HEVC_MAIN10, we minus (6*(10-8)=12) on our side and continue.
|
||||
@note Default QPP value is implementation dependent and subject to change without additional notice in this document. */
|
||||
mfxU16 QPP;
|
||||
mfxU16 ICQQuality; /*!< Used by the Intelligent Constant Quality (ICQ) bitrate control algorithm. Values are in the 1 to 51 range, where 1 corresponds the best quality. */
|
||||
|
@ -722,6 +747,9 @@ typedef struct {
|
|||
mfxU16 MaxKbps;
|
||||
/*! Quantization Parameter (QP) for B-frames for constant QP mode (CQP). Zero QP is not valid and means that the default value is assigned by the library.
|
||||
Non-zero QPI might be clipped to supported QPB range.
|
||||
@note In the HEVC design, a further adjustment to QPs can occur based on bit depth.
|
||||
Adjusted QPB value = QPB - (6 * (BitDepthLuma - 8)) for BitDepthLuma in the range [8,14].
|
||||
For HEVC_MAIN10, we minus (6*(10-8)=12) on our side and continue.
|
||||
@note Default QPB value is implementation dependent and subject to change without additional notice in this document. */
|
||||
mfxU16 QPB;
|
||||
mfxU16 Convergence; /*!< Convergence period in the unit of 100 frames. */
|
||||
|
@ -1346,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.
|
||||
|
@ -1402,7 +1432,7 @@ typedef struct {
|
|||
*/
|
||||
mfxU16 NumMbPerSlice;
|
||||
/*!
|
||||
Enables usage of mfxEncodeCtrl::SkipFrameparameter. See the SkipFrame enumerator for values of this option.
|
||||
Enables usage of mfxEncodeCtrl::SkipFrame parameter. See the SkipFrame enumerator for values of this option.
|
||||
@note Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported.
|
||||
*/
|
||||
mfxU16 SkipFrame;
|
||||
|
@ -1478,7 +1508,10 @@ enum {
|
|||
enum {
|
||||
MFX_CONTENT_UNKNOWN = 0,
|
||||
MFX_CONTENT_FULL_SCREEN_VIDEO = 1,
|
||||
MFX_CONTENT_NON_VIDEO_SCREEN = 2
|
||||
MFX_CONTENT_NON_VIDEO_SCREEN = 2,
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
MFX_CONTENT_NOISY_VIDEO = 3
|
||||
#endif
|
||||
};
|
||||
|
||||
/*! The PRefType enumerator itemizes models of reference list construction and DPB management when GopRefDist=1. */
|
||||
|
@ -1717,7 +1750,7 @@ typedef struct {
|
|||
*/
|
||||
mfxU16 AdaptiveCQM;
|
||||
/*!
|
||||
If this flag is set to ON, encoder adaptively selects list of reference frames to imrove encoding quality.
|
||||
If this flag is set to ON, encoder adaptively selects list of reference frames to improve encoding quality.
|
||||
Enabling of the flag can increase computation complexity and introduce additional delay.
|
||||
If this flag is set to OFF, regular reference frames are used for encoding.
|
||||
*/
|
||||
|
@ -1979,7 +2012,7 @@ enum {
|
|||
*/
|
||||
MFX_EXTBUFF_PRED_WEIGHT_TABLE = MFX_MAKEFOURCC('E','P','W','T'),
|
||||
/*!
|
||||
See the mfxExtDitrtyRect structure for details.
|
||||
See the mfxExtDirtyRect structure for details.
|
||||
*/
|
||||
MFX_EXTBUFF_DIRTY_RECTANGLES = MFX_MAKEFOURCC('D','R','O','I'),
|
||||
/*!
|
||||
|
@ -2043,22 +2076,22 @@ enum {
|
|||
*/
|
||||
MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO = MFX_MAKEFOURCC('L', 'L', 'I', 'S'),
|
||||
/*!
|
||||
This extended buffer configures HDR SEI message. See the mfxExtMasteringDisplayColourVolume structure for details. If colour volume changes
|
||||
This extended buffer configures HDR SEI message. See the mfxExtMasteringDisplayColourVolume structure for details. If color volume changes
|
||||
per frame, the application can attach this buffer to the mfxFrameData structure for video processing.
|
||||
*/
|
||||
MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME = MFX_MAKEFOURCC('D', 'C', 'V', 'S'),
|
||||
/*!
|
||||
This extended buffer configures HDR SEI message. See the mfxExtMasteringDisplayColourVolume structure for details. The application can
|
||||
attach this buffer to the mfxVideoParam structure for the input of video processing if the mastering display colour volume changes per
|
||||
attach this buffer to the mfxVideoParam structure for the input of video processing if the mastering display color volume changes per
|
||||
sequence. In this case, this buffer should be together with MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO to indicate the light level and mastering
|
||||
colour volume of the input of video processing. If colour Volume changes per frame instead of per sequence, the application can attach
|
||||
color volume of the input of video processing. If color Volume changes per frame instead of per sequence, the application can attach
|
||||
MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME to mfxFrameData for frame based processing.
|
||||
*/
|
||||
MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME_IN = MFX_MAKEFOURCC('D', 'C', 'V', 'I'),
|
||||
/*!
|
||||
This extended buffer configures HDR SEI message. See the mfxExtMasteringDisplayColourVolume structure for details. The application can
|
||||
attach this buffer to the mfxVideoParam structure for the output of video processing if the mastering display colour volume changes per
|
||||
sequence. If colour volume changes per frame instead of per sequence, the application can attach the buffer with MFX_EXTBUFF_MASTERING_
|
||||
attach this buffer to the mfxVideoParam structure for the output of video processing if the mastering display color volume changes per
|
||||
sequence. If color volume changes per frame instead of per sequence, the application can attach the buffer with MFX_EXTBUFF_MASTERING_
|
||||
DISPLAY_COLOUR_VOLUME to mfxFrameData for frame based processing.
|
||||
*/
|
||||
MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME_OUT = MFX_MAKEFOURCC('D', 'C', 'V', 'O'),
|
||||
|
@ -2143,13 +2176,13 @@ enum {
|
|||
See the mfxExtTemporalLayers structure for more details.
|
||||
*/
|
||||
MFX_EXTBUFF_UNIVERSAL_TEMPORAL_LAYERS = MFX_MAKEFOURCC('U', 'T', 'M', 'P'),
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
/*!
|
||||
This extended buffer defines additional encoding controls for reference list. See the mfxExtRefListCtrl structure for details.
|
||||
The application can attach this buffer to the mfxVideoParam structure for encoding & decoding initialization, or
|
||||
the mfxEncodeCtrl structure for per-frame encoding configuration.
|
||||
*/
|
||||
MFX_EXTBUFF_UNIVERSAL_REFLIST_CTRL = MFX_EXTBUFF_AVC_REFLIST_CTRL,
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
/*!
|
||||
See the mfxExtEncodeStats structure for details.
|
||||
*/
|
||||
|
@ -2164,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 */
|
||||
|
@ -2214,7 +2263,7 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
|
|||
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.
|
||||
mfxU16 Strength; /*!< Denoise strength in manual 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];
|
||||
|
@ -2830,49 +2879,55 @@ typedef struct {
|
|||
MFX_PACK_END()
|
||||
|
||||
|
||||
/*! The InsertHDRPayload enumerator itemizes HDR payloads insertion rules. */
|
||||
/*!
|
||||
The InsertHDRPayload enumerator itemizes HDR payloads insertion rules in the encoder,
|
||||
and indicates if there is valid HDR SEI message in the clip in the decoder.
|
||||
*/
|
||||
enum {
|
||||
MFX_PAYLOAD_OFF = 0, /*!< Do not insert payload. */
|
||||
MFX_PAYLOAD_IDR = 1 /*!< Insert payload on IDR frames. */
|
||||
MFX_PAYLOAD_OFF = 0, /*!< Do not insert payload when encoding;
|
||||
Clip does not have valid HDE SEI when decoding. */
|
||||
MFX_PAYLOAD_IDR = 1 /*!< Insert payload on IDR frames when encoding;
|
||||
Clip has valid HDE SEI when decoding. */
|
||||
};
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
Handle the HDR SEI message.
|
||||
|
||||
If the application attaches this structure to the mfxEncodeCtrl structure
|
||||
at runtime, the encoder inserts the HDR SEI message for the current frame and ignores InsertPayloadToggle.
|
||||
|
||||
If the application attaches this
|
||||
During encoding: If the application attaches this structure to the mfxEncodeCtrl structure at runtime,
|
||||
the encoder inserts the HDR SEI message for the current frame and ignores InsertPayloadToggle. If the application attaches this
|
||||
structure to the mfxVideoParam structure during initialization or reset, the encoder inserts the HDR SEI message based on InsertPayloadToggle.
|
||||
|
||||
If the application attaches this structure for video processing, InsertPayloadToggle will be ignored.
|
||||
During video processing: If the application attaches this structure for video processing, InsertPayloadToggle will be ignored.
|
||||
And DisplayPrimariesX[3], DisplayPrimariesY[3] specify the color primaries where 0,1,2 specifies Red, Green, Blue respectively.
|
||||
|
||||
If the application attaches this structure to the mfxFrameSurface1 structure at runtime
|
||||
During decoding: If the application attaches this structure to the mfxFrameSurface1 structure at runtime
|
||||
which will seed to the MFXVideoDECODE_DecodeFrameAsync() as surface_work parameter,
|
||||
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().
|
||||
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 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()
|
||||
|
||||
|
@ -2880,22 +2935,22 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
|
|||
/*!
|
||||
Handle the HDR SEI message.
|
||||
|
||||
If the application attaches this structure to the mfxEncodeCtrl
|
||||
structure at runtime, the encoder inserts the HDR SEI message for the current frame and ignores InsertPayloadToggle.
|
||||
During encoding: If the application attaches this structure to the mfxEncodeCtrl structure at runtime,
|
||||
the encoder inserts the HDR SEI message for the current frame and ignores InsertPayloadToggle. If the application
|
||||
attaches this structure to the mfxVideoParam structure during initialization or reset, the encoder inserts
|
||||
the HDR SEI message based on InsertPayloadToggle.
|
||||
|
||||
If the application
|
||||
attaches this structure to the mfxVideoParam structure during initialization or reset, the encoder inserts the HDR SEI message based on
|
||||
InsertPayloadToggle.
|
||||
During video processing: If the application attaches this structure for video processing, InsertPayloadToggle will be ignored.
|
||||
|
||||
If the application attaches this structure for video processing, InsertPayloadToggle will be ignored.
|
||||
|
||||
If the application attaches this structure to the mfxFrameSurface1 structure at runtime
|
||||
During decoding: If the application attaches this structure to the mfxFrameSurface1 structure at runtime
|
||||
which will seed to the MFXVideoDECODE_DecodeFrameAsync() as surface_work parameter,
|
||||
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().
|
||||
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 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. */
|
||||
|
@ -3446,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. */
|
||||
|
@ -3466,7 +3523,7 @@ enum {
|
|||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*!
|
||||
Specifies per-MB or per-CU mode and QP or deltaQP value depending on the mode type.
|
||||
Specifies per-MB or per-CU mode and QP or DeltaQP value depending on the mode type.
|
||||
*/
|
||||
typedef struct{
|
||||
union {
|
||||
|
@ -3499,7 +3556,12 @@ MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
|
|||
typedef struct {
|
||||
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_MBQP. */
|
||||
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
mfxU32 reserved[9];
|
||||
mfxU32 Pitch; /*!< Distance in bytes between the start of two consecutive rows in the QP array. */
|
||||
#else
|
||||
mfxU32 reserved[10];
|
||||
#endif
|
||||
mfxU16 Mode; /*!< Defines QP update mode. See MBQPMode enumerator for more details. */
|
||||
mfxU16 BlockSize; /*!< QP block size, valid for HEVC only during Init and Runtime. */
|
||||
mfxU32 NumQPAlloc; /*!< Size of allocated by application QP or DeltaQP array. */
|
||||
|
@ -3747,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. */
|
||||
|
@ -3954,9 +4018,7 @@ typedef mfxExtAVCRefListCtrl mfxExtHEVCRefListCtrl;
|
|||
typedef mfxExtAVCRefLists mfxExtHEVCRefLists;
|
||||
typedef mfxExtAvcTemporalLayers mfxExtHEVCTemporalLayers;
|
||||
|
||||
#ifdef ONEVPL_EXPERIMENTAL
|
||||
typedef mfxExtAVCRefListCtrl mfxExtRefListCtrl;
|
||||
#endif
|
||||
|
||||
/* The MirroringType enumerator itemizes mirroring types. */
|
||||
enum
|
||||
|
@ -4453,7 +4515,7 @@ typedef struct {
|
|||
|
||||
mfxU16 NumTileRows; /*!< Number of tile rows, default value is 1. */
|
||||
mfxU16 NumTileColumns; /*!< Number of tile columns, default value is 1. */
|
||||
mfxU16 NumTileGroups; /*!< Number of tile groups, it will be ingored if the tile groups num is invalid, default value is 1. */
|
||||
mfxU16 NumTileGroups; /*!< Number of tile groups, it will be ignored if the tile groups num is invalid, default value is 1. */
|
||||
|
||||
mfxU16 reserved[5];
|
||||
} mfxExtAV1TileParam;
|
||||
|
@ -4675,7 +4737,7 @@ typedef struct mfxSurfaceArray
|
|||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_STRUCT_W_PTR()
|
||||
/*! The structure is used for VPP channels initializtion in Decode_VPP component. */
|
||||
/*! The structure is used for VPP channels initialization in Decode_VPP component. */
|
||||
typedef struct {
|
||||
mfxFrameInfo VPP; /*!< The configuration parameters of VPP filters per each channel. */
|
||||
mfxU16 Protected; /*!< Specifies the content protection mechanism. */
|
||||
|
@ -4687,7 +4749,7 @@ typedef struct {
|
|||
MFX_PACK_END()
|
||||
|
||||
MFX_PACK_BEGIN_USUAL_STRUCT()
|
||||
/*! The structure describes rectangle coordinates wat can bse used for ROI or for Cropping. */
|
||||
/*! The structure describes rectangle coordinates that can be used for ROI or for Cropping. */
|
||||
typedef struct {
|
||||
mfxU16 Left; /*!< X coordinate of region of top-left corner of rectangle. */
|
||||
mfxU16 Top; /*!< Y coordinate of region of top-left corner of rectangle. */
|
||||
|
@ -4776,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
|
||||
|
|
|
@ -37,7 +37,7 @@ typedef struct {
|
|||
*/
|
||||
mfxU32 DeltaToAllocateOnTheFly;
|
||||
union {
|
||||
mfxVPPPoolType VPPPoolType; /*!< Defines what VPP pool is targeted - input or ouput. Ignored for other components. */
|
||||
mfxVPPPoolType VPPPoolType; /*!< Defines what VPP pool is targeted - input or output. Ignored for other components. */
|
||||
mfxU32 reserved;
|
||||
};
|
||||
mfxU32 Wait; /*!< Time in milliseconds for GetSurfaceForXXX() and DecodeFrameAsync functions to wait until surface will be available. */
|
||||
|
|
|
@ -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 @@ public:
|
|||
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 @@ public:
|
|||
|
||||
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 <typename varDataType>
|
||||
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<mfxU32>(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<mfxU32>(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<mfxU32>(0, "mfxImplDescription.VendorImplID");
|
||||
break;
|
||||
case MFX_IMPL_HARDWARE2:
|
||||
mfxRes = CreateConfig<mfxU32>(1, "mfxImplDescription.VendorImplID");
|
||||
break;
|
||||
case MFX_IMPL_HARDWARE3:
|
||||
mfxRes = CreateConfig<mfxU32>(2, "mfxImplDescription.VendorImplID");
|
||||
break;
|
||||
case MFX_IMPL_HARDWARE4:
|
||||
mfxRes = CreateConfig<mfxU32>(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<mfxU32>(MFX_ACCEL_MODE_VIA_D3D9,
|
||||
"mfxImplDescription.AccelerationMode");
|
||||
}
|
||||
else if (implAccelMode == MFX_IMPL_VIA_D3D11) {
|
||||
// D3D11 - VendorImplID corresponds to DXGI adapter index
|
||||
mfxRes = CreateConfig<mfxU32>(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<mfxU32>(MFX_ACCEL_MODE_VIA_VAAPI,
|
||||
"mfxImplDescription.AccelerationMode");
|
||||
}
|
||||
|
||||
if (MFX_ERR_NONE != mfxRes)
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
|
||||
// set required API level
|
||||
mfxRes =
|
||||
CreateConfig<mfxU32>(par.Version.Version, "mfxImplDescription.ApiVersion.Version");
|
||||
if (MFX_ERR_NONE != mfxRes)
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
|
||||
// set GPUCopy parameter
|
||||
if (par.GPUCopy) {
|
||||
mfxRes = CreateConfig<mfxU16>(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<mfxHDL>(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 @@ protected:
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -971,7 +971,7 @@ mfxStatus MFX_CDECL MFXVideoVPP_RunFrameVPPAsync(mfxSession session, mfxFrameSur
|
|||
@return
|
||||
MFX_ERR_NONE The output frame is ready after synchronization. \n
|
||||
MFX_ERR_MORE_DATA Need more input frames before VPP can produce an output. \n
|
||||
MFX_ERR_MEMORY_ALLOC The function failed to allocate output videoframe. \n
|
||||
MFX_ERR_MEMORY_ALLOC The function failed to allocate output video frame. \n
|
||||
|
||||
MFX_ERR_DEVICE_LOST Hardware device was lost.
|
||||
\verbatim embed:rst
|
||||
|
@ -991,7 +991,7 @@ mfxStatus MFX_CDECL MFXVideoVPP_ProcessFrameAsync(mfxSession session, mfxFrameSu
|
|||
but application has to provide array of pointers to mfxVideoChannelParam and num_channel_param - number of channels. Application is responsible for
|
||||
memory allocation for mfxVideoChannelParam parameters and for each channel it should specify channel IDs:
|
||||
mfxVideoChannelParam::mfxFrameInfo::ChannelId. ChannelId should be unique value within one session. ChannelID equals to the 0
|
||||
is reserved for the orginal decoded frame.
|
||||
is reserved for the original decoded frame.
|
||||
The application can attach mfxExtInCrops to mfxVideoChannelParam::ExtParam to annotate input video frame if it wants to enable
|
||||
letterboxing operation.
|
||||
@param[in] session SDK session handle.
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// https://github.com/Intel-Media-SDK/MediaSDK/blob/master/_studio/shared/include/mfxstructures-int.h
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
@ -384,30 +385,47 @@ static mfxStatus get_devices(std::vector<Device> &allDevices) {
|
|||
|
||||
int i = 0;
|
||||
for (; i < 64; ++i) {
|
||||
int ret;
|
||||
Device device;
|
||||
std::string path = std::string(dir) + "/renderD" + std::to_string(128 + i) + vendor_id_file;
|
||||
std::string line;
|
||||
std::ifstream dev_str;
|
||||
|
||||
FILE *file = fopen(path.c_str(), "r");
|
||||
if (!file)
|
||||
dev_str.open(path);
|
||||
if (!dev_str.is_open()) {
|
||||
continue;
|
||||
ret = fscanf(file, "%x", &device.vendor_id);
|
||||
fclose(file);
|
||||
if (ret != 1)
|
||||
}
|
||||
std::getline(dev_str, line);
|
||||
dev_str.close();
|
||||
try {
|
||||
device.vendor_id = std::stoul(line, 0, 16);
|
||||
}
|
||||
catch (std::invalid_argument &) {
|
||||
continue;
|
||||
}
|
||||
catch (std::out_of_range &) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Filter out non-Intel devices
|
||||
if (device.vendor_id != 0x8086)
|
||||
continue;
|
||||
|
||||
path = std::string(dir) + "/renderD" + std::to_string(128 + i) + device_id_file;
|
||||
file = fopen(path.c_str(), "r");
|
||||
if (!file)
|
||||
dev_str.open(path);
|
||||
if (!dev_str.is_open()) {
|
||||
continue;
|
||||
ret = fscanf(file, "%x", &device.device_id);
|
||||
fclose(file);
|
||||
if (ret != 1)
|
||||
}
|
||||
std::getline(dev_str, line);
|
||||
dev_str.close();
|
||||
try {
|
||||
device.device_id = std::stoul(line, 0, 16);
|
||||
}
|
||||
catch (std::invalid_argument &) {
|
||||
continue;
|
||||
}
|
||||
catch (std::out_of_range &) {
|
||||
continue;
|
||||
}
|
||||
|
||||
device.platform = get_platform(device.device_id);
|
||||
|
||||
|
|
|
@ -23,12 +23,18 @@
|
|||
|
||||
namespace MFX {
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#if defined(__x86_64__) || (INTPTR_MAX == INT64_MAX)
|
||||
#define LIBMFXSW "libmfxsw64.so.1"
|
||||
#define LIBMFXHW "libmfxhw64.so.1"
|
||||
|
||||
#define ONEVPLSW "libvplswref64.so.1"
|
||||
#define ONEVPLHW "libmfx-gen.so.1.2"
|
||||
#elif defined(__i386__) || (INTPTR_MAX == INT32_MAX)
|
||||
#define LIBMFXSW "libmfxsw32.so.1"
|
||||
#define LIBMFXHW "libmfxhw32.so.1"
|
||||
|
||||
#define ONEVPLSW "libvplswref32.so.1"
|
||||
#define ONEVPLHW "libmfx-gen.so.1.2"
|
||||
#else
|
||||
#error Unsupported architecture
|
||||
#endif
|
||||
|
|
|
@ -72,7 +72,9 @@ typedef char CHAR_TYPE;
|
|||
|
||||
#define TAB_SIZE(type, tab) (sizeof(tab) / sizeof(type))
|
||||
#define MAKE_MFX_VERSION(major, minor) \
|
||||
{ (minor), (major) }
|
||||
{ \
|
||||
{ (minor), (major) } \
|
||||
}
|
||||
|
||||
// internal function to load dll by full path, fail if unsuccessful
|
||||
mfxStatus MFXInitEx2(mfxVersion version,
|
||||
|
@ -170,7 +172,7 @@ enum PropRanges {
|
|||
|
||||
// must match eProp_TotalProps, is checked with static_assert in _config.cpp
|
||||
// (should throw error at compile time if !=)
|
||||
#define NUM_TOTAL_FILTER_PROPS 55
|
||||
#define NUM_TOTAL_FILTER_PROPS 56
|
||||
|
||||
// typedef child structures for easier reading
|
||||
typedef struct mfxDecoderDescription::decoder DecCodec;
|
||||
|
|
|
@ -107,6 +107,7 @@ enum PropIdx {
|
|||
ePropExtDev_LUIDDeviceNodeMask,
|
||||
ePropExtDev_DRMRenderNodeNum,
|
||||
ePropExtDev_DRMPrimaryNodeNum,
|
||||
ePropExtDev_RevisionID,
|
||||
ePropExtDev_DeviceName,
|
||||
|
||||
// special properties not part of description struct
|
||||
|
@ -182,6 +183,7 @@ static const PropVariant PropIdxTab[] = {
|
|||
{ "ePropExtDev_LUIDDeviceNodeMask", MFX_VARIANT_TYPE_U32 },
|
||||
{ "ePropExtDev_DRMRenderNodeNum", MFX_VARIANT_TYPE_U32 },
|
||||
{ "ePropExtDev_DRMPrimaryNodeNum", MFX_VARIANT_TYPE_U32 },
|
||||
{ "ePropExtDev_RevisionID", MFX_VARIANT_TYPE_U16 },
|
||||
{ "ePropExtDev_DeviceName", MFX_VARIANT_TYPE_PTR },
|
||||
|
||||
{ "ePropSpecial_HandleType", MFX_VARIANT_TYPE_U32 },
|
||||
|
@ -554,6 +556,9 @@ mfxStatus ConfigCtxVPL::SetFilterProperty(const mfxU8 *name, mfxVariant value) {
|
|||
else if (nextProp == "DRMPrimaryNodeNum") {
|
||||
return ValidateAndSetProp(ePropExtDev_DRMPrimaryNodeNum, value);
|
||||
}
|
||||
else if (nextProp == "RevisionID") {
|
||||
return ValidateAndSetProp(ePropExtDev_RevisionID, value);
|
||||
}
|
||||
else if (nextProp == "DeviceName") {
|
||||
return ValidateAndSetProp(ePropExtDev_DeviceName, value);
|
||||
}
|
||||
|
@ -1124,6 +1129,8 @@ mfxStatus ConfigCtxVPL::CheckPropsExtDevID(const mfxVariant cfgPropsAll[],
|
|||
}
|
||||
}
|
||||
|
||||
CHECK_PROP(ePropExtDev_RevisionID, U16, libImplExtDevID->RevisionID);
|
||||
|
||||
// check string: DeviceName (string match)
|
||||
if (cfgPropsAll[ePropExtDev_DeviceName].Type != MFX_VARIANT_TYPE_UNSET) {
|
||||
std::string filtName = *(std::string *)(cfgPropsAll[ePropExtDev_DeviceName].Data.Ptr);
|
||||
|
@ -1515,27 +1522,15 @@ bool ConfigCtxVPL::CheckLowLatencyConfig(std::list<ConfigCtxVPL *> configCtxList
|
|||
return bLowLatency;
|
||||
}
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
bool ConfigCtxVPL::ParseDeviceIDx86(mfxChar *cDeviceID, mfxU32 &deviceID, mfxU32 &adapterIdx) {
|
||||
std::string strDevID(cDeviceID);
|
||||
// XXX: std::regex is crashing on Windows + gcc
|
||||
#if 0
|
||||
std::regex reDevIDAll("[0-9a-fA-F]+/[0-9]+");
|
||||
std::regex reDevIDMin("[0-9a-fA-F]+");
|
||||
#else
|
||||
static const gchar *reDevIDAll = "[0-9a-fA-F]+/[0-9]+";
|
||||
static const gchar *reDevIDMin = "[0-9a-fA-F]+";
|
||||
|
||||
if (!cDeviceID)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
deviceID = DEVICE_ID_UNKNOWN;
|
||||
adapterIdx = ADAPTER_IDX_UNKNOWN;
|
||||
|
||||
bool bHasAdapterIdx = false;
|
||||
#if 0
|
||||
if (std::regex_match(strDevID, reDevIDAll)) {
|
||||
// check for DeviceID in format "devID/adapterIdx"
|
||||
// devID = hex value
|
||||
|
@ -1551,25 +1546,6 @@ bool ConfigCtxVPL::ParseDeviceIDx86(mfxChar *cDeviceID, mfxU32 &deviceID, mfxU32
|
|||
// invalid format
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (g_regex_match_simple(reDevIDAll, cDeviceID,
|
||||
(GRegexCompileFlags)0, (GRegexMatchFlags)0)) {
|
||||
// check for DeviceID in format "devID/adapterIdx"
|
||||
// devID = hex value
|
||||
// adapterIdx = decimal integer
|
||||
bHasAdapterIdx = true;
|
||||
}
|
||||
else if (g_regex_match_simple(reDevIDMin, cDeviceID,
|
||||
(GRegexCompileFlags)0, (GRegexMatchFlags)0)) {
|
||||
// check for DeviceID in format "devID"
|
||||
// (no adpaterIdx)
|
||||
bHasAdapterIdx = false;
|
||||
}
|
||||
else {
|
||||
// invalid format
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// get deviceID (value before the slash, if present)
|
||||
try {
|
||||
|
|
|
@ -1695,14 +1695,14 @@ mfxStatus LoaderCtxVPL::InitDispatcherLog() {
|
|||
DWORD err;
|
||||
|
||||
char logEnabled[MAX_VPL_SEARCH_PATH] = "";
|
||||
err = GetEnvironmentVariable("ONEVPL_DISPATCHER_LOG", logEnabled, MAX_VPL_SEARCH_PATH);
|
||||
err = GetEnvironmentVariableA("ONEVPL_DISPATCHER_LOG", logEnabled, MAX_VPL_SEARCH_PATH);
|
||||
if (err == 0 || err >= MAX_VPL_SEARCH_PATH)
|
||||
return MFX_ERR_UNSUPPORTED; // environment variable not defined or string too long
|
||||
|
||||
strLogEnabled = logEnabled;
|
||||
|
||||
char logFile[MAX_VPL_SEARCH_PATH] = "";
|
||||
err = GetEnvironmentVariable("ONEVPL_DISPATCHER_LOG_FILE", logFile, MAX_VPL_SEARCH_PATH);
|
||||
err = GetEnvironmentVariableA("ONEVPL_DISPATCHER_LOG_FILE", logFile, MAX_VPL_SEARCH_PATH);
|
||||
if (err == 0 || err >= MAX_VPL_SEARCH_PATH) {
|
||||
// nothing to do - strLogFile is an empty string
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
############################################################################*/
|
||||
|
||||
#include <fstream>
|
||||
#include "vpl/mfx_dispatcher_vpl.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
|
@ -12,7 +13,7 @@
|
|||
|
||||
#ifdef __linux__
|
||||
#include <pthread.h>
|
||||
#define strncpy_s(dst, size, src, cnt) strcpy((dst), (src)) // NOLINT
|
||||
#define strncpy_s(dst, size, src, cnt) strncpy((dst), (src), (cnt)) // NOLINT
|
||||
#endif
|
||||
|
||||
// leave table formatting alone
|
||||
|
@ -39,7 +40,7 @@ const mfxIMPL msdkImplTab[MAX_NUM_IMPL_MSDK] = {
|
|||
#define NUM_POOL_POLICIES_MSDK 0
|
||||
|
||||
static const mfxPoolPolicyDescription PoolPolicies = {
|
||||
{ 0, 1 }, // struct Version
|
||||
{{ 0, 1 }}, // struct Version
|
||||
{}, // reserved
|
||||
NUM_POOL_POLICIES_MSDK, // NumPoolPolicies
|
||||
nullptr,
|
||||
|
@ -96,6 +97,20 @@ static const mfxImplementedFunctions msdkImplFuncs = {
|
|||
(mfxChar**)msdkImplFuncsNames
|
||||
};
|
||||
|
||||
// optional extBuf to limit threads created in MSDK session creation
|
||||
// to enable, set vplParam.NumExtParam and vplParam.ExtParam before calling MFXInitEx2()
|
||||
static const mfxExtThreadsParam extThreadParam = {
|
||||
{MFX_EXTBUFF_THREADS_PARAM, sizeof(mfxExtThreadsParam)},
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
{},
|
||||
};
|
||||
|
||||
static const mfxExtBuffer* extParams[1] = {
|
||||
(mfxExtBuffer *)&extThreadParam,
|
||||
};
|
||||
|
||||
// end table formatting
|
||||
// clang-format on
|
||||
|
||||
|
@ -128,6 +143,14 @@ mfxStatus LoaderCtxMSDK::OpenSession(mfxSession *session,
|
|||
mfxInitializationParam vplParam = {};
|
||||
vplParam.AccelerationMode = accelMode;
|
||||
|
||||
#ifdef __linux__
|
||||
vplParam.ExtParam = (mfxExtBuffer **)&extParams;
|
||||
vplParam.NumExtParam = 1;
|
||||
#else
|
||||
vplParam.ExtParam = nullptr;
|
||||
vplParam.NumExtParam = 0;
|
||||
#endif
|
||||
|
||||
return MFXInitEx2(reqVersion,
|
||||
vplParam,
|
||||
hwImpl,
|
||||
|
@ -213,6 +236,14 @@ mfxStatus LoaderCtxMSDK::QueryAPIVersion(STRING_TYPE libNameFull, mfxVersion *ms
|
|||
vplParam.AccelerationMode =
|
||||
(mfxAccelerationMode)CvtAccelType(MFX_IMPL_HARDWARE, implDefault & 0xFF00);
|
||||
|
||||
#ifdef __linux__
|
||||
vplParam.ExtParam = (mfxExtBuffer **)&extParams;
|
||||
vplParam.NumExtParam = 1;
|
||||
#else
|
||||
vplParam.ExtParam = nullptr;
|
||||
vplParam.NumExtParam = 0;
|
||||
#endif
|
||||
|
||||
mfxU16 deviceID;
|
||||
sts = MFXInitEx2(reqVersion,
|
||||
vplParam,
|
||||
|
@ -335,8 +366,11 @@ mfxStatus LoaderCtxMSDK::QueryMSDKCaps(STRING_TYPE libNameFull,
|
|||
|
||||
// fill in strings
|
||||
strncpy_s(m_id.ImplName, sizeof(m_id.ImplName), strImplName, sizeof(strImplName));
|
||||
m_id.ImplName[sizeof(m_id.ImplName) - 1] = 0;
|
||||
strncpy_s(m_id.License, sizeof(m_id.License), strLicense, sizeof(strLicense));
|
||||
m_id.License[sizeof(m_id.License) - 1] = 0;
|
||||
strncpy_s(m_id.Keywords, sizeof(m_id.Keywords), strKeywords, sizeof(strKeywords));
|
||||
m_id.Keywords[sizeof(m_id.Keywords) - 1] = 0;
|
||||
|
||||
m_id.VendorID = 0x8086;
|
||||
m_id.NumExtParam = 0;
|
||||
|
@ -422,6 +456,10 @@ mfxStatus LoaderCtxMSDK::CheckD3D9Support(mfxU64 luid, STRING_TYPE libNameFull,
|
|||
mfxInitializationParam vplParam = {};
|
||||
vplParam.AccelerationMode = MFX_ACCEL_MODE_VIA_D3D9;
|
||||
|
||||
// thread limit not enabled on Windows
|
||||
vplParam.ExtParam = nullptr;
|
||||
vplParam.NumExtParam = 0;
|
||||
|
||||
mfxU16 deviceID;
|
||||
sts = MFXInitEx2(reqVersion,
|
||||
vplParam,
|
||||
|
@ -446,6 +484,27 @@ mfxStatus LoaderCtxMSDK::CheckD3D9Support(mfxU64 luid, STRING_TYPE libNameFull,
|
|||
#endif
|
||||
}
|
||||
|
||||
mfxU32 read_device_file(std::string &path) {
|
||||
mfxU32 result = 0;
|
||||
std::string line;
|
||||
std::ifstream dev_str(path);
|
||||
if (!dev_str.is_open()) {
|
||||
return 0;
|
||||
}
|
||||
std::getline(dev_str, line);
|
||||
dev_str.close();
|
||||
try {
|
||||
result = std::stoul(line, 0, 16);
|
||||
}
|
||||
catch (std::invalid_argument &) {
|
||||
return 0;
|
||||
}
|
||||
catch (std::out_of_range &) {
|
||||
return 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
mfxStatus LoaderCtxMSDK::GetRenderNodeDescription(mfxU32 adapterID,
|
||||
mfxU32 &vendorID,
|
||||
mfxU16 &deviceID) {
|
||||
|
@ -459,28 +518,12 @@ mfxStatus LoaderCtxMSDK::GetRenderNodeDescription(mfxU32 adapterID,
|
|||
std::string vendorPath = "/sys/class/drm/renderD" + nodeStr + "/device/vendor";
|
||||
std::string devPath = "/sys/class/drm/renderD" + nodeStr + "/device/device";
|
||||
|
||||
// check if vendor == 0x8086
|
||||
FILE *vendorFile = fopen(vendorPath.c_str(), "r");
|
||||
if (vendorFile) {
|
||||
unsigned int u32 = 0;
|
||||
int nRead = fscanf(vendorFile, "%x", &u32);
|
||||
if (nRead == 1)
|
||||
vendorID = (mfxU32)u32;
|
||||
fclose(vendorFile);
|
||||
}
|
||||
vendorID = read_device_file(vendorPath);
|
||||
|
||||
if (vendorID != 0x8086)
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
|
||||
// get deviceID for this node
|
||||
FILE *devFile = fopen(devPath.c_str(), "r");
|
||||
if (devFile) {
|
||||
unsigned int u32 = 0;
|
||||
int nRead = fscanf(devFile, "%x", &u32);
|
||||
if (nRead == 1)
|
||||
deviceID = (mfxU32)u32;
|
||||
fclose(devFile);
|
||||
}
|
||||
deviceID = read_device_file(devPath);
|
||||
|
||||
if (deviceID == 0)
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
|
@ -525,6 +568,9 @@ mfxStatus LoaderCtxMSDK::QueryExtDeviceID(mfxExtendedDeviceId *extDeviceID,
|
|||
extDeviceID->DRMRenderNodeNum = 0;
|
||||
extDeviceID->DRMPrimaryNodeNum = 0x7FFFFFFF;
|
||||
|
||||
// default - no PCI RevisionID
|
||||
extDeviceID->RevisionID = 0xFFFF;
|
||||
|
||||
snprintf(extDeviceID->DeviceName, sizeof(extDeviceID->DeviceName), "%s", strImplName);
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
|
|
|
@ -19,12 +19,16 @@
|
|||
#if defined(MEDIASDK_UWP_DISPATCHER)
|
||||
#if defined(MFX_D3D9_ENABLED) && !defined(MFX_FORCE_D3D9_ENABLED)
|
||||
#undef MFX_D3D9_ENABLED
|
||||
#pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ \
|
||||
" (" STRINGIFY(__LINE__) "):\nUsing of D3D9 disabled for UWP!\n\n")
|
||||
#endif
|
||||
#if defined(MFX_FORCE_D3D9_ENABLED)
|
||||
#define MFX_D3D9_ENABLED
|
||||
#endif
|
||||
#else
|
||||
#define MFX_D3D9_ENABLED
|
||||
#pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ \
|
||||
" (" STRINGIFY(__LINE__) "):\nUsing of D3D9 enabled!\n\n")
|
||||
#endif
|
||||
|
||||
#include "vpl/mfxdefs.h"
|
||||
|
|
Loading…
Reference in a new issue