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
This commit is contained in:
Deb Mukherjee 2012-10-19 15:12:12 -07:00
Родитель f3208f362b
Коммит 57679badf2
7 изменённых файлов: 37 добавлений и 56 удалений

Просмотреть файл

@ -402,7 +402,6 @@ typedef struct MacroBlockD {
#define ACTIVE_HT16 300 #define ACTIVE_HT16 300
#endif #endif
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
// 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 B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
B_PREDICTION_MODE b_mode; B_PREDICTION_MODE b_mode;
@ -444,7 +443,6 @@ static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
} }
return b_mode; return b_mode;
} }
#endif
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16 #if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
// transform mapping // transform mapping

Просмотреть файл

@ -159,45 +159,34 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
if (!(b & 3)) { if (!(b & 3)) {
/* On L edge, get from MB to left of us */ /* On L edge, get from MB to left of us */
--cur_mb; --cur_mb;
switch (cur_mb->mbmi.mode) {
case DC_PRED: if (cur_mb->mbmi.mode < I8X8_PRED) {
return B_DC_PRED; return pred_mode_conv(cur_mb->mbmi.mode);
case V_PRED: } else if (cur_mb->mbmi.mode == I8X8_PRED) {
return B_VE_PRED; return pred_mode_conv((cur_mb->bmi + 3 + b)->as_mode.first);
case H_PRED: } else if (cur_mb->mbmi.mode == B_PRED) {
return B_HE_PRED; return ((cur_mb->bmi + 3 + b)->as_mode.first);
case TM_PRED: } else {
return B_TM_PRED; return B_DC_PRED;
case I8X8_PRED:
case B_PRED:
return (cur_mb->bmi + b + 3)->as_mode.first;
default:
return B_DC_PRED;
} }
} }
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 static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
*cur_mb, int b, int mi_stride) { int b, int mi_stride) {
if (!(b >> 2)) { if (!(b >> 2)) {
/* On top edge, get from MB above us */ /* On top edge, get from MB above us */
cur_mb -= mi_stride; cur_mb -= mi_stride;
switch (cur_mb->mbmi.mode) { if (cur_mb->mbmi.mode < I8X8_PRED) {
case DC_PRED: return pred_mode_conv(cur_mb->mbmi.mode);
return B_DC_PRED; } else if (cur_mb->mbmi.mode == I8X8_PRED) {
case V_PRED: return pred_mode_conv((cur_mb->bmi + 12 + b)->as_mode.first);
return B_VE_PRED; } else if (cur_mb->mbmi.mode == B_PRED) {
case H_PRED: return ((cur_mb->bmi + 12 + b)->as_mode.first);
return B_HE_PRED; } else {
case TM_PRED: return B_DC_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;
} }
} }

Просмотреть файл

@ -298,18 +298,19 @@ void vp8_comp_intra4x4_predict_c(BLOCKD *x,
void vp8_intra_prediction_down_copy(MACROBLOCKD *xd) { void vp8_intra_prediction_down_copy(MACROBLOCKD *xd) {
unsigned char *above_right = *(xd->block[0].base_dst) + xd->block[0].dst - unsigned char *above_right = *(xd->block[0].base_dst) + xd->block[0].dst -
xd->block[0].dst_stride + 16; 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;
unsigned int *dst_ptr0 =
(unsigned int *)(above_right + 4 * xd->block[0].dst_stride);
unsigned int *dst_ptr1 = 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 *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); (unsigned int *)(above_right + 12 * xd->block[0].dst_stride);
*dst_ptr0 = *src_ptr; *dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr; *dst_ptr1 = *src_ptr;
*dst_ptr2 = *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) { if (mode != B_PRED) {
vp8_build_intra_predictors_mby(xd); 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 { } else {
#if CONFIG_SUPERBLOCKS #if CONFIG_SUPERBLOCKS
@ -371,6 +364,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
b->dst_stride); b->dst_stride);
} }
} else if (mode == B_PRED) { } else if (mode == B_PRED) {
vp8_intra_prediction_down_copy(xd);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
BLOCKD *b = &xd->block[i]; BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode.first; 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 dx = col_delta[i];
int offset_extended = dy * xd->mode_info_stride + dx; int offset_extended = dy * xd->mode_info_stride + dx;
xd->mb_index = i;
mi = xd->mode_info_context; mi = xd->mode_info_context;
if ((mb_row >= pc->mb_rows) || (mb_col >= pc->mb_cols)) { if ((mb_row >= pc->mb_rows) || (mb_col >= pc->mb_cols)) {
// MB lies outside frame, skip on to next // 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) { if (mbmi->mode == I8X8_PRED) {
vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x); vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra8x8mbuv(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); vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
else } else {
vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x); vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x);
}
if (mbmi->mode != I8X8_PRED) { if (mbmi->mode != I8X8_PRED) {
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x); 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->ref_frame == INTRA_FRAME) {
if (mbmi->mode == B_PRED) { if (mbmi->mode == B_PRED) {
vp8_intra_prediction_down_copy(xd);
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x); vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x); vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
} else if (mbmi->mode == I8X8_PRED) { } 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); vp8_subtract_4b_c(be, b, 16);
#if CONFIG_HYBRIDTRANSFORM8X8 #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) { if (tx_type != DCT_DCT) {
vp8_fht_c(be->src_diff, (x->block + idx)->coeff, 32, vp8_fht_c(be->src_diff, (x->block + idx)->coeff, 32,
tx_type, 8); tx_type, 8);

Просмотреть файл

@ -1175,11 +1175,6 @@ static int64_t rd_pick_intra4x4block(VP8_COMP *cpi, MACROBLOCK *x, BLOCK *be,
int64_t this_rd; int64_t this_rd;
int ratey; 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; b->bmi.as_mode.first = mode;
rate = bmode_costs[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; tl = (ENTROPY_CONTEXT *)&t_left;
} }
// TODO(agrange)
// vp8_intra_prediction_down_copy(xd);
xd->mode_info_context->mbmi.mode = B_PRED; xd->mode_info_context->mbmi.mode = B_PRED;
bmode_costs = mb->inter_bmode_costs; bmode_costs = mb->inter_bmode_costs;
vp8_intra_prediction_down_copy(xd);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
MODE_INFO *const mic = xd->mode_info_context; MODE_INFO *const mic = xd->mode_info_context;
const int mis = xd->mode_info_stride; const int mis = xd->mode_info_stride;