projects
/
platform
/
upstream
/
libvpx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e3dd49
)
Prevent overflow in variance32x32.
author
Ronald S. Bultje
<rbultje@google.com>
Wed, 14 Nov 2012 23:02:43 +0000
(15:02 -0800)
committer
Ronald S. Bultje
<rbultje@google.com>
Wed, 14 Nov 2012 23:18:21 +0000
(15:18 -0800)
Change-Id: I478878c78ef8a770186622d987d318176827ef5f
vp9/encoder/variance_c.c
patch
|
blob
|
history
diff --git
a/vp9/encoder/variance_c.c
b/vp9/encoder/variance_c.c
index 8ac956e95fbb5689400ce19cad0f392f56c64ce4..7703ef0c20cac8e8ca6ee9184cb9af7e9f074a18 100644
(file)
--- a/
vp9/encoder/variance_c.c
+++ b/
vp9/encoder/variance_c.c
@@
-12,7
+12,7
@@
#include "variance.h"
#include "vp9/common/filter.h"
#include "vp9/common/subpelvar.h"
-
+#include "vpx/vpx_integer.h"
unsigned int vp9_get_mb_ss_c(const short *src_ptr) {
unsigned int i, sum = 0;
@@
-37,8
+37,7
@@
unsigned int vp9_variance32x32_c(const unsigned char *src_ptr,
variance(src_ptr, source_stride, ref_ptr, recon_stride, 32, 32, &var, &avg);
*sse = var;
- // TODO(rbultje): in extreme cases these products will rollover.
- return (var - (((unsigned int)avg * avg) >> 10));
+ return (var - (((int64_t)avg * avg) >> 10));
}
#endif