[x265] [PATCH] Fix payload size for SEIRecoveryPoint

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Fri Mar 16 11:54:56 CET 2018


# HG changeset patch
# User Aarthi Thirumalai <aarthi at multicorewareinc.com>
# Date 1521028474 -19800
#      Wed Mar 14 17:24:34 2018 +0530
# Node ID 265d516af978a209bd22a6ae43487cecd01c4503
# Parent  d7c26df32fae052b7e895fee9bda1c22b24cc44b
Fix payload size for SEIRecoveryPoint

diff -r d7c26df32fae -r 265d516af978 source/encoder/sei.cpp
--- a/source/encoder/sei.cpp	Tue Mar 13 13:40:13 2018 +0530
+++ b/source/encoder/sei.cpp	Wed Mar 14 17:24:34 2018 +0530
@@ -41,8 +41,9 @@
     uint32_t type = m_payloadType;
     m_bitIf = &bs;
     BitCounter count;
+    uint32_t payloadSize = m_payloadSize;
     bool hrdTypes = (m_payloadType == ACTIVE_PARAMETER_SETS || m_payloadType == PICTURE_TIMING || m_payloadType == BUFFERING_PERIOD);
-    if (hrdTypes)
+    if (hrdTypes || m_payloadType == RECOVERY_POINT)
     {
         m_bitIf = &count;
         /* virtual writeSEI method, write to bit counter to determine size */
@@ -53,10 +54,10 @@
             WRITE_CODE(0xff, 8, "payload_type");
     }
     WRITE_CODE(type, 8, "payload_type");
-    uint32_t payloadSize;
-    if (hrdTypes || m_payloadType == USER_DATA_UNREGISTERED || m_payloadType == USER_DATA_REGISTERED_ITU_T_T35)
+    if (hrdTypes || m_payloadType == USER_DATA_UNREGISTERED || m_payloadType == USER_DATA_REGISTERED_ITU_T_T35 ||
+        m_payloadType == RECOVERY_POINT)
     {
-        if (hrdTypes)
+        if (hrdTypes || m_payloadType == RECOVERY_POINT)
         {
             X265_CHECK(0 == (count.getNumberOfWrittenBits() & 7), "payload unaligned\n");
             payloadSize = count.getNumberOfWrittenBits() >> 3;
@@ -65,13 +66,10 @@
             payloadSize = m_payloadSize + 16;
         else
             payloadSize = m_payloadSize;
-
-        for (; payloadSize >= 0xff; payloadSize -= 0xff)
-            WRITE_CODE(0xff, 8, "payload_size");
-        WRITE_CODE(payloadSize, 8, "payload_size");
     }
-    else
-        WRITE_CODE(m_payloadSize, 8, "payload_size");
+    for (; payloadSize >= 0xff; payloadSize -= 0xff)
+        WRITE_CODE(0xff, 8, "payload_size");
+    WRITE_CODE(payloadSize, 8, "payload_size");
     /* virtual writeSEI method, write to bs */
     writeSEI(sps);
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265.patch
Type: text/x-patch
Size: 2169 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180316/8e331e14/attachment.bin>


More information about the x265-devel mailing list