~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to extern/libopenjpeg/mct.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 * POSSIBILITY OF SUCH DAMAGE.
30
30
 */
31
31
 
 
32
#ifdef __SSE__
 
33
#include <xmmintrin.h>
 
34
#endif
 
35
 
32
36
#include "opj_includes.h"
33
37
 
34
38
/* <summary> */
127
131
                int n)
128
132
{
129
133
        int i;
 
134
#ifdef __SSE__
 
135
        __m128 vrv, vgu, vgv, vbu;
 
136
        vrv = _mm_set1_ps(1.402f);
 
137
        vgu = _mm_set1_ps(0.34413f);
 
138
        vgv = _mm_set1_ps(0.71414f);
 
139
        vbu = _mm_set1_ps(1.772f);
 
140
        for (i = 0; i < (n >> 3); ++i) {
 
141
                __m128 vy, vu, vv;
 
142
                __m128 vr, vg, vb;
 
143
 
 
144
                vy = _mm_load_ps(c0);
 
145
                vu = _mm_load_ps(c1);
 
146
                vv = _mm_load_ps(c2);
 
147
                vr = _mm_add_ps(vy, _mm_mul_ps(vv, vrv));
 
148
                vg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm_mul_ps(vv, vgv));
 
149
                vb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu));
 
150
                _mm_store_ps(c0, vr);
 
151
                _mm_store_ps(c1, vg);
 
152
                _mm_store_ps(c2, vb);
 
153
                c0 += 4;
 
154
                c1 += 4;
 
155
                c2 += 4;
 
156
 
 
157
                vy = _mm_load_ps(c0);
 
158
                vu = _mm_load_ps(c1);
 
159
                vv = _mm_load_ps(c2);
 
160
                vr = _mm_add_ps(vy, _mm_mul_ps(vv, vrv));
 
161
                vg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm_mul_ps(vv, vgv));
 
162
                vb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu));
 
163
                _mm_store_ps(c0, vr);
 
164
                _mm_store_ps(c1, vg);
 
165
                _mm_store_ps(c2, vb);
 
166
                c0 += 4;
 
167
                c1 += 4;
 
168
                c2 += 4;
 
169
        }
 
170
        n &= 7;
 
171
#endif
130
172
        for(i = 0; i < n; ++i) {
131
173
                float y = c0[i];
132
174
                float u = c1[i];