summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2014-12-08 09:01:39 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-12-08 09:01:39 -0800
commit127f65531bc93bfc1267153f557a40d080245466 (patch)
treed9e5c676e197595f1ccf51f5cc7970b4497afb34 /vp9/encoder
parent0f8e8330eba25447d2893c1c661fa1dbc5ce5579 (diff)
parent00e3626e13f27112d23b58fedce4bda7395ff793 (diff)
downloadlibvpx-127f65531bc93bfc1267153f557a40d080245466.tar
libvpx-127f65531bc93bfc1267153f557a40d080245466.tar.gz
libvpx-127f65531bc93bfc1267153f557a40d080245466.tar.bz2
libvpx-127f65531bc93bfc1267153f557a40d080245466.zip
Merge "Use average mb energy from first pass in AQ2 test."
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_aq_complexity.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_aq_complexity.c b/vp9/encoder/vp9_aq_complexity.c
index 83f4a53d6..9ec4799e3 100644
--- a/vp9/encoder/vp9_aq_complexity.c
+++ b/vp9/encoder/vp9_aq_complexity.c
@@ -23,7 +23,7 @@ static const double aq_c_q_adj_factor[AQ_C_STRENGTHS][AQ_C_SEGMENTS] =
{{1.0, 1.0, 1.0}, {1.0, 2.0, 1.0}, {1.0, 1.5, 2.5}};
static const double aq_c_transitions[AQ_C_STRENGTHS][AQ_C_SEGMENTS] =
{{1.0, 1.0, 1.0}, {1.0, 0.25, 0.0}, {1.0, 0.5, 0.25}};
-static const double aq_c_var_thresholds[AQ_C_SEGMENTS] = {100.0, 12.0, 10.0};
+static const double aq_c_var_thresholds[AQ_C_SEGMENTS] = {100.0, -1.0, -2.0};
static int get_aq_c_strength(int q_index, vpx_bit_depth_t bit_depth) {
// Approximate base quatizer (truncated to int)
@@ -90,6 +90,8 @@ void vp9_setup_in_frame_q_adj(VP9_COMP *cpi) {
}
}
+#define DEFAULT_LV_THRESH 10.0
+
// Select a segment for the current SB64 block.
// The choice of segment for a block depends on the ratio of the projected
// bits for the block vs a target average.
@@ -122,6 +124,11 @@ void vp9_select_in_frame_q_segment(VP9_COMP *cpi, MACROBLOCK *mb,
const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth);
const int active_segments = aq_c_active_segments[aq_strength];
double logvar;
+ double low_var_thresh;
+
+ vp9_clear_system_state();
+ low_var_thresh =
+ (cpi->oxcf.pass == 2) ? cpi->twopass.mb_av_energy : DEFAULT_LV_THRESH;
vp9_setup_src_planes(mb, cpi->Source, mi_row, mi_col);
logvar = vp9_log_block_var(cpi, mb, bs);
@@ -136,7 +143,7 @@ void vp9_select_in_frame_q_segment(VP9_COMP *cpi, MACROBLOCK *mb,
while (segment > 0) {
if ((projected_rate <
target_rate * aq_c_transitions[aq_strength][segment]) &&
- (logvar < aq_c_var_thresholds[segment])) {
+ (logvar < (low_var_thresh + aq_c_var_thresholds[segment]))) {
break;
}
--segment;