[x265-commits] [x265] rdcost: fix checked build warnings, nits

Min Chen chenm003 at 163.com
Sun Sep 20 03:21:00 CEST 2015


details:   http://hg.videolan.org/x265/rev/57f027dfb308
branches:  
changeset: 10991:57f027dfb308
user:      Min Chen <chenm003 at 163.com>
date:      Fri Sep 18 18:53:46 2015 -0500
description:
rdcost: fix checked build warnings, nits

diffstat:

 source/encoder/rdcost.h |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 5dde4773fcef -r 57f027dfb308 source/encoder/rdcost.h
--- a/source/encoder/rdcost.h	Fri Sep 18 11:49:00 2015 -0500
+++ b/source/encoder/rdcost.h	Fri Sep 18 18:53:46 2015 -0500
@@ -90,13 +90,15 @@ public:
 
     inline uint64_t calcRdCost(sse_ret_t distortion, uint32_t bits) const
     {
+#if X265_DEPTH <= 10
         X265_CHECK(bits <= (UINT64_MAX - 128) / m_lambda2,
-#if X265_DEPTH <= 10
                    "calcRdCost wrap detected dist: %u, bits %u, lambda: " X265_LL "\n",
+                   distortion, bits, m_lambda2);
 #else
+        X265_CHECK(bits <= (UINT64_MAX - 128) / m_lambda2,
                    "calcRdCost wrap detected dist: " X265_LL ", bits %u, lambda: " X265_LL "\n",
+                   distortion, bits, m_lambda2);
 #endif
-                   distortion, bits, m_lambda2);
         return distortion + ((bits * m_lambda2 + 128) >> 8);
     }
 
@@ -127,13 +129,15 @@ public:
 
     inline sse_ret_t scaleChromaDist(uint32_t plane, sse_ret_t dist) const
     {
+#if X265_DEPTH <= 10
         X265_CHECK(dist <= (UINT64_MAX - 128) / m_chromaDistWeight[plane - 1],
-#if X265_DEPTH <= 10
                    "scaleChromaDist wrap detected dist: %u, lambda: %u\n",
+                   dist, m_chromaDistWeight[plane - 1]);
 #else
+        X265_CHECK(dist <= (UINT64_MAX - 128) / m_chromaDistWeight[plane - 1],
                    "scaleChromaDist wrap detected dist: " X265_LL " lambda: %u\n",
+                   dist, m_chromaDistWeight[plane - 1]);
 #endif
-                   dist, m_chromaDistWeight[plane - 1]);
         return (sse_ret_t)((dist * (uint64_t)m_chromaDistWeight[plane - 1] + 128) >> 8);
     }
 


More information about the x265-commits mailing list