12#ifndef AOM_AV1_ENCODER_AQ_CYCLICREFRESH_H_
13#define AOM_AV1_ENCODER_AQ_CYCLICREFRESH_H_
15#include "av1/common/blockd.h"
17#include "av1/encoder/tokenize.h"
25#define CR_SEGMENT_ID_BASE 0
26#define CR_SEGMENT_ID_BOOST1 1
27#define CR_SEGMENT_ID_BOOST2 2
30#define CR_MAX_RATE_TARGET_RATIO 4.0
120 int apply_cyclic_refresh;
122 int counter_encode_maxq_scene_change;
123 int use_block_sad_scene_det;
131CYCLIC_REFRESH *av1_cyclic_refresh_alloc(
int mi_rows,
int mi_cols);
151 double correction_factor);
172 double correction_factor);
198 BLOCK_SIZE bsize, RUN_TYPE dry_run);
226 int mi_col, BLOCK_SIZE bsize,
227 int64_t rate, int64_t dist,
int skip,
310int av1_cyclic_refresh_disable_lf_cdef(
struct AV1_COMP *
const cpi);
312static inline int cyclic_refresh_segment_id_boosted(
int segment_id) {
313 return segment_id == CR_SEGMENT_ID_BOOST1 ||
314 segment_id == CR_SEGMENT_ID_BOOST2;
317static inline int cyclic_refresh_segment_id(
int segment_id) {
318 if (segment_id == CR_SEGMENT_ID_BOOST1)
319 return CR_SEGMENT_ID_BOOST1;
320 else if (segment_id == CR_SEGMENT_ID_BOOST2)
321 return CR_SEGMENT_ID_BOOST2;
323 return CR_SEGMENT_ID_BASE;
int av1_cyclic_refresh_rc_bits_per_mb(const struct AV1_COMP *cpi, int i, double correction_factor)
Estimate the bits per mb, for given q = i and delta-q.
void av1_cyclic_refresh_update_parameters(struct AV1_COMP *const cpi)
Set the global/frame level parameters for cyclic refresh.
void av1_cyclic_refresh_update_segment(const struct AV1_COMP *cpi, MACROBLOCK *const x, int mi_row, int mi_col, BLOCK_SIZE bsize, int64_t rate, int64_t dist, int skip, RUN_TYPE dry_run)
Update segment_id for block based on mode selected.
int av1_cyclic_refresh_estimate_bits_at_q(const struct AV1_COMP *cpi, double correction_factor)
Estimate the bits, incorporating the delta-q from the segments.
void av1_cyclic_reset_segment_skip(const struct AV1_COMP *cpi, MACROBLOCK *const x, int mi_row, int mi_col, BLOCK_SIZE bsize, RUN_TYPE dry_run)
Update segment_id for blocks are skipped.
void av1_accumulate_cyclic_refresh_counters(CYCLIC_REFRESH *const cyclic_refresh, const MACROBLOCK *const x)
Accumulate cyclic refresh counters.
void av1_cyclic_refresh_set_golden_update(struct AV1_COMP *const cpi)
Set golden frame update interval nased on cyclic refresh.
void av1_init_cyclic_refresh_counters(MACROBLOCK *const x)
Initialize counters used for cyclic refresh.
void av1_cyclic_refresh_setup(struct AV1_COMP *const cpi)
Setup the cyclic background refresh.
Top level encoder structure.
Definition encoder.h:2870
The stucture of CYCLIC_REFRESH.
Definition aq_cyclicrefresh.h:36
int16_t motion_thresh
Definition aq_cyclicrefresh.h:102
int64_t thresh_rate_sb
Definition aq_cyclicrefresh.h:92
int time_for_refresh
Definition aq_cyclicrefresh.h:65
int rdmult
Definition aq_cyclicrefresh.h:83
int max_qdelta_perc
Definition aq_cyclicrefresh.h:51
int8_t * map
Definition aq_cyclicrefresh.h:87
int64_t thresh_dist_sb
Definition aq_cyclicrefresh.h:97
int actual_num_seg2_blocks
Definition aq_cyclicrefresh.h:79
double rate_ratio_qdelta_adjustment
Definition aq_cyclicrefresh.h:111
int last_sb_index
Definition aq_cyclicrefresh.h:59
int target_num_seg_blocks
Definition aq_cyclicrefresh.h:69
int sb_index
Definition aq_cyclicrefresh.h:55
int percent_refresh_adjustment
Definition aq_cyclicrefresh.h:46
int rate_boost_fac
Definition aq_cyclicrefresh.h:116
int percent_refresh
Definition aq_cyclicrefresh.h:41
int actual_num_seg1_blocks
Definition aq_cyclicrefresh.h:74
double rate_ratio_qdelta
Definition aq_cyclicrefresh.h:106
Encoder's parameters related to the current coding block.
Definition block.h:878