// Copyright 2015 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // SSE4 version of some encoding functions. // // Author: Skal ([email protected]) #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE41) #include <smmintrin.h> #include <stdlib.h> // for abs() #include "src/dsp/common_sse2.h" #include "src/enc/vp8i_enc.h" //------------------------------------------------------------------------------ // Compute susceptibility based on DCT-coeff histograms. static void CollectHistogram_SSE41(const uint8_t* ref, const uint8_t* pred, int start_block, int end_block, VP8Histogram* const histo) { … } //------------------------------------------------------------------------------ // Texture distortion // // We try to match the spectral content (weighted) between source and // reconstructed samples. // Hadamard transform // Returns the weighted sum of the absolute value of transformed coefficients. // w[] contains a row-major 4 by 4 symmetric matrix. static int TTransform_SSE41(const uint8_t* inA, const uint8_t* inB, const uint16_t* const w) { … } static int Disto4x4_SSE41(const uint8_t* const a, const uint8_t* const b, const uint16_t* const w) { … } static int Disto16x16_SSE41(const uint8_t* const a, const uint8_t* const b, const uint16_t* const w) { … } //------------------------------------------------------------------------------ // Quantization // // Generates a pshufb constant for shuffling 16b words. #define PSHUFB_CST … static WEBP_INLINE int DoQuantizeBlock_SSE41(int16_t in[16], int16_t out[16], const uint16_t* const sharpen, const VP8Matrix* const mtx) { … } #undef PSHUFB_CST static int QuantizeBlock_SSE41(int16_t in[16], int16_t out[16], const VP8Matrix* const mtx) { … } static int QuantizeBlockWHT_SSE41(int16_t in[16], int16_t out[16], const VP8Matrix* const mtx) { … } static int Quantize2Blocks_SSE41(int16_t in[32], int16_t out[32], const VP8Matrix* const mtx) { … } //------------------------------------------------------------------------------ // Entry point extern void VP8EncDspInitSSE41(void); WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE41(void) { … } #else // !WEBP_USE_SSE41 WEBP_DSP_INIT_STUB(VP8EncDspInitSSE41) #endif // WEBP_USE_SSE41