deinterlace: small clean-ups
authorRobert Swain <robert.swain@collabora.co.uk>
Mon, 24 Jan 2011 11:18:39 +0000 (12:18 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 21 Feb 2011 20:14:19 +0000 (20:14 +0000)
Improve debug output by printing the buffer pointer when
popping a buffer and simplify code to use scanlines.bottom_field
as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=642691

gst/deinterlace/gstdeinterlace.c
gst/deinterlace/gstdeinterlacemethod.c

index 98c8247..f10f1bc 100644 (file)
@@ -770,8 +770,8 @@ gst_deinterlace_pop_history (GstDeinterlace * self)
 
   self->history_count--;
 
-  GST_DEBUG_OBJECT (self, "Returning buffer: %" GST_TIME_FORMAT
-      " with duration %" GST_TIME_FORMAT " and size %u",
+  GST_DEBUG_OBJECT (self, "Returning buffer: %p %" GST_TIME_FORMAT
+      " with duration %" GST_TIME_FORMAT " and size %u", buffer,
       GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)),
       GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)), GST_BUFFER_SIZE (buffer));
 
index 7228f01..a5d1058 100644 (file)
@@ -350,7 +350,7 @@ gst_deinterlace_simple_method_deinterlace_frame_packed (GstDeinterlaceMethod *
     memset (&scanlines, 0, sizeof (scanlines));
     scanlines.bottom_field = (cur_field_flags == PICTURE_INTERLACED_BOTTOM);
 
-    if (!((i & 1) ^ (cur_field_flags == PICTURE_INTERLACED_BOTTOM))) {
+    if (!((i & 1) ^ scanlines.bottom_field)) {
       /* copying */
       scanlines.tt0 = LINE2 (field0, (i - 2 >= 0) ? i - 2 : i);
       scanlines.m0 = LINE2 (field0, i);
@@ -453,7 +453,7 @@ static void
     memset (&scanlines, 0, sizeof (scanlines));
     scanlines.bottom_field = (cur_field_flags == PICTURE_INTERLACED_BOTTOM);
 
-    if (!((i & 1) ^ (cur_field_flags == PICTURE_INTERLACED_BOTTOM))) {
+    if (!((i & 1) ^ scanlines.bottom_field)) {
       /* copying */
       scanlines.tt0 = LINE2 (field0, (i - 2 >= 0) ? i - 2 : i);
       scanlines.m0 = LINE2 (field0, i);