[SDL] Problem with some SDL_Overlay sizes.
Vassili A Akimov
vasia at active-video.ru
Wed Oct 18 01:29:03 PDT 2006
> On 17 Oct 2006, at 14:17, Vassili A akimov wrote:
> > Hello!
> > My name is Vassili Akimov, I try to develop some program, which
> > utilize SDL.
> > I need to create some number of SDL_Overlays ( software overlays ) and
> > display them on the main surface. I found, that some x sizes,
> > provided to
> > SDL_CreateYUVOverlay, results "wrong" overlay, which being
> > displayed, shows
> > only part of the pixels it should.
> > For example if I try to create the software overlay 23x23 pixels, I
> > get some
> > overlay, wich shows only part of the pixels, I provide to it. To
> > illustrate
> > the problem, I made simple program, which creates SDL surface, than
> > creates
> > RGB surface 23x23 pixels. Than fill rgb surface with vertical rgb
> > stripes one
> > pixel wide. Than I create 10 overlays 23x23 convert rgb surface
> > data into
> > yv12 and fill overlay with this data, and display the overlays on main
> > surface.
> >
> > As the result, stripes occured to be diagonal, and only part to
> > destination
> > rectangle is displayed. If I change the overlay size to 22 pixels ( x
> > -direction ), everything turnes out correct. Can anyone help me
> > with this
> > situation?
>
> You can't have "nice" arbitrary size YV12 overlays because of
> subsampling: number of values stored for chroma components is 1/4 of
> number of pixels, so you want your overlays have even sizes (e.g.
> 24x24 or 22x22)
>
> I'm not sure what goes on when you request incompatible sizes, i
> would say "behaviour is unspecified" ;-)
Thanks, but is there any criteria to find out which size is "wrong"? So I can
correct it before creating the overlay?
This problem looks to my very odd, it appeares, that 23x22 pixels is "wrong"
size and 22x23 is correct one. This problem doesn't appear if I create the
hardware overlay. Which still YV12 and according to your explanation must be
displayed with "uncpecified behavior".
I can make workaround and avoid creating "wrong" overlays, if I would have
exact criteria which size is "wrong". Can you help me with that?
More information about the SDL
mailing list