commit eabf429b8405a3c120b2409d20f6ec6329ef0589
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Fri Jan 20 10:38:23 2017 +0100
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Fri Jan 20 10:38:23 2017 +0100
blind-guass-blur: check that the SD is positive
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/src/blind-gauss-blur.c b/src/blind-gauss-blur.c
index 174afb0..d974a53 100644
--- a/src/blind-gauss-blur.c
+++ b/src/blind-gauss-blur.c
_AT_@ -135,8 +135,8 @@ process_xyza(char *restrict output, char *restrict cbuf, char *restrict sbuf,
if (chroma || measure_y_only) {\
k[0] = sig[i1][1] * sig[i1][3];\
if (auto_spread)\
- spread = (size_t)(k[0] * 3 + 0.5);\
- blur[2] = blur[0] = !!k[0];\
+ spread = k[0] > 0 ? (size_t)(k[0] * 3 + 0.5) : 0;\
+ blur[2] = blur[0] = k[0] > 0;\
c[0] = k[0] *= k[0] * 2, c[0] = sqrt(c[0] * M_PI);\
k[0] = 1 / -k[0], c[0] = 1 / c[0];\
if (chroma) {\
_AT_@ -154,15 +154,17 @@ process_xyza(char *restrict output, char *restrict cbuf, char *restrict sbuf,
spread = 0;\
for (i = 0; i < 3; i++) {\
k[i] = sig[i1][i] * sig[i1][3];\
- if (auto_spread && spread < (size_t)(k[i] * 3 + 0.5))\
+ if (auto_spread && k[i] > 0 && spread < (size_t)(k[i] * 3 + 0.5))\
spread = (size_t)(k[i] * 3 + 0.5);\
- blur[i] = !!k[i];\
+ blur[i] = k[i] > 0;\
c[i] = k[i] *= k[i] * 2, c[i] = sqrt(c[i] * M_PI);\
k[i] = 1 / -k[i], c[i] = 1 / c[i];\
}\
}\
if (blur[0] + blur[1] + blur[2] == 0)\
- goto no_blur_##DIR;
+ goto no_blur_##DIR;\
+ if (spread < 1)\
+ spread = 1;
#define BLUR_PIXEL(START, LOOP, DISTANCE)\
if (k[0] == k[1] && k[1] == k[2]) {\
Received on Fri Jan 20 2017 - 10:38:32 CET
This archive was generated by hypermail 2.3.0
: Fri Jan 20 2017 - 10:48:19 CET