From: <tp...@ke...> - 2008-03-02 18:07:21
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: tpm Date: Sun Mar 02 2008 18:07:24 UTC Log message: * gst-libs/gst/video/video.c: (gst_video_format_get_component_offset): YV12 is I420 with swapped components 1 and 2, so the offset of component 1 for I420 should be the offset for component 2 for YV12 and vice versa. Modified files: . : ChangeLog gst-libs/gst/video: video.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.3786&r2=1.3787 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst-libs/gst/video/video.c.diff?r1=1.19&r2=1.20 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.3786 retrieving revision 1.3787 diff -u -d -r1.3786 -r1.3787 --- ChangeLog 29 Feb 2008 21:47:58 -0000 1.3786 +++ ChangeLog 2 Mar 2008 18:07:09 -0000 1.3787 @@ -1,3 +1,10 @@ +2008-03-02 Tim-Philipp Müller <tim at centricular dot net> + + * gst-libs/gst/video/video.c: (gst_video_format_get_component_offset): + YV12 is I420 with swapped components 1 and 2, so the offset of + component 1 for I420 should be the offset for component 2 for YV12 + and vice versa. 2008-02-29 Rene Stadler <ma...@re...> * sys/v4l/gstv4lelement.c: Index: video.c RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/video/video.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- video.c 22 Dec 2007 05:18:59 -0000 1.19 +++ video.c 2 Mar 2008 18:07:10 -0000 1.20 @@ -904,19 +904,27 @@ { switch (format) { case GST_VIDEO_FORMAT_I420: - case GST_VIDEO_FORMAT_YV12: - if (component == 0) { + if (component == 0) return 0; - } else { - int offset; - - offset = GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height); - if (component == 2) { - offset += GST_ROUND_UP_4 (GST_ROUND_UP_2 (width) / 2) * - (GST_ROUND_UP_2 (height) / 2); - } - return offset; + if (component == 1) + return GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height); + if (component == 2) { + return GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height) + + GST_ROUND_UP_4 (GST_ROUND_UP_2 (width) / 2) * + (GST_ROUND_UP_2 (height) / 2); } + return 0; + case GST_VIDEO_FORMAT_YV12: /* same as I420, but components 1+2 swapped */ + return 0; + if (component == 2) + if (component == 1) { + } case GST_VIDEO_FORMAT_YUY2: if (component == 0) |