ref: 22a3e30790d141033778e430a47ba7d558237362
parent: 01aae92dcfb879c7b5a965f40e46f1beec77a30a
author: Dmitry Kovalev <[email protected]>
date: Mon Apr 7 12:01:34 EDT 2014
Converting set_prev_mi() to get_prev_mi(). Change-Id: Iad4002d7aecaae0e25d88e286bacde7e6cd7264f
--- a/vp9/common/vp9_mvref_common.c
+++ b/vp9/common/vp9_mvref_common.c
@@ -195,7 +195,7 @@
int block, int mi_row, int mi_col) {
const int *ref_sign_bias = cm->ref_frame_sign_bias;
int i, refmv_count = 0;
- const MODE_INFO *prev_mi = cm->coding_use_prev_mi && cm->prev_mi
+ const MODE_INFO *prev_mi = cm->prev_mi
? cm->prev_mi_grid_visible[mi_row * xd->mi_stride + mi_col]
: NULL;
const MB_MODE_INFO *const prev_mbmi = prev_mi ? &prev_mi->mbmi : NULL;
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -281,15 +281,15 @@
xd->left_available = (mi_col > tile->mi_col_start);
}
-static INLINE void set_prev_mi(VP9_COMMON *cm) {
- const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
- cm->height == cm->last_height &&
- !cm->intra_only &&
- cm->last_show_frame;
+static INLINE MODE_INFO *get_prev_mi(VP9_COMMON *cm) {
+ const int use_prev_mi = cm->coding_use_prev_mi &&
+ cm->width == cm->last_width &&
+ cm->height == cm->last_height &&
+ !cm->intra_only &&
+ cm->last_show_frame;
// Special case: set prev_mi to NULL when the previous mode info
// context cannot be used.
- cm->prev_mi = use_prev_in_find_mv_refs ?
- cm->prev_mip + cm->mi_stride + 1 : NULL;
+ return use_prev_mi ? &cm->prev_mip[cm->mi_stride + 1] : NULL;
}
static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) {
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -1288,11 +1288,7 @@
}
init_macroblockd(cm, &pbi->mb);
-
- if (cm->coding_use_prev_mi)
- set_prev_mi(cm);
- else
- cm->prev_mi = NULL;
+ cm->prev_mi = get_prev_mi(cm);
setup_plane_dequants(cm, xd, cm->base_qindex);
vp9_setup_block_planes(xd, cm->subsampling_x, cm->subsampling_y);
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3084,7 +3084,7 @@
vp9_zero(cpi->rd_tx_select_diff);
vp9_zero(cpi->rd_tx_select_threshes);
- set_prev_mi(cm);
+ cm->prev_mi = get_prev_mi(cm);
if (cpi->sf.use_nonrd_pick_mode) {
// Initialize internal buffer pointers for rtc coding, where non-RD