From 92928134cac847107f44826f179e88d5499e4c99 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 21 Sep 2009 18:49:42 +0200 Subject: [PATCH] [video] Fix Y41B Chroma components should be aligned on 4byte boundaries. https://bugzilla.gnome.org/show_bug.cgi?id=595849 --- gst-libs/gst/video/video.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index ab1d8c0..d4cdcc8 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -892,7 +892,7 @@ gst_video_format_get_row_stride (GstVideoFormat format, int component, if (component == 0) { return GST_ROUND_UP_4 (width); } else { - return GST_ROUND_UP_8 (width) / 4; + return GST_ROUND_UP_16 (width) / 4; } case GST_VIDEO_FORMAT_Y42B: if (component == 0) { @@ -1237,7 +1237,8 @@ gst_video_format_get_component_offset (GstVideoFormat format, int component, if (component == 1) return GST_ROUND_UP_4 (width) * height; if (component == 2) - return (GST_ROUND_UP_4 (width) + (GST_ROUND_UP_8 (width) / 4)) * height; + return (GST_ROUND_UP_4 (width) + + (GST_ROUND_UP_16 (width) / 4)) * height; return 0; case GST_VIDEO_FORMAT_Y42B: if (component == 0) @@ -1312,7 +1313,7 @@ gst_video_format_get_size (GstVideoFormat format, int width, int height) return GST_ROUND_UP_4 (width * 3) * height; case GST_VIDEO_FORMAT_Y41B: /* simplification of ROUNDUP4(w)*h + 2*((ROUNDUP8(w)/4)*h */ - return (GST_ROUND_UP_4 (width) + (GST_ROUND_UP_8 (width) / 2)) * height; + return (GST_ROUND_UP_4 (width) + (GST_ROUND_UP_16 (width) / 2)) * height; case GST_VIDEO_FORMAT_Y42B: /* simplification of ROUNDUP4(w)*h + 2*(ROUNDUP8(w)/2)*h: */ return (GST_ROUND_UP_4 (width) + GST_ROUND_UP_8 (width)) * height; -- 2.7.4