Hevc/h265 hm10.0 Analysis (2) tcomdatacu. cpp

Source: Internet
Author: User

The following is an analysis of tcomdatacu. cpp. This CPP is very important and should be analyzed several times. This is the analysis of tcomdatacu. cpp (1 ).

Void TComDataCU::getPartPosition( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH){  UInt col = m_uiCUPelX;  UInt row = m_uiCUPelY;  switch ( m_pePartSize[0] )  {  case SIZE_2NxN:    nPSW = getWidth(0);          nPSH = getHeight(0) >> 1;     xP   = col;    yP   = (partIdx ==0)? row: row + nPSH;    break;  case SIZE_Nx2N:    nPSW = getWidth(0) >> 1;     nPSH = getHeight(0);          xP   = (partIdx ==0)? col: col + nPSW;    yP   = row;    break;  case SIZE_NxN:    nPSW = getWidth(0) >> 1;     nPSH = getHeight(0) >> 1;     xP   = col + (partIdx&0x1)*nPSW;    yP   = row + (partIdx>>1)*nPSH;    break;  case SIZE_2NxnU:    nPSW = getWidth(0);    nPSH = ( partIdx == 0 ) ?  getHeight(0) >> 2 : ( getHeight(0) >> 2 ) + ( getHeight(0) >> 1 );    xP   = col;    yP   = (partIdx ==0)? row: row + getHeight(0) - nPSH;    break;  case SIZE_2NxnD:    nPSW = getWidth(0);    nPSH = ( partIdx == 0 ) ?  ( getHeight(0) >> 2 ) + ( getHeight(0) >> 1 ) : getHeight(0) >> 2;    xP   = col;    yP   = (partIdx ==0)? row: row + getHeight(0) - nPSH;    break;  case SIZE_nLx2N:    nPSW = ( partIdx == 0 ) ? getWidth(0) >> 2 : ( getWidth(0) >> 2 ) + ( getWidth(0) >> 1 );    nPSH = getHeight(0);    xP   = (partIdx ==0)? col: col + getWidth(0) - nPSW;    yP   = row;    break;  case SIZE_nRx2N:    nPSW = ( partIdx == 0 ) ? ( getWidth(0) >> 2 ) + ( getWidth(0) >> 1 ) : getWidth(0) >> 2;    nPSH = getHeight(0);    xP   = (partIdx ==0)? col: col + getWidth(0) - nPSW;    yP   = row;    break;  default:    assert ( m_pePartSize[0] == SIZE_2Nx2N );    nPSW = getWidth(0);          nPSH = getHeight(0);          xP   = col ;    yP   = row ;    break;  }}

In 2n * n, 2n * Nu, 2n * nd, the preceding partidx is 0, and the following part is 1;

In N * 2n, NL * 2n, NR * 2n, partidx on the left is 0, and 1 on the right;

In N * n, based on the quad-tree structure, partidx is 0, 1, 2, and 3, respectively;

In 2n * 2n, partidx can only be 0;

The value of XP and YP is the absolute position value in the upper left corner of the Cu block. npsw and npsh are the width and height of the current Cu block. Remember, Cu can be nested and Cu contains Cu, therefore, XP, YP, npsw, and npsh can uniquely determine the Cu block,

Limited by the time relationship, this is the first analysis today.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.