tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

dec_sse41.c (1420B)


      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 version of some decoding functions.
     11 //
     12 // Author: Skal (pascal.massimino@gmail.com)
     13 
     14 #include "src/dsp/dsp.h"
     15 
     16 #if defined(WEBP_USE_SSE41)
     17 #include <emmintrin.h>
     18 #include <smmintrin.h>
     19 
     20 #include "src/webp/types.h"
     21 #include "src/dec/vp8i_dec.h"
     22 #include "src/dsp/cpu.h"
     23 #include "src/utils/utils.h"
     24 
     25 static void HE16_SSE41(uint8_t* dst) {     // horizontal
     26  int j;
     27  const __m128i kShuffle3 = _mm_set1_epi8(3);
     28  for (j = 16; j > 0; --j) {
     29    const __m128i in = _mm_cvtsi32_si128(WebPMemToInt32(dst - 4));
     30    const __m128i values = _mm_shuffle_epi8(in, kShuffle3);
     31    _mm_storeu_si128((__m128i*)dst, values);
     32    dst += BPS;
     33  }
     34 }
     35 
     36 //------------------------------------------------------------------------------
     37 // Entry point
     38 
     39 extern void VP8DspInitSSE41(void);
     40 
     41 WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE41(void) {
     42  VP8PredLuma16[3] = HE16_SSE41;
     43 }
     44 
     45 #else  // !WEBP_USE_SSE41
     46 
     47 WEBP_DSP_INIT_STUB(VP8DspInitSSE41)
     48 
     49 #endif  // WEBP_USE_SSE41