diff options
author | Marco <marpan@chromium.org> | 2015-10-06 17:47:08 -0700 |
---|---|---|
committer | Marco <marpan@chromium.org> | 2015-10-06 17:51:30 -0700 |
commit | bc137ff67b242dedb03996174d5872fe2a6cb257 (patch) | |
tree | ceea32b155a81f1a5f484a93f86d71a6b7d817d1 /vp9/encoder | |
parent | ce3f4ade670cf02e05998f4ca50e08736802f5e7 (diff) | |
download | libvpx-bc137ff67b242dedb03996174d5872fe2a6cb257.tar libvpx-bc137ff67b242dedb03996174d5872fe2a6cb257.tar.gz libvpx-bc137ff67b242dedb03996174d5872fe2a6cb257.tar.bz2 libvpx-bc137ff67b242dedb03996174d5872fe2a6cb257.zip |
Move setting of refresh threshold outside loop.
Small code cleanup. consec_zeromv refresh threshold
does not need to be computed for every super-block.
No change in behavior.
Change-Id: I8c4b1b28072f42b01d917fff6d1f62722f1e1554
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_aq_cyclicrefresh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c index 968dad26b..04fa8f6fd 100644 --- a/vp9/encoder/vp9_aq_cyclicrefresh.c +++ b/vp9/encoder/vp9_aq_cyclicrefresh.c @@ -395,6 +395,7 @@ static void cyclic_refresh_update_map(VP9_COMP *const cpi) { unsigned char *const seg_map = cpi->segmentation_map; int i, block_count, bl_index, sb_rows, sb_cols, sbs_in_frame; int xmis, ymis, x, y; + int consec_zero_mv_thresh = 0; memset(seg_map, CR_SEGMENT_ID_BASE, cm->mi_rows * cm->mi_cols); sb_cols = (cm->mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE; sb_rows = (cm->mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE; @@ -407,6 +408,9 @@ static void cyclic_refresh_update_map(VP9_COMP *const cpi) { assert(cr->sb_index < sbs_in_frame); i = cr->sb_index; cr->target_num_seg_blocks = 0; + if (cpi->oxcf.content != VP9E_CONTENT_SCREEN && + cr->percent_refresh > 0) + consec_zero_mv_thresh = 10 * (100 / cr->percent_refresh); do { int sum_map = 0; // Get the mi_row/mi_col corresponding to superblock index i. @@ -416,9 +420,6 @@ static void cyclic_refresh_update_map(VP9_COMP *const cpi) { int mi_col = sb_col_index * MI_BLOCK_SIZE; int qindex_thresh = vp9_get_qindex(&cm->seg, CR_SEGMENT_ID_BOOST2, cm->base_qindex); - int consec_zero_mv_thresh = - cpi->oxcf.content == VP9E_CONTENT_SCREEN ? 0 - : 10 * (100 / cr->percent_refresh); assert(mi_row >= 0 && mi_row < cm->mi_rows); assert(mi_col >= 0 && mi_col < cm->mi_cols); bl_index = mi_row * cm->mi_cols + mi_col; |