Ticket #101: getPartIndexAndSize_with_uiAbsPartIdx.txt

File getPartIndexAndSize_with_uiAbsPartIdx.txt, 2.1 KB (added by nsprljan, 11 years ago)
Line 
1Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx )
2{
3  switch ( m_pePartSize[uiAbsPartIdx] )
4  {
5    case SIZE_2Nx2N: riWidth = getWidth(uiAbsPartIdx);      riHeight = getHeight(uiAbsPartIdx);      ruiPartAddr = 0;                                             break;
6    case SIZE_2NxN:  riWidth = getWidth(uiAbsPartIdx);      riHeight = getHeight(uiAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : m_uiNumPartition >> 1; break;
7    case SIZE_Nx2N:  riWidth = getWidth(uiAbsPartIdx) >> 1; riHeight = getHeight(uiAbsPartIdx);      ruiPartAddr = ( uiPartIdx == 0 )? 0 : m_uiNumPartition >> 2; break;
8    case SIZE_NxN:   riWidth = getWidth(uiAbsPartIdx) >> 1; riHeight = getHeight(uiAbsPartIdx) >> 1; ruiPartAddr = ( m_uiNumPartition >> 2 ) * uiPartIdx;         break;
9    case SIZE_2NxnU:
10      riWidth     = getWidth(uiAbsPartIdx);
11      riHeight    = ( uiPartIdx == 0 ) ?  getHeight(uiAbsPartIdx) >> 2 : ( getHeight(uiAbsPartIdx) >> 2 ) + ( getHeight(uiAbsPartIdx) >> 1 );
12      ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : m_uiNumPartition >> 3;
13      break;
14    case SIZE_2NxnD:
15      riWidth     = getWidth(uiAbsPartIdx);
16      riHeight    = ( uiPartIdx == 0 ) ?  ( getHeight(uiAbsPartIdx) >> 2 ) + ( getHeight(uiAbsPartIdx) >> 1 ) : getHeight(uiAbsPartIdx) >> 2;
17      ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (m_uiNumPartition >> 1) + (m_uiNumPartition >> 3);
18      break;
19    case SIZE_nLx2N:
20      riWidth     = ( uiPartIdx == 0 ) ? getWidth(uiAbsPartIdx) >> 2 : ( getWidth(uiAbsPartIdx) >> 2 ) + ( getWidth(uiAbsPartIdx) >> 1 );
21      riHeight    = getHeight(uiAbsPartIdx);
22      ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : m_uiNumPartition >> 4;
23      break;
24    case SIZE_nRx2N:
25      riWidth     = ( uiPartIdx == 0 ) ? ( getWidth(uiAbsPartIdx) >> 2 ) + ( getWidth(uiAbsPartIdx) >> 1 ) : getWidth(uiAbsPartIdx) >> 2;
26      riHeight    = getHeight(uiAbsPartIdx);
27      ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (m_uiNumPartition >> 2) + (m_uiNumPartition >> 4);
28      break;
29    default: assert (uiAbsPartIdx); break;
30  }
31}