Revision b615c1ed

View differences:

libavcodec/vc1dsp.c
35 35
{
36 36
    int i;
37 37
    int a, b, c, d;
38
    int d1, d2;
38 39
    for(i = 0; i < 8; i++) {
39 40
        a = src[-2*stride];
40 41
        b = src[-stride];
41 42
        c = src[0];
42 43
        d = src[stride];
44
        d1 = (a - d + 3 + rnd) >> 3;
45
        d2 = (a - d + b - c + 4 - rnd) >> 3;
43 46

  
44
        src[-2*stride] = clip_uint8((7*a + d + 4 - rnd) >> 3);
45
        src[-stride] = clip_uint8((-a + 7*b + c + d + 3 + rnd) >> 3);
46
        src[0] = clip_uint8((a + b + 7*c - d + 4 - rnd) >> 3);
47
        src[stride] = clip_uint8((a + 7*d + 3 + rnd) >> 3);
47
        src[-2*stride] = a - d1;
48
        src[-stride] = b - d2;
49
        src[0] = c + d2;
50
        src[stride] = d + d1;
48 51
        src++;
49 52
    }
50 53
}
......
55 58
{
56 59
    int i;
57 60
    int a, b, c, d;
61
    int d1, d2;
58 62
    for(i = 0; i < 8; i++) {
59 63
        a = src[-2];
60 64
        b = src[-1];
61 65
        c = src[0];
62 66
        d = src[1];
67
        d1 = (a - d + 3 + rnd) >> 3;
68
        d2 = (a - d + b - c + 4 - rnd) >> 3;
63 69

  
64
        src[-2] = clip_uint8((7*a + d + 4 - rnd) >> 3);
65
        src[-1] = clip_uint8((-a + 7*b + c + d + 3 + rnd) >> 3);
66
        src[0] = clip_uint8((a + b + 7*c - d + 4 - rnd) >> 3);
67
        src[1] = clip_uint8((a + 7*d + 3 + rnd) >> 3);
70
        src[-2] = a - d1;
71
        src[-1] = b - d2;
72
        src[0] = c + d2;
73
        src[1] = d + d1;
68 74
        src += stride;
69 75
    }
70 76
}

Also available in: Unified diff