changeset 9606:058cbd563b8f

weightb: avoid signed left-shifts (which cause -ftrapv exceptions)
author Steve Borho <steve@borho.org>
date Wed, 04 Mar 2015 10:35:55 -0600
parents 6c70bf1d3c90
children 9eceacadf27b
files source/common/predict.cpp
diffstat 1 files changed, 1 insertions(+-), 1 deletions(-) [+]
line wrap: on
line diff
--- a/source/common/predict.cpp	Wed Mar 04 07:20:07 2015 -0600
+++ b/source/common/predict.cpp	Wed Mar 04 10:35:55 2015 -0600
@@ -50,7 +50,7 @@ namespace
 {
 inline pixel weightBidir(int w0, int16_t P0, int w1, int16_t P1, int round, int shift, int offset)
 {
-    return x265_clip((w0 * (P0 + IF_INTERNAL_OFFS) + w1 * (P1 + IF_INTERNAL_OFFS) + round + (offset << (shift - 1))) >> shift);
+    return x265_clip((w0 * (P0 + IF_INTERNAL_OFFS) + w1 * (P1 + IF_INTERNAL_OFFS) + round + (offset * (1 << (shift - 1)))) >> shift);
 }
 }