Commit 8c1e57c2 authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Change 2 motion search counts to be tile data

Imported changes from VP9:
https://chromium-review.googlesource.com/#/c/402551/
https://chromium-review.googlesource.com/#/c/403128/

Change-Id: I8570c867190a6fa641926431ce97f7d9d7da3528
parent a1730659
...@@ -4442,8 +4442,10 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row, ...@@ -4442,8 +4442,10 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row,
av1_zero_above_context(cm, tile_info->mi_col_start, tile_info->mi_col_end); av1_zero_above_context(cm, tile_info->mi_col_start, tile_info->mi_col_end);
// Set up pointers to per thread motion search counters. // Set up pointers to per thread motion search counters.
td->mb.m_search_count_ptr = &td->rd_counts.m_search_count; this_tile->m_search_count = 0; // Count of motion search hits.
td->mb.ex_search_count_ptr = &td->rd_counts.ex_search_count; this_tile->ex_search_count = 0; // Exhaustive mesh search hits.
td->mb.m_search_count_ptr = &this_tile->m_search_count;
td->mb.ex_search_count_ptr = &this_tile->ex_search_count;
for (mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end; for (mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end;
mi_row += cm->mib_size) { mi_row += cm->mib_size) {
...@@ -4624,8 +4626,6 @@ static void encode_frame_internal(AV1_COMP *cpi) { ...@@ -4624,8 +4626,6 @@ static void encode_frame_internal(AV1_COMP *cpi) {
av1_zero(*td->counts); av1_zero(*td->counts);
av1_zero(rdc->coef_counts); av1_zero(rdc->coef_counts);
av1_zero(rdc->comp_pred_diff); av1_zero(rdc->comp_pred_diff);
rdc->m_search_count = 0; // Count of motion search hits.
rdc->ex_search_count = 0; // Exhaustive mesh search hits.
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
aom_clear_system_state(); aom_clear_system_state();
......
...@@ -3596,7 +3596,7 @@ static void output_frame_level_debug_stats(AV1_COMP *cpi) { ...@@ -3596,7 +3596,7 @@ static void output_frame_level_debug_stats(AV1_COMP *cpi) {
recon_err = aom_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); recon_err = aom_get_y_sse(cpi->Source, get_frame_new_buffer(cm));
if (cpi->twopass.total_left_stats.coded_error != 0.0) if (cpi->twopass.total_left_stats.coded_error != 0.0)
fprintf(f, "%10u %dx%d %10d %10d %d %d %10d %10d %10d %10d" fprintf(f, "%10u %dx%d %d %d %10d %10d %10d %10d"
"%10"PRId64" %10"PRId64" %5d %5d %10"PRId64" " "%10"PRId64" %10"PRId64" %5d %5d %10"PRId64" "
"%10"PRId64" %10"PRId64" %10d " "%10"PRId64" %10"PRId64" %10d "
"%7.2lf %7.2lf %7.2lf %7.2lf %7.2lf" "%7.2lf %7.2lf %7.2lf %7.2lf %7.2lf"
...@@ -3605,8 +3605,6 @@ static void output_frame_level_debug_stats(AV1_COMP *cpi) { ...@@ -3605,8 +3605,6 @@ static void output_frame_level_debug_stats(AV1_COMP *cpi) {
"%10lf %8u %10"PRId64" %10d %10d %10d\n", "%10lf %8u %10"PRId64" %10d %10d %10d\n",
cpi->common.current_video_frame, cpi->common.current_video_frame,
cm->width, cm->height, cm->width, cm->height,
cpi->td.rd_counts.m_search_count,
cpi->td.rd_counts.ex_search_count,
cpi->rc.source_alt_ref_pending, cpi->rc.source_alt_ref_pending,
cpi->rc.source_alt_ref_active, cpi->rc.source_alt_ref_active,
cpi->rc.this_frame_target, cpi->rc.this_frame_target,
......
...@@ -268,13 +268,13 @@ typedef struct TileDataEnc { ...@@ -268,13 +268,13 @@ typedef struct TileDataEnc {
TileInfo tile_info; TileInfo tile_info;
int thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; int thresh_freq_fact[BLOCK_SIZES][MAX_MODES];
int mode_map[BLOCK_SIZES][MAX_MODES]; int mode_map[BLOCK_SIZES][MAX_MODES];
int m_search_count;
int ex_search_count;
} TileDataEnc; } TileDataEnc;
typedef struct RD_COUNTS { typedef struct RD_COUNTS {
av1_coeff_count coef_counts[TX_SIZES][PLANE_TYPES]; av1_coeff_count coef_counts[TX_SIZES][PLANE_TYPES];
int64_t comp_pred_diff[REFERENCE_MODES]; int64_t comp_pred_diff[REFERENCE_MODES];
int m_search_count;
int ex_search_count;
} RD_COUNTS; } RD_COUNTS;
typedef struct ThreadData { typedef struct ThreadData {
......
...@@ -27,10 +27,6 @@ static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) { ...@@ -27,10 +27,6 @@ static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) {
for (n = 0; n < ENTROPY_TOKENS; n++) for (n = 0; n < ENTROPY_TOKENS; n++)
td->rd_counts.coef_counts[i][j][k][l][m][n] += td->rd_counts.coef_counts[i][j][k][l][m][n] +=
td_t->rd_counts.coef_counts[i][j][k][l][m][n]; td_t->rd_counts.coef_counts[i][j][k][l][m][n];
// Counts of all motion searches and exhuastive mesh searches.
td->rd_counts.m_search_count += td_t->rd_counts.m_search_count;
td->rd_counts.ex_search_count += td_t->rd_counts.ex_search_count;
} }
static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) { static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) {
......
...@@ -89,6 +89,7 @@ class AVxEncoderThreadTest ...@@ -89,6 +89,7 @@ class AVxEncoderThreadTest
encoder->Control(AOME_SET_ARNR_MAXFRAMES, 7); encoder->Control(AOME_SET_ARNR_MAXFRAMES, 7);
encoder->Control(AOME_SET_ARNR_STRENGTH, 5); encoder->Control(AOME_SET_ARNR_STRENGTH, 5);
encoder->Control(AOME_SET_ARNR_TYPE, 3); encoder->Control(AOME_SET_ARNR_TYPE, 3);
encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 0);
} else { } else {
encoder->Control(AOME_SET_ENABLEAUTOALTREF, 0); encoder->Control(AOME_SET_ENABLEAUTOALTREF, 0);
encoder->Control(AV1E_SET_AQ_MODE, 3); encoder->Control(AV1E_SET_AQ_MODE, 3);
...@@ -180,5 +181,5 @@ AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadTest, ...@@ -180,5 +181,5 @@ AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadTest,
AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadTestLarge, AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadTestLarge,
::testing::Values(::libaom_test::kTwoPassGood, ::testing::Values(::libaom_test::kTwoPassGood,
::libaom_test::kOnePassGood), ::libaom_test::kOnePassGood),
::testing::Range(1, 3)); ::testing::Range(0, 3));
} // namespace } // namespace
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