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

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

Issue 1546003002: libwebp: update to 0.5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « third_party/libwebp/dsp/lossless_enc_sse2.c ('k') | third_party/libwebp/dsp/lossless_mips32.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 Google Inc. All Rights Reserved.
2 //
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
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 // -----------------------------------------------------------------------------
9 //
10 // SSE4.1 variant of methods for lossless encoder
11 //
12 // Author: Skal (pascal.massimino@gmail.com)
13
14 #include "./dsp.h"
15
16 #if defined(WEBP_USE_SSE41)
17 #include <assert.h>
18 #include <smmintrin.h>
19 #include "./lossless.h"
20
21 //------------------------------------------------------------------------------
22 // Subtract-Green Transform
23
24 static void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) {
25 int i;
26 const __m128i kCstShuffle = _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9,
27 -1, 5, -1, 5, -1, 1, -1, 1);
28 for (i = 0; i + 4 <= num_pixels; i += 4) {
29 const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);
30 const __m128i in_0g0g = _mm_shuffle_epi8(in, kCstShuffle);
31 const __m128i out = _mm_sub_epi8(in, in_0g0g);
32 _mm_storeu_si128((__m128i*)&argb_data[i], out);
33 }
34 // fallthrough and finish off with plain-C
35 VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i);
36 }
37
38 //------------------------------------------------------------------------------
39 // Entry point
40
41 extern void VP8LEncDspInitSSE41(void);
42
43 WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE41(void) {
44 VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed;
45 }
46
47 #else // !WEBP_USE_SSE41
48
49 WEBP_DSP_INIT_STUB(VP8LEncDspInitSSE41)
50
51 #endif // WEBP_USE_SSE41
OLDNEW
« no previous file with comments | « third_party/libwebp/dsp/lossless_enc_sse2.c ('k') | third_party/libwebp/dsp/lossless_mips32.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698