[x265] [PATCH] faster grow buffer size to reduce number of memcpy
Min Chen
chenm003 at 163.com
Tue Oct 15 14:34:19 CEST 2013
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1381840284 -28800
# Node ID 67e0b25b7cd380dcddc4e541d329749e0923ffc4
# Parent edccd210d53260d0807bf7539d060262694b5561
faster grow buffer size to reduce number of memcpy
diff -r edccd210d532 -r 67e0b25b7cd3 source/Lib/TLibCommon/TComBitStream.cpp
--- a/source/Lib/TLibCommon/TComBitStream.cpp Tue Oct 15 20:31:05 2013 +0800
+++ b/source/Lib/TLibCommon/TComBitStream.cpp Tue Oct 15 20:31:24 2013 +0800
@@ -212,7 +212,7 @@
}
else
{
- buffsize += MIN_FIFO_SIZE;
+ buffsize *= 2;
/** FIFO size is Reached into MIN_FIFO_SIZE then Reallocate the FIFO and Copy the fifo to new memory
location and continue to push encoded bit streams */
uint8_t *temp = (uint8_t *)X265_MALLOC(uint8_t, buffsize);
More information about the x265-devel
mailing list