Commit 65751919 authored by Alex Converse's avatar Alex Converse

Only track mode_chosen_counts if CONFIG_INTERNAL_STATS.

Change-Id: Ia9252ad0caa4d2bda529a3fe93efcb31e7eb2da0
parent 33bb4435
...@@ -398,7 +398,6 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -398,7 +398,6 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
MODE_INFO *mi_addr = xd->mi_8x8[0]; MODE_INFO *mi_addr = xd->mi_8x8[0];
const int mb_mode_index = ctx->best_mode_index;
const int mis = cm->mode_info_stride; const int mis = cm->mode_info_stride;
const int mi_width = num_8x8_blocks_wide_lookup[bsize]; const int mi_width = num_8x8_blocks_wide_lookup[bsize];
const int mi_height = num_8x8_blocks_high_lookup[bsize]; const int mi_height = num_8x8_blocks_high_lookup[bsize];
...@@ -470,8 +469,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -470,8 +469,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
cpi->rd_tx_select_diff[i] += ctx->tx_rd_diff[i]; cpi->rd_tx_select_diff[i] += ctx->tx_rd_diff[i];
} }
if (frame_is_intra_only(cm)) {
#if CONFIG_INTERNAL_STATS #if CONFIG_INTERNAL_STATS
if (frame_is_intra_only(cm)) {
static const int kf_mode_index[] = { static const int kf_mode_index[] = {
THR_DC /*DC_PRED*/, THR_DC /*DC_PRED*/,
THR_V_PRED /*V_PRED*/, THR_V_PRED /*V_PRED*/,
...@@ -484,12 +483,13 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -484,12 +483,13 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
THR_D63_PRED /*D63_PRED*/, THR_D63_PRED /*D63_PRED*/,
THR_TM /*TM_PRED*/, THR_TM /*TM_PRED*/,
}; };
cpi->mode_chosen_counts[kf_mode_index[mbmi->mode]]++; ++cpi->mode_chosen_counts[kf_mode_index[mbmi->mode]];
#endif
} else { } else {
// Note how often each mode chosen as best // Note how often each mode chosen as best
cpi->mode_chosen_counts[mb_mode_index]++; ++cpi->mode_chosen_counts[ctx->best_mode_index];
}
#endif
if (!frame_is_intra_only(cm)) {
if (is_inter_block(mbmi)) { if (is_inter_block(mbmi)) {
if (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV) { if (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV) {
int_mv best_mv[2]; int_mv best_mv[2];
...@@ -1049,11 +1049,10 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -1049,11 +1049,10 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
const int mb_mode_index = ctx->best_mode_index;
x->skip = ctx->skip; x->skip = ctx->skip;
if (frame_is_intra_only(cm)) {
#if CONFIG_INTERNAL_STATS #if CONFIG_INTERNAL_STATS
if (frame_is_intra_only(cm)) {
static const int kf_mode_index[] = { static const int kf_mode_index[] = {
THR_DC /*DC_PRED*/, THR_DC /*DC_PRED*/,
THR_V_PRED /*V_PRED*/, THR_V_PRED /*V_PRED*/,
...@@ -1067,10 +1066,12 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -1067,10 +1066,12 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
THR_TM /*TM_PRED*/, THR_TM /*TM_PRED*/,
}; };
++cpi->mode_chosen_counts[kf_mode_index[mbmi->mode]]; ++cpi->mode_chosen_counts[kf_mode_index[mbmi->mode]];
#endif
} else { } else {
// Note how often each mode chosen as best // Note how often each mode chosen as best
cpi->mode_chosen_counts[mb_mode_index]++; ++cpi->mode_chosen_counts[ctx->best_mode_index];
}
#endif
if (!frame_is_intra_only(cm)) {
if (is_inter_block(mbmi)) { if (is_inter_block(mbmi)) {
if (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV) { if (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV) {
int_mv best_mv[2]; int_mv best_mv[2];
......
...@@ -875,8 +875,10 @@ void vp9_set_speed_features(VP9_COMP *cpi) { ...@@ -875,8 +875,10 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
if (speed < 0) if (speed < 0)
speed = -speed; speed = -speed;
#if CONFIG_INTERNAL_STATS
for (i = 0; i < MAX_MODES; ++i) for (i = 0; i < MAX_MODES; ++i)
cpi->mode_chosen_counts[i] = 0; cpi->mode_chosen_counts[i] = 0;
#endif
// best quality defaults // best quality defaults
sf->frame_parameter_update = 1; sf->frame_parameter_update = 1;
...@@ -2782,8 +2784,6 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) { ...@@ -2782,8 +2784,6 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
for (i = 0; i < MAX_MODES; ++i) for (i = 0; i < MAX_MODES; ++i)
fprintf(fmodes, "%5d ", cpi->mode_chosen_counts[i]); fprintf(fmodes, "%5d ", cpi->mode_chosen_counts[i]);
for (i = 0; i < MAX_REFS; ++i)
fprintf(fmodes, "%5d ", cpi->sub8x8_mode_chosen_counts[i]);
fprintf(fmodes, "\n"); fprintf(fmodes, "\n");
......
...@@ -486,9 +486,6 @@ typedef struct VP9_COMP { ...@@ -486,9 +486,6 @@ typedef struct VP9_COMP {
// Ambient reconstruction err target for force key frames // Ambient reconstruction err target for force key frames
int ambient_err; int ambient_err;
unsigned int mode_chosen_counts[MAX_MODES];
unsigned int sub8x8_mode_chosen_counts[MAX_REFS];
int rd_threshes[MAX_SEGMENTS][BLOCK_SIZES][MAX_MODES]; int rd_threshes[MAX_SEGMENTS][BLOCK_SIZES][MAX_MODES];
int rd_thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; int rd_thresh_freq_fact[BLOCK_SIZES][MAX_MODES];
int rd_thresh_sub8x8[MAX_SEGMENTS][BLOCK_SIZES][MAX_REFS]; int rd_thresh_sub8x8[MAX_SEGMENTS][BLOCK_SIZES][MAX_REFS];
...@@ -586,6 +583,8 @@ typedef struct VP9_COMP { ...@@ -586,6 +583,8 @@ typedef struct VP9_COMP {
int fixed_divide[512]; int fixed_divide[512];
#if CONFIG_INTERNAL_STATS #if CONFIG_INTERNAL_STATS
unsigned int mode_chosen_counts[MAX_MODES];
int count; int count;
double total_y; double total_y;
double total_u; double total_u;
......
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