From 8fb7d0bad58dbad4a0c54128cc120f6e6e66fc3d Mon Sep 17 00:00:00 2001 From: JTGaming <38790084+JTGaming@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:24:19 +0100 Subject: [PATCH] Fix config & clean-up debug menu debug menu got a slight overhaul with better alignment and cleaner text. Fixed 'superres only if upscaling' not saving properly. --- Source/D3D11VP.cpp | 34 +++++++------- Source/DX11VideoProcessor.cpp | 58 +++++++++++------------ Source/DX9VideoProcessor.cpp | 88 +++++++++++++++++++++++------------ Source/DXVA2VP.cpp | 6 +-- Source/DXVA2VP.h | 6 +-- Source/Helper.cpp | 82 ++++++++++++++++---------------- Source/Shaders.cpp | 22 ++++----- Source/VideoProcessor.cpp | 24 +++++----- Source/VideoRenderer.cpp | 2 +- 9 files changed, 176 insertions(+), 146 deletions(-) diff --git a/Source/D3D11VP.cpp b/Source/D3D11VP.cpp index 5fddb240..83af3c70 100644 --- a/Source/D3D11VP.cpp +++ b/Source/D3D11VP.cpp @@ -185,7 +185,7 @@ HRESULT CD3D11VP::InitVideoProcessor( if (FAILED(hr)) { // Windows 8/8.1 DLog(L"CD3D11VP::InitVideoProcessor() : ID3D11VideoProcessorEnumerator1 unavailable"); - if (exFmt.value && exFmt.VideoTransferMatrix > DXVA2_VideoTransferMatrix_BT601) { + if (exFmt.value && exFmt.VideoTransferMatrix > MFVideoTransferMatrix_BT601) { // Win8/8.1 D3D11 VP only supports RGB, BT.601, BT.709 return E_ABORT; } @@ -515,14 +515,14 @@ HRESULT CD3D11VP::CheckColorSpaceNew( m_bConvSupportedG2084 = FALSE; HRESULT hr = S_OK; - const bool fullrange = (exFmt.NominalRange == DXVA2_NominalRange_0_255); + const bool fullrange = (exFmt.NominalRange == MFNominalRange_0_255); bool isG2084 = false; cstype_input = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; cstype_output = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; if (bHdrPassthrough) { - cstype_input = (exFmt.VideoChromaSubsampling == DXVA2_VideoChromaSubsampling_Cosited) + cstype_input = (exFmt.VideoChromaSubsampling == MFVideoChromaSubsampling_Cosited) ? DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020; cstype_output = DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020; @@ -536,7 +536,7 @@ HRESULT CD3D11VP::CheckColorSpaceNew( else if (exFmt.value) { /* if (exFmt.VideoTransferMatrix == VIDEOTRANSFERMATRIX_BT2020_10 || exFmt.VideoTransferMatrix == VIDEOTRANSFERMATRIX_BT2020_12) { - const bool topleft = (exFmt.VideoChromaSubsampling == DXVA2_VideoChromaSubsampling_Cosited); + const bool topleft = (exFmt.VideoChromaSubsampling == MFVideoChromaSubsampling_Cosited); if (exFmt.VideoTransferFunction == MFVideoTransFunc_2084) { cstype_stream = topleft @@ -548,12 +548,12 @@ HRESULT CD3D11VP::CheckColorSpaceNew( ? DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 : DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020; } - else if (exFmt.VideoTransferFunction == DXVA2_VideoTransFunc_sRGB) { + else if (exFmt.VideoTransferFunction == MFVideoTransFunc_sRGB) { cstype_stream = topleft ? DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020; } - else { // DXVA2_VideoTransFunc_22 and other + else { // MFVideoTransFunc_22 and other cstype_stream = topleft ? DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 : fullrange ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020; @@ -561,7 +561,7 @@ HRESULT CD3D11VP::CheckColorSpaceNew( } */ if (exFmt.VideoTransferFunction == MFVideoTransFunc_2084 && (exFmt.VideoTransferMatrix == MFVideoTransferMatrix_BT2020_10 || exFmt.VideoTransferMatrix == MFVideoTransferMatrix_BT2020_12)) { - const bool topleft = (exFmt.VideoChromaSubsampling == DXVA2_VideoChromaSubsampling_Cosited); + const bool topleft = (exFmt.VideoChromaSubsampling == MFVideoChromaSubsampling_Cosited); cstype_input = topleft ? DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020; @@ -573,16 +573,16 @@ HRESULT CD3D11VP::CheckColorSpaceNew( outputFormat, cstype_output, &m_bConvSupportedG2084); } - else if (exFmt.VideoTransferMatrix == DXVA2_VideoTransferMatrix_BT601) { + else if (exFmt.VideoTransferMatrix == MFVideoTransferMatrix_BT601) { cstype_input = fullrange ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601; } - else { // DXVA2_VideoTransferMatrix_BT709 and other - if (exFmt.VideoTransferFunction == DXVA2_VideoTransFunc_sRGB) { + else { // MFVideoTransferMatrix_BT709 and other + if (exFmt.VideoTransferFunction == MFVideoTransFunc_sRGB) { cstype_input = DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709; } - else { // DXVA2_VideoTransFunc_22 and other + else { // MFVideoTransFunc_22 and other cstype_input = fullrange ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709; @@ -591,16 +591,16 @@ HRESULT CD3D11VP::CheckColorSpaceNew( } if (isG2084 && (FAILED(hr) || !m_bConvSupportedG2084)) { - if (exFmt.VideoTransferMatrix == DXVA2_VideoTransferMatrix_BT601) { + if (exFmt.VideoTransferMatrix == MFVideoTransferMatrix_BT601) { cstype_input = fullrange ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601; } - else { // DXVA2_VideoTransferMatrix_BT709 and other - if (exFmt.VideoTransferFunction == DXVA2_VideoTransFunc_sRGB) { + else { // MFVideoTransferMatrix_BT709 and other + if (exFmt.VideoTransferFunction == MFVideoTransFunc_sRGB) { cstype_input = DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709; } - else { // DXVA2_VideoTransFunc_22 and other + else { // MFVideoTransFunc_22 and other cstype_input = fullrange ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709; @@ -652,10 +652,10 @@ void CD3D11VP::SetColorSpaceOld(const DXVA2_ExtendedFormat exFmt) D3D11_VIDEO_PROCESSOR_COLOR_SPACE colorSpace = {}; if (exFmt.value) { colorSpace.RGB_Range = 0; // output RGB always full range (0-255) - colorSpace.YCbCr_Matrix = (exFmt.VideoTransferMatrix == DXVA2_VideoTransferMatrix_BT601) + colorSpace.YCbCr_Matrix = (exFmt.VideoTransferMatrix == MFVideoTransferMatrix_BT601) ? 0 // ITU-R BT.601 : 1; // ITU-R BT.709 - colorSpace.Nominal_Range = (exFmt.NominalRange == DXVA2_NominalRange_0_255) + colorSpace.Nominal_Range = (exFmt.NominalRange == MFNominalRange_0_255) ? D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255 : D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235; } diff --git a/Source/DX11VideoProcessor.cpp b/Source/DX11VideoProcessor.cpp index 2daa9bfd..eef508cf 100644 --- a/Source/DX11VideoProcessor.cpp +++ b/Source/DX11VideoProcessor.cpp @@ -1165,7 +1165,7 @@ void CDX11VideoProcessor::SetGraphSize() CalcStatsFont(); if (S_OK == m_Font3D.CreateFontBitmap(L"Consolas", m_StatsFontH, 0)) { SIZE charSize = m_Font3D.GetMaxCharMetric(); - m_StatsRect.right = m_StatsRect.left + 61 * charSize.cx + 5 + 3; + m_StatsRect.right = m_StatsRect.left + 64 * charSize.cx + 5 + 3; m_StatsRect.bottom = m_StatsRect.top + 19 * charSize.cy + 5 + 3; } m_StatsBackground.Set(m_StatsRect, rtSize, D3DCOLOR_ARGB(80, 0, 0, 0)); @@ -1810,9 +1810,9 @@ BOOL CDX11VideoProcessor::InitMediaType(const CMediaType* pmt) hr = InitializeD3D11VP(FmtParams, origW, origH); if (SUCCEEDED(hr)) { UINT resId = 0; - bool bTransFunc22 = m_srcExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_22 - || m_srcExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_709 - || m_srcExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_240M; + bool bTransFunc22 = m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_22 + || m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_709 + || m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_240M; if (m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_2084 && !(m_bHdrPassthroughSupport && m_bHdrPassthrough) && m_bConvertToSdr) { resId = m_D3D11VP.IsPqSupported() ? IDF_PS_11_CONVERT_PQ_TO_SDR : IDF_PS_11_FIXCONVERT_PQ_TO_SDR; @@ -3872,9 +3872,9 @@ void CDX11VideoProcessor::UpdateStatsPresent() { DXGI_SWAP_CHAIN_DESC1 swapchain_desc; if (m_pDXGISwapChain1 && S_OK == m_pDXGISwapChain1->GetDesc1(&swapchain_desc)) { - m_strStatsPresent.assign(L"\nPresentation : "); + m_strStatsPresent.assign(L"\nPresentation : "); if (m_bVBlankBeforePresent && m_pDXGIOutput) { - m_strStatsPresent.append(L"wait VBlank, "); + m_strStatsPresent.append(L"wait for VBlank, "); } switch (swapchain_desc.SwapEffect) { case DXGI_SWAP_EFFECT_DISCARD: @@ -3884,10 +3884,10 @@ void CDX11VideoProcessor::UpdateStatsPresent() m_strStatsPresent.append(L"Sequential"); break; case DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL: - m_strStatsPresent.append(L"Flip sequential"); + m_strStatsPresent.append(L"Flip Sequential"); break; case DXGI_SWAP_EFFECT_FLIP_DISCARD: - m_strStatsPresent.append(L"Flip discard"); + m_strStatsPresent.append(L"Flip Discard"); break; } m_strStatsPresent.append(L", "); @@ -3902,16 +3902,16 @@ void CDX11VideoProcessor::UpdateStatsStatic() UpdateStatsInputFmt(); - m_strStatsVProc.assign(L"\nVideoProcessor: "); + m_strStatsVProc.assign(L"\nVideo Processor : "); if (m_D3D11VP.IsReady()) { - m_strStatsVProc += std::format(L"D3D11 VP, output to {}", DXGIFormatToString(m_D3D11OutputFmt)); + m_strStatsVProc += std::format(L"D3D11 VP, Output to {}", DXGIFormatToString(m_D3D11OutputFmt)); } else { m_strStatsVProc.append(L"Shaders"); if (m_srcParams.Subsampling == 420 || m_srcParams.Subsampling == 422) { - m_strStatsVProc.append(L", Chroma scaling: "); + m_strStatsVProc.append(L", Chroma Scaling: "); switch (m_iChromaScaling) { case CHROMA_Nearest: - m_strStatsVProc.append(L"Nearest-neighbor"); + m_strStatsVProc.append(L"Nearest-Neighbor"); break; case CHROMA_Bilinear: m_strStatsVProc.append(L"Bilinear"); @@ -3922,7 +3922,7 @@ void CDX11VideoProcessor::UpdateStatsStatic() } } } - m_strStatsVProc += std::format(L"\nInternalFormat: {}", DXGIFormatToString(m_InternalTexFmt)); + m_strStatsVProc += std::format(L"\nInternal Format : {}", DXGIFormatToString(m_InternalTexFmt)); //add debug output so users know when RTX Video HDR is enabled //might want to rename this feature to 'Auto HDR' or something else in the future, @@ -3930,9 +3930,9 @@ void CDX11VideoProcessor::UpdateStatsStatic() // RTX Video HDR seems to be more recognizable for users. bool sourceHDR = SourceIsHDR(); if (sourceHDR || m_bVPUseRTXVideoHDR) { - m_strStatsHDR.assign(L"\nHDR processing: "); + m_strStatsHDR.assign(L"\nHDR Processing : "); if (m_bVPUseRTXVideoHDR && !sourceHDR) - m_strStatsHDR.append(L"RTX Video HDR*"); + m_strStatsHDR.append(L"RTX Video HDR"); else if (m_bHdrPassthroughSupport && m_bHdrPassthrough) { m_strStatsHDR.append(L"Passthrough"); if (m_lastHdr10.bValid) { @@ -3941,7 +3941,7 @@ void CDX11VideoProcessor::UpdateStatsStatic() } else if (m_bConvertToSdr) { m_strStatsHDR.append(L"Convert to SDR"); } else { - m_strStatsHDR.append(L"Not used"); + m_strStatsHDR.append(L"Not Used"); } } else { m_strStatsHDR.clear(); @@ -3991,11 +3991,11 @@ HRESULT CDX11VideoProcessor::DrawStats(ID3D11Texture2D* pRenderTarget) str.reserve(700); str.assign(m_strStatsHeader); str.append(m_strStatsDispInfo); - str += std::format(L"\nGraph. Adapter: {}", m_strAdapterDescription); + str += std::format(L"\nGraphics Adapter: {}", m_strAdapterDescription); wchar_t frametype = (m_SampleFormat != D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE) ? 'i' : 'p'; str += std::format( - L"\nFrame rate : {:7.3f}{},{:7.3f}", + L"\nFrame Rate : {:7.3f}{},{:7.3f}p", m_pFilter->m_FrameStats.GetAverageFps(), frametype, m_pFilter->m_DrawStats.GetAverageFps() @@ -4003,7 +4003,7 @@ HRESULT CDX11VideoProcessor::DrawStats(ID3D11Texture2D* pRenderTarget) str.append(m_strStatsInputFmt); if (m_Dovi.bValid) { - str.append(L", MetaData: DolbyVision"); + str.append(L", Metadata: Dolby Vision"); if (m_Dovi.bHasMMR) { str.append(L"(MMR)"); } @@ -4013,9 +4013,9 @@ HRESULT CDX11VideoProcessor::DrawStats(ID3D11Texture2D* pRenderTarget) const int dstW = m_videoRect.Width(); const int dstH = m_videoRect.Height(); if (m_iRotation) { - str += std::format(L"\nScaling : {}x{} r{}\u00B0> {}x{}", m_srcRectWidth, m_srcRectHeight, m_iRotation, dstW, dstH); + str += std::format(L"\nScaling : {}x{} r{}\u00B0> {}x{}", m_srcRectWidth, m_srcRectHeight, m_iRotation, dstW, dstH); } else { - str += std::format(L"\nScaling : {}x{} -> {}x{}", m_srcRectWidth, m_srcRectHeight, dstW, dstH); + str += std::format(L"\nScaling : {}x{} -> {}x{}", m_srcRectWidth, m_srcRectHeight, dstW, dstH); } if (m_srcRectWidth != dstW || m_srcRectHeight != dstH) { //D3D scaling is manually forced on if SuperRes is enabled @@ -4036,39 +4036,39 @@ HRESULT CDX11VideoProcessor::DrawStats(ID3D11Texture2D* pRenderTarget) } if (m_bVPUseSuperRes) { - str.append(L" SuperResolution*"); + str.append(L" Super Resolution"); } if (m_strCorrection || m_pPostScaleShaders.size() || m_bDitherUsed) { - str.append(L"\nPostProcessing:"); + str.append(L"\nPost-Processing :"); if (m_strCorrection) { str += std::format(L" {},", m_strCorrection); } if (m_pPostScaleShaders.size()) { - str += std::format(L" shaders[{}],", m_pPostScaleShaders.size()); + str += std::format(L" Shaders[{}],", m_pPostScaleShaders.size()); } if (m_bDitherUsed) { - str.append(L" dither"); + str.append(L" Dither"); } str_trim_end(str, ','); } str.append(m_strStatsHDR); str.append(m_strStatsPresent); - str += std::format(L"\nFrames: {:5}, skipped: {}/{}, failed: {}", + str += std::format(L"\nFrames : {}, skipped: {}/{}, failed: {}", m_pFilter->m_FrameStats.GetFrames(), m_pFilter->m_DrawStats.m_dropped, m_RenderStats.dropped2, m_RenderStats.failed); - str += std::format(L"\nTimes(ms): Copy{:3}, Paint{:3}, Present{:3}", + str += std::format(L"\nTimes : copy:{:3} ms, paint:{:3} ms, present:{:3} ms", m_RenderStats.copyticks * 1000 / GetPreciseTicksPerSecondI(), m_RenderStats.paintticks * 1000 / GetPreciseTicksPerSecondI(), m_RenderStats.presentticks * 1000 / GetPreciseTicksPerSecondI()); - str += std::format(L"\nSync offset : {:+3} ms", (m_RenderStats.syncoffset + 5000) / 10000); + str += std::format(L"\nSync offset : {:+3} ms", (m_RenderStats.syncoffset + 5000) / 10000); #if SYNC_OFFSET_EX { const auto [so_min, so_max] = m_Syncs.MinMax(); const auto [sod_min, sod_max] = m_SyncDevs.MinMax(); - str += std::format(L", range[{:+3.0f};{:+3.0f}], max change{:+3.0f}/{:+3.0f}", + str += std::format(L", range [{:+3.0f};{:+3.0f}], max change {:+3.0f}/{:+3.0f}", so_min / 10000.0f, so_max / 10000.0f, sod_min / 10000.0f, diff --git a/Source/DX9VideoProcessor.cpp b/Source/DX9VideoProcessor.cpp index 034d047f..8bafecd7 100644 --- a/Source/DX9VideoProcessor.cpp +++ b/Source/DX9VideoProcessor.cpp @@ -986,8 +986,8 @@ void CDX9VideoProcessor::SetGraphSize() CalcStatsFont(); if (S_OK == m_Font3D.CreateFontBitmap(L"Consolas", m_StatsFontH, 0)) { SIZE charSize = m_Font3D.GetMaxCharMetric(); - m_StatsRect.right = m_StatsRect.left + 61 * charSize.cx + 5 + 3; - m_StatsRect.bottom = m_StatsRect.top + 18 * charSize.cy + 5 + 3; + m_StatsRect.right = m_StatsRect.left + 64 * charSize.cx + 5 + 3; + m_StatsRect.bottom = m_StatsRect.top + 19 * charSize.cy + 5 + 3; m_StatsBackground.Set(m_StatsRect, D3DCOLOR_ARGB(80, 0, 0, 0)); } @@ -1214,9 +1214,9 @@ BOOL CDX9VideoProcessor::InitMediaType(const CMediaType* pmt) if (FmtParams.DXVA2Format != D3DFMT_UNKNOWN) { hr = InitializeDXVA2VP(FmtParams, origW, origH); if (SUCCEEDED(hr)) { - bool bTransFunc22 = m_srcExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_22 - || m_srcExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_709 - || m_srcExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_240M + bool bTransFunc22 = m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_22 + || m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_709 + || m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_240M || m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_HLG; // HLG compatible with SDR if (m_srcExFmt.VideoTransferFunction == MFVideoTransFunc_2084 && m_bConvertToSdr) { @@ -2263,14 +2263,14 @@ HRESULT CDX9VideoProcessor::UpdateConvertColorShader() if (m_srcParams.cformat != CF_YUY2 && m_iChromaScaling == CHROMA_Bilinear) { if (m_srcParams.Subsampling == 420) { switch (m_srcExFmt.VideoChromaSubsampling) { - case DXVA2_VideoChromaSubsampling_Cosited: + case MFVideoChromaSubsampling_Cosited: sx = 0.5f * dx; sy = 0.5f * dy; break; - case DXVA2_VideoChromaSubsampling_MPEG1: + case MFVideoChromaSubsampling_MPEG1: //nothing; break; - case DXVA2_VideoChromaSubsampling_MPEG2: + case MFVideoChromaSubsampling_MPEG2: default: sx = 0.5f * dx; } @@ -2891,9 +2891,9 @@ HRESULT CDX9VideoProcessor::TextureResizeShader( void CDX9VideoProcessor::UpdateStatsPresent() { if (m_d3dpp.SwapEffect) { - m_strStatsPresent.assign(L"\nPresentation : "); + m_strStatsPresent.assign(L"\nPresentation : "); if (m_bVBlankBeforePresent) { - m_strStatsPresent.append(L"wait VBlank, "); + m_strStatsPresent.append(L"wait for VBlank, "); } switch (m_d3dpp.SwapEffect) { case D3DSWAPEFFECT_DISCARD: @@ -2924,16 +2924,16 @@ void CDX9VideoProcessor::UpdateStatsStatic() UpdateStatsInputFmt(); - m_strStatsVProc.assign(L"\nVideoProcessor: "); + m_strStatsVProc.assign(L"\nVideo Processor : "); if (m_DXVA2VP.IsReady()) { - m_strStatsVProc += std::format(L"DXVA2 VP, output to {}", D3DFormatToString(m_DXVA2OutputFmt)); + m_strStatsVProc += std::format(L"DXVA2 VP, Output to {}", D3DFormatToString(m_DXVA2OutputFmt)); } else { m_strStatsVProc.append(L"Shaders"); if (m_srcParams.Subsampling == 420 || m_srcParams.Subsampling == 422) { - m_strStatsVProc.append(L", Chroma scaling: "); + m_strStatsVProc.append(L", Chroma Scaling: "); switch (m_iChromaScaling) { case CHROMA_Nearest: - m_strStatsVProc.append(L"Nearest-neighbor"); + m_strStatsVProc.append(L"Nearest-Neighbor"); break; case CHROMA_Bilinear: m_strStatsVProc.append(L"Bilinear"); @@ -2944,14 +2944,14 @@ void CDX9VideoProcessor::UpdateStatsStatic() } } } - m_strStatsVProc += std::format(L"\nInternalFormat: {}", D3DFormatToString(m_InternalTexFmt)); + m_strStatsVProc += std::format(L"\nInternal Format : {}", D3DFormatToString(m_InternalTexFmt)); if (SourceIsHDR()) { - m_strStatsHDR.assign(L"\nHDR processing: "); + m_strStatsHDR.assign(L"\nHDR Processing : "); if (m_bConvertToSdr) { m_strStatsHDR.append(L"Convert to SDR"); } else { - m_strStatsHDR.append(L"Not used"); + m_strStatsHDR.append(L"Not Used"); } } else { m_strStatsHDR.clear(); @@ -3001,11 +3001,11 @@ HRESULT CDX9VideoProcessor::DrawStats(IDirect3DSurface9* pRenderTarget) str.reserve(700); str.assign(m_strStatsHeader); str.append(m_strStatsDispInfo); - str += std::format(L"\nGraph. Adapter: {}", m_strAdapterDescription); + str += std::format(L"\nGraphics Adapter: {}", m_strAdapterDescription); wchar_t frametype = (m_CurrentSampleFmt >= DXVA2_SampleFieldInterleavedEvenFirst && m_CurrentSampleFmt <= DXVA2_SampleFieldSingleOdd) ? 'i' : 'p'; str += std::format( - L"\nFrame rate : {:7.3f}{},{:7.3f}", + L"\nFrame Rate : {:7.3f}{},{:7.3f}p", m_pFilter->m_FrameStats.GetAverageFps(), frametype, m_pFilter->m_DrawStats.GetAverageFps() @@ -3013,16 +3013,19 @@ HRESULT CDX9VideoProcessor::DrawStats(IDirect3DSurface9* pRenderTarget) str.append(m_strStatsInputFmt); if (m_Dovi.bValid) { - str.append(L", MetaData: DolbyVision"); + str.append(L", Metadata: Dolby Vision"); + if (m_Dovi.bHasMMR) { + str.append(L"(MMR)"); + } } str.append(m_strStatsVProc); const int dstW = m_videoRect.Width(); const int dstH = m_videoRect.Height(); if (m_iRotation) { - str += std::format(L"\nScaling : {}x{} r{}\u00B0> {}x{}", m_srcRectWidth, m_srcRectHeight, m_iRotation, dstW, dstH); + str += std::format(L"\nScaling : {}x{} r{}\u00B0> {}x{}", m_srcRectWidth, m_srcRectHeight, m_iRotation, dstW, dstH); } else { - str += std::format(L"\nScaling : {}x{} -> {}x{}", m_srcRectWidth, m_srcRectHeight, dstW, dstH); + str += std::format(L"\nScaling : {}x{} -> {}x{}", m_srcRectWidth, m_srcRectHeight, dstW, dstH); } if (m_srcRectWidth != dstW || m_srcRectHeight != dstH) { if (m_DXVA2VP.IsReady() && m_bVPScaling && !m_bVPScalingUseShaders) { @@ -3042,39 +3045,66 @@ HRESULT CDX9VideoProcessor::DrawStats(IDirect3DSurface9* pRenderTarget) } if (m_strCorrection || m_pPostScaleShaders.size() || m_bDitherUsed) { - str.append(L"\nPostProcessing:"); + str.append(L"\nPost-Processing :"); if (m_strCorrection) { str += std::format(L" {},", m_strCorrection); } if (m_pPostScaleShaders.size()) { - str += std::format(L" shaders[{}],", m_pPostScaleShaders.size()); + str += std::format(L" Shaders[{}],", m_pPostScaleShaders.size()); } if (m_bDitherUsed) { - str.append(L" dither"); + str.append(L" Dither"); } str_trim_end(str, ','); } str.append(m_strStatsHDR); str.append(m_strStatsPresent); - str += std::format(L"\nFrames: {:5}, skipped: {}/{}, failed: {}", + str += std::format(L"\nFrames : {}, skipped: {}/{}, failed: {}", m_pFilter->m_FrameStats.GetFrames(), m_pFilter->m_DrawStats.m_dropped, m_RenderStats.dropped2, m_RenderStats.failed); - str += std::format(L"\nTimes(ms): Copy{:3}, Paint{:3}, Present{:3}", + str += std::format(L"\nTimes : copy:{:3} ms, paint:{:3} ms, present:{:3} ms", m_RenderStats.copyticks * 1000 / GetPreciseTicksPerSecondI(), m_RenderStats.paintticks * 1000 / GetPreciseTicksPerSecondI(), m_RenderStats.presentticks * 1000 / GetPreciseTicksPerSecondI()); - str += std::format(L"\nSync offset : {:+3} ms", (m_RenderStats.syncoffset + 5000) / 10000); + str += std::format(L"\nSync offset : {:+3} ms", (m_RenderStats.syncoffset + 5000) / 10000); #if SYNC_OFFSET_EX { const auto [so_min, so_max] = m_Syncs.MinMax(); const auto [sod_min, sod_max] = m_SyncDevs.MinMax(); - str += std::format(L", range[{:+3.0f};{:+3.0f}], max change{:+3.0f}/{:+3.0f}", + str += std::format(L", range [{:+3.0f};{:+3.0f}], max change {:+3.0f}/{:+3.0f}", so_min / 10000.0f, so_max / 10000.0f, sod_min / 10000.0f, sod_max / 10000.0f); } + + //log the average frametime variance and desync + const auto& devs = m_SyncDevs.Data(); + const auto dev_size = m_SyncDevs.Size(); + if (dev_size > 0) + { + LONGLONG avg = 0; + for (unsigned int i = 0; i < dev_size; i++) + { + avg += abs(devs[i]); + } + avg /= dev_size; + str += std::format(L",\n avg dev: {:3.3f} ms", (float)avg / 10000.f); + } + + const auto& syncs = m_Syncs.Data(); + const auto sync_size = m_Syncs.Size(); + if (sync_size > 0) + { + LONGLONG avg = 0; + for (unsigned int i = 0; i < sync_size; i++) + { + avg += (syncs[i]); + } + avg /= sync_size; + str += std::format(L", avg sync: {:+3.3f} ms", (float)avg / 10000.f); + } #endif #if TEST_TICKS str += std::format(L"\n1:{:6.3f}, 2:{:6.3f}, 3:{:6.3f}, 4:{:6.3f}, 5:{:6.3f}, 6:{:6.3f} ms", diff --git a/Source/DXVA2VP.cpp b/Source/DXVA2VP.cpp index 77873d4e..fdc064ee 100644 --- a/Source/DXVA2VP.cpp +++ b/Source/DXVA2VP.cpp @@ -351,12 +351,12 @@ HRESULT CDXVA2VP::InitVideoProcessor( m_BltParams.DestFormat.value = 0; // output to RGB m_BltParams.DestFormat.SampleFormat = DXVA2_SampleProgressiveFrame; // output to progressive RGB - if (exFmt.NominalRange == DXVA2_NominalRange_0_255 && (m_VendorId == PCIV_NVIDIA || m_VendorId == PCIV_AMDATI)) { + if (exFmt.NominalRange == MFNominalRange_0_255 && (m_VendorId == PCIV_NVIDIA || m_VendorId == PCIV_AMDATI)) { // hack for Nvidia and AMD, nothing helps Intel - m_BltParams.DestFormat.NominalRange = DXVA2_NominalRange_16_235; + m_BltParams.DestFormat.NominalRange = MFNominalRange_16_235; } else { // output to full range RGB - m_BltParams.DestFormat.NominalRange = DXVA2_NominalRange_0_255; + m_BltParams.DestFormat.NominalRange = MFNominalRange_0_255; } m_srcFormat = inputFmt; diff --git a/Source/DXVA2VP.h b/Source/DXVA2VP.h index b3d7cee3..c4c2e5c9 100644 --- a/Source/DXVA2VP.h +++ b/Source/DXVA2VP.h @@ -77,9 +77,9 @@ class VideoSampleBuffer m_exFmt = exFmt; // replace values that are not included in the DXVA2 specification to obtain a more stable result for subsequent correction - if (m_exFmt.VideoTransferMatrix > DXVA2_VideoTransferMatrix_SMPTE240M) { m_exFmt.VideoTransferMatrix = DXVA2_VideoTransferMatrix_BT709; } - if (m_exFmt.VideoPrimaries > DXVA2_VideoPrimaries_SMPTE_C) { m_exFmt.VideoPrimaries = DXVA2_VideoPrimaries_BT709; } - if (m_exFmt.VideoTransferFunction > DXVA2_VideoTransFunc_28) { m_exFmt.VideoTransferFunction = DXVA2_VideoTransFunc_709; } + if (m_exFmt.VideoTransferMatrix > MFVideoTransferMatrix_SMPTE240M) { m_exFmt.VideoTransferMatrix = MFVideoTransferMatrix_BT709; } + if (m_exFmt.VideoPrimaries > MFVideoPrimaries_SMPTE_C) { m_exFmt.VideoPrimaries = MFVideoPrimaries_BT709; } + if (m_exFmt.VideoTransferFunction > MFVideoTransFunc_28) { m_exFmt.VideoTransferFunction = MFVideoTransFunc_709; } } DXVA2_VideoSample* GetNextVideoSample() diff --git a/Source/Helper.cpp b/Source/Helper.cpp index d8003b01..f1953f86 100644 --- a/Source/Helper.cpp +++ b/Source/Helper.cpp @@ -761,16 +761,16 @@ void set_colorspace(const DXVA2_ExtendedFormat extfmt, mp_colorspace& colorspace } switch (extfmt.NominalRange) { - case DXVA2_NominalRange_0_255: colorspace.levels = MP_CSP_LEVELS_PC; break; - case DXVA2_NominalRange_16_235: colorspace.levels = MP_CSP_LEVELS_TV; break; + case MFNominalRange_0_255: colorspace.levels = MP_CSP_LEVELS_PC; break; + case MFNominalRange_16_235: colorspace.levels = MP_CSP_LEVELS_TV; break; default: colorspace.levels = MP_CSP_LEVELS_AUTO; } switch (extfmt.VideoTransferMatrix) { - case DXVA2_VideoTransferMatrix_BT709: colorspace.space = MP_CSP_BT_709; break; - case DXVA2_VideoTransferMatrix_BT601: colorspace.space = MP_CSP_BT_601; break; - case DXVA2_VideoTransferMatrix_SMPTE240M: colorspace.space = MP_CSP_SMPTE_240M; break; + case MFVideoTransferMatrix_BT709: colorspace.space = MP_CSP_BT_709; break; + case MFVideoTransferMatrix_BT601: colorspace.space = MP_CSP_BT_601; break; + case MFVideoTransferMatrix_SMPTE240M: colorspace.space = MP_CSP_SMPTE_240M; break; case MFVideoTransferMatrix_BT2020_10: colorspace.space = MP_CSP_BT_2020_NC; break; case VIDEOTRANSFERMATRIX_YCgCo: colorspace.space = MP_CSP_YCGCO; break; default: @@ -778,11 +778,11 @@ void set_colorspace(const DXVA2_ExtendedFormat extfmt, mp_colorspace& colorspace } switch (extfmt.VideoPrimaries) { - case DXVA2_VideoPrimaries_BT709: colorspace.primaries = MP_CSP_PRIM_BT_709; break; - case DXVA2_VideoPrimaries_BT470_2_SysM: colorspace.primaries = MP_CSP_PRIM_BT_470M; break; - case DXVA2_VideoPrimaries_BT470_2_SysBG: colorspace.primaries = MP_CSP_PRIM_BT_601_625; break; - case DXVA2_VideoPrimaries_SMPTE170M: - case DXVA2_VideoPrimaries_SMPTE240M: colorspace.primaries = MP_CSP_PRIM_BT_601_525; break; + case MFVideoPrimaries_BT709: colorspace.primaries = MP_CSP_PRIM_BT_709; break; + case MFVideoPrimaries_BT470_2_SysM: colorspace.primaries = MP_CSP_PRIM_BT_470M; break; + case MFVideoPrimaries_BT470_2_SysBG: colorspace.primaries = MP_CSP_PRIM_BT_601_625; break; + case MFVideoPrimaries_SMPTE170M: + case MFVideoPrimaries_SMPTE240M: colorspace.primaries = MP_CSP_PRIM_BT_601_525; break; case MFVideoPrimaries_BT2020: colorspace.primaries = MP_CSP_PRIM_BT_2020; break; case MFVideoPrimaries_DCI_P3: colorspace.primaries = MP_CSP_PRIM_DCI_P3; break; default: @@ -790,16 +790,16 @@ void set_colorspace(const DXVA2_ExtendedFormat extfmt, mp_colorspace& colorspace } switch (extfmt.VideoTransferFunction) { - case DXVA2_VideoTransFunc_10: colorspace.gamma = MP_CSP_TRC_LINEAR; break; - case DXVA2_VideoTransFunc_18: colorspace.gamma = MP_CSP_TRC_GAMMA18; break; - case DXVA2_VideoTransFunc_20: colorspace.gamma = MP_CSP_TRC_GAMMA20; break; - case DXVA2_VideoTransFunc_22: colorspace.gamma = MP_CSP_TRC_GAMMA22; break; - case DXVA2_VideoTransFunc_709: - case DXVA2_VideoTransFunc_240M: + case MFVideoTransFunc_10: colorspace.gamma = MP_CSP_TRC_LINEAR; break; + case MFVideoTransFunc_18: colorspace.gamma = MP_CSP_TRC_GAMMA18; break; + case MFVideoTransFunc_20: colorspace.gamma = MP_CSP_TRC_GAMMA20; break; + case MFVideoTransFunc_22: colorspace.gamma = MP_CSP_TRC_GAMMA22; break; + case MFVideoTransFunc_709: + case MFVideoTransFunc_240M: case MFVideoTransFunc_2020_const: case MFVideoTransFunc_2020: colorspace.gamma = MP_CSP_TRC_BT_1886; break; - case DXVA2_VideoTransFunc_sRGB: colorspace.gamma = MP_CSP_TRC_SRGB; break; - case DXVA2_VideoTransFunc_28: colorspace.gamma = MP_CSP_TRC_GAMMA28; break; + case MFVideoTransFunc_sRGB: colorspace.gamma = MP_CSP_TRC_SRGB; break; + case MFVideoTransFunc_28: colorspace.gamma = MP_CSP_TRC_GAMMA28; break; case MFVideoTransFunc_2084: colorspace.gamma = MP_CSP_TRC_PQ; break; case MFVideoTransFunc_HLG: colorspace.gamma = MP_CSP_TRC_HLG; break; default: @@ -979,35 +979,35 @@ DXVA2_ExtendedFormat SpecifyExtendedFormat(DXVA2_ExtendedFormat exFormat, const // https://docs.microsoft.com/en-us/windows/desktop/api/dxva2api/ns-dxva2api-dxva2_extendedformat if (fmtParams.Subsampling != 420) { - exFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_Unknown; + exFormat.VideoChromaSubsampling = MFVideoChromaSubsampling_Unknown; } - else if (exFormat.VideoChromaSubsampling == DXVA2_VideoChromaSubsampling_Unknown) { - exFormat.VideoChromaSubsampling = DXVA2_VideoChromaSubsampling_MPEG2; + else if (exFormat.VideoChromaSubsampling == MFVideoChromaSubsampling_Unknown) { + exFormat.VideoChromaSubsampling = MFVideoChromaSubsampling_MPEG2; } - if (exFormat.NominalRange == DXVA2_NominalRange_Unknown) { - exFormat.NominalRange = DXVA2_NominalRange_16_235; + if (exFormat.NominalRange == MFNominalRange_Unknown) { + exFormat.NominalRange = MFNominalRange_16_235; } - if (exFormat.VideoTransferMatrix == DXVA2_VideoTransferMatrix_Unknown) { + if (exFormat.VideoTransferMatrix == MFVideoTransferMatrix_Unknown) { if (width <= 1024 && height <= 576) { // SD (more reliable way to determine SD than MicroSoft offers) - exFormat.VideoTransferMatrix = DXVA2_VideoTransferMatrix_BT601; + exFormat.VideoTransferMatrix = MFVideoTransferMatrix_BT601; } else { // HD - exFormat.VideoTransferMatrix = DXVA2_VideoTransferMatrix_BT709; + exFormat.VideoTransferMatrix = MFVideoTransferMatrix_BT709; } } - if (exFormat.VideoLighting == DXVA2_VideoLighting_Unknown) { - exFormat.VideoLighting = DXVA2_VideoLighting_dim; + if (exFormat.VideoLighting == MFVideoLighting_Unknown) { + exFormat.VideoLighting = MFVideoLighting_dim; } - if (exFormat.VideoPrimaries == DXVA2_VideoPrimaries_Unknown) { - exFormat.VideoPrimaries = DXVA2_VideoPrimaries_BT709; // pick BT.709 to minimize damage + if (exFormat.VideoPrimaries == MFVideoPrimaries_Unknown) { + exFormat.VideoPrimaries = MFVideoPrimaries_BT709; // pick BT.709 to minimize damage } - if (exFormat.VideoTransferFunction == DXVA2_VideoTransFunc_Unknown) { - exFormat.VideoTransferFunction = DXVA2_VideoTransFunc_709; + if (exFormat.VideoTransferFunction == MFVideoTransFunc_Unknown) { + exFormat.VideoTransferFunction = MFVideoTransFunc_709; } } @@ -1016,15 +1016,15 @@ DXVA2_ExtendedFormat SpecifyExtendedFormat(DXVA2_ExtendedFormat exFormat, const void GetExtendedFormatString(LPCSTR (&strs)[6], const DXVA2_ExtendedFormat exFormat, const ColorSystem_t colorSystem) { - static LPCSTR chromalocation[] = { "unknown", "Center(MPEG-1)", nullptr, nullptr, nullptr, "Left(MPEG-2)", "TopLeft(PAL DV)", "TopLeft(Co-sited)" }; - static LPCSTR nominalrange[] = { "unknown", "0-255", "16-235", "48-208" }; - static LPCSTR transfermatrix[] = { "unknown", "BT.709", "BT.601", "SMPTE 240M", "BT.2020", nullptr, nullptr, "YCgCo" }; - static LPCSTR lighting[] = { "unknown", "bright", "office", "dim", "dark" }; - static LPCSTR primaries[] = { "unknown", "Reserved", "BT.709", "BT.470-4 System M", "BT.470-4 System B,G", - "SMPTE 170M", "SMPTE 240M", "EBU Tech. 3213", "SMPTE C", "BT.2020" }; - static LPCSTR transfunc[] = { "unknown", "Linear RGB", "1.8 gamma", "2.0 gamma", "2.2 gamma", "BT.709", "SMPTE 240M", - "sRGB", "2.8 gamma", "Log100", "Log316", "Symmetric BT.709", "Constant luminance BT.2020", "Non-constant luminance BT.2020", - "2.6 gamma", "SMPTE ST 2084 (PQ)", "ARIB STD-B67 (HLG)"}; + static LPCSTR chromalocation[] = { "unknown", "Center(MPEG-1)", nullptr, nullptr, nullptr, "Left (MPEG-2)", "Top Left (PAL DV)", "Top Left (Co-sited)" }; + static LPCSTR nominalrange[] = { "unknown", "0-255", "16-235", "48-208", "64-127" }; + static LPCSTR transfermatrix[] = { "unknown", "BT.709", "BT.601", "SMPTE 240M", "BT.2020", nullptr, nullptr, "YCoCg" }; + static LPCSTR lighting[] = { "unknown", "Bright", "Office", "Dim", "Dark" }; + static LPCSTR primaries[] = { "unknown", "Reserved", "BT.709", "BT.470-4 System M", "BT.470-4 System B/G", + "SMPTE 170M", "SMPTE 240M", "EBU Tech. 3213", "SMPTE C", "BT.2020", "XYZ", "DCI-P3", "ACES" }; + static LPCSTR transfunc[] = { "unknown", "Linear RGB", "Gamma 1.8", "Gamma 2.0", "Gamma 2.2", "BT.709", "SMPTE 240M", + "sRGB", "Gamma 2.8", "Log100", "Log316", "Symmetric BT.709", "Constant luminance BT.2020", "Non-constant luminance BT.2020", + "Gamma 2.6", "SMPTE ST.2084 (PQ)", "ARIB STD-B67 (HLG)"}; auto getDesc = [] (unsigned num, LPCSTR* descs, unsigned count) { if (num < count && descs[num]) { diff --git a/Source/Shaders.cpp b/Source/Shaders.cpp index 941a089a..733dc571 100644 --- a/Source/Shaders.cpp +++ b/Source/Shaders.cpp @@ -115,17 +115,17 @@ void ShaderGetPixels( const char* strChromaPos2 = ""; if (fmtParams.Subsampling == 420) { switch (chromaSubsampling) { - case DXVA2_VideoChromaSubsampling_Cosited: + case MFVideoChromaSubsampling_Cosited: strChromaPos = "+float2(dx*0.5,dy*0.5)"; strChromaPos2 = "+float2(-0.25,-0.25)"; DLog(L"ConvertColorShader: chroma location - Co-sited"); break; - case DXVA2_VideoChromaSubsampling_MPEG1: + case MFVideoChromaSubsampling_MPEG1: //strChromaPos = ""; strChromaPos2 = "+float2(-0.5,-0.5)"; DLog(L"ConvertColorShader: chroma location - MPEG-1"); break; - case DXVA2_VideoChromaSubsampling_MPEG2: + case MFVideoChromaSubsampling_MPEG2: default: strChromaPos = "+float2(dx*0.5,0)"; strChromaPos2 = "+float2(-0.25,-0.5)"; @@ -809,15 +809,15 @@ HRESULT GetShaderConvertColor( else if (bBT2020Primaries) { std::string toLinear; switch (exFmt.VideoTransferFunction) { - case DXVA2_VideoTransFunc_10: toLinear = "\\\\nothing\n"; break; - case DXVA2_VideoTransFunc_18: toLinear = "color = pow(color, 1.8);\n"; break; - case DXVA2_VideoTransFunc_20: toLinear = "color = pow(color, 2.0);\n"; break; + case MFVideoTransFunc_10: toLinear = "\\\\nothing\n"; break; + case MFVideoTransFunc_18: toLinear = "color = pow(color, 1.8);\n"; break; + case MFVideoTransFunc_20: toLinear = "color = pow(color, 2.0);\n"; break; case MFVideoTransFunc_HLG: // HLG compatible with SDR - case DXVA2_VideoTransFunc_22: - case DXVA2_VideoTransFunc_709: - case DXVA2_VideoTransFunc_240M: toLinear = "color = pow(color, 2.2);\n"; break; - case DXVA2_VideoTransFunc_sRGB: toLinear = "color = pow(color, 2.2);\n"; break; - case DXVA2_VideoTransFunc_28: toLinear = "color = pow(color, 2.8);\n"; break; + case MFVideoTransFunc_22: + case MFVideoTransFunc_709: + case MFVideoTransFunc_240M: toLinear = "color = pow(color, 2.2);\n"; break; + case MFVideoTransFunc_sRGB: toLinear = "color = pow(color, 2.2);\n"; break; + case MFVideoTransFunc_28: toLinear = "color = pow(color, 2.8);\n"; break; case MFVideoTransFunc_26: toLinear = "color = pow(color, 2.6);\n"; break; } diff --git a/Source/VideoProcessor.cpp b/Source/VideoProcessor.cpp index eeb87a1f..b0fcf568 100644 --- a/Source/VideoProcessor.cpp +++ b/Source/VideoProcessor.cpp @@ -129,7 +129,7 @@ void CVideoProcessor::SetDisplayInfo(const DisplayConfig_t& dc, const bool prima if (primary) { m_strStatsDispInfo.append(L" Primary"); } - m_strStatsDispInfo.append(fullscreen ? L" fullscreen" : L" windowed"); + m_strStatsDispInfo.append(fullscreen ? L" Fullscreen" : L" Windowed"); if (str.size()) { m_strStatsDispInfo.append(str); @@ -138,13 +138,13 @@ void CVideoProcessor::SetDisplayInfo(const DisplayConfig_t& dc, const bool prima void CVideoProcessor::UpdateStatsInputFmt() { - m_strStatsInputFmt.assign(L"\nInput format : "); + m_strStatsInputFmt.assign(L"\nInput Format : "); if (m_iSrcFromGPU == 9) { m_strStatsInputFmt.append(L"DXVA2_"); } else if (m_iSrcFromGPU == 11) { - m_strStatsInputFmt.append(L"D3D11_"); + m_strStatsInputFmt.append(L"D3D11_"); } m_strStatsInputFmt.append(m_srcParams.str); @@ -160,28 +160,28 @@ void CVideoProcessor::UpdateStatsInputFmt() LPCSTR strs[6] = {}; GetExtendedFormatString(strs, m_srcExFmt, m_srcParams.CSType); m_strStatsInputFmt += std::format(L"\n Range: {}", A2WStr(strs[1])); - if (m_decExFmt.NominalRange == DXVA2_NominalRange_Unknown) { + if (m_decExFmt.NominalRange == MFNominalRange_Unknown) { m_strStatsInputFmt += L'*'; }; - m_strStatsInputFmt += std::format(L", Matrix: {}", A2WStr(strs[2])); - if (m_decExFmt.VideoTransferMatrix == DXVA2_VideoTransferMatrix_Unknown) { + m_strStatsInputFmt += std::format(L", Color Matrix: {}", A2WStr(strs[2])); + if (m_decExFmt.VideoTransferMatrix == MFVideoTransferMatrix_Unknown) { m_strStatsInputFmt += L'*'; }; - if (m_decExFmt.VideoLighting != DXVA2_VideoLighting_Unknown) { + if (m_decExFmt.VideoLighting != MFVideoLighting_Unknown) { // display Lighting only for values other than Unknown, but this never happens m_strStatsInputFmt += std::format(L", Lighting: {}", A2WStr(strs[3])); }; m_strStatsInputFmt += std::format(L"\n Primaries: {}", A2WStr(strs[4])); - if (m_decExFmt.VideoPrimaries == DXVA2_VideoPrimaries_Unknown) { + if (m_decExFmt.VideoPrimaries == MFVideoPrimaries_Unknown) { m_strStatsInputFmt += L'*'; }; - m_strStatsInputFmt += std::format(L", Function: {}", A2WStr(strs[5])); - if (m_decExFmt.VideoTransferFunction == DXVA2_VideoTransFunc_Unknown) { + m_strStatsInputFmt += std::format(L", Transfer Function: {}", A2WStr(strs[5])); + if (m_decExFmt.VideoTransferFunction == MFVideoTransFunc_Unknown) { m_strStatsInputFmt += L'*'; }; if (m_srcParams.Subsampling == 420) { - m_strStatsInputFmt += std::format(L"\n ChromaLocation: {}", A2WStr(strs[0])); - if (m_decExFmt.VideoChromaSubsampling == DXVA2_VideoChromaSubsampling_Unknown) { + m_strStatsInputFmt += std::format(L"\n Chroma Location: {}", A2WStr(strs[0])); + if (m_decExFmt.VideoChromaSubsampling == MFVideoChromaSubsampling_Unknown) { m_strStatsInputFmt += L'*'; }; } diff --git a/Source/VideoRenderer.cpp b/Source/VideoRenderer.cpp index 31d475d9..333379f3 100644 --- a/Source/VideoRenderer.cpp +++ b/Source/VideoRenderer.cpp @@ -1203,7 +1203,7 @@ STDMETHODIMP CMpcVideoRenderer::SaveSettings() key.SetDWORDValue(OPT_VPSuperResolution, m_Sets.iVPSuperRes); key.SetDWORDValue(OPT_VPRTXVideoHDR, m_Sets.bVPRTXVideoHDR); key.SetDWORDValue(OPT_VPSuperResIfScaling, m_Sets.bVPSuperResIfScaling); - key.SetDWORDValue(OPT_VPSuperResIfScaling, m_Sets.bVPFrameSyncing); + key.SetDWORDValue(OPT_VPFrameSyncing, m_Sets.bVPFrameSyncing); key.SetDWORDValue(OPT_ChromaUpsampling, m_Sets.iChromaScaling); key.SetDWORDValue(OPT_Upscaling, m_Sets.iUpscaling); key.SetDWORDValue(OPT_Downscaling, m_Sets.iDownscaling);