diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 7c7ae6db8..16244e025 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -391,10 +391,9 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd, static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, PARTITION_TYPE partition) { - BLOCK_SIZE_TYPE subsize; + BLOCK_SIZE_TYPE subsize = bsize; switch (partition) { case PARTITION_NONE: - subsize = bsize; break; case PARTITION_HORZ: if (bsize == BLOCK_SIZE_SB64X64) diff --git a/vp9/common/vp9_entropymv.c b/vp9/common/vp9_entropymv.c index a62fa476a..50e8463f6 100644 --- a/vp9/common/vp9_entropymv.c +++ b/vp9/common/vp9_entropymv.c @@ -85,7 +85,7 @@ const nmv_context vp9_default_nmv_context = { #define mv_class_base(c) ((c) ? (CLASS0_SIZE << (c + 2)) : 0) MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) { - MV_CLASS_TYPE c; + MV_CLASS_TYPE c = MV_CLASS_0; if (z < CLASS0_SIZE * 8) c = MV_CLASS_0; else if (z < CLASS0_SIZE * 16) c = MV_CLASS_1; else if (z < CLASS0_SIZE * 32) c = MV_CLASS_2; diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c index f331a8f85..265a19ab1 100644 --- a/vp9/common/vp9_reconinter.c +++ b/vp9/common/vp9_reconinter.c @@ -365,17 +365,16 @@ static void build_inter_predictors(int plane, int block, MACROBLOCKD * const xd = arg->xd; const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x; const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y; - const int bh = 4 << bhl, bw = 4 << bwl; const int x = 4 * (block & ((1 << bwl) - 1)), y = 4 * (block >> bwl); const int use_second_ref = xd->mode_info_context->mbmi.ref_frame[1] > 0; int which_mv; - assert(x < bw); - assert(y < bh); + assert(x < (4 << bwl)); + assert(y < (4 << bhl)); assert(xd->mode_info_context->mbmi.sb_type < BLOCK_SIZE_SB8X8 || - 4 << pred_w == bw); + 4 << pred_w == (4 << bwl)); assert(xd->mode_info_context->mbmi.sb_type < BLOCK_SIZE_SB8X8 || - 4 << pred_h == bh); + 4 << pred_h == (4 << bhl)); for (which_mv = 0; which_mv < 1 + use_second_ref; ++which_mv) { // source diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 6885c77db..c36cf796c 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -629,7 +629,7 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc, int bsl = b_width_log2(bsize); int bs = (1 << bsl) / 4; // mode_info step for subsize int n; - PARTITION_TYPE partition; + PARTITION_TYPE partition = PARTITION_NONE; BLOCK_SIZE_TYPE subsize; if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index ce81e0583..9c04d8a7a 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -324,9 +324,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, int mb_mode_index = ctx->best_mode_index; const int mis = cpi->common.mode_info_stride; const int bh = 1 << mi_height_log2(bsize), bw = 1 << mi_width_log2(bsize); - const MB_PREDICTION_MODE mb_mode = mi->mbmi.mode; - assert(mb_mode < MB_MODE_COUNT); + assert(mi->mbmi.mode < MB_MODE_COUNT); assert(mb_mode_index < MAX_MODES); assert(mi->mbmi.ref_frame[0] < MAX_REF_FRAMES); assert(mi->mbmi.ref_frame[1] < MAX_REF_FRAMES); @@ -1170,7 +1169,7 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp, int mh = bh / 2; int bss = (1 << bsl) / 4; int i, pl; - PARTITION_TYPE partition; + PARTITION_TYPE partition = PARTITION_NONE; BLOCK_SIZE_TYPE subsize; ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE]; PARTITION_CONTEXT sl[8], sa[8]; @@ -1421,6 +1420,8 @@ static void rd_pick_partition(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int srate = INT_MAX; int64_t sdist = INT_MAX; + (void) *tp_orig; + if (bsize < BLOCK_SIZE_SB8X8) if (xd->ab_index != 0) { *rate = 0; @@ -1928,13 +1929,13 @@ static void reset_skip_txfm_size_b(VP9_COMP *cpi, MODE_INFO *mi, int mis, if (mbmi->txfm_size > txfm_max) { MACROBLOCK * const x = &cpi->mb; MACROBLOCKD * const xd = &x->e_mbd; - const int segment_id = mbmi->segment_id; const int ymbs = MIN(bh, cm->mi_rows - mi_row); const int xmbs = MIN(bw, cm->mi_cols - mi_col); xd->mode_info_context = mi; assert( - vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP) || get_skip_flag(mi, mis, ymbs, xmbs)); + vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_SKIP) || + get_skip_flag(mi, mis, ymbs, xmbs)); set_txfm_flag(mi, mis, ymbs, xmbs, txfm_max); } } diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index e42b6a4b6..fbd437424 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -478,8 +478,8 @@ static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE_TYPE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int *out_rate_sum, int64_t *out_dist_sum, int *out_skip) { - int t, j, k; - enum BlockSize bs; + int t = 4, j, k; + enum BlockSize bs = BLOCK_4X4; struct macroblock_plane *const p = &x->plane[0]; struct macroblockd_plane *const pd = &xd->plane[0]; const int bw = plane_block_width(bsize, pd); @@ -551,26 +551,25 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb, int pt; int c = 0; int cost = 0; - const int16_t *scan, *nb; + const int16_t *scan = NULL, *nb; const int eob = xd->plane[plane].eobs[block]; const int16_t *qcoeff_ptr = BLOCK_OFFSET(xd->plane[plane].qcoeff, block, 16); const int ref = mbmi->ref_frame[0] != INTRA_FRAME; unsigned int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] = mb->token_costs[tx_size][type][ref]; - ENTROPY_CONTEXT above_ec, left_ec; + ENTROPY_CONTEXT above_ec = 0, left_ec = 0; TX_TYPE tx_type = DCT_DCT; const int segment_id = xd->mode_info_context->mbmi.segment_id; - int seg_eob; + int seg_eob = 0; uint8_t token_cache[1024]; - const uint8_t * band_translate; + const uint8_t *band_translate = NULL; // Check for consistency of tx_size with mode info assert((!type && !plane) || (type && plane)); if (type == PLANE_TYPE_Y_WITH_DC) { assert(xd->mode_info_context->mbmi.txfm_size == tx_size); } else { - TX_SIZE tx_size_uv = get_uv_tx_size(mbmi); - assert(tx_size == tx_size_uv); + assert(tx_size == get_uv_tx_size(mbmi)); } switch (tx_size) {