From f9a13a1786e3ab2a35f9f5a97731ec6d05421dda Mon Sep 17 00:00:00 2001 From: Johann Date: Wed, 14 Mar 2018 13:25:05 -0700 Subject: 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 --- vp8/encoder/rdopt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vp8') diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index fa5dde15d..2951ca4fd 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -1779,6 +1779,10 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, 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; -- cgit v1.2.3