]> granicus.if.org Git - libvpx/commitdiff
rdopt: fix use of uninitialized value in addition
authorJames Zern <jzern@google.com>
Mon, 5 Nov 2012 20:50:16 +0000 (12:50 -0800)
committerJames Zern <jzern@google.com>
Mon, 5 Nov 2012 20:50:16 +0000 (12:50 -0800)
rd_pick_intra4x4mby_modes / rd_pick_intra8x8mby_modes would both use the
input value of 'rate_y' in the return calculation. In many places this
value is uninitialized. Remove the unneeded sum.

Change-Id: Icbd3df685303000301e69291c0ebc06f74bd548d

vp9/encoder/rdopt.c

index 71b8a2ea7eed1dcfa793bf1c3ef41e39cbf8cdb9..ffff248acc0377c83d3bd5b981356198cbebf1fd 100644 (file)
@@ -1180,7 +1180,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rat
   cost += vp9_cost_bit(128, allow_comp);
 #endif
   *Rate = cost;
-  *rate_y += tot_rate_y;
+  *rate_y = tot_rate_y;
   *Distortion = distortion;
 
   return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);
@@ -1516,7 +1516,7 @@ static int64_t rd_pick_intra8x8mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
 #endif
   }
   *Rate = cost;
-  *rate_y += tot_rate_y;
+  *rate_y = tot_rate_y;
   *Distortion = distortion;
   return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);
 }