ref: e993fb5e24123bd988e370ee0a0be567f6d73623
parent: 8e9c9f118cda45013f14cce7961dcc8df78ffebf
author: Yaowu Xu <yaowu@google.com>
date: Thu Mar 20 15:35:06 EDT 2014
Fix a valgrind error Valgrind was complaining uninitialzed values are being used. Change-Id: Ia9eb619f4e67d1fb7af1057d50304f15adc02aab
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2705,8 +2705,8 @@
const int mis = cm->mode_info_stride;
PARTITION_TYPE partition;
BLOCK_SIZE subsize;
- int rate;
- int64_t dist;
+ int rate = INT_MAX;
+ int64_t dist = INT64_MAX;
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
return;
@@ -2753,7 +2753,6 @@
break;
case PARTITION_SPLIT:
subsize = get_subsize(bsize, PARTITION_SPLIT);
-
*get_sb_index(x, subsize) = 0;
nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col,
subsize, output_enabled, totrate, totdist);
@@ -2810,8 +2809,8 @@
// Code each SB in the row
for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end;
mi_col += MI_BLOCK_SIZE) {
- int dummy_rate;
- int64_t dummy_dist;
+ int dummy_rate = 0;
+ int64_t dummy_dist = 0;
const int idx_str = cm->mode_info_stride * mi_row + mi_col;
MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
@@ -2828,8 +2827,8 @@
else if (cpi->sf.partition_search_type == REFERENCE_PARTITION) {
if (cpi->sf.partition_check) {
MACROBLOCK *x = &cpi->mb;
- int rate1, rate2, rate3;
- int64_t dist1, dist2, dist3;
+ int rate1 = 0, rate2 = 0, rate3 = 0;
+ int64_t dist1 = 0, dist2 = 0, dist3 = 0;
set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, BLOCK_8X8);
nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
0, &rate1, &dist1);
--
⑨