diff options
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/mp_image.h | 1 | ||||
-rw-r--r-- | libmpcodecs/vd_dshow.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vd_xanim.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_expand.c | 25 | ||||
-rw-r--r-- | libmpcodecs/vf_format.c | 3 |
5 files changed, 32 insertions, 1 deletions
diff --git a/libmpcodecs/mp_image.h b/libmpcodecs/mp_image.h index b99dbf2b89..9bc7a12765 100644 --- a/libmpcodecs/mp_image.h +++ b/libmpcodecs/mp_image.h @@ -76,6 +76,7 @@ static inline void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){ mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=12; return; + case IMGFMT_IF09: case IMGFMT_YVU9: mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=9; diff --git a/libmpcodecs/vd_dshow.c b/libmpcodecs/vd_dshow.c index a0f8738c85..90ec4fb741 100644 --- a/libmpcodecs/vd_dshow.c +++ b/libmpcodecs/vd_dshow.c @@ -67,6 +67,8 @@ static int init(sh_video_t *sh){ case IMGFMT_I420: case IMGFMT_IYUV: DS_VideoDecoder_SetDestFmt(sh->context,12,out_fmt);break; // planar YUV + case IMGFMT_YVU9: + DS_VideoDecoder_SetDestFmt(sh->context,9,out_fmt);break; default: DS_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0); // RGB/BGR } diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index 55f44cfedc..df603f8dad 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -28,7 +28,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ // init driver static int init(sh_video_t *sh){ - if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format)) return 0; + if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12)) return 0; return xacodec_init_video(sh,sh->codec->outfmt[sh->outfmtidx]); } 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), diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c index 6b06b6c7c6..b9cdd89fc6 100644 --- a/libmpcodecs/vf_format.c +++ b/libmpcodecs/vf_format.c @@ -31,12 +31,15 @@ static int open(vf_instance_t *vf, char* args){ if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else + if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else + if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else + if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else { printf("Unknown format name: '%s'\n",args);return 0;} } else vf->priv->fmt=IMGFMT_YUY2; |