summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorJorge E. Moreira <jemoreira@google.com>2020-05-08 15:14:48 -0700
committerJorge E. Moreira <jemoreira@google.com>2020-05-08 15:30:26 -0700
commite8b818b581b9ab7e9c8f7b1becd753dd4efbdf43 (patch)
tree3259e5690fb323481541cf75df42c247ab16370f /vp8
parent2d0f3b23a908bb54dbeddf6d1dcc666600470e2e (diff)
downloadlibvpx-e8b818b581b9ab7e9c8f7b1becd753dd4efbdf43.tar
libvpx-e8b818b581b9ab7e9c8f7b1becd753dd4efbdf43.tar.gz
libvpx-e8b818b581b9ab7e9c8f7b1becd753dd4efbdf43.tar.bz2
libvpx-e8b818b581b9ab7e9c8f7b1becd753dd4efbdf43.zip
Don't collect stats if they won't be used
When the encoder is run continuously for a few minutes at 60 fps, the total_target_vs_actual field overflows. Since this field is a signed integer that's considered undefined behavior in C++, which causes an abort when used in an android binary (those run with ubsan enabled) Bug: b/154172422 Test: run cuttelfish with webrtc enabled for an hour Change-Id: I8f7d9d0884311a6338bdcdec76348b8cc3ce8c69
Diffstat (limited to 'vp8')
-rw-r--r--vp8/encoder/onyx_if.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 3f5b9816d..dccc6ebb1 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -4533,9 +4533,11 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
/* Actual bits spent */
cpi->total_actual_bits += cpi->projected_frame_size;
+#if 0 && CONFIG_INTERNAL_STATS
/* Debug stats */
cpi->total_target_vs_actual +=
(cpi->this_frame_target - cpi->projected_frame_size);
+#endif
cpi->buffer_level = cpi->bits_off_target;