History

avfilter/vf_maskedclamp: make C version consistent with ASM one

In case of undefined behaviour.

Paul B Mahol committed 6 years ago

Commit 68416e41 parent 3b860bf1 file · +2 −6Browse files

Unified · Split

libavfilter/vf_maskedclamp.c+2−6
@@ -178,12 +178,8 @@ static void maskedclamp##name(const uint8_t *bbsrc, uint8_t *ddst, · 177 unmodified lines
178178 type *dst = (type *)ddst; \
179179 \
180180 for (int x = 0; x < w; x++) { \
181− if (bsrc[x] < darksrc[x] - undershoot) \
182− dst[x] = darksrc[x] - undershoot; \
183− else if (bsrc[x] > brightsrc[x] + overshoot) \
184− dst[x] = brightsrc[x] + overshoot; \
185− else \
186− dst[x] = bsrc[x]; \
181+ dst[x] = FFMAX(bsrc[x], darksrc[x] - undershoot); \
182+ dst[x] = FFMIN(dst[x], brightsrc[x] + overshoot); \
187183 } \
188184 }
189185

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