[Mplayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.79,1.80

Arpi arpi at thot.banki.hu
Sat Dec 28 01:13:53 CET 2002


Hi,

>      if(mpi->imgfmt==IMGFMT_I420 || mpi->imgfmt==IMGFMT_YV12 ||
> mpi->imgfmt==IMGFMT_IYUV){
> -        const int y_size= mpi->stride[0] * mpi->height;
> -        const int c_size= mpi->stride[1] * mpi->chroma_height;
> +        const int y_size= mpi->stride[0] * (mpi->h-1) + mpi->w;
> +        const int c_size= mpi->stride[1] * ((mpi->h>>1)-1) + (mpi->w>>1);

some comments on this:

it failed for evry case when image expanded in horizontal direction only.
why?

normal case:
Y plane size = w*h, followed by U and V
U = Y + w*h, stride[0]==w, -> assert(Y+stride[0]*h<=U) ok.

expand case:
stride == expanded size. the image is centered (shifted to right) so teh
pointers passed to lavc are shifted:
xpos = buffer width (stride[0]) - image width (w)
Y' = Y + xpos
U' = U + (xpos/2)
-> assert(Y'+stride[0]*h<=U') fails (it thinks the buffer is smaller by
xpos-(xpos/2) bytes than should be, but it's bad, teh image is not as wide
as stride.

hope it's clear :)


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-cvslog mailing list