]> granicus.if.org Git - libvpx/commitdiff
Change the min/max q validation in lossless mode
authorYaowu Xu <yaowu@google.com>
Fri, 21 Mar 2014 00:29:04 +0000 (17:29 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 21 Mar 2014 02:22:27 +0000 (19:22 -0700)
This commit changed how q is validated in lossless mode. With this
commit, when --lossless=1 is specificed at commandline, --min-q and
--max-q are now ignored. This is to make the option non-ambiguious.

Change-Id: I33e85690460537509d33be75d6a3597be4affc09

vp9/encoder/vp9_onyx_if.c
vp9/vp9_cx_iface.c

index 7fd9febbd17616c9e76db09ba7a42b387c627513..a7788847b5d2b1088bba536496a8534bfb295f32 100644 (file)
@@ -1328,10 +1328,16 @@ void vp9_change_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
   cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
 
   cpi->oxcf.lossless = oxcf->lossless;
-  cpi->mb.e_mbd.itxm_add = cpi->oxcf.lossless ? vp9_iwht4x4_add
-                                              : vp9_idct4x4_add;
+  if (cpi->oxcf.lossless) {
+    // In lossless mode, make sure right quantizer range and correct transform
+    // is set.
+    cpi->oxcf.worst_allowed_q = 0;
+    cpi->oxcf.best_allowed_q = 0;
+    cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add;
+  } else {
+    cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add;
+  }
   cpi->rc.baseline_gf_interval = DEFAULT_GF_INTERVAL;
-
   cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
 
   cpi->refresh_golden_frame = 0;
index 2e8326099647ee52814d09a15052425455f9ab89..650d9ba870f7ab37e50bcd2cdb8183b9d87c0e36 100644 (file)
@@ -152,10 +152,6 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t      *ctx,
   RANGE_CHECK_HI(cfg, rc_max_quantizer,   63);
   RANGE_CHECK_HI(cfg, rc_min_quantizer,   cfg->rc_max_quantizer);
   RANGE_CHECK_BOOL(extra_cfg, lossless);
-  if (extra_cfg->lossless) {
-    RANGE_CHECK_HI(cfg, rc_max_quantizer, 0);
-    RANGE_CHECK_HI(cfg, rc_min_quantizer, 0);
-  }
   RANGE_CHECK(extra_cfg, aq_mode,           0, AQ_MODE_COUNT - 1);
 
   RANGE_CHECK_HI(cfg, g_threads,          64);