Fix #22829: build error in openjpeg with SSE using MSVC, already fixed
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 13 Jul 2010 13:59:34 +0000 (13:59 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 13 Jul 2010 13:59:34 +0000 (13:59 +0000)
in openjpeg svn but not in any release, so adding just that fix for now.

extern/libopenjpeg/dwt.c

index 78d18d175f4519e5965218b8eabc7c0a1a2f2915..357b475b9ac35fec704488dbb593e7103b6052f1 100644 (file)
@@ -610,7 +610,7 @@ static void v4dwt_decode_step1_sse(v4* w, int count, const __m128 c){
        int i;
        for(i = 0; i < count; ++i){
                __m128 tmp = vw[i*2];
-               vw[i*2] = tmp * c;
+               vw[i*2] = _mm_mul_ps(tmp, c);
        }
 }
 
@@ -622,18 +622,18 @@ static void v4dwt_decode_step2_sse(v4* l, v4* w, int k, int m, __m128 c){
                __m128 tmp1 = vl[ 0];
                __m128 tmp2 = vw[-1];
                __m128 tmp3 = vw[ 0];
-               vw[-1] = tmp2 + ((tmp1 + tmp3) * c);
+               vw[-1] = _mm_add_ps(tmp2, _mm_mul_ps(_mm_add_ps(tmp1, tmp3), c));
                vl = vw;
                vw += 2;
        }
        if(m >= k){
                return;
        }
-       c += c;
-       c *= vl[0];
+       c = _mm_add_ps(c, c);
+       c = _mm_mul_ps(c, vl[0]);
        for(; m < k; ++m){
                __m128 tmp = vw[-1];
-               vw[-1] = tmp + c;
+               vw[-1] = _mm_add_ps(tmp, c);
                vw += 2;
        }
 }