summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_expand.c')
-rw-r--r--libmpcodecs/vf_expand.c25
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),