summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vp8/common/blockd.h2
-rw-r--r--vp8/common/findnearmv.h49
-rw-r--r--vp8/common/reconintra4x4.c13
-rw-r--r--vp8/decoder/decodframe.c10
-rw-r--r--vp8/encoder/encodeframe.c7
-rw-r--r--vp8/encoder/encodeintra.c2
-rw-r--r--vp8/encoder/rdopt.c10
7 files changed, 37 insertions, 56 deletions
diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h
index 10e7d6d0c..acf710d05 100644
--- a/vp8/common/blockd.h
+++ b/vp8/common/blockd.h
@@ -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
diff --git a/vp8/common/findnearmv.h b/vp8/common/findnearmv.h
index cd7b87adf..345a7c1c0 100644
--- a/vp8/common/findnearmv.h
+++ b/vp8/common/findnearmv.h
@@ -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;
}
}
diff --git a/vp8/common/reconintra4x4.c b/vp8/common/reconintra4x4.c
index 0ba0a2cff..dfbaf137b 100644
--- a/vp8/common/reconintra4x4.c
+++ b/vp8/common/reconintra4x4.c
@@ -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;
}
-
-
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 049cac7c7..ff447dcd7 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -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
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index c92ec0253..619695c33 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -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) {
diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c
index 9ff39c6f1..9076780d9 100644
--- a/vp8/encoder/encodeintra.c
+++ b/vp8/encoder/encodeintra.c
@@ -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);
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index 7b5c8e1b4..4b9e90725 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -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;