From 74323ca8bf08cad5281bc925af714af934c44e9c Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 23 Jun 2002 15:03:54 +0000 Subject: [PATCH] if09 support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6525 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf.c | 17 +++++++++++------ libmpcodecs/vf_yvu9.c | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 9e7608e840..0617c7b771 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -72,7 +72,7 @@ static vf_info_t* filter_list[]={ void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){ int y; if(mpi->flags&MP_IMGFLAG_PLANAR){ - int div = (mpi->imgfmt == IMGFMT_YVU9) ? 2 : 1; + int div = (mpi->imgfmt == IMGFMT_YVU9 || mpi->imgfmt == IMGFMT_IF09) ? 2 : 1; y0&=~1;h+=h&1; if(x0==0 && w==mpi->width){ // full width clear: @@ -164,14 +164,19 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, if(vf->get_image) vf->get_image(vf,mpi); if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ - // non-direct and not yet allocaed image. allocate it! - mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); + // non-direct and not yet allocated image. allocate it! + // IF09 - allocate space for 4. plane delta info - unused + if (mpi->imgfmt == IMGFMT_IF09) + mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ + (mpi->width>>2)*(mpi->height>>2)); + else + mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); if(mpi->flags&MP_IMGFLAG_PLANAR){ - // YV12/I420/YVU9. feel free to add other planar formats here... + // YV12/I420/YVU9/IF09. feel free to add other planar formats here... if(!mpi->stride[0]) mpi->stride[0]=mpi->width; if (!mpi->stride[1]) { - if (mpi->imgfmt == IMGFMT_YVU9) + if (mpi->imgfmt == IMGFMT_YVU9 || mpi->imgfmt == IMGFMT_IF09) mpi->stride[1]=mpi->stride[2]=mpi->width/4; else mpi->stride[1]=mpi->stride[2]=mpi->width/2; @@ -183,7 +188,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, } else { // YV12,YVU9 (Y,V,U) mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; - if (mpi->imgfmt == IMGFMT_YVU9) + if (mpi->imgfmt == IMGFMT_YVU9 || mpi->imgfmt == IMGFMT_IF09) mpi->planes[1]=mpi->planes[2]+(mpi->width>>2)*(mpi->height>>2); else mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1); diff --git a/libmpcodecs/vf_yvu9.c b/libmpcodecs/vf_yvu9.c index 6817f70bd5..7f66855f63 100644 --- a/libmpcodecs/vf_yvu9.c +++ b/libmpcodecs/vf_yvu9.c @@ -64,7 +64,7 @@ static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){ //===========================================================================// static int query_format(struct vf_instance_s* vf, unsigned int fmt){ - if (fmt == IMGFMT_YVU9) + if (fmt == IMGFMT_YVU9 || fmt == IMGFMT_IF09) return vf_next_query_format(vf,IMGFMT_YV12) & (~VFCAP_CSP_SUPPORTED_BY_HW); return 0; }