diff options
author | Jason Garrett-Glaser <jason@x264.com> | 2011-02-04 06:44:32 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-06 22:31:43 +0300 |
commit | c54ac7a8f252a03299c7686fb885c41ee9fc1233 (patch) | |
tree | a7b10507c33087c32bb7ffbda875840232ada618 /libavcodec/vp8.c | |
parent | 8cde1b7997b92a2be01f2c0e2c88b9b10e799756 (diff) |
VP8: faster filter_level clip
(cherry picked from commit a1b227bb533f173354795124e0b966277c251b56)
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r-- | libavcodec/vp8.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index bcf623790c..1db57e49ac 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -1480,7 +1480,10 @@ static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *m filter_level += s->lf_delta.ref[mb->ref_frame]; filter_level += s->lf_delta.mode[mb->mode]; } - filter_level = av_clip(filter_level, 0, 63); + +/* Like av_clip for inputs 0 and max, where max is equal to (2^n-1) */ +#define POW2CLIP(x,max) (((x) & ~max) ? (-(x))>>31 & max : (x)); + filter_level = POW2CLIP(filter_level, 63); interior_limit = filter_level; if (s->filter.sharpness) { |