diff options
author | Scott LaVarnway <slavarnway@google.com> | 2016-03-30 04:47:39 -0700 |
---|---|---|
committer | Scott LaVarnway <slavarnway@google.com> | 2016-03-30 04:47:39 -0700 |
commit | ba962a5f370d85a5fb8abf8aa67c7d5fb416f01c (patch) | |
tree | 3d2c797531e32765d8ae4100165b290589a82b85 /vp9/common | |
parent | aea8d97a74ae8102a864baa1439dd4f4f25555e9 (diff) | |
download | libvpx-ba962a5f370d85a5fb8abf8aa67c7d5fb416f01c.tar libvpx-ba962a5f370d85a5fb8abf8aa67c7d5fb416f01c.tar.gz libvpx-ba962a5f370d85a5fb8abf8aa67c7d5fb416f01c.tar.bz2 libvpx-ba962a5f370d85a5fb8abf8aa67c7d5fb416f01c.zip |
VP9: Eliminate up_available and left_available
Use above_mi and left_mi instead.
Change-Id: I0b50e232c31d11da30aa2fb6f91a695aaf725e0c
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_blockd.h | 3 | ||||
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 16 | ||||
-rw-r--r-- | vp9/common/vp9_pred_common.c | 24 | ||||
-rw-r--r-- | vp9/common/vp9_pred_common.h | 4 | ||||
-rw-r--r-- | vp9/common/vp9_reconintra.c | 4 |
5 files changed, 18 insertions, 33 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index ae2f66a4a..3ff86b432 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -158,9 +158,6 @@ typedef struct macroblockd { MODE_INFO *left_mi; MODE_INFO *above_mi; - int up_available; - int left_available; - const vpx_prob (*partition_probs)[PARTITION_TYPES - 1]; /* Distance of MB away from frame edges */ diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index fd674cbc6..3fd935e62 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -404,20 +404,8 @@ static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile, xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8; // Are edges available for intra prediction? - xd->up_available = (mi_row != 0); - xd->left_available = (mi_col > tile->mi_col_start); - // TODO(slavarnway): eliminate up/left available ??? - if (xd->up_available) { - xd->above_mi = xd->mi[-xd->mi_stride]; - } else { - xd->above_mi = NULL; - } - - if (xd->left_available) { - xd->left_mi = xd->mi[-1]; - } else { - xd->left_mi = NULL; - } + xd->above_mi = (mi_row != 0) ? xd->mi[-xd->mi_stride] : NULL; + xd->left_mi = (mi_col > tile->mi_col_start) ? xd->mi[-1] : NULL; } static INLINE void update_partition_context(MACROBLOCKD *xd, diff --git a/vp9/common/vp9_pred_common.c b/vp9/common/vp9_pred_common.c index c201890a8..92dc85ad4 100644 --- a/vp9/common/vp9_pred_common.c +++ b/vp9/common/vp9_pred_common.c @@ -20,10 +20,10 @@ int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) { // left of the entries corresponding to real macroblocks. // The prediction flags in these dummy entries are initialized to 0. const MODE_INFO *const left_mi = xd->left_mi; - const int left_type = xd->left_available && is_inter_block(left_mi) ? + const int left_type = left_mi && is_inter_block(left_mi) ? left_mi->interp_filter : SWITCHABLE_FILTERS; const MODE_INFO *const above_mi = xd->above_mi; - const int above_type = xd->up_available && is_inter_block(above_mi) ? + const int above_type = above_mi && is_inter_block(above_mi) ? above_mi->interp_filter : SWITCHABLE_FILTERS; if (left_type == above_type) @@ -46,8 +46,8 @@ int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) { int vp9_get_intra_inter_context(const MACROBLOCKD *xd) { const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; + const int has_above = !!above_mi; + const int has_left = !!left_mi; if (has_above && has_left) { // both edges available const int above_intra = !is_inter_block(above_mi); @@ -66,8 +66,8 @@ int vp9_get_reference_mode_context(const VP9_COMMON *cm, int ctx; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; + const int has_above = !!above_mi; + const int has_left = !!left_mi; // Note: // The mode info data structure has a one element border above and to the // left of the entries corresponding to real macroblocks. @@ -109,8 +109,8 @@ int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, int pred_context; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; - const int above_in_image = xd->up_available; - const int left_in_image = xd->left_available; + const int above_in_image = !!above_mi; + const int left_in_image = !!left_mi; // Note: // The mode info data structure has a one element border above and to the @@ -190,8 +190,8 @@ int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) { int pred_context; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; + const int has_above = !!above_mi; + const int has_left = !!left_mi; // Note: // The mode info data structure has a one element border above and to the // left of the entries corresponding to real macroblocks. @@ -256,8 +256,8 @@ int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) { int pred_context; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; + const int has_above = !!above_mi; + const int has_left = !!left_mi; // Note: // The mode info data structure has a one element border above and to the diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h index 254cb8b74..494286226 100644 --- a/vp9/common/vp9_pred_common.h +++ b/vp9/common/vp9_pred_common.h @@ -113,8 +113,8 @@ static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { const int max_tx_size = max_txsize_lookup[xd->mi[0]->sb_type]; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; - const int has_above = xd->up_available; - const int has_left = xd->left_available; + const int has_above = !!above_mi; + const int has_left = !!left_mi; int above_ctx = (has_above && !above_mi->skip) ? (int)above_mi->tx_size : max_tx_size; int left_ctx = (has_left && !left_mi->skip) ? (int)left_mi->tx_size diff --git a/vp9/common/vp9_reconintra.c b/vp9/common/vp9_reconintra.c index 13a95ae8f..c4d91c825 100644 --- a/vp9/common/vp9_reconintra.c +++ b/vp9/common/vp9_reconintra.c @@ -425,8 +425,8 @@ void vp9_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int aoff, int loff, int plane) { const int bw = (1 << bwl_in); const int txw = (1 << tx_size); - const int have_top = loff || xd->up_available; - const int have_left = aoff || xd->left_available; + const int have_top = loff || (xd->above_mi != NULL); + const int have_left = aoff || (xd->left_mi != NULL); const int have_right = (aoff + txw) < bw; const int x = aoff * 4; const int y = loff * 4; |