]> granicus.if.org Git - libvpx/commitdiff
Integrate fast txfm and quant path into skip_recode system
authorJingning Han <jingning@google.com>
Wed, 6 Aug 2014 23:11:22 +0000 (16:11 -0700)
committerJingning Han <jingning@google.com>
Wed, 6 Aug 2014 23:11:22 +0000 (16:11 -0700)
This commit integrates the fast transform and quantization process
into skip_recode scheme in the rate-distortion optimization loop.
Previously the fast transform and quantization process was only
enabled for non-RD coding flow.

Change-Id: Ib7db4d39b7033f1495c75897271f769799198ba8

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodemb.c

index 1fcd1e91ef74abcd80b7592f73f9c26796e07698..34e782752a72ab7975929d2c5f98ffe6be058b4c 100644 (file)
@@ -3468,6 +3468,9 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
                    cpi->oxcf.aq_mode != CYCLIC_REFRESH_AQ &&
                    cpi->sf.allow_skip_recode;
 
+  if (!x->skip_recode && !cpi->sf.use_nonrd_pick_mode)
+    vpx_memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
+
   x->skip_optimize = ctx->is_coded;
   ctx->is_coded = 1;
   x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
index 0bb33e91cdb30973f4276771aea41b66161988b3..d48f0b0c2357097d03ad49a67ee6395b8ffca69a 100644 (file)
@@ -472,22 +472,22 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
     return;
   }
 
-  if (x->skip_txfm[plane] == 0) {
-    // full forward transform and quantization
-    if (!x->skip_recode) {
+  if (!x->skip_recode) {
+    if (x->skip_txfm[plane] == 0) {
+      // full forward transform and quantization
       if (x->quant_fp)
         vp9_xform_quant_fp(x, plane, block, plane_bsize, tx_size);
       else
         vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
+    } else if (x->skip_txfm[plane] == 2) {
+      // fast path forward transform and quantization
+      vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size);
+    } else {
+      // skip forward transform
+      p->eobs[block] = 0;
+      *a = *l = 0;
+      return;
     }
-  } else if (x->skip_txfm[plane] == 2) {
-    // fast path forward transform and quantization
-    vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size);
-  } else {
-    // skip forward transform
-    p->eobs[block] = 0;
-    *a = *l = 0;
-    return;
   }
 
   if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {