mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
video-dither: remove check for below zero for unsigned value
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative number since it is an unsigned integer. Removing that check and only checking if it is bigger than max and setting it appropriately. CID 1256559
This commit is contained in:
parent
23880ec874
commit
6992da94b0
1 changed files with 5 additions and 5 deletions
|
@ -97,7 +97,7 @@ dither_verterr_u16 (GstVideoDither * dither, gpointer pixels, guint x, guint y,
|
|||
e[i] = v & mp;
|
||||
/* quantize and store */
|
||||
v &= ~mp;
|
||||
p[i] = CLAMP (v, 0, 65535);
|
||||
p[i] = MIN (v, 65535);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ dither_floyd_steinberg_u8 (GstVideoDither * dither, gpointer pixels, guint x,
|
|||
e[i + 4] = v & mp;
|
||||
/* quantize and store */
|
||||
v &= ~mp;
|
||||
p[i] = CLAMP (v, 0, 255);
|
||||
p[i] = MIN (v, 255);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -162,7 +162,7 @@ dither_floyd_steinberg_u16 (GstVideoDither * dither, gpointer pixels, guint x,
|
|||
e[i + 4] = v & mp;
|
||||
/* quantize and store */
|
||||
v &= ~mp;
|
||||
p[i] = CLAMP (v, 0, 65535);
|
||||
p[i] = MIN (v, 65535);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ dither_sierra_lite_u8 (GstVideoDither * dither, gpointer pixels, guint x,
|
|||
e[i + 4] = v & mp;
|
||||
/* quantize and store */
|
||||
v &= ~mp;
|
||||
p[i] = CLAMP (v, 0, 255);
|
||||
p[i] = MIN (v, 255);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ dither_sierra_lite_u16 (GstVideoDither * dither, gpointer pixels, guint x,
|
|||
e[i + 4] = v & mp;
|
||||
/* quantize and store */
|
||||
v &= ~mp;
|
||||
p[i] = CLAMP (v & ~mp, 0, 65535);
|
||||
p[i] = MIN (v & ~mp, 65535);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue