A question regarding stride in YUV buffers

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

A question regarding stride in YUV buffers

Neil Young
Hi,

I'm referring to this documentation


Up to now I received namely I420 buffers with a size of 1.5*width/height, as expected default YUV size. 

video/x-raw, format=(string)I420, width=(int)720, height=(int)540, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)0/1;

Frame buffer size is 583200 byte.


Today for the first time I got this:

video/x-raw(memory:VASurface), format=(string)NV12, width=(int)720, height=(int)540, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)0/1

with a frame buffer size of 622080 byte, which is cleary more than 1.5 * w * h.

Now I'm wondering, how to understand the values of rstride and pstride in the above document. Could somebody help please?

TIA

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question regarding stride in YUV buffers

Neil Young
Correction for 1.5*width/height: 1.5 * width * height of course

Am 15.07.2019 um 19:46 schrieb Neil Young <[hidden email]>:

Hi,

I'm referring to this documentation


Up to now I received namely I420 buffers with a size of 1.5*width/height, as expected default YUV size. 

video/x-raw, format=(string)I420, width=(int)720, height=(int)540, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)0/1;

Frame buffer size is 583200 byte.


Today for the first time I got this:

video/x-raw(memory:VASurface), format=(string)NV12, width=(int)720, height=(int)540, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)0/1

with a frame buffer size of 622080 byte, which is cleary more than 1.5 * w * h.

Now I'm wondering, how to understand the values of rstride and pstride in the above document. Could somebody help please?

TIA


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question regarding stride in YUV buffers

Nicolas Dufresne-5
In reply to this post by Neil Young
Le lundi 15 juillet 2019 à 19:46 +0200, Neil Young a écrit :

> Hi,
>
> I'm referring to this documentation
>
> https://gstreamer.freedesktop.org/documentation/additional/design/mediatype-video-raw.html?gi-language=c
>
> Up to now I received namely I420 buffers with a size of 1.5*width/height, as expected default YUV size.
>
> video/x-raw, format=(string)I420, width=(int)720, height=(int)540, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)0/1;
>
> Frame buffer size is 583200 byte.
>
>
> Today for the first time I got this:
>
> video/x-raw(memory:VASurface), format=(string)NV12, width=(int)720, height=(int)540, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)0/1
>
> with a frame buffer size of 622080 byte, which is cleary more than 1.5 * w * h.
>
> Now I'm wondering, how to understand the values of rstride and pstride in the above document. Could somebody help please?
pstride only exist for simple pixel formats. It represent the distance
in bytes betwen two pixels. This value, when it exists, is constant for
a specific format.

rtstride (row stride), is the size, in bytes, of one two. In general,
it must be larger or equal to pstride * width, when pstride exist for
your format. This design document outline the calculation of the
default strides and offsets withing the libgstvideo library. Notice the
use of RU4 or RU2, which are round up, these are used to ensure the
each row starts on an align pointer. This simplify memory access in
software processing.

When you use VAAPI, you are using some HW accelerators. These
accelerators have wider memory alignment requirement, hence the end
results is that strides will be larger, and sometimes there will also
be couple of padding rows.

>
> TIA
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment