mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 21:12:26 +00:00
videoscaler: 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 a division of an unsigned integer (i). Removing that check and only checking if it is bigger than max and setting it appropriately. CID #1308950
This commit is contained in:
parent
c5dbee33b0
commit
6e263cc5f6
1 changed files with 2 additions and 2 deletions
|
@ -1145,12 +1145,12 @@ gst_video_scaler_combine_packed_YUV (GstVideoScaler * y_scale,
|
|||
gint ic;
|
||||
|
||||
if ((i & 1) == scale->out_y_offset) {
|
||||
ic = CLAMP (i / 2, 0, y_scale->resampler.out_size - 1);
|
||||
ic = MIN (i / 2, y_scale->resampler.out_size - 1);
|
||||
offset[i] = y_scale->resampler.offset[ic] * 2 + scale->in_y_offset;
|
||||
memcpy (taps + i * max_taps, y_scale->resampler.taps +
|
||||
y_scale->resampler.phase[ic] * max_taps, max_taps * sizeof (gdouble));
|
||||
} else {
|
||||
ic = CLAMP (i / 4, 0, uv_scale->resampler.out_size - 1);
|
||||
ic = MIN (i / 4, uv_scale->resampler.out_size - 1);
|
||||
offset[i] = uv_scale->resampler.offset[ic] * 4 + (i & 3);
|
||||
memcpy (taps + i * max_taps, uv_scale->resampler.taps +
|
||||
uv_scale->resampler.phase[ic] * max_taps,
|
||||
|
|
Loading…
Reference in a new issue