Skip to content

Commit 259413a

Browse files
committed
Reformatted some code in ArithmeticCoderBase.update() to highlight similarity, in all languages.
1 parent dcc02d8 commit 259413a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cpp/ArithmeticCoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ArithmeticCoderBase::update(const FrequencyTable &freqs, uint32_t symbol) {
5858
// While low and high have the same top bit value, shift them out
5959
while (((low ^ high) & halfRange) == 0) {
6060
shift();
61-
low = (low << 1) & stateMask;
61+
low = ((low << 1) & stateMask);
6262
high = ((high << 1) & stateMask) | 1;
6363
}
6464
// Now low's top bit must be 0 and high's top bit must be 1

java/src/ArithmeticCoderBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected void update(CheckedFrequencyTable freqs, int symbol) throws IOExceptio
142142
// While low and high have the same top bit value, shift them out
143143
while (((low ^ high) & halfRange) == 0) {
144144
shift();
145-
low = (low << 1) & stateMask;
145+
low = ((low << 1) & stateMask);
146146
high = ((high << 1) & stateMask) | 1;
147147
}
148148
// Now low's top bit must be 0 and high's top bit must be 1

python/arithmeticcoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def update(self, freqs, symbol):
9494
# While low and high have the same top bit value, shift them out
9595
while ((self.low ^ self.high) & self.half_range) == 0:
9696
self.shift()
97-
self.low = (self.low << 1) & self.state_mask
97+
self.low = ((self.low << 1) & self.state_mask)
9898
self.high = ((self.high << 1) & self.state_mask) | 1
9999
# Now low's top bit must be 0 and high's top bit must be 1
100100

0 commit comments

Comments
 (0)