shithub: libvpx

Download patch

ref: 60f9cf29204bb798654939ae497d16c5376e5fb9
parent: bd6b274dc04b75289ae3403564f03c2717b878d1
author: Marco Paniconi <marpan@google.com>
date: Sun Jun 24 18:00:58 EDT 2018

vp9: Fixes for lossless mode for real-time mode.

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

--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -429,6 +429,7 @@
   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 &&
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2431,7 +2431,7 @@
   }
 
   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,
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -2218,7 +2218,7 @@
 
     // 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);