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

Side by Side Diff: src/opts/SkNx_sse.h

Issue 2184543003: Perform color correction on png decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@colorjpegs
Patch Set: Created 4 years, 4 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 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkNx_sse_DEFINED 8 #ifndef SkNx_sse_DEFINED
9 #define SkNx_sse_DEFINED 9 #define SkNx_sse_DEFINED
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 SkNx thenElse(const SkNx& t, const SkNx& e) const { 170 SkNx thenElse(const SkNx& t, const SkNx& e) const {
171 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 171 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41
172 return _mm_blendv_epi8(e.fVec, t.fVec, fVec); 172 return _mm_blendv_epi8(e.fVec, t.fVec, fVec);
173 #else 173 #else
174 return _mm_or_si128(_mm_and_si128 (fVec, t.fVec), 174 return _mm_or_si128(_mm_and_si128 (fVec, t.fVec),
175 _mm_andnot_si128(fVec, e.fVec)); 175 _mm_andnot_si128(fVec, e.fVec));
176 #endif 176 #endif
177 } 177 }
178 178
179 SkNx logicalShiftRight(int bits) const { return _mm_srli_epi32(fVec, bits); }
180
179 __m128i fVec; 181 __m128i fVec;
180 }; 182 };
181 183
182 template <> 184 template <>
183 class SkNx<4, uint16_t> { 185 class SkNx<4, uint16_t> {
184 public: 186 public:
185 SkNx(const __m128i& vec) : fVec(vec) {} 187 SkNx(const __m128i& vec) : fVec(vec) {}
186 188
187 SkNx() {} 189 SkNx() {}
188 SkNx(uint16_t val) : fVec(_mm_set1_epi16(val)) {} 190 SkNx(uint16_t val) : fVec(_mm_set1_epi16(val)) {}
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 const Sk4h& a) { 409 const Sk4h& a) {
408 __m128i rg = _mm_unpacklo_epi16(r.fVec, g.fVec); 410 __m128i rg = _mm_unpacklo_epi16(r.fVec, g.fVec);
409 __m128i ba = _mm_unpacklo_epi16(b.fVec, a.fVec); 411 __m128i ba = _mm_unpacklo_epi16(b.fVec, a.fVec);
410 __m128i lo = _mm_unpacklo_epi32(rg, ba); 412 __m128i lo = _mm_unpacklo_epi32(rg, ba);
411 __m128i hi = _mm_unpackhi_epi32(rg, ba); 413 __m128i hi = _mm_unpackhi_epi32(rg, ba);
412 _mm_storeu_si128(((__m128i*) dst) + 0, lo); 414 _mm_storeu_si128(((__m128i*) dst) + 0, lo);
413 _mm_storeu_si128(((__m128i*) dst) + 1, hi); 415 _mm_storeu_si128(((__m128i*) dst) + 1, hi);
414 } 416 }
415 417
416 #endif//SkNx_sse_DEFINED 418 #endif//SkNx_sse_DEFINED
OLDNEW
« no previous file with comments | « src/opts/SkNx_neon.h ('k') | src/opts/SkOpts_sse41.cpp » ('j') | src/opts/SkOpts_sse41.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698