summaryrefslogtreecommitdiffstats
path: root/gst/deinterlace2
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-04-16 17:41:37 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-05-13 10:34:04 +0200
commitb9659ac68b241d75e34bc4003467742127b65b6a (patch)
treea1a2678bcb9bbcacf034ee48d107856d35dcf120 /gst/deinterlace2
parent3354937f0588b3ed561293d8710fa7f110df016d (diff)
[MOVED FROM BAD 50/56] deinterlace2: Rename line_length to row_stride and remove output_stride
Diffstat (limited to 'gst/deinterlace2')
-rw-r--r--gst/deinterlace2/gstdeinterlace2.c36
-rw-r--r--gst/deinterlace2/gstdeinterlace2.h14
-rw-r--r--gst/deinterlace2/tvtime/greedy.c22
-rw-r--r--gst/deinterlace2/tvtime/greedyh.c22
-rw-r--r--gst/deinterlace2/tvtime/scalerbob.c2
-rw-r--r--gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll.inc4
-rw-r--r--gst/deinterlace2/tvtime/weave.c4
-rw-r--r--gst/deinterlace2/tvtime/weavebff.c6
-rw-r--r--gst/deinterlace2/tvtime/weavetff.c6
9 files changed, 58 insertions, 58 deletions
diff --git a/gst/deinterlace2/gstdeinterlace2.c b/gst/deinterlace2/gstdeinterlace2.c
index 02afc7a2..7bbe2494 100644
--- a/gst/deinterlace2/gstdeinterlace2.c
+++ b/gst/deinterlace2/gstdeinterlace2.c
@@ -1,7 +1,7 @@
/*
* GStreamer
* Copyright (C) 2005 Martin Eikermann <meiker@upb.de>
- * Copyright (C) 2008 Sebastian Dröge <slomo@collabora.co.uk>
+ * Copyright (C) 2008-2009 Sebastian Dröge <slomo@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -104,7 +104,7 @@ gst_deinterlace_simple_method_interpolate_scanline (GstDeinterlaceMethod * self,
GstDeinterlace2 * parent, guint8 * out,
GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->m1, parent->line_length);
+ oil_memcpy (out, scanlines->m1, parent->row_stride);
}
static void
@@ -112,7 +112,7 @@ gst_deinterlace_simple_method_copy_scanline (GstDeinterlaceMethod * self,
GstDeinterlace2 * parent, guint8 * out,
GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->m0, parent->line_length);
+ oil_memcpy (out, scanlines->m0, parent->row_stride);
}
static void
@@ -143,12 +143,12 @@ gst_deinterlace_simple_method_deinterlace_frame (GstDeinterlaceMethod * self,
if (cur_field_flags == PICTURE_INTERLACED_BOTTOM) {
/* double the first scanline of the bottom field */
- oil_memcpy (out, field0, parent->line_length);
- out += parent->output_stride;
+ oil_memcpy (out, field0, parent->row_stride);
+ out += parent->row_stride;
}
- oil_memcpy (out, field0, parent->line_length);
- out += parent->output_stride;
+ oil_memcpy (out, field0, parent->row_stride);
+ out += parent->row_stride;
for (line = 2; line <= parent->field_height; line++) {
@@ -189,7 +189,7 @@ gst_deinterlace_simple_method_deinterlace_frame (GstDeinterlaceMethod * self,
dsm_class->interpolate_scanline (self, parent, out, &scanlines,
parent->frame_width);
- out += parent->output_stride;
+ out += parent->row_stride;
memset (&scanlines, 0, sizeof (scanlines));
scanlines.bottom_field = (cur_field_flags == PICTURE_INTERLACED_BOTTOM);
@@ -227,12 +227,12 @@ gst_deinterlace_simple_method_deinterlace_frame (GstDeinterlaceMethod * self,
dsm_class->copy_scanline (self, parent, out, &scanlines,
parent->frame_width);
- out += parent->output_stride;
+ out += parent->row_stride;
}
if (cur_field_flags == PICTURE_INTERLACED_TOP) {
/* double the last scanline of the top field */
- oil_memcpy (out, field0, parent->line_length);
+ oil_memcpy (out, field0, parent->row_stride);
}
}
@@ -570,8 +570,7 @@ gst_deinterlace2_reset_history (GstDeinterlace2 * self)
static void
gst_deinterlace2_reset (GstDeinterlace2 * self)
{
- self->output_stride = 0;
- self->line_length = 0;
+ self->row_stride = 0;
self->frame_width = 0;
self->frame_height = 0;
self->frame_rate_n = 0;
@@ -719,13 +718,13 @@ gst_deinterlace2_push_history (GstDeinterlace2 * self, GstBuffer * buffer)
GST_DEBUG ("Top field first");
field1 = gst_buffer_ref (buffer);
field1_flags = PICTURE_INTERLACED_TOP;
- field2 = gst_buffer_create_sub (buffer, self->line_length,
- GST_BUFFER_SIZE (buffer) - self->line_length);
+ field2 = gst_buffer_create_sub (buffer, self->row_stride,
+ GST_BUFFER_SIZE (buffer) - self->row_stride);
field2_flags = PICTURE_INTERLACED_BOTTOM;
} else {
GST_DEBUG ("Bottom field first");
- field1 = gst_buffer_create_sub (buffer, self->line_length,
- GST_BUFFER_SIZE (buffer) - self->line_length);
+ field1 = gst_buffer_create_sub (buffer, self->row_stride,
+ GST_BUFFER_SIZE (buffer) - self->row_stride);
field1_flags = PICTURE_INTERLACED_BOTTOM;
field2 = gst_buffer_ref (buffer);
field2_flags = PICTURE_INTERLACED_TOP;
@@ -1132,7 +1131,6 @@ gst_deinterlace2_setcaps (GstPad * pad, GstCaps * caps)
goto caps_not_accepted;
gst_caps_unref (othercaps);
- /* TODO: introduce self->field_stride */
self->field_height = self->frame_height / 2;
fmt = gst_video_format_from_fourcc (fourcc);
@@ -1141,11 +1139,9 @@ gst_deinterlace2_setcaps (GstPad * pad, GstCaps * caps)
change when the buffer-fields concept has landed */
self->field_stride =
gst_video_format_get_row_stride (fmt, 0, self->frame_width) * 2;
- self->output_stride =
- gst_video_format_get_row_stride (fmt, 0, self->frame_width);
/* in bytes */
- self->line_length =
+ self->row_stride =
gst_video_format_get_row_stride (fmt, 0, self->frame_width);
self->frame_size =
gst_video_format_get_size (fmt, self->frame_width, self->frame_height);
diff --git a/gst/deinterlace2/gstdeinterlace2.h b/gst/deinterlace2/gstdeinterlace2.h
index ee40504b..1d2c3e1a 100644
--- a/gst/deinterlace2/gstdeinterlace2.h
+++ b/gst/deinterlace2/gstdeinterlace2.h
@@ -1,7 +1,7 @@
/*
* GStreamer
* Copyright (C) 2005 Martin Eikermann <meiker@upb.de>
- * Copyright (C) 2008 Sebastian Dröge <slomo@collabora.co.uk>
+ * Copyright (C) 2008-2009 Sebastian Dröge <slomo@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -187,12 +187,19 @@ typedef enum
GST_DEINTERLACE2_LAYOUT_BFF
} GstDeinterlace2FieldLayout;
+typedef enum {
+ GST_DEINTERLACE2_MODE_AUTO,
+ GST_DEINTERLACE2_MODE_INTERLACED
+} GstDeinterlace2Mode;
+
struct _GstDeinterlace2
{
GstElement parent;
GstPad *srcpad, *sinkpad;
+ GstDeinterlace2Mode mode;
+
GstDeinterlace2FieldLayout field_layout;
guint frame_size;
@@ -215,14 +222,11 @@ struct _GstDeinterlace2
GstPicture field_history[MAX_FIELD_HISTORY];
guint history_count;
- /* Overlay pitch (number of bytes between scanlines). */
- guint output_stride;
-
/* Number of bytes of actual data in each scanline. May be less than
OverlayPitch since the overlay's scanlines might have alignment
requirements. Generally equal to FrameWidth * 2.
*/
- guint line_length;
+ guint row_stride;
/* Number of pixels in each scanline. */
gint frame_width;
diff --git a/gst/deinterlace2/tvtime/greedy.c b/gst/deinterlace2/tvtime/greedy.c
index f364c094..7d4e4b3a 100644
--- a/gst/deinterlace2/tvtime/greedy.c
+++ b/gst/deinterlace2/tvtime/greedy.c
@@ -365,8 +365,8 @@ deinterlace_frame_di_greedy (GstDeinterlaceMethod * d_method,
GST_BUFFER_DATA (object->field_history[object->history_count - 3].buf);
// copy first even line
- oil_memcpy (Dest, L1, object->line_length);
- Dest += object->output_stride;
+ oil_memcpy (Dest, L1, object->row_stride);
+ Dest += object->row_stride;
} else {
InfoIsOdd = 0;
L1 = GST_BUFFER_DATA (object->field_history[object->history_count - 2].buf);
@@ -379,18 +379,18 @@ deinterlace_frame_di_greedy (GstDeinterlaceMethod * d_method,
// copy first even line
oil_memcpy (Dest, GST_BUFFER_DATA (object->field_history[0].buf),
- object->line_length);
- Dest += object->output_stride;
+ object->row_stride);
+ Dest += object->row_stride;
// then first odd line
- oil_memcpy (Dest, L1, object->line_length);
- Dest += object->output_stride;
+ oil_memcpy (Dest, L1, object->row_stride);
+ Dest += object->row_stride;
}
for (Line = 0; Line < (object->field_height - 1); ++Line) {
- klass->scanline (self, L2, L1, L3, L2P, Dest, object->line_length);
- Dest += object->output_stride;
- oil_memcpy (Dest, L3, object->line_length);
- Dest += object->output_stride;
+ klass->scanline (self, L2, L1, L3, L2P, Dest, object->row_stride);
+ Dest += object->row_stride;
+ oil_memcpy (Dest, L3, object->row_stride);
+ Dest += object->row_stride;
L1 += Pitch;
L2 += Pitch;
@@ -399,7 +399,7 @@ deinterlace_frame_di_greedy (GstDeinterlaceMethod * d_method,
}
if (InfoIsOdd) {
- oil_memcpy (Dest, L2, object->line_length);
+ oil_memcpy (Dest, L2, object->row_stride);
}
}
diff --git a/gst/deinterlace2/tvtime/greedyh.c b/gst/deinterlace2/tvtime/greedyh.c
index 0b4dc463..a5aafd18 100644
--- a/gst/deinterlace2/tvtime/greedyh.c
+++ b/gst/deinterlace2/tvtime/greedyh.c
@@ -266,8 +266,8 @@ deinterlace_frame_di_greedyh (GstDeinterlaceMethod * d_method,
GST_BUFFER_DATA (object->field_history[object->history_count - 3].buf);
// copy first even line
- oil_memcpy (Dest, L1, object->line_length);
- Dest += object->output_stride;
+ oil_memcpy (Dest, L1, object->row_stride);
+ Dest += object->row_stride;
} else {
InfoIsOdd = 0;
L1 = GST_BUFFER_DATA (object->field_history[object->history_count - 2].buf);
@@ -280,18 +280,18 @@ deinterlace_frame_di_greedyh (GstDeinterlaceMethod * d_method,
// copy first even line
oil_memcpy (Dest, GST_BUFFER_DATA (object->field_history[0].buf),
- object->line_length);
- Dest += object->output_stride;
+ object->row_stride);
+ Dest += object->row_stride;
// then first odd line
- oil_memcpy (Dest, L1, object->line_length);
- Dest += object->output_stride;
+ oil_memcpy (Dest, L1, object->row_stride);
+ Dest += object->row_stride;
}
for (Line = 0; Line < (object->field_height - 1); ++Line) {
- klass->scanline (self, L1, L2, L3, L2P, Dest, object->line_length);
- Dest += object->output_stride;
- oil_memcpy (Dest, L3, object->line_length);
- Dest += object->output_stride;
+ klass->scanline (self, L1, L2, L3, L2P, Dest, object->row_stride);
+ Dest += object->row_stride;
+ oil_memcpy (Dest, L3, object->row_stride);
+ Dest += object->row_stride;
L1 += Pitch;
L2 += Pitch;
@@ -300,7 +300,7 @@ deinterlace_frame_di_greedyh (GstDeinterlaceMethod * d_method,
}
if (InfoIsOdd) {
- oil_memcpy (Dest, L2, object->line_length);
+ oil_memcpy (Dest, L2, object->row_stride);
}
}
diff --git a/gst/deinterlace2/tvtime/scalerbob.c b/gst/deinterlace2/tvtime/scalerbob.c
index b2546e23..a37792ab 100644
--- a/gst/deinterlace2/tvtime/scalerbob.c
+++ b/gst/deinterlace2/tvtime/scalerbob.c
@@ -46,7 +46,7 @@ deinterlace_scanline_scaler_bob (GstDeinterlaceMethod * self,
GstDeinterlace2 * parent, guint8 * out,
GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->t0, parent->line_length);
+ oil_memcpy (out, scanlines->t0, parent->row_stride);
}
G_DEFINE_TYPE (GstDeinterlaceMethodScalerBob, gst_deinterlace_method_scaler_bob,
diff --git a/gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll.inc b/gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll.inc
index f014aeb4..89ed39e4 100644
--- a/gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll.inc
+++ b/gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll.inc
@@ -80,8 +80,8 @@ void FUNCT_NAME(GstDeinterlaceMethod *d_method, GstDeinterlace2* object, GstBuff
/* double stride do address just every odd/even scanline */
src_pitch = object->field_stride;
- dst_pitch = object->output_stride;
- rowsize = object->line_length;
+ dst_pitch = object->row_stride;
+ rowsize = object->row_stride;
FldHeight = object->field_height;
pCopySrc = GST_BUFFER_DATA(object->field_history[object->history_count-1].buf);
diff --git a/gst/deinterlace2/tvtime/weave.c b/gst/deinterlace2/tvtime/weave.c
index da0c79a1..09732a3a 100644
--- a/gst/deinterlace2/tvtime/weave.c
+++ b/gst/deinterlace2/tvtime/weave.c
@@ -47,14 +47,14 @@ deinterlace_scanline_weave (GstDeinterlaceMethod * self,
GstDeinterlace2 * parent, guint8 * out,
GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->m1, parent->line_length);
+ oil_memcpy (out, scanlines->m1, parent->row_stride);
}
static void
copy_scanline (GstDeinterlaceMethod * self, GstDeinterlace2 * parent,
guint8 * out, GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->m0, parent->line_length);
+ oil_memcpy (out, scanlines->m0, parent->row_stride);
}
G_DEFINE_TYPE (GstDeinterlaceMethodWeave, gst_deinterlace_method_weave,
diff --git a/gst/deinterlace2/tvtime/weavebff.c b/gst/deinterlace2/tvtime/weavebff.c
index 2da05bdc..4ddf5a51 100644
--- a/gst/deinterlace2/tvtime/weavebff.c
+++ b/gst/deinterlace2/tvtime/weavebff.c
@@ -47,7 +47,7 @@ deinterlace_scanline_weave (GstDeinterlaceMethod * self,
GstDeinterlace2 * parent, guint8 * out,
GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->m1, parent->line_length);
+ oil_memcpy (out, scanlines->m1, parent->row_stride);
}
static void
@@ -56,9 +56,9 @@ copy_scanline (GstDeinterlaceMethod * self, GstDeinterlace2 * parent,
{
/* FIXME: original code used m2 and m0 but this looks really bad */
if (scanlines->bottom_field) {
- oil_memcpy (out, scanlines->bb2, parent->line_length);
+ oil_memcpy (out, scanlines->bb2, parent->row_stride);
} else {
- oil_memcpy (out, scanlines->bb0, parent->line_length);
+ oil_memcpy (out, scanlines->bb0, parent->row_stride);
}
}
diff --git a/gst/deinterlace2/tvtime/weavetff.c b/gst/deinterlace2/tvtime/weavetff.c
index 0b941a05..9411f51b 100644
--- a/gst/deinterlace2/tvtime/weavetff.c
+++ b/gst/deinterlace2/tvtime/weavetff.c
@@ -47,7 +47,7 @@ deinterlace_scanline_weave (GstDeinterlaceMethod * self,
GstDeinterlace2 * parent, guint8 * out,
GstDeinterlaceScanlineData * scanlines, gint width)
{
- oil_memcpy (out, scanlines->m1, parent->line_length);
+ oil_memcpy (out, scanlines->m1, parent->row_stride);
}
static void
@@ -56,9 +56,9 @@ copy_scanline (GstDeinterlaceMethod * self, GstDeinterlace2 * parent,
{
/* FIXME: original code used m2 and m0 but this looks really bad */
if (scanlines->bottom_field) {
- oil_memcpy (out, scanlines->bb0, parent->line_length);
+ oil_memcpy (out, scanlines->bb0, parent->row_stride);
} else {
- oil_memcpy (out, scanlines->bb2, parent->line_length);
+ oil_memcpy (out, scanlines->bb2, parent->row_stride);
}
}