diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-24 19:01:01 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-24 19:01:01 +0000 |
commit | afca126ff7e1ccc16445c3598cd794bebe567ebc (patch) | |
tree | 81783b7f88135a9a730736e4ad861e5e32174c11 /libmpcodecs/vd.c | |
parent | 7d29c3856a8f220d269813e532760dae7e258709 (diff) | |
download | mpv-afca126ff7e1ccc16445c3598cd794bebe567ebc.tar.bz2 mpv-afca126ff7e1ccc16445c3598cd794bebe567ebc.tar.xz |
UV vs VU fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5316 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd.c')
-rw-r--r-- | libmpcodecs/vd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index f9f3e26c9d..64ffc48e80 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -245,7 +245,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf // Note: buffer allocation may be moved to mpcodecs_config_vo() later... mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h){ mp_image_t* mpi=NULL; - int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_STRIDE)?((w+15)&(~15)):w; + int w2=w; //(mp_imgflag&MP_IMGFLAG_ACCEPT_STRIDE)?((w+15)&(~15)):w; // Note: we should call libvo first to check if it supports direct rendering // and if not, then fallback to software buffers: switch(mp_imgtype){ @@ -301,8 +301,15 @@ mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, i // YV12/I420. feel free to add other planar formats here... if(!mpi->stride[0]) mpi->stride[0]=mpi->width; if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->width/2; - mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; - mpi->planes[2]=mpi->planes[1]+mpi->width*mpi->height/4; + if(mpi->flags&MP_IMGFLAG_SWAPPED){ + // I420/IYUV (Y,U,V) + mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; + mpi->planes[2]=mpi->planes[1]+(mpi->width>>1)*(mpi->height>>1); + } else { + // YV12,YVU9 (Y,V,U) + mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; + mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1); + } } else { if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; } |