diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-08-31 20:45:06 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-08-31 20:45:06 +0000 |
commit | d169756b83ab07b13602f87054d7e99095dfc34b (patch) | |
tree | 6199dfe3ce7671948deb6c97a4855ad26e06ee99 /libmpcodecs/vd_raw.c | |
parent | 94b4a47fa4a7d52dbe09dfc4426f3bb778954315 (diff) |
basic nv12 and nv21 support by Angelo Cano <angelo_cano@fastmail.fm>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10743 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd_raw.c')
-rw-r--r-- | libmpcodecs/vd_raw.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libmpcodecs/vd_raw.c b/libmpcodecs/vd_raw.c index 90689c3f35..407bcec7e6 100644 --- a/libmpcodecs/vd_raw.c +++ b/libmpcodecs/vd_raw.c @@ -68,13 +68,18 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mpi->planes[0]=data; mpi->stride[0]=mpi->width; frame_size=mpi->stride[0]*mpi->h; - if(mpi->flags&MP_IMGFLAG_YUV) { + if((mpi->imgfmt == IMGFMT_NV12) || (mpi->imgfmt == IMGFMT_NV21)) + { + mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; + mpi->stride[1]=mpi->chroma_width; + frame_size+=mpi->chroma_width*mpi->chroma_height; + } else if(mpi->flags&MP_IMGFLAG_YUV) { + int cb=2, cr=1; + if(mpi->flags&MP_IMGFLAG_SWAPPED) { + cb=1; cr=2; + } // Support for some common Planar YUV formats /* YV12,I420,IYUV */ - int cb=2, cr=1; - if(mpi->flags&MP_IMGFLAG_SWAPPED) { - cb=1; cr=2; - } mpi->planes[cb]=mpi->planes[0]+mpi->width*mpi->height; mpi->stride[cb]=mpi->chroma_width; mpi->planes[cr]=mpi->planes[cb]+mpi->chroma_width*mpi->chroma_height; |