summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-19 02:48:53 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-19 02:48:53 +0000
commitf0626e2f8d8579e9491e98ec67e4c283a914180b (patch)
tree0e48e8b5115b0e49ad30b404e9a14cda5908501d /libmpcodecs
parent4188ea6e9990520aa475dd37b69935a78769bfb9 (diff)
downloadmpv-f0626e2f8d8579e9491e98ec67e4c283a914180b.tar.bz2
mpv-f0626e2f8d8579e9491e98ec67e4c283a914180b.tar.xz
vf_clone_mpi_attributes()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9935 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf.c9
-rw-r--r--libmpcodecs/vf.h1
-rw-r--r--libmpcodecs/vf_noise.c3
-rw-r--r--libmpcodecs/vf_scale.c3
-rw-r--r--libmpcodecs/vf_swapuv.c4
-rw-r--r--libmpcodecs/vf_unsharp.c3
-rw-r--r--libmpcodecs/vf_yuy2.c3
-rw-r--r--libmpcodecs/vf_yvu9.c3
8 files changed, 16 insertions, 13 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 56b176325d..3f237d7adb 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -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){
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index 1f21500ac7..f27eb22f36 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -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,
diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c
index d11178a100..453b4ced05 100644
--- a/libmpcodecs/vf_noise.c
+++ b/libmpcodecs/vf_noise.c
@@ -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");
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index cb2c323ec6..f92aac3fab 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -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!
diff --git a/libmpcodecs/vf_swapuv.c b/libmpcodecs/vf_swapuv.c
index d624bedc9e..fe16f3f6b0 100644
--- a/libmpcodecs/vf_swapuv.c
+++ b/libmpcodecs/vf_swapuv.c
@@ -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);
}
diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c
index 63248a77e6..b4fa47827f 100644
--- a/libmpcodecs/vf_unsharp.c
+++ b/libmpcodecs/vf_unsharp.c
@@ -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)
diff --git a/libmpcodecs/vf_yuy2.c b/libmpcodecs/vf_yuy2.c
index 9d60d9a38e..010e43c07d 100644
--- a/libmpcodecs/vf_yuy2.c
+++ b/libmpcodecs/vf_yuy2.c
@@ -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);
}
diff --git a/libmpcodecs/vf_yvu9.c b/libmpcodecs/vf_yvu9.c
index 6ab5a3399a..480b8a09f5 100644
--- a/libmpcodecs/vf_yvu9.c
+++ b/libmpcodecs/vf_yvu9.c
@@ -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);
}