]> granicus.if.org Git - libvpx/commitdiff
vp9: Fixes for lossless mode for real-time mode.
authorMarco Paniconi <marpan@google.com>
Mon, 25 Jun 2018 05:00:58 +0000 (22:00 -0700)
committerMarco Paniconi <marpan@google.com>
Mon, 25 Jun 2018 16:56:10 +0000 (09:56 -0700)
Fixes to nonrd coding mode for lossless mode: keep
skip_txfm to 0 (no skip) and disable the encoder breakout.
This makes the encoding lossless when that mode is selected
for real-time (nonrd pickmode).

Also the disable the cyclic refresh for lossless mode.

Change-Id: I20a11ef6df08accec472d26fabebd14d51f4d337

vp9/encoder/vp9_aq_cyclicrefresh.c
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_pickmode.c

index aadedba39127ef718a47a98dad05ce2289956d4e..f47da2fa487ff53f776757062993a2265206618a 100644 (file)
@@ -429,6 +429,7 @@ void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) {
   int thresh_low_motion = (cm->width < 720) ? 55 : 20;
   cr->apply_cyclic_refresh = 1;
   if (cm->frame_type == KEY_FRAME || cpi->svc.temporal_layer_id > 0 ||
+      is_lossless_requested(&cpi->oxcf) ||
       (cpi->use_svc &&
        cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame) ||
       (!cpi->use_svc && rc->avg_frame_low_motion < thresh_low_motion &&
index f6fcd9d3345b12863812a29a2d01734ff9743065..afbee524c94db8e48c1b0873a68661834b7b613e 100644 (file)
@@ -2431,7 +2431,7 @@ static void update_state_rt(VP9_COMP *cpi, ThreadData *td,
   }
 
   x->skip = ctx->skip;
-  x->skip_txfm[0] = mi->segment_id ? 0 : ctx->skip_txfm[0];
+  x->skip_txfm[0] = (mi->segment_id || xd->lossless) ? 0 : ctx->skip_txfm[0];
 }
 
 static void encode_b_rt(VP9_COMP *cpi, ThreadData *td,
index 8b5ad9ac5c60e5e04d80c0257ca87048c701603a..eb9abf729d132762bd2c35d41e69b480d5b651ba 100644 (file)
@@ -2218,7 +2218,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
 
     // Skipping checking: test to see if this block can be reconstructed by
     // prediction only.
-    if (cpi->allow_encode_breakout) {
+    if (cpi->allow_encode_breakout && !xd->lossless) {
       encode_breakout_test(cpi, x, bsize, mi_row, mi_col, ref_frame, this_mode,
                            var_y, sse_y, yv12_mb, &this_rdc.rate,
                            &this_rdc.dist, flag_preduv_computed);