From 394020383d3da02e602050f9d5e8e671a6e3cb8b Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Wed, 7 Dec 2016 10:00:36 -0800 Subject: [PATCH] Remove an unused first pass statistic One of the first pass stats "new_mv_count" is no longer used in VP9, and is removed. This also makes it easy to implement a multi-threaded first pass. This change doesn't affect the coding performance, which has been verified by borg tests. Change-Id: I4c7c7bf9465fda838eb230814ef0c631c068c903 --- vp9/encoder/vp9_firstpass.c | 14 +------------- vp9/encoder/vp9_firstpass.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 788952d..72e9ac7 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -117,8 +117,7 @@ static void output_stats(FIRSTPASS_STATS *stats, stats->intra_skip_pct, stats->intra_smooth_pct, stats->inactive_zone_rows, stats->inactive_zone_cols, stats->MVr, stats->mvr_abs, stats->MVc, stats->mvc_abs, stats->MVrv, - stats->MVcv, stats->mv_in_out_count, stats->new_mv_count, - stats->count, stats->duration); + stats->MVcv, stats->mv_in_out_count, stats->count, stats->duration); fclose(fpfile); } #endif @@ -157,7 +156,6 @@ static void zero_stats(FIRSTPASS_STATS *section) { section->MVrv = 0.0; section->MVcv = 0.0; section->mv_in_out_count = 0.0; - section->new_mv_count = 0.0; section->count = 0.0; section->duration = 1.0; section->spatial_layer_id = 0; @@ -187,7 +185,6 @@ static void accumulate_stats(FIRSTPASS_STATS *section, section->MVrv += frame->MVrv; section->MVcv += frame->MVcv; section->mv_in_out_count += frame->mv_in_out_count; - section->new_mv_count += frame->new_mv_count; section->count += frame->count; section->duration += frame->duration; } @@ -215,7 +212,6 @@ static void subtract_stats(FIRSTPASS_STATS *section, section->MVrv -= frame->MVrv; section->MVcv -= frame->MVcv; section->mv_in_out_count -= frame->mv_in_out_count; - section->new_mv_count -= frame->new_mv_count; section->count -= frame->count; section->duration -= frame->duration; } @@ -679,9 +675,7 @@ void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { int intra_skip_count = 0; int intra_smooth_count = 0; int image_data_start_row = INVALID_ROW; - int new_mv_count = 0; int sum_in_vectors = 0; - MV lastmv = { 0, 0 }; TWO_PASS *twopass = &cpi->twopass; const MV zero_mv = { 0, 0 }; int recon_y_stride, recon_uv_stride, uv_mb_height; @@ -1144,10 +1138,6 @@ void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { } #endif - // Non-zero vector, was it different from the last non zero vector? - if (!is_equal_mv(&mv, &lastmv)) ++new_mv_count; - lastmv = mv; - // Does the row vector point inwards or outwards? if (mb_row < cm->mb_rows / 2) { if (mv.row > 0) @@ -1263,7 +1253,6 @@ void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { fps.MVcv = ((double)sum_mvcs - ((double)sum_mvc * sum_mvc / mvcount)) / mvcount; fps.mv_in_out_count = (double)sum_in_vectors / (mvcount * 2); - fps.new_mv_count = new_mv_count; fps.pcnt_motion = (double)mvcount / num_mbs; } else { fps.MVr = 0.0; @@ -1273,7 +1262,6 @@ void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { fps.MVrv = 0.0; fps.MVcv = 0.0; fps.mv_in_out_count = 0.0; - fps.new_mv_count = 0.0; fps.pcnt_motion = 0.0; } diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h index 6aa39cd..5541893 100644 --- a/vp9/encoder/vp9_firstpass.h +++ b/vp9/encoder/vp9_firstpass.h @@ -61,7 +61,6 @@ typedef struct { double MVrv; double MVcv; double mv_in_out_count; - double new_mv_count; double duration; double count; int64_t spatial_layer_id; -- 2.7.4