Commit 0154f2b5 authored by Yaowu Xu's avatar Yaowu Xu

Fix several static analysis warnings

1. reduce the scope of low_qc_cost in encodetxb.c
2. add initialization of signs[] in decodetxb.c

Change-Id: I8dfb9f69c064ec3d23752df7aaec95249f270c22
parent 0f191dac
......@@ -89,7 +89,7 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
uint8_t levels_buf[TX_PAD_2D];
uint8_t *const levels = set_levels(levels_buf, width);
DECLARE_ALIGNED(16, uint8_t, level_counts[MAX_TX_SQUARE]);
int8_t signs[MAX_TX_SQUARE];
int8_t signs[MAX_TX_SQUARE] = { 0 };
uint16_t update_pos[MAX_TX_SQUARE];
const int all_zero = av1_read_record_bin(
......
......@@ -329,11 +329,9 @@ static void get_dist_cost_stats(LevelDownStats *const stats, const int scan_idx,
stats->rd = RDCOST(txb_info->rdmult, stats->rate, stats->dist);
stats->low_qc = get_lower_coeff(qc);
int low_qc_cost;
#if CONFIG_LV_MAP_MULTI
if (is_eob && stats->low_qc == 0) {
low_qc_cost = qc_cost;
stats->rd_low = stats->rd; // disable selection of low_qc in this case.
} else {
#else
......@@ -346,11 +344,11 @@ static void get_dist_cost_stats(LevelDownStats *const stats, const int scan_idx,
dqv, txb_info->shift);
const int64_t low_dqc_dist =
get_coeff_dist(tqc, stats->low_dqc, txb_info->shift);
low_qc_cost = get_coeff_cost(stats->low_qc, scan_idx,
const int low_qc_cost = get_coeff_cost(stats->low_qc, scan_idx,
#if CONFIG_LV_MAP_MULTI
is_eob,
is_eob,
#endif
txb_info, txb_costs, coeff_ctx);
txb_info, txb_costs, coeff_ctx);
stats->dist_low = low_dqc_dist - stats->dist0;
stats->rate_low = low_qc_cost;
stats->rd_low = RDCOST(txb_info->rdmult, stats->rate_low, stats->dist_low);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment