Commit 7be5b6da authored by Scott LaVarnway's avatar Scott LaVarnway Committed by Code Review
Browse files

Merge "Populate bmi for B_PRED only"

parents bf6b314d 223d1b54
...@@ -123,7 +123,21 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) ...@@ -123,7 +123,21 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b)
{ {
/* On L edge, get from MB to left of us */ /* On L edge, get from MB to left of us */
--cur_mb; --cur_mb;
b += 4; switch (cur_mb->mbmi.mode)
{
case B_PRED:
return (cur_mb->bmi + b + 3)->as_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;
default:
return B_DC_PRED;
}
} }
return (cur_mb->bmi + b - 1)->as_mode; return (cur_mb->bmi + b - 1)->as_mode;
...@@ -135,7 +149,22 @@ static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, int b, int mi ...@@ -135,7 +149,22 @@ static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, int b, int mi
{ {
/* On top edge, get from MB above us */ /* On top edge, get from MB above us */
cur_mb -= mi_stride; cur_mb -= mi_stride;
b += 16;
switch (cur_mb->mbmi.mode)
{
case B_PRED:
return (cur_mb->bmi + b + 12)->as_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;
default:
return B_DC_PRED;
}
} }
return (cur_mb->bmi + b - 4)->as_mode; return (cur_mb->bmi + b - 4)->as_mode;
......
...@@ -101,36 +101,6 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co ...@@ -101,36 +101,6 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co
} }
while (++i < 16); while (++i < 16);
} }
else
{
int BMode;
int i = 0;
switch (y_mode)
{
case DC_PRED:
BMode = B_DC_PRED;
break;
case V_PRED:
BMode = B_VE_PRED;
break;
case H_PRED:
BMode = B_HE_PRED;
break;
case TM_PRED:
BMode = B_TM_PRED;
break;
default:
BMode = B_DC_PRED;
break;
}
do
{
m->bmi[i].as_mode = (B_PREDICTION_MODE)BMode;
}
while (++i < 16);
}
m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.kf_uv_mode_prob); m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.kf_uv_mode_prob);
} }
......
...@@ -109,30 +109,6 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) ...@@ -109,30 +109,6 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
RECON_INVOKE(&rtcd->common->recon, recon_mby) RECON_INVOKE(&rtcd->common->recon, recon_mby)
(IF_RTCD(&rtcd->common->recon), &x->e_mbd); (IF_RTCD(&rtcd->common->recon), &x->e_mbd);
// make sure block modes are set the way we want them for context updates
for (b = 0; b < 16; b++)
{
BLOCKD *d = &x->e_mbd.block[b];
switch (x->e_mbd.mode_info_context->mbmi.mode)
{
case DC_PRED:
d->bmi.as_mode = B_DC_PRED;
break;
case V_PRED:
d->bmi.as_mode = B_VE_PRED;
break;
case H_PRED:
d->bmi.as_mode = B_HE_PRED;
break;
case TM_PRED:
d->bmi.as_mode = B_TM_PRED;
break;
default:
d->bmi.as_mode = B_DC_PRED;
break;
}
}
} }
void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
......
...@@ -140,8 +140,7 @@ static int pick_intra4x4block( ...@@ -140,8 +140,7 @@ static int pick_intra4x4block(
MACROBLOCK *x, MACROBLOCK *x,
int ib, int ib,
B_PREDICTION_MODE *best_mode, B_PREDICTION_MODE *best_mode,
B_PREDICTION_MODE above, unsigned int *mode_costs,
B_PREDICTION_MODE left,
int *bestrate, int *bestrate,
int *bestdistortion) int *bestdistortion)
...@@ -153,16 +152,6 @@ static int pick_intra4x4block( ...@@ -153,16 +152,6 @@ static int pick_intra4x4block(
int best_rd = INT_MAX; // 1<<30 int best_rd = INT_MAX; // 1<<30
int rate; int rate;
int distortion; int distortion;
unsigned int *mode_costs;
if (x->e_mbd.frame_type == KEY_FRAME)
{
mode_costs = x->bmode_costs[above][left];
}
else
{
mode_costs = x->inter_bmode_costs;
}
for (mode = B_DC_PRED; mode <= B_HE_PRED /*B_HU_PRED*/; mode++) for (mode = B_DC_PRED; mode <= B_HE_PRED /*B_HU_PRED*/; mode++)
{ {
...@@ -202,20 +191,30 @@ static int pick_intra4x4mby_modes ...@@ -202,20 +191,30 @@ static int pick_intra4x4mby_modes
int cost = mb->mbmode_cost [xd->frame_type] [B_PRED]; int cost = mb->mbmode_cost [xd->frame_type] [B_PRED];
int error; int error;
int distortion = 0; int distortion = 0;
unsigned int *bmode_costs;
vp8_intra_prediction_down_copy(xd); vp8_intra_prediction_down_copy(xd);
bmode_costs = mb->inter_bmode_costs;
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;
const B_PREDICTION_MODE A = above_block_mode(mic, i, mis);
const B_PREDICTION_MODE L = left_block_mode(mic, i);
B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode); B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode);
int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(d); int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(d);
pick_intra4x4block(rtcd, mb, i, &best_mode, A, L, &r, &d); if (mb->e_mbd.frame_type == KEY_FRAME)
{
const B_PREDICTION_MODE A = above_block_mode(mic, i, mis);
const B_PREDICTION_MODE L = left_block_mode(mic, i);
bmode_costs = mb->bmode_costs[A][L];
}
pick_intra4x4block(rtcd, mb, i, &best_mode, bmode_costs, &r, &d);
cost += r; cost += r;
distortion += d; distortion += d;
......
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