mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-18 21:38:29 -04:00
obs-qsv11: Add AV1 Screen Content Tools
This commit is contained in:
committed by
Ryan Foster
parent
6c590805e8
commit
53853df33a
@@ -56,6 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ONEVPL_EXPERIMENTAL
|
||||
#include <vpl/mfxstructures.h>
|
||||
#include <vpl/mfxadapter.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -195,6 +195,22 @@ static inline bool HasOptimizedBRCSupport(const mfxPlatform &platform,
|
||||
UNUSED_PARAMETER(rateControl);
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool HasAV1ScreenContentSupport(const mfxPlatform &platform,
|
||||
const mfxVersion &version)
|
||||
{
|
||||
#if (MFX_VERSION_MAJOR >= 2 && MFX_VERSION_MINOR >= 12) || MFX_VERSION_MAJOR > 2
|
||||
// Platform enums needed are introduced in VPL version 2.12
|
||||
if ((version.Major >= 2 && version.Minor >= 12) || version.Major > 2)
|
||||
if (platform.CodeName >= MFX_PLATFORM_LUNARLAKE &&
|
||||
platform.CodeName != MFX_PLATFORM_ALDERLAKE_N &&
|
||||
platform.CodeName != MFX_PLATFORM_ARROWLAKE)
|
||||
return true;
|
||||
#endif
|
||||
UNUSED_PARAMETER(platform);
|
||||
UNUSED_PARAMETER(version);
|
||||
return false;
|
||||
}
|
||||
PRAGMA_WARN_POP
|
||||
|
||||
mfxStatus QSV_Encoder_Internal::InitParams(qsv_param_t *pParams,
|
||||
@@ -372,6 +388,22 @@ mfxStatus QSV_Encoder_Internal::InitParams(qsv_param_t *pParams,
|
||||
extendedBuffers.push_back((mfxExtBuffer *)&m_ExtAv1TileParam);
|
||||
}
|
||||
|
||||
// AV1_SCREEN_CONTENT_TOOLS API is introduced in VPL version 2.11
|
||||
#if (MFX_VERSION_MAJOR >= 2 && MFX_VERSION_MINOR >= 11) || MFX_VERSION_MAJOR > 2
|
||||
if (codec == QSV_CODEC_AV1 &&
|
||||
HasAV1ScreenContentSupport(platform, m_ver)) {
|
||||
memset(&m_ExtAV1ScreenContentTools, 0,
|
||||
sizeof(m_ExtAV1ScreenContentTools));
|
||||
m_ExtAV1ScreenContentTools.Header.BufferId =
|
||||
MFX_EXTBUFF_AV1_SCREEN_CONTENT_TOOLS;
|
||||
m_ExtAV1ScreenContentTools.Header.BufferSz =
|
||||
sizeof(m_ExtAV1ScreenContentTools);
|
||||
m_ExtAV1ScreenContentTools.Palette = MFX_CODINGOPTION_ON;
|
||||
extendedBuffers.push_back(
|
||||
(mfxExtBuffer *)&m_ExtAV1ScreenContentTools);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
// TODO: Ask about this one on VAAPI too.
|
||||
memset(&m_ExtVideoSignalInfo, 0, sizeof(m_ExtVideoSignalInfo));
|
||||
|
||||
@@ -54,6 +54,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#pragma once
|
||||
#define ONEVPL_EXPERIMENTAL
|
||||
#include <vpl/mfxstructures.h>
|
||||
#include <vpl/mfxvideo++.h>
|
||||
#include "QSV_Encoder.h"
|
||||
@@ -121,6 +122,9 @@ private:
|
||||
mfxExtCodingOption m_co;
|
||||
mfxExtHEVCParam m_ExtHEVCParam{};
|
||||
mfxExtAV1TileParam m_ExtAv1TileParam{};
|
||||
#if (MFX_VERSION_MAJOR >= 2 && MFX_VERSION_MINOR >= 11) || MFX_VERSION_MAJOR > 2
|
||||
mfxExtAV1ScreenContentTools m_ExtAV1ScreenContentTools{};
|
||||
#endif
|
||||
mfxExtVideoSignalInfo m_ExtVideoSignalInfo{};
|
||||
mfxExtChromaLocInfo m_ExtChromaLocInfo{};
|
||||
mfxExtMasteringDisplayColourVolume m_ExtMasteringDisplayColourVolume{};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#define ONEVPL_EXPERIMENTAL
|
||||
#include <vpl/mfxstructures.h>
|
||||
#include <vpl/mfxadapter.h>
|
||||
#include <vpl/mfxvideo++.h>
|
||||
|
||||
Reference in New Issue
Block a user