Commit c1814d26 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

Merge UVINTRA experiment

The commit merges the UVINTRA experiment and removed the related
macros. The overall effect of the experiment is a small gain (.1%
on derf)

Change-Id: Ia34b3312fb9b5b34c9ba111bf0fa78c6f78ac80b
parent ad06c9f0
......@@ -35,7 +35,6 @@ static const unsigned int kf_y_mode_cts[VP8_YMODES] = {
static const unsigned int y_mode_cts [VP8_YMODES] = {
106, 25, 21, 13, 16, 74};
#if CONFIG_UVINTRA
static const unsigned int uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={
{ 210, 20, 20, 6},
{ 180, 60, 10, 6},
......@@ -44,13 +43,9 @@ static const unsigned int uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={
{ 142, 51, 45, 18}, /* never used */
{ 160, 40, 46, 10},
};
#else
static const unsigned int uv_mode_cts [VP8_UV_MODES] = { 59483, 13605, 16492, 4230};
#endif
static const unsigned int i8x8_mode_cts [VP8_UV_MODES] = {93, 69, 81, 13};
#if CONFIG_UVINTRA
static const unsigned int kf_uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={
{ 180, 34, 34, 8},
{ 132, 74, 40, 10},
......@@ -59,9 +54,6 @@ static const unsigned int kf_uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={
{ 142, 51, 45, 18}, /* never used */
{ 142, 51, 45, 18},
};
#else
static const unsigned int kf_uv_mode_cts[VP8_UV_MODES] = { 5319, 1904, 1703, 674};
#endif
static const unsigned int bmode_cts[VP8_BINTRAMODES] =
{
......@@ -287,7 +279,6 @@ void vp8_init_mbmode_probs(VP8_COMMON *x)
256, 1
);
#endif
#if CONFIG_UVINTRA
{
int i;
for (i=0;i<VP8_YMODES;i++)
......@@ -302,17 +293,7 @@ void vp8_init_mbmode_probs(VP8_COMMON *x)
256, 1);
}
}
#else
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
x->fc.uv_mode_prob, bct, uv_mode_cts,
256, 1);
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
x->kf_uv_mode_prob, bct, kf_uv_mode_cts,
256, 1);
#endif
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree,
x->i8x8_mode_prob, bct, i8x8_mode_cts,
......
......@@ -46,11 +46,7 @@ typedef struct frame_contexts
{
vp8_prob bmode_prob [VP8_BINTRAMODES-1];
vp8_prob ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */
#if CONFIG_UVINTRA
vp8_prob uv_mode_prob [VP8_YMODES][VP8_UV_MODES-1];
#else
vp8_prob uv_mode_prob [VP8_UV_MODES-1];
#endif
vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1];
vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
vp8_prob coef_probs_8x8 [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
......@@ -212,12 +208,7 @@ typedef struct VP8Common
#else
vp8_prob kf_ymode_prob [VP8_YMODES-1]; /* keyframe "" */
#endif
#if CONFIG_UVINTRA
vp8_prob kf_uv_mode_prob[VP8_YMODES] [VP8_UV_MODES-1];
#else
vp8_prob kf_uv_mode_prob [VP8_UV_MODES-1];
#endif
vp8_prob i8x8_mode_prob [VP8_UV_MODES-1];
vp8_prob prob_intra_coded;
......
......@@ -190,13 +190,8 @@ static void vp8_kfread_modes(VP8D_COMP *pbi,
}
}
else
#if CONFIG_UVINTRA
m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc,
pbi->common.kf_uv_mode_prob[m->mbmi.mode]);
#else
m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc,
pbi->common.kf_uv_mode_prob);
#endif
#if CONFIG_COMP_INTRA_PRED
m->mbmi.second_uv_mode = (MB_PREDICTION_MODE) (DC_PRED - 1);
#endif
......@@ -568,20 +563,6 @@ static void mb_mode_mv_init(VP8D_COMP *pbi)
}
while (++i < VP8_YMODES-1);
}
#if CONFIG_UVINTRA
//vp8_read_bit(bc);
#else
if (vp8_read_bit(bc))
{
int i = 0;
do
{
cm->fc.uv_mode_prob[i] = (vp8_prob) vp8_read_literal(bc, 8);
}
while (++i < VP8_UV_MODES-1);
}
#endif /* CONFIG_UVINTRA */
#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv)
read_mvcontexts_hp(bc, mvc_hp);
......@@ -1041,13 +1022,9 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
}
}
else
#if CONFIG_UVINTRA
mbmi->uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc,
pbi->common.fc.uv_mode_prob[mbmi->mode]);
#else
mbmi->uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc,
pbi->common.fc.uv_mode_prob);
#endif /*CONFIG_UVINTRA*/
#if CONFIG_COMP_INTRA_PRED
mbmi->second_uv_mode = (MB_PREDICTION_MODE) (DC_PRED - 1);
#endif
......
......@@ -134,18 +134,6 @@ static void update_mbintra_mode_probs(VP8_COMP *cpi)
Pnew, x->fc.ymode_prob, bct, (unsigned int *)cpi->ymode_count
);
}
{
#if CONFIG_UVINTRA
//vp8_write_bit(w, 0);
#else
vp8_prob Pnew [VP8_UV_MODES-1];
unsigned int bct [VP8_UV_MODES-1] [2];
update_mode(
w, VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
Pnew, x->fc.uv_mode_prob, bct, (unsigned int *)cpi->uv_mode_count
);
#endif
}
}
void update_skip_probs(VP8_COMP *cpi)
......@@ -1009,18 +997,12 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
}
else
{
#if CONFIG_UVINTRA
write_uv_mode(w, mi->uv_mode,
pc->fc.uv_mode_prob[mode]);
#ifdef MODE_STATS
if(mode!=B_PRED)
++cpi->y_uv_mode_count[mode][mi->uv_mode];
#endif
#else
write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);
#endif /*CONFIG_UVINTRA*/
}
}
else
......@@ -1362,11 +1344,7 @@ static void write_kfmodes(VP8_COMP *cpi)
c->i8x8_mode_prob);
}
else
#if CONFIG_UVINTRA
write_uv_mode(bc, m->mbmi.uv_mode, c->kf_uv_mode_prob[ym]);
#else
write_uv_mode(bc, m->mbmi.uv_mode, c->kf_uv_mode_prob);
#endif
// Next MB
mb_row += dy;
......
......@@ -49,17 +49,10 @@ void vp8_init_mode_costs(VP8_COMP *c)
vp8_cost_tokens(c->mb.mbmode_cost[0],
x->kf_ymode_prob, vp8_kf_ymode_tree);
#endif
#if CONFIG_UVINTRA
vp8_cost_tokens(c->mb.intra_uv_mode_cost[1],
x->fc.uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0],
x->kf_uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
#else
vp8_cost_tokens(c->mb.intra_uv_mode_cost[1],
x->fc.uv_mode_prob, vp8_uv_mode_tree);
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0],
x->kf_uv_mode_prob, vp8_uv_mode_tree);
#endif
vp8_cost_tokens(c->mb.i8x8_mode_costs,
x->i8x8_mode_prob,vp8_i8x8_mode_tree);
......
......@@ -1914,12 +1914,9 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf)
cpi->common.error.setjmp = 0;
#if CONFIG_UVINTRA
vp8_zero(cpi->y_uv_mode_count)
#endif
return (VP8_PTR) cpi;
}
void vp8_remove_compressor(VP8_PTR *ptr)
......@@ -2013,7 +2010,6 @@ void vp8_remove_compressor(VP8_PTR *ptr)
uv_modes_y[i][1], uv_modes_y[i][2], uv_modes_y[i][3]);
}
}
#if CONFIG_UVINTRA
fprintf(f, "Inter Y-UV:\n");
{
int i;
......@@ -2023,7 +2019,6 @@ void vp8_remove_compressor(VP8_PTR *ptr)
cpi->y_uv_mode_count[i][1], cpi->y_uv_mode_count[i][2], cpi->y_uv_mode_count[i][3]);
}
}
#endif
fprintf(f, "B: ");
{
int i;
......
......@@ -91,11 +91,7 @@ typedef struct
[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
vp8_prob ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */
#if CONFIG_UVINTRA
vp8_prob uv_mode_prob [VP8_YMODES][VP8_UV_MODES-1];
#else
vp8_prob uv_mode_prob [VP8_UV_MODES-1];
#endif
int mv_ref_ct[6][4][2];
int mode_context[6][4];
......@@ -522,10 +518,7 @@ typedef struct VP8_COMP
int t4x4_count;
int t8x8_count;
#if CONFIG_UVINTRA
int y_uv_mode_count[VP8_YMODES][VP8_UV_MODES];
#endif
unsigned char *segmentation_map;
// segment threashold for encode breakout
......
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