Coding path sync test: force quantizer
Change-Id: I5ad29fe45dcb83cec15ca7295bc2116fccbd8d06
diff --git a/test/coding_path_sync.cc b/test/coding_path_sync.cc
index 8068f52..3826aa9 100644
--- a/test/coding_path_sync.cc
+++ b/test/coding_path_sync.cc
@@ -32,11 +32,17 @@
aom_codec_enc_cfg_t cfg;
aom_codec_enc_config_default(algo, &cfg, 0);
- const int max_q = cfg.rc_max_quantizer;
+ // force the quantizer, to reduce the sensitivity on encoding choices.
+ // e.g, we don't want this test to break when the rate control is modified.
+ {
+ const int max_q = cfg.rc_max_quantizer;
+ const int min_q = cfg.rc_min_quantizer;
+ const int q = rnd_.PseudoUniform(max_q - min_q + 1) + min_q;
- cfg.rc_end_usage = AOM_CQ;
- cfg.rc_max_quantizer = max_q;
- cfg.rc_min_quantizer = max_q;
+ cfg.rc_end_usage = AOM_Q;
+ cfg.rc_max_quantizer = q;
+ cfg.rc_min_quantizer = q;
+ }
// choose the picture size
{