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

Side by Side Diff: src/opts/SkNx_neon.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_neon_DEFINED 8 #ifndef SkNx_neon_DEFINED
9 #define SkNx_neon_DEFINED 9 #define SkNx_neon_DEFINED
10 10
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 return vreinterpretq_s32_u32(vcgtq_s32(fVec, o.fVec)); 403 return vreinterpretq_s32_u32(vcgtq_s32(fVec, o.fVec));
404 } 404 }
405 405
406 static SkNx Min(const SkNx& a, const SkNx& b) { return vminq_s32(a.fVec, b.f Vec); } 406 static SkNx Min(const SkNx& a, const SkNx& b) { return vminq_s32(a.fVec, b.f Vec); }
407 // TODO as needed 407 // TODO as needed
408 408
409 SkNx thenElse(const SkNx& t, const SkNx& e) const { 409 SkNx thenElse(const SkNx& t, const SkNx& e) const {
410 return vbslq_s32(vreinterpretq_u32_s32(fVec), t.fVec, e.fVec); 410 return vbslq_s32(vreinterpretq_u32_s32(fVec), t.fVec, e.fVec);
411 } 411 }
412 412
413 SkNx logicalShiftRight(int bits) const {
414 SHIFT32(vshrq_n_u32, vreinterpretq_u32_s32(fVec), bits);
415 }
416
413 int32x4_t fVec; 417 int32x4_t fVec;
414 }; 418 };
415 419
416 #undef SHIFT32 420 #undef SHIFT32
417 #undef SHIFT16 421 #undef SHIFT16
418 #undef SHIFT8 422 #undef SHIFT8
419 423
420 template<> inline Sk4i SkNx_cast<int, float>(const Sk4f& src) { 424 template<> inline Sk4i SkNx_cast<int, float>(const Sk4f& src) {
421 return vcvtq_s32_f32(src.fVec); 425 return vcvtq_s32_f32(src.fVec);
422 426
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 uint16x4x4_t rgba = {{ 492 uint16x4x4_t rgba = {{
489 r.fVec, 493 r.fVec,
490 g.fVec, 494 g.fVec,
491 b.fVec, 495 b.fVec,
492 a.fVec, 496 a.fVec,
493 }}; 497 }};
494 vst4_u16((uint16_t*) dst, rgba); 498 vst4_u16((uint16_t*) dst, rgba);
495 } 499 }
496 500
497 #endif//SkNx_neon_DEFINED 501 #endif//SkNx_neon_DEFINED
OLDNEW
« no previous file with comments | « src/opts/SkColorXform_opts.h ('k') | src/opts/SkNx_sse.h » ('j') | src/opts/SkOpts_sse41.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698