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

Side by Side Diff: third_party/libwebp/dsp/lossless_enc_sse41.c

Issue 2651883004: libwebp-0.6.0-rc1 (Closed)
Patch Set: Created 3 years, 11 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 // Copyright 2015 Google Inc. All Rights Reserved. 1 // Copyright 2015 Google Inc. All Rights Reserved.
2 // 2 //
3 // Use of this source code is governed by a BSD-style license 3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the COPYING file in the root of the source 4 // that can be found in the COPYING file in the root of the source
5 // tree. An additional intellectual property rights grant can be found 5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may 6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree. 7 // be found in the AUTHORS file in the root of the source tree.
8 // ----------------------------------------------------------------------------- 8 // -----------------------------------------------------------------------------
9 // 9 //
10 // SSE4.1 variant of methods for lossless encoder 10 // SSE4.1 variant of methods for lossless encoder
(...skipping 14 matching lines...) Expand all
25 int i; 25 int i;
26 const __m128i kCstShuffle = _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9, 26 const __m128i kCstShuffle = _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9,
27 -1, 5, -1, 5, -1, 1, -1, 1); 27 -1, 5, -1, 5, -1, 1, -1, 1);
28 for (i = 0; i + 4 <= num_pixels; i += 4) { 28 for (i = 0; i + 4 <= num_pixels; i += 4) {
29 const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); 29 const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);
30 const __m128i in_0g0g = _mm_shuffle_epi8(in, kCstShuffle); 30 const __m128i in_0g0g = _mm_shuffle_epi8(in, kCstShuffle);
31 const __m128i out = _mm_sub_epi8(in, in_0g0g); 31 const __m128i out = _mm_sub_epi8(in, in_0g0g);
32 _mm_storeu_si128((__m128i*)&argb_data[i], out); 32 _mm_storeu_si128((__m128i*)&argb_data[i], out);
33 } 33 }
34 // fallthrough and finish off with plain-C 34 // fallthrough and finish off with plain-C
35 VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i); 35 if (i != num_pixels) {
36 VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i);
37 }
36 } 38 }
37 39
38 //------------------------------------------------------------------------------ 40 //------------------------------------------------------------------------------
39 // Entry point 41 // Entry point
40 42
41 extern void VP8LEncDspInitSSE41(void); 43 extern void VP8LEncDspInitSSE41(void);
42 44
43 WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE41(void) { 45 WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE41(void) {
44 VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed; 46 VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed;
45 } 47 }
46 48
47 #else // !WEBP_USE_SSE41 49 #else // !WEBP_USE_SSE41
48 50
49 WEBP_DSP_INIT_STUB(VP8LEncDspInitSSE41) 51 WEBP_DSP_INIT_STUB(VP8LEncDspInitSSE41)
50 52
51 #endif // WEBP_USE_SSE41 53 #endif // WEBP_USE_SSE41
OLDNEW
« no previous file with comments | « third_party/libwebp/dsp/lossless_enc_sse2.c ('k') | third_party/libwebp/dsp/lossless_mips_dsp_r2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698