shithub: libvpx

Download patch

ref: f9a13a1786e3ab2a35f9f5a97731ec6d05421dda
parent: 1f41c0d37f59d3099260b435a87a6f89de404695
author: Johann <johannkoenig@google.com>
date: Wed Mar 14 09:25:05 EDT 2018

vp8 rdopt.c: zero rd.[rate_uv|distortion_uv]

These values are not consistently set before calling update_best_mode.

In vp9_rdopt.c they are individual values instead of a struct and are
zero'd at declaration.

Clears a static analysis warning:
warning: The right operand of '-' is a garbage value
RDCOST(x->rdmult, x->rddiv, (rd->rate2 - rd->rate_uv - other_cost),

warning: The right operand of '-' is a garbage value
(rd->distortion2 - rd->distortion_uv));

Change-Id: I19895d062e7c0ac67937126ebc5dcb0afd3a2931

--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -1779,6 +1779,10 @@
                best_rd_sse = UINT_MAX;
 #endif
 
+  // _uv variables are not set consistantly before calling update_best_mode.
+  rd.rate_uv = 0;
+  rd.distortion_uv = 0;
+
   mode_mv = mode_mv_sb[sign_bias];
   best_ref_mv.as_int = 0;
   best_mode.rd = INT_MAX;