summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_unsharp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_unsharp.c')
-rw-r--r--libmpcodecs/vf_unsharp.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c
index b4fa47827f..40b993139a 100644
--- a/libmpcodecs/vf_unsharp.c
+++ b/libmpcodecs/vf_unsharp.c
@@ -61,7 +61,6 @@ typedef struct FilterParam {
struct vf_priv_s {
FilterParam lumaParam;
FilterParam chromaParam;
- mp_image_t *dmpi;
unsigned int outfmt;
};
@@ -175,15 +174,15 @@ static void get_image( struct vf_instance_s* vf, mp_image_t *mpi ) {
if( mpi->imgfmt!=vf->priv->outfmt )
return; // colorspace differ
- vf->priv->dmpi = vf_get_image( vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h );
- mpi->planes[0] = vf->priv->dmpi->planes[0];
- mpi->stride[0] = vf->priv->dmpi->stride[0];
- mpi->width = vf->priv->dmpi->width;
+ vf->dmpi = vf_get_image( vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h );
+ mpi->planes[0] = vf->dmpi->planes[0];
+ mpi->stride[0] = vf->dmpi->stride[0];
+ mpi->width = vf->dmpi->width;
if( mpi->flags & MP_IMGFLAG_PLANAR ) {
- mpi->planes[1] = vf->priv->dmpi->planes[1];
- mpi->planes[2] = vf->priv->dmpi->planes[2];
- mpi->stride[1] = vf->priv->dmpi->stride[1];
- mpi->stride[2] = vf->priv->dmpi->stride[2];
+ mpi->planes[1] = vf->dmpi->planes[1];
+ mpi->planes[2] = vf->dmpi->planes[2];
+ mpi->stride[1] = vf->dmpi->stride[1];
+ mpi->stride[2] = vf->dmpi->stride[2];
}
mpi->flags |= MP_IMGFLAG_DIRECT;
}
@@ -193,8 +192,8 @@ static int put_image( struct vf_instance_s* vf, mp_image_t *mpi ) {
if( !(mpi->flags & MP_IMGFLAG_DIRECT) )
// no DR, so get a new image! hope we'll get DR buffer:
- vf->priv->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h);
- dmpi= vf->priv->dmpi;
+ vf->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h);
+ dmpi= vf->dmpi;
unsharp( dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam );
unsharp( dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam );