| 1 |
|
| 2 |
|
| 3 |
> |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef __GST_DEINTERLACE_METHOD_H__ |
| 22 |
#define __GST_DEINTERLACE_METHOD_H__ |
| 23 |
|
| 24 |
#include <gst/gst.h> |
| 25 |
#include <gst/video/video.h> |
| 26 |
|
| 27 |
#if defined(HAVE_GCC_ASM) && defined(HAVE_ORC) |
| 28 |
#if defined(HAVE_CPU_I386) || defined(HAVE_CPU_X86_64) |
| 29 |
#define BUILD_X86_ASM |
| 30 |
#endif |
| 31 |
#endif |
| 32 |
|
| 33 |
G_BEGIN_DECLS |
| 34 |
|
| 35 |
#define GST_TYPE_DEINTERLACE_METHOD (gst_deinterlace_method_get_type ()) |
| 36 |
#define GST_IS_DEINTERLACE_METHOD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEINTERLACE_METHOD)) |
| 37 |
#define GST_IS_DEINTERLACE_METHOD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEINTERLACE_METHOD)) |
| 38 |
#define GST_DEINTERLACE_METHOD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEINTERLACE_METHOD, GstDeinterlaceMethodClass)) |
| 39 |
#define GST_DEINTERLACE_METHOD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEINTERLACE_METHOD, GstDeinterlaceMethod)) |
| 40 |
#define GST_DEINTERLACE_METHOD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEINTERLACE_METHOD, GstDeinterlaceMethodClass)) |
| 41 |
#define GST_DEINTERLACE_METHOD_CAST(obj) ((GstDeinterlaceMethod*)(obj)) |
| 42 |
|
| 43 |
typedef struct _GstDeinterlaceMethod GstDeinterlaceMethod; |
| 44 |
typedef struct _GstDeinterlaceMethodClass GstDeinterlaceMethodClass; |
| 45 |
|
| 46 |
|
| 47 |
#define PICTURE_PROGRESSIVE 0 |
| 48 |
#define PICTURE_INTERLACED_BOTTOM 1 |
| 49 |
#define PICTURE_INTERLACED_TOP 2 |
| 50 |
#define PICTURE_INTERLACED_MASK (PICTURE_INTERLACED_BOTTOM | PICTURE_INTERLACED_TOP) |
| 51 |
|
| 52 |
typedef struct |
| 53 |
{ |
| 54 |
GstVideoFrame *frame; |
| 55 |
|
| 56 |
guint flags; |
| 57 |
GstVideoTimeCode *tc; |
| 58 |
GstVideoCaptionMeta *caption; |
| 59 |
} GstDeinterlaceField; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
typedef void (*GstDeinterlaceMethodDeinterlaceFunction) ( |
| 66 |
GstDeinterlaceMethod *self, const GstDeinterlaceField *history, |
| 67 |
guint history_count, GstVideoFrame *outframe, int cur_field_idx); |
| 68 |
|
| 69 |
struct _GstDeinterlaceMethod { |
| 70 |
GstObject parent; |
| 71 |
|
| 72 |
GstVideoInfo *vinfo; |
| 73 |
|
| 74 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame; |
| 75 |
}; |
| 76 |
|
| 77 |
struct _GstDeinterlaceMethodClass { |
| 78 |
GstObjectClass parent_class; |
| 79 |
guint fields_required; |
| 80 |
guint latency; |
| 81 |
|
| 82 |
gboolean (*supported) (GstDeinterlaceMethodClass *klass, GstVideoFormat format, gint width, gint height); |
| 83 |
|
| 84 |
void (*setup) (GstDeinterlaceMethod *self, GstVideoInfo * vinfo); |
| 85 |
|
| 86 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_yuy2; |
| 87 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_yvyu; |
| 88 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_uyvy; |
| 89 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_i420; |
| 90 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_yv12; |
| 91 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_y444; |
| 92 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_y42b; |
| 93 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_y41b; |
| 94 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_ayuv; |
| 95 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_nv12; |
| 96 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_nv21; |
| 97 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_argb; |
| 98 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_abgr; |
| 99 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_rgba; |
| 100 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_bgra; |
| 101 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_rgb; |
| 102 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_bgr; |
| 103 |
|
| 104 |
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame_planar_high; |
| 105 |
|
| 106 |
const gchar *name; |
| 107 |
const gchar *nick; |
| 108 |
}; |
| 109 |
|
| 110 |
GType gst_deinterlace_method_get_type (void); |
| 111 |
|
| 112 |
gboolean gst_deinterlace_method_supported (GType type, GstVideoFormat format, gint width, gint height); |
| 113 |
void gst_deinterlace_method_setup (GstDeinterlaceMethod * self, GstVideoInfo * vinfo); |
| 114 |
void gst_deinterlace_method_deinterlace_frame (GstDeinterlaceMethod * self, const GstDeinterlaceField * history, guint history_count, GstVideoFrame * outframe, |
| 115 |
int cur_field_idx); |
| 116 |
gint gst_deinterlace_method_get_fields_required (GstDeinterlaceMethod * self); |
| 117 |
gint gst_deinterlace_method_get_latency (GstDeinterlaceMethod * self); |
| 118 |
|
| 119 |
#define GST_TYPE_DEINTERLACE_SIMPLE_METHOD (gst_deinterlace_simple_method_get_type ()) |
| 120 |
#define GST_IS_DEINTERLACE_SIMPLE_METHOD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEINTERLACE_SIMPLE_METHOD)) |
| 121 |
#define GST_IS_DEINTERLACE_SIMPLE_METHOD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEINTERLACE_SIMPLE_METHOD)) |
| 122 |
#define GST_DEINTERLACE_SIMPLE_METHOD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEINTERLACE_SIMPLE_METHOD, GstDeinterlaceSimpleMethodClass)) |
| 123 |
#define GST_DEINTERLACE_SIMPLE_METHOD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEINTERLACE_SIMPLE_METHOD, GstDeinterlaceSimpleMethod)) |
| 124 |
#define GST_DEINTERLACE_SIMPLE_METHOD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEINTERLACE_SIMPLE_METHOD, GstDeinterlaceSimpleMethodClass)) |
| 125 |
#define GST_DEINTERLACE_SIMPLE_METHOD_CAST(obj) ((GstDeinterlaceSimpleMethod*)(obj)) |
| 126 |
|
| 127 |
typedef struct _GstDeinterlaceSimpleMethod GstDeinterlaceSimpleMethod; |
| 128 |
typedef struct _GstDeinterlaceSimpleMethodClass GstDeinterlaceSimpleMethodClass; |
| 129 |
typedef struct _GstDeinterlaceScanlineData GstDeinterlaceScanlineData; |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
struct _GstDeinterlaceScanlineData { |
| 136 |
const guint8 *ttp, *tp, *mp, *bp, *bbp; |
| 137 |
const guint8 *tt0, *t0, *m0, *b0, *bb0; |
| 138 |
const guint8 *tt1, *t1, *m1, *b1, *bb1; |
| 139 |
const guint8 *tt2, *t2, *m2, *b2, *bb2; |
| 140 |
const guint8 *tp2, *bp2; |
| 141 |
gboolean bottom_field; |
| 142 |
}; |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
typedef void (*GstDeinterlaceSimpleMethodFunction) (GstDeinterlaceSimpleMethod *self, guint8 *out, const GstDeinterlaceScanlineData *scanlines, guint size); |
| 169 |
|
| 170 |
struct _GstDeinterlaceSimpleMethod { |
| 171 |
GstDeinterlaceMethod parent; |
| 172 |
|
| 173 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_packed; |
| 174 |
GstDeinterlaceSimpleMethodFunction copy_scanline_packed; |
| 175 |
|
| 176 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar[3]; |
| 177 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar[3]; |
| 178 |
}; |
| 179 |
|
| 180 |
struct _GstDeinterlaceSimpleMethodClass { |
| 181 |
GstDeinterlaceMethodClass parent_class; |
| 182 |
|
| 183 |
|
| 184 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_yuy2; |
| 185 |
GstDeinterlaceSimpleMethodFunction copy_scanline_yuy2; |
| 186 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_yvyu; |
| 187 |
GstDeinterlaceSimpleMethodFunction copy_scanline_yvyu; |
| 188 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_uyvy; |
| 189 |
GstDeinterlaceSimpleMethodFunction copy_scanline_uyvy; |
| 190 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_ayuv; |
| 191 |
GstDeinterlaceSimpleMethodFunction copy_scanline_ayuv; |
| 192 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_argb; |
| 193 |
GstDeinterlaceSimpleMethodFunction copy_scanline_argb; |
| 194 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_abgr; |
| 195 |
GstDeinterlaceSimpleMethodFunction copy_scanline_abgr; |
| 196 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_rgba; |
| 197 |
GstDeinterlaceSimpleMethodFunction copy_scanline_rgba; |
| 198 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_bgra; |
| 199 |
GstDeinterlaceSimpleMethodFunction copy_scanline_bgra; |
| 200 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_rgb; |
| 201 |
GstDeinterlaceSimpleMethodFunction copy_scanline_rgb; |
| 202 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_bgr; |
| 203 |
GstDeinterlaceSimpleMethodFunction copy_scanline_bgr; |
| 204 |
|
| 205 |
|
| 206 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_nv12; |
| 207 |
GstDeinterlaceSimpleMethodFunction copy_scanline_nv12; |
| 208 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_nv21; |
| 209 |
GstDeinterlaceSimpleMethodFunction copy_scanline_nv21; |
| 210 |
|
| 211 |
|
| 212 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_y; |
| 213 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar_y; |
| 214 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_u; |
| 215 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar_u; |
| 216 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_v; |
| 217 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar_v; |
| 218 |
|
| 219 |
|
| 220 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_y_16bits; |
| 221 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar_y_16bits; |
| 222 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_u_16bits; |
| 223 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar_u_16bits; |
| 224 |
GstDeinterlaceSimpleMethodFunction copy_scanline_planar_v_16bits; |
| 225 |
GstDeinterlaceSimpleMethodFunction interpolate_scanline_planar_v_16bits; |
| 226 |
}; |
| 227 |
|
| 228 |
GType gst_deinterlace_simple_method_get_type (void); |
| 229 |
|
| 230 |
G_END_DECLS |
| 231 |
|
| 232 |
#endif |