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
14/* Trees map alphabets into huffman-like codes suitable for an arithmetic14/* Trees map alphabets into huffman-like codes suitable for an arithmetic
15 bit coder. Timothy S Murphy 11 October 2004 */15 bit coder. Timothy S Murphy 11 October 2004 */
16 16
17#include <stdint.h>
18
17#include "./vpx_config.h"19#include "./vpx_config.h"
18#include "vp8/common/treecoder.h"20#include "vp8/common/treecoder.h"
19 21
@@ -48,7 +50,9 @@ static INLINE unsigned int vp8_cost_branch(const unsigned int ct[2], · 28 unmodified lines
48 vp8_prob p) {50 vp8_prob p) {
49 /* Imitate existing calculation */51 /* Imitate existing calculation */
50 52
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);
52}56}
53 57
54/* Small functions to write explicit values and tokens, as well as58/* 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