Commit 26876fdb authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_fftdnoiz: round toward nearest integer

Instead of rounding toward zero and thus producing
darker output.
parent a60232ab
...@@ -156,7 +156,7 @@ static void export_row8(FFTComplex *src, uint8_t *dst, int rw, float scale, int ...@@ -156,7 +156,7 @@ static void export_row8(FFTComplex *src, uint8_t *dst, int rw, float scale, int
int j; int j;
for (j = 0; j < rw; j++) for (j = 0; j < rw; j++)
dst[j] = av_clip_uint8(src[j].re * scale); dst[j] = av_clip_uint8(src[j].re * scale + 0.5f);
} }
static void import_row16(FFTComplex *dst, uint8_t *srcp, int rw) static void import_row16(FFTComplex *dst, uint8_t *srcp, int rw)
...@@ -176,7 +176,7 @@ static void export_row16(FFTComplex *src, uint8_t *dstp, int rw, float scale, in ...@@ -176,7 +176,7 @@ static void export_row16(FFTComplex *src, uint8_t *dstp, int rw, float scale, in
int j; int j;
for (j = 0; j < rw; j++) for (j = 0; j < rw; j++)
dst[j] = av_clip_uintp2_c(src[j].re * scale, depth); dst[j] = av_clip_uintp2_c(src[j].re * scale + 0.5f, depth);
} }
static int config_input(AVFilterLink *inlink) static int config_input(AVFilterLink *inlink)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment