mirror of
https://github.com/mpv-player/mpv
synced 2024-12-20 22:02:59 +00:00
vf_clone_mpi_attributes()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9935 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4188ea6e99
commit
f0626e2f8d
@ -422,6 +422,15 @@ unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int pr
|
||||
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){
|
||||
|
@ -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);
|
||||
|
||||
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,
|
||||
|
@ -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[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");
|
||||
|
@ -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){
|
||||
// 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!
|
||||
|
@ -70,9 +70,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
|
||||
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);
|
||||
}
|
||||
|
@ -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[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)
|
||||
|
@ -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],
|
||||
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);
|
||||
}
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
dmpi->qscale=mpi->qscale;
|
||||
dmpi->qstride=mpi->qstride;
|
||||
vf_clone_mpi_attributes(dmpi, mpi);
|
||||
|
||||
return vf_next_put_image(vf,dmpi);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user