Commit eb56833d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

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

parent 1f8e9326
......@@ -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;
......
......@@ -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))
......
......@@ -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;
......
......@@ -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))
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment