aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_boxblur.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-08-02 23:45:30 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-08-03 11:18:15 +0200
commitd68ba3feb80f9fbb6c80c2ede4a105062084fef8 (patch)
treedb2169e57b810cc49a7f3e5a915970bdd574c22b /libavfilter/vf_boxblur.c
parent1d186e9e120d777cc9f5e68d2974d48bfbdd528e (diff)
downloadffmpeg-d68ba3feb80f9fbb6c80c2ede4a105062084fef8.tar.gz
vf_boxblur: prefer the name "len" over "w" in the blur routines
Make more clear the meaning of the variables. They specify the length of a (vertical or horizontal) line rather than a width. Less confusing.
Diffstat (limited to 'libavfilter/vf_boxblur.c')
-rw-r--r--libavfilter/vf_boxblur.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
index 7fb1ec5ba2..398014a0b9 100644
--- a/libavfilter/vf_boxblur.c
+++ b/libavfilter/vf_boxblur.c
@@ -206,7 +206,7 @@ static int config_input(AVFilterLink *inlink)
}
static inline void blur(uint8_t *dst, int dst_step, const uint8_t *src, int src_step,
- int w, int radius)
+ int len, int radius)
{
/* Naive boxblur would sum source pixels from x-radius .. x+radius
* for destination pixel x. That would be O(radius*width).
@@ -235,39 +235,39 @@ static inline void blur(uint8_t *dst, int dst_step, const uint8_t *src, int src_
dst[x*dst_step] = (sum*inv + (1<<15))>>16;
}
- for (; x < w-radius; x++) {
+ for (; x < len-radius; x++) {
sum += src[(radius+x)*src_step] - src[(x-radius-1)*src_step];
dst[x*dst_step] = (sum*inv + (1<<15))>>16;
}
- for (; x < w; x++) {
- sum += src[(2*w-radius-x-1)*src_step] - src[(x-radius-1)*src_step];
+ for (; x < len; x++) {
+ sum += src[(2*len-radius-x-1)*src_step] - src[(x-radius-1)*src_step];
dst[x*dst_step] = (sum*inv + (1<<15))>>16;
}
}
static inline void blur_power(uint8_t *dst, int dst_step, const uint8_t *src, int src_step,
- int w, int radius, int power, uint8_t *temp[2])
+ int len, int radius, int power, uint8_t *temp[2])
{
uint8_t *a = temp[0], *b = temp[1];
if (radius && power) {
- blur(a, 1, src, src_step, w, radius);
+ blur(a, 1, src, src_step, len, radius);
for (; power > 2; power--) {
uint8_t *c;
- blur(b, 1, a, 1, w, radius);
+ blur(b, 1, a, 1, len, radius);
c = a; a = b; b = c;
}
if (power > 1) {
- blur(dst, dst_step, a, 1, w, radius);
+ blur(dst, dst_step, a, 1, len, radius);
} else {
int i;
- for (i = 0; i < w; i++)
+ for (i = 0; i < len; i++)
dst[i*dst_step] = a[i];
}
} else {
int i;
- for (i = 0; i < w; i++)
+ for (i = 0; i < len; i++)
dst[i*dst_step] = src[i*src_step];
}
}