summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/encoder/aq_cyclicrefresh.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/av1/encoder/aq_cyclicrefresh.c')
-rw-r--r--third_party/aom/av1/encoder/aq_cyclicrefresh.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/third_party/aom/av1/encoder/aq_cyclicrefresh.c b/third_party/aom/av1/encoder/aq_cyclicrefresh.c
index a1fe37d4a..dec2c730d 100644
--- a/third_party/aom/av1/encoder/aq_cyclicrefresh.c
+++ b/third_party/aom/av1/encoder/aq_cyclicrefresh.c
@@ -137,8 +137,9 @@ static int candidate_refresh_aq(const CYCLIC_REFRESH *cr,
static int compute_deltaq(const AV1_COMP *cpi, int q, double rate_factor) {
const CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
const RATE_CONTROL *const rc = &cpi->rc;
- int deltaq = av1_compute_qdelta_by_rate(rc, cpi->common.frame_type, q,
- rate_factor, cpi->common.bit_depth);
+ int deltaq =
+ av1_compute_qdelta_by_rate(rc, cpi->common.frame_type, q, rate_factor,
+ cpi->common.seq_params.bit_depth);
if ((-deltaq) > cr->max_qdelta_perc * q / 100) {
deltaq = -cr->max_qdelta_perc * q / 100;
}
@@ -164,15 +165,16 @@ int av1_cyclic_refresh_estimate_bits_at_q(const AV1_COMP *cpi,
estimated_bits =
(int)((1.0 - weight_segment1 - weight_segment2) *
av1_estimate_bits_at_q(cm->frame_type, cm->base_qindex, mbs,
- correction_factor, cm->bit_depth) +
- weight_segment1 *
- av1_estimate_bits_at_q(cm->frame_type,
- cm->base_qindex + cr->qindex_delta[1],
- mbs, correction_factor, cm->bit_depth) +
- weight_segment2 *
- av1_estimate_bits_at_q(cm->frame_type,
- cm->base_qindex + cr->qindex_delta[2],
- mbs, correction_factor, cm->bit_depth));
+ correction_factor,
+ cm->seq_params.bit_depth) +
+ weight_segment1 * av1_estimate_bits_at_q(
+ cm->frame_type,
+ cm->base_qindex + cr->qindex_delta[1], mbs,
+ correction_factor, cm->seq_params.bit_depth) +
+ weight_segment2 * av1_estimate_bits_at_q(
+ cm->frame_type,
+ cm->base_qindex + cr->qindex_delta[2], mbs,
+ correction_factor, cm->seq_params.bit_depth));
return estimated_bits;
}
@@ -197,12 +199,13 @@ int av1_cyclic_refresh_rc_bits_per_mb(const AV1_COMP *cpi, int i,
// Compute delta-q corresponding to qindex i.
int deltaq = compute_deltaq(cpi, i, cr->rate_ratio_qdelta);
// Take segment weighted average for bits per mb.
- bits_per_mb = (int)((1.0 - weight_segment) *
- av1_rc_bits_per_mb(cm->frame_type, i,
- correction_factor, cm->bit_depth) +
- weight_segment *
- av1_rc_bits_per_mb(cm->frame_type, i + deltaq,
- correction_factor, cm->bit_depth));
+ bits_per_mb =
+ (int)((1.0 - weight_segment) *
+ av1_rc_bits_per_mb(cm->frame_type, i, correction_factor,
+ cm->seq_params.bit_depth) +
+ weight_segment * av1_rc_bits_per_mb(cm->frame_type, i + deltaq,
+ correction_factor,
+ cm->seq_params.bit_depth));
return bits_per_mb;
}
@@ -507,7 +510,8 @@ void av1_cyclic_refresh_setup(AV1_COMP *const cpi) {
} else {
int qindex_delta = 0;
int qindex2;
- const double q = av1_convert_qindex_to_q(cm->base_qindex, cm->bit_depth);
+ const double q =
+ av1_convert_qindex_to_q(cm->base_qindex, cm->seq_params.bit_depth);
aom_clear_system_state();
// Set rate threshold to some multiple (set to 2 for now) of the target
// rate (target is given by sb64_target_rate and scaled by 256).