[x265-commits] [x265] ratecontrol: remove dead code

Deepthi Nandakumar deepthi at multicorewareinc.com
Wed Apr 9 18:16:08 CEST 2014


details:   http://hg.videolan.org/x265/rev/6284b30a0fdd
branches:  
changeset: 6680:6284b30a0fdd
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Wed Apr 09 13:57:24 2014 +0530
description:
ratecontrol: remove dead code

Imported from x264; likely a part of 2-pass. In any case, not relevant here.
Subject: [x265] level: remove conditional expression warning

details:   http://hg.videolan.org/x265/rev/7f62dfabe319
branches:  
changeset: 6681:7f62dfabe319
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Wed Apr 09 14:01:41 2014 +0530
description:
level: remove conditional expression warning
Subject: [x265] ratecontrol: partial backout of 6284b30a0fdd, get rid of debugging notes.

details:   http://hg.videolan.org/x265/rev/bdca492dc1d7
branches:  
changeset: 6682:bdca492dc1d7
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Wed Apr 09 14:06:29 2014 +0530
description:
ratecontrol: partial backout of 6284b30a0fdd, get rid of debugging notes.
Subject: [x265] level: fix MSVC compile error, give sqrt() argument unambiguous data type

details:   http://hg.videolan.org/x265/rev/bd987db26d5d
branches:  
changeset: 6683:bd987db26d5d
user:      Steve Borho <steve at borho.org>
date:      Wed Apr 09 11:15:33 2014 -0500
description:
level: fix MSVC compile error, give sqrt() argument unambiguous data type

diffstat:

 source/encoder/level.cpp       |  12 ++++++------
 source/encoder/ratecontrol.cpp |  11 +++--------
 2 files changed, 9 insertions(+), 14 deletions(-)

diffs (66 lines):

diff -r 15471ecb08d8 -r bd987db26d5d source/encoder/level.cpp
--- a/source/encoder/level.cpp	Mon Apr 07 12:23:01 2014 -0500
+++ b/source/encoder/level.cpp	Wed Apr 09 11:15:33 2014 -0500
@@ -102,9 +102,9 @@ void determineLevel(const x265_param &pa
             continue;
         else if (bitrate > levels[i].maxBitrateHigh)
             continue;
-        else if (param.sourceWidth > sqrt(levels[i].maxLumaSamples * 8))
+        else if (param.sourceWidth > sqrt(levels[i].maxLumaSamples * 8.0f))
             continue;
-        else if (param.sourceHeight > sqrt(levels[i].maxLumaSamples * 8))
+        else if (param.sourceHeight > sqrt(levels[i].maxLumaSamples * 8.0f))
             continue;
 
         int maxDpbSize = MaxDpbPicBuf;
@@ -154,9 +154,9 @@ void enforceLevel(x265_param& param, int
     bool ok = true;
     if (lumaSamples > l.maxLumaSamples)
         ok = false;
-    else if (param.sourceWidth > sqrt(l.maxLumaSamples * 8))
+    else if (param.sourceWidth > sqrt(l.maxLumaSamples * 8.0f))
         ok = false;
-    else if (param.sourceHeight > sqrt(l.maxLumaSamples * 8))
+    else if (param.sourceHeight > sqrt(l.maxLumaSamples * 8.0f))
         ok = false;
     if (!ok)
         x265_log(&param, X265_LOG_WARNING, "picture dimensions are out of range for specified level\n");
@@ -184,7 +184,8 @@ void enforceLevel(x265_param& param, int
         maxDpbSize = X265_MIN((4 * MaxDpbPicBuf) / 3, 16);
     int savedRefCount = param.maxNumReferences;
 
-    do {
+    for(; ;)
+    {
         int numReorderPics = (param.bBPyramid && param.bframes > 1) ? 2 : 1;
         int maxDecPicBuffering = X265_MIN(MAX_NUM_REF, X265_MAX(numReorderPics + 1, param.maxNumReferences) + numReorderPics);
 
@@ -193,7 +194,6 @@ void enforceLevel(x265_param& param, int
         else
             break;
     }
-    while (1);
 
     if (param.maxNumReferences != savedRefCount)
     {
diff -r 15471ecb08d8 -r bd987db26d5d source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Mon Apr 07 12:23:01 2014 -0500
+++ b/source/encoder/ratecontrol.cpp	Wed Apr 09 11:15:33 2014 -0500
@@ -958,14 +958,9 @@ double RateControl::getQScale(RateContro
     else
         q = pow(rce->blurredComplexity, 1 - param->rc.qCompress);
 
-    // avoid NaN's in the rc_eq
-    if (rce->texBits + rce->mvBits == 0)
-        q = lastQScaleFor[rce->sliceType];
-    else
-    {
-        lastRceq = q;
-        q /= rateFactor;
-    }
+    lastRceq = q;
+    q /= rateFactor;
+   
     return q;
 }
 


More information about the x265-commits mailing list