Merge changes I23aa5547,I8341a19c into experimental

* changes:
  tokenize: make local symbols static; give exported symbols a vp9_ prefix.
  encodemb: make locally used functions static.
This commit is contained in:
Paul Wilkins 2012-10-30 07:24:53 -07:00 committed by Gerrit Code Review
commit 5091302722
4 changed files with 41 additions and 48 deletions

View File

@ -267,9 +267,9 @@ static const int plane_rd_mult[4] = {
}\ }\
} }
void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l, ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
const VP8_ENCODER_RTCD *rtcd, int tx_size) { const VP8_ENCODER_RTCD *rtcd, int tx_size) {
BLOCK *b; BLOCK *b;
BLOCKD *d; BLOCKD *d;
vp8_token_state tokens[65][2]; vp8_token_state tokens[65][2];
@ -689,14 +689,14 @@ void vp8_optimize_mbuv_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) {
} }
} }
void optimize_mb_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) { static void optimize_mb_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) {
vp8_optimize_mby_8x8(x, rtcd); vp8_optimize_mby_8x8(x, rtcd);
vp8_optimize_mbuv_8x8(x, rtcd); vp8_optimize_mbuv_8x8(x, rtcd);
} }
void optimize_b_16x16(MACROBLOCK *mb, int i, PLANE_TYPE type, static void optimize_b_16x16(MACROBLOCK *mb, int i, PLANE_TYPE type,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l, ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
const VP8_ENCODER_RTCD *rtcd) { const VP8_ENCODER_RTCD *rtcd) {
BLOCK *b = &mb->block[i]; BLOCK *b = &mb->block[i];
BLOCKD *d = &mb->e_mbd.block[i]; BLOCKD *d = &mb->e_mbd.block[i];
vp8_token_state tokens[257][2]; vp8_token_state tokens[257][2];

View File

@ -738,7 +738,7 @@ static void macro_block_yrd_4x4(MACROBLOCK *mb,
*Distortion = (d >> 2); *Distortion = (d >> 2);
// rate // rate
*Rate = vp8_rdcost_mby(mb); *Rate = vp8_rdcost_mby(mb);
*skippable = mby_is_skippable_4x4(&mb->e_mbd, 1); *skippable = vp9_mby_is_skippable_4x4(&mb->e_mbd, 1);
} }
static int vp8_rdcost_mby_8x8(MACROBLOCK *mb, int backup) { static int vp8_rdcost_mby_8x8(MACROBLOCK *mb, int backup) {
@ -802,7 +802,7 @@ static void macro_block_yrd_8x8(MACROBLOCK *mb,
*Distortion = (d >> 2); *Distortion = (d >> 2);
// rate // rate
*Rate = vp8_rdcost_mby_8x8(mb, 1); *Rate = vp8_rdcost_mby_8x8(mb, 1);
*skippable = mby_is_skippable_8x8(&mb->e_mbd, 1); *skippable = vp9_mby_is_skippable_8x8(&mb->e_mbd, 1);
} }
static int vp8_rdcost_mby_16x16(MACROBLOCK *mb) { static int vp8_rdcost_mby_16x16(MACROBLOCK *mb) {
@ -850,7 +850,7 @@ static void macro_block_yrd_16x16(MACROBLOCK *mb, int *Rate, int *Distortion,
*Distortion = (d >> 2); *Distortion = (d >> 2);
// rate // rate
*Rate = vp8_rdcost_mby_16x16(mb); *Rate = vp8_rdcost_mby_16x16(mb);
*skippable = mby_is_skippable_16x16(&mb->e_mbd); *skippable = vp9_mby_is_skippable_16x16(&mb->e_mbd);
} }
static void macro_block_yrd(VP8_COMP *cpi, MACROBLOCK *x, int *rate, static void macro_block_yrd(VP8_COMP *cpi, MACROBLOCK *x, int *rate,
@ -1024,7 +1024,7 @@ static void super_block_yrd_8x8(MACROBLOCK *x,
xd->above_context = ta + x_idx; xd->above_context = ta + x_idx;
xd->left_context = tl + y_idx; xd->left_context = tl + y_idx;
r += vp8_rdcost_mby_8x8(x, 0); r += vp8_rdcost_mby_8x8(x, 0);
skippable = skippable && mby_is_skippable_8x8(xd, 1); skippable = skippable && vp9_mby_is_skippable_8x8(xd, 1);
} }
*distortion = (d >> 2); *distortion = (d >> 2);
@ -1618,7 +1618,7 @@ static int64_t rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate,
*rate = rd_cost_mbuv(x); *rate = rd_cost_mbuv(x);
*distortion = vp8_mbuverror(x) / 4; *distortion = vp8_mbuverror(x) / 4;
*skip = mbuv_is_skippable_4x4(&x->e_mbd); *skip = vp9_mbuv_is_skippable_4x4(&x->e_mbd);
return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); return RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
} }
@ -1683,7 +1683,7 @@ static int64_t rd_inter32x32_uv_8x8(VP8_COMP *cpi, MACROBLOCK *x, int *rate,
xd->left_context = tl + y_idx; xd->left_context = tl + y_idx;
r += rd_cost_mbuv_8x8(x, 0); r += rd_cost_mbuv_8x8(x, 0);
d += vp8_mbuverror(x) / 4; d += vp8_mbuverror(x) / 4;
skippable = skippable && mbuv_is_skippable_8x8(xd); skippable = skippable && vp9_mbuv_is_skippable_8x8(xd);
} }
*rate = r; *rate = r;
@ -1708,7 +1708,7 @@ static int64_t rd_inter16x16_uv_8x8(VP8_COMP *cpi, MACROBLOCK *x, int *rate,
*rate = rd_cost_mbuv_8x8(x, 1); *rate = rd_cost_mbuv_8x8(x, 1);
*distortion = vp8_mbuverror(x) / 4; *distortion = vp8_mbuverror(x) / 4;
*skip = mbuv_is_skippable_8x8(&x->e_mbd); *skip = vp9_mbuv_is_skippable_8x8(&x->e_mbd);
return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); return RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
} }
@ -1725,7 +1725,7 @@ static int64_t rd_inter4x4_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate,
*rate = rd_cost_mbuv(x); *rate = rd_cost_mbuv(x);
*distortion = vp8_mbuverror(x) / 4; *distortion = vp8_mbuverror(x) / 4;
*skippable = mbuv_is_skippable_4x4(&x->e_mbd); *skippable = vp9_mbuv_is_skippable_4x4(&x->e_mbd);
return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); return RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
} }
@ -1783,7 +1783,7 @@ static void rd_pick_intra_mbuv_mode(VP8_COMP *cpi,
this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);
if (this_rd < best_rd) { if (this_rd < best_rd) {
skip = mbuv_is_skippable_4x4(xd); skip = vp9_mbuv_is_skippable_4x4(xd);
best_rd = this_rd; best_rd = this_rd;
d = distortion; d = distortion;
r = rate; r = rate;
@ -1840,7 +1840,7 @@ static void rd_pick_intra_mbuv_mode_8x8(VP8_COMP *cpi,
this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);
if (this_rd < best_rd) { if (this_rd < best_rd) {
skip = mbuv_is_skippable_8x8(xd); skip = vp9_mbuv_is_skippable_8x8(xd);
best_rd = this_rd; best_rd = this_rd;
d = distortion; d = distortion;
r = rate; r = rate;
@ -1884,7 +1884,7 @@ static void super_block_uvrd_8x8(MACROBLOCK *x,
dst_uv_stride); dst_uv_stride);
vp8_transform_mbuv_8x8(x); vp8_transform_mbuv_8x8(x);
vp8_quantize_mbuv_8x8(x); vp8_quantize_mbuv_8x8(x);
s &= mbuv_is_skippable_8x8(xd); s &= vp9_mbuv_is_skippable_8x8(xd);
d += vp8_mbuverror(x) >> 2; d += vp8_mbuverror(x) >> 2;
xd->above_context = ta + x_idx; xd->above_context = ta + x_idx;
@ -2745,8 +2745,8 @@ static int rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
*returndistortion = bsi.d; *returndistortion = bsi.d;
*returnyrate = bsi.segment_yrate; *returnyrate = bsi.segment_yrate;
*skippable = bsi.txfm_size == TX_4X4 ? *skippable = bsi.txfm_size == TX_4X4 ?
mby_is_skippable_4x4(&x->e_mbd, 0) : vp9_mby_is_skippable_4x4(&x->e_mbd, 0) :
mby_is_skippable_8x8(&x->e_mbd, 0); vp9_mby_is_skippable_8x8(&x->e_mbd, 0);
/* save partitions */ /* save partitions */
mbmi->txfm_size = bsi.txfm_size; mbmi->txfm_size = bsi.txfm_size;

View File

@ -218,7 +218,7 @@ static void tokenize_b(VP8_COMP *cpi,
*a = *l = (c != !type); /* 0 <-> all coeff data is zero */ *a = *l = (c != !type); /* 0 <-> all coeff data is zero */
} }
int mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block) { int vp9_mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block) {
int skip = 1; int skip = 1;
int i = 0; int i = 0;
@ -233,7 +233,7 @@ int mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block) {
return skip; return skip;
} }
int mbuv_is_skippable_4x4(MACROBLOCKD *xd) { int vp9_mbuv_is_skippable_4x4(MACROBLOCKD *xd) {
int skip = 1; int skip = 1;
int i; int i;
@ -242,12 +242,12 @@ int mbuv_is_skippable_4x4(MACROBLOCKD *xd) {
return skip; return skip;
} }
int mb_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block) { static int mb_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block) {
return (mby_is_skippable_4x4(xd, has_y2_block) & return (vp9_mby_is_skippable_4x4(xd, has_y2_block) &
mbuv_is_skippable_4x4(xd)); vp9_mbuv_is_skippable_4x4(xd));
} }
int mby_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block) { int vp9_mby_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block) {
int skip = 1; int skip = 1;
int i = 0; int i = 0;
@ -262,31 +262,28 @@ int mby_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block) {
return skip; return skip;
} }
int mbuv_is_skippable_8x8(MACROBLOCKD *xd) { int vp9_mbuv_is_skippable_8x8(MACROBLOCKD *xd) {
return (!xd->block[16].eob) & (!xd->block[20].eob); return (!xd->block[16].eob) & (!xd->block[20].eob);
} }
int mb_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block) { static int mb_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block) {
return (mby_is_skippable_8x8(xd, has_y2_block) & return (vp9_mby_is_skippable_8x8(xd, has_y2_block) &
mbuv_is_skippable_8x8(xd)); vp9_mbuv_is_skippable_8x8(xd));
} }
int mb_is_skippable_8x8_4x4uv(MACROBLOCKD *xd, int has_y2_block) { static int mb_is_skippable_8x8_4x4uv(MACROBLOCKD *xd, int has_y2_block) {
return (mby_is_skippable_8x8(xd, has_y2_block) & return (vp9_mby_is_skippable_8x8(xd, has_y2_block) &
mbuv_is_skippable_4x4(xd)); vp9_mbuv_is_skippable_4x4(xd));
} }
int mby_is_skippable_16x16(MACROBLOCKD *xd) { int vp9_mby_is_skippable_16x16(MACROBLOCKD *xd) {
int skip = 1; int skip = 1;
//skip &= (xd->block[0].eob < 2); // I think this should be commented? No second order == DC must be coded
//skip &= (xd->block[0].eob < 1);
//skip &= (!xd->block[24].eob);
skip &= !xd->block[0].eob; skip &= !xd->block[0].eob;
return skip; return skip;
} }
int mb_is_skippable_16x16(MACROBLOCKD *xd) { static int mb_is_skippable_16x16(MACROBLOCKD *xd) {
return (mby_is_skippable_16x16(xd) & mbuv_is_skippable_8x8(xd)); return (vp9_mby_is_skippable_16x16(xd) & vp9_mbuv_is_skippable_8x8(xd));
} }
void vp8_tokenize_mb(VP8_COMP *cpi, void vp8_tokenize_mb(VP8_COMP *cpi,

View File

@ -31,15 +31,11 @@ typedef struct {
int rd_cost_mby(MACROBLOCKD *); int rd_cost_mby(MACROBLOCKD *);
extern int mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block); extern int vp9_mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block);
extern int mbuv_is_skippable_4x4(MACROBLOCKD *xd); extern int vp9_mbuv_is_skippable_4x4(MACROBLOCKD *xd);
extern int mb_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block); extern int vp9_mby_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block);
extern int mby_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block); extern int vp9_mbuv_is_skippable_8x8(MACROBLOCKD *xd);
extern int mbuv_is_skippable_8x8(MACROBLOCKD *xd); extern int vp9_mby_is_skippable_16x16(MACROBLOCKD *xd);
extern int mb_is_skippable_8x8(MACROBLOCKD *xd, int has_y2_block);
extern int mb_is_skippable_8x8_4x4uv(MACROBLOCKD *xd, int has_y2_block);
extern int mb_is_skippable_16x16(MACROBLOCKD *xd);
extern int mby_is_skippable_16x16(MACROBLOCKD *xd);
#ifdef ENTROPY_STATS #ifdef ENTROPY_STATS
void init_context_counters(); void init_context_counters();