summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_smartblur.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_smartblur.c')
-rw-r--r--libmpcodecs/vf_smartblur.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libmpcodecs/vf_smartblur.c b/libmpcodecs/vf_smartblur.c
index ebe18dc840..a5a1265111 100644
--- a/libmpcodecs/vf_smartblur.c
+++ b/libmpcodecs/vf_smartblur.c
@@ -97,11 +97,11 @@ static int allocStuff(FilterParam *f, int width, int height){
static int config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
-
+
int sw, sh;
allocStuff(&vf->priv->luma, width, height);
-
+
getSubSampleFactors(&sw, &sh, outfmt);
allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
@@ -132,14 +132,14 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride,
int dstStrideArray[MP_MAX_PLANES]= {dstStride};
sws_scale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
-
+
if(f.threshold > 0){
for(y=0; y<h; y++){
for(x=0; x<w; x++){
const int orig= src[x + y*srcStride];
const int filtered= dst[x + y*dstStride];
const int diff= orig - filtered;
-
+
if(diff > 0){
if(diff > 2*f.threshold){
dst[x + y*dstStride]= orig;
@@ -161,7 +161,7 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride,
const int orig= src[x + y*srcStride];
const int filtered= dst[x + y*dstStride];
const int diff= orig - filtered;
-
+
if(diff > 0){
if(diff > -2*f.threshold){
}else if(diff > -f.threshold){
@@ -191,11 +191,11 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
mpi->w,mpi->h);
assert(mpi->flags&MP_IMGFLAG_PLANAR);
-
+
blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
blur(dmpi->planes[1], mpi->planes[1], cw , ch , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
blur(dmpi->planes[2], mpi->planes[2], cw , ch , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
-
+
return vf_next_put_image(vf,dmpi, pts);
}
@@ -228,7 +228,7 @@ static int open(vf_instance_t *vf, char* args){
memset(vf->priv, 0, sizeof(struct vf_priv_s));
if(args==NULL) return 0;
-
+
e=sscanf(args, "%f:%f:%d:%f:%f:%d",
&vf->priv->luma.radius,
&vf->priv->luma.strength,
@@ -239,7 +239,7 @@ static int open(vf_instance_t *vf, char* args){
);
vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
-
+
if(e==3){
vf->priv->chroma.radius= vf->priv->luma.radius;
vf->priv->chroma.strength= vf->priv->luma.strength;