x265-bitstream.cpp
#define MIN_FIFO_SIZE 1000
Bitstream()
bitstream的構造函數
Bitstream::Bitstream()
{
m_fifo = X265_MALLOC(uint8_t, MIN_FIFO_SIZE);
m_byteAlloc = MIN_FIFO_SIZE;
resetBits();
}
Bitstream::push_back(uint8_t val)
把int值放到fifo中,如果空間不夠,就重新分配;
void Bitstream::push_back(uint8_t val)
{
if (!m_fifo)
return;
if (m_byteOccupancy >= m_byteAlloc)
{
/** reallocate buffer with doubled size */
uint8_t *temp = X265_MALLOC(uint8_t, m_byteAlloc * 2);
if (temp)
{
memcpy(temp, m_fifo, m_byteOccupancy);
X265_FREE(m_fifo);
m_fifo = temp;
m_byteAlloc *= 2;
}
else
{
x265_lo
總結
以上是生活随笔為你收集整理的x265-bitstream.cpp的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: x265-bitstream.h
- 下一篇: x265-common.h