[x265] [PATCH] fix bug in SEI::write clean up
santhoshini at multicorewareinc.com
santhoshini at multicorewareinc.com
Fri Mar 30 05:44:55 CEST 2018
# HG changeset patch
# User Santhoshini Sekar <santhoshini at multicorewareinc.com>
# Date 1522314350 -19800
# Thu Mar 29 14:35:50 2018 +0530
# Node ID 22aa607166e0a9917b923b6b21b775055fc708fd
# Parent 1fafca24a3990106ecf203afc4e900fa0eddfbe1
fix bug in SEI::write clean up
diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp
+++ b/source/encoder/encoder.cpp
@@ -2332,7 +2332,7 @@
bs.resetBits();
SEIuserDataUnregistered idsei;
idsei.m_userData = (uint8_t*)buffer;
- idsei.setSize((uint32_t)strlen(buffer) + 16);
+ idsei.setSize((uint32_t)strlen(buffer));
idsei.write(bs, m_sps);
bs.writeByteAlignment();
list.serialize(NAL_UNIT_PREFIX_SEI, bs);
@@ -2350,9 +2350,9 @@
SEIActiveParameterSets sei;
sei.m_selfContainedCvsFlag = true;
sei.m_noParamSetUpdateFlag = true;
+ bs.resetBits();
int payloadSize = sei.countPayloadSize(m_sps);
sei.setSize(payloadSize);
- bs.resetBits();
sei.write(bs, m_sps);
bs.writeByteAlignment();
list.serialize(NAL_UNIT_PREFIX_SEI, bs);
diff --git a/source/encoder/frameencoder.cpp b/source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp
+++ b/source/encoder/frameencoder.cpp
@@ -633,9 +633,9 @@
bpSei->m_dpbDelayOffset = 0;
// hrdFullness() calculates the initial CPB removal delay and offset
m_top->m_rateControl->hrdFullness(bpSei);
+ m_bs.resetBits();
int payloadSize = bpSei->countPayloadSize(*slice->m_sps);
bpSei->setSize(payloadSize);
- m_bs.resetBits();
bpSei->write(m_bs, *slice->m_sps);
m_bs.writeByteAlignment();
@@ -651,8 +651,8 @@
sei.m_recoveryPocCnt = 0;
sei.m_exactMatchingFlag = true;
sei.m_brokenLinkFlag = false;
+ m_bs.resetBits();
sei.setSize(sei.countPayloadSize(*slice->m_sps));
- m_bs.resetBits();
sei.write(m_bs, *slice->m_sps);
m_bs.writeByteAlignment();
m_nalList.serialize(NAL_UNIT_PREFIX_SEI, m_bs);
@@ -704,7 +704,7 @@
SEIuserDataUnregistered sei;
sei.m_userData = payload->payload;
m_bs.resetBits();
- sei.setSize(payload->payloadSize + 16);
+ sei.setSize(payload->payloadSize);
sei.write(m_bs, *slice->m_sps);
m_bs.writeByteAlignment();
m_nalList.serialize(NAL_UNIT_PREFIX_SEI, m_bs);
diff --git a/source/encoder/sei.cpp b/source/encoder/sei.cpp
--- a/source/encoder/sei.cpp
+++ b/source/encoder/sei.cpp
@@ -51,6 +51,8 @@
uint32_t type = m_payloadType;
m_bitIf = &bs;
uint32_t payloadSize = m_payloadSize;
+ if (m_payloadType == USER_DATA_UNREGISTERED)
+ payloadSize = m_payloadSize + 16;
uint32_t payloadType = m_payloadType;
for (; payloadType >= 0xff; payloadType -= 0xff)
WRITE_CODE(0xff, 8, "payload_type");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265.patch
Type: text/x-patch
Size: 3132 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180330/3d95ff90/attachment.bin>
More information about the x265-devel
mailing list