YUV420p buffer plane alignmentg.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

YUV420p buffer plane alignmentg.

Thibault Jochem
Hi,

I'm working with an YUV buffer taken from a fake sink, and I have some
troubles to find the right data alignment.

For "standard" resolution, it's ok, but with Big Buck Bunny 480p for
example, which is 854x480 there is some kind of alignment :

I figured out that for U and V buffer, each row is aligned to
even-numbered bytes (as buffers are 427x240).

But I'm still missing something, as my total buffer size is 616320b
(reported by gstreamer), whereas my datas + alignment weight 615360b
..... so I'm still missing 960b

I also noticed that by U and V buffer are "offsetted" .... so I guess
that there is some padding between buffers ... but I'd like to know
exactly what's going on.

Kind regards,
--
Thibault Jochem

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: YUV420p buffer plane alignmentg.

Tim-Philipp Müller-2
On Wed, 2010-02-24 at 11:54 +0100, Thibault Jochem wrote:

Hi,

> I'm working with an YUV buffer taken from a fake sink, and I have some
> troubles to find the right data alignment.
>
> For "standard" resolution, it's ok, but with Big Buck Bunny 480p for
> example, which is 854x480 there is some kind of alignment :
>
> I figured out that for U and V buffer, each row is aligned to
> even-numbered bytes (as buffers are 427x240).
>
> But I'm still missing something, as my total buffer size is 616320b
> (reported by gstreamer), whereas my datas + alignment weight 615360b
> ..... so I'm still missing 960b
>
> I also noticed that by U and V buffer are "offsetted" .... so I guess
> that there is some padding between buffers ... but I'd like to know
> exactly what's going on.

libgstvideo in -base has a few helper functions for this, e.g.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideo.html#gst-video-format-get-component-offset

Cheers
 -Tim




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: YUV420p buffer plane alignmentg.

Benjamin Otte
In reply to this post by Thibault Jochem
The solution here is to use the GStreamer video library (provided by
gst-plugins-base, pkgconfig name gstreamer-video-0.10, which provides
helper functions for getting this right in gstreamer/video/video.h

Cheers,
Benjamin


On Wed, 2010-02-24 at 11:54 +0100, Thibault Jochem wrote:

> Hi,
>
> I'm working with an YUV buffer taken from a fake sink, and I have some
> troubles to find the right data alignment.
>
> For "standard" resolution, it's ok, but with Big Buck Bunny 480p for
> example, which is 854x480 there is some kind of alignment :
>
> I figured out that for U and V buffer, each row is aligned to
> even-numbered bytes (as buffers are 427x240).
>
> But I'm still missing something, as my total buffer size is 616320b
> (reported by gstreamer), whereas my datas + alignment weight 615360b
> ..... so I'm still missing 960b
>
> I also noticed that by U and V buffer are "offsetted" .... so I guess
> that there is some padding between buffers ... but I'd like to know
> exactly what's going on.
>
> Kind regards,
> --
> Thibault Jochem
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel