<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 25, 2018 at 7:40 PM,  <span dir="ltr"><<a href="mailto:ashok@multicorewareinc.com" target="_blank">ashok@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""># HG changeset patch<br>
# User Ashok Kumar Mishra <<a href="mailto:ashok@multicorewareinc.com">ashok@multicorewareinc.com</a>><br>
# Date 1532498266 -19800<br>
</span>#      Wed Jul 25 11:27:46 2018 +0530<br>
# Node ID 4536d8af0bc01b18aaeb21c45b3b1c<wbr>2988b3021a<br>
<span class=""># Parent  c258d214c978a5c64ec8dd3986a3b3<wbr>cc3d2381ac<br>
Fix for build error in ffmpeg<br>
<br>
</span>diff -r c258d214c978 -r 4536d8af0bc0 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt     Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/CMakeLists.txt     Wed Jul 25 11:27:46 2018 +0530<br>
@@ -29,7 +29,7 @@<br>
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
 # X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 163)<br>
+set(X265_BUILD 164)<br>
 configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
                "${PROJECT_BINARY_DIR}/x265.<wbr>def")<br>
 configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r c258d214c978 -r 4536d8af0bc0 source/common/predict.cpp<br>
<div><div class="h5">--- a/source/common/predict.cpp Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/common/predict.cpp Wed Jul 25 11:27:46 2018 +0530<br>
@@ -91,7 +91,7 @@<br>
         MV mv0 = cu.m_mv[0][pu.puAbsPartIdx];<br>
         cu.clipMv(mv0);<br>
