scalerbob.c 4.76 KB
Newer Older
1
/*
2
 * Double lines
3
 * Copyright (C) 2008,2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
17 18
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
19 20 21 22 23 24
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

25
#include "gstdeinterlacemethod.h"
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#include <string.h>

#define GST_TYPE_DEINTERLACE_METHOD_SCALER_BOB	(gst_deinterlace_method_scaler_bob_get_type ())
#define GST_IS_DEINTERLACE_METHOD_SCALER_BOB(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEINTERLACE_METHOD_SCALER_BOB))
#define GST_IS_DEINTERLACE_METHOD_SCALER_BOB_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEINTERLACE_METHOD_SCALER_BOB))
#define GST_DEINTERLACE_METHOD_SCALER_BOB_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEINTERLACE_METHOD_SCALER_BOB, GstDeinterlaceMethodScalerBobClass))
#define GST_DEINTERLACE_METHOD_SCALER_BOB(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEINTERLACE_METHOD_SCALER_BOB, GstDeinterlaceMethodScalerBob))
#define GST_DEINTERLACE_METHOD_SCALER_BOB_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEINTERLACE_METHOD_SCALER_BOB, GstDeinterlaceMethodScalerBobClass))
#define GST_DEINTERLACE_METHOD_SCALER_BOB_CAST(obj)	((GstDeinterlaceMethodScalerBob*)(obj))

GType gst_deinterlace_method_scaler_bob_get_type (void);

typedef GstDeinterlaceSimpleMethod GstDeinterlaceMethodScalerBob;
typedef GstDeinterlaceSimpleMethodClass GstDeinterlaceMethodScalerBobClass;

static void
42
deinterlace_scanline_scaler_bob_packed (GstDeinterlaceSimpleMethod * self,
43
    guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
44
{
45
  memcpy (out, scanlines->t0, size);
46 47
}

48 49
static void
deinterlace_scanline_scaler_bob_planar_y (GstDeinterlaceSimpleMethod * self,
50
    guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
51
{
52
  memcpy (out, scanlines->t0, size);
53 54 55 56
}

static void
deinterlace_scanline_scaler_bob_planar_u (GstDeinterlaceSimpleMethod * self,
57
    guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
58
{
59
  memcpy (out, scanlines->t0, size);
60 61 62 63
}

static void
deinterlace_scanline_scaler_bob_planar_v (GstDeinterlaceSimpleMethod * self,
64
    guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
65
{
66
  memcpy (out, scanlines->t0, size);
67 68
}

69 70 71 72 73 74 75 76 77 78 79
G_DEFINE_TYPE (GstDeinterlaceMethodScalerBob, gst_deinterlace_method_scaler_bob,
    GST_TYPE_DEINTERLACE_SIMPLE_METHOD);

static void
gst_deinterlace_method_scaler_bob_class_init (GstDeinterlaceMethodScalerBobClass
    * klass)
{
  GstDeinterlaceMethodClass *dim_class = (GstDeinterlaceMethodClass *) klass;
  GstDeinterlaceSimpleMethodClass *dism_class =
      (GstDeinterlaceSimpleMethodClass *) klass;

80
  dim_class->fields_required = 2;
81 82
  dim_class->name = "Double lines";
  dim_class->nick = "scalerbob";
83
  dim_class->latency = 1;
84

85 86
  dism_class->interpolate_scanline_ayuv =
      deinterlace_scanline_scaler_bob_packed;
87 88 89 90
  dism_class->interpolate_scanline_yuy2 =
      deinterlace_scanline_scaler_bob_packed;
  dism_class->interpolate_scanline_yvyu =
      deinterlace_scanline_scaler_bob_packed;
91 92
  dism_class->interpolate_scanline_uyvy =
      deinterlace_scanline_scaler_bob_packed;
93 94
  dism_class->interpolate_scanline_nv12 =
      deinterlace_scanline_scaler_bob_packed;
95 96
  dism_class->interpolate_scanline_nv21 =
      deinterlace_scanline_scaler_bob_packed;
97 98 99 100 101 102 103 104 105 106
  dism_class->interpolate_scanline_argb =
      deinterlace_scanline_scaler_bob_packed;
  dism_class->interpolate_scanline_abgr =
      deinterlace_scanline_scaler_bob_packed;
  dism_class->interpolate_scanline_rgba =
      deinterlace_scanline_scaler_bob_packed;
  dism_class->interpolate_scanline_bgra =
      deinterlace_scanline_scaler_bob_packed;
  dism_class->interpolate_scanline_rgb = deinterlace_scanline_scaler_bob_packed;
  dism_class->interpolate_scanline_bgr = deinterlace_scanline_scaler_bob_packed;
107 108 109 110 111 112
  dism_class->interpolate_scanline_planar_y =
      deinterlace_scanline_scaler_bob_planar_y;
  dism_class->interpolate_scanline_planar_u =
      deinterlace_scanline_scaler_bob_planar_u;
  dism_class->interpolate_scanline_planar_v =
      deinterlace_scanline_scaler_bob_planar_v;
113 114 115 116 117 118
}

static void
gst_deinterlace_method_scaler_bob_init (GstDeinterlaceMethodScalerBob * self)
{
}