Permalink
Browse files

VideoRenderer: add gui setting for threshold when hq scaling is desired

  • Loading branch information...
FernetMenta committed Mar 5, 2013
1 parent a75ddf9 commit 5bbf176603b593a867dab88b9848b7e319f609cc
@@ -5345,19 +5345,24 @@ msgctxt "#13434"
msgid "Play only this"
msgstr ""
+#: xbmc/settings/GUISettings.cpp
msgctxt "#13435"
-msgid "Allow Vdpau OpenGL interop"
+msgid "Enable HQ Scalers for scalings above %"
msgstr ""
msgctxt "#13436"
-msgid "Prefer VDPAU Video Mixer"
+msgid "Allow Vdpau OpenGL interop"
msgstr ""
msgctxt "#13437"
+msgid "Prefer VDPAU Video Mixer"
+msgstr ""
+
+msgctxt "#13438"
msgid "Allow hardware acceleration (XVBA)"
msgstr ""
-#empty strings from id 13438 to 13499
+#empty strings from id 13439 to 13499
#: xbmc/settings/GUISettings.cpp
msgctxt "#13500"
@@ -3719,6 +3719,13 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method)
|| method == VS_SCALINGMETHOD_SPLINE36
|| method == VS_SCALINGMETHOD_LANCZOS3)
{
+ // if scaling is below level, avoid hq scaling
+ float scaleX = fabs(((float)m_sourceWidth - m_destRect.Width())/m_sourceWidth)*100;
+ float scaleY = fabs(((float)m_sourceHeight - m_destRect.Height())/m_sourceHeight)*100;
+ int minScale = g_guiSettings.GetInt("videoplayer.hqscalers");
+ if (scaleX < minScale && scaleY < minScale)
+ return false;
+
if ((glewIsSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL)) ||
(m_renderMethod & RENDER_VDPAU) || (m_renderMethod & RENDER_VAAPI) || (m_renderMethod & RENDER_XVBA))
{
@@ -1070,7 +1070,15 @@ bool CWinRenderer::Supports(ESCALINGMETHOD method)
|| method == VS_SCALINGMETHOD_LANCZOS3_FAST
|| method == VS_SCALINGMETHOD_SPLINE36
|| method == VS_SCALINGMETHOD_LANCZOS3)
+ {
+ // if scaling is below level, avoid hq scaling
+ float scaleX = fabs(((float)m_sourceWidth - m_destRect.Width())/m_sourceWidth)*100;
+ float scaleY = fabs(((float)m_sourceHeight - m_destRect.Height())/m_sourceHeight)*100;
+ int minScale = g_guiSettings.GetInt("videoplayer.hqscalers");
+ if (scaleX < minScale && scaleY < minScale)
+ return false;
return true;
+ }
}
}
else if(m_renderMethod == RENDER_SW)
@@ -709,15 +709,17 @@ void CGUISettings::Initialize()
#endif
AddInt(vp, "videoplayer.rendermethod", 13415, RENDER_METHOD_AUTO, renderers, SPIN_CONTROL_TEXT);
+ AddInt(vp, "videoplayer.hqscalers", 13435, 0, 0, 10, 100, SPIN_CONTROL_INT);
+
#ifdef HAVE_LIBVDPAU
AddBool(vp, "videoplayer.usevdpau", 13425, true);
- AddBool(vp, "videoplayer.usevdpaumixer", 13436, true);
+ AddBool(vp, "videoplayer.usevdpaumixer", 13437, true);
#endif
#ifdef HAVE_LIBVA
AddBool(vp, "videoplayer.usevaapi", 13426, true);
#endif
#ifdef HAVE_LIBXVBA
- AddBool(vp, "videoplayer.usexvba", 13437, true);
+ AddBool(vp, "videoplayer.usexvba", 13438, true);
#endif
#ifdef HAS_DX
AddBool(g_sysinfo.IsVistaOrHigher() ? vp: NULL, "videoplayer.usedxva2", 13427, g_sysinfo.IsVistaOrHigher() ? true : false);

0 comments on commit 5bbf176

Please sign in to comment.