int rdmult;
// Cyclic refresh map.
signed char *map;
- // Projected rate and distortion for the current superblock.
- int64_t projected_rate_sb;
- int64_t projected_dist_sb;
// Thresholds applied to projected rate/distortion of the superblock.
int64_t thresh_rate_sb;
int64_t thresh_dist_sb;
// mode, and rate/distortion.
static int candidate_refresh_aq(const CYCLIC_REFRESH *cr,
const MB_MODE_INFO *mbmi,
- BLOCK_SIZE bsize, int use_rd) {
+ BLOCK_SIZE bsize, int use_rd,
+ int64_t rate_sb) {
if (use_rd) {
MV mv = mbmi->mv[0].as_mv;
// If projected rate is below the thresh_rate (well below target,
// so undershoot expected), accept it for lower-qp coding.
- if (cr->projected_rate_sb < cr->thresh_rate_sb)
+ if (rate_sb < cr->thresh_rate_sb)
return 1;
// Otherwise, reject the block for lower-qp coding if any of the following:
// 1) mode uses large mv
void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi,
MB_MODE_INFO *const mbmi,
int mi_row, int mi_col,
- BLOCK_SIZE bsize, int use_rd) {
+ BLOCK_SIZE bsize, int use_rd,
+ int64_t rate_sb) {
const VP9_COMMON *const cm = &cpi->common;
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
const int bw = num_8x8_blocks_wide_lookup[bsize];
const int xmis = MIN(cm->mi_cols - mi_col, bw);
const int ymis = MIN(cm->mi_rows - mi_row, bh);
const int block_index = mi_row * cm->mi_cols + mi_col;
- const int refresh_this_block = candidate_refresh_aq(cr, mbmi, bsize, use_rd);
+ const int refresh_this_block = candidate_refresh_aq(cr, mbmi, bsize, use_rd,
+ rate_sb);
// Default is to not update the refresh map.
int new_map_value = cr->map[block_index];
int x = 0; int y = 0;
}
}
-void vp9_cyclic_refresh_set_rate_and_dist_sb(CYCLIC_REFRESH *cr,
- int64_t rate_sb, int64_t dist_sb) {
- cr->projected_rate_sb = rate_sb;
- cr->projected_dist_sb = dist_sb;
-}
-
int vp9_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr) {
return cr->rdmult;
}
void vp9_cyclic_refresh_update_segment(struct VP9_COMP *const cpi,
MB_MODE_INFO *const mbmi,
int mi_row, int mi_col,
- BLOCK_SIZE bsize, int use_rd);
+ BLOCK_SIZE bsize, int use_rd,
+ int64_t rate_sb);
// Setup cyclic background refresh: set delta q and segmentation map.
void vp9_cyclic_refresh_setup(struct VP9_COMP *const cpi);
-void vp9_cyclic_refresh_set_rate_and_dist_sb(CYCLIC_REFRESH *cr,
- int64_t rate_sb, int64_t dist_sb);
-
int vp9_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr);
#ifdef __cplusplus
// Else for cyclic refresh mode update the segment map, set the segment id
// and then update the quantizer.
if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
-
- vp9_cyclic_refresh_set_rate_and_dist_sb(cpi->cyclic_refresh,
- ctx->rate, ctx->dist);
vp9_cyclic_refresh_update_segment(cpi, &xd->mi[0].src_mi->mbmi,
- mi_row, mi_col, bsize, 1);
+ mi_row, mi_col, bsize, 1, ctx->rate);
}
}
: cm->last_frame_seg_map;
mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col);
} else {
- vp9_cyclic_refresh_set_rate_and_dist_sb(cpi->cyclic_refresh,
- ctx->rate, ctx->dist);
// Setting segmentation map for cyclic_refresh
- vp9_cyclic_refresh_update_segment(cpi, mbmi, mi_row, mi_col, bsize, 1);
+ vp9_cyclic_refresh_update_segment(cpi, mbmi, mi_row, mi_col, bsize, 1,
+ ctx->rate);
}
vp9_init_plane_quantizers(cpi, x);
}