Commit 4455036c authored by Ronald S. Bultje's avatar Ronald S. Bultje

Merge superblocks (32x32) experiment.

Change-Id: I0df99742029834a85c4933652b0587cf5b6b2587
parent 879cb7d9
......@@ -16,7 +16,7 @@ const uint8_t vp9_block2left[TX_SIZE_MAX_SB][25] = {
{0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8},
{0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 6, 6, 6, 6, 8},
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 6, 6, 6, 6, 8}
#endif
};
......@@ -24,7 +24,7 @@ const uint8_t vp9_block2above[TX_SIZE_MAX_SB][25] = {
{0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8},
{0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 6, 6, 6, 6, 8},
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 6, 6, 6, 6, 8}
#endif
};
......@@ -122,7 +122,7 @@ typedef enum {
TX_8X8 = 1, // 8x8 dct transform
TX_16X16 = 2, // 16x16 dct transform
TX_SIZE_MAX_MB = 3, // Number of different transforms available
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
TX_32X32 = TX_SIZE_MAX_MB, // 32x32 dct transform
TX_SIZE_MAX_SB, // Number of transforms available to SBs
#else
......@@ -226,7 +226,6 @@ typedef enum {
MAX_REF_FRAMES = 4
} MV_REFERENCE_FRAME;
#if CONFIG_SUPERBLOCKS
typedef enum {
BLOCK_SIZE_MB16X16 = 0,
BLOCK_SIZE_SB32X32 = 1,
......@@ -234,7 +233,6 @@ typedef enum {
BLOCK_SIZE_SB64X64 = 2,
#endif
} BLOCK_SIZE_TYPE;
#endif
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
......@@ -276,11 +274,7 @@ typedef struct {
#endif
INTERPOLATIONFILTERTYPE interp_filter;
#if CONFIG_SUPERBLOCKS
// FIXME need a SB array of 4 MB_MODE_INFOs that
// only needs one sb_type.
BLOCK_SIZE_TYPE sb_type;
#endif
} MB_MODE_INFO;
typedef struct {
......@@ -310,7 +304,7 @@ typedef struct blockd {
union b_mode_info bmi;
} BLOCKD;
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
typedef struct superblockd {
/* 32x32 Y and 16x16 U/V. No 2nd order transform yet. */
DECLARE_ALIGNED(16, int16_t, diff[32*32+16*16*2]);
......@@ -326,7 +320,7 @@ typedef struct macroblockd {
DECLARE_ALIGNED(16, int16_t, dqcoeff[400]);
DECLARE_ALIGNED(16, uint16_t, eobs[25]);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
SUPERBLOCKD sb_coeff_data;
#endif
......@@ -417,14 +411,6 @@ typedef struct macroblockd {
int corrupted;
#if !CONFIG_SUPERBLOCKS && (ARCH_X86 || ARCH_X86_64)
/* This is an intermediate buffer currently used in sub-pixel motion search
* to keep a copy of the reference area. This buffer can be used for other
* purpose.
*/
DECLARE_ALIGNED(32, uint8_t, y_buf[22 * 32]);
#endif
int sb_index;
int mb_index; // Index of the MB in the SB (0..3)
int q_index;
......@@ -528,11 +514,9 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, const BLOCKD *b) {
int ib = (int)(b - xd->block);
if (ib >= 16)
return tx_type;
#if CONFIG_SUPERBLOCKS
// TODO(rbultje, debargha): Explore ADST usage for superblocks
if (xd->mode_info_context->mbmi.sb_type)
return tx_type;
#endif
if (xd->mode_info_context->mbmi.mode == B_PRED &&
xd->q_index < ACTIVE_HT) {
tx_type = txfm_map(
......@@ -585,11 +569,9 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, const BLOCKD *b) {
int ib = (int)(b - xd->block);
if (ib >= 16)
return tx_type;
#if CONFIG_SUPERBLOCKS
// TODO(rbultje, debargha): Explore ADST usage for superblocks
if (xd->mode_info_context->mbmi.sb_type)
return tx_type;
#endif
if (xd->mode_info_context->mbmi.mode == I8X8_PRED &&
xd->q_index < ACTIVE_HT8) {
// TODO(rbultje): MB_PREDICTION_MODE / B_PREDICTION_MODE should be merged
......@@ -620,11 +602,9 @@ static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd, const BLOCKD *b) {
int ib = (int)(b - xd->block);
if (ib >= 16)
return tx_type;
#if CONFIG_SUPERBLOCKS
// TODO(rbultje, debargha): Explore ADST usage for superblocks
if (xd->mode_info_context->mbmi.sb_type)
return tx_type;
#endif
if (xd->mode_info_context->mbmi.mode < I8X8_PRED &&
xd->q_index < ACTIVE_HT16) {
tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode));
......
......@@ -1038,7 +1038,7 @@ static const vp9_coeff_probs default_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16]
}
}
};
#if CONFIG_SUPERBLOCKS && CONFIG_TX32X32
#if CONFIG_TX32X32
static const vp9_coeff_probs default_coef_probs_32x32[BLOCK_TYPES_32X32] = {
{ /* block Type 0 */
{ /* Coeff Band 0 */
......@@ -1210,4 +1210,4 @@ static const vp9_coeff_probs default_coef_probs_32x32[BLOCK_TYPES_32X32] = {
}
}
};
#endif // CONFIG_SUPERBLOCKS && CONFIG_TX32X32
#endif // CONFIG_TX32X32
......@@ -142,7 +142,7 @@ DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]) = {
237, 252, 253, 238, 223, 239, 254, 255,
};
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
#if CONFIG_DWT32X32HYBRID
DECLARE_ALIGNED(16, const int, vp9_coef_bands_32x32[1024]) = {
0, 1, 2, 3, 5, 4, 4, 5, 5, 3, 6, 3, 5, 4, 6,
......@@ -547,7 +547,7 @@ DECLARE_ALIGNED(16, int,
vp9_default_zig_zag1d_8x8_neighbors[64 * MAX_NEIGHBORS]);
DECLARE_ALIGNED(16, int,
vp9_default_zig_zag1d_16x16_neighbors[256 * MAX_NEIGHBORS]);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
DECLARE_ALIGNED(16, int,
vp9_default_zig_zag1d_32x32_neighbors[1024 * MAX_NEIGHBORS]);
#endif
......@@ -628,7 +628,7 @@ void vp9_init_neighbors() {
vp9_default_zig_zag1d_8x8_neighbors);
init_scan_neighbors(vp9_default_zig_zag1d_16x16, 16,
vp9_default_zig_zag1d_16x16_neighbors);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
init_scan_neighbors(vp9_default_zig_zag1d_32x32, 32,
vp9_default_zig_zag1d_32x32_neighbors);
#endif
......@@ -645,7 +645,7 @@ const int *vp9_get_coef_neighbors_handle(const int *scan) {
return vp9_default_zig_zag1d_8x8_neighbors;
} else if (scan == vp9_default_zig_zag1d_16x16) {
return vp9_default_zig_zag1d_16x16_neighbors;
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
} else if (scan == vp9_default_zig_zag1d_32x32) {
return vp9_default_zig_zag1d_32x32_neighbors;
#endif
......@@ -693,7 +693,7 @@ void vp9_default_coef_probs(VP9_COMMON *pc) {
vpx_memcpy(pc->fc.hybrid_coef_probs_16x16,
default_hybrid_coef_probs_16x16,
sizeof(pc->fc.hybrid_coef_probs_16x16));
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
vpx_memcpy(pc->fc.coef_probs_32x32, default_coef_probs_32x32,
sizeof(pc->fc.coef_probs_32x32));
#endif
......@@ -840,7 +840,7 @@ void vp9_adapt_coef_probs(VP9_COMMON *cm) {
cm->fc.pre_hybrid_coef_probs_16x16,
BLOCK_TYPES_16X16, cm->fc.hybrid_coef_counts_16x16,
count_sat, update_factor);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
update_coef_probs(cm->fc.coef_probs_32x32, cm->fc.pre_coef_probs_32x32,
BLOCK_TYPES_32X32, cm->fc.coef_counts_32x32,
count_sat, update_factor);
......
......@@ -66,7 +66,7 @@ extern vp9_extra_bit_struct vp9_extra_bits[12]; /* indexed by token value */
#define BLOCK_TYPES_16X16 4
#if CONFIG_SUPERBLOCKS && CONFIG_TX32X32
#if CONFIG_TX32X32
#define BLOCK_TYPES_32X32 4
#endif
......@@ -77,7 +77,7 @@ extern vp9_extra_bit_struct vp9_extra_bits[12]; /* indexed by token value */
extern DECLARE_ALIGNED(16, const int, vp9_coef_bands_4x4[16]);
extern DECLARE_ALIGNED(64, const int, vp9_coef_bands_8x8[64]);
extern DECLARE_ALIGNED(16, const int, vp9_coef_bands_16x16[256]);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
extern DECLARE_ALIGNED(16, const int, vp9_coef_bands_32x32[1024]);
#endif
......@@ -122,7 +122,7 @@ extern DECLARE_ALIGNED(16, const int, vp9_row_scan_4x4[16]);
extern DECLARE_ALIGNED(64, const int, vp9_default_zig_zag1d_8x8[64]);
extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]);
#if CONFIG_SUPERBLOCKS && CONFIG_TX32X32
#if CONFIG_TX32X32
extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_32x32[1024]);
#endif
......@@ -154,7 +154,7 @@ extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_8x8_neighbors[
64 * MAX_NEIGHBORS]);
extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_16x16_neighbors[
256 * MAX_NEIGHBORS]);
#if CONFIG_SUPERBLOCKS && CONFIG_TX32X32
#if CONFIG_TX32X32
extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_32x32_neighbors[
1024 * MAX_NEIGHBORS]);
#endif
......
......@@ -272,13 +272,11 @@ const vp9_tree_index vp9_mv_ref_tree[8] = {
-NEWMV, -SPLITMV
};
#if CONFIG_SUPERBLOCKS
const vp9_tree_index vp9_sb_mv_ref_tree[6] = {
-ZEROMV, 2,
-NEARESTMV, 4,
-NEARMV, -NEWMV
};
#endif
const vp9_tree_index vp9_sub_mv_ref_tree[6] = {
-LEFT4X4, 2,
......@@ -289,19 +287,15 @@ const vp9_tree_index vp9_sub_mv_ref_tree[6] = {
struct vp9_token_struct vp9_bmode_encodings[VP9_NKF_BINTRAMODES];
struct vp9_token_struct vp9_kf_bmode_encodings[VP9_KF_BINTRAMODES];
struct vp9_token_struct vp9_ymode_encodings[VP9_YMODES];
#if CONFIG_SUPERBLOCKS
struct vp9_token_struct vp9_sb_ymode_encodings[VP9_I32X32_MODES];
struct vp9_token_struct vp9_sb_kf_ymode_encodings[VP9_I32X32_MODES];
#endif
struct vp9_token_struct vp9_kf_ymode_encodings[VP9_YMODES];
struct vp9_token_struct vp9_uv_mode_encodings[VP9_UV_MODES];
struct vp9_token_struct vp9_i8x8_mode_encodings[VP9_I8X8_MODES];
struct vp9_token_struct vp9_mbsplit_encodings[VP9_NUMMBSPLITS];
struct vp9_token_struct vp9_mv_ref_encoding_array[VP9_MVREFS];
#if CONFIG_SUPERBLOCKS
struct vp9_token_struct vp9_sb_mv_ref_encoding_array[VP9_MVREFS];
#endif
struct vp9_token_struct vp9_sub_mv_ref_encoding_array[VP9_SUBMVREFS];
void vp9_init_mbmode_probs(VP9_COMMON *x) {
......@@ -310,24 +304,20 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
vp9_tree_probs_from_distribution(VP9_YMODES, vp9_ymode_encodings,
vp9_ymode_tree, x->fc.ymode_prob,
bct, y_mode_cts);
#if CONFIG_SUPERBLOCKS
vp9_tree_probs_from_distribution(VP9_I32X32_MODES, vp9_sb_ymode_encodings,
vp9_sb_ymode_tree, x->fc.sb_ymode_prob,
bct, y_mode_cts);
#endif
{
int i;
for (i = 0; i < 8; i++) {
vp9_tree_probs_from_distribution(VP9_YMODES, vp9_kf_ymode_encodings,
vp9_kf_ymode_tree, x->kf_ymode_prob[i],
bct, kf_y_mode_cts[i]);
#if CONFIG_SUPERBLOCKS
vp9_tree_probs_from_distribution(VP9_I32X32_MODES,
vp9_sb_kf_ymode_encodings,
vp9_sb_kf_ymode_tree,
x->sb_kf_ymode_prob[i], bct,
kf_y_mode_cts[i]);
#endif
}
}
{
......@@ -426,10 +416,8 @@ void vp9_entropy_mode_init() {
vp9_tokens_from_tree(vp9_bmode_encodings, vp9_bmode_tree);
vp9_tokens_from_tree(vp9_ymode_encodings, vp9_ymode_tree);
vp9_tokens_from_tree(vp9_kf_ymode_encodings, vp9_kf_ymode_tree);
#if CONFIG_SUPERBLOCKS
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);
#endif
vp9_tokens_from_tree(vp9_uv_mode_encodings, vp9_uv_mode_tree);
vp9_tokens_from_tree(vp9_i8x8_mode_encodings, vp9_i8x8_mode_tree);
vp9_tokens_from_tree(vp9_mbsplit_encodings, vp9_mbsplit_tree);
......@@ -438,10 +426,8 @@ void vp9_entropy_mode_init() {
vp9_tokens_from_tree_offset(vp9_mv_ref_encoding_array,
vp9_mv_ref_tree, NEARESTMV);
#if CONFIG_SUPERBLOCKS
vp9_tokens_from_tree_offset(vp9_sb_mv_ref_encoding_array,
vp9_sb_mv_ref_tree, NEARESTMV);
#endif
vp9_tokens_from_tree_offset(vp9_sub_mv_ref_encoding_array,
vp9_sub_mv_ref_tree, LEFT4X4);
}
......@@ -599,11 +585,9 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
update_mode_probs(VP9_YMODES, vp9_ymode_encodings, vp9_ymode_tree,
cm->fc.ymode_counts, cm->fc.pre_ymode_prob,
cm->fc.ymode_prob);
#if CONFIG_SUPERBLOCKS
update_mode_probs(VP9_I32X32_MODES, vp9_sb_ymode_encodings, vp9_sb_ymode_tree,
cm->fc.sb_ymode_counts, cm->fc.pre_sb_ymode_prob,
cm->fc.sb_ymode_prob);
#endif
for (i = 0; i < VP9_YMODES; ++i) {
update_mode_probs(VP9_UV_MODES, vp9_uv_mode_encodings, vp9_uv_mode_tree,
cm->fc.uv_mode_counts[i], cm->fc.pre_uv_mode_prob[i],
......
......@@ -190,7 +190,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
SP(this_mv.as_mv.row),
above_src, xd->dst.y_stride, &sse);
score += sse;
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type >= BLOCK_SIZE_SB32X32) {
vp9_sub_pixel_variance16x2_c(above_ref + offset + 16,
ref_y_stride,
......@@ -214,7 +213,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
above_src + 48, xd->dst.y_stride, &sse);
score += sse;
}
#endif
#endif
}
if (xd->left_available) {
......@@ -223,7 +221,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
SP(this_mv.as_mv.row),
left_src, xd->dst.y_stride, &sse);
score += sse;
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type >= BLOCK_SIZE_SB32X32) {
vp9_sub_pixel_variance2x16_c(left_ref + offset + ref_y_stride * 16,
ref_y_stride,
......@@ -250,7 +247,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
xd->dst.y_stride, &sse);
score += sse;
}
#endif
#endif
}
#else
......@@ -263,7 +259,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
if (xd->up_available) {
score += vp9_sad16x3(above_src, xd->dst.y_stride,
above_ref + offset, ref_y_stride);
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type >= BLOCK_SIZE_SB32X32) {
score += vp9_sad16x3(above_src + 16, xd->dst.y_stride,
above_ref + offset + 16, ref_y_stride);
......@@ -275,13 +270,11 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
score += vp9_sad16x3(above_src + 48, xd->dst.y_stride,
above_ref + offset + 48, ref_y_stride);
}
#endif
#endif
}
if (xd->left_available) {
score += vp9_sad3x16(left_src, xd->dst.y_stride,
left_ref + offset, ref_y_stride);
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type >= BLOCK_SIZE_SB32X32) {
score += vp9_sad3x16(left_src + xd->dst.y_stride * 16,
xd->dst.y_stride,
......@@ -299,7 +292,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
left_ref + offset + ref_y_stride * 48,
ref_y_stride);
}
#endif
#endif
}
#endif
......
......@@ -146,7 +146,7 @@ void vp9_inverse_transform_mb_16x16(MACROBLOCKD *xd) {
vp9_inverse_transform_mbuv_8x8(xd);
}
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
void vp9_inverse_transform_sby_32x32(SUPERBLOCKD *xd_sb) {
vp9_short_idct32x32(xd_sb->dqcoeff, xd_sb->diff, 64);
}
......
......@@ -39,7 +39,7 @@ extern void vp9_inverse_transform_mb_16x16(MACROBLOCKD *xd);
extern void vp9_inverse_transform_mby_16x16(MACROBLOCKD *xd);
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
extern void vp9_inverse_transform_sby_32x32(SUPERBLOCKD *xd_sb);
extern void vp9_inverse_transform_sbuv_16x16(SUPERBLOCKD *xd_sb);
#endif
......
......@@ -229,16 +229,13 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
lfi.lim = lfi_n->lim[filter_level];
lfi.hev_thr = lfi_n->hev_thr[hev_index];
if (mb_col > 0
#if CONFIG_SUPERBLOCKS
&& !((mb_col & 1) && mode_info_context->mbmi.sb_type &&
if (mb_col > 0 &&
!((mb_col & 1) && mode_info_context->mbmi.sb_type &&
((skip_lf && mb_lf_skip(&mode_info_context[-1].mbmi))
#if CONFIG_TX32X32
|| tx_size == TX_32X32
#endif
))
#endif
)
)))
vp9_loop_filter_mbv(y_ptr, u_ptr, v_ptr, post->y_stride,
post->uv_stride, &lfi);
if (!skip_lf) {
......@@ -251,16 +248,13 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
}
/* don't apply across umv border */
if (mb_row > 0
#if CONFIG_SUPERBLOCKS
&& !((mb_row & 1) && mode_info_context->mbmi.sb_type &&
if (mb_row > 0 &&
!((mb_row & 1) && mode_info_context->mbmi.sb_type &&
((skip_lf && mb_lf_skip(&mode_info_context[-mis].mbmi))
#if CONFIG_TX32X32
|| tx_size == TX_32X32
#endif
))
#endif
)
)))
vp9_loop_filter_mbh(y_ptr, u_ptr, v_ptr, post->y_stride,
post->uv_stride, &lfi);
if (!skip_lf) {
......@@ -274,11 +268,8 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
} else {
// FIXME: Not 8x8 aware
if (mb_col > 0 &&
!(skip_lf && mb_lf_skip(&mode_info_context[-1].mbmi))
#if CONFIG_SUPERBLOCKS
&& !((mb_col & 1) && mode_info_context->mbmi.sb_type)
#endif
)
!(skip_lf && mb_lf_skip(&mode_info_context[-1].mbmi)) &&
!((mb_col & 1) && mode_info_context->mbmi.sb_type))
vp9_loop_filter_simple_mbv(y_ptr, post->y_stride,
lfi_n->mblim[filter_level]);
if (!skip_lf)
......@@ -287,11 +278,8 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
/* don't apply across umv border */
if (mb_row > 0 &&
!(skip_lf && mb_lf_skip(&mode_info_context[-mis].mbmi))
#if CONFIG_SUPERBLOCKS
&& !((mb_row & 1) && mode_info_context->mbmi.sb_type)
#endif
)
!(skip_lf && mb_lf_skip(&mode_info_context[-mis].mbmi)) &&
!((mb_row & 1) && mode_info_context->mbmi.sb_type))
vp9_loop_filter_simple_mbh(y_ptr, post->y_stride,
lfi_n->mblim[filter_level]);
if (!skip_lf)
......
......@@ -17,14 +17,12 @@ static int mb_mv_ref_search[MVREF_NEIGHBOURS][2] = {
};
static int mb_ref_distance_weight[MVREF_NEIGHBOURS] =
{ 3, 3, 2, 1, 1, 1, 1, 1 };
#if CONFIG_SUPERBLOCKS
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 sb_ref_distance_weight[MVREF_NEIGHBOURS] =
{ 3, 3, 2, 2, 2, 1, 1, 1 };
#endif
// clamp_mv
#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units
......@@ -236,7 +234,6 @@ void vp9_find_mv_refs(
vpx_memset(candidate_mvs, 0, sizeof(int_mv) * MAX_MV_REF_CANDIDATES);
vpx_memset(candidate_scores, 0, sizeof(candidate_scores));
#if CONFIG_SUPERBLOCKS
if (mbmi->sb_type) {
mv_ref_search = sb_mv_ref_search;
ref_distance_weight = sb_ref_distance_weight;
......@@ -244,10 +241,6 @@ void vp9_find_mv_refs(
mv_ref_search = mb_mv_ref_search;
ref_distance_weight = mb_ref_distance_weight;
}
#else
mv_ref_search = mb_mv_ref_search;
ref_distance_weight = mb_ref_distance_weight;
#endif
// We first scan for candidate vectors that match the current reference frame
// Look at nearest neigbours
......
......@@ -44,9 +44,7 @@ void vp9_initialize_common(void);
typedef struct frame_contexts {
vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1];
vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
#if CONFIG_SUPERBLOCKS
vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1];
#endif
vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1];
vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
......@@ -57,7 +55,7 @@ typedef struct frame_contexts {
vp9_coeff_probs hybrid_coef_probs_8x8[BLOCK_TYPES_8X8];
vp9_coeff_probs coef_probs_16x16[BLOCK_TYPES_16X16];
vp9_coeff_probs hybrid_coef_probs_16x16[BLOCK_TYPES_16X16];
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
vp9_coeff_probs coef_probs_32x32[BLOCK_TYPES_32X32];
#endif
......@@ -65,18 +63,14 @@ typedef struct frame_contexts {
nmv_context pre_nmvc;
vp9_prob pre_bmode_prob[VP9_NKF_BINTRAMODES - 1];
vp9_prob pre_ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
#if CONFIG_SUPERBLOCKS
vp9_prob pre_sb_ymode_prob[VP9_I32X32_MODES - 1];
#endif
vp9_prob pre_uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
vp9_prob pre_i8x8_mode_prob[VP9_I8X8_MODES - 1];
vp9_prob pre_sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
vp9_prob pre_mbsplit_prob[VP9_NUMMBSPLITS - 1];
unsigned int bmode_counts[VP9_NKF_BINTRAMODES];
unsigned int ymode_counts[VP9_YMODES]; /* interframe intra mode probs */
#if CONFIG_SUPERBLOCKS
unsigned int sb_ymode_counts[VP9_I32X32_MODES];
#endif
unsigned int uv_mode_counts[VP9_YMODES][VP9_UV_MODES];
unsigned int i8x8_mode_counts[VP9_I8X8_MODES]; /* interframe intra probs */
unsigned int sub_mv_ref_counts[SUBMVREF_COUNT][VP9_SUBMVREFS];
......@@ -88,7 +82,7 @@ typedef struct frame_contexts {
vp9_coeff_probs pre_hybrid_coef_probs_8x8[BLOCK_TYPES_8X8];
vp9_coeff_probs pre_coef_probs_16x16[BLOCK_TYPES_16X16];
vp9_coeff_probs pre_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16];
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
vp9_coeff_probs pre_coef_probs_32x32[BLOCK_TYPES_32X32];
#endif
......@@ -98,7 +92,7 @@ typedef struct frame_contexts {
vp9_coeff_count hybrid_coef_counts_8x8[BLOCK_TYPES_8X8];
vp9_coeff_count coef_counts_16x16[BLOCK_TYPES_16X16];
vp9_coeff_count hybrid_coef_counts_16x16[BLOCK_TYPES_16X16];
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
vp9_coeff_count coef_counts_32x32[BLOCK_TYPES_32X32];
#endif
......@@ -131,11 +125,11 @@ typedef enum {
ONLY_4X4 = 0,
ALLOW_8X8 = 1,
ALLOW_16X16 = 2,
#if CONFIG_TX32X32 && CONFIG_SUPERBLOCKS
#if CONFIG_TX32X32
ALLOW_32X32 = 3,
#endif
TX_MODE_SELECT = 3 + (CONFIG_TX32X32 && CONFIG_SUPERBLOCKS),
NB_TXFM_MODES = 4 + (CONFIG_TX32X32 && CONFIG_SUPERBLOCKS),
TX_MODE_SELECT = 3 + CONFIG_TX32X32,
NB_TXFM_MODES = 4 + CONFIG_TX32X32,
} TXFM_MODE;
typedef struct VP9Common {
......@@ -237,9 +231,7 @@ typedef struct VP9Common {
[VP9_KF_BINTRAMODES]
[VP9_KF_BINTRAMODES - 1];
vp9_prob kf_ymode_prob[8][VP9_YMODES - 1]; /* keyframe "" */
#if CONFIG_SUPERBLOCKS
vp9_prob sb_kf_ymode_prob[8][VP9_I32X32_MODES - 1];
#endif
int kf_ymode_probs_index;
int kf_ymode_probs_update;
vp9_prob kf_uv_mode_prob[VP9_YMODES] [VP9_UV_MODES - 1];
......@@ -247,12 +239,10 @@ typedef struct VP9Common {
vp9_prob prob_intra_coded;
vp9_prob prob_last_coded;
vp9_prob prob_gf_coded;
#if CONFIG_SUPERBLOCKS
vp9_prob sb32_coded;
#if CONFIG_SUPERBLOCKS64
vp9_prob sb64_coded;
#endif // CONFIG_SUPERBLOCKS64
#endif
// Context probabilities when using predictive coding of segment id
vp9_prob segment_pred_probs[PREDICTION_PROBS];
......
......@@ -223,14 +223,11 @@ unsigned char vp9_get_pred_flag(const MACROBLOCKD *const xd,
void vp9_set_pred_flag(MACROBLOCKD *const xd,
PRED_ID pred_id,
unsigned char pred_flag) {
#if CONFIG_SUPERBLOCKS
const int mis = xd->mode_info_stride;
#endif
switch (pred_id) {
case PRED_SEG_ID:
xd->mode_info_context->mbmi.seg_id_predicted = pred_flag;
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type) {
#define sub(a, b) (b) < 0 ? (a) + (b) : (a)
const int n_mbs = 1 << xd->mode_info_context->mbmi.sb_type;
......@@ -245,12 +242,10 @@ void vp9_set_pred_flag(MACROBLOCKD *const xd,
}
}
}
#endif
break;
case PRED_REF:
xd->mode_info_context->mbmi.ref_predicted = pred_flag;
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type) {
const int n_mbs = 1 << xd->mode_info_context->mbmi.sb_type;
const int x_mbs = sub(n_mbs, xd->mb_to_right_edge >> 7);
......@@ -263,12 +258,10 @@ void vp9_set_pred_flag(MACROBLOCKD *const xd,
}
}
}
#endif
break;
case PRED_MBSKIP:
xd->mode_info_context->mbmi.mb_skip_coeff = pred_flag;
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.sb_type) {
const int n_mbs = 1 << xd->mode_info_context->mbmi.sb_type;
const int x_mbs = sub(n_mbs, xd->mb_to_right_edge >> 7);
......@@ -281,7 +274,6 @@ void vp9_set_pred_flag(MACROBLOCKD *const xd,
}
}
}
#endif
break;
default:
......@@ -299,11 +291,8 @@ unsigned char vp9_get_pred_mb_segid(const VP9_COMMON *const cm,
const MACROBLOCKD *const xd, int MbIndex) {