Skip to content
Snippets Groups Projects
Commit 530bf8ec authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avfilter/vf_eq: Fix clipping code

parent 5a1e524b
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@ static void process_c(EQParameters *param, uint8_t *dst, int dst_stride,
for (x = 0; x < w; x++) {
pel = ((src[y * src_stride + x] * contrast) >> 12) + brightness;
if (pel & 768)
if (pel & ~255)
pel = (-pel) >> 31;
dst[y * dst_stride + x] = pel;
......
......@@ -72,7 +72,7 @@ static void process_MMX(EQParameters *param, uint8_t *dst, int dst_stride,
for (i = w&7; i; i--) {
pel = ((*src++ * contrast) >> 12) + brightness;
if (pel & 768)
if (pel & ~255)
pel = (-pel) >> 31;
*dst++ = pel;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment