diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-06-22 23:05:00 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-06-22 23:05:00 +0000 |
commit | 7f025d4e466287f008467a7e8c417a504662d301 (patch) | |
tree | e868c9a3a334f5b727170ec875a1731e8c628542 /libmpcodecs | |
parent | cb7f0c8feb7ba4ce2064e4cf1b18e2f5788d1bd9 (diff) | |
download | mpv-7f025d4e466287f008467a7e8c417a504662d301.tar.bz2 mpv-7f025d4e466287f008467a7e8c417a504662d301.tar.xz |
use built-in yvu9->yv12 code, because it requires all src/dst strides and
offsets, the params passed to postproc's converter is simply not enough...
(temp. solution, waiting for yvu9 support in swscale)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6505 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_yvu9.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libmpcodecs/vf_yvu9.c b/libmpcodecs/vf_yvu9.c index b7ad27a8c0..6817f70bd5 100644 --- a/libmpcodecs/vf_yvu9.c +++ b/libmpcodecs/vf_yvu9.c @@ -29,16 +29,32 @@ static int config(struct vf_instance_s* vf, static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){ mp_image_t *dmpi; + int y,w,h; // hope we'll get DR buffer: dmpi=vf_get_image(vf->next,IMGFMT_YV12, MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/, mpi->w, mpi->h); - yvu9toyv12(mpi->planes[0],mpi->planes[1],mpi->planes[2], - dmpi->planes[0], dmpi->planes[1], dmpi->planes[2], mpi->w, mpi->h, - dmpi->stride[0], dmpi->stride[1]); - + for(y=0;y<mpi->h;y++) + memcpy(dmpi->planes[0]+dmpi->stride[0]*y, + mpi->planes[0]+mpi->stride[0]*y, + mpi->w); + + w=mpi->w/4; h=mpi->h/2; + for(y=0;y<h;y++){ + unsigned char* s=mpi->planes[1]+mpi->stride[1]*(y>>1); + unsigned char* d=dmpi->planes[1]+dmpi->stride[1]*y; + int x; + for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; + } + for(y=0;y<h;y++){ + unsigned char* s=mpi->planes[2]+mpi->stride[2]*(y>>1); + unsigned char* d=dmpi->planes[2]+dmpi->stride[2]*y; + int x; + for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; + } + dmpi->qscale=mpi->qscale; dmpi->qstride=mpi->qstride; |