namespace {
// FIRSTPASS_STATS struct:
// {
-// 25 double members;
+// 26 double members;
// 1 int64_t member;
// }
// Whenever FIRSTPASS_STATS struct is modified, the following constants need to
// be revisited.
-const int kDbl = 25;
+const int kDbl = 26;
const int kInt = 1;
const size_t kFirstPassStatsSz = kDbl * sizeof(double) + kInt * sizeof(int64_t);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
// Compare to check if using or not using row-mt generates close stats.
- ASSERT_NO_FATAL_FAILURE(compare_fp_stats(&firstpass_stats_, 1000.0));
+ ASSERT_NO_FATAL_FAILURE(compare_fp_stats(&firstpass_stats_, 400.0));
// Test single thread vs multiple threads
row_mt_mode_ = 1;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
// Compare to check if single-thread and multi-thread stats are close enough.
- ASSERT_NO_FATAL_FAILURE(compare_fp_stats(&firstpass_stats_, 1000.0));
+ ASSERT_NO_FATAL_FAILURE(compare_fp_stats(&firstpass_stats_, 400.0));
// Bit exact test in row_mt mode.
// When row_mt_mode_=1 and using >1 threads, the encoder generates bit exact
section->pcnt_intra_high = 0.0;
section->inactive_zone_rows = 0.0;
section->inactive_zone_cols = 0.0;
+ section->new_mv_count = 0.0;
section->MVr = 0.0;
section->mvr_abs = 0.0;
section->MVc = 0.0;
section->pcnt_intra_high += frame->pcnt_intra_high;
section->inactive_zone_rows += frame->inactive_zone_rows;
section->inactive_zone_cols += frame->inactive_zone_cols;
+ section->new_mv_count += frame->new_mv_count;
section->MVr += frame->MVr;
section->mvr_abs += frame->mvr_abs;
section->MVc += frame->MVc;
section->pcnt_intra_high -= frame->pcnt_intra_high;
section->inactive_zone_rows -= frame->inactive_zone_rows;
section->inactive_zone_cols -= frame->inactive_zone_cols;
+ section->new_mv_count -= frame->new_mv_count;
section->MVr -= frame->MVr;
section->mvr_abs -= frame->mvr_abs;
section->MVc -= frame->MVc;
fps->inactive_zone_cols = (double)0;
if (fp_acc_data->mvcount > 0) {
+ fps->new_mv_count = (double)(fp_acc_data->new_mv_count) / num_mbs;
fps->MVr = (double)(fp_acc_data->sum_mvr) / fp_acc_data->mvcount;
fps->mvr_abs = (double)(fp_acc_data->sum_mvr_abs) / fp_acc_data->mvcount;
fps->MVc = (double)(fp_acc_data->sum_mvc) / fp_acc_data->mvcount;
(double)(fp_acc_data->sum_in_vectors) / (fp_acc_data->mvcount * 2);
fps->pcnt_motion = (double)(fp_acc_data->mvcount) / num_mbs;
} else {
+ fps->new_mv_count = 0.0;
fps->MVr = 0.0;
fps->mvr_abs = 0.0;
fps->MVc = 0.0;
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.new_mv_count += fp_acc_data->new_mv_count;
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_abs += fp_acc_data->sum_mvr_abs;
double mb_neutral_count;
int scaled_low_intra_thresh = scale_sse_threshold(cm, LOW_I_THRESH);
+ MV *first_top_mv = &tile_data->firstpass_top_mv;
+ MV last_nonzero_mv = { 0, 0 };
+
// First pass code requires valid last and new frame buffers.
assert(new_yv12 != NULL);
assert(frame_is_intra_only(cm) || (lst_yv12 != NULL));
(*(cpi->row_mt_sync_read_ptr))(&tile_data->row_mt_sync, mb_row, c);
+ if (mb_col == mb_col_start) {
+ last_nonzero_mv = *first_top_mv;
+ }
+
// Adjust to the next column of MBs.
x->plane[0].src.buf = cpi->Source->y_buffer +
mb_row * 16 * x->plane[0].src.stride + mb_col * 16;
if (!is_zero_mv(&mv)) {
++(fp_acc_data->mvcount);
+ if (!is_equal_mv(&mv, &last_nonzero_mv)) {
+ ++(fp_acc_data->new_mv_count);
+ }
+ last_nonzero_mv = mv;
// Does the row vector point inwards or outwards?
if (mb_row < cm->mb_rows / 2) {
}
fp_acc_data->coded_error += (int64_t)this_error;
+ if (mb_col == mb_col_start) {
+ *first_top_mv = last_nonzero_mv;
+ }
recon_yoffset += 16;
recon_uvoffset += uv_mb_height;
MV best_ref_mv;
// Tiling is ignored in the first pass.
vp9_tile_init(tile, cm, 0, 0);
-
+ tile_data.firstpass_top_mv = zero_mv;
#if CONFIG_RATE_CTRL
if (cpi->oxcf.use_simple_encode_api) {
fp_motion_vector_info_reset(cpi->frame_info.frame_width,