video: Fix height calculation for YUV9/YVU9
authorDavid Schleef <ds@schleef.org>
Thu, 24 Mar 2011 06:10:51 +0000 (23:10 -0700)
committerDavid Schleef <ds@schleef.org>
Fri, 1 Apr 2011 20:55:56 +0000 (13:55 -0700)
gst-libs/gst/video/video.c
tests/check/libs/video.c

index fd265a1..efb2e9f 100644 (file)
@@ -1926,9 +1926,9 @@ gst_video_format_get_component_offset (GstVideoFormat format,
       if (component == 0)
         return 0;
       if (component == 1)
-        return GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height);
+        return GST_ROUND_UP_4 (width) * height;
       if (component == 2) {
-        return GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height) +
+        return GST_ROUND_UP_4 (width) * height +
             GST_ROUND_UP_4 (GST_ROUND_UP_4 (width) / 4) *
             (GST_ROUND_UP_4 (height) / 4);
       }
index 34d28e0..dc5ef88 100644 (file)
@@ -424,14 +424,6 @@ GST_START_TEST (test_video_formats)
         off1 = gst_video_format_get_component_offset (fmt, 1, w, h);
         off2 = gst_video_format_get_component_offset (fmt, 2, w, h);
 
-        /* FIXME: for YUV9/YVU9 old videotestsrc code disagrees with new code
-         *  - figure out which is right */
-        if (fmt == GST_VIDEO_FORMAT_YUV9 || fmt == GST_VIDEO_FORMAT_YVU9) {
-          if (w == 1 && h == 1)
-            GST_ERROR ("FIXME: fix GST_VIDEO_FORMAT_YUV9/YVU9 size checks");
-          goto skip_check;
-        }
-
         fail_unless_equals_int (size, (unsigned long) paintinfo.endptr);
         fail_unless_equals_int (off0, (unsigned long) paintinfo.yp);
         fail_unless_equals_int (off1, (unsigned long) paintinfo.up);