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
156156 int j;
157157
158158 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);
160160 }
161161
162162 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 · 13 unmodified lines
176176 int j;
177177
178178 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);
180180 }
181181
182182 static 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