segfeatures
t8x8
csm
- i8x8
qimode
uvintra
newnear
V_PRED, /* vertical prediction */
H_PRED, /* horizontal prediction */
TM_PRED, /* Truemotion prediction */
-#if CONFIG_I8X8
I8X8_PRED, /* 8x8 based prediction, each 8x8 has its own prediction mode */
-#endif
B_PRED, /* block based prediction, each block has its own prediction mode */
NEARESTMV,
int i;
int is_4x4;
is_4x4 = (xd->mode_info_context->mbmi.mode == SPLITMV) ||
-#if CONFIG_I8X8
- (xd->mode_info_context->mbmi.mode==I8X8_PRED)||
-#endif
- (xd->mode_info_context->mbmi.mode == B_PRED);
+ (xd->mode_info_context->mbmi.mode == I8X8_PRED) ||
+ (xd->mode_info_context->mbmi.mode == B_PRED);
if (is_4x4)
{
#include "entropymode.h"
#include "entropy.h"
#include "vpx_mem/vpx_mem.h"
-#if CONFIG_I8X8
#if CONFIG_QIMODE
const unsigned int kf_y_mode_cts[8][VP8_YMODES] =
#endif
/* TODO: calibrate the baseline distribution */
static const unsigned int y_mode_cts [VP8_YMODES] = { 8080, 1908, 1582, 1007, 2000, 5874};
-#else
-static const unsigned int kf_y_mode_cts[VP8_YMODES] = { 1607, 915, 812, 811, 5455};
-static const unsigned int y_mode_cts [VP8_YMODES] = { 8080, 1908, 1582, 1007, 5874};
-#endif
#if CONFIG_UVINTRA
static const unsigned int uv_mode_cts [VP8_UV_MODES] ={ 162, 41, 41, 12};
#endif
-#if CONFIG_I8X8
static const unsigned int i8x8_mode_cts [VP8_UV_MODES] = {93, 69, 81, 13};
-#endif
#if CONFIG_UVINTRA
/* Again, these trees use the same probability indices as their
explicitly-programmed predecessors. */
-#if CONFIG_I8X8
const vp8_tree_index vp8_ymode_tree[10] =
{
-DC_PRED, 2,
-V_PRED, 4,
-H_PRED, -TM_PRED
};
-#else
-const vp8_tree_index vp8_ymode_tree[8] =
-{
- -DC_PRED, 2,
- 4, 6,
- -V_PRED, -H_PRED,
- -TM_PRED, -B_PRED
-};
-
-const vp8_tree_index vp8_kf_ymode_tree[8] =
-{
- -B_PRED, 2,
- 4, 6,
- -DC_PRED, -V_PRED,
- -H_PRED, -TM_PRED
-};
-#endif
const vp8_tree_index vp8_uv_mode_tree[6] =
{
-DC_PRED, 2,
struct vp8_token_struct vp8_ymode_encodings [VP8_YMODES];
struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
struct vp8_token_struct vp8_uv_mode_encodings [VP8_UV_MODES];
-#if CONFIG_I8X8
struct vp8_token_struct vp8_i8x8_mode_encodings [VP8_UV_MODES];
-#endif
struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
256, 1
);
#endif
-#if CONFIG_I8X8
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree,
x->i8x8_mode_prob, bct, i8x8_mode_cts,
256, 1
);
-#endif
vpx_memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob));
}
vp8_tokens_from_tree(vp8_ymode_encodings, vp8_ymode_tree);
vp8_tokens_from_tree(vp8_kf_ymode_encodings, vp8_kf_ymode_tree);
vp8_tokens_from_tree(vp8_uv_mode_encodings, vp8_uv_mode_tree);
-#if CONFIG_I8X8
vp8_tokens_from_tree(vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree);
-#endif
vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree);
vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array,
extern const vp8_tree_index vp8_ymode_tree[];
extern const vp8_tree_index vp8_kf_ymode_tree[];
extern const vp8_tree_index vp8_uv_mode_tree[];
-#if CONFIG_I8X8
extern const vp8_tree_index vp8_i8x8_mode_tree[];
-#endif
extern const vp8_tree_index vp8_mbsplit_tree[];
extern const vp8_tree_index vp8_mv_ref_tree[];
extern const vp8_tree_index vp8_sub_mv_ref_tree[];
extern struct vp8_token_struct vp8_bmode_encodings [VP8_BINTRAMODES];
extern struct vp8_token_struct vp8_ymode_encodings [VP8_YMODES];
extern struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
-#if CONFIG_I8X8
extern struct vp8_token_struct vp8_i8x8_mode_encodings [VP8_UV_MODES];
-#endif
extern struct vp8_token_struct vp8_uv_mode_encodings [VP8_UV_MODES];
extern struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
return B_HE_PRED;
case TM_PRED:
return B_TM_PRED;
-#if CONFIG_I8X8
case I8X8_PRED:
-#endif
case B_PRED:
return (cur_mb->bmi + b + 3)->as_mode;
default:
return B_HE_PRED;
case TM_PRED:
return B_TM_PRED;
-#if CONFIG_I8X8
case I8X8_PRED:
-#endif
case B_PRED:
return (cur_mb->bmi + b + 12)->as_mode;
default:
#endif /* CONFIG_DUALPRED */
rtcd->recon.copy8x4 = vp8_copy_mem8x4_c;
rtcd->recon.recon = vp8_recon_b_c;
-#if CONFIG_I8X8
rtcd->recon.recon_uv = vp8_recon_uv_b_c;
-#endif
rtcd->recon.recon2 = vp8_recon2b_c;
rtcd->recon.recon4 = vp8_recon4b_c;
rtcd->recon.recon_mb = vp8_recon_mb_c;
vp8_build_intra_predictors_mbuv_s;
rtcd->recon.intra4x4_predict =
vp8_intra4x4_predict;
-
-#if CONFIG_I8X8
rtcd->recon.intra8x8_predict =
vp8_intra8x8_predict;
rtcd->recon.intra_uv4x4_predict =
vp8_intra_uv4x4_predict;
-#endif
-
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c;
int i;
if (x->mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
x->mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
x->mode_info_context->mbmi.mode != SPLITMV)
{
/* do 2nd order transform on the dc block */
lfi->mode_lf_lut[H_PRED] = 1;
lfi->mode_lf_lut[TM_PRED] = 1;
lfi->mode_lf_lut[B_PRED] = 0;
-#if CONFIG_I8X8
lfi->mode_lf_lut[I8X8_PRED]=0;
-#endif
lfi->mode_lf_lut[ZEROMV] = 1;
lfi->mode_lf_lut[NEARESTMV] = 2;
lfi->mode_lf_lut[NEARMV] = 2;
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
-
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
for (mb_col = 0; mb_col < mb_cols; mb_col++)
{
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
- mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
+ mode_info_context->mbmi.mode != I8X8_PRED &&
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
#else
vp8_prob kf_uv_mode_prob [VP8_UV_MODES-1];
#endif
-#if CONFIG_I8X8
+
vp8_prob i8x8_mode_prob [VP8_UV_MODES-1];
-#endif
#if CONFIG_MULCONTEXT
FRAME_CONTEXT lfc_a; /* last alt ref entropy */
}
}
-#if CONFIG_I8X8
void vp8_recon_uv_b_c
(
unsigned char *pred_ptr,
pred_ptr += 8;
}
}
-#endif
void vp8_recon4b_c
(
unsigned char *pred_ptr,
#endif
extern prototype_recon_block(vp8_recon_recon);
-#if CONFIG_I8X8
#ifndef vp8_recon_recon_uv
#define vp8_recon_recon_uv vp8_recon_uv_b_c
#endif
extern prototype_recon_block(vp8_recon_recon_uv);
-#endif
extern prototype_recon_block(vp8_recon_recon);
#ifndef vp8_recon_recon2
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mby);
-#if CONFIG_I8X8
#ifndef vp8_recon_build_intra8x8_predictors_mby
#define vp8_recon_build_intra8x8_predictors_mby vp8_build_intra8x8_predictors_mby
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra8x8_predictors_mby);
-#endif
#ifndef vp8_recon_build_intra_predictors_mby_s
#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mbuv);
-#if CONFIG_I8X8
#ifndef vp8_recon_build_intra8x8_predictors_mbuv
#define vp8_recon_build_intra8x8_predictors_mbuv vp8_build_intra8x8_predictors_mbuv
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra8x8_predictors_mbuv);
-#endif
#ifndef vp8_recon_build_intra_predictors_mbuv_s
#define vp8_recon_build_intra_predictors_mbuv_s vp8_build_intra_predictors_mbuv_s
extern prototype_intra4x4_predict\
(vp8_recon_intra4x4_predict);
-#if CONFIG_I8X8
#ifndef vp8_recon_intra8x8_predict
#define vp8_recon_intra8x8_predict vp8_intra8x8_predict
#endif
extern prototype_intra4x4_predict\
(vp8_recon_intra_uv4x4_predict);
-#endif
-
typedef prototype_copy_block((*vp8_copy_block_fn_t));
typedef prototype_recon_block((*vp8_recon_fn_t));
typedef prototype_recon_macroblock((*vp8_recon_mb_fn_t));
#endif /* CONFIG_DUALPRED */
vp8_copy_block_fn_t copy8x4;
vp8_recon_fn_t recon;
-#if CONFIG_I8X8
vp8_recon_fn_t recon_uv;
-#endif
vp8_recon_fn_t recon2;
vp8_recon_fn_t recon4;
vp8_recon_mb_fn_t recon_mb;
vp8_build_intra_pred_fn_t build_intra_predictors_mbuv_s;
vp8_build_intra_pred_fn_t build_intra_predictors_mbuv;
vp8_intra4x4_pred_fn_t intra4x4_predict;
-#if CONFIG_I8X8
vp8_intra4x4_pred_fn_t intra8x8_predict;
vp8_intra4x4_pred_fn_t intra_uv4x4_predict;
-#endif
} vp8_recon_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
break;
}
}
-#if CONFIG_I8X8
void vp8_intra8x8_predict(BLOCKD *x,
int mode,
unsigned char *predictor)
Current code assumes that a uv 4x4 block use same mode
as corresponding Y 8x8 area
*/
-#endif
return i;
}
-#if CONFIG_I8X8
static int vp8_read_i8x8_mode(vp8_reader *bc, const vp8_prob *p)
{
const int i = vp8_treed_read(bc, vp8_i8x8_mode_tree, p);
return i;
}
-#endif
static int vp8_read_uv_mode(vp8_reader *bc, const vp8_prob *p)
}
while (++i < 16);
}
-#if CONFIG_I8X8
if((m->mbmi.mode = y_mode) == I8X8_PRED)
{
int i;
}
}
else
-#endif
#if CONFIG_UVINTRA
- m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc,
- pbi->common.kf_uv_mode_prob[m->mbmi.mode]);
+ 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);
+ m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc,
+ pbi->common.kf_uv_mode_prob);
#endif
}
while (++j < 16);
}
-#if CONFIG_I8X8
if(mbmi->mode == I8X8_PRED)
{
int i;
}
}
else
-#endif
- mbmi->uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.fc.uv_mode_prob);
+ mbmi->uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.fc.uv_mode_prob);
}
}
}
}
-#if CONFIG_I8X8
-extern const int vp8_i8x8_block[4];
-#endif
+extern const int vp8_i8x8_block[4];
static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
unsigned int mb_idx)
{
mode = xd->mode_info_context->mbmi.mode;
if (eobtotal == 0 && mode != B_PRED && mode != SPLITMV
-#if CONFIG_I8X8
&& mode != I8X8_PRED
-#endif
&&!vp8dx_bool_error(xd->current_bc)
)
{
/* do prediction */
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
-#if CONFIG_I8X8
if(mode != I8X8_PRED)
{
-#endif
- RECON_INVOKE(&pbi->common.rtcd.recon, build_intra_predictors_mbuv)(xd);
-
- if (mode != B_PRED)
- {
- RECON_INVOKE(&pbi->common.rtcd.recon,
- build_intra_predictors_mby)(xd);
- } else {
- vp8_intra_prediction_down_copy(xd);
- }
-#if CONFIG_I8X8
+ RECON_INVOKE(&pbi->common.rtcd.recon, build_intra_predictors_mbuv)(xd);
+ if (mode != B_PRED)
+ {
+ RECON_INVOKE(&pbi->common.rtcd.recon,
+ build_intra_predictors_mby)(xd);
+ } else {
+ vp8_intra_prediction_down_copy(xd);
+ }
}
-#endif
}
else
{
#endif
/* dequantization and idct */
-#if CONFIG_I8X8
if (mode == I8X8_PRED)
{
for (i = 0; i < 4; i++)
*(b->base_dst) + b->dst, 8, b->dst_stride);
}
}
- else
-#endif
- if (mode == B_PRED)
+ else if (mode == B_PRED)
{
for (i = 0; i < 16; i++)
{
}
else
#endif
-#if CONFIG_I8X8
if(xd->mode_info_context->mbmi.mode!=I8X8_PRED)
-#endif
- DEQUANT_INVOKE (&pbi->dequant, idct_add_uv_block)
- (xd->qcoeff+16*16, xd->block[16].dequant,
- xd->predictor+16*16, xd->dst.u_buffer, xd->dst.v_buffer,
- xd->dst.uv_stride, xd->eobs+16);
+ DEQUANT_INVOKE (&pbi->dequant, idct_add_uv_block)
+ (xd->qcoeff+16*16, xd->block[16].dequant,
+ xd->predictor+16*16, xd->dst.u_buffer, xd->dst.v_buffer,
+ xd->dst.uv_stride, xd->eobs+16);
}
}
#endif
-#if CONFIG_I8X8
update_blockd_bmi(xd);
-#endif
+
xd->dst.y_buffer = pc->yv12_fb[dst_fb_idx].y_buffer + recon_yoffset;
xd->dst.u_buffer = pc->yv12_fb[dst_fb_idx].u_buffer + recon_uvoffset;
xd->dst.v_buffer = pc->yv12_fb[dst_fb_idx].v_buffer + recon_uvoffset;
{
/* Clear entropy contexts for Y2 blocks */
if (x->mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
x->mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
x->mode_info_context->mbmi.mode != SPLITMV)
{
vpx_memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
scan = vp8_default_zig_zag1d;
qcoeff_ptr = &xd->qcoeff[0];
if (xd->mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
xd->mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
xd->mode_info_context->mbmi.mode != SPLITMV)
{
i = 24;
if (pbi->common.filter_level)
{
int skip_lf = (xd->mode_info_context->mbmi.mode != B_PRED &&
-#if CONFIG_I8X8
xd->mode_info_context->mbmi.mode != I8X8_PRED &&
-#endif
xd->mode_info_context->mbmi.mode != SPLITMV &&
xd->mode_info_context->mbmi.mb_skip_coeff);
vp8_write_token(bc, vp8_kf_ymode_tree, p, vp8_kf_ymode_encodings + m);
}
-#if CONFIG_I8X8
static void write_i8x8_mode(vp8_writer *bc, int m, const vp8_prob *p)
{
vp8_write_token(bc,vp8_i8x8_mode_tree, p, vp8_i8x8_mode_encodings + m);
}
-#endif
+
static void write_uv_mode(vp8_writer *bc, int m, const vp8_prob *p)
{
vp8_write_token(bc, vp8_uv_mode_tree, p, vp8_uv_mode_encodings + m);
write_bmode(w, m->bmi[j].as_mode, pc->fc.bmode_prob);
while (++j < 16);
}
-#if CONFIG_I8X8
if(mode == I8X8_PRED)
{
write_i8x8_mode(w, m->bmi[0].as_mode, pc->i8x8_mode_prob);
write_i8x8_mode(w, m->bmi[10].as_mode, pc->i8x8_mode_prob);
}
else
-#endif
-
- write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);
+ write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);
}
else
{
}
while (++i < 16);
}
-#if CONFIG_I8X8
if(ym == I8X8_PRED)
{
write_i8x8_mode(bc, m->bmi[0].as_mode, c->i8x8_mode_prob);
m++;
}
else
-#endif
#if CONFIG_UVINTRA
- write_uv_mode(bc, (m++)->mbmi.uv_mode, c->kf_uv_mode_prob[ym]);
+ 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);
+ write_uv_mode(bc, (m++)->mbmi.uv_mode, c->kf_uv_mode_prob);
#endif
}
//printf("\n");
int mbmode_cost[2][MB_MODE_COUNT];
int intra_uv_mode_cost[2][MB_MODE_COUNT];
unsigned int bmode_costs[10][10][10];
-#if CONFIG_I8X8
unsigned int i8x8_mode_costs[MB_MODE_COUNT];
-#endif
unsigned int inter_bmode_costs[B_MODE_COUNT];
// These define limits to motion vector components to prevent them from extending outside the UMV borders
}
while (++b < 16);
}
-#if CONFIG_I8X8
+
if(m==I8X8_PRED)
{
i8x8_modes[xd->block[0].bmi.as_mode]++;
i8x8_modes[xd->block[8].bmi.as_mode]++;
i8x8_modes[xd->block[10].bmi.as_mode]++;
}
-#endif
#endif
++cpi->ymode_count[m];
vp8_update_zbin_extra(cpi, x);
}
-#if CONFIG_I8X8
if(x->e_mbd.mode_info_context->mbmi.mode == I8X8_PRED)
{
vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra8x8mbuv(IF_RTCD(&cpi->rtcd), x);
}
- else
-#endif
- if (x->e_mbd.mode_info_context->mbmi.mode == B_PRED)
+ else if (x->e_mbd.mode_info_context->mbmi.mode == B_PRED)
vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
else
- {
vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x);
- }
-#if CONFIG_I8X8
- if(x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED)
-#endif
- vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
+
+ if(x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED)
+ vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
sum_intra_stats(cpi, x);
vp8_tokenize_mb(cpi, &x->e_mbd, t);
#if CONFIG_T8X8
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
}
-#if CONFIG_I8X8
else if(xd->mode_info_context->mbmi.mode == I8X8_PRED)
{
vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x);
vp8_encode_intra8x8mbuv(IF_RTCD(&cpi->rtcd), x);
}
-#endif
else
{
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
vp8_recon_intra_mbuv(IF_RTCD(&rtcd->common->recon), &x->e_mbd);
}
-#if CONFIG_I8X8
void vp8_encode_intra8x8(const VP8_ENCODER_RTCD *rtcd,
MACROBLOCK *x, int ib)
{
vp8_encode_intra_uv4x4(rtcd, x, i+20, mode);
}
}
-#endif
tl = (ENTROPY_CONTEXT *)&t_left;
has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&&x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
type = has_2nd_order ? PLANE_TYPE_Y_NO_DC : PLANE_TYPE_Y_WITH_DC;
tl = (ENTROPY_CONTEXT *)&t_left;
has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&&x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
type = has_2nd_order ? PLANE_TYPE_Y_NO_DC : PLANE_TYPE_Y_WITH_DC;
tl = (ENTROPY_CONTEXT *)&t_left;
has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&&x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
-#endif
-
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
type = has_2nd_order ? 0 : 3;
tl = (ENTROPY_CONTEXT *)&t_left;
has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&& x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
type = has_2nd_order ? 0 : 3;
#else
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0], x->kf_uv_mode_prob, vp8_uv_mode_tree);
#endif
-#if CONFIG_I8X8
vp8_cost_tokens(c->mb.i8x8_mode_costs,
x->i8x8_mode_prob,vp8_i8x8_mode_tree);
-#endif
-
}
sf->thresh_mult[THR_V_PRED ] = 1000;
sf->thresh_mult[THR_H_PRED ] = 1000;
sf->thresh_mult[THR_B_PRED ] = 2000;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 2000;
-#endif
sf->thresh_mult[THR_TM ] = 1000;
sf->thresh_mult[THR_NEWMV ] = 1000;
sf->thresh_mult[THR_V_PRED ] = 1000;
sf->thresh_mult[THR_H_PRED ] = 1000;
sf->thresh_mult[THR_B_PRED ] = 2500;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 2500;
-#endif
sf->thresh_mult[THR_TM ] = 1000;
sf->thresh_mult[THR_NEARESTG ] = 1000;
sf->thresh_mult[THR_V_PRED ] = 1500;
sf->thresh_mult[THR_H_PRED ] = 1500;
sf->thresh_mult[THR_B_PRED ] = 5000;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 5000;
-#endif
+
if (cpi->ref_frame_flags & VP8_LAST_FLAG)
{
sf->thresh_mult[THR_NEWMV ] = 2000;
sf->thresh_mult[THR_V_PRED ] = 2000;
sf->thresh_mult[THR_H_PRED ] = 2000;
sf->thresh_mult[THR_B_PRED ] = 7500;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 7500;
-#endif
if (cpi->ref_frame_flags & VP8_LAST_FLAG)
{
cpi->mode_check_freq[THR_V_PRED] = 0;
cpi->mode_check_freq[THR_H_PRED] = 0;
cpi->mode_check_freq[THR_B_PRED] = 0;
-#if CONFIG_I8X8
cpi->mode_check_freq[THR_I8X8_PRED] = 0;
-#endif
-
cpi->mode_check_freq[THR_NEARG] = 0;
cpi->mode_check_freq[THR_NEWG] = 0;
cpi->mode_check_freq[THR_NEARA] = 0;
cpi->mode_check_freq[THR_V_PRED] = 2;
cpi->mode_check_freq[THR_H_PRED] = 2;
cpi->mode_check_freq[THR_B_PRED] = 2;
-#if CONFIG_I8X8
cpi->mode_check_freq[THR_I8X8_PRED]=2;
-#endif
-
if (cpi->ref_frame_flags & VP8_GOLD_FLAG)
{
sf->thresh_mult[THR_V_PRED ] = 1000;
sf->thresh_mult[THR_H_PRED ] = 1000;
sf->thresh_mult[THR_B_PRED ] = 2500;
-#if CONFIG_I8X8
- sf->thresh_mult[THR_I8X8_PRED] = 2500;
-#endif
+ sf->thresh_mult[THR_I8X8_PRED] = 2500;
sf->thresh_mult[THR_NEARESTG ] = 1000;
sf->thresh_mult[THR_ZEROG ] = 1000;
sf->thresh_mult[THR_NEARG ] = 1000;
sf->thresh_mult[THR_V_PRED ] = 2000;
sf->thresh_mult[THR_H_PRED ] = 2000;
sf->thresh_mult[THR_B_PRED ] = 5000;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 5000;
-#endif
if (cpi->ref_frame_flags & VP8_LAST_FLAG)
{
sf->thresh_mult[THR_V_PRED ] = 2000;
sf->thresh_mult[THR_H_PRED ] = 2000;
sf->thresh_mult[THR_B_PRED ] = 5000;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 5000;
-#endif
+
if (cpi->ref_frame_flags & VP8_LAST_FLAG)
{
sf->thresh_mult[THR_NEWMV ] = 2000;
cpi->mode_check_freq[THR_V_PRED] = 2;
cpi->mode_check_freq[THR_H_PRED] = 2;
cpi->mode_check_freq[THR_B_PRED] = 2;
-#if CONFIG_I8X8
cpi->mode_check_freq[THR_I8X8_PRED]=2;
-#endif
-
if (cpi->ref_frame_flags & VP8_GOLD_FLAG)
{
cpi->mode_check_freq[THR_V_PRED] = 4;
cpi->mode_check_freq[THR_H_PRED] = 4;
cpi->mode_check_freq[THR_B_PRED] = 4;
-#if CONFIG_I8X8
cpi->mode_check_freq[THR_I8X8_PRED]=4;
-#endif
+
if (cpi->ref_frame_flags & VP8_GOLD_FLAG)
{
cpi->mode_check_freq[THR_NEARG] = 2;
sf->thresh_mult[THR_TM ] = 2000;
sf->thresh_mult[THR_B_PRED ] = 5000;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = 5000;
-#endif
-
if (cpi->ref_frame_flags & VP8_GOLD_FLAG)
{
{
// Disable split MB intra prediction mode
sf->thresh_mult[THR_B_PRED] = INT_MAX;
-#if CONFIG_I8X8
sf->thresh_mult[THR_I8X8_PRED] = INT_MAX;
-#endif
}
if (Speed > 6)
sprintf(modes_stats_file, "modes_q%03d.stt",cpi->common.base_qindex);
f = fopen(modes_stats_file, "w");
fprintf(f, "intra_mode in Intra Frames:\n");
-#if CONFIG_I8X8
fprintf(f, "Y: %8d, %8d, %8d, %8d, %8d, %8d\n", y_modes[0], y_modes[1], y_modes[2], y_modes[3], y_modes[4], y_modes[5]);
fprintf(f, "I8:%8d, %8d, %8d, %8d\n", i8x8_modes[0], i8x8_modes[1], i8x8_modes[2], i8x8_modes[3]);
-#else
- fprintf(f, "Y: %8d, %8d, %8d, %8d, %8d\n", y_modes[0], y_modes[1], y_modes[2], y_modes[3], y_modes[4]);
-#endif
fprintf(f, "UV:%8d, %8d, %8d, %8d\n", uv_modes[0], uv_modes[1], uv_modes[2], uv_modes[3]);
fprintf(f, "Y-UV:\n");
{
#define AF_THRESH2 100
#define ARF_DECAY_THRESH 12
#if CONFIG_DUALPRED
-#define MAX_MODES (32 + CONFIG_I8X8)
+#define MAX_MODES 33
#else /* CONFIG_DUALPRED */
-#define MAX_MODES (20 + CONFIG_I8X8)
+#define MAX_MODES 21
#endif /* CONFIG_DUALPRED */
#define MIN_THRESHMULT 32
THR_SPLITA = 18,
THR_B_PRED = 19,
-#if CONFIG_I8X8
THR_I8X8_PRED = 20,
-#endif
#if CONFIG_DUALPRED
- THR_DUAL_ZEROLG = 20 + CONFIG_I8X8,
- THR_DUAL_NEARESTLG = 21 + CONFIG_I8X8,
- THR_DUAL_NEARLG = 22 + CONFIG_I8X8,
+ THR_DUAL_ZEROLG = 21,
+ THR_DUAL_NEARESTLG = 22,
+ THR_DUAL_NEARLG = 23,
- THR_DUAL_ZEROLA = 23 + CONFIG_I8X8,
- THR_DUAL_NEARESTLA = 24 + CONFIG_I8X8,
- THR_DUAL_NEARLA = 25 + CONFIG_I8X8,
+ THR_DUAL_ZEROLA = 24,
+ THR_DUAL_NEARESTLA = 25,
+ THR_DUAL_NEARLA = 26,
- THR_DUAL_ZEROGA = 26 + CONFIG_I8X8,
- THR_DUAL_NEARESTGA = 27 + CONFIG_I8X8,
- THR_DUAL_NEARGA = 28 + CONFIG_I8X8,
+ THR_DUAL_ZEROGA = 27,
+ THR_DUAL_NEARESTGA = 28,
+ THR_DUAL_NEARGA = 29,
- THR_DUAL_NEWLG = 29 + CONFIG_I8X8,
- THR_DUAL_NEWLA = 30 + CONFIG_I8X8,
- THR_DUAL_NEWGA = 31 + CONFIG_I8X8,
+ THR_DUAL_NEWLG = 30,
+ THR_DUAL_NEWLA = 31,
+ THR_DUAL_NEWGA = 32,
#endif /* CONFIG_DUALPRED */
}
THR_MODES;
{
int i;
int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&& x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
for (i = 0; i < 16; i++)
{
int i;
int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&& x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
for (i = 0; i < 24+has_2nd_order; i++)
SPLITMV,
B_PRED,
-#if CONFIG_I8X8
I8X8_PRED,
-#endif
#if CONFIG_DUALPRED
/* dual prediction modes */
ALTREF_FRAME,
INTRA_FRAME,
-#if CONFIG_I8X8
INTRA_FRAME,
-#endif
#if CONFIG_DUALPRED
/* dual prediction modes */
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-#if CONFIG_I8X8
0,
-#endif
/* dual prediction modes */
GOLDEN_FRAME,
x->e_mbd.mode_info_context->mbmi.mode = mode_selected;
return best_rd;
}
-#if CONFIG_I8X8
static int rd_pick_intra8x8block(
VP8_COMP *cpi,
MACROBLOCK *x,
*Distortion = distortion;
return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);
}
-#endif
static int rd_cost_mbuv(MACROBLOCK *mb)
{
}
}
-#if CONFIG_I8X8
static void set_i8x8_block_modes(MACROBLOCK *x, int *modes)
{
int i;
xd->block[i].bmi = xd->mode_info_context->bmi[i];
}
}
-#endif
-
-
void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset,
int *returnrate, int *returndistortion, int *returnintra,
MB_PREDICTION_MODE this_mode;
int num00;
int best_mode_index = 0;
-#if CONFIG_I8X8
int mode8x8[4];
-#endif
unsigned char segment_id = xd->mode_info_context->mbmi.segment_id;
int i;
}
}
break;
-#if CONFIG_I8X8
case I8X8_PRED:
{
int tmp_rd;
}
}
break;
-#endif
case SPLITMV:
{
vpx_memcpy(&best_partition, x->partition_info, sizeof(PARTITION_INFO));
if ((this_mode == B_PRED)
-#if CONFIG_I8X8
||(this_mode == I8X8_PRED)
-#endif
|| (this_mode == SPLITMV))
for (i = 0; i < 16; i++)
{
}
}
-#if CONFIG_I8X8
if (best_mbmode.mode == I8X8_PRED)
{
set_i8x8_block_modes(x, mode8x8);
}
-#endif
if (best_mbmode.mode == SPLITMV)
{
int rate4x4_tokenonly = 0;
int rate16x16_tokenonly = 0;
int rateuv_tokenonly = 0;
-#if CONFIG_I8X8
int error8x8, rate8x8_tokenonly=0;
int rate8x8, dist8x8;
int mode16x16;
int mode8x8[4];
-#endif
x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME;
error16x16 = rd_pick_intra16x16mby_mode(cpi, x,
&rate16x16, &rate16x16_tokenonly,
&dist16x16);
-#if CONFIG_I8X8
mode16x16 = x->e_mbd.mode_info_context->mbmi.mode;
error8x8 = rd_pick_intra8x8mby_modes(cpi, x,
&rate8x8, &rate8x8_tokenonly,
mode8x8[1]= x->e_mbd.mode_info_context->bmi[2].as_mode;
mode8x8[2]= x->e_mbd.mode_info_context->bmi[8].as_mode;
mode8x8[3]= x->e_mbd.mode_info_context->bmi[10].as_mode;
-#endif
#if CONFIG_T8X8
if ( get_seg_tx_type( xd,
&dist4x4, error16x16);
#endif
-#if CONFIG_I8X8
if(error8x8> error16x16)
{
-#endif
- if (error4x4 < error16x16)
- {
- x->e_mbd.mode_info_context->mbmi.mode = B_PRED;
- rate += rate4x4;
- }
- else
- {
-#if CONFIG_I8X8
- x->e_mbd.mode_info_context->mbmi.mode = mode16x16;
-#endif
- rate += rate16x16;
+ if (error4x4 < error16x16)
+ {
+ x->e_mbd.mode_info_context->mbmi.mode = B_PRED;
+ rate += rate4x4;
+ }
+ else
+ {
+ x->e_mbd.mode_info_context->mbmi.mode = mode16x16;
+ rate += rate16x16;
- }
-#if CONFIG_I8X8
+ }
}
else
{
rate += rate8x8;
}
}
-#endif
*rate_ = rate;
}
skip_inc = 0;
has_y2_block = (x->mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&& x->mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->mode_info_context->mbmi.mode != SPLITMV);
x->mode_info_context->mbmi.mb_skip_coeff =
{
/* Clear entropy contexts for Y2 blocks */
if (x->mode_info_context->mbmi.mode != B_PRED
-#if CONFIG_I8X8
&& x->mode_info_context->mbmi.mode != I8X8_PRED
-#endif
&& x->mode_info_context->mbmi.mode != SPLITMV)
{
vpx_memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));