Skip to content

Commit 8e6e003

Browse files
committed
Simpler finish
1 parent 42c2634 commit 8e6e003

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/structs/vpx_bool_writer.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,11 @@ impl<W: Write> VPXBoolWriter<W> {
286286
let mut tmp_value = self.low_value;
287287
let stream_bits = 64 - tmp_value.leading_zeros() as i32 - 2;
288288

289-
tmp_value <<= MAX_STREAM_BITS - stream_bits - 1;
290-
if (tmp_value & (1 << (MAX_STREAM_BITS - 1))) != 0 {
289+
tmp_value <<= MAX_STREAM_BITS - stream_bits;
290+
if (tmp_value & (1 << MAX_STREAM_BITS)) != 0 {
291291
self.carry();
292292
}
293293

294-
tmp_value <<= 1;
295294
let mut shift = MAX_STREAM_BITS - 8;
296295
let mut stream_bytes = (stream_bits + 7) >> 3;
297296
while stream_bytes > 0 {

0 commit comments

Comments
 (0)