[x265] [PATCH RFC] cli: introduce new option --[no]-b-intra which enable/disable intra process in B frames

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Fri May 16 11:04:06 CEST 2014


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1400230861 -19800
# Node ID d2ba63943099454a972d0de343eff5e5dc54d058
# Parent  48af10fff12b5b29f835303312fe061a489e8be4
cli: introduce new option --[no]-b-intra which enable/disable intra process in B frames

disable intra in B frame process either through --[no]-b-intra or --tune fastdecode option
by default it is enabled
in higher rd level(6 and 5), intra in B frame is disabled through above option
in lower rd levels(4,3,...0), it is disabled by default

diff -r 48af10fff12b -r d2ba63943099 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Fri May 16 10:42:23 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Fri May 16 14:31:01 2014 +0530
@@ -887,10 +887,10 @@
 
             // do normal intra modes
             // speedup for inter frames
-            if (slice->getSliceType() == I_SLICE ||
+            if ((slice->getSliceType() == I_SLICE ||
                 outBestCU->getCbf(0, TEXT_LUMA) != 0   ||
                 outBestCU->getCbf(0, TEXT_CHROMA_U) != 0   ||
-                outBestCU->getCbf(0, TEXT_CHROMA_V) != 0) // avoid very complex intra if it is unlikely
+                outBestCU->getCbf(0, TEXT_CHROMA_V) != 0) && m_param->bIntraInBFrames) // avoid very complex intra if it is unlikely
             {
                 xCheckRDCostIntraInInter(outBestCU, outTempCU, SIZE_2Nx2N);
                 outTempCU->initEstData(depth);
diff -r 48af10fff12b -r d2ba63943099 source/common/param.cpp
--- a/source/common/param.cpp	Fri May 16 10:42:23 2014 +0530
+++ b/source/common/param.cpp	Fri May 16 14:31:01 2014 +0530
@@ -157,6 +157,7 @@
     param->crQpOffset = 0;
     param->rdPenalty = 0;
     param->psyRd = 0.0;
+    param->bIntraInBFrames = 1;
 
     /* Rate control options */
     param->rc.vbvMaxBitrate = 0;
@@ -384,6 +385,7 @@
             param->bEnableSAO = 0;
             param->bEnableWeightedPred = 0;
             param->bEnableWeightedBiPred = 0;
+            param->bIntraInBFrames = 0;
         }
         else if (!strcmp(tune, "zerolatency") ||
                  !strcmp(tune, "zero-latency"))
@@ -591,6 +593,7 @@
     OPT("rd") p->rdLevel = atoi(value);
     OPT("psy-rd") p->psyRd = atof(value);
     OPT("signhide") p->bEnableSignHiding = atobool(value);
+    OPT("b-intra") p->bIntraInBFrames = atobool(value);
     OPT("lft") p->bEnableLoopFilter = atobool(value);
     OPT("sao") p->bEnableSAO = atobool(value);
     OPT("sao-lcu-bounds") p->saoLcuBoundary = atoi(value);
diff -r 48af10fff12b -r d2ba63943099 source/x265.cpp
--- a/source/x265.cpp	Fri May 16 10:42:23 2014 +0530
+++ b/source/x265.cpp	Fri May 16 14:31:01 2014 +0530
@@ -174,6 +174,8 @@
     { "aud",                  no_argument, NULL, 0 },
     { "no-aud",               no_argument, NULL, 0 },
     { "qpfile",         required_argument, NULL, 0 },
+    { "b-intra",              no_argument, NULL, 0 },
+    { "no-b-intra",           no_argument, NULL, 0 },
     { 0, 0, 0, 0 }
 };
 
@@ -382,6 +384,7 @@
     H0("   --rd <0..6>                   Level of RD in mode decision 0:least....6:full RDO. Default %d\n", param->rdLevel);
     H0("   --psy-rd <0..2.0>             Strength of psycho-visual optimization. Default %f\n", param->psyRd);
     H0("   --[no-]signhide               Hide sign bit of one coeff per TU (rdo). Default %s\n", OPT(param->bEnableSignHiding));
+    H0("   --[no-]b-intra                Enable intra in B frames. Default %s\n", OPT(param->bIntraInBFrames));
     H0("\nLoop filters (deblock and SAO):\n");
     H0("   --[no-]lft                    Enable Deblocking Loop Filter. Default %s\n", OPT(param->bEnableLoopFilter));
     H0("   --[no-]sao                    Enable Sample Adaptive Offset. Default %s\n", OPT(param->bEnableSAO));
diff -r 48af10fff12b -r d2ba63943099 source/x265.h
--- a/source/x265.h	Fri May 16 10:42:23 2014 +0530
+++ b/source/x265.h	Fri May 16 14:31:01 2014 +0530
@@ -640,6 +640,10 @@
      * Default is 0, which is recommended */
     int       crQpOffset;
 
+    /*  Specify whether to perform intra in B frames. by default enabled, 
+     * disable it when --tune fastdecode is specified */
+    int       bIntraInBFrames;
+
     /*== Rate Control ==*/
 
     struct


More information about the x265-devel mailing list