vf_clone_mpi_attributes()

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9935 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2003-04-19 02:48:53 +00:00
parent 4188ea6e99
commit f0626e2f8d
8 changed files with 16 additions and 13 deletions

View File

@ -422,6 +422,15 @@ unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int pr
return best; 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 vf_next_config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height, int width, int height, int d_width, int d_height,
unsigned int voflags, unsigned int outfmt){ unsigned int voflags, unsigned int outfmt){

View File

@ -74,6 +74,7 @@ vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char **args);
vf_instance_t* vf_open_encoder(vf_instance_t* next, char *name, char *args); 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); 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: // default wrappers:
int vf_next_config(struct vf_instance_s* vf, int vf_next_config(struct vf_instance_s* vf,

View File

@ -351,8 +351,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
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[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); 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; vf_clone_mpi_attributes(dmpi, mpi);
dmpi->qstride=mpi->qstride;
#ifdef HAVE_MMX #ifdef HAVE_MMX
if(gCpuCaps.hasMMX) asm volatile ("emms\n\t"); if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");

View File

@ -251,8 +251,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
if(vf->priv->w==mpi->w && vf->priv->h==mpi->h){ if(vf->priv->w==mpi->w && vf->priv->h==mpi->h){
// just conversion, no scaling -> keep postprocessing data // just conversion, no scaling -> keep postprocessing data
// this way we can apply pp filter to non-yv12 source using scaler // this way we can apply pp filter to non-yv12 source using scaler
dmpi->qscale=mpi->qscale; vf_clone_mpi_attributes(dmpi, mpi);
dmpi->qstride=mpi->qstride;
} }
if(vf->priv->palette) dmpi->planes[1]=vf->priv->palette; // export palette! if(vf->priv->palette) dmpi->planes[1]=vf->priv->palette; // export palette!

View File

@ -70,9 +70,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
dmpi->width=mpi->width; dmpi->width=mpi->width;
} }
dmpi->qscale=mpi->qscale; vf_clone_mpi_attributes(dmpi, mpi);
dmpi->qstride=mpi->qstride;
dmpi->pict_type=mpi->pict_type;
return vf_next_put_image(vf,dmpi); return vf_next_put_image(vf,dmpi);
} }

View File

@ -200,8 +200,7 @@ static int put_image( struct vf_instance_s* vf, mp_image_t *mpi ) {
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[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 ); 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; vf_clone_mpi_attributes(dmpi, mpi);
dmpi->qstride = mpi->qstride;
#ifdef HAVE_MMX #ifdef HAVE_MMX
if(gCpuCaps.hasMMX) if(gCpuCaps.hasMMX)

View File

@ -42,8 +42,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], 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]); mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]);
dmpi->qscale=mpi->qscale; vf_clone_mpi_attributes(dmpi, mpi);
dmpi->qstride=mpi->qstride;
return vf_next_put_image(vf,dmpi); return vf_next_put_image(vf,dmpi);
} }

View File

@ -55,8 +55,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];
} }
dmpi->qscale=mpi->qscale; vf_clone_mpi_attributes(dmpi, mpi);
dmpi->qstride=mpi->qstride;
return vf_next_put_image(vf,dmpi); return vf_next_put_image(vf,dmpi);
} }