Changeset 1081 in 3DVCSoftware for branches/HTM-12.1-dev0/source/Lib/TLibCommon


Ignore:
Timestamp:
22 Oct 2014, 01:32:55 (11 years ago)
Author:
tech
Message:

Update to HTM-15.0

Location:
branches/HTM-12.1-dev0/source/Lib/TLibCommon
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/CommonDef.h

    r1067 r1081  
    6161#if H_MV
    6262#define NV_VERSION        "12.1"                ///< Current software version
    63 #define HM_VERSION        "14.0"                ///<
     63#define HM_VERSION        "15.0"                ///<
    6464#else
    6565#define NV_VERSION        "14.0"                 ///< Current software version
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/SEI.h

    r964 r1081  
    161161  UInt m_bpSeqParameterSetId;
    162162  Bool m_rapCpbParamsPresentFlag;
    163   Bool m_cpbDelayOffset;
    164   Bool m_dpbDelayOffset;
     163  UInt m_cpbDelayOffset;
     164  UInt m_dpbDelayOffset;
    165165  UInt m_initialCpbRemovalDelay         [MAX_CPB_CNT][2];
    166166  UInt m_initialCpbRemovalDelayOffset   [MAX_CPB_CNT][2];
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComPicSym.cpp

    r872 r1081  
    3838#include "TComPicSym.h"
    3939#include "TComSampleAdaptiveOffset.h"
     40#include "TComSlice.h"
    4041
    4142//! \ingroup TLibCommon
     
    6364,m_iNumColumnsMinus1 (0)
    6465,m_iNumRowsMinus1(0)
    65 ,m_apcTComTile(NULL)
    6666,m_puiCUOrderMap(0)
    6767,m_puiTileIdxMap(NULL)
     
    101101    delete [] m_apcTComSlice;
    102102  }
    103   m_apcTComSlice      = new TComSlice*[m_uiNumCUsInFrame*m_uiNumPartitions]; 
     103  m_apcTComSlice      = new TComSlice*[m_uiNumCUsInFrame];
    104104  m_apcTComSlice[0]   = new TComSlice;
    105105  m_uiNumAllocatedSlice = 1;
     
    148148  m_apcTComDataCU = NULL;
    149149
    150   for(Int i = 0; i < (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )
    151   {
    152     delete m_apcTComTile[i];
    153   }
    154   delete [] m_apcTComTile;
    155 
    156   m_apcTComTile = NULL;
    157 
    158150  delete [] m_puiCUOrderMap;
    159151  m_puiCUOrderMap = NULL;
     
    173165Void TComPicSym::allocateNewSlice()
    174166{
     167  assert ((m_uiNumAllocatedSlice + 1) <= m_uiNumCUsInFrame);
    175168  m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice;
    176169  if (m_uiNumAllocatedSlice>=2)
     
    201194}
    202195
    203 Void TComPicSym::xCreateTComTileArray()
    204 {
    205   m_apcTComTile = new TComTile*[(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)];
    206   for( UInt i=0; i<(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )
    207   {
    208     m_apcTComTile[i] = new TComTile;
    209   }
    210 }
    211 
    212 Void TComPicSym::xInitTiles()
    213 {
    214   UInt  uiTileIdx;
    215   UInt  uiColumnIdx = 0;
    216   UInt  uiRowIdx = 0;
    217   UInt  uiRightEdgePosInCU;
    218   UInt  uiBottomEdgePosInCU;
    219   Int   i, j;
     196Void TComPicSym::initTiles(TComPPS *pps)
     197{
     198  //set NumColumnsMinus1 and NumRowsMinus1
     199  setNumColumnsMinus1( pps->getNumTileColumnsMinus1() );
     200  setNumRowsMinus1( pps->getTileNumRowsMinus1() );
     201
     202  const Int numCols = pps->getNumTileColumnsMinus1() + 1;
     203  const Int numRows = pps->getTileNumRowsMinus1() + 1;
     204  const Int numTiles = numRows * numCols;
     205
     206  // allocate memory for tile parameters
     207  m_tileParameters.resize(numTiles);
     208
     209  if( pps->getTileUniformSpacingFlag() )
     210  {
     211    //set width and height for each (uniform) tile
     212    for(Int row=0; row < numRows; row++)
     213    {
     214      for(Int col=0; col < numCols; col++)
     215      {
     216        const Int tileIdx = row * numCols + col;
     217        m_tileParameters[tileIdx].setTileWidth( (col+1)*getFrameWidthInCU()/numCols
     218                                              - (col*getFrameWidthInCU())/numCols );
     219        m_tileParameters[tileIdx].setTileHeight( (row+1)*getFrameHeightInCU()/numRows
     220                                               - (row*getFrameHeightInCU())/numRows );
     221      }
     222    }
     223  }
     224  else
     225  {
     226    //set the width for each tile
     227    for(Int row=0; row < numRows; row++)
     228    {
     229      Int cumulativeTileWidth = 0;
     230      for(Int col=0; col < getNumColumnsMinus1(); col++)
     231  {
     232  }
     233      m_tileParameters[row * numCols + getNumColumnsMinus1()].setTileWidth( getFrameWidthInCU()-cumulativeTileWidth );
     234}
     235
     236    //set the height for each tile
     237    for(Int col=0; col < numCols; col++)
     238{
     239      Int cumulativeTileHeight = 0;
     240      for(Int row=0; row < getNumRowsMinus1(); row++)
     241      {
     242        m_tileParameters[row * numCols + col].setTileHeight( pps->getTileRowHeight(row) );
     243        cumulativeTileHeight += pps->getTileRowHeight(row);
     244      }
     245      m_tileParameters[getNumRowsMinus1() * numCols + col].setTileHeight( getFrameHeightInCU()-cumulativeTileHeight );
     246    }
     247  }
     248
     249#if TILE_SIZE_CHECK
     250  Int minWidth  = 1;
     251  Int minHeight = 1;
     252  const Int profileIdc = pps->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc();
     253  if (  profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10)
     254  {
     255    if (pps->getTilesEnabledFlag())
     256    {
     257      minHeight = 64  / g_uiMaxCUHeight;
     258      minWidth  = 256 / g_uiMaxCUWidth;
     259    }
     260  }
     261  for(Int row=0; row < numRows; row++)
     262  {
     263    for(Int col=0; col < numCols; col++)
     264    {
     265      const Int tileIdx = row * numCols + col;
     266      assert (m_tileParameters[tileIdx].getTileWidth() >= minWidth);
     267      assert (m_tileParameters[tileIdx].getTileHeight() >= minHeight);
     268    }
     269  }
     270#endif
    220271
    221272  //initialize each tile of the current picture
    222   for( uiRowIdx=0; uiRowIdx < m_iNumRowsMinus1+1; uiRowIdx++ )
    223   {
    224     for( uiColumnIdx=0; uiColumnIdx < m_iNumColumnsMinus1+1; uiColumnIdx++ )
    225     {
    226       uiTileIdx = uiRowIdx * (m_iNumColumnsMinus1+1) + uiColumnIdx;
     273  for( Int row=0; row < numRows; row++ )
     274  {
     275    for( Int col=0; col < numCols; col++ )
     276    {
     277      const Int tileIdx = row * numCols + col;
    227278
    228279      //initialize the RightEdgePosInCU for each tile
    229       uiRightEdgePosInCU = 0;
    230       for( i=0; i <= uiColumnIdx; i++ )
    231       {
    232         uiRightEdgePosInCU += this->getTComTile(uiRowIdx * (m_iNumColumnsMinus1+1) + i)->getTileWidth();
    233       }
    234       this->getTComTile(uiTileIdx)->setRightEdgePosInCU(uiRightEdgePosInCU-1);
     280      Int rightEdgePosInCTU = 0;
     281      for( Int i=0; i <= col; i++ )
     282      {
     283        rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidth();
     284      }
     285      m_tileParameters[tileIdx].setRightEdgePosInCU(rightEdgePosInCTU-1);
    235286
    236287      //initialize the BottomEdgePosInCU for each tile
    237       uiBottomEdgePosInCU = 0;
    238       for( i=0; i <= uiRowIdx; i++ )
    239       {
    240         uiBottomEdgePosInCU += this->getTComTile(i * (m_iNumColumnsMinus1+1) + uiColumnIdx)->getTileHeight();
    241       }
    242       this->getTComTile(uiTileIdx)->setBottomEdgePosInCU(uiBottomEdgePosInCU-1);
     288      Int bottomEdgePosInCTU = 0;
     289      for( Int i=0; i <= row; i++ )
     290      {
     291        bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeight();
     292      }
     293      m_tileParameters[tileIdx].setBottomEdgePosInCU(bottomEdgePosInCTU-1);
    243294
    244295      //initialize the FirstCUAddr for each tile
    245       this->getTComTile(uiTileIdx)->setFirstCUAddr( (this->getTComTile(uiTileIdx)->getBottomEdgePosInCU() - this->getTComTile(uiTileIdx)->getTileHeight() +1)*m_uiWidthInCU +
    246         this->getTComTile(uiTileIdx)->getRightEdgePosInCU() - this->getTComTile(uiTileIdx)->getTileWidth() + 1);
    247     }
    248   }
     296      m_tileParameters[tileIdx].setFirstCUAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCU() - m_tileParameters[tileIdx].getTileHeight() + 1) * getFrameWidthInCU() +
     297                                                 m_tileParameters[tileIdx].getRightEdgePosInCU() - m_tileParameters[tileIdx].getTileWidth() + 1);
     298    }
     299  }
     300
     301  Int  columnIdx = 0;
     302  Int  rowIdx = 0;
    249303
    250304  //initialize the TileIdxMap
    251   for( i=0; i<m_uiNumCUsInFrame; i++)
    252   {
    253     for(j=0; j < m_iNumColumnsMinus1+1; j++)
    254     {
    255       if(i % m_uiWidthInCU <= this->getTComTile(j)->getRightEdgePosInCU())
    256       {
    257         uiColumnIdx = j;
    258         j = m_iNumColumnsMinus1+1;
    259       }
    260     }
    261     for(j=0; j < m_iNumRowsMinus1+1; j++)
    262     {
    263       if(i/m_uiWidthInCU <= this->getTComTile(j*(m_iNumColumnsMinus1 + 1))->getBottomEdgePosInCU())
    264       {
    265         uiRowIdx = j;
    266         j = m_iNumRowsMinus1 + 1;
    267       }
    268     }
    269     m_puiTileIdxMap[i] = uiRowIdx * (m_iNumColumnsMinus1 + 1) + uiColumnIdx;
     305  for( Int i=0; i<m_uiNumCUsInFrame; i++)
     306  {
     307    for( Int col=0; col < numCols; col++)
     308    {
     309      if(i % getFrameWidthInCU() <= m_tileParameters[col].getRightEdgePosInCU())
     310      {
     311        columnIdx = col;
     312        break;
     313      }
     314    }
     315    for(Int row=0; row < numRows; row++)
     316    {
     317      if(i / getFrameWidthInCU() <= m_tileParameters[row*numCols].getBottomEdgePosInCU())
     318      {
     319        rowIdx = row;
     320        break;
     321      }
     322    }
     323    m_puiTileIdxMap[i] = rowIdx * numCols + columnIdx;
    270324  }
    271325
     
    417471
    418472TComTile::TComTile()
     473: m_uiTileWidth         (0)
     474, m_uiTileHeight        (0)
     475, m_uiRightEdgePosInCU  (0)
     476, m_uiBottomEdgePosInCU (0)
     477, m_uiFirstCUAddr       (0)
     478
    419479{
    420480}
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComPicSym.h

    r872 r1081  
    4545#include "TComDataCU.h"
    4646class TComSampleAdaptiveOffset;
     47class TComPPS;
    4748
    4849//! \ingroup TLibCommon
     
    102103  Int           m_iNumColumnsMinus1;
    103104  Int           m_iNumRowsMinus1;
    104   TComTile**    m_apcTComTile;
     105  std::vector<TComTile> m_tileParameters;
    105106  UInt*         m_puiCUOrderMap;       //the map of LCU raster scan address relative to LCU encoding order
    106107  UInt*         m_puiTileIdxMap;       //the map of the tile index relative to LCU raster scan address
     
    133134  Int          getNumRowsMinus1()                                    { return m_iNumRowsMinus1; }
    134135  Int          getNumTiles()                                         { return (m_iNumRowsMinus1+1)*(m_iNumColumnsMinus1+1); }
    135   TComTile*    getTComTile  ( UInt tileIdx )                         { return *(m_apcTComTile + tileIdx); }
     136  TComTile*    getTComTile  ( UInt tileIdx )                         { return &(m_tileParameters[tileIdx]); }
    136137  Void         setCUOrderMap( Int encCUOrder, Int cuAddr )           { *(m_puiCUOrderMap + encCUOrder) = cuAddr; }
    137138  UInt         getCUOrderMap( Int encCUOrder )                       { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); }
     
    141142  UInt         getPicSCUEncOrder( UInt SCUAddr );
    142143  UInt         getPicSCUAddr( UInt SCUEncOrder );
    143   Void         xCreateTComTileArray();
    144   Void         xInitTiles();
     144  Void         initTiles(TComPPS *pps);
    145145  UInt         xCalculateNxtCUAddr( UInt uiCurrCUAddr );
    146146  SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;}
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r1078 r1081  
    28732873, m_entropyCodingSyncEnabledFlag   (false)
    28742874, m_loopFilterAcrossTilesEnabledFlag  (true)
    2875 , m_uniformSpacingFlag           (0)
    2876 , m_iNumColumnsMinus1            (0)
    2877 , m_puiColumnWidth               (NULL)
    2878 , m_iNumRowsMinus1               (0)
    2879 , m_puiRowHeight                 (NULL)
    2880 , m_iNumSubstreams             (1)
     2875, m_uniformSpacingFlag           (false)
     2876, m_numTileColumnsMinus1         (0)
     2877, m_numTileRowsMinus1            (0)
     2878, m_numSubstreams               (1)
    28812879, m_signHideFlag(0)
    28822880, m_cabacInitPresentFlag        (false)
     
    29112909TComPPS::~TComPPS()
    29122910{
    2913   if( m_iNumColumnsMinus1 > 0 && m_uniformSpacingFlag == 0 )
    2914   {
    2915     if (m_puiColumnWidth) delete [] m_puiColumnWidth;
    2916     m_puiColumnWidth = NULL;
    2917   }
    2918   if( m_iNumRowsMinus1 > 0 && m_uniformSpacingFlag == 0 )
    2919   {
    2920     if (m_puiRowHeight) delete [] m_puiRowHeight;
    2921     m_puiRowHeight = NULL;
    2922   }
    29232911  delete m_scalingList;
    29242912}
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComSlice.h

    r1076 r1081  
    19701970 
    19711971  Bool     m_loopFilterAcrossTilesEnabledFlag;
    1972   Int      m_uniformSpacingFlag;
    1973   Int      m_iNumColumnsMinus1;
    1974   UInt*    m_puiColumnWidth;
    1975   Int      m_iNumRowsMinus1;
    1976   UInt*    m_puiRowHeight;
    1977 
    1978   Int      m_iNumSubstreams;
     1972  Bool             m_uniformSpacingFlag;
     1973  Int              m_numTileColumnsMinus1;
     1974  Int              m_numTileRowsMinus1;
     1975  std::vector<Int> m_tileColumnWidth;
     1976  std::vector<Int> m_tileRowHeight;
     1977
     1978  Int      m_numSubstreams;
    19791979
    19801980  Int      m_signHideFlag;
     
    20732073  Bool    getDependentSliceSegmentsEnabledFlag() const     { return m_dependentSliceSegmentsEnabledFlag; }
    20742074  Void    setDependentSliceSegmentsEnabledFlag(Bool val)   { m_dependentSliceSegmentsEnabledFlag = val; }
    2075   Bool    getTilesEnabledFlag() const                      { return m_tilesEnabledFlag; }
    2076   Void    setTilesEnabledFlag(Bool val)                    { m_tilesEnabledFlag = val; }
    20772075  Bool    getEntropyCodingSyncEnabledFlag() const          { return m_entropyCodingSyncEnabledFlag; }
    20782076  Void    setEntropyCodingSyncEnabledFlag(Bool val)        { m_entropyCodingSyncEnabledFlag = val; }
    2079   Void     setUniformSpacingFlag            ( Bool b )          { m_uniformSpacingFlag = b; }
    2080   Bool     getUniformSpacingFlag            ()                  { return m_uniformSpacingFlag; }
    2081   Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
    2082   Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
    2083   Void     setColumnWidth ( UInt* columnWidth )
    2084   {
    2085     if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 )
    2086     {
    2087       m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
    2088 
    2089       for(Int i=0; i<m_iNumColumnsMinus1; i++)
    2090       {
    2091         m_puiColumnWidth[i] = columnWidth[i];
    2092       }
    2093     }
    2094   }
    2095   UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
    2096   Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
    2097   Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
    2098   Void     setRowHeight    ( UInt* rowHeight )
    2099   {
    2100     if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 )
    2101     {
    2102       m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
    2103 
    2104       for(Int i=0; i<m_iNumRowsMinus1; i++)
    2105       {
    2106         m_puiRowHeight[i] = rowHeight[i];
    2107       }
    2108     }
    2109   }
    2110   UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
    2111   Void     setNumSubstreams(Int iNumSubstreams)               { m_iNumSubstreams = iNumSubstreams; }
    2112   Int      getNumSubstreams()                                 { return m_iNumSubstreams; }
     2077
     2078  Void     setTilesEnabledFlag       (Bool val)                             { m_tilesEnabledFlag = val; }
     2079  Bool     getTilesEnabledFlag       () const                               { return m_tilesEnabledFlag; }
     2080  Void     setTileUniformSpacingFlag (Bool b)                               { m_uniformSpacingFlag = b; }
     2081  Bool     getTileUniformSpacingFlag () const                               { return m_uniformSpacingFlag; }
     2082  Void     setNumTileColumnsMinus1   (Int i)                                { m_numTileColumnsMinus1 = i; }
     2083  Int      getNumTileColumnsMinus1   () const                               { return m_numTileColumnsMinus1; }
     2084  Void     setTileColumnWidth        (const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; }
     2085  UInt     getTileColumnWidth        (UInt columnIdx) const                 { return  m_tileColumnWidth[columnIdx]; }
     2086  Void     setNumTileRowsMinus1      (Int i)                                { m_numTileRowsMinus1 = i; }
     2087  Int      getTileNumRowsMinus1      () const                               { return m_numTileRowsMinus1; }
     2088  Void     setTileRowHeight          (const std::vector<Int>& rowHeight)    { m_tileRowHeight = rowHeight;  }
     2089  UInt     getTileRowHeight          (UInt rowIdx) const                    { return m_tileRowHeight[rowIdx]; }
     2090
     2091  Void     setNumSubstreams    (Int numSubstreams)                     { m_numSubstreams = numSubstreams; }
     2092  Int      getNumSubstreams    ()                                      { return m_numSubstreams; }
    21132093
    21142094  Void      setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; }
  • branches/HTM-12.1-dev0/source/Lib/TLibCommon/TypeDef.h

    r1078 r1081  
    369369#define H_MV_HLS_PTL_LIMITS                  0
    370370#define H_MV_HLS7_GEN                        0  // General changes (not tested)
    371 
     371#define H_MV_ALIGN_HM_15                     1 
    372372
    373373// POC
     
    418418#define SAO_SGN_FUNC 1
    419419
     420#define TILE_SIZE_CHECK 1
     421
    420422#define FIX1172 1 ///< fix ticket #1172
    421423
     
    433435#define MAX_NESTING_NUM_LAYER       64
    434436
     437#if H_MV
    435438#define MAX_VPS_NUM_HRD_PARAMETERS                1024
     439#else
     440#define MAX_VPS_NUM_HRD_PARAMETERS                1
     441#endif
    436442#if H_MV
    437443#define MAX_NUM_SUB_LAYERS                        7
Note: See TracChangeset for help on using the changeset viewer.