diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-06-23 15:15:31 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-06-23 15:15:31 +0000 |
commit | 78191f35e99bc7a1cec550466fe312f8139b2b1f (patch) | |
tree | 27b8afd2df61b0b35ba67667c6e8113ab7b9345c /libmpcodecs/vf_expand.c | |
parent | 74323ca8bf08cad5281bc925af714af934c44e9c (diff) | |
download | mpv-78191f35e99bc7a1cec550466fe312f8139b2b1f.tar.bz2 mpv-78191f35e99bc7a1cec550466fe312f8139b2b1f.tar.xz |
yvu9 and if09 support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6526 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_expand.c')
-rw-r--r-- | libmpcodecs/vf_expand.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c index b612ab390d..3329e86250 100644 --- a/libmpcodecs/vf_expand.c +++ b/libmpcodecs/vf_expand.c @@ -146,6 +146,7 @@ static void draw_osd(struct vf_instance_s* vf_,int w,int h){ static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ + if (outfmt == IMGFMT_IF09) return 0; // calculate the missing parameters: #if 0 if(vf->priv->exp_w<width) vf->priv->exp_w=width; @@ -194,10 +195,20 @@ static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ if(mpi->flags&MP_IMGFLAG_PLANAR){ mpi->planes[0]=vf->priv->dmpi->planes[0]+ vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x; + if (mpi->imgfmt == IMGFMT_YVU9) + { + mpi->planes[1]=vf->priv->dmpi->planes[1]+ + (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>2); + mpi->planes[2]=vf->priv->dmpi->planes[2]+ + (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>2); + } + else + { mpi->planes[1]=vf->priv->dmpi->planes[1]+ (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>1); mpi->planes[2]=vf->priv->dmpi->planes[2]+ (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>1); + } mpi->stride[1]=vf->priv->dmpi->stride[1]; mpi->stride[2]=vf->priv->dmpi->stride[2]; } else { @@ -231,6 +242,19 @@ static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){ vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x, mpi->planes[0], mpi->w, mpi->h, vf->priv->dmpi->stride[0],mpi->stride[0]); + if (mpi->imgfmt == IMGFMT_YVU9) + { + memcpy_pic(vf->priv->dmpi->planes[1]+ + (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>2), + mpi->planes[1], mpi->w>>2, mpi->h>>2, + vf->priv->dmpi->stride[1],mpi->stride[1]); + memcpy_pic(vf->priv->dmpi->planes[2]+ + (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>2), + mpi->planes[2], mpi->w>>2, mpi->h>>2, + vf->priv->dmpi->stride[2],mpi->stride[2]); + } + else + { memcpy_pic(vf->priv->dmpi->planes[1]+ (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>1), mpi->planes[1], mpi->w>>1, mpi->h>>1, @@ -239,6 +263,7 @@ static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){ (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>1), mpi->planes[2], mpi->w>>1, mpi->h>>1, vf->priv->dmpi->stride[2],mpi->stride[2]); + } } else { memcpy_pic(vf->priv->dmpi->planes[0]+ vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x*(vf->priv->dmpi->bpp/8), |