mirror of
https://github.com/mpv-player/mpv
synced 2025-05-01 15:50:33 +00:00
yuv handling simplified (using new mpi fields)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6668 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b19296cc7e
commit
42be919947
@ -64,23 +64,17 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
|||||||
// TODO !!!
|
// TODO !!!
|
||||||
mpi->planes[0]=data;
|
mpi->planes[0]=data;
|
||||||
mpi->stride[0]=mpi->width;
|
mpi->stride[0]=mpi->width;
|
||||||
if(mpi->bpp == 12 && mpi->flags&MP_IMGFLAG_YUV) {
|
if(mpi->flags&MP_IMGFLAG_YUV) {
|
||||||
// Support for some common Planar YUV formats
|
// Support for some common Planar YUV formats
|
||||||
/* YV12,I420,IYUV */
|
/* YV12,I420,IYUV */
|
||||||
int cb=2, cr=1;
|
int cb=2, cr=1;
|
||||||
if(mpi->flags&MP_IMGFLAG_SWAPPED) {
|
if(mpi->flags&MP_IMGFLAG_SWAPPED) {
|
||||||
cb=1; cr=2;
|
cb=1; cr=2;
|
||||||
}
|
}
|
||||||
mpi->planes[cb]=data+mpi->width*mpi->height;
|
mpi->planes[cb]=mpi->planes[0]+mpi->width*mpi->height;
|
||||||
mpi->stride[cb]=mpi->width/2;
|
mpi->stride[cb]=mpi->chroma_width;
|
||||||
mpi->planes[cr]=data+5*mpi->width*mpi->height/4;
|
mpi->planes[cr]=mpi->planes[cb]+mpi->chroma_width*mpi->chroma_height;
|
||||||
mpi->stride[cr]=mpi->width/2;
|
mpi->stride[cr]=mpi->chroma_width;
|
||||||
}
|
|
||||||
else if (mpi->bpp==9 && mpi->flags&MP_IMGFLAG_YUV) {
|
|
||||||
/* YVU9 ! */
|
|
||||||
mpi->stride[1]=mpi->stride[2]=mpi->width/4;
|
|
||||||
mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
|
|
||||||
mpi->planes[1]=mpi->planes[2]+(mpi->width>>2)*(mpi->height>>2);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mpi->planes[0]=data;
|
mpi->planes[0]=data;
|
||||||
@ -95,4 +89,3 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
|||||||
|
|
||||||
return mpi;
|
return mpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user