History

avfilter/vf_fftdnoiz: round toward nearest integer

Instead of rounding toward zero and thus producing darker output.

Paul B Mahol committed 7 years ago

Commit 26876fd1 parent a60232a1 file · +2 −2Browse files

Unified · Split

libavfilter/vf_fftdnoiz.c+2−2
@@ -156,7 +156,7 @@ static void export_row8(FFTComplex *src, uint8_t *dst, int rw, float scale, int · 155 unmodified lines
156 int j;156 int j;
157 157
158 for (j = 0; j < rw; j++)158 for (j = 0; j < rw; j++)
159 dst[j] = av_clip_uint8(src[j].re * scale);159 dst[j] = av_clip_uint8(src[j].re * scale + 0.5f);
160}160}
161 161
162static void import_row16(FFTComplex *dst, uint8_t *srcp, int rw)162static 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 · 13 unmodified lines
176 int j;176 int j;
177 177
178 for (j = 0; j < rw; j++)178 for (j = 0; j < rw; j++)
179 dst[j] = av_clip_uintp2_c(src[j].re * scale, depth);179 dst[j] = av_clip_uintp2_c(src[j].re * scale + 0.5f, depth);
180}180}
181 181
182static int config_input(AVFilterLink *inlink)182static int config_input(AVFilterLink *inlink)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t