[vlc-commits] vdpau: optional high quality scaling

Rémi Denis-Courmont git at videolan.org
Sun Jul 7 20:13:42 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul  1 21:01:50 2013 +0300| [07946c4e6fb2c00f9fd974082c57a98709cd5c67] | committer: Rémi Denis-Courmont

vdpau: optional high quality scaling

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=07946c4e6fb2c00f9fd974082c57a98709cd5c67
---

 modules/hw/vdpau/chroma.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index c8504b5..0d780d0 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -55,7 +55,7 @@ static VdpVideoMixer MixerCreate(filter_t *filter)
     VdpBool ok;
 
     /* Check for potentially useful features */
-    VdpVideoMixerFeature featv[2];
+    VdpVideoMixerFeature featv[3];
     unsigned featc = 0;
 
     const float noise = var_InheritFloat(filter, "vdpau-noise-reduction");
@@ -78,6 +78,23 @@ static VdpVideoMixer MixerCreate(filter_t *filter)
         featv[featc++] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS;
     }
 
+    const int offset = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 - 1;
+    unsigned level = var_InheritInteger(filter, "vdpau-scaling");
+    while (level > 0)
+    {
+
+        err = vdp_video_mixer_query_feature_support(sys->vdp, sys->device,
+                                                    offset + level, &ok);
+        if (err == VDP_STATUS_OK && ok == VDP_TRUE)
+        {
+            msg_Dbg(filter, "using video mixer high quality scaling L%u",
+                    level);
+            featv[featc++] = offset + level;
+            break;
+        }
+        level--; /* fallback to lower quality */
+    }
+
     /* Create the mixer */
     VdpVideoMixerParameter parms[3] = {
         VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH,
@@ -112,6 +129,9 @@ static VdpVideoMixer MixerCreate(filter_t *filter)
         attrc++;
     }
 
+    if (level > 0)
+        featv[featc++] = offset + level;
+
     if (featc > 0)
     {
         VdpBool enablev[featc];
@@ -570,6 +590,8 @@ vlc_module_begin()
 
     add_float_with_range("vdpau-noise-reduction", 0., 0., 1.,
         N_("Noise reduction level"), N_("Noise reduction level"), true)
+    add_integer_with_range("vdpau-scaling", 0, 0, 9,
+       N_("Scaling quality"), N_("High quality scaling level"), true)
 
     add_submodule()
     set_callbacks(YCbCrOpen, YCbCrClose)



More information about the vlc-commits mailing list