OLD | NEW |
1 /* | 1 /* |
2 * The copyright in this software is being made available under the 2-clauses | 2 * The copyright in this software is being made available under the 2-clauses |
3 * BSD License, included below. This software may be subject to other third | 3 * BSD License, included below. This software may be subject to other third |
4 * party and contributor rights, including patent rights, and no such rights | 4 * party and contributor rights, including patent rights, and no such rights |
5 * are granted under this license. | 5 * are granted under this license. |
6 * | 6 * |
7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium | 7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
8 * Copyright (c) 2002-2014, Professor Benoit Macq | 8 * Copyright (c) 2002-2014, Professor Benoit Macq |
9 * Copyright (c) 2001-2003, David Janssens | 9 * Copyright (c) 2001-2003, David Janssens |
10 * Copyright (c) 2002-2003, Yannick Verschueren | 10 * Copyright (c) 2002-2003, Yannick Verschueren |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 vb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu)); | 183 vb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu)); |
184 _mm_store_ps(c0, vr); | 184 _mm_store_ps(c0, vr); |
185 _mm_store_ps(c1, vg); | 185 _mm_store_ps(c1, vg); |
186 _mm_store_ps(c2, vb); | 186 _mm_store_ps(c2, vb); |
187 c0 += 4; | 187 c0 += 4; |
188 c1 += 4; | 188 c1 += 4; |
189 c2 += 4; | 189 c2 += 4; |
190 } | 190 } |
191 n &= 7; | 191 n &= 7; |
192 } else { | 192 } else { |
193 » » for(i = 0; i < n; ++i) { | 193 » » for (i = 0; i < n; ++i) { |
194 OPJ_FLOAT32 y = c0[i]; | 194 OPJ_FLOAT32 y = c0[i]; |
195 OPJ_FLOAT32 u = c1[i]; | 195 OPJ_FLOAT32 u = c1[i]; |
196 OPJ_FLOAT32 v = c2[i]; | 196 OPJ_FLOAT32 v = c2[i]; |
197 OPJ_FLOAT32 r = y + (v * 1.402f); | 197 OPJ_FLOAT32 r = y + (v * 1.402f); |
198 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f)); | 198 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f)); |
199 OPJ_FLOAT32 b = y + (u * 1.772f); | 199 OPJ_FLOAT32 b = y + (u * 1.772f); |
200 c0[i] = r; | 200 c0[i] = r; |
201 c1[i] = g; | 201 c1[i] = g; |
202 c2[i] = b; | 202 c2[i] = b; |
203 } | 203 } |
204 } | 204 } |
205 | |
206 #endif | 205 #endif |
207 for(i = 0; i < n; ++i) { | 206 for(i = 0; i < n; ++i) { |
208 OPJ_FLOAT32 y = c0[i]; | 207 OPJ_FLOAT32 y = c0[i]; |
209 OPJ_FLOAT32 u = c1[i]; | 208 OPJ_FLOAT32 u = c1[i]; |
210 OPJ_FLOAT32 v = c2[i]; | 209 OPJ_FLOAT32 v = c2[i]; |
211 OPJ_FLOAT32 r = y + (v * 1.402f); | 210 OPJ_FLOAT32 r = y + (v * 1.402f); |
212 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f)); | 211 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f)); |
213 OPJ_FLOAT32 b = y + (u * 1.772f); | 212 OPJ_FLOAT32 b = y + (u * 1.772f); |
214 c0[i] = r; | 213 c0[i] = r; |
215 c1[i] = g; | 214 c1[i] = g; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 lIndex = i; | 332 lIndex = i; |
334 | 333 |
335 for (j=0;j<pNbComps;++j) { | 334 for (j=0;j<pNbComps;++j) { |
336 lCurrentValue = lMatrix[lIndex]; | 335 lCurrentValue = lMatrix[lIndex]; |
337 lIndex += pNbComps; | 336 lIndex += pNbComps; |
338 lNorms[i] += lCurrentValue * lCurrentValue; | 337 lNorms[i] += lCurrentValue * lCurrentValue; |
339 } | 338 } |
340 lNorms[i] = sqrt(lNorms[i]); | 339 lNorms[i] = sqrt(lNorms[i]); |
341 } | 340 } |
342 } | 341 } |
OLD | NEW |