Unified · Split
| @@ -14,6 +14,8 @@ · 13 unmodified lines | |||
| 14 | /* Trees map alphabets into huffman-like codes suitable for an arithmetic | 14 | /* 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 as | 58 | /* Small functions to write explicit values and tokens, as well as |