Revision 72946825

View differences:

libavcodec/i386/motion_est_mmx.c
88 88
    );
89 89
}
90 90

  
91
static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)
92
{
93
    int ret;
94
    asm volatile(
95
        "pxor %%xmm6, %%xmm6            \n\t"
96
        ASMALIGN(4)
97
        "1:                             \n\t"
98
        "movdqu (%1), %%xmm0            \n\t"
99
        "movdqu (%1, %3), %%xmm1        \n\t"
100
        "psadbw (%2), %%xmm0            \n\t"
101
        "psadbw (%2, %3), %%xmm1        \n\t"
102
        "paddw %%xmm0, %%xmm6           \n\t"
103
        "paddw %%xmm1, %%xmm6           \n\t"
104
        "lea (%1,%3,2), %1              \n\t"
105
        "lea (%2,%3,2), %2              \n\t"
106
        "sub $2, %0                     \n\t"
107
        " jg 1b                         \n\t"
108
        : "+r" (h), "+r" (blk1), "+r" (blk2)
109
        : "r" ((long)stride)
110
    );
111
    asm volatile(
112
        "movhlps %%xmm6, %%xmm0         \n\t"
113
        "paddw   %%xmm0, %%xmm6         \n\t"
114
        "movd    %%xmm6, %0             \n\t"
115
        : "=r"(ret)
116
    );
117
    return ret;
118
}
119

  
91 120
static inline void sad8_x2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
92 121
{
93 122
    asm volatile(
......
424 453
            c->pix_abs[1][3] = sad8_xy2_mmx2;
425 454
        }
426 455
    }
456
    if ((mm_flags & MM_SSE2) && !(mm_flags & MM_3DNOW)) {
457
        c->sad[0]= sad16_sse2;
458
    }
427 459
}

Also available in: Unified diff