Commit c0504a9b authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review

Merge "Merge SB8X8 into the codebase" into experimental

parents 9c7d06e6 776c1482
......@@ -249,7 +249,6 @@ EXPERIMENT_LIST="
oneshotq
multiple_arf
code_zerogroup
sb8x8
non420
"
CONFIG_LIST="
......
This diff is collapsed.
......@@ -16,7 +16,6 @@
#include "vpx_mem/vpx_mem.h"
static const unsigned int kf_y_mode_cts[8][VP9_YMODES] = {
#if CONFIG_SB8X8
/* DC V H D45 135 117 153 D27 D63 TM i4X4 */
{12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 200},
{25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 160},
......@@ -26,27 +25,11 @@ static const unsigned int kf_y_mode_cts[8][VP9_YMODES] = {
{68, 33, 35, 8, 8, 8, 8, 8, 8, 17, 68},
{78, 38, 38, 8, 8, 8, 8, 8, 8, 19, 52},
{89, 42, 42, 8, 8, 8, 8, 8, 8, 21, 34},
#else
/* DC V H D45 135 117 153 D27 D63 TM i8x8 i4X4 */
{12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 22, 200},
{25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 27, 160},
{31, 17, 18, 8, 8, 8, 8, 8, 8, 9, 26, 139},
{40, 22, 23, 8, 8, 8, 8, 8, 8, 12, 27, 116},
{53, 26, 28, 8, 8, 8, 8, 8, 8, 13, 26, 94},
{68, 33, 35, 8, 8, 8, 8, 8, 8, 17, 20, 68},
{78, 38, 38, 8, 8, 8, 8, 8, 8, 19, 16, 52},
{89, 42, 42, 8, 8, 8, 8, 8, 8, 21, 12, 34},
#endif
};
static const unsigned int y_mode_cts [VP9_YMODES] = {
#if CONFIG_SB8X8
/* DC V H D45 135 117 153 D27 D63 TM i4X4 */
98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 70
#else
/* DC V H D45 135 117 153 D27 D63 TM i8x8 i4X4 */
98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 16, 70
#endif
};
static const unsigned int uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
......@@ -61,19 +44,9 @@ static const unsigned int uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
{ 150, 15, 10, 10, 10, 10, 10, 75, 10, 6}, /* D27 */
{ 150, 15, 10, 10, 10, 10, 10, 10, 75, 6}, /* D63 */
{ 160, 30, 30, 10, 10, 10, 10, 10, 10, 16}, /* TM */
#if !CONFIG_SB8X8
{ 132, 46, 40, 10, 10, 10, 10, 10, 10, 18}, /* i8x8 - never used */
#endif
{ 150, 35, 41, 10, 10, 10, 10, 10, 10, 10}, /* i4X4 */
};
#if !CONFIG_SB8X8
static const unsigned int i8x8_mode_cts [VP9_I8X8_MODES] = {
/* DC V H D45 135 117 153 D27 D63 TM */
73, 49, 61, 30, 30, 30, 30, 30, 30, 13
};
#endif
static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
// DC V H D45 135 117 153 D27 D63 TM
{ 160, 24, 24, 20, 20, 20, 20, 20, 20, 8}, /* DC */
......@@ -86,9 +59,6 @@ static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
{ 102, 33, 20, 20, 20, 20, 20, 64, 20, 14}, /* D27 */
{ 102, 33, 20, 20, 20, 20, 20, 20, 64, 14}, /* D63 */
{ 132, 36, 30, 20, 20, 20, 20, 20, 20, 18}, /* TM */
#if !CONFIG_SB8X8
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* i8x8 - never used */
#endif
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* I4X4 */
};
......@@ -146,45 +116,13 @@ const vp9_prob vp9_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP9_SUBMVREFS - 1] = {
{ 208, 1, 1 }
};
#if !CONFIG_SB8X8
vp9_mbsplit vp9_mbsplits [VP9_NUMMBSPLITS] = {
{
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1,
1, 1, 1, 1,
}, {
0, 0, 1, 1,
0, 0, 1, 1,
0, 0, 1, 1,
0, 0, 1, 1,
}, {
0, 0, 1, 1,
0, 0, 1, 1,
2, 2, 3, 3,
2, 2, 3, 3,
}, {
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15,
},
};
const int vp9_mbsplit_count [VP9_NUMMBSPLITS] = { 2, 2, 4, 16};
const vp9_prob vp9_mbsplit_probs [VP9_NUMMBSPLITS - 1] = { 110, 111, 150};
#endif
const vp9_prob vp9_partition_probs[NUM_PARTITION_CONTEXTS]
[PARTITION_TYPES - 1] = {
#if CONFIG_SB8X8
// FIXME(jingning,rbultje) put real probabilities here
{202, 162, 107},
{16, 2, 169},
{3, 246, 19},
{104, 90, 134},
#endif
{202, 162, 107},
{16, 2, 169},
{3, 246, 19},
......@@ -260,12 +198,7 @@ const vp9_tree_index vp9_ymode_tree[VP9_YMODES * 2 - 2] = {
-D27_PRED, -D63_PRED,
16, 18,
-V_PRED, -H_PRED,
#if CONFIG_SB8X8
-TM_PRED, -I4X4_PRED
#else
-TM_PRED, 20,
-I4X4_PRED, -I8X8_PRED
#endif
};
const vp9_tree_index vp9_kf_ymode_tree[VP9_YMODES * 2 - 2] = {
......@@ -278,28 +211,9 @@ const vp9_tree_index vp9_kf_ymode_tree[VP9_YMODES * 2 - 2] = {
-D27_PRED, -D63_PRED,
16, 18,
-V_PRED, -H_PRED,
#if CONFIG_SB8X8
-TM_PRED, -I4X4_PRED
#else
-TM_PRED, 20,
-I4X4_PRED, -I8X8_PRED
#endif
};
#if !CONFIG_SB8X8
const vp9_tree_index vp9_i8x8_mode_tree[VP9_I8X8_MODES * 2 - 2] = {
2, 14,
-DC_PRED, 4,
6, 8,
-D45_PRED, -D135_PRED,
10, 12,
-D117_PRED, -D153_PRED,
-D27_PRED, -D63_PRED,
-V_PRED, 16,
-H_PRED, -TM_PRED
};
#endif
const vp9_tree_index vp9_uv_mode_tree[VP9_UV_MODES * 2 - 2] = {
2, 14,
-DC_PRED, 4,
......@@ -312,14 +226,6 @@ const vp9_tree_index vp9_uv_mode_tree[VP9_UV_MODES * 2 - 2] = {
-H_PRED, -TM_PRED
};
#if !CONFIG_SB8X8
const vp9_tree_index vp9_mbsplit_tree[6] = {
-PARTITIONING_4X4, 2,
-PARTITIONING_8X8, 4,
-PARTITIONING_16X8, -PARTITIONING_8X16,
};
#endif
const vp9_tree_index vp9_mv_ref_tree[8] = {
-ZEROMV, 2,
-NEARESTMV, 4,
......@@ -352,10 +258,6 @@ struct vp9_token vp9_sb_ymode_encodings[VP9_I32X32_MODES];
struct vp9_token vp9_sb_kf_ymode_encodings[VP9_I32X32_MODES];
struct vp9_token vp9_kf_ymode_encodings[VP9_YMODES];
struct vp9_token vp9_uv_mode_encodings[VP9_UV_MODES];
#if !CONFIG_SB8X8
struct vp9_token vp9_i8x8_mode_encodings[VP9_I8X8_MODES];
struct vp9_token vp9_mbsplit_encodings[VP9_NUMMBSPLITS];
#endif
struct vp9_token vp9_mv_ref_encoding_array[VP9_MVREFS];
struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_MVREFS];
......@@ -386,16 +288,8 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
bct, uv_mode_cts[i], 0);
}
#if !CONFIG_SB8X8
vp9_tree_probs_from_distribution(vp9_i8x8_mode_tree, x->fc.i8x8_mode_prob,
bct, i8x8_mode_cts, 0);
#endif
vpx_memcpy(x->fc.sub_mv_ref_prob, vp9_sub_mv_ref_prob2,
sizeof(vp9_sub_mv_ref_prob2));
#if !CONFIG_SB8X8
vpx_memcpy(x->fc.mbsplit_prob, vp9_mbsplit_probs, sizeof(vp9_mbsplit_probs));
#endif
vpx_memcpy(x->fc.switchable_interp_prob, vp9_switchable_interp_prob,
sizeof(vp9_switchable_interp_prob));
......@@ -499,10 +393,6 @@ void vp9_entropy_mode_init() {
vp9_tokens_from_tree(vp9_sb_ymode_encodings, vp9_sb_ymode_tree);
vp9_tokens_from_tree(vp9_sb_kf_ymode_encodings, vp9_sb_kf_ymode_tree);
vp9_tokens_from_tree(vp9_uv_mode_encodings, vp9_uv_mode_tree);
#if !CONFIG_SB8X8
vp9_tokens_from_tree(vp9_i8x8_mode_encodings, vp9_i8x8_mode_tree);
vp9_tokens_from_tree(vp9_mbsplit_encodings, vp9_mbsplit_tree);
#endif
vp9_tokens_from_tree(vp9_switchable_interp_encodings,
vp9_switchable_interp_tree);
vp9_tokens_from_tree(vp9_partition_encodings, vp9_partition_tree);
......@@ -681,11 +571,6 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
update_mode_probs(VP9_NKF_BINTRAMODES, vp9_bmode_tree,
fc->bmode_counts, fc->pre_bmode_prob,
fc->bmode_prob, 0);
#if !CONFIG_SB8X8
update_mode_probs(VP9_I8X8_MODES,
vp9_i8x8_mode_tree, fc->i8x8_mode_counts,
fc->pre_i8x8_mode_prob, fc->i8x8_mode_prob, 0);
#endif
for (i = 0; i < SUBMVREF_COUNT; ++i)
update_mode_probs(VP9_SUBMVREFS,
......@@ -693,11 +578,6 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
fc->pre_sub_mv_ref_prob[i], fc->sub_mv_ref_prob[i],
LEFT4X4);
#if !CONFIG_SB8X8
update_mode_probs(VP9_NUMMBSPLITS, vp9_mbsplit_tree,
fc->mbsplit_counts, fc->pre_mbsplit_prob,
fc->mbsplit_prob, 0);
#endif
#if CONFIG_COMP_INTERINTRA_PRED
if (cm->use_interintra) {
int factor, interintra_prob, count;
......
......@@ -15,9 +15,6 @@
#include "vp9/common/vp9_treecoder.h"
#define SUBMVREF_COUNT 5
#if !CONFIG_SB8X8
#define VP9_NUMMBSPLITS 4
#endif
#if CONFIG_COMP_INTERINTRA_PRED
#define VP9_DEF_INTERINTRA_PROB 248
......@@ -26,16 +23,6 @@
#define SEPARATE_INTERINTRA_UV 0
#endif
#if !CONFIG_SB8X8
typedef const int vp9_mbsplit[16];
extern vp9_mbsplit vp9_mbsplits[VP9_NUMMBSPLITS];
extern const int vp9_mbsplit_count[VP9_NUMMBSPLITS]; /* # of subsets */
extern const vp9_prob vp9_mbsplit_probs[VP9_NUMMBSPLITS - 1];
#endif
extern int vp9_mv_cont(const int_mv *l, const int_mv *a);
extern const vp9_prob vp9_sub_mv_ref_prob2[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
......@@ -52,10 +39,6 @@ extern const vp9_tree_index vp9_kf_ymode_tree[];
extern const vp9_tree_index vp9_uv_mode_tree[];
#define vp9_sb_ymode_tree vp9_uv_mode_tree
#define vp9_sb_kf_ymode_tree vp9_uv_mode_tree
#if !CONFIG_SB8X8
extern const vp9_tree_index vp9_i8x8_mode_tree[];
extern const vp9_tree_index vp9_mbsplit_tree[];
#endif
extern const vp9_tree_index vp9_mv_ref_tree[];
extern const vp9_tree_index vp9_sb_mv_ref_tree[];
extern const vp9_tree_index vp9_sub_mv_ref_tree[];
......@@ -67,10 +50,6 @@ extern struct vp9_token vp9_sb_ymode_encodings[VP9_I32X32_MODES];
extern struct vp9_token vp9_sb_kf_ymode_encodings[VP9_I32X32_MODES];
extern struct vp9_token vp9_kf_ymode_encodings[VP9_YMODES];
extern struct vp9_token vp9_uv_mode_encodings[VP9_UV_MODES];
#if !CONFIG_SB8X8
extern struct vp9_token vp9_i8x8_mode_encodings[VP9_I8X8_MODES];
extern struct vp9_token vp9_mbsplit_encodings[VP9_NUMMBSPLITS];
#endif
/* Inter mode values do not start at zero */
......
......@@ -13,22 +13,16 @@
#include "./vpx_config.h"
#if CONFIG_SB8X8
#define LOG2_MI_SIZE 3
#else
#define LOG2_MI_SIZE 4
#endif
#define MI_SIZE (1 << LOG2_MI_SIZE)
#define MI_UV_SIZE (1 << (LOG2_MI_SIZE - 1))
typedef enum BLOCK_SIZE_TYPE {
BLOCK_SIZE_AB4X4,
#if CONFIG_SB8X8
BLOCK_SIZE_SB8X8,
BLOCK_SIZE_SB8X16,
BLOCK_SIZE_SB16X8,
#endif
BLOCK_SIZE_MB16X16,
BLOCK_SIZE_SB16X32,
BLOCK_SIZE_SB32X16,
......@@ -47,6 +41,6 @@ typedef enum PARTITION_TYPE {
} PARTITION_TYPE;
#define PARTITION_PLOFFSET 4 // number of probability models per block size
#define NUM_PARTITION_CONTEXTS ((2 + CONFIG_SB8X8) * PARTITION_PLOFFSET)
#define NUM_PARTITION_CONTEXTS (3 * PARTITION_PLOFFSET)
#endif // VP9_COMMON_VP9_ENUMS_H_
......@@ -74,13 +74,9 @@ vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc,
vp9_prob p[VP9_MVREFS - 1],
const int context);
#if !CONFIG_SB8X8
extern const uint8_t vp9_mbsplit_offset[4][16];
#endif
static int left_block_mv(const MACROBLOCKD *xd,
const MODE_INFO *cur_mb, int b) {
if (!(b & (3 >> CONFIG_SB8X8))) {
if (!(b & 1)) {
if (!xd->left_available)
return 0;
......@@ -90,7 +86,7 @@ static int left_block_mv(const MACROBLOCKD *xd,
if (cur_mb->mbmi.mode != SPLITMV)
return cur_mb->mbmi.mv[0].as_int;
b += 4 >> CONFIG_SB8X8;
b += 2;
}
return (cur_mb->bmi + b - 1)->as_mv[0].as_int;
......@@ -98,7 +94,7 @@ static int left_block_mv(const MACROBLOCKD *xd,
static int left_block_second_mv(const MACROBLOCKD *xd,
const MODE_INFO *cur_mb, int b) {
if (!(b & (3 >> CONFIG_SB8X8))) {
if (!(b & 1)) {
if (!xd->left_available)
return 0;
......@@ -108,7 +104,7 @@ static int left_block_second_mv(const MACROBLOCKD *xd,
if (cur_mb->mbmi.mode != SPLITMV)
return cur_mb->mbmi.second_ref_frame > 0 ?
cur_mb->mbmi.mv[1].as_int : cur_mb->mbmi.mv[0].as_int;
b += 4 >> CONFIG_SB8X8;
b += 2;
}
return cur_mb->mbmi.second_ref_frame > 0 ?
......@@ -117,85 +113,69 @@ static int left_block_second_mv(const MACROBLOCKD *xd,
}
static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride) {
if (!(b >> (2 >> CONFIG_SB8X8))) {
if (!(b >> 1)) {
/* On top edge, get from MB above us */
cur_mb -= mi_stride;
if (cur_mb->mbmi.mode != SPLITMV)
return cur_mb->mbmi.mv[0].as_int;
b += 16 >> (2 * CONFIG_SB8X8);
b += 4;
}
return (cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mv[0].as_int;
return (cur_mb->bmi + b - 2)->as_mv[0].as_int;
}
static int above_block_second_mv(const MODE_INFO *cur_mb, int b, int mi_stride) {
if (!(b >> (2 >> CONFIG_SB8X8))) {
if (!(b >> 1)) {
/* On top edge, get from MB above us */
cur_mb -= mi_stride;
if (cur_mb->mbmi.mode != SPLITMV)
return cur_mb->mbmi.second_ref_frame > 0 ?
cur_mb->mbmi.mv[1].as_int : cur_mb->mbmi.mv[0].as_int;
b += 16 >> (2 * CONFIG_SB8X8);
b += 4;
}
return cur_mb->mbmi.second_ref_frame > 0 ?
(cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mv[1].as_int :
(cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mv[0].as_int;
(cur_mb->bmi + b - 2)->as_mv[1].as_int :
(cur_mb->bmi + b - 2)->as_mv[0].as_int;
}
static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
#if CONFIG_SB8X8
// FIXME(rbultje, jingning): temporary hack because jenkins doesn't
// understand this condition. This will go away soon.
if (b == 0 || b == 2) {
#else
if (!(b & (3 >> CONFIG_SB8X8))) {
#endif
/* On L edge, get from MB to left of us */
--cur_mb;
if (cur_mb->mbmi.mode <= TM_PRED) {
return pred_mode_conv(cur_mb->mbmi.mode);
#if !CONFIG_SB8X8
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
return pred_mode_conv(
(MB_PREDICTION_MODE)(cur_mb->bmi + 3 + b)->as_mode.first);
#endif // !CONFIG_SB8X8
} else if (cur_mb->mbmi.mode == I4X4_PRED) {
return ((cur_mb->bmi + (3 >> CONFIG_SB8X8) + b)->as_mode.first);
return ((cur_mb->bmi + 1 + b)->as_mode.first);
} else {
return B_DC_PRED;
}
}
#if CONFIG_SB8X8
assert(b == 1 || b == 3);
#endif
return (cur_mb->bmi + b - 1)->as_mode.first;
}
static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
int b, int mi_stride) {
if (!(b >> (2 >> CONFIG_SB8X8))) {
if (!(b >> 1)) {
/* On top edge, get from MB above us */
cur_mb -= mi_stride;
if (cur_mb->mbmi.mode <= TM_PRED) {
return pred_mode_conv(cur_mb->mbmi.mode);
#if !CONFIG_SB8X8
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
return pred_mode_conv(
(MB_PREDICTION_MODE)(cur_mb->bmi + 12 + b)->as_mode.first);
#endif
} else if (cur_mb->mbmi.mode == I4X4_PRED) {
return ((cur_mb->bmi + (CONFIG_SB8X8 ? 2 : 12) + b)->as_mode.first);
return ((cur_mb->bmi + 2 + b)->as_mode.first);
} else {
return B_DC_PRED;
}
}
return (cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mode.first;
return (cur_mb->bmi + b - 2)->as_mode.first;
}
#endif // VP9_COMMON_VP9_FINDNEARMV_H_
......@@ -27,9 +27,6 @@ static void lf_init_lut(loop_filter_info_n *lfi) {
lfi->mode_lf_lut[H_PRED] = 1;
lfi->mode_lf_lut[TM_PRED] = 1;
lfi->mode_lf_lut[I4X4_PRED] = 0;
#if !CONFIG_SB8X8
lfi->mode_lf_lut[I8X8_PRED] = 0;
#endif
lfi->mode_lf_lut[ZEROMV] = 1;
lfi->mode_lf_lut[NEARESTMV] = 2;
lfi->mode_lf_lut[NEARMV] = 2;
......@@ -169,12 +166,7 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm,
static int mb_lf_skip(const MB_MODE_INFO *const mbmi) {
const int skip_coef = mbmi->mb_skip_coeff;
const int tx_size = mbmi->txfm_size;
#if CONFIG_SB8X8
return mbmi->sb_type >= BLOCK_SIZE_MB16X16 &&
#else
const MB_PREDICTION_MODE mode = mbmi->mode;
return mode != I4X4_PRED && mode != I8X8_PRED && mode != SPLITMV &&
#endif
(tx_size >= TX_16X16 || skip_coef);
}
......@@ -227,11 +219,7 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
if (!skip_lf) {
if (tx_size >= TX_8X8) {
if (tx_size == TX_8X8 &&
#if CONFIG_SB8X8
(mi->mbmi.sb_type < BLOCK_SIZE_MB16X16)
#else
(mode == I8X8_PRED || mode == SPLITMV)
#endif
)
vp9_loop_filter_bh8x8(y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, &lfi);
......@@ -257,12 +245,7 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
if (!skip_lf) {
if (tx_size >= TX_8X8) {
if (tx_size == TX_8X8 &&
#if CONFIG_SB8X8
(mi->mbmi.sb_type < BLOCK_SIZE_MB16X16)
#else
(mode == I8X8_PRED || mode == SPLITMV)
#endif
)
(mi->mbmi.sb_type < BLOCK_SIZE_MB16X16))
vp9_loop_filter_bv8x8(y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, &lfi);
else
......@@ -322,7 +305,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_only? 0 : v_ptr,
y_stride, uv_stride, dering);
// process 2nd MB top-right
mi = mode_info_context + (1 << CONFIG_SB8X8);
mi = mode_info_context + 2;
do_left_v = !(wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_32X32 ||
sb_mb_lf_skip(mode_info_context, mi)));
do_above_h = (mb_row > 0);
......@@ -338,7 +321,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_stride, uv_stride, dering);
// process 3rd MB bottom-left
mi = mode_info_context + (mis << CONFIG_SB8X8);
mi = mode_info_context + (mis << 1);
do_left_v = (mb_col > 0);
do_above_h = !(hbl >= 3 /* 16x32 or >=32x32 */ && (tx_size >= TX_32X32 ||
sb_mb_lf_skip(mode_info_context, mi)));
......@@ -354,15 +337,15 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_stride, uv_stride, dering);
// process 4th MB bottom right
mi = mode_info_context + ((mis + 1) << CONFIG_SB8X8);
mi = mode_info_context + ((mis + 1) << 1);
do_left_v = !(wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_32X32 ||
sb_mb_lf_skip(mi - (1 << CONFIG_SB8X8), mi)));
sb_mb_lf_skip(mi - 2, mi)));
do_above_h = !(hbl >= 3 /* 16x32 or >=32x32 */ && (tx_size >= TX_32X32 ||
sb_mb_lf_skip(mode_info_context + (1 << CONFIG_SB8X8), mi)));
sb_mb_lf_skip(mode_info_context + 2, mi)));
do_left_v_mbuv = (wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_16X16 ||
sb_mb_lf_skip(mi - (1 << CONFIG_SB8X8), mi)));
sb_mb_lf_skip(mi - 2, mi)));
do_above_h_mbuv = !(hbl >= 3 /* 16x32 or >=32x32 */ && (tx_size >= TX_16X16 ||
sb_mb_lf_skip(mode_info_context + (1 << CONFIG_SB8X8), mi)));
sb_mb_lf_skip(mode_info_context + 2, mi)));
lpf_mb(cm, mi, do_left_v, do_above_h,
do_left_v_mbuv, do_above_h_mbuv,
y_ptr + 16 * y_stride + 16,
......@@ -379,17 +362,16 @@ static void lpf_sb64(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering);
lpf_sb32(cm, mode_info_context + (2 << CONFIG_SB8X8), mb_row, mb_col + 2,
lpf_sb32(cm, mode_info_context + 4, mb_row, mb_col + 2,
y_ptr + 32, u_ptr + 16, v_ptr + 16,
y_stride, uv_stride, y_only, dering);
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * (2 << CONFIG_SB8X8),
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4,
mb_row + 2, mb_col,
y_ptr + 32 * y_stride,
u_ptr + 16 * uv_stride,
v_ptr + 16 * uv_stride,
y_stride, uv_stride, y_only, dering);
lpf_sb32(cm, mode_info_context + cm->mode_info_stride *
(2 << CONFIG_SB8X8) + (2 << CONFIG_SB8X8),
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4 + 4,
mb_row + 2, mb_col + 2,
y_ptr + 32 * y_stride + 32,
u_ptr + 16 * uv_stride + 16,
......@@ -459,14 +441,14 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr += 64;
u_ptr = y_only? 0 : u_ptr + 32;
v_ptr = y_only? 0 : v_ptr + 32;
mode_info_context += 4 << CONFIG_SB8X8; // step to next SB64
mode_info_context += 8; // step to next SB64
}
if (extra_sb32_col) {
// process 2 SB32s in the extra SB32 col
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering);
lpf_sb32(cm, mode_info_context + mis * (2 << CONFIG_SB8X8),
lpf_sb32(cm, mode_info_context + mis * 4,
mb_row + 2, mb_col,
y_ptr + 32 * y_stride,
u_ptr + 16 * uv_stride,
......@@ -475,7 +457,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr += 32;
u_ptr = y_only? 0 : u_ptr + 16;
v_ptr = y_only? 0 : v_ptr + 16;
mode_info_context += 2 << CONFIG_SB8X8; // step to next SB32
mode_info_context += 4; // step to next SB32
mb_col += 2;
}
if (extra_mb_col) {
......@@ -493,7 +475,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_only? 0 : v_ptr,
y_stride, uv_stride, dering);
// process 2nd MB
mi = mode_info_context + (mis << CONFIG_SB8X8);
mi = mode_info_context + (mis << 1);
do_left_v = (mb_col > 0);
do_above_h = 1;
do_left_v_mbuv = 1;
......@@ -505,7 +487,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_only ? 0 : (v_ptr + 8 * uv_stride),
y_stride, uv_stride, dering);
// process 3nd MB
mi = mode_info_context + (mis << CONFIG_SB8X8) * 2;
mi = mode_info_context + (mis << 1) * 2;
do_left_v = (mb_col > 0);
do_above_h = 1;
do_left_v_mbuv = 1;
......@@ -517,7 +499,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_only ? 0 : (v_ptr + 16 * uv_stride),
y_stride, uv_stride, dering);
// process 4th MB
mi = mode_info_context + (mis << CONFIG_SB8X8) * 3;
mi = mode_info_context + (mis << 1) * 3;
do_left_v = (mb_col > 0);
do_above_h = 1;
do_left_v_mbuv = 1;
......@@ -531,7 +513,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8;
mode_info_context += 1 << CONFIG_SB8X8; // step to next MB
mode_info_context += 2; // step to next MB
}
// move pointers to the begining of next sb64 row
y_ptr += y_stride * 64 - post->y_width;
......@@ -540,7 +522,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
v_ptr += uv_stride * 32 - post->uv_width;
}
/* skip to next SB64 row */
mode_info_context += mis * (4 << CONFIG_SB8X8) - cm->mi_cols;
mode_info_context += mis * 8 - cm->mi_cols;
}
if (extra_sb32_row) {
const int sb32_cols = sb64_cols * 2 + extra_sb32_col;
......@@ -551,7 +533,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr += 32;
u_ptr = y_only? 0 : u_ptr + 16;
v_ptr = y_only? 0 : v_ptr + 16;
mode_info_context += 2 << CONFIG_SB8X8; // step to next SB32
mode_info_context += 4; // step to next SB32
}
if (extra_mb_col) {
// process 1st MB
......@@ -567,7 +549,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_only? NULL : v_ptr,
y_stride, uv_stride, dering);
// process 2nd MB
mi = mode_info_context + (mis << CONFIG_SB8X8);
mi = mode_info_context + (mis << 1);
do_left_v = (mb_col > 0);
do_above_h = 1;
do_left_v_mbuv = 1;
......@@ -581,14 +563,14 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8;
mode_info_context += 1 << CONFIG_SB8X8; /* step to next MB */
mode_info_context += 2; /* step to next MB */
}
// move pointers to the beginning of next sb64 row
y_ptr += y_stride * 32 - post->y_width;
u_ptr += y_only? 0 : uv_stride * 16 - post->uv_width;
v_ptr += y_only? 0 : uv_stride * 16 - post->uv_width;
// skip to next MB row if exist
mode_info_context += mis * (2 << CONFIG_SB8X8) - cm->mi_cols;
mode_info_context += mis * 4 - cm->mi_cols;
mb_row += 2;
}
if (extra_mb_row) {
......@@ -607,7 +589,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8;
mode_info_context += 1 << CONFIG_SB8X8; // step to next MB
mode_info_context += 2; // step to next MB
}
}
}
......@@ -12,7 +12,6 @@
#define MVREF_NEIGHBOURS 8
#if CONFIG_SB8X8
static int b_mv_ref_search[MVREF_NEIGHBOURS][2] = {
{0, -1}, {-1, 0}, {-1, -1}, {0, -2},
{-2, 0}, {-1, -2}, {-2, -1}, {-2, -2}
......@@ -32,22 +31,6 @@ static int sb64_mv_ref_search[MVREF_NEIGHBOURS][2] = {
{0, -1}, {-1, 0}, {2, -1}, {-1, 2},
{4, -1}, {-1, 4}, {6, -1}, {-1, -1}
};
#else
static int mb_mv_ref_search[MVREF_NEIGHBOURS][2] = {
{0, -1}, {-1, 0}, {-1, -1}, {0, -2},
{-2, 0}, {-1, -2}, {-2, -1}, {-2, -2}
};
static int sb_mv_ref_search[MVREF_NEIGHBOURS][2] = {
{0, -1}, {-1, 0}, {1, -1}, {-1, 1},
{-1, -1}, {0, -2}, {-2, 0}, {-1, -2}
};
static int sb64_mv_ref_search[MVREF_NEIGHBOURS][2] = {
{0, -1}, {-1, 0}, {1, -1}, {-1, 1},
{2, -1}, {-1, 2}, {3, -1}, {-1, -1}
};
#endif
// clamp_mv_ref
#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units
......@@ -190,15 +173,10 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
mv_ref_search = sb64_mv_ref_search;
} else if (mbmi->sb_type >= BLOCK_SIZE_SB32X32) {
mv_ref_search = sb_mv_ref_search;
#if CONFIG_SB8X8
} else if (mbmi->sb_type >= BLOCK_SIZE_MB16X16) {
mv_ref_search = mb_mv_ref_search;