Commit f622ff16 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_boxblur: avoid one addition per line

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7cdce8cb
......@@ -221,11 +221,10 @@ static inline void blur(uint8_t *dst, int dst_step, const uint8_t *src, int src_
*/
const int length = radius*2 + 1;
const int inv = ((1<<16) + length/2)/length;
int x, sum = 0;
int x, sum = src[radius*src_step];
for (x = 0; x < radius; x++)
sum += src[x*src_step]<<1;
sum += src[radius*src_step];
sum = sum*inv + (1<<15);
......
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