Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMina <minasamy_@hotmail.com>2018-08-14 21:56:51 +0300
committerThilo Borgmann <thilo.borgmann@mail.de>2018-08-14 21:56:51 +0300
commitf5559dd8694cbc28b8dbb501378270077f5a72b5 (patch)
treec4b52965dcc444a9200626883e0714c1e807ea86 /libavfilter/vf_colorconstancy.c
parent729ebd3cd001a5aeafbec3c36d9a6318c83f9053 (diff)
lavfi/vf_colorconstancy: cosmetic update
Diffstat (limited to 'libavfilter/vf_colorconstancy.c')
-rw-r--r--libavfilter/vf_colorconstancy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavfilter/vf_colorconstancy.c b/libavfilter/vf_colorconstancy.c
index e8271f34ec..e3bb39e51b 100644
--- a/libavfilter/vf_colorconstancy.c
+++ b/libavfilter/vf_colorconstancy.c
@@ -28,7 +28,6 @@
* J. van de Weijer, Th. Gevers, A. Gijsenij "Edge-Based Color Constancy".
*/
-#include "libavutil/bprint.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
@@ -42,6 +41,8 @@
#define GREY_EDGE "greyedge"
+#define SQRT3 1.73205080757
+
#define NUM_PLANES 3
#define MAX_DIFF_ORD 2
#define MAX_META_DATA 4
@@ -145,7 +146,7 @@ static int set_gauss(AVFilterContext *ctx)
sum1 = 0.0;
for (i = 0; i < filtersize; ++i) {
s->gauss[1][i] = - (GINDX(filtersize, i) / pow(sigma, 2)) * s->gauss[0][i];
- sum1 += s->gauss[1][i] *GINDX(filtersize, i);
+ sum1 += s->gauss[1][i] * GINDX(filtersize, i);
}
for (i = 0; i < filtersize; ++i) {
@@ -595,7 +596,6 @@ static int diagonal_transformation(AVFilterContext *ctx, void *arg, int jobnr, i
ThreadData *td = arg;
AVFrame *in = td->in;
AVFrame *out = td->out;
- double sqrt3 = pow(3.0, 0.5);
int plane;
for (plane = 0; plane < NUM_PLANES; ++plane) {
@@ -610,7 +610,7 @@ static int diagonal_transformation(AVFilterContext *ctx, void *arg, int jobnr, i
unsigned i;
for (i = slice_start; i < slice_end; ++i) {
- temp = src[i] / (s->white[plane] * sqrt3);
+ temp = src[i] / (s->white[plane] * SQRT3);
dst[i] = av_clip_uint8((int)(temp + 0.5));
}
}
@@ -657,12 +657,12 @@ static int config_props(AVFilterLink *inlink)
double sigma = s->sigma;
int ret;
- if (!sigma && s->difford) {
- av_log(ctx, AV_LOG_ERROR, "Sigma can't be set to 0 when difford > 0.\n");
+ if (!floor(break_off_sigma * sigma + 0.5) && s->difford) {
+ av_log(ctx, AV_LOG_ERROR, "floor(%f * sigma) must be > 0 when difford > 0.\n", break_off_sigma);
return AVERROR(EINVAL);
}
- s->filtersize = 2 * floor(break_off_sigma * s->sigma + 0.5) + 1;
+ s->filtersize = 2 * floor(break_off_sigma * sigma + 0.5) + 1;
if (ret=set_gauss(ctx)) {
return ret;
}