1 parent 4aca6a6 commit e9d5cc6Copy full SHA for e9d5cc6
1 file changed
src/entropy/AdaptiveProbMap.hpp
@@ -70,7 +70,8 @@ namespace kanzi {
70
71
// Return interpolated probabibility
72
const uint16 w = uint16(pr & 127);
73
- return int(_data[_index] * (128 - w) + _data[_index + 1] * w) >> 11;
+ return ((_data[_index] << 7) +
74
+ (int(_data[_index + 1]) - int(_data[_index])) * int(w)) >> 11;
75
}
76
77
@@ -120,7 +121,8 @@ namespace kanzi {
120
121
122
123
124
125
126
} else {
127
_index = ((Global::stretch(pr) + 2048) >> 7) + 32 * ctx;
128
return int(_data[_index]) >> 4;
0 commit comments