[video] Fix Y41B

Chroma components should be aligned on 4byte boundaries.

https://bugzilla.gnome.org/show_bug.cgi?id=595849
This commit is contained in:
Benjamin Otte 2009-09-21 18:49:42 +02:00
parent a0a66e8ceb
commit 92928134ca

View file

@ -892,7 +892,7 @@ gst_video_format_get_row_stride (GstVideoFormat format, int component,
if (component == 0) { if (component == 0) {
return GST_ROUND_UP_4 (width); return GST_ROUND_UP_4 (width);
} else { } else {
return GST_ROUND_UP_8 (width) / 4; return GST_ROUND_UP_16 (width) / 4;
} }
case GST_VIDEO_FORMAT_Y42B: case GST_VIDEO_FORMAT_Y42B:
if (component == 0) { if (component == 0) {
@ -1237,7 +1237,8 @@ gst_video_format_get_component_offset (GstVideoFormat format, int component,
if (component == 1) if (component == 1)
return GST_ROUND_UP_4 (width) * height; return GST_ROUND_UP_4 (width) * height;
if (component == 2) 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; return 0;
case GST_VIDEO_FORMAT_Y42B: case GST_VIDEO_FORMAT_Y42B:
if (component == 0) 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; return GST_ROUND_UP_4 (width * 3) * height;
case GST_VIDEO_FORMAT_Y41B: case GST_VIDEO_FORMAT_Y41B:
/* simplification of ROUNDUP4(w)*h + 2*((ROUNDUP8(w)/4)*h */ /* 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: case GST_VIDEO_FORMAT_Y42B:
/* simplification of ROUNDUP4(w)*h + 2*(ROUNDUP8(w)/2)*h: */ /* simplification of ROUNDUP4(w)*h + 2*(ROUNDUP8(w)/2)*h: */
return (GST_ROUND_UP_4 (width) + GST_ROUND_UP_8 (width)) * height; return (GST_ROUND_UP_4 (width) + GST_ROUND_UP_8 (width)) * height;