[x265] [PATCH] silence MSVC warning C4334

Ma0 mateuszb at poczta.onet.pl
Fri Oct 13 00:06:51 CEST 2017


# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1507845626 -7200
#      Fri Oct 13 00:00:26 2017 +0200
# Node ID 600c3dbe372ad82f3e92800fbaff63492958eb00
# Parent  0e168bdeb48b3d57d896d3823e2efb2bf69d4b26
silence MSVC warning C4334

warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits

diff -r 0e168bdeb48b -r 600c3dbe372a source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon Oct 09 12:34:25 2017 +0530
+++ b/source/encoder/analysis.cpp	Fri Oct 13 00:00:26 2017 +0200
@@ -309,8 +309,8 @@
 
             if (ctu.m_predMode[puabsPartIdx + absPartIdx] == MODE_SKIP)
             {
-                ctu.m_encData->m_frameStats.cntSkipPu[depth] += (uint64_t)(1 << shift);
-                ctu.m_encData->m_frameStats.totalPu[depth] += (uint64_t)(1 << shift);
+                ctu.m_encData->m_frameStats.cntSkipPu[depth] += 1ULL << shift;
+                ctu.m_encData->m_frameStats.totalPu[depth] += 1ULL << shift;
             }
             else if (ctu.m_predMode[puabsPartIdx + absPartIdx] == MODE_INTRA)
             {
@@ -321,14 +321,14 @@
                 }
                 else
                 {
-                    ctu.m_encData->m_frameStats.cntIntraPu[depth] += (uint64_t)(1 << shift);
-                    ctu.m_encData->m_frameStats.totalPu[depth] += (uint64_t)(1 << shift);
+                    ctu.m_encData->m_frameStats.cntIntraPu[depth] += 1ULL << shift;
+                    ctu.m_encData->m_frameStats.totalPu[depth] += 1ULL << shift;
                 }
             }
             else if (mode == 3)
             {
-                ctu.m_encData->m_frameStats.cntAmp[depth] += (uint64_t)(1 << shift);
-                ctu.m_encData->m_frameStats.totalPu[depth] += (uint64_t)(1 << shift);
+                ctu.m_encData->m_frameStats.cntAmp[depth] += 1ULL << shift;
+                ctu.m_encData->m_frameStats.totalPu[depth] += 1ULL << shift;
                 break;
             }
             else


More information about the x265-devel mailing list