Question

I am using HM 12.1 reference code. My task is to find PU dimensions(both symmetric and asymmetric) from an encoded h.265 bit stream.
In TLibDecoder > TDecEntropy.cpp > decodePUWise function, I inserted a printf statement to print the dimensions, but it does not seem to give the correct answer. Pls help!


for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) { printf("%d X %d\n", pcCU->getHeight(uiSubPartIdx), pcCU->getWidth(uiSubPartIdx)); /* I put this code */

  decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
  ....
  ....

Was it helpful?

Solution

There are 8 types of PUs in HEVC version 1 such as 2Nx2N, Nx2N, 2NxN, NxN, 2NxnU, 2NxnD, nRx2N, and nLx2N. You can see the PU types from the m_pePartSize in pcCU (TComDataCU* structure)

I recommend to refer xSetEdgefilterPU function in TComLoopFilter.cpp You can see how to check the type of PU

switch ( pcCU->getPartitionSize( uiAbsZorderIdx )) {
case SIZE_2Nx2N:
{
  break;
}
case SIZE_2NxN:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_HOR, uiHHeightInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
case SIZE_Nx2N:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_VER, uiHWidthInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
case SIZE_NxN:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_VER, uiHWidthInBaseUnits, m_stLFCUParam.bInternalEdge );
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_HOR, uiHHeightInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
case SIZE_2NxnU:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_HOR, uiQHeightInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
case SIZE_2NxnD:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_HOR, uiHeightInBaseUnits - uiQHeightInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
case SIZE_nLx2N:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_VER, uiQWidthInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
case SIZE_nRx2N:
{
  xSetEdgefilterMultiple( pcCU, uiAbsZorderIdx, uiDepth, EDGE_VER, uiWidthInBaseUnits - uiQWidthInBaseUnits, m_stLFCUParam.bInternalEdge );
  break;
}
default:
{
  break;
}  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top