diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2006-11-17 09:12:33 +0300 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2006-11-17 09:12:33 +0300 |
commit | b615c1edfcdf9fabfc1b92a3b155a7bce6543153 (patch) | |
tree | 2bef42b5f1e586fac1bf49022f0be60a5b7cf7a1 /libavcodec/vc1dsp.c | |
parent | 7ad8d3bf0c02ecb34d257451fe84be9d60d06472 (diff) |
Optimize overlapping
Suggested by Skal, sprintf(mail, "skal%d@orange.fr", 0xFFFF)
Originally committed as revision 7113 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r-- | libavcodec/vc1dsp.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index b488f2ca0b..518a690d3a 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -35,16 +35,19 @@ static void vc1_v_overlap_c(uint8_t* src, int stride, int rnd) { int i; int a, b, c, d; + int d1, d2; for(i = 0; i < 8; i++) { a = src[-2*stride]; b = src[-stride]; c = src[0]; d = src[stride]; + d1 = (a - d + 3 + rnd) >> 3; + d2 = (a - d + b - c + 4 - rnd) >> 3; - src[-2*stride] = clip_uint8((7*a + d + 4 - rnd) >> 3); - src[-stride] = clip_uint8((-a + 7*b + c + d + 3 + rnd) >> 3); - src[0] = clip_uint8((a + b + 7*c - d + 4 - rnd) >> 3); - src[stride] = clip_uint8((a + 7*d + 3 + rnd) >> 3); + src[-2*stride] = a - d1; + src[-stride] = b - d2; + src[0] = c + d2; + src[stride] = d + d1; src++; } } @@ -55,16 +58,19 @@ static void vc1_h_overlap_c(uint8_t* src, int stride, int rnd) { int i; int a, b, c, d; + int d1, d2; for(i = 0; i < 8; i++) { a = src[-2]; b = src[-1]; c = src[0]; d = src[1]; + d1 = (a - d + 3 + rnd) >> 3; + d2 = (a - d + b - c + 4 - rnd) >> 3; - src[-2] = clip_uint8((7*a + d + 4 - rnd) >> 3); - src[-1] = clip_uint8((-a + 7*b + c + d + 3 + rnd) >> 3); - src[0] = clip_uint8((a + b + 7*c - d + 4 - rnd) >> 3); - src[1] = clip_uint8((a + 7*d + 3 + rnd) >> 3); + src[-2] = a - d1; + src[-1] = b - d2; + src[0] = c + d2; + src[1] = d + d1; src += stride; } } |