diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-21 02:59:23 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-21 02:59:23 +0300 |
commit | f622ff16cde3b4a66dfacb3db0d89528fbd16999 (patch) | |
tree | 748f7d5fc692f4a23c8589ff447794d239652705 /libavfilter/vf_boxblur.c | |
parent | 7cdce8cb55e7af25b88b45b6338402baad1e9ec9 (diff) |
avfilter/vf_boxblur: avoid one addition per line
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_boxblur.c')
-rw-r--r-- | libavfilter/vf_boxblur.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index a908b6d125..bc604e69d7 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -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); |