[vlc-devel] [vlc-commits] commit: vmem: By default keep the original image aspect ratio. (Pierre d' Herbemont )

Pierre d'Herbemont pdherbemont at free.fr
Sun Oct 31 14:39:00 CET 2010


On Sun, Oct 31, 2010 at 2:16 PM, Laurent Aimar <fenrir at elivagar.org> wrote:
> Hi
>
> On Sun, Oct 31, 2010 at 02:05:00PM +0100, Pierre d'Herbemont wrote:
>> >> -    for (int i = 0; i < picture->i_planes; i++)
>> >> -        picture->p[i].p_pixels = planes[i];
>> >> +    const int y = sys->place.y;
>> >> +    const int x = sys->place.x;
>> >> +    const int pitch = sys->vmem_pitch;
>> >> +    const int bbp = pitch / sys->vmem_width;
>> >  This is wrong, the pitch is not a multiple of the width.
>>
>> No. "vmem pitch" doesn't include any extra trailer bytes.
>  Yes it can, the module handle it correctly. The only limitation is
> that the same pitch is used for each plane.

Huh? ok, I think I do understand, but this seems really creepy. Tell
me if I am mistaken.

Basically the vmem accept, a pitch, a width and a height. That means
that if we want to compute correctly the bpp, we must figure this out
from the pitch and the width. So this works only if the trailer bytes
in the pitch are inferior to the bytes per pixel count.

So, why do we bother with a pitch? This seems useless if we don't
directly pass along the bpp.

This would also means that the code would be just equivalent to what
you suggest?

>> > Use picture->p[i].i_pixel_pitch instead.
>> Nice shortcut. No idea this was even existing. Why don't we have bpp directly?
>  i_pixel_pitch is the number of bytes per pixel (per plane). So I don't understand
> your question.

So I do understand nothing. pixel pitch is what is generally called
the byte per pixel... This name could probably be clarified :)

Pierre.



More information about the vlc-devel mailing list