[x265] [PATCH] frameencoder: fix for error in VPS when AccessUnitDelimeter is turned on

albert.j.wang at gmail.com albert.j.wang at gmail.com
Mon Jun 30 04:55:59 CEST 2014


# HG changeset patch
# User Albert Wang
# Date 1404096269 -28800
#      Mon Jun 30 10:44:29 2014 +0800
# Node ID b76204c1654c54ab2acb549eefb6a7f3c647a23a
# Parent  32aa6cc3cf4d108ac92f5d29258b2c38ca888d29
frameencoder: fix for error in VPS when AccessUnitDelimeter is turned on

The bitstream needs to be reset before start encode VPS, since if AU_Delimeter
is turned on, there is one byte of data left in the bitstream that will be
written wrongly into the VPS.

diff -r 32aa6cc3cf4d -r b76204c1654c source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Thu Jun 26 17:19:08 2014 -0700
+++ b/source/encoder/frameencoder.cpp	Mon Jun 30 10:44:29 2014 +0800
@@ -203,6 +203,7 @@
     TEncEntropy* entropyCoder = getEntropyCoder(0);
 
     /* headers for start of bitstream */
+    bs.resetBits();
     entropyCoder->setEntropyCoder(&m_sbacCoder, NULL);
     entropyCoder->setBitstream(&bs);
     entropyCoder->encodeVPS(&m_top->m_vps);


More information about the x265-devel mailing list