Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1391)

Side by Side Diff: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mct.c

Issue 318593002: Use none SSE functions when data is not 16 byte aligned (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Patch Set 2 Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 vg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm _mul_ps(vv, vgv)); 182 vg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm _mul_ps(vv, vgv));
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 {
jabdelmalek 2014/06/06 17:25:31 why remove this?
193 for (i = 0; i < n; ++i) {
194 OPJ_FLOAT32 y = c0[i];
195 OPJ_FLOAT32 u = c1[i];
196 OPJ_FLOAT32 v = c2[i];
197 OPJ_FLOAT32 r = y + (v * 1.402f);
198 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f));
199 OPJ_FLOAT32 b = y + (u * 1.772f);
200 c0[i] = r;
201 c1[i] = g;
202 c2[i] = b;
203 }
204 } 192 }
205 #endif 193 #endif
206 for(i = 0; i < n; ++i) { 194 for(i = 0; i < n; ++i) {
207 OPJ_FLOAT32 y = c0[i]; 195 OPJ_FLOAT32 y = c0[i];
208 OPJ_FLOAT32 u = c1[i]; 196 OPJ_FLOAT32 u = c1[i];
209 OPJ_FLOAT32 v = c2[i]; 197 OPJ_FLOAT32 v = c2[i];
210 OPJ_FLOAT32 r = y + (v * 1.402f); 198 OPJ_FLOAT32 r = y + (v * 1.402f);
211 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f)); 199 OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f));
212 OPJ_FLOAT32 b = y + (u * 1.772f); 200 OPJ_FLOAT32 b = y + (u * 1.772f);
213 c0[i] = r; 201 c0[i] = r;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 lIndex = i; 320 lIndex = i;
333 321
334 for (j=0;j<pNbComps;++j) { 322 for (j=0;j<pNbComps;++j) {
335 lCurrentValue = lMatrix[lIndex]; 323 lCurrentValue = lMatrix[lIndex];
336 lIndex += pNbComps; 324 lIndex += pNbComps;
337 lNorms[i] += lCurrentValue * lCurrentValue; 325 lNorms[i] += lCurrentValue * lCurrentValue;
338 } 326 }
339 lNorms[i] = sqrt(lNorms[i]); 327 lNorms[i] = sqrt(lNorms[i]);
340 } 328 }
341 } 329 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698