/** \file TComPicSym.cpp \brief picture symbol class */ #include "TComPicSym.h" // ==================================================================================================================== // Constructor / destructor / create / destroy // ==================================================================================================================== Void TComPicSym::create ( Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ) { UInt i; m_uhTotalDepth = uiMaxDepth; m_uiNumPartitions = 1<<(m_uhTotalDepth<<1); m_uiMaxCUWidth = uiMaxWidth; m_uiMaxCUHeight = uiMaxHeight; m_uiMinCUWidth = uiMaxWidth >> m_uhTotalDepth; m_uiMinCUHeight = uiMaxHeight >> m_uhTotalDepth; m_uiNumPartInWidth = m_uiMaxCUWidth / m_uiMinCUWidth; m_uiNumPartInHeight = m_uiMaxCUHeight / m_uiMinCUHeight; m_uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; m_uiHeightInCU = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; m_uiNumCUsInFrame = m_uiWidthInCU * m_uiHeightInCU; m_apcTComDataCU = new TComDataCU*[m_uiNumCUsInFrame]; if (m_uiNumAllocatedSlice>0) { for ( i=0; icreate( m_uiNumPartitions, m_uiMaxCUWidth, m_uiMaxCUHeight, false ); } } Void TComPicSym::destroy() { Int i; if (m_uiNumAllocatedSlice>0) { for ( i=0; idestroy(); delete m_apcTComDataCU[i]; m_apcTComDataCU[i] = NULL; } delete [] m_apcTComDataCU; m_apcTComDataCU = NULL; } Void TComPicSym::allocateNewSlice() { assert(m_uiNumCUsInFrame >= m_uiNumAllocatedSlice); m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice; } Void TComPicSym::clearSliceBuffer() { UInt i; for (i = 1; i < m_uiNumAllocatedSlice; i++) { delete m_apcTComSlice[i]; } m_uiNumAllocatedSlice = 1; }