summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-04-10 22:44:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-04-10 22:44:09 +0000
commit04c6e3baba92b9101238693640ea94fed0a7c412 (patch)
tree17db1a0fbb2fe38c038a317c91e1cca71b067686 /common
parent9083317185f3ebf2d60f2234fe7abd224b294cf4 (diff)
parent4be8f62fca27d40794e855d0846ce872fdb8510e (diff)
downloadplatform_external_libavc-04c6e3baba92b9101238693640ea94fed0a7c412.tar.gz
platform_external_libavc-04c6e3baba92b9101238693640ea94fed0a7c412.tar.bz2
platform_external_libavc-04c6e3baba92b9101238693640ea94fed0a7c412.zip
Merge "Decoder: Fix undefined left shift"
Diffstat (limited to 'common')
-rw-r--r--common/x86/ih264_ihadamard_scaling_sse42.c2
-rw-r--r--common/x86/ih264_ihadamard_scaling_ssse3.c2
-rw-r--r--common/x86/ih264_iquant_itrans_recon_sse42.c4
-rw-r--r--common/x86/ih264_iquant_itrans_recon_ssse3.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/common/x86/ih264_ihadamard_scaling_sse42.c b/common/x86/ih264_ihadamard_scaling_sse42.c
index d68d105..4065e35 100644
--- a/common/x86/ih264_ihadamard_scaling_sse42.c
+++ b/common/x86/ih264_ihadamard_scaling_sse42.c
@@ -96,7 +96,7 @@ void ih264_ihadamard_scaling_4x4_sse42(WORD16* pi2_src,
__m128i src_r0_r1, src_r2_r3;
__m128i src_r0, src_r1, src_r2, src_r3;
__m128i temp0, temp1, temp2, temp3;
- __m128i add_rshift = _mm_set1_epi32((1 << (5 - u4_qp_div_6)));
+ __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 6) ? (1 << (5 - u4_qp_div_6)) : 0);
__m128i mult_val = _mm_set1_epi32(pu2_iscal_mat[0] * pu2_weigh_mat[0]);
UNUSED (pi4_tmp);
diff --git a/common/x86/ih264_ihadamard_scaling_ssse3.c b/common/x86/ih264_ihadamard_scaling_ssse3.c
index 1b940ea..b4d483f 100644
--- a/common/x86/ih264_ihadamard_scaling_ssse3.c
+++ b/common/x86/ih264_ihadamard_scaling_ssse3.c
@@ -96,7 +96,7 @@ void ih264_ihadamard_scaling_4x4_ssse3(WORD16* pi2_src,
__m128i src_r0_r1, src_r2_r3, sign_reg, zero_8x16b = _mm_setzero_si128();
__m128i src_r0, src_r1, src_r2, src_r3;
__m128i temp0, temp1, temp2, temp3;
- __m128i add_rshift = _mm_set1_epi32((1 << (5 - u4_qp_div_6)));
+ __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 6) ? (1 << (5 - u4_qp_div_6)) : 0);
__m128i mult_val = _mm_set1_epi32(pu2_iscal_mat[0] * pu2_weigh_mat[0]);
__m128i mask = _mm_set1_epi32(val);
diff --git a/common/x86/ih264_iquant_itrans_recon_sse42.c b/common/x86/ih264_iquant_itrans_recon_sse42.c
index f27111f..a7b9e82 100644
--- a/common/x86/ih264_iquant_itrans_recon_sse42.c
+++ b/common/x86/ih264_iquant_itrans_recon_sse42.c
@@ -118,7 +118,7 @@ void ih264_iquant_itrans_recon_4x4_sse42(WORD16 *pi2_src,
__m128i zero_8x16b = _mm_setzero_si128(); // all bits reset to zero
__m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
__m128i resq_r0, resq_r1, resq_r2, resq_r3;
- __m128i add_rshift = _mm_set1_epi32((1 << (3 - u4_qp_div_6)));
+ __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
__m128i value_32 = _mm_set1_epi32(32);
UNUSED (pi2_tmp);
@@ -367,7 +367,7 @@ void ih264_iquant_itrans_recon_chroma_4x4_sse42(WORD16 *pi2_src,
__m128i zero_8x16b = _mm_setzero_si128(); // all bits reset to zero
__m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
__m128i resq_r0, resq_r1, resq_r2, resq_r3;
- __m128i add_rshift = _mm_set1_epi32((1 << (3 - u4_qp_div_6)));
+ __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
__m128i value_32 = _mm_set1_epi32(32);
__m128i chroma_mask = _mm_set1_epi16 (0xFF);
__m128i out_r0, out_r1, out_r2, out_r3;
diff --git a/common/x86/ih264_iquant_itrans_recon_ssse3.c b/common/x86/ih264_iquant_itrans_recon_ssse3.c
index 30f7e59..506be49 100644
--- a/common/x86/ih264_iquant_itrans_recon_ssse3.c
+++ b/common/x86/ih264_iquant_itrans_recon_ssse3.c
@@ -118,7 +118,7 @@ void ih264_iquant_itrans_recon_4x4_ssse3(WORD16 *pi2_src,
__m128i zero_8x16b = _mm_setzero_si128(); // all bits reset to zero
__m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
__m128i resq_r0, resq_r1, resq_r2, resq_r3;
- __m128i add_rshift = _mm_set1_epi32((1 << (3 - u4_qp_div_6)));
+ __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
__m128i value_32 = _mm_set1_epi32(32);
UNUSED (pi2_tmp);
UNUSED (pi2_dc_ld_addr);
@@ -384,7 +384,7 @@ void ih264_iquant_itrans_recon_8x8_ssse3(WORD16 *pi2_src,
// __m128i one_8x16b = _mm_set1_epi8(255); // all bits set to 1
// __m128i one_zero_mask = _mm_unpacklo_epi16(one_8x16b, zero_8x16b); // 1 0 1 0 1 0 1 0 --- 16 bits size
__m128i value_32 = _mm_set1_epi32(32);
- __m128i add_rshift = _mm_set1_epi32((1 << (5 - qp_div)));
+ __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
__m128i dequant_r0;
__m128i predload_r;
__m128i pred_r0_1, pred_r1_1, pred_r2_1, pred_r3_1, pred_r4_1, pred_r5_1,