[x265] [PATCH] Nalwrite: removed EMULATION_SIZE macro and calculate the emulationSize from Encoded bitstream size

gopu at multicorewareinc.com gopu at multicorewareinc.com
Tue Jan 21 00:38:13 CET 2014


# HG changeset patch
# User Gopu Govindaswamy
# Date 1390260962 28800
#      Mon Jan 20 15:36:02 2014 -0800
# Node ID d46fafa164b2962694acd34f26972b40af47b4ff
# Parent  d2d62366797b2d36c4ae673728cea3b2cb5a0d43
Nalwrite: removed EMULATION_SIZE macro and calculate the emulationSize from Encoded bitstream size

diff -r d2d62366797b -r d46fafa164b2 source/Lib/TLibEncoder/NALwrite.cpp
--- a/source/Lib/TLibEncoder/NALwrite.cpp	Mon Jan 20 15:31:51 2014 -0800
+++ b/source/Lib/TLibEncoder/NALwrite.cpp	Mon Jan 20 15:36:02 2014 -0800
@@ -84,7 +84,8 @@
      */
     uint32_t fsize = nalu.m_bitstream.getByteStreamLength();
     uint8_t* fifo = nalu.m_bitstream.getFIFO();
-    uint8_t* emulation = (uint8_t*)X265_MALLOC(uint8_t, fsize + EMULATION_SIZE);
+    uint32_t  emulationSize = fsize / 2;
+    uint8_t* emulation = (uint8_t*)X265_MALLOC(uint8_t, fsize + emulationSize);
     uint32_t nalsize = 0;
 
     if (emulation)


More information about the x265-devel mailing list