# HG changeset patch # User michael # Date 1050720533 0 # Node ID 89da8ec89558711f1a5d3ec5b3ac9573a7056aaa # Parent 3548701a13fe138e168ae2f967bea459365ff7f4 vf_clone_mpi_attributes() diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf.c --- a/libmpcodecs/vf.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf.c Sat Apr 19 02:48:53 2003 +0000 @@ -422,6 +422,15 @@ return best; } +void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src){ + dst->pict_type= src->pict_type; + dst->qscale_type= src->qscale_type; + if(dst->width == src->width && dst->height == src->height){ + dst->qstride= src->qstride; + dst->qscale= src->qscale; + } +} + int vf_next_config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int voflags, unsigned int outfmt){ diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf.h --- a/libmpcodecs/vf.h Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf.h Sat Apr 19 02:48:53 2003 +0000 @@ -74,6 +74,7 @@ vf_instance_t* vf_open_encoder(vf_instance_t* next, char *name, char *args); unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred); +void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src); // default wrappers: int vf_next_config(struct vf_instance_s* vf, diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf_noise.c --- a/libmpcodecs/vf_noise.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf_noise.c Sat Apr 19 02:48:53 2003 +0000 @@ -351,8 +351,7 @@ noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam); noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam); - dmpi->qscale=mpi->qscale; - dmpi->qstride=mpi->qstride; + vf_clone_mpi_attributes(dmpi, mpi); #ifdef HAVE_MMX if(gCpuCaps.hasMMX) asm volatile ("emms\n\t"); diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf_scale.c --- a/libmpcodecs/vf_scale.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf_scale.c Sat Apr 19 02:48:53 2003 +0000 @@ -251,8 +251,7 @@ if(vf->priv->w==mpi->w && vf->priv->h==mpi->h){ // just conversion, no scaling -> keep postprocessing data // this way we can apply pp filter to non-yv12 source using scaler - dmpi->qscale=mpi->qscale; - dmpi->qstride=mpi->qstride; + vf_clone_mpi_attributes(dmpi, mpi); } if(vf->priv->palette) dmpi->planes[1]=vf->priv->palette; // export palette! diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf_swapuv.c --- a/libmpcodecs/vf_swapuv.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf_swapuv.c Sat Apr 19 02:48:53 2003 +0000 @@ -70,9 +70,7 @@ dmpi->width=mpi->width; } - dmpi->qscale=mpi->qscale; - dmpi->qstride=mpi->qstride; - dmpi->pict_type=mpi->pict_type; + vf_clone_mpi_attributes(dmpi, mpi); return vf_next_put_image(vf,dmpi); } diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf_unsharp.c --- a/libmpcodecs/vf_unsharp.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf_unsharp.c Sat Apr 19 02:48:53 2003 +0000 @@ -200,8 +200,7 @@ unsharp( dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam ); unsharp( dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam ); - dmpi->qscale = mpi->qscale; - dmpi->qstride = mpi->qstride; + vf_clone_mpi_attributes(dmpi, mpi); #ifdef HAVE_MMX if(gCpuCaps.hasMMX) diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf_yuy2.c --- a/libmpcodecs/vf_yuy2.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf_yuy2.c Sat Apr 19 02:48:53 2003 +0000 @@ -42,8 +42,7 @@ yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); - dmpi->qscale=mpi->qscale; - dmpi->qstride=mpi->qstride; + vf_clone_mpi_attributes(dmpi, mpi); return vf_next_put_image(vf,dmpi); } diff -r 3548701a13fe -r 89da8ec89558 libmpcodecs/vf_yvu9.c --- a/libmpcodecs/vf_yvu9.c Sat Apr 19 01:39:37 2003 +0000 +++ b/libmpcodecs/vf_yvu9.c Sat Apr 19 02:48:53 2003 +0000 @@ -55,8 +55,7 @@ for(x=0;xqscale=mpi->qscale; - dmpi->qstride=mpi->qstride; + vf_clone_mpi_attributes(dmpi, mpi); return vf_next_put_image(vf,dmpi); }