ref: ef01b956d88e68a4cb66b94d6a99a46c6909fa1a
parent: 6b1b34177491351fb15613637bd1667ced34c5ac
author: Paul Wilkins <paulwilkins@google.com>
date: Fri Feb 15 06:34:25 EST 2013
Entropy stats output code. Fixes to make Entropy stats code work again Change-Id: I62e380481a4eb4c170076ac6ab36f0c2b203e914
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -810,7 +810,6 @@
vp9_mv_ref_probs(&cpi->common, mv_ref_p, mi->mb_mode_context[rf]);
#ifdef ENTROPY_STATS
- accum_mv_refs(mode, ct);
active_section = 3;
#endif
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -19,11 +19,6 @@
#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_common.h"
-#ifdef ENTROPY_STATS
-static int mv_ref_ct [31] [4] [2];
-static int mv_mode_cts [4] [2];
-#endif
-
void vp9_clamp_mv_min_max(MACROBLOCK *x, int_mv *ref_mv) {
int col_min = (ref_mv->as_mv.col >> 3) - MAX_FULL_PEL_VAL +
((ref_mv->as_mv.col & 7) ? 1 : 0);
@@ -2103,14 +2098,14 @@
#ifdef ENTROPY_STATS
-void print_mode_context(void) {
+void print_mode_context(VP9_COMMON *pc) {
FILE *f = fopen("vp9_modecont.c", "a");
int i, j;
fprintf(f, "#include \"vp9_entropy.h\"\n");
- fprintf(f, "const int vp9_mode_contexts[6][4] =");
+ fprintf(f, "const int vp9_mode_contexts[INTER_MODE_CONTEXTS][4] =");
fprintf(f, "{\n");
- for (j = 0; j < 6; j++) {
+ for (j = 0; j < INTER_MODE_CONTEXTS; j++) {
fprintf(f, " {/* %d */ ", j);
fprintf(f, " ");
for (i = 0; i < 4; i++) {
@@ -2117,7 +2112,8 @@
int this_prob;
// context probs
- this_prob = get_binary_prob(mv_ref_ct[j][i][0], mv_ref_ct[j][i][1]);
+ this_prob = get_binary_prob(pc->fc.mv_ref_ct[j][i][0],
+ pc->fc.mv_ref_ct[j][i][1]);
fprintf(f, "%5d, ", this_prob);
}
@@ -2126,46 +2122,6 @@
fprintf(f, "};\n");
fclose(f);
-}
-
-/* MV ref count ENTROPY_STATS stats code */
-void init_mv_ref_counts() {
- vpx_memset(mv_ref_ct, 0, sizeof(mv_ref_ct));
- vpx_memset(mv_mode_cts, 0, sizeof(mv_mode_cts));
-}
-
-void accum_mv_refs(MB_PREDICTION_MODE m, const int ct[4]) {
- if (m == ZEROMV) {
- ++mv_ref_ct [ct[0]] [0] [0];
- ++mv_mode_cts[0][0];
- } else {
- ++mv_ref_ct [ct[0]] [0] [1];
- ++mv_mode_cts[0][1];
-
- if (m == NEARESTMV) {
- ++mv_ref_ct [ct[1]] [1] [0];
- ++mv_mode_cts[1][0];
- } else {
- ++mv_ref_ct [ct[1]] [1] [1];
- ++mv_mode_cts[1][1];
-
- if (m == NEARMV) {
- ++mv_ref_ct [ct[2]] [2] [0];
- ++mv_mode_cts[2][0];
- } else {
- ++mv_ref_ct [ct[2]] [2] [1];
- ++mv_mode_cts[2][1];
-
- if (m == NEWMV) {
- ++mv_ref_ct [ct[3]] [3] [0];
- ++mv_mode_cts[3][0];
- } else {
- ++mv_ref_ct [ct[3]] [3] [1];
- ++mv_mode_cts[3][1];
- }
- }
- }
- }
}
#endif/* END MV ref count ENTROPY_STATS stats code */
--- a/vp9/encoder/vp9_mcomp.h
+++ b/vp9/encoder/vp9_mcomp.h
@@ -16,9 +16,7 @@
#include "vp9/encoder/vp9_variance.h"
#ifdef ENTROPY_STATS
-extern void init_mv_ref_counts();
-extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]);
-void print_mode_context(void);
+void print_mode_context(VP9_COMMON *pc);
#endif
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -1648,10 +1648,6 @@
cpi->rd_thresh_mult[i] = 128;
}
-#ifdef ENTROPY_STATS
- init_mv_ref_counts();
-#endif
-
#define BFP(BT, SDF, VF, SVF, SVFHH, SVFHV, SVFHHV, SDX3F, SDX8F, SDX4DF) \
cpi->fn_ptr[BT].sdf = SDF; \
cpi->fn_ptr[BT].vf = VF; \
@@ -1738,7 +1734,7 @@
if (cpi->pass != 1) {
print_context_counters();
print_tree_update_probs();
- print_mode_context();
+ print_mode_context(&cpi->common);
}
#endif
#ifdef NMV_STATS
--
⑨