YUV buffer pstride and rstride clarification needed
nicolas at ndufresne.ca
Tue Jul 16 01:12:32 UTC 2019
Le lundi 15 juillet 2019 à 14:52 -0700, David Ing a écrit :
> I hope someone can correct me if I am wrong, but I am guessing that
> pstride = pixel stride (i.e. the number of bytes per pixel)
> rstride = row stride (i.e. the number of bytes per row of pixels)
> Suppose I want to find the pixel (row=y, column=x), then I should look at the following location within the byte array:
> y * rstride + x * pstride
> Keep in mind that I am a complete novice ... this is just a guess.
Well, clearly you know enough to read this, since this is correct
(appart the pstride does not exist for all formats).
> On Mon, Jul 15, 2019 at 2:45 PM Neil Young <foreverneilyoung at googlemail.com> wrote:
> > 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.
> > Caps:
> > 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:
> > Caps:
> > 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 more than 1.5 * width * height.
> > 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
> > gstreamer-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: This is a digitally signed message part
More information about the gstreamer-devel