History

Merge "Temporarily convert to 64 bits to avoid overflows"

James Zern committed 6 years ago

Commit e334d9f2 parents 5fd3c08 b6fa0f21 file · +5 −1Browse files

Unified · Split

vp8/encoder/treewriter.h+5−1
@@ -14,6 +14,8 @@ · 13 unmodified lines
1414 /* Trees map alphabets into huffman-like codes suitable for an arithmetic
1515 bit coder. Timothy S Murphy 11 October 2004 */
1616
17+#include <stdint.h>
18+
1719 #include "./vpx_config.h"
1820 #include "vp8/common/treecoder.h"
1921
@@ -48,7 +50,9 @@ static INLINE unsigned int vp8_cost_branch(const unsigned int ct[2], · 28 unmodified lines
4850 vp8_prob p) {
4951 /* Imitate existing calculation */
5052
51− return ((ct[0] * vp8_cost_zero(p)) + (ct[1] * vp8_cost_one(p))) >> 8;
53+ return (unsigned int)(((((uint64_t)ct[0]) * vp8_cost_zero(p)) +
54+ (((uint64_t)ct[1]) * vp8_cost_one(p))) >>
55+ 8);
5256 }
5357
5458 /* Small functions to write explicit values and tokens, as well as

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t