Commit ea2348ca authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Removing NMS_STATS defines."

parents 78182538 5edc65d0
......@@ -20,10 +20,6 @@
extern unsigned int active_section;
#endif
#ifdef NMV_STATS
nmv_context_counts tnmvcounts;
#endif
static void encode_mv_component(vp9_writer* w, int comp,
const nmv_component* mvcomp, int usehp) {
int offset;
......@@ -218,152 +214,6 @@ static void counts_to_nmv_context(
}
}
#ifdef NMV_STATS
void init_nmvstats() {
vp9_zero(tnmvcounts);
}
void print_nmvstats() {
nmv_context prob;
unsigned int branch_ct_joint[MV_JOINTS - 1][2];
unsigned int branch_ct_sign[2][2];
unsigned int branch_ct_classes[2][MV_CLASSES - 1][2];
unsigned int branch_ct_class0[2][CLASS0_SIZE - 1][2];
unsigned int branch_ct_bits[2][MV_OFFSET_BITS][2];
unsigned int branch_ct_class0_fp[2][CLASS0_SIZE][4 - 1][2];
unsigned int branch_ct_fp[2][4 - 1][2];
unsigned int branch_ct_class0_hp[2][2];
unsigned int branch_ct_hp[2][2];
int i, j, k;
counts_to_nmv_context(&tnmvcounts, &prob, 1,
branch_ct_joint, branch_ct_sign, branch_ct_classes,
branch_ct_class0, branch_ct_bits,
branch_ct_class0_fp, branch_ct_fp,
branch_ct_class0_hp, branch_ct_hp);
printf("\nCounts =\n { ");
for (j = 0; j < MV_JOINTS; ++j)
printf("%d, ", tnmvcounts.joints[j]);
printf("},\n");
for (i = 0; i < 2; ++i) {
printf(" {\n");
printf(" %d/%d,\n", tnmvcounts.comps[i].sign[0],
tnmvcounts.comps[i].sign[1]);
printf(" { ");
for (j = 0; j < MV_CLASSES; ++j)
printf("%d, ", tnmvcounts.comps[i].classes[j]);
printf("},\n");
printf(" { ");
for (j = 0; j < CLASS0_SIZE; ++j)
printf("%d, ", tnmvcounts.comps[i].class0[j]);
printf("},\n");
printf(" { ");
for (j = 0; j < MV_OFFSET_BITS; ++j)
printf("%d/%d, ", tnmvcounts.comps[i].bits[j][0],
tnmvcounts.comps[i].bits[j][1]);
printf("},\n");
printf(" {");
for (j = 0; j < CLASS0_SIZE; ++j) {
printf("{");
for (k = 0; k < 4; ++k)
printf("%d, ", tnmvcounts.comps[i].class0_fp[j][k]);
printf("}, ");
}
printf("},\n");
printf(" { ");
for (j = 0; j < 4; ++j)
printf("%d, ", tnmvcounts.comps[i].fp[j]);
printf("},\n");
printf(" %d/%d,\n",
tnmvcounts.comps[i].class0_hp[0],
tnmvcounts.comps[i].class0_hp[1]);
printf(" %d/%d,\n",
tnmvcounts.comps[i].hp[0],
tnmvcounts.comps[i].hp[1]);
printf(" },\n");
}
printf("\nProbs =\n { ");
for (j = 0; j < MV_JOINTS - 1; ++j)
printf("%d, ", prob.joints[j]);
printf("},\n");
for (i=0; i< 2; ++i) {
printf(" {\n");
printf(" %d,\n", prob.comps[i].sign);
printf(" { ");
for (j = 0; j < MV_CLASSES - 1; ++j)
printf("%d, ", prob.comps[i].classes[j]);
printf("},\n");
printf(" { ");
for (j = 0; j < CLASS0_SIZE - 1; ++j)
printf("%d, ", prob.comps[i].class0[j]);
printf("},\n");
printf(" { ");
for (j = 0; j < MV_OFFSET_BITS; ++j)
printf("%d, ", prob.comps[i].bits[j]);
printf("},\n");
printf(" { ");
for (j = 0; j < CLASS0_SIZE; ++j) {
printf("{");
for (k = 0; k < 3; ++k)
printf("%d, ", prob.comps[i].class0_fp[j][k]);
printf("}, ");
}
printf("},\n");
printf(" { ");
for (j = 0; j < 3; ++j)
printf("%d, ", prob.comps[i].fp[j]);
printf("},\n");
printf(" %d,\n", prob.comps[i].class0_hp);
printf(" %d,\n", prob.comps[i].hp);
printf(" },\n");
}
}
static void add_nmvcount(nmv_context_counts* const dst,
const nmv_context_counts* const src) {
int i, j, k;
for (j = 0; j < MV_JOINTS; ++j) {
dst->joints[j] += src->joints[j];
}
for (i = 0; i < 2; ++i) {
for (j = 0; j < MV_VALS; ++j) {
dst->comps[i].mvcount[j] += src->comps[i].mvcount[j];
}
dst->comps[i].sign[0] += src->comps[i].sign[0];
dst->comps[i].sign[1] += src->comps[i].sign[1];
for (j = 0; j < MV_CLASSES; ++j) {
dst->comps[i].classes[j] += src->comps[i].classes[j];
}
for (j = 0; j < CLASS0_SIZE; ++j) {
dst->comps[i].class0[j] += src->comps[i].class0[j];
}
for (j = 0; j < MV_OFFSET_BITS; ++j) {
dst->comps[i].bits[j][0] += src->comps[i].bits[j][0];
dst->comps[i].bits[j][1] += src->comps[i].bits[j][1];
}
}
for (i = 0; i < 2; ++i) {
for (j = 0; j < CLASS0_SIZE; ++j) {
for (k = 0; k < 4; ++k) {
dst->comps[i].class0_fp[j][k] += src->comps[i].class0_fp[j][k];
}
}
for (j = 0; j < 4; ++j) {
dst->comps[i].fp[j] += src->comps[i].fp[j];
}
dst->comps[i].class0_hp[0] += src->comps[i].class0_hp[0];
dst->comps[i].class0_hp[1] += src->comps[i].class0_hp[1];
dst->comps[i].hp[0] += src->comps[i].hp[0];
dst->comps[i].hp[1] += src->comps[i].hp[1];
}
}
#endif
void vp9_write_nmv_probs(VP9_COMP* const cpi, int usehp, vp9_writer* const bc) {
int i, j;
nmv_context prob;
......@@ -378,10 +228,6 @@ void vp9_write_nmv_probs(VP9_COMP* const cpi, int usehp, vp9_writer* const bc) {
unsigned int branch_ct_hp[2][2];
nmv_context *mvc = &cpi->common.fc.nmvc;
#ifdef NMV_STATS
if (!cpi->dummy_packing)
add_nmvcount(&tnmvcounts, &cpi->NMVcount);
#endif
counts_to_nmv_context(&cpi->NMVcount, &prob, usehp,
branch_ct_joint, branch_ct_sign, branch_ct_classes,
branch_ct_class0, branch_ct_bits,
......
......@@ -103,10 +103,6 @@ extern int intra_mode_stats[VP9_INTRA_MODES]
[VP9_INTRA_MODES];
#endif
#ifdef NMV_STATS
extern void init_nmvstats();
extern void print_nmvstats();
#endif
#ifdef MODE_STATS
extern void init_tx_count_stats();
extern void write_tx_count_stats();
......@@ -1466,9 +1462,6 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
init_context_counters();
#endif
#ifdef NMV_STATS
init_nmvstats();
#endif
#ifdef MODE_STATS
init_tx_count_stats();
init_switchable_interp_stats();
......@@ -1732,10 +1725,7 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
print_mode_context(cpi);
}
#endif
#ifdef NMV_STATS
if (cpi->pass != 1)
print_nmvstats();
#endif
#ifdef MODE_STATS
if (cpi->pass != 1) {
write_tx_count_stats();
......
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