Commit d8637853 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_convolution: Use av_clip_uint8()

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 7fc944df
......@@ -163,7 +163,7 @@ static void filter_3x3(ConvolutionContext *s, AVFrame *in, AVFrame *out, int pla
p2[x] * matrix[7] +
p2[x + 1] * matrix[8];
sum = (int)(sum * rdiv + bias + 0.5f);
dst[x] = av_clip(sum, 0, 255);
dst[x] = av_clip_uint8(sum);
}
p0 = p1;
......@@ -218,7 +218,7 @@ static void filter_5x5(ConvolutionContext *s, AVFrame *in, AVFrame *out, int pla
sum += *(array[i] + x) * matrix[i];
}
sum = (int)(sum * rdiv + bias + 0.5f);
dst[x] = av_clip(sum, 0, 255);
dst[x] = av_clip_uint8(sum);
}
p0 = p1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment