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:
Luis de Bethencourt 2015-06-29 16:16:06 +01:00
parent c5dbee33b0
commit 6e263cc5f6

View file

@ -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,