Commit 7ac5ac52 authored by Jingning Han's avatar Jingning Han Committed by Paul Wilkins
Browse files

Merge 4x4 block level partition into codebase

Move 4x4/4x8/8x4 partition coding out of experimental list.

This commit fixed the unit test failure issues. It also resolved
the merge conflicts between 4x4 block level partition and iterative
motion search for comp_inter_inter.

Change-Id: I898671f0631f5ddc4f5cc68d4c62ead7de9c5a58
parent 0812c121
...@@ -246,7 +246,6 @@ EXPERIMENT_LIST=" ...@@ -246,7 +246,6 @@ EXPERIMENT_LIST="
multiple_arf multiple_arf
non420 non420
alpha alpha
ab4x4
" "
CONFIG_LIST=" CONFIG_LIST="
external_build external_build
......
...@@ -158,7 +158,7 @@ typedef enum { ...@@ -158,7 +158,7 @@ typedef enum {
union b_mode_info { union b_mode_info {
struct { struct {
B_PREDICTION_MODE first; MB_PREDICTION_MODE first;
} as_mode; } as_mode;
int_mv as_mv[2]; // first, second inter predictor motion vectors int_mv as_mv[2]; // first, second inter predictor motion vectors
}; };
...@@ -174,13 +174,9 @@ typedef enum { ...@@ -174,13 +174,9 @@ typedef enum {
static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) {
switch (sb_type) { switch (sb_type) {
#if CONFIG_AB4X4
case BLOCK_SIZE_SB4X8: case BLOCK_SIZE_SB4X8:
#endif
case BLOCK_SIZE_AB4X4: return 0; case BLOCK_SIZE_AB4X4: return 0;
#if CONFIG_AB4X4
case BLOCK_SIZE_SB8X4: case BLOCK_SIZE_SB8X4:
#endif
case BLOCK_SIZE_SB8X8: case BLOCK_SIZE_SB8X8:
case BLOCK_SIZE_SB8X16: return 1; case BLOCK_SIZE_SB8X16: return 1;
case BLOCK_SIZE_SB16X8: case BLOCK_SIZE_SB16X8:
...@@ -198,13 +194,9 @@ static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) { ...@@ -198,13 +194,9 @@ static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) {
static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) {
switch (sb_type) { switch (sb_type) {
#if CONFIG_AB4X4
case BLOCK_SIZE_SB8X4: case BLOCK_SIZE_SB8X4:
#endif
case BLOCK_SIZE_AB4X4: return 0; case BLOCK_SIZE_AB4X4: return 0;
#if CONFIG_AB4X4
case BLOCK_SIZE_SB4X8: case BLOCK_SIZE_SB4X8:
#endif
case BLOCK_SIZE_SB8X8: case BLOCK_SIZE_SB8X8:
case BLOCK_SIZE_SB16X8: return 1; case BLOCK_SIZE_SB16X8: return 1;
case BLOCK_SIZE_SB8X16: case BLOCK_SIZE_SB8X16:
...@@ -222,21 +214,17 @@ static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) { ...@@ -222,21 +214,17 @@ static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) {
static INLINE int mi_width_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int mi_width_log2(BLOCK_SIZE_TYPE sb_type) {
int a = b_width_log2(sb_type) - 1; int a = b_width_log2(sb_type) - 1;
#if CONFIG_AB4X4
// align 4x4 block to mode_info // align 4x4 block to mode_info
if (a < 0) if (a < 0)
a = 0; a = 0;
#endif
assert(a >= 0); assert(a >= 0);
return a; return a;
} }
static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) {
int a = b_height_log2(sb_type) - 1; int a = b_height_log2(sb_type) - 1;
#if CONFIG_AB4X4
if (a < 0) if (a < 0)
a = 0; a = 0;
#endif
assert(a >= 0); assert(a >= 0);
return a; return a;
} }
...@@ -413,9 +401,7 @@ typedef struct macroblockd { ...@@ -413,9 +401,7 @@ typedef struct macroblockd {
int sb_index; // index of 32x32 block inside the 64x64 block int sb_index; // index of 32x32 block inside the 64x64 block
int mb_index; // index of 16x16 block inside the 32x32 block int mb_index; // index of 16x16 block inside the 32x32 block
int b_index; // index of 8x8 block inside the 16x16 block int b_index; // index of 8x8 block inside the 16x16 block
#if CONFIG_AB4X4
int ab_index; // index of 4x4 block inside the 8x8 block int ab_index; // index of 4x4 block inside the 8x8 block
#endif
int q_index; int q_index;
} MACROBLOCKD; } MACROBLOCKD;
...@@ -435,12 +421,10 @@ static int *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE_TYPE subsize) { ...@@ -435,12 +421,10 @@ static int *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE_TYPE subsize) {
case BLOCK_SIZE_SB8X16: case BLOCK_SIZE_SB8X16:
case BLOCK_SIZE_SB8X8: case BLOCK_SIZE_SB8X8:
return &xd->b_index; return &xd->b_index;
#if CONFIG_AB4X4
case BLOCK_SIZE_SB8X4: case BLOCK_SIZE_SB8X4:
case BLOCK_SIZE_SB4X8: case BLOCK_SIZE_SB4X8:
case BLOCK_SIZE_AB4X4: case BLOCK_SIZE_AB4X4:
return &xd->ab_index; return &xd->ab_index;
#endif
default: default:
assert(0); assert(0);
return NULL; return NULL;
...@@ -456,12 +440,6 @@ static INLINE void update_partition_context(MACROBLOCKD *xd, ...@@ -456,12 +440,6 @@ static INLINE void update_partition_context(MACROBLOCKD *xd,
int boffset = b_width_log2(BLOCK_SIZE_SB64X64) - bsl; int boffset = b_width_log2(BLOCK_SIZE_SB64X64) - bsl;
int i; int i;
#if !CONFIG_AB4X4
// skip 8x8 block partition
if (bsl == 0)
return;
#endif
// update the partition context at the end notes. set partition bits // update the partition context at the end notes. set partition bits
// of block sizes larger than the current one to be one, and partition // of block sizes larger than the current one to be one, and partition
// bits of smaller block sizes to be zero. // bits of smaller block sizes to be zero.
...@@ -508,11 +486,7 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd, ...@@ -508,11 +486,7 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd,
above = (above > 0); above = (above > 0);
left = (left > 0); left = (left > 0);
#if CONFIG_AB4X4
return (left * 2 + above) + bsl * PARTITION_PLOFFSET; return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
#else
return (left * 2 + above) + (bsl - 1) * PARTITION_PLOFFSET;
#endif
} }
static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
...@@ -529,10 +503,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, ...@@ -529,10 +503,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
subsize = BLOCK_SIZE_SB32X16; subsize = BLOCK_SIZE_SB32X16;
else if (bsize == BLOCK_SIZE_MB16X16) else if (bsize == BLOCK_SIZE_MB16X16)
subsize = BLOCK_SIZE_SB16X8; subsize = BLOCK_SIZE_SB16X8;
#if CONFIG_AB4X4
else if (bsize == BLOCK_SIZE_SB8X8) else if (bsize == BLOCK_SIZE_SB8X8)
subsize = BLOCK_SIZE_SB8X4; subsize = BLOCK_SIZE_SB8X4;
#endif
else else
assert(0); assert(0);
break; break;
...@@ -543,10 +515,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, ...@@ -543,10 +515,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
subsize = BLOCK_SIZE_SB16X32; subsize = BLOCK_SIZE_SB16X32;
else if (bsize == BLOCK_SIZE_MB16X16) else if (bsize == BLOCK_SIZE_MB16X16)
subsize = BLOCK_SIZE_SB8X16; subsize = BLOCK_SIZE_SB8X16;
#if CONFIG_AB4X4
else if (bsize == BLOCK_SIZE_SB8X8) else if (bsize == BLOCK_SIZE_SB8X8)
subsize = BLOCK_SIZE_SB4X8; subsize = BLOCK_SIZE_SB4X8;
#endif
else else
assert(0); assert(0);
break; break;
...@@ -557,10 +527,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, ...@@ -557,10 +527,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
subsize = BLOCK_SIZE_MB16X16; subsize = BLOCK_SIZE_MB16X16;
else if (bsize == BLOCK_SIZE_MB16X16) else if (bsize == BLOCK_SIZE_MB16X16)
subsize = BLOCK_SIZE_SB8X8; subsize = BLOCK_SIZE_SB8X8;
#if CONFIG_AB4X4
else if (bsize == BLOCK_SIZE_SB8X8) else if (bsize == BLOCK_SIZE_SB8X8)
subsize = BLOCK_SIZE_AB4X4; subsize = BLOCK_SIZE_AB4X4;
#endif
else else
assert(0); assert(0);
break; break;
...@@ -571,39 +539,39 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, ...@@ -571,39 +539,39 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
} }
// convert MB_PREDICTION_MODE to B_PREDICTION_MODE // convert MB_PREDICTION_MODE to B_PREDICTION_MODE
static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) { static MB_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
switch (mode) { switch (mode) {
case DC_PRED: return B_DC_PRED; case DC_PRED: return DC_PRED;
case V_PRED: return B_V_PRED; case V_PRED: return V_PRED;
case H_PRED: return B_H_PRED; case H_PRED: return H_PRED;
case TM_PRED: return B_TM_PRED; case TM_PRED: return TM_PRED;
case D45_PRED: return B_D45_PRED; case D45_PRED: return D45_PRED;
case D135_PRED: return B_D135_PRED; case D135_PRED: return D135_PRED;
case D117_PRED: return B_D117_PRED; case D117_PRED: return D117_PRED;
case D153_PRED: return B_D153_PRED; case D153_PRED: return D153_PRED;
case D27_PRED: return B_D27_PRED; case D27_PRED: return D27_PRED;
case D63_PRED: return B_D63_PRED; case D63_PRED: return D63_PRED;
default: default:
assert(0); assert(0);
return B_MODE_COUNT; // Dummy value return MB_MODE_COUNT; // Dummy value
} }
} }
// transform mapping // transform mapping
static TX_TYPE txfm_map(B_PREDICTION_MODE bmode) { static TX_TYPE txfm_map(MB_PREDICTION_MODE bmode) {
switch (bmode) { switch (bmode) {
case B_TM_PRED : case TM_PRED :
case B_D135_PRED : case D135_PRED :
return ADST_ADST; return ADST_ADST;
case B_V_PRED : case V_PRED :
case B_D117_PRED : case D117_PRED :
case B_D63_PRED: case D63_PRED:
return ADST_DCT; return ADST_DCT;
case B_H_PRED : case H_PRED :
case B_D153_PRED : case D153_PRED :
case B_D27_PRED : case D27_PRED :
return DCT_ADST; return DCT_ADST;
default: default:
......
...@@ -106,12 +106,10 @@ const vp9_prob vp9_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP9_SUBMVREFS - 1] = { ...@@ -106,12 +106,10 @@ const vp9_prob vp9_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP9_SUBMVREFS - 1] = {
const vp9_prob vp9_partition_probs[NUM_PARTITION_CONTEXTS] const vp9_prob vp9_partition_probs[NUM_PARTITION_CONTEXTS]
[PARTITION_TYPES - 1] = { [PARTITION_TYPES - 1] = {
// FIXME(jingning,rbultje) put real probabilities here // FIXME(jingning,rbultje) put real probabilities here
#if CONFIG_AB4X4
{202, 162, 107}, {202, 162, 107},
{16, 2, 169}, {16, 2, 169},
{3, 246, 19}, {3, 246, 19},
{104, 90, 134}, {104, 90, 134},
#endif
{202, 162, 107}, {202, 162, 107},
{16, 2, 169}, {16, 2, 169},
{3, 246, 19}, {3, 246, 19},
......
...@@ -22,10 +22,8 @@ ...@@ -22,10 +22,8 @@
typedef enum BLOCK_SIZE_TYPE { typedef enum BLOCK_SIZE_TYPE {
BLOCK_SIZE_AB4X4, BLOCK_SIZE_AB4X4,
#if CONFIG_AB4X4
BLOCK_SIZE_SB4X8, BLOCK_SIZE_SB4X8,
BLOCK_SIZE_SB8X4, BLOCK_SIZE_SB8X4,
#endif
BLOCK_SIZE_SB8X8, BLOCK_SIZE_SB8X8,
BLOCK_SIZE_SB8X16, BLOCK_SIZE_SB8X16,
BLOCK_SIZE_SB16X8, BLOCK_SIZE_SB16X8,
...@@ -48,10 +46,6 @@ typedef enum PARTITION_TYPE { ...@@ -48,10 +46,6 @@ typedef enum PARTITION_TYPE {
} PARTITION_TYPE; } PARTITION_TYPE;
#define PARTITION_PLOFFSET 4 // number of probability models per block size #define PARTITION_PLOFFSET 4 // number of probability models per block size
#if CONFIG_AB4X4
#define NUM_PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET) #define NUM_PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET)
#else
#define NUM_PARTITION_CONTEXTS (3 * PARTITION_PLOFFSET)
#endif
#endif // VP9_COMMON_VP9_ENUMS_H_ #endif // VP9_COMMON_VP9_ENUMS_H_
...@@ -141,7 +141,7 @@ static int above_block_second_mv(const MODE_INFO *cur_mb, int b, int mi_stride) ...@@ -141,7 +141,7 @@ static int above_block_second_mv(const MODE_INFO *cur_mb, int b, int mi_stride)
(cur_mb->bmi + b - 2)->as_mv[0].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) { static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
// FIXME(rbultje, jingning): temporary hack because jenkins doesn't // FIXME(rbultje, jingning): temporary hack because jenkins doesn't
// understand this condition. This will go away soon. // understand this condition. This will go away soon.
if (b == 0 || b == 2) { if (b == 0 || b == 2) {
...@@ -160,7 +160,7 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) { ...@@ -160,7 +160,7 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
return (cur_mb->bmi + b - 1)->as_mode.first; return (cur_mb->bmi + b - 1)->as_mode.first;
} }
static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
int b, int mi_stride) { int b, int mi_stride) {
if (!(b >> 1)) { if (!(b >> 1)) {
/* On top edge, get from MB above us */ /* On top edge, get from MB above us */
......
...@@ -467,6 +467,12 @@ specialize vp9_sad8x16x8 sse4 ...@@ -467,6 +467,12 @@ specialize vp9_sad8x16x8 sse4
prototype void vp9_sad8x8x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array" prototype void vp9_sad8x8x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
specialize vp9_sad8x8x8 sse4 specialize vp9_sad8x8x8 sse4
prototype void vp9_sad8x4x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
specialize vp9_sad8x4x8
prototype void vp9_sad4x8x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
specialize vp9_sad4x8x8
prototype void vp9_sad4x4x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array" prototype void vp9_sad4x4x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
specialize vp9_sad4x4x8 sse4 specialize vp9_sad4x4x8 sse4
......
...@@ -119,7 +119,6 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m, ...@@ -119,7 +119,6 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
m->mbmi.mb_skip_coeff = vp9_read(r, vp9_get_pred_prob(cm, xd, PRED_MBSKIP)); m->mbmi.mb_skip_coeff = vp9_read(r, vp9_get_pred_prob(cm, xd, PRED_MBSKIP));
// luma mode // luma mode
#if CONFIG_AB4X4
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) { if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
const MB_PREDICTION_MODE A = above_block_mode(m, 0, mis); const MB_PREDICTION_MODE A = above_block_mode(m, 0, mis);
const MB_PREDICTION_MODE L = xd->left_available ? const MB_PREDICTION_MODE L = xd->left_available ?
...@@ -128,26 +127,14 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m, ...@@ -128,26 +127,14 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
} else { } else {
m->mbmi.mode = I4X4_PRED; m->mbmi.mode = I4X4_PRED;
} }
#else
m->mbmi.mode = m->mbmi.sb_type > BLOCK_SIZE_SB8X8 ?
read_kf_sb_ymode(r, cm->sb_kf_ymode_prob[cm->kf_ymode_probs_index]):
read_kf_mb_ymode(r, cm->kf_ymode_prob[cm->kf_ymode_probs_index]);
#endif
m->mbmi.ref_frame = INTRA_FRAME; m->mbmi.ref_frame = INTRA_FRAME;
#if CONFIG_AB4X4
if (m->mbmi.sb_type < BLOCK_SIZE_SB8X8) { if (m->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
#else
if (m->mbmi.mode == I4X4_PRED) {
#endif
int idx, idy; int idx, idy;
int bw = 1 << b_width_log2(m->mbmi.sb_type); int bw = 1 << b_width_log2(m->mbmi.sb_type);
int bh = 1 << b_height_log2(m->mbmi.sb_type); int bh = 1 << b_height_log2(m->mbmi.sb_type);
#if !CONFIG_AB4X4
bw = 1, bh = 1;
#endif
for (idy = 0; idy < 2; idy += bh) { for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) { for (idx = 0; idx < 2; idx += bw) {
int ib = idy * 2 + idx; int ib = idy * 2 + idx;
...@@ -169,12 +156,7 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m, ...@@ -169,12 +156,7 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
if (cm->txfm_mode == TX_MODE_SELECT && if (cm->txfm_mode == TX_MODE_SELECT &&
!(m->mbmi.mb_skip_coeff && m->mbmi.ref_frame != INTRA_FRAME) !(m->mbmi.mb_skip_coeff && m->mbmi.ref_frame != INTRA_FRAME)
#if CONFIG_AB4X4 && m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
&& m->mbmi.sb_type >= BLOCK_SIZE_SB8X8
#else
&& m->mbmi.mode != I4X4_PRED
#endif
) {
const int allow_16x16 = m->mbmi.sb_type >= BLOCK_SIZE_MB16X16; const int allow_16x16 = m->mbmi.sb_type >= BLOCK_SIZE_MB16X16;
const int allow_32x32 = m->mbmi.sb_type >= BLOCK_SIZE_SB32X32; const int allow_32x32 = m->mbmi.sb_type >= BLOCK_SIZE_SB32X32;
m->mbmi.txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32); m->mbmi.txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32);
...@@ -186,12 +168,7 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m, ...@@ -186,12 +168,7 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
m->mbmi.mode <= TM_PRED) { m->mbmi.mode <= TM_PRED) {
m->mbmi.txfm_size = TX_16X16; m->mbmi.txfm_size = TX_16X16;
} else if (cm->txfm_mode >= ALLOW_8X8 && } else if (cm->txfm_mode >= ALLOW_8X8 &&
#if CONFIG_AB4X4 m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
m->mbmi.sb_type >= BLOCK_SIZE_SB8X8
#else
m->mbmi.mode != I4X4_PRED
#endif
) {
m->mbmi.txfm_size = TX_8X8; m->mbmi.txfm_size = TX_8X8;
} else { } else {
m->mbmi.txfm_size = TX_4X4; m->mbmi.txfm_size = TX_4X4;
...@@ -631,16 +608,10 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -631,16 +608,10 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
if (vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_SKIP)) { if (vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_SKIP)) {
mbmi->mode = ZEROMV; mbmi->mode = ZEROMV;
} else { } else {
#if CONFIG_AB4X4
if (bsize >= BLOCK_SIZE_SB8X8) if (bsize >= BLOCK_SIZE_SB8X8)
mbmi->mode = read_sb_mv_ref(r, mv_ref_p); mbmi->mode = read_sb_mv_ref(r, mv_ref_p);
else else
mbmi->mode = SPLITMV; mbmi->mode = SPLITMV;
#else
mbmi->mode = bsize > BLOCK_SIZE_SB8X8 ?
read_sb_mv_ref(r, mv_ref_p)
: read_mv_ref(r, mv_ref_p);
#endif
vp9_accum_mv_refs(cm, mbmi->mode, mbmi->mb_mode_context[ref_frame]); vp9_accum_mv_refs(cm, mbmi->mode, mbmi->mb_mode_context[ref_frame]);
} }
...@@ -706,9 +677,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -706,9 +677,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
mbmi->uv_mode = DC_PRED; mbmi->uv_mode = DC_PRED;
switch (mbmi->mode) { switch (mbmi->mode) {
case SPLITMV: case SPLITMV:
#if !CONFIG_AB4X4
bw = 1, bh = 1;
#endif
mbmi->need_to_clamp_mvs = 0; mbmi->need_to_clamp_mvs = 0;
for (idy = 0; idy < 2; idy += bh) { for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) { for (idx = 0; idx < 2; idx += bw) {
...@@ -848,33 +816,16 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -848,33 +816,16 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
// required for left and above block mv // required for left and above block mv
mv0->as_int = 0; mv0->as_int = 0;
#if CONFIG_AB4X4
if (bsize >= BLOCK_SIZE_SB8X8) { if (bsize >= BLOCK_SIZE_SB8X8) {
mbmi->mode = read_sb_ymode(r, cm->fc.sb_ymode_prob); mbmi->mode = read_sb_ymode(r, cm->fc.sb_ymode_prob);
cm->fc.sb_ymode_counts[mbmi->mode]++; cm->fc.sb_ymode_counts[mbmi->mode]++;
} else { } else {
mbmi->mode = I4X4_PRED; mbmi->mode = I4X4_PRED;
} }
#else
if (bsize > BLOCK_SIZE_SB8X8) {
mbmi->mode = read_sb_ymode(r, cm->fc.sb_ymode_prob);
cm->fc.sb_ymode_counts[mbmi->mode]++;
} else {
mbmi->mode = read_ymode(r, cm->fc.ymode_prob);
cm->fc.ymode_counts[mbmi->mode]++;
}
#endif
// If MB mode is I4X4_PRED read the block modes // If MB mode is I4X4_PRED read the block modes
#if CONFIG_AB4X4
if (bsize < BLOCK_SIZE_SB8X8) { if (bsize < BLOCK_SIZE_SB8X8) {
#else
if (mbmi->mode == I4X4_PRED) {
#endif
int idx, idy; int idx, idy;
#if !CONFIG_AB4X4
bw = 1, bh = 1;
#endif
for (idy = 0; idy < 2; idy += bh) { for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) { for (idx = 0; idx < 2; idx += bw) {
int ib = idy * 2 + idx, k; int ib = idy * 2 + idx, k;
...@@ -893,15 +844,9 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -893,15 +844,9 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
cm->fc.uv_mode_counts[mbmi->mode][mbmi->uv_mode]++; cm->fc.uv_mode_counts[mbmi->mode][mbmi->uv_mode]++;
} }
#if CONFIG_AB4X4
if (cm->txfm_mode == TX_MODE_SELECT && mbmi->mb_skip_coeff == 0 &&
bsize >= BLOCK_SIZE_SB8X8) {
#else
if (cm->txfm_mode == TX_MODE_SELECT && if (cm->txfm_mode == TX_MODE_SELECT &&
(mbmi->mb_skip_coeff == 0 || mbmi->ref_frame == INTRA_FRAME) && (mbmi->mb_skip_coeff == 0 || mbmi->ref_frame == INTRA_FRAME) &&
((mbmi->ref_frame == INTRA_FRAME && mbmi->mode != I4X4_PRED) || bsize >= BLOCK_SIZE_SB8X8) {
(mbmi->ref_frame != INTRA_FRAME && mbmi->mode != SPLITMV))) {
#endif
const int allow_16x16 = bsize >= BLOCK_SIZE_MB16X16; const int allow_16x16 = bsize >= BLOCK_SIZE_MB16X16;
const int allow_32x32 = bsize >= BLOCK_SIZE_SB32X32; const int allow_32x32 = bsize >= BLOCK_SIZE_SB32X32;
mbmi->txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32); mbmi->txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32);
...@@ -909,21 +854,9 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -909,21 +854,9 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
cm->txfm_mode >= ALLOW_32X32) { cm->txfm_mode >= ALLOW_32X32) {
mbmi->txfm_size = TX_32X32; mbmi->txfm_size = TX_32X32;
} else if (cm->txfm_mode >= ALLOW_16X16 && } else if (cm->txfm_mode >= ALLOW_16X16 &&
bsize >= BLOCK_SIZE_MB16X16 bsize >= BLOCK_SIZE_MB16X16) {
#if !CONFIG_AB4X4
&& ((mbmi->ref_frame == INTRA_FRAME && mbmi->mode <= TM_PRED) ||
(mbmi->ref_frame != INTRA_FRAME && mbmi->mode != SPLITMV))
#endif
) {
mbmi->txfm_size = TX_16X16; mbmi->txfm_size = TX_16X16;
} else if (cm->txfm_mode >= ALLOW_8X8 && } else if (cm->txfm_mode >= ALLOW_8X8 && (bsize >= BLOCK_SIZE_SB8X8)) {
#if CONFIG_AB4X4