Commit 57679bad authored by Deb Mukherjee's avatar Deb Mukherjee
Browse files

Allow B_VL_PRED & B_LD_PRED modes with Superblocks

Allows B_VL_PRED & B_LD_PRED modes to be used for all blocks
within a MB in B_PRED mode. These modes were temporarily
disabled with super-block coding.

Change-Id: I973b9bdb82c3da5f12d7cc963162a28805f25303
parent f3208f36
......@@ -402,7 +402,6 @@ typedef struct MacroBlockD {
#define ACTIVE_HT16 300
#endif
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
// convert MB_PREDICTION_MODE to B_PREDICTION_MODE
static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
B_PREDICTION_MODE b_mode;
......@@ -444,7 +443,6 @@ static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
}
return b_mode;
}
#endif
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
// transform mapping
......
......@@ -159,45 +159,34 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
if (!(b & 3)) {
/* On L edge, get from MB to left of us */
--cur_mb;
switch (cur_mb->mbmi.mode) {
case DC_PRED:
return B_DC_PRED;
case V_PRED:
return B_VE_PRED;
case H_PRED:
return B_HE_PRED;
case TM_PRED:
return B_TM_PRED;
case I8X8_PRED:
case B_PRED:
return (cur_mb->bmi + b + 3)->as_mode.first;
default:
return B_DC_PRED;
if (cur_mb->mbmi.mode < I8X8_PRED) {
return pred_mode_conv(cur_mb->mbmi.mode);
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
return pred_mode_conv((cur_mb->bmi + 3 + b)->as_mode.first);
} else if (cur_mb->mbmi.mode == B_PRED) {
return ((cur_mb->bmi + 3 + b)->as_mode.first);
} else {
return B_DC_PRED;
}
}
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) {
static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
int b, int mi_stride) {
if (!(b >> 2)) {
/* On top edge, get from MB above us */
cur_mb -= mi_stride;
switch (cur_mb->mbmi.mode) {
case DC_PRED:
return B_DC_PRED;
case V_PRED:
return B_VE_PRED;
case H_PRED:
return B_HE_PRED;
case TM_PRED:
return B_TM_PRED;
case I8X8_PRED:
case B_PRED:
return (cur_mb->bmi + b + 12)->as_mode.first;
default:
return B_DC_PRED;
if (cur_mb->mbmi.mode < I8X8_PRED) {
return pred_mode_conv(cur_mb->mbmi.mode);
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
return pred_mode_conv((cur_mb->bmi + 12 + b)->as_mode.first);
} else if (cur_mb->mbmi.mode == B_PRED) {
return ((cur_mb->bmi + 12 + b)->as_mode.first);
} else {
return B_DC_PRED;
}
}
......
......@@ -298,18 +298,19 @@ void vp8_comp_intra4x4_predict_c(BLOCKD *x,
void vp8_intra_prediction_down_copy(MACROBLOCKD *xd) {
unsigned char *above_right = *(xd->block[0].base_dst) + xd->block[0].dst -
xd->block[0].dst_stride + 16;
unsigned int *src_ptr = (unsigned int *)
(above_right - (xd->mb_index == 3 ? 16 * xd->block[0].dst_stride : 0));
unsigned int *src_ptr = (unsigned int *)above_right;
unsigned int *dst_ptr0 =
(unsigned int *)(above_right + 4 * xd->block[0].dst_stride);
unsigned int *dst_ptr0 = (unsigned int *)above_right;
unsigned int *dst_ptr1 =
(unsigned int *)(above_right + 8 * xd->block[0].dst_stride);
(unsigned int *)(above_right + 4 * xd->block[0].dst_stride);
unsigned int *dst_ptr2 =
(unsigned int *)(above_right + 8 * xd->block[0].dst_stride);
unsigned int *dst_ptr3 =
(unsigned int *)(above_right + 12 * xd->block[0].dst_stride);
*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
*dst_ptr3 = *src_ptr;
}
......@@ -296,13 +296,6 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
if (mode != B_PRED) {
vp8_build_intra_predictors_mby(xd);
}
#if 0
// Intra-modes requiring recon data from top-right
// MB have been temporarily disabled.
else {
vp8_intra_prediction_down_copy(xd);
}
#endif
}
} else {
#if CONFIG_SUPERBLOCKS
......@@ -371,6 +364,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
b->dst_stride);
}
} else if (mode == B_PRED) {
vp8_intra_prediction_down_copy(xd);
for (i = 0; i < 16; i++) {
BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode.first;
......@@ -595,6 +589,8 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
int dx = col_delta[i];
int offset_extended = dy * xd->mode_info_stride + dx;
xd->mb_index = i;
mi = xd->mode_info_context;
if ((mb_row >= pc->mb_rows) || (mb_col >= pc->mb_cols)) {
// MB lies outside frame, skip on to next
......
......@@ -1945,10 +1945,12 @@ void vp8cx_encode_intra_macro_block(VP8_COMP *cpi,
if (mbmi->mode == I8X8_PRED) {
vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra8x8mbuv(IF_RTCD(&cpi->rtcd), x);
} else if (mbmi->mode == B_PRED)
} else if (mbmi->mode == B_PRED) {
vp8_intra_prediction_down_copy(&x->e_mbd);
vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
else
} else {
vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x);
}
if (mbmi->mode != I8X8_PRED) {
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
......@@ -2049,6 +2051,7 @@ void vp8cx_encode_inter_macroblock (VP8_COMP *cpi, MACROBLOCK *x,
if (mbmi->ref_frame == INTRA_FRAME) {
if (mbmi->mode == B_PRED) {
vp8_intra_prediction_down_copy(xd);
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
} else if (mbmi->mode == I8X8_PRED) {
......
......@@ -218,7 +218,7 @@ void vp8_encode_intra8x8(const VP8_ENCODER_RTCD *rtcd,
vp8_subtract_4b_c(be, b, 16);
#if CONFIG_HYBRIDTRANSFORM8X8
tx_type = get_tx_type(xd, &xd->block[idx]);
tx_type = get_tx_type(xd, xd->block + idx);
if (tx_type != DCT_DCT) {
vp8_fht_c(be->src_diff, (x->block + idx)->coeff, 32,
tx_type, 8);
......
......@@ -1175,11 +1175,6 @@ static int64_t rd_pick_intra4x4block(VP8_COMP *cpi, MACROBLOCK *x, BLOCK *be,
int64_t this_rd;
int ratey;
// TODO Temporarily ignore modes that need the above-right data. SB
// encoding means this data is not available for the bottom right MB
// Do we need to do this for mode2 also?
if (mode == B_LD_PRED || mode == B_VL_PRED)
continue;
b->bmi.as_mode.first = mode;
rate = bmode_costs[mode];
......@@ -1293,12 +1288,11 @@ static int64_t rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rat
tl = (ENTROPY_CONTEXT *)&t_left;
}
// TODO(agrange)
// vp8_intra_prediction_down_copy(xd);
xd->mode_info_context->mbmi.mode = B_PRED;
bmode_costs = mb->inter_bmode_costs;
vp8_intra_prediction_down_copy(xd);
for (i = 0; i < 16; i++) {
MODE_INFO *const mic = xd->mode_info_context;
const int mis = xd->mode_info_stride;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment