vdpau: add YUV 444
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 16 Jul 2013 19:01:35 +0000 (22:01 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 16 Jul 2013 19:10:10 +0000 (22:10 +0300)
This is untested due to lack of compatible hardware.

include/vlc_fourcc.h
modules/hw/vdpau/chroma.c
modules/hw/vdpau/vlc_vdpau.h
src/misc/fourcc.c

index 47f47cd..39e9737 100644 (file)
 #define VLC_CODEC_VDPAU_VIDEO_420 VLC_FOURCC('V','D','V','0')
 /* VDPAU video surface YCbCr 4:2:2 */
 #define VLC_CODEC_VDPAU_VIDEO_422 VLC_FOURCC('V','D','V','2')
+/* VDPAU video surface YCbCr 4:4:4 */
+#define VLC_CODEC_VDPAU_VIDEO_444 VLC_FOURCC('V','D','V','4')
 /* VDPAU output surface RGBA */
 #define VLC_CODEC_VDPAU_OUTPUT    VLC_FOURCC('V','D','O','R')
 
index 8928f0c..99f9b84 100644 (file)
@@ -441,6 +441,7 @@ static picture_t *VideoPassthrough(filter_t *filter, picture_t *src)
         {
              case VDP_CHROMA_TYPE_420: fmt.i_chroma = VLC_CODEC_NV12; break;
              case VDP_CHROMA_TYPE_422: fmt.i_chroma = VLC_CODEC_UYVY; break;
+             case VDP_CHROMA_TYPE_444: fmt.i_chroma = VLC_CODEC_NV24; break;
              default: assert(0);
         }
 
@@ -599,6 +600,13 @@ static int OutputOpen(vlc_object_t *obj)
     sys->vdp = NULL;
     sys->mixer = VDP_INVALID_HANDLE;
 
+    if (filter->fmt_in.video.i_chroma == VLC_CODEC_VDPAU_VIDEO_444)
+    {
+        sys->chroma = VDP_CHROMA_TYPE_444;
+        sys->format = VDP_YCBCR_FORMAT_NV12;
+        sys->import = VideoPassthrough;
+    }
+    else
     if (filter->fmt_in.video.i_chroma == VLC_CODEC_VDPAU_VIDEO_422)
     {
         sys->chroma = VDP_CHROMA_TYPE_422;
@@ -676,7 +684,8 @@ static int YCbCrOpen(vlc_object_t *obj)
 {
     filter_t *filter = (filter_t *)obj;
     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_422
+     && filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
         return VLC_EGENERIC;
 
     if (filter->fmt_in.video.i_visible_width
index 1f11c67..362e60a 100644 (file)
@@ -241,6 +241,14 @@ bool vlc_fourcc_to_vdp_ycc(vlc_fourcc_t fourcc,
             *type = VDP_CHROMA_TYPE_422;
             *format = VDP_YCBCR_FORMAT_UYVY;
             break;
+        case VLC_CODEC_I444:
+            *type = VDP_CHROMA_TYPE_444;
+            *format = VDP_YCBCR_FORMAT_YV12;
+            break;
+        case VLC_CODEC_NV24:
+            *type = VDP_CHROMA_TYPE_444;
+            *format = VDP_YCBCR_FORMAT_NV12;
+            break;
         default:
             return false;
     }
index 9cd13f5..b439c72 100644 (file)
@@ -1807,6 +1807,7 @@ static const vlc_fourcc_t p_list_YUV[] = {
     VLC_CODEC_YUV_PLANAR_444_16,
     VLC_CODEC_VDPAU_VIDEO_420,
     VLC_CODEC_VDPAU_VIDEO_422,
+    VLC_CODEC_VDPAU_VIDEO_444,
     0,
 };
 
@@ -1991,6 +1992,7 @@ static const struct
     { { VLC_CODEC_XYZ12,  0 },                 PACKED_FMT(6, 48) },
 
     { { VLC_CODEC_VDPAU_VIDEO_420, VLC_CODEC_VDPAU_VIDEO_422,
+        VLC_CODEC_VDPAU_VIDEO_444,
         VLC_CODEC_VDPAU_OUTPUT, 0 },           FAKE_FMT() },
 
     { {0}, { 0, {}, 0, 0 } }