Additional first pass stats.
Added counts that split the intra coded blocks into low and high variance. Change-Id: Ic540144b34d5141659081bb22f7ee16fd6861f14
This commit is contained in:
@@ -21,12 +21,12 @@
|
|||||||
namespace {
|
namespace {
|
||||||
// FIRSTPASS_STATS struct:
|
// FIRSTPASS_STATS struct:
|
||||||
// {
|
// {
|
||||||
// 23 double members;
|
// 25 double members;
|
||||||
// 1 int64_t member;
|
// 1 int64_t member;
|
||||||
// }
|
// }
|
||||||
// Whenever FIRSTPASS_STATS struct is modified, the following constants need to
|
// Whenever FIRSTPASS_STATS struct is modified, the following constants need to
|
||||||
// be revisited.
|
// be revisited.
|
||||||
const int kDbl = 23;
|
const int kDbl = 25;
|
||||||
const int kInt = 1;
|
const int kInt = 1;
|
||||||
const size_t kFirstPassStatsSz = kDbl * sizeof(double) + kInt * sizeof(int64_t);
|
const size_t kFirstPassStatsSz = kDbl * sizeof(double) + kInt * sizeof(int64_t);
|
||||||
|
|
||||||
|
|||||||
@@ -3335,10 +3335,10 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size,
|
|||||||
// Adjustment limits for min and max q
|
// Adjustment limits for min and max q
|
||||||
qrange_adj = VPXMAX(1, (top_index - bottom_index) / 2);
|
qrange_adj = VPXMAX(1, (top_index - bottom_index) / 2);
|
||||||
|
|
||||||
bottom_index = VPXMAX(bottom_index - qrange_adj / 2,
|
bottom_index =
|
||||||
cpi->oxcf.best_allowed_q);
|
VPXMAX(bottom_index - qrange_adj / 2, cpi->oxcf.best_allowed_q);
|
||||||
top_index = VPXMIN(cpi->oxcf.worst_allowed_q,
|
top_index =
|
||||||
top_index + qrange_adj / 2);
|
VPXMIN(cpi->oxcf.worst_allowed_q, top_index + qrange_adj / 2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// TODO(agrange) Scale cpi->max_mv_magnitude if frame-size has changed.
|
// TODO(agrange) Scale cpi->max_mv_magnitude if frame-size has changed.
|
||||||
|
|||||||
@@ -229,6 +229,8 @@ static void accumulate_fp_tile_stat(TileDataEnc *tile_data,
|
|||||||
tile_data->fp_data.intercount += tile_data_t->fp_data.intercount;
|
tile_data->fp_data.intercount += tile_data_t->fp_data.intercount;
|
||||||
tile_data->fp_data.second_ref_count += tile_data_t->fp_data.second_ref_count;
|
tile_data->fp_data.second_ref_count += tile_data_t->fp_data.second_ref_count;
|
||||||
tile_data->fp_data.neutral_count += tile_data_t->fp_data.neutral_count;
|
tile_data->fp_data.neutral_count += tile_data_t->fp_data.neutral_count;
|
||||||
|
tile_data->fp_data.intra_count_low += tile_data_t->fp_data.intra_count_low;
|
||||||
|
tile_data->fp_data.intra_count_high += tile_data_t->fp_data.intra_count_high;
|
||||||
tile_data->fp_data.intra_skip_count += tile_data_t->fp_data.intra_skip_count;
|
tile_data->fp_data.intra_skip_count += tile_data_t->fp_data.intra_skip_count;
|
||||||
tile_data->fp_data.mvcount += tile_data_t->fp_data.mvcount;
|
tile_data->fp_data.mvcount += tile_data_t->fp_data.mvcount;
|
||||||
tile_data->fp_data.sum_mvr += tile_data_t->fp_data.sum_mvr;
|
tile_data->fp_data.sum_mvr += tile_data_t->fp_data.sum_mvr;
|
||||||
|
|||||||
@@ -108,13 +108,15 @@ static void output_stats(FIRSTPASS_STATS *stats,
|
|||||||
fpfile = fopen("firstpass.stt", "a");
|
fpfile = fopen("firstpass.stt", "a");
|
||||||
|
|
||||||
fprintf(fpfile,
|
fprintf(fpfile,
|
||||||
"%12.0lf %12.4lf %12.0lf %12.0lf %12.0lf %12.0lf %12.4lf"
|
"%12.0lf %12.4lf %12.0lf %12.0lf %12.0lf %12.0lf %12.4lf %12.4lf"
|
||||||
"%12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf"
|
"%12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.4lf"
|
||||||
"%12.4lf %12.4lf %12.4lf %12.4lf %12.0lf %12.0lf %12.0lf %12.4lf"
|
"%12.4lf %12.4lf %12.4lf %12.4lf %12.4lf %12.0lf %12.0lf %12.0lf"
|
||||||
|
"%12.4lf"
|
||||||
"\n",
|
"\n",
|
||||||
stats->frame, stats->weight, stats->intra_error, stats->coded_error,
|
stats->frame, stats->weight, stats->intra_error, stats->coded_error,
|
||||||
stats->sr_coded_error, stats->frame_noise_energy, stats->pcnt_inter,
|
stats->sr_coded_error, stats->frame_noise_energy, stats->pcnt_inter,
|
||||||
stats->pcnt_motion, stats->pcnt_second_ref, stats->pcnt_neutral,
|
stats->pcnt_motion, stats->pcnt_second_ref, stats->pcnt_neutral,
|
||||||
|
stats->pcnt_intra_low, stats->pcnt_intra_high,
|
||||||
stats->intra_skip_pct, stats->intra_smooth_pct,
|
stats->intra_skip_pct, stats->intra_smooth_pct,
|
||||||
stats->inactive_zone_rows, stats->inactive_zone_cols, stats->MVr,
|
stats->inactive_zone_rows, stats->inactive_zone_cols, stats->MVr,
|
||||||
stats->mvr_abs, stats->MVc, stats->mvc_abs, stats->MVrv,
|
stats->mvr_abs, stats->MVc, stats->mvc_abs, stats->MVrv,
|
||||||
@@ -148,6 +150,8 @@ static void zero_stats(FIRSTPASS_STATS *section) {
|
|||||||
section->pcnt_neutral = 0.0;
|
section->pcnt_neutral = 0.0;
|
||||||
section->intra_skip_pct = 0.0;
|
section->intra_skip_pct = 0.0;
|
||||||
section->intra_smooth_pct = 0.0;
|
section->intra_smooth_pct = 0.0;
|
||||||
|
section->pcnt_intra_low = 0.0;
|
||||||
|
section->pcnt_intra_high = 0.0;
|
||||||
section->inactive_zone_rows = 0.0;
|
section->inactive_zone_rows = 0.0;
|
||||||
section->inactive_zone_cols = 0.0;
|
section->inactive_zone_cols = 0.0;
|
||||||
section->MVr = 0.0;
|
section->MVr = 0.0;
|
||||||
@@ -177,6 +181,8 @@ static void accumulate_stats(FIRSTPASS_STATS *section,
|
|||||||
section->pcnt_neutral += frame->pcnt_neutral;
|
section->pcnt_neutral += frame->pcnt_neutral;
|
||||||
section->intra_skip_pct += frame->intra_skip_pct;
|
section->intra_skip_pct += frame->intra_skip_pct;
|
||||||
section->intra_smooth_pct += frame->intra_smooth_pct;
|
section->intra_smooth_pct += frame->intra_smooth_pct;
|
||||||
|
section->pcnt_intra_low += frame->pcnt_intra_low;
|
||||||
|
section->pcnt_intra_high += frame->pcnt_intra_high;
|
||||||
section->inactive_zone_rows += frame->inactive_zone_rows;
|
section->inactive_zone_rows += frame->inactive_zone_rows;
|
||||||
section->inactive_zone_cols += frame->inactive_zone_cols;
|
section->inactive_zone_cols += frame->inactive_zone_cols;
|
||||||
section->MVr += frame->MVr;
|
section->MVr += frame->MVr;
|
||||||
@@ -204,6 +210,8 @@ static void subtract_stats(FIRSTPASS_STATS *section,
|
|||||||
section->pcnt_neutral -= frame->pcnt_neutral;
|
section->pcnt_neutral -= frame->pcnt_neutral;
|
||||||
section->intra_skip_pct -= frame->intra_skip_pct;
|
section->intra_skip_pct -= frame->intra_skip_pct;
|
||||||
section->intra_smooth_pct -= frame->intra_smooth_pct;
|
section->intra_smooth_pct -= frame->intra_smooth_pct;
|
||||||
|
section->pcnt_intra_low -= frame->pcnt_intra_low;
|
||||||
|
section->pcnt_intra_high -= frame->pcnt_intra_high;
|
||||||
section->inactive_zone_rows -= frame->inactive_zone_rows;
|
section->inactive_zone_rows -= frame->inactive_zone_rows;
|
||||||
section->inactive_zone_cols -= frame->inactive_zone_cols;
|
section->inactive_zone_cols -= frame->inactive_zone_cols;
|
||||||
section->MVr -= frame->MVr;
|
section->MVr -= frame->MVr;
|
||||||
@@ -710,6 +718,8 @@ static void first_pass_stat_calc(VP9_COMP *cpi, FIRSTPASS_STATS *fps,
|
|||||||
fps->pcnt_inter = (double)(fp_acc_data->intercount) / num_mbs;
|
fps->pcnt_inter = (double)(fp_acc_data->intercount) / num_mbs;
|
||||||
fps->pcnt_second_ref = (double)(fp_acc_data->second_ref_count) / num_mbs;
|
fps->pcnt_second_ref = (double)(fp_acc_data->second_ref_count) / num_mbs;
|
||||||
fps->pcnt_neutral = (double)(fp_acc_data->neutral_count) / num_mbs;
|
fps->pcnt_neutral = (double)(fp_acc_data->neutral_count) / num_mbs;
|
||||||
|
fps->pcnt_intra_low = (double)(fp_acc_data->intra_count_low) / num_mbs;
|
||||||
|
fps->pcnt_intra_high = (double)(fp_acc_data->intra_count_high) / num_mbs;
|
||||||
fps->intra_skip_pct = (double)(fp_acc_data->intra_skip_count) / num_mbs;
|
fps->intra_skip_pct = (double)(fp_acc_data->intra_skip_count) / num_mbs;
|
||||||
fps->intra_smooth_pct = (double)(fp_acc_data->intra_smooth_count) / num_mbs;
|
fps->intra_smooth_pct = (double)(fp_acc_data->intra_smooth_count) / num_mbs;
|
||||||
fps->inactive_zone_rows = (double)(fp_acc_data->image_data_start_row);
|
fps->inactive_zone_rows = (double)(fp_acc_data->image_data_start_row);
|
||||||
@@ -755,6 +765,8 @@ static void accumulate_fp_mb_row_stat(TileDataEnc *this_tile,
|
|||||||
this_tile->fp_data.intercount += fp_acc_data->intercount;
|
this_tile->fp_data.intercount += fp_acc_data->intercount;
|
||||||
this_tile->fp_data.second_ref_count += fp_acc_data->second_ref_count;
|
this_tile->fp_data.second_ref_count += fp_acc_data->second_ref_count;
|
||||||
this_tile->fp_data.neutral_count += fp_acc_data->neutral_count;
|
this_tile->fp_data.neutral_count += fp_acc_data->neutral_count;
|
||||||
|
this_tile->fp_data.intra_count_low += fp_acc_data->intra_count_low;
|
||||||
|
this_tile->fp_data.intra_count_high += fp_acc_data->intra_count_high;
|
||||||
this_tile->fp_data.intra_skip_count += fp_acc_data->intra_skip_count;
|
this_tile->fp_data.intra_skip_count += fp_acc_data->intra_skip_count;
|
||||||
this_tile->fp_data.mvcount += fp_acc_data->mvcount;
|
this_tile->fp_data.mvcount += fp_acc_data->mvcount;
|
||||||
this_tile->fp_data.sum_mvr += fp_acc_data->sum_mvr;
|
this_tile->fp_data.sum_mvr += fp_acc_data->sum_mvr;
|
||||||
@@ -1262,10 +1274,14 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td,
|
|||||||
fp_acc_data->frame_noise_energy += (int64_t)SECTION_NOISE_DEF;
|
fp_acc_data->frame_noise_energy += (int64_t)SECTION_NOISE_DEF;
|
||||||
}
|
}
|
||||||
} else { // Intra < inter error
|
} else { // Intra < inter error
|
||||||
if (this_intra_error < scale_sse_threshold(cm, LOW_I_THRESH))
|
int scaled_low_intra_thresh = scale_sse_threshold(cm, LOW_I_THRESH);
|
||||||
|
if (this_intra_error < scaled_low_intra_thresh) {
|
||||||
fp_acc_data->frame_noise_energy += fp_estimate_block_noise(x, bsize);
|
fp_acc_data->frame_noise_energy += fp_estimate_block_noise(x, bsize);
|
||||||
else
|
fp_acc_data->intra_count_low += 1.0;
|
||||||
|
} else {
|
||||||
fp_acc_data->frame_noise_energy += (int64_t)SECTION_NOISE_DEF;
|
fp_acc_data->frame_noise_energy += (int64_t)SECTION_NOISE_DEF;
|
||||||
|
fp_acc_data->intra_count_high += 1.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fp_acc_data->sr_coded_error += (int64_t)this_error;
|
fp_acc_data->sr_coded_error += (int64_t)this_error;
|
||||||
@@ -2463,8 +2479,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
|
|||||||
rc->source_alt_ref_pending = 0;
|
rc->source_alt_ref_pending = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit maximum boost based on interval length.
|
|
||||||
#ifdef AGRESSIVE_VBR
|
#ifdef AGRESSIVE_VBR
|
||||||
|
// Limit maximum boost based on interval length.
|
||||||
rc->gfu_boost = VPXMIN((int)rc->gfu_boost, i * 140);
|
rc->gfu_boost = VPXMIN((int)rc->gfu_boost, i * 140);
|
||||||
#else
|
#else
|
||||||
rc->gfu_boost = VPXMIN((int)rc->gfu_boost, i * 200);
|
rc->gfu_boost = VPXMIN((int)rc->gfu_boost, i * 200);
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ typedef struct {
|
|||||||
int intercount;
|
int intercount;
|
||||||
int second_ref_count;
|
int second_ref_count;
|
||||||
double neutral_count;
|
double neutral_count;
|
||||||
|
double intra_count_low; // Coded intra but low variance
|
||||||
|
double intra_count_high; // Coded intra high variance
|
||||||
int intra_skip_count;
|
int intra_skip_count;
|
||||||
int image_data_start_row;
|
int image_data_start_row;
|
||||||
int mvcount;
|
int mvcount;
|
||||||
@@ -84,6 +86,8 @@ typedef struct {
|
|||||||
double pcnt_motion;
|
double pcnt_motion;
|
||||||
double pcnt_second_ref;
|
double pcnt_second_ref;
|
||||||
double pcnt_neutral;
|
double pcnt_neutral;
|
||||||
|
double pcnt_intra_low; // Coded intra but low variance
|
||||||
|
double pcnt_intra_high; // Coded intra high variance
|
||||||
double intra_skip_pct;
|
double intra_skip_pct;
|
||||||
double intra_smooth_pct; // % of blocks that are smooth
|
double intra_smooth_pct; // % of blocks that are smooth
|
||||||
double inactive_zone_rows; // Image mask rows top and bottom.
|
double inactive_zone_rows; // Image mask rows top and bottom.
|
||||||
|
|||||||
Reference in New Issue
Block a user