diff options
author | trav90 <travawine@palemoon.org> | 2018-10-19 21:52:15 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2018-10-19 21:52:20 -0500 |
commit | bbcc64772580c8a979288791afa02d30bc476d2e (patch) | |
tree | 437ce94c3fdd7497508e5b55de06c6d011678597 /third_party/aom/av1/encoder/ethread.c | |
parent | 14805f6ddbfb173c327768fff9f81f40ce5e81b0 (diff) | |
download | UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.gz UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.lz UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.xz UXP-bbcc64772580c8a979288791afa02d30bc476d2e.zip |
Update aom to v1.0.0
Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
Diffstat (limited to 'third_party/aom/av1/encoder/ethread.c')
-rw-r--r-- | third_party/aom/av1/encoder/ethread.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/third_party/aom/av1/encoder/ethread.c b/third_party/aom/av1/encoder/ethread.c index edc9b1d61..404af2e7c 100644 --- a/third_party/aom/av1/encoder/ethread.c +++ b/third_party/aom/av1/encoder/ethread.c @@ -18,15 +18,13 @@ static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) { for (int i = 0; i < REFERENCE_MODES; i++) td->rd_counts.comp_pred_diff[i] += td_t->rd_counts.comp_pred_diff[i]; -#if CONFIG_GLOBAL_MOTION - for (int i = 0; i < TOTAL_REFS_PER_FRAME; i++) + for (int i = 0; i < REF_FRAMES; i++) td->rd_counts.global_motion_used[i] += td_t->rd_counts.global_motion_used[i]; -#endif // CONFIG_GLOBAL_MOTION td->rd_counts.compound_ref_used_flag |= td_t->rd_counts.compound_ref_used_flag; - td->rd_counts.single_ref_used_flag |= td_t->rd_counts.single_ref_used_flag; + td->rd_counts.skip_mode_used_flag |= td_t->rd_counts.skip_mode_used_flag; } static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) { @@ -53,7 +51,7 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) { AV1_COMMON *const cm = &cpi->common; const int tile_cols = cm->tile_cols; const AVxWorkerInterface *const winterface = aom_get_worker_interface(); - const int num_workers = AOMMIN(cpi->oxcf.max_threads, tile_cols); + int num_workers = AOMMIN(cpi->oxcf.max_threads, tile_cols); int i; av1_init_tile_data(cpi); @@ -81,29 +79,19 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) { aom_memalign(32, sizeof(*thread_data->td))); av1_zero(*thread_data->td); -// Set up pc_tree. -#if !CONFIG_CB4X4 - thread_data->td->leaf_tree = NULL; -#endif + // Set up pc_tree. thread_data->td->pc_tree = NULL; av1_setup_pc_tree(cm, thread_data->td); -#if CONFIG_MOTION_VAR -#if CONFIG_HIGHBITDEPTH - int buf_scaler = 2; -#else - int buf_scaler = 1; -#endif CHECK_MEM_ERROR(cm, thread_data->td->above_pred_buf, (uint8_t *)aom_memalign( - 16, - buf_scaler * MAX_MB_PLANE * MAX_SB_SQUARE * - sizeof(*thread_data->td->above_pred_buf))); + 16, MAX_MB_PLANE * MAX_SB_SQUARE * + sizeof(*thread_data->td->above_pred_buf))); CHECK_MEM_ERROR(cm, thread_data->td->left_pred_buf, (uint8_t *)aom_memalign( - 16, - buf_scaler * MAX_MB_PLANE * MAX_SB_SQUARE * - sizeof(*thread_data->td->left_pred_buf))); + 16, MAX_MB_PLANE * MAX_SB_SQUARE * + sizeof(*thread_data->td->left_pred_buf))); + CHECK_MEM_ERROR( cm, thread_data->td->wsrc_buf, (int32_t *)aom_memalign( @@ -112,7 +100,6 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) { cm, thread_data->td->mask_buf, (int32_t *)aom_memalign( 16, MAX_SB_SQUARE * sizeof(*thread_data->td->mask_buf))); -#endif // Allocate frame counters in thread data. CHECK_MEM_ERROR(cm, thread_data->td->counts, aom_calloc(1, sizeof(*thread_data->td->counts))); @@ -133,6 +120,8 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) { winterface->sync(worker); } + } else { + num_workers = AOMMIN(num_workers, cpi->num_workers); } for (i = 0; i < num_workers; i++) { @@ -148,16 +137,13 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) { if (thread_data->td != &cpi->td) { thread_data->td->mb = cpi->td.mb; thread_data->td->rd_counts = cpi->td.rd_counts; -#if CONFIG_MOTION_VAR thread_data->td->mb.above_pred_buf = thread_data->td->above_pred_buf; thread_data->td->mb.left_pred_buf = thread_data->td->left_pred_buf; thread_data->td->mb.wsrc_buf = thread_data->td->wsrc_buf; thread_data->td->mb.mask_buf = thread_data->td->mask_buf; -#endif } - if (thread_data->td->counts != &cpi->common.counts) { - memcpy(thread_data->td->counts, &cpi->common.counts, - sizeof(cpi->common.counts)); + if (thread_data->td->counts != &cpi->counts) { + memcpy(thread_data->td->counts, &cpi->counts, sizeof(cpi->counts)); } if (i < num_workers - 1) @@ -187,14 +173,24 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) { for (i = 0; i < num_workers; i++) { AVxWorker *const worker = &cpi->workers[i]; EncWorkerData *const thread_data = (EncWorkerData *)worker->data1; - + cpi->intrabc_used |= thread_data->td->intrabc_used_this_tile; // Accumulate counters. if (i < cpi->num_workers - 1) { - av1_accumulate_frame_counts(&cm->counts, thread_data->td->counts); + av1_accumulate_frame_counts(&cpi->counts, thread_data->td->counts); accumulate_rd_opt(&cpi->td, thread_data->td); -#if CONFIG_VAR_TX cpi->td.mb.txb_split_count += thread_data->td->mb.txb_split_count; -#endif } } } + +// Accumulate frame counts. FRAME_COUNTS consist solely of 'unsigned int' +// members, so we treat it as an array, and sum over the whole length. +void av1_accumulate_frame_counts(FRAME_COUNTS *acc_counts, + const FRAME_COUNTS *counts) { + unsigned int *const acc = (unsigned int *)acc_counts; + const unsigned int *const cnt = (const unsigned int *)counts; + + const unsigned int n_counts = sizeof(FRAME_COUNTS) / sizeof(unsigned int); + + for (unsigned int i = 0; i < n_counts; i++) acc[i] += cnt[i]; +} |