[vlc-commits] vdpau: add support for 4:4:4 chroma sampling

Rémi Denis-Courmont git at videolan.org
Sat Jul 26 12:37:06 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jul 26 13:02:23 2014 +0300| [eb56833d6a315c5a914654449e0d03f0ed65a4c5] | committer: Rémi Denis-Courmont

vdpau: add support for 4:4:4 chroma sampling

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

 modules/hw/vdpau/adjust.c      |    5 +++--
 modules/hw/vdpau/chroma.c      |   24 ++++++++++++++++++++----
 modules/hw/vdpau/deinterlace.c |    5 +++--
 modules/hw/vdpau/display.c     |    3 ++-
 modules/hw/vdpau/picture.c     |    3 ++-
 modules/hw/vdpau/sharpen.c     |    5 +++--
 6 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/modules/hw/vdpau/adjust.c b/modules/hw/vdpau/adjust.c
index 9153e3d..d150579 100644
--- a/modules/hw/vdpau/adjust.c
+++ b/modules/hw/vdpau/adjust.c
@@ -125,8 +125,9 @@ static int Open(vlc_object_t *obj)
 {
     filter_t *filter = (filter_t *)obj;
 
-    if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
-     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420)
+    if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
         return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
         return VLC_EGENERIC;
diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index 126cf29..70ce32f 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -329,7 +329,8 @@ static picture_t *VideoExport(filter_t *filter, picture_t *src, picture_t *dst)
         pitches[i] = dst->p[i].i_pitch;
     }
     if (dst->format.i_chroma == VLC_CODEC_I420
-     || dst->format.i_chroma == VLC_CODEC_I422)
+     || dst->format.i_chroma == VLC_CODEC_I422
+     || dst->format.i_chroma == VLC_CODEC_I444)
     {
         planes[1] = dst->p[2].p_pixels;
         planes[2] = dst->p[1].p_pixels;
@@ -378,7 +379,9 @@ static picture_t *VideoImport(filter_t *filter, picture_t *src)
         planes[i] = src->p[i].p_pixels;
         pitches[i] = src->p[i].i_pitch;
     }
-    if (src->format.i_chroma == VLC_CODEC_I420)
+    if (src->format.i_chroma == VLC_CODEC_I420
+     || src->format.i_chroma == VLC_CODEC_I422
+     || src->format.i_chroma == VLC_CODEC_I444)
     {
         planes[1] = src->p[2].p_pixels;
         planes[2] = src->p[1].p_pixels;
@@ -396,8 +399,21 @@ static picture_t *VideoImport(filter_t *filter, picture_t *src)
 
     /* Wrap surface into a picture */
     video_format_t fmt = src->format;
-    fmt.i_chroma = (sys->chroma == VDP_CHROMA_TYPE_420)
-        ? VLC_CODEC_VDPAU_VIDEO_420 : VLC_CODEC_VDPAU_VIDEO_422;
+
+    switch (sys->chroma)
+    {
+        case VDP_CHROMA_TYPE_420:
+            fmt.i_chroma = VLC_CODEC_VDPAU_VIDEO_420;
+            break;
+        case VDP_CHROMA_TYPE_422:
+            fmt.i_chroma = VLC_CODEC_VDPAU_VIDEO_422;
+            break;
+        case VDP_CHROMA_TYPE_444:
+            fmt.i_chroma = VLC_CODEC_VDPAU_VIDEO_444;
+            break;
+        default:
+            assert(0);
+    }
 
     picture_t *dst = picture_NewFromFormat(&fmt);
     if (unlikely(dst == NULL))
diff --git a/modules/hw/vdpau/deinterlace.c b/modules/hw/vdpau/deinterlace.c
index 44d7f25..cb30070 100644
--- a/modules/hw/vdpau/deinterlace.c
+++ b/modules/hw/vdpau/deinterlace.c
@@ -98,8 +98,9 @@ static int Open(vlc_object_t *obj)
 {
     filter_t *filter = (filter_t *)obj;
 
-    if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
-     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420)
+    if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
         return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
         return VLC_EGENERIC;
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 18a68d3..54e1cb8 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -477,7 +477,8 @@ static int Open(vlc_object_t *obj)
     video_format_ApplyRotation(&fmt, &vd->fmt);
 
     if (fmt.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
-     || fmt.i_chroma == VLC_CODEC_VDPAU_VIDEO_422)
+     || fmt.i_chroma == VLC_CODEC_VDPAU_VIDEO_422
+     || fmt.i_chroma == VLC_CODEC_VDPAU_VIDEO_444)
         ;
     else
     if (vlc_fourcc_to_vdp_ycc(fmt.i_chroma, &chroma, &format))
diff --git a/modules/hw/vdpau/picture.c b/modules/hw/vdpau/picture.c
index 7c865ed..b881140 100644
--- a/modules/hw/vdpau/picture.c
+++ b/modules/hw/vdpau/picture.c
@@ -96,7 +96,8 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
         return VDP_STATUS_RESOURCES;
 
     assert(pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
-        || pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422);
+        || pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422
+        || pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_444);
     assert(!picture_IsReferenced(pic));
     assert(pic->context == NULL);
     pic->context = field;
diff --git a/modules/hw/vdpau/sharpen.c b/modules/hw/vdpau/sharpen.c
index bbdc6df..0470990 100644
--- a/modules/hw/vdpau/sharpen.c
+++ b/modules/hw/vdpau/sharpen.c
@@ -82,8 +82,9 @@ static int Open(vlc_object_t *obj)
 {
     filter_t *filter = (filter_t *)obj;
 
-    if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
-     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420)
+    if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
         return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
         return VLC_EGENERIC;



More information about the vlc-commits mailing list