<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 25, 2017 at 6:47 PM,  <span dir="ltr"><<a href="mailto:bhavna@multicorewareinc.com" target="_blank">bhavna@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Bhavna Hariharan <<a href="mailto:bhavna@multicorewareinc.com">bhavna@multicorewareinc.com</a>><br>
# Date 1495523574 -19800<br>
#      Tue May 23 12:42:54 2017 +0530<br>
# Node ID 38e7a4373f26b463e13107ff24dc92<wbr>440a5fc119<br>
# Parent  355cf3582263acc9bbcb8faa24f1df<wbr>a009f41de3<br>
Support high payload size<br></blockquote><div><br></div><div>Pushed to default.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r 355cf3582263 -r 38e7a4373f26 source/dynamicHDR10/<wbr>metadataFromJson.cpp<br>
--- a/source/dynamicHDR10/<wbr>metadataFromJson.cpp  Mon May 22 12:05:24 2017 +0530<br>
+++ b/source/dynamicHDR10/<wbr>metadataFromJson.cpp  Tue May 23 12:42:54 2017 +0530<br>
@@ -168,7 +168,7 @@<br>
     {<br>
         int payloadBytes = 1;<br>
<br>
-        for(;payload > 0xFF; payload -= 0xFF, ++payloadBytes);<br>
+        for(;payload >= 0xFF; payload -= 0xFF, ++payloadBytes);<br>
<br>
         if(payloadBytes > 1)<br>
         {<br>
diff -r 355cf3582263 -r 38e7a4373f26 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Mon May 22 12:05:24 2017 +0530<br>
+++ b/source/encoder/encoder.cpp        Tue May 23 12:42:54 2017 +0530<br>
@@ -607,8 +607,13 @@<br>
             uint8_t *cim = NULL;<br>
             if (m_hdr10plus_api->hdr10plus_<wbr>json_to_frame_cim(m_param-><wbr>toneMapFile, pic_in->poc, cim))<br>
             {<br>
-                toneMap.payload = (uint8_t*)x265_malloc(sizeof(<wbr>uint8_t) * cim[0]);<br>
-                toneMap.payloadSize = cim[0];<br>
+                int32_t i = 0;<br>
+                toneMap.payloadSize = 0;<br>
+                while (cim[i] == 0xFF)<br>
+                    toneMap.payloadSize += cim[i++] + 1;<br>
+                toneMap.payloadSize += cim[i] + 1;<br>
+<br>
+                toneMap.payload = (uint8_t*)x265_malloc(sizeof(<wbr>uint8_t) * toneMap.payloadSize);<br>
                 toneMap.payloadType = USER_DATA_REGISTERED_ITU_T_<wbr>T35;<br>
                 memcpy(toneMap.payload, cim, toneMap.payloadSize);<br>
             }<br>
diff -r 355cf3582263 -r 38e7a4373f26 source/encoder/sei.h<br>
--- a/source/encoder/sei.h      Mon May 22 12:05:24 2017 +0530<br>
+++ b/source/encoder/sei.h      Tue May 23 12:42:54 2017 +0530<br>
@@ -289,12 +289,10 @@<br>
         while (cim[i] == 0xFF)<br>
         {<br>
             i++;<br>
-            payloadSize += cim[i];<br>
             WRITE_CODE(0xFF, 8, "payload_size");<br>
         }<br>
-        WRITE_CODE(payloadSize, 8, "payload_size");<br>
+        WRITE_CODE(cim[i], 8, "payload_size");<br>
         i++;<br>
-        payloadSize += i;<br>
         for (; i < payloadSize; ++i)<br>
             WRITE_CODE(cim[i], 8, "creative_intent_metadata");<br>
     }<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>