summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_multi_thread.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2018-12-21 14:46:52 -0800
committerYunqing Wang <yunqingwang@google.com>2018-12-27 11:02:17 -0800
commit95ac0cc9f77e8b42edc8db1c38c557fc5c9b60fd (patch)
treee7095e73c2ecac4f4dad60a8cc2dd05da6655bdf /vp9/encoder/vp9_multi_thread.c
parent8010d20b010251d59fff89c0a10f4baffd336579 (diff)
downloadlibvpx-95ac0cc9f77e8b42edc8db1c38c557fc5c9b60fd.tar
libvpx-95ac0cc9f77e8b42edc8db1c38c557fc5c9b60fd.tar.gz
libvpx-95ac0cc9f77e8b42edc8db1c38c557fc5c9b60fd.tar.bz2
libvpx-95ac0cc9f77e8b42edc8db1c38c557fc5c9b60fd.zip
Adaptively choose block sizes in temporal filtering
Use variable block sizes in temporal filtering. Based on prediction errors of 32x32 or 16x16 blocks, choose the block size adaptively. This improves the coding performance, especially for HD resolutions. Speed 1 borg test result: avg_psnr: ovr_psnr: ssim: lowres: -0.090 -0.075 -0.112 midres: -0.120 -0.107 -0.168 hdres: -0.506 -0.512 -0.547 Change-Id: I8f774e29ecb2e0dd372b32b60c32d8fa30c013a8
Diffstat (limited to 'vp9/encoder/vp9_multi_thread.c')
-rw-r--r--vp9/encoder/vp9_multi_thread.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/vp9/encoder/vp9_multi_thread.c b/vp9/encoder/vp9_multi_thread.c
index 7148fd0d6..c66c03549 100644
--- a/vp9/encoder/vp9_multi_thread.c
+++ b/vp9/encoder/vp9_multi_thread.c
@@ -74,7 +74,9 @@ void vp9_row_mt_mem_alloc(VP9_COMP *cpi) {
const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
int jobs_per_tile_col, total_jobs;
- jobs_per_tile_col = VPXMAX(((cm->mi_rows + TF_ROUND) >> TF_SHIFT), sb_rows);
+ // Allocate memory that is large enough for all row_mt stages. First pass
+ // uses 16x16 block size.
+ jobs_per_tile_col = VPXMAX(cm->mb_rows, sb_rows);
// Calculate the total number of jobs
total_jobs = jobs_per_tile_col * tile_cols;
@@ -229,13 +231,19 @@ void vp9_prepare_job_queue(VP9_COMP *cpi, JOB_TYPE job_type) {
MultiThreadHandle *multi_thread_ctxt = &cpi->multi_thread_ctxt;
JobQueue *job_queue = multi_thread_ctxt->job_queue;
const int tile_cols = 1 << cm->log2_tile_cols;
- int job_row_num, jobs_per_tile, jobs_per_tile_col, total_jobs;
+ int job_row_num, jobs_per_tile, jobs_per_tile_col = 0, total_jobs;
const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
int tile_col, i;
- jobs_per_tile_col = (job_type != ENCODE_JOB)
- ? ((cm->mi_rows + TF_ROUND) >> TF_SHIFT)
- : sb_rows;
+ switch (job_type) {
+ case ENCODE_JOB: jobs_per_tile_col = sb_rows; break;
+ case FIRST_PASS_JOB: jobs_per_tile_col = cm->mb_rows; break;
+ case ARNR_JOB:
+ jobs_per_tile_col = ((cm->mi_rows + TF_ROUND) >> TF_SHIFT);
+ break;
+ default: assert(0);
+ }
+
total_jobs = jobs_per_tile_col * tile_cols;
multi_thread_ctxt->jobs_per_tile_col = jobs_per_tile_col;