[x265] [PATCH 1 of 3] cli: add option to signal consistent cudeltaQP

kavitha at multicorewareinc.com kavitha at multicorewareinc.com
Thu Dec 22 10:59:18 CET 2016


# HG changeset patch
# User Kavitha Sampath <kavitha at multicorewareinc.com>
# Date 1482315369 -19800
#      Wed Dec 21 15:46:09 2016 +0530
# Node ID 62f0c309ca7057dcdc3e604f74fad58ff885c740
# Parent  e8152da7aa0e03a27f01a2a95aedf914248fe577
cli: add option to signal consistent cudeltaQP

diff -r e8152da7aa0e -r 62f0c309ca70 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Fri Dec 09 14:36:00 2016 +0530
+++ b/doc/reST/cli.rst	Wed Dec 21 15:46:09 2016 +0530
@@ -1895,6 +1895,13 @@
 
 	Enable storing commonly used RPS in SPS in multi pass mode. Default disabled.
 
+.. option:: --[no-]opt-cu-delta-qp
+
+	Optimize CU level QPs by pulling up lower QPs to value close to meanQP thereby
+	minimizing fluctuations in deltaQP signalling. Default disabled.
+
+	Only effective at RD levels 5 and 6
+
 
 Debugging options
 =================
diff -r e8152da7aa0e -r 62f0c309ca70 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Fri Dec 09 14:36:00 2016 +0530
+++ b/source/CMakeLists.txt	Wed Dec 21 15:46:09 2016 +0530
@@ -29,7 +29,7 @@
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 103)
+set(X265_BUILD 104)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r e8152da7aa0e -r 62f0c309ca70 source/common/param.cpp
--- a/source/common/param.cpp	Fri Dec 09 14:36:00 2016 +0530
+++ b/source/common/param.cpp	Wed Dec 21 15:46:09 2016 +0530
@@ -263,6 +263,7 @@
     param->bEmitVUIHRDInfo      = 1;
     param->bOptQpPPS            = 1;
     param->bOptRefListLengthPPS = 1;
+    param->bOptCUDeltaQP        = 0;
 
 }
 
@@ -920,6 +921,7 @@
         OPT("multi-pass-opt-rps") p->bMultiPassOptRPS = atobool(value);
         OPT("scenecut-bias") p->scenecutBias = atof(value);
         OPT("lookahead-threads") p->lookaheadThreads = atoi(value);
+        OPT("opt-cu-delta-qp") p->bOptCUDeltaQP = atobool(value);
         else
             return X265_PARAM_BAD_NAME;
     }
@@ -1622,6 +1624,7 @@
     BOOL(p->bOptRefListLengthPPS, "opt-ref-list-length-pps");
     BOOL(p->bMultiPassOptRPS, "multi-pass-opt-rps");
     s += sprintf(s, " scenecut-bias=%.2f", p->scenecutBias);
+    BOOL(p->bOptCUDeltaQP, "opt-cu-delta-qp");
 #undef BOOL
     return buf;
 }
diff -r e8152da7aa0e -r 62f0c309ca70 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Dec 09 14:36:00 2016 +0530
+++ b/source/encoder/encoder.cpp	Wed Dec 21 15:46:09 2016 +0530
@@ -2016,6 +2016,12 @@
         x265_log(p, X265_LOG_WARNING, "--rd-refine disabled, requires RD level > 4 and adaptive quant\n");
     }
 
+    if (p->bOptCUDeltaQP && p->rdLevel < 5)
+    {
+        p->bOptCUDeltaQP = false;
+        x265_log(p, X265_LOG_WARNING, "--opt-cu-delta-qp disabled, requires RD level > 4\n");
+    }
+
     if (p->limitTU && p->tuQTMaxInterDepth < 2)
     {
         p->limitTU = 0;
diff -r e8152da7aa0e -r 62f0c309ca70 source/x265.h
--- a/source/x265.h	Fri Dec 09 14:36:00 2016 +0530
+++ b/source/x265.h	Wed Dec 21 15:46:09 2016 +0530
@@ -1342,6 +1342,9 @@
     * resources for frame Encoder and can harm performance. Default is 0 - disabled. */
     int       lookaheadThreads;
 
+    /* Optimize CU level QPs to signal consistent deltaQPs in frame for rd level > 4 */
+    int        bOptCUDeltaQP;
+
 } x265_param;
 
 /* x265_param_alloc:
diff -r e8152da7aa0e -r 62f0c309ca70 source/x265cli.h
--- a/source/x265cli.h	Fri Dec 09 14:36:00 2016 +0530
+++ b/source/x265cli.h	Wed Dec 21 15:46:09 2016 +0530
@@ -219,6 +219,8 @@
     { "no-opt-qp-pps",        no_argument, NULL, 0 },
     { "opt-ref-list-length-pps",         no_argument, NULL, 0 },
     { "no-opt-ref-list-length-pps",      no_argument, NULL, 0 },
+    { "opt-cu-delta-qp",      no_argument, NULL, 0 },
+    { "no-opt-cu-delta-qp",   no_argument, NULL, 0 },
     { "no-dither",            no_argument, NULL, 0 },
     { "dither",               no_argument, NULL, 0 },
     { "no-repeat-headers",    no_argument, NULL, 0 },
@@ -467,6 +469,7 @@
     H0("   --[no-]opt-qp-pps             Dynamically optimize QP in PPS (instead of default 26) based on QPs in previous GOP. Default %s\n", OPT(param->bOptQpPPS));
     H0("   --[no-]opt-ref-list-length-pps  Dynamically set L0 and L1 ref list length in PPS (instead of default 0) based on values in last GOP. Default %s\n", OPT(param->bOptRefListLengthPPS));
     H0("   --[no-]multi-pass-opt-rps     Enable storing commonly used RPS in SPS in multi pass mode. Default %s\n", OPT(param->bMultiPassOptRPS));
+    H0("   --[no-]opt-cu-delta-qp        Optimize to signal consistent CU level delta QPs in frame. Default %s\n", OPT(param->bOptCUDeltaQP));
     H1("\nReconstructed video options (debugging):\n");
     H1("-r/--recon <filename>            Reconstructed raw image YUV or Y4M output file name\n");
     H1("   --recon-depth <integer>       Bit-depth of reconstructed raw image file. Defaults to input bit depth, or 8 if Y4M\n");


More information about the x265-devel mailing list