summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Koenig <johannkoenig@google.com>2017-02-16 02:40:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-02-16 02:41:00 +0000
commitb63e88e506a28b0e2814259c1af04ef319dac77b (patch)
treeedee188c85d4462cb9feb5abb7754cc84806660c
parent61d05c1e67371c7468b6e4dbc414bf0c16414e6d (diff)
parent327a02d77ef45932c7cce39fca53765b8acc158d (diff)
downloadlibvpx-b63e88e506a28b0e2814259c1af04ef319dac77b.tar
libvpx-b63e88e506a28b0e2814259c1af04ef319dac77b.tar.gz
libvpx-b63e88e506a28b0e2814259c1af04ef319dac77b.tar.bz2
libvpx-b63e88e506a28b0e2814259c1af04ef319dac77b.zip
Merge "Use 'packssdw' for loading tran_low_t values"
-rw-r--r--vpx_dsp/x86/bitdepth_conversion_sse2.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/vpx_dsp/x86/bitdepth_conversion_sse2.h b/vpx_dsp/x86/bitdepth_conversion_sse2.h
index bff62a431..c5a29efbe 100644
--- a/vpx_dsp/x86/bitdepth_conversion_sse2.h
+++ b/vpx_dsp/x86/bitdepth_conversion_sse2.h
@@ -16,13 +16,12 @@
#include "vpx/vpx_integer.h"
#include "vpx_dsp/vpx_dsp_common.h"
-// Load 8 16 bit values. If the source is 32 bits then cast down.
-// This does not saturate values. It only truncates.
+// Load 8 16 bit values. If the source is 32 bits then pack down with
+// saturation.
static INLINE __m128i load_tran_low(const tran_low_t *a) {
#if CONFIG_VP9_HIGHBITDEPTH
- return _mm_setr_epi16((int16_t)a[0], (int16_t)a[1], (int16_t)a[2],
- (int16_t)a[3], (int16_t)a[4], (int16_t)a[5],
- (int16_t)a[6], (int16_t)a[7]);
+ const __m128i a_low = _mm_load_si128((const __m128i *)a);
+ return _mm_packs_epi32(a_low, *(const __m128i *)(a + 4));
#else
return _mm_load_si128((const __m128i *)a);
#endif