<br>
-        if (cu.m_slice->m_pps-><wbr>bUseWeightPred && wp0->bPresentFlag)<br>
+        if (cu.m_slice->m_pps-><wbr>bUseWeightPred && wp0->wtPresent)<br>
         {<br>
             for (int plane = 0; plane < (bChroma ? 3 : 1); plane++)<br>
             {<br>
@@ -133,7 +133,7 @@<br>
             pwp0 = refIdx0 >= 0 ? cu.m_slice->m_weightPredTable[<wbr>0][refIdx0] : NULL;<br>
             pwp1 = refIdx1 >= 0 ? cu.m_slice->m_weightPredTable[<wbr>1][refIdx1] : NULL;<br>
<br>
-            if (pwp0 && pwp1 && (pwp0->bPresentFlag || pwp1->bPresentFlag))<br>
+            if (pwp0 && pwp1 && (pwp0->wtPresent || pwp1->wtPresent))<br>
             {<br>
                 /* biprediction weighting */<br>
                 for (int plane = 0; plane < (bChroma ? 3 : 1); plane++)<br>
@@ -183,7 +183,7 @@<br>
                 predInterChromaShort(pu, m_predShortYuv[1], *cu.m_slice->m_<wbr>refReconPicList[1][refIdx1], mv1);<br>
             }<br>
<br>
-            if (pwp0 && pwp1 && (pwp0->bPresentFlag || pwp1->bPresentFlag))<br>
+            if (pwp0 && pwp1 && (pwp0->wtPresent || pwp1->wtPresent))<br>
                 addWeightBi(pu, predYuv, m_predShortYuv[0], m_predShortYuv[1], wv0, wv1, bLuma, bChroma);<br>
             else<br>
                 predYuv.addAvg(m_predShortYuv[<wbr>0], m_predShortYuv[1], pu.puAbsPartIdx, pu.width, pu.height, bLuma, bChroma);<br>
@@ -193,7 +193,7 @@<br>
             MV mv0 = cu.m_mv[0][pu.puAbsPartIdx];<br>
             cu.clipMv(mv0);<br>
<br>
-            if (pwp0 && pwp0->bPresentFlag)<br>
+            if (pwp0 && pwp0->wtPresent)<br>
             {<br>
                 ShortYuv& shortYuv = m_predShortYuv[0];<br>
<br>
@@ -220,7 +220,7 @@<br>
             /* uniprediction to L1 */<br>
             X265_CHECK(refIdx1 >= 0, "refidx1 was not positive\n");<br>
<br>
-            if (pwp1 && pwp1->bPresentFlag)<br>
+            if (pwp1 && pwp1->wtPresent)<br>
             {<br>
                 ShortYuv& shortYuv = m_predShortYuv[0];<br>
<br>
</div></div>diff -r c258d214c978 -r 4536d8af0bc0 source/common/slice.cpp<br>
<span class="">--- a/source/common/slice.cpp   Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/common/slice.cpp   Wed Jul 25 11:27:46 2018 +0530<br>
@@ -138,7 +138,7 @@<br>
             for (int yuv = 0; yuv < 3; yuv++)<br>
             {<br>
                 WeightParam& wp = m_weightPredTable[l][i][yuv];<br>
-                wp.bPresentFlag = false;<br>
+                wp.wtPresent = 0;<br>
                 wp.log2WeightDenom = 0;<br>
                 wp.inputWeight = 1;<br>
                 wp.inputOffset = 0;<br>
</span>diff -r c258d214c978 -r 4536d8af0bc0 source/common/slice.h<br>
--- a/source/common/slice.h     Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/common/slice.h     Wed Jul 25 11:27:46 2018 +0530<br>
@@ -298,7 +298,7 @@<br>
<span class="">     uint32_t log2WeightDenom;<br>
     int      inputWeight;<br>
     int      inputOffset;<br>
-    bool     bPresentFlag;<br>
+    int      wtPresent;<br>
<br>
</span><span class="">     /* makes a non-h265 weight (i.e. fix7), into an h265 weight */<br>
     void setFromWeightAndOffset(int w, int o, int denom, bool bNormalize)<br>
@@ -321,7 +321,7 @@<br>
         (w).inputWeight = (s); \<br>
         (w).log2WeightDenom = (d); \<br>
         (w).inputOffset = (o); \<br>
-        (w).bPresentFlag = (b); \<br>
+        (w).wtPresent = (b); \<br>
     }<br>
<br>
 class Slice<br>
</span>diff -r c258d214c978 -r 4536d8af0bc0 source/encoder/encoder.cpp<br>
<div><div class="h5">--- a/source/encoder/encoder.cpp        Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/encoder/encoder.cpp        Wed Jul 25 11:27:46 2018 +0530<br>
@@ -1307,7 +1307,7 @@<br>
             {<br>
                 if (slice->m_sliceType == P_SLICE)<br>
                 {<br>
-                    if (slice->m_weightPredTable[0][<wbr>0][0].bPresentFlag)<br>
+                    if (slice->m_weightPredTable[0][<wbr>0][0].wtPresent)<br>
                         m_numLumaWPFrames++;<br>
                 }<br>
                 else if (slice->m_sliceType == B_SLICE)<br>
@@ -1315,7 +1315,7 @@<br>
                     bool bLuma = false;<br>
                     for (int l = 0; l < 2; l++)<br>
                     {<br>
-                        if (slice->m_weightPredTable[l][<wbr>0][0].bPresentFlag)<br>
+                        if (slice->m_weightPredTable[l][<wbr>0][0].wtPresent)<br>
                             bLuma = true;<br>
                     }<br>
                     if (bLuma)<br>
@@ -1326,10 +1326,10 @@<br>
             {<br>
                 if (slice->m_sliceType == P_SLICE)<br>
                 {<br>
-                    if (slice->m_weightPredTable[0][<wbr>0][0].bPresentFlag)<br>
+                    if (slice->m_weightPredTable[0][<wbr>0][0].wtPresent)<br>
                         m_numLumaWPFrames++;<br>
-                    if (slice->m_weightPredTable[0][<wbr>0][1].bPresentFlag ||<br>
-                        slice->m_weightPredTable[0][0]<wbr>[2].bPresentFlag)<br>
+                    if (slice->m_weightPredTable[0][<wbr>0][1].wtPresent ||<br>
+                        slice->m_weightPredTable[0][0]<wbr>[2].wtPresent)<br>
                         m_numChromaWPFrames++;<br>
                 }<br>
                 else if (slice->m_sliceType == B_SLICE)<br>
@@ -1337,10 +1337,10 @@<br>
                     bool bLuma = false, bChroma = false;<br>
                     for (int l = 0; l < 2; l++)<br>
                     {<br>
-                        if (slice->m_weightPredTable[l][<wbr>0][0].bPresentFlag)<br>
+                        if (slice->m_weightPredTable[l][<wbr>0][0].wtPresent)<br>
                             bLuma = true;<br>
-                        if (slice->m_weightPredTable[l][<wbr>0][1].bPresentFlag ||<br>
-                            slice->m_weightPredTable[l][0]<wbr>[2].bPresentFlag)<br>
+                        if (slice->m_weightPredTable[l][<wbr>0][1].wtPresent ||<br>
+                            slice->m_weightPredTable[l][0]<wbr>[2].wtPresent)<br>
                             bChroma = true;<br>
                     }<br>
<br>
</div></div>diff -r c258d214c978 -r 4536d8af0bc0 source/encoder/entropy.cpp<br>
<div><div class="h5">--- a/source/encoder/entropy.cpp        Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/encoder/entropy.cpp        Wed Jul 25 11:27:46 2018 +0530<br>
@@ -1369,8 +1369,8 @@<br>
                     }<br>
                     bDenomCoded = true;<br>
                 }<br>
-                WRITE_FLAG(wp[0].bPresentFlag, "luma_weight_lX_flag");<br>
-                totalSignalledWeightFlags += wp[0].bPresentFlag;<br>
+                WRITE_FLAG(!!wp[0].wtPresent, "luma_weight_lX_flag");<br>
+                totalSignalledWeightFlags += wp[0].wtPresent;<br>
             }<br>
<br>
             if (bChroma)<br>
@@ -1378,15 +1378,15 @@<br>
                 for (int ref = 0; ref < slice.m_numRefIdx[list]; ref++)<br>
                 {<br>
                     wp = slice.m_weightPredTable[list][<wbr>ref];<br>
-                    WRITE_FLAG(wp[1].bPresentFlag, "chroma_weight_lX_flag");<br>
-                    totalSignalledWeightFlags += 2 * wp[1].bPresentFlag;<br>
+                    WRITE_FLAG(!!wp[1].wtPresent, "chroma_weight_lX_flag");<br>
+                    totalSignalledWeightFlags += 2 * wp[1].wtPresent;<br>
                 }<br>
             }<br>
<br>
             for (int ref = 0; ref < slice.m_numRefIdx[list]; ref++)<br>
             {<br>
                 wp = slice.m_weightPredTable[list][<wbr>ref];<br>
-                if (wp[0].bPresentFlag)<br>
+                if (wp[0].wtPresent)<br>
                 {<br>
                     int deltaWeight = (wp[0].inputWeight - (1 << wp[0].log2WeightDenom));<br>
                     WRITE_SVLC(deltaWeight, "delta_luma_weight_lX");<br>
@@ -1395,7 +1395,7 @@<br>
<br>
                 if (bChroma)<br>
                 {<br>
-                    if (wp[1].bPresentFlag)<br>
+                    if (wp[1].wtPresent)<br>
                     {<br>
                         for (int plane = 1; plane < 3; plane++)<br>
                         {<br>
</div></div>diff -r c258d214c978 -r 4536d8af0bc0 source/encoder/frameencoder.<wbr>cpp<br>
<span class="">--- a/source/encoder/frameencoder.<wbr>cpp   Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/encoder/frameencoder.<wbr>cpp   Wed Jul 25 11:27:46 2018 +0530<br>
@@ -478,7 +478,7 @@<br>
         for (int ref = 0; ref < slice->m_numRefIdx[l]; ref++)<br>
         {<br>
             WeightParam *w = NULL;<br>
-            if ((bUseWeightP || bUseWeightB) && slice->m_weightPredTable[l][<wbr>ref][0].bPresentFlag)<br>
+            if ((bUseWeightP || bUseWeightB) && slice->m_weightPredTable[l][<wbr>ref][0].wtPresent)<br>
                 w = slice->m_weightPredTable[l][<wbr>ref];<br>
             slice->m_refReconPicList[l][<wbr>ref] = slice->m_refFrameList[l][ref]-<wbr>>m_reconPic;<br>
             m_mref[l][ref].init(slice->m_<wbr>refReconPicList[l][ref], w, *m_param);<br>
</span>diff -r c258d214c978 -r 4536d8af0bc0 source/encoder/reference.cpp<br>
<span class="">--- a/source/encoder/reference.cpp      Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/encoder/reference.cpp      Wed Jul 25 11:27:46 2018 +0530<br>
@@ -89,7 +89,7 @@<br>
                 cuHeight >>= reconPic->m_vChromaShift;<br>
             }<br>
<br>
-            if (wp[c].bPresentFlag)<br>
+            if (wp[c].wtPresent)<br>
             {<br>
                 if (!weightBuffer[c])<br>
                 {<br>
</span>diff -r c258d214c978 -r 4536d8af0bc0 source/encoder/slicetype.cpp<br>
<span class="">--- a/source/encoder/slicetype.cpp      Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/encoder/slicetype.cpp      Wed Jul 25 11:27:46 2018 +0530<br>
@@ -436,7 +436,7 @@<br>
     pixel *src = ref.fpelPlane[0];<br>
     intptr_t stride = fenc.lumaStride;<br>
<br>
-    if (wp.bPresentFlag)<br>
+    if (wp.wtPresent)<br>
     {<br>
         int offset = wp.inputOffset << (X265_DEPTH - 8);<br>
         int scale = wp.inputWeight;<br>
@@ -490,7 +490,7 @@<br>
     int deltaIndex = fenc.frameNum - ref.frameNum;<br>
<br>
     WeightParam wp;<br>
-    wp.bPresentFlag = false;<br>
+    wp.wtPresent = 0;<br>
<br>
     if (!wbuffer[0])<br>
     {<br>
</span>diff -r c258d214c978 -r 4536d8af0bc0 source/encoder/<wbr>weightPrediction.cpp<br>
<div><div class="h5">--- a/source/encoder/<wbr>weightPrediction.cpp       Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/encoder/<wbr>weightPrediction.cpp       Wed Jul 25 11:27:46 2018 +0530<br>
@@ -293,7 +293,7 @@<br>
         for (int plane = 0; plane < (param.internalCsp != X265_CSP_I400 ? 3 : 1); plane++)<br>
         {<br>
             denom = plane ? chromaDenom : lumaDenom;<br>
-            if (plane && !weights[0].bPresentFlag)<br>
+            if (plane && !weights[0].wtPresent)<br>
                 break;<br>
<br>
             /* Early termination */<br>
@@ -476,12 +476,12 @@<br>
             }<br>
         }<br>
<br>
-        if (weights[0].bPresentFlag)<br>
+        if (weights[0].wtPresent)<br>
         {<br>
             // Make sure both chroma channels match<br>
-            if (weights[1].bPresentFlag != weights[2].bPresentFlag)<br>
+            if (weights[1].wtPresent != weights[2].wtPresent)<br>
             {<br>
-                if (weights[1].bPresentFlag)<br>
+                if (weights[1].wtPresent)<br>
                     weights[2] = weights[1];<br>
                 else<br>
                     weights[1] = weights[2];<br>
@@ -515,15 +515,15 @@<br>
         for (int list = 0; list < numPredDir; list++)<br>
         {<br>
             WeightParam* w = &wp[list][0][0];<br>
-            if (w[0].bPresentFlag || w[1].bPresentFlag || w[2].bPresentFlag)<br>
+            if (w[0].wtPresent || w[1].wtPresent || w[2].wtPresent)<br>
             {<br>
                 bWeighted = true;<br>
                 p += sprintf(buf + p, " [L%d:R0 ", list);<br>
-                if (w[0].bPresentFlag)<br>
+                if (w[0].wtPresent)<br>
                     p += sprintf(buf + p, "Y{%d/%d%+d}", w[0].inputWeight, 1 << w[0].log2WeightDenom, w[0].inputOffset);<br>
-                if (w[1].bPresentFlag)<br>
+                if (w[1].wtPresent)<br>
                     p += sprintf(buf + p, "U{%d/%d%+d}", w[1].inputWeight, 1 << w[1].log2WeightDenom, w[1].inputOffset);<br>
-                if (w[2].bPresentFlag)<br>
+                if (w[2].wtPresent)<br>
                     p += sprintf(buf + p, "V{%d/%d%+d}", w[2].inputWeight, 1 << w[2].log2WeightDenom, w[2].inputOffset);<br>
                 p += sprintf(buf + p, "]");<br>
             }<br>
</div></div>diff -r c258d214c978 -r 4536d8af0bc0 source/x265.h<br>
<span class="">--- a/source/x265.h     Mon Jul 23 15:36:44 2018 +0530<br>
+++ b/source/x265.h     Wed Jul 25 11:27:46 2018 +0530<br>
@@ -169,7 +169,7 @@<br>
     uint32_t log2WeightDenom;<br>
     int      inputWeight;<br>
     int      inputOffset;<br>
-    bool     bPresentFlag;<br>
+    int      wtPresent;<br>
 }x265_weight_param;<br>
<br>
</span> #if X265_DEPTH < 10<br>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Pushed.</div></div>