deinterlace: Add support for NV21 colorspace

This commit is contained in:
Sebastian Dröge 2011-02-24 14:08:25 +01:00
parent ce0e34a0d5
commit 88cbcf5aa4
10 changed files with 34 additions and 2 deletions

View file

@ -161,7 +161,7 @@ gst_deinterlace_modes_get_type (void)
}
#define DEINTERLACE_CAPS \
GST_VIDEO_CAPS_YUV ("{ AYUV, Y444, YUY2, YVYU, UYVY, Y42B, I420, YV12, Y41B, NV12 }") ";" \
GST_VIDEO_CAPS_YUV ("{ AYUV, Y444, YUY2, YVYU, UYVY, Y42B, I420, YV12, Y41B, NV12, NV21 }") ";" \
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_ABGR ";" \
GST_VIDEO_CAPS_RGBA ";" GST_VIDEO_CAPS_BGRA ";" \
GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_xBGR ";" \

View file

@ -71,6 +71,8 @@ gst_deinterlace_method_supported_impl (GstDeinterlaceMethodClass * klass,
return (klass->deinterlace_frame_ayuv != NULL);
case GST_VIDEO_FORMAT_NV12:
return (klass->deinterlace_frame_nv12 != NULL);
case GST_VIDEO_FORMAT_NV21:
return (klass->deinterlace_frame_nv21 != NULL);
case GST_VIDEO_FORMAT_ARGB:
case GST_VIDEO_FORMAT_xRGB:
return (klass->deinterlace_frame_argb != NULL);
@ -157,6 +159,9 @@ gst_deinterlace_method_setup_impl (GstDeinterlaceMethod * self,
case GST_VIDEO_FORMAT_NV12:
self->deinterlace_frame = klass->deinterlace_frame_nv12;
break;
case GST_VIDEO_FORMAT_NV21:
self->deinterlace_frame = klass->deinterlace_frame_nv21;
break;
case GST_VIDEO_FORMAT_ARGB:
case GST_VIDEO_FORMAT_xRGB:
self->deinterlace_frame = klass->deinterlace_frame_argb;
@ -276,6 +281,9 @@ gst_deinterlace_simple_method_supported (GstDeinterlaceMethodClass * mklass,
case GST_VIDEO_FORMAT_NV12:
return (klass->interpolate_scanline_nv12 != NULL
&& klass->copy_scanline_nv12 != NULL);
case GST_VIDEO_FORMAT_NV21:
return (klass->interpolate_scanline_nv21 != NULL
&& klass->copy_scanline_nv21 != NULL);
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_Y444:
@ -673,6 +681,10 @@ gst_deinterlace_simple_method_setup (GstDeinterlaceMethod * method,
self->interpolate_scanline_packed = klass->interpolate_scanline_nv12;
self->copy_scanline_packed = klass->copy_scanline_nv12;
break;
case GST_VIDEO_FORMAT_NV21:
self->interpolate_scanline_packed = klass->interpolate_scanline_nv21;
self->copy_scanline_packed = klass->copy_scanline_nv21;
break;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_Y444:
@ -731,6 +743,8 @@ gst_deinterlace_simple_method_class_init (GstDeinterlaceSimpleMethodClass
gst_deinterlace_simple_method_deinterlace_frame_planar;
dm_class->deinterlace_frame_nv12 =
gst_deinterlace_simple_method_deinterlace_frame_nv12;
dm_class->deinterlace_frame_nv21 =
gst_deinterlace_simple_method_deinterlace_frame_nv12;
dm_class->fields_required = 2;
dm_class->setup = gst_deinterlace_simple_method_setup;
dm_class->supported = gst_deinterlace_simple_method_supported;

View file

@ -96,6 +96,7 @@ struct _GstDeinterlaceMethodClass {
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_y41b;
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_ayuv;
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_nv12;
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_nv21;
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_argb;
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_abgr;
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_rgba;
@ -199,9 +200,12 @@ struct _GstDeinterlaceSimpleMethodClass {
GstDeinterlaceSimpleMethodFunction copy_scanline_rgb;
GstDeinterlaceSimpleMethodFunction interpolate_scanline_bgr;
GstDeinterlaceSimpleMethodFunction copy_scanline_bgr;
/* Semi-planar formats */
GstDeinterlaceSimpleMethodFunction interpolate_scanline_nv12;
GstDeinterlaceSimpleMethodFunction copy_scanline_nv12;
GstDeinterlaceSimpleMethodFunction interpolate_scanline_nv21;
GstDeinterlaceSimpleMethodFunction copy_scanline_nv21;
/* Planar formats */
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_y;

View file

@ -113,6 +113,7 @@ gst_deinterlace_method_linear_class_init (GstDeinterlaceMethodLinearClass *
dism_class->interpolate_scanline_rgb = deinterlace_scanline_linear_packed_c;
dism_class->interpolate_scanline_bgr = deinterlace_scanline_linear_packed_c;
dism_class->interpolate_scanline_nv12 = deinterlace_scanline_linear_packed_c;
dism_class->interpolate_scanline_nv21 = deinterlace_scanline_linear_packed_c;
dism_class->interpolate_scanline_planar_y =
deinterlace_scanline_linear_planar_y_c;
dism_class->interpolate_scanline_planar_u =

View file

@ -169,6 +169,8 @@ static void
deinterlace_scanline_linear_blend_packed_c;
dism_class->interpolate_scanline_nv12 =
deinterlace_scanline_linear_blend_packed_c;
dism_class->interpolate_scanline_nv21 =
deinterlace_scanline_linear_blend_packed_c;
dism_class->interpolate_scanline_planar_y =
deinterlace_scanline_linear_blend_planar_y_c;

View file

@ -92,6 +92,8 @@ gst_deinterlace_method_scaler_bob_class_init (GstDeinterlaceMethodScalerBobClass
deinterlace_scanline_scaler_bob_packed;
dism_class->interpolate_scanline_nv12 =
deinterlace_scanline_scaler_bob_packed;
dism_class->interpolate_scanline_nv21 =
deinterlace_scanline_scaler_bob_packed;
dism_class->interpolate_scanline_argb =
deinterlace_scanline_scaler_bob_packed;
dism_class->interpolate_scanline_abgr =

View file

@ -260,6 +260,7 @@ gst_deinterlace_method_vfir_class_init (GstDeinterlaceMethodVFIRClass * klass)
dism_class->interpolate_scanline_yvyu = deinterlace_line_packed_mmx;
dism_class->interpolate_scanline_uyvy = deinterlace_line_packed_mmx;
dism_class->interpolate_scanline_nv12 = deinterlace_line_packed_mmx;
dism_class->interpolate_scanline_nv21 = deinterlace_line_packed_mmx;
dism_class->interpolate_scanline_argb = deinterlace_line_packed_mmx;
dism_class->interpolate_scanline_abgr = deinterlace_line_packed_mmx;
dism_class->interpolate_scanline_rgba = deinterlace_line_packed_mmx;
@ -275,6 +276,7 @@ gst_deinterlace_method_vfir_class_init (GstDeinterlaceMethodVFIRClass * klass)
dism_class->interpolate_scanline_uyvy = deinterlace_line_packed_c;
dism_class->interpolate_scanline_ayuv = deinterlace_line_packed_c;
dism_class->interpolate_scanline_nv12 = deinterlace_line_packed_c;
dism_class->interpolate_scanline_nv21 = deinterlace_line_packed_c;
dism_class->interpolate_scanline_argb = deinterlace_line_packed_c;
dism_class->interpolate_scanline_abgr = deinterlace_line_packed_c;
dism_class->interpolate_scanline_rgba = deinterlace_line_packed_c;
@ -291,6 +293,7 @@ gst_deinterlace_method_vfir_class_init (GstDeinterlaceMethodVFIRClass * klass)
dism_class->interpolate_scanline_yvyu = deinterlace_line_packed_c;
dism_class->interpolate_scanline_uyvy = deinterlace_line_packed_c;
dism_class->interpolate_scanline_nv12 = deinterlace_line_packed_c;
dism_class->interpolate_scanline_nv21 = deinterlace_line_packed_c;
dism_class->interpolate_scanline_argb = deinterlace_line_packed_c;
dism_class->interpolate_scanline_abgr = deinterlace_line_packed_c;
dism_class->interpolate_scanline_rgba = deinterlace_line_packed_c;

View file

@ -120,6 +120,7 @@ gst_deinterlace_method_weave_class_init (GstDeinterlaceMethodWeaveClass * klass)
dism_class->interpolate_scanline_yvyu = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_uyvy = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_nv12 = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_nv21 = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_argb = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_abgr = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_rgba = deinterlace_scanline_weave_packed;
@ -138,6 +139,7 @@ gst_deinterlace_method_weave_class_init (GstDeinterlaceMethodWeaveClass * klass)
dism_class->copy_scanline_yvyu = copy_scanline_packed;
dism_class->copy_scanline_uyvy = copy_scanline_packed;
dism_class->copy_scanline_nv12 = copy_scanline_packed;
dism_class->copy_scanline_nv21 = copy_scanline_packed;
dism_class->copy_scanline_argb = copy_scanline_packed;
dism_class->copy_scanline_abgr = copy_scanline_packed;
dism_class->copy_scanline_rgba = copy_scanline_packed;

View file

@ -141,6 +141,7 @@ gst_deinterlace_method_weave_bff_class_init (GstDeinterlaceMethodWeaveBFFClass *
dism_class->interpolate_scanline_yvyu = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_uyvy = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_nv12 = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_nv21 = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_argb = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_abgr = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_rgba = deinterlace_scanline_weave_packed;
@ -159,6 +160,7 @@ gst_deinterlace_method_weave_bff_class_init (GstDeinterlaceMethodWeaveBFFClass *
dism_class->copy_scanline_yvyu = copy_scanline_packed;
dism_class->copy_scanline_uyvy = copy_scanline_packed;
dism_class->copy_scanline_nv12 = copy_scanline_packed;
dism_class->copy_scanline_nv21 = copy_scanline_packed;
dism_class->copy_scanline_argb = copy_scanline_packed;
dism_class->copy_scanline_abgr = copy_scanline_packed;
dism_class->copy_scanline_rgba = copy_scanline_packed;

View file

@ -142,6 +142,7 @@ gst_deinterlace_method_weave_tff_class_init (GstDeinterlaceMethodWeaveTFFClass *
dism_class->interpolate_scanline_yvyu = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_uyvy = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_nv12 = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_nv21 = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_argb = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_abgr = deinterlace_scanline_weave_packed;
dism_class->interpolate_scanline_rgba = deinterlace_scanline_weave_packed;
@ -160,6 +161,7 @@ gst_deinterlace_method_weave_tff_class_init (GstDeinterlaceMethodWeaveTFFClass *
dism_class->copy_scanline_yvyu = copy_scanline_packed;
dism_class->copy_scanline_uyvy = copy_scanline_packed;
dism_class->copy_scanline_nv12 = copy_scanline_packed;
dism_class->copy_scanline_nv21 = copy_scanline_packed;
dism_class->copy_scanline_argb = copy_scanline_packed;
dism_class->copy_scanline_abgr = copy_scanline_packed;
dism_class->copy_scanline_rgba = copy_scanline_packed;