From 3cc137f4fa8ea87d335c210786aee652226e7710 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Fri, 8 Feb 2019 13:03:00 +0300 Subject: [PATCH] [videoplayer] WinRenderer: remove `dxvaallowhqscaling` setting --- .../VideoRenderers/WinRenderer.cpp | 54 ++++++------------- xbmc/settings/AdvancedSettings.cpp | 2 - xbmc/settings/AdvancedSettings.h | 1 - 3 files changed, 15 insertions(+), 42 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp index 3a2f7a62b49da..bf3ac0e651436 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp @@ -493,42 +493,25 @@ void CWinRenderer::SelectPSVideoFilter() switch (m_scalingMethod) { - case VS_SCALINGMETHOD_NEAREST: - case VS_SCALINGMETHOD_LINEAR: - break; - case VS_SCALINGMETHOD_CUBIC: case VS_SCALINGMETHOD_LANCZOS2: case VS_SCALINGMETHOD_SPLINE36_FAST: case VS_SCALINGMETHOD_LANCZOS3_FAST: - m_bUseHQScaler = true; - break; - case VS_SCALINGMETHOD_SPLINE36: case VS_SCALINGMETHOD_LANCZOS3: m_bUseHQScaler = true; break; - case VS_SCALINGMETHOD_SINC8: - CLog::Log(LOGERROR, "D3D: TODO: This scaler has not yet been implemented"); - break; - - case VS_SCALINGMETHOD_BICUBIC_SOFTWARE: - case VS_SCALINGMETHOD_LANCZOS_SOFTWARE: - case VS_SCALINGMETHOD_SINC_SOFTWARE: - CLog::Log(LOGERROR, "D3D: TODO: Software scaling has not yet been implemented"); - break; - default: break; } if (m_scalingMethod == VS_SCALINGMETHOD_AUTO) { - bool scaleSD = m_sourceHeight < 720 && m_sourceWidth < 1280; - bool scaleUp = static_cast(m_sourceHeight) < CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight() + const bool scaleSD = m_sourceHeight < 720 && m_sourceWidth < 1280; + const bool scaleUp = static_cast(m_sourceHeight) < CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight() && static_cast(m_sourceWidth) < CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth(); - bool scaleFps = m_fps < (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoAutoScaleMaxFps + 0.01f); + const bool scaleFps = m_fps < CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoAutoScaleMaxFps + 0.01f; if (m_renderMethod == RENDER_DXVA) { @@ -540,6 +523,8 @@ void CWinRenderer::SelectPSVideoFilter() m_scalingMethod = VS_SCALINGMETHOD_LANCZOS3_FAST; m_bUseHQScaler = true; } + else + m_scalingMethod = VS_SCALINGMETHOD_LINEAR; } if (m_renderOrientation) m_bUseHQScaler = false; @@ -1037,21 +1022,17 @@ bool CWinRenderer::Supports(ERENDERFEATURE feature) bool CWinRenderer::Supports(ESCALINGMETHOD method) { - if (m_renderMethod == RENDER_PS || m_renderMethod == RENDER_DXVA) - { - if (m_renderMethod == RENDER_DXVA) - { - if (method == VS_SCALINGMETHOD_DXVA_HARDWARE - || method == VS_SCALINGMETHOD_AUTO) - return true; - if (!CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_DXVAAllowHqScaling || m_renderOrientation) - return false; - } + if (method == VS_SCALINGMETHOD_AUTO) + return true; - if ( method == VS_SCALINGMETHOD_AUTO - || (method == VS_SCALINGMETHOD_LINEAR && m_renderMethod == RENDER_PS)) - return true; + if (method == VS_SCALINGMETHOD_LINEAR && m_renderMethod != RENDER_DXVA) + return true; + if (method == VS_SCALINGMETHOD_DXVA_HARDWARE && m_renderMethod == RENDER_DXVA) + return true; + + if (m_renderMethod == RENDER_PS || m_renderMethod == RENDER_DXVA) + { if (DX::DeviceResources::Get()->GetDeviceFeatureLevel() >= D3D_FEATURE_LEVEL_9_3 && !m_renderOrientation) { if (method == VS_SCALINGMETHOD_CUBIC @@ -1071,12 +1052,7 @@ bool CWinRenderer::Supports(ESCALINGMETHOD method) } } } - else if(m_renderMethod == RENDER_SW) - { - if (method == VS_SCALINGMETHOD_AUTO - || method == VS_SCALINGMETHOD_LINEAR) - return true; - } + return false; } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index f3931613ed1e7..1b38457c7cad9 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -173,7 +173,6 @@ void CAdvancedSettings::Initialize() m_DXVACheckCompatibility = false; m_DXVACheckCompatibilityPresent = false; m_DXVAForceProcessorRenderer = true; - m_DXVAAllowHqScaling = true; m_videoFpsDetect = 1; m_maxTempo = 1.55f; m_videoPreferStereoStream = false; @@ -718,7 +717,6 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) m_DXVACheckCompatibilityPresent = XMLUtils::GetBoolean(pElement,"checkdxvacompatibility", m_DXVACheckCompatibility); XMLUtils::GetBoolean(pElement,"forcedxvarenderer", m_DXVAForceProcessorRenderer); - XMLUtils::GetBoolean(pElement, "dxvaallowhqscaling", m_DXVAAllowHqScaling); XMLUtils::GetBoolean(pElement, "usedisplaycontrolhwstereo", m_useDisplayControlHWStereo); XMLUtils::GetBoolean(pElement, "allowdiscretedecoder", m_allowUseSeparateDeviceForDecoding); //0 = disable fps detect, 1 = only detect on timestamps with uniform spacing, 2 detect on all timestamps diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index 1df75ad562bb6..1de3b00b276dc 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -179,7 +179,6 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler bool m_DXVACheckCompatibility; bool m_DXVACheckCompatibilityPresent; bool m_DXVAForceProcessorRenderer; - bool m_DXVAAllowHqScaling; int m_videoFpsDetect; bool m_mediacodecForceSoftwareRendering; float m_maxTempo;