Mercurial > mplayer.hg
changeset 6525:0a7be46617d8
yvu9 and if09 support
author | alex |
---|---|
date | Sun, 23 Jun 2002 15:15:31 +0000 |
parents | 05cd2cf758e4 |
children | 561de0125a61 |
files | libmpcodecs/mp_image.h libmpcodecs/vd_dshow.c libmpcodecs/vd_xanim.c libmpcodecs/vf_expand.c libmpcodecs/vf_format.c |
diffstat | 5 files changed, 32 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpcodecs/mp_image.h Sun Jun 23 15:03:54 2002 +0000 +++ b/libmpcodecs/mp_image.h Sun Jun 23 15:15:31 2002 +0000 @@ -76,6 +76,7 @@ mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=12; return; + case IMGFMT_IF09: case IMGFMT_YVU9: mpi->flags|=MP_IMGFLAG_PLANAR; mpi->bpp=9;
--- a/libmpcodecs/vd_dshow.c Sun Jun 23 15:03:54 2002 +0000 +++ b/libmpcodecs/vd_dshow.c Sun Jun 23 15:15:31 2002 +0000 @@ -67,6 +67,8 @@ 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 }
--- a/libmpcodecs/vd_xanim.c Sun Jun 23 15:03:54 2002 +0000 +++ b/libmpcodecs/vd_xanim.c Sun Jun 23 15:15:31 2002 +0000 @@ -28,7 +28,7 @@ // 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]); }
--- a/libmpcodecs/vf_expand.c Sun Jun 23 15:03:54 2002 +0000 +++ b/libmpcodecs/vf_expand.c Sun Jun 23 15:15:31 2002 +0000 @@ -146,6 +146,7 @@ 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 @@ 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 @@ 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 @@ (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),
--- a/libmpcodecs/vf_format.c Sun Jun 23 15:03:54 2002 +0000 +++ b/libmpcodecs/vf_format.c Sun Jun 23 15:15:31 2002 +0000 @@ -31,12 +31,15 @@ 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;