[SDL] Re: Problem with small images and YUV overlay on Windows
Robert Folland
robert.folland at gmail.com
Sun Aug 7 23:00:20 PDT 2005
On 8/5/05, Bill May <wmay at cisco.com> wrote:
> Robert Folland wrote:
> > Hi, I'm new to the forum.
> >
> > I'm using SDL to display YUV images, and it works fine on both
> > Linux and Windows for images over a certain size. But on Windows
> > I get problems with image size 176x144 (QCIF). It works fine on Linux.
> > Exactly the same source file is used for Linux and Windows.
> >
> > Larges sizes (eg 352x288 and 704x576) work fine on both platforms.
> >
> > Is there a problem with allocating areas with dimensions not divisible by 32
> > on Windows?
>
> Sometime width != image->pitches[], especially with small sizes:
>
> if (width != m_image->pitches[0]) {
> // The width is not equal to the size in the SDL buffers -
> // we need to copy a row at a time
> to = (uint8_t *)m_image->pixels[0];
> from = y;
> for (ix = 0; ix < height; ix++) {
> memcpy(to, from, width);
> to += m_image->pitches[0];
> from += width;
> }
> } else {
> // Copy entire Y frame
> memcpy(m_image->pixels[0],
> y,
> bufsize);
> }
>
I'm now reading single bytes at a time from file, still the same problem.
More information about the SDL
mailing list