Changeset 1081 in 3DVCSoftware for branches/HTM-12.1-dev0/source/Lib/TLibCommon
- Timestamp:
- 22 Oct 2014, 01:32:55 (11 years ago)
- 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 61 61 #if H_MV 62 62 #define NV_VERSION "12.1" ///< Current software version 63 #define HM_VERSION "1 4.0" ///<63 #define HM_VERSION "15.0" ///< 64 64 #else 65 65 #define NV_VERSION "14.0" ///< Current software version -
branches/HTM-12.1-dev0/source/Lib/TLibCommon/SEI.h
r964 r1081 161 161 UInt m_bpSeqParameterSetId; 162 162 Bool m_rapCpbParamsPresentFlag; 163 Boolm_cpbDelayOffset;164 Boolm_dpbDelayOffset;163 UInt m_cpbDelayOffset; 164 UInt m_dpbDelayOffset; 165 165 UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; 166 166 UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; -
branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComPicSym.cpp
r872 r1081 38 38 #include "TComPicSym.h" 39 39 #include "TComSampleAdaptiveOffset.h" 40 #include "TComSlice.h" 40 41 41 42 //! \ingroup TLibCommon … … 63 64 ,m_iNumColumnsMinus1 (0) 64 65 ,m_iNumRowsMinus1(0) 65 ,m_apcTComTile(NULL)66 66 ,m_puiCUOrderMap(0) 67 67 ,m_puiTileIdxMap(NULL) … … 101 101 delete [] m_apcTComSlice; 102 102 } 103 m_apcTComSlice = new TComSlice*[m_uiNumCUsInFrame *m_uiNumPartitions];103 m_apcTComSlice = new TComSlice*[m_uiNumCUsInFrame]; 104 104 m_apcTComSlice[0] = new TComSlice; 105 105 m_uiNumAllocatedSlice = 1; … … 148 148 m_apcTComDataCU = NULL; 149 149 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 158 150 delete [] m_puiCUOrderMap; 159 151 m_puiCUOrderMap = NULL; … … 173 165 Void TComPicSym::allocateNewSlice() 174 166 { 167 assert ((m_uiNumAllocatedSlice + 1) <= m_uiNumCUsInFrame); 175 168 m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice; 176 169 if (m_uiNumAllocatedSlice>=2) … … 201 194 } 202 195 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; 196 Void 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 220 271 221 272 //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; 227 278 228 279 //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); 235 286 236 287 //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); 243 294 244 295 //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; 249 303 250 304 //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; 270 324 } 271 325 … … 417 471 418 472 TComTile::TComTile() 473 : m_uiTileWidth (0) 474 , m_uiTileHeight (0) 475 , m_uiRightEdgePosInCU (0) 476 , m_uiBottomEdgePosInCU (0) 477 , m_uiFirstCUAddr (0) 478 419 479 { 420 480 } -
branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComPicSym.h
r872 r1081 45 45 #include "TComDataCU.h" 46 46 class TComSampleAdaptiveOffset; 47 class TComPPS; 47 48 48 49 //! \ingroup TLibCommon … … 102 103 Int m_iNumColumnsMinus1; 103 104 Int m_iNumRowsMinus1; 104 TComTile** m_apcTComTile;105 std::vector<TComTile> m_tileParameters; 105 106 UInt* m_puiCUOrderMap; //the map of LCU raster scan address relative to LCU encoding order 106 107 UInt* m_puiTileIdxMap; //the map of the tile index relative to LCU raster scan address … … 133 134 Int getNumRowsMinus1() { return m_iNumRowsMinus1; } 134 135 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]); } 136 137 Void setCUOrderMap( Int encCUOrder, Int cuAddr ) { *(m_puiCUOrderMap + encCUOrder) = cuAddr; } 137 138 UInt getCUOrderMap( Int encCUOrder ) { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); } … … 141 142 UInt getPicSCUEncOrder( UInt SCUAddr ); 142 143 UInt getPicSCUAddr( UInt SCUEncOrder ); 143 Void xCreateTComTileArray(); 144 Void xInitTiles(); 144 Void initTiles(TComPPS *pps); 145 145 UInt xCalculateNxtCUAddr( UInt uiCurrCUAddr ); 146 146 SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;} -
branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComSlice.cpp
r1078 r1081 2873 2873 , m_entropyCodingSyncEnabledFlag (false) 2874 2874 , 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) 2881 2879 , m_signHideFlag(0) 2882 2880 , m_cabacInitPresentFlag (false) … … 2911 2909 TComPPS::~TComPPS() 2912 2910 { 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 }2923 2911 delete m_scalingList; 2924 2912 } -
branches/HTM-12.1-dev0/source/Lib/TLibCommon/TComSlice.h
r1076 r1081 1970 1970 1971 1971 Bool m_loopFilterAcrossTilesEnabledFlag; 1972 Intm_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; 1979 1979 1980 1980 Int m_signHideFlag; … … 2073 2073 Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } 2074 2074 Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } 2075 Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; }2076 Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; }2077 2075 Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } 2078 2076 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; } 2113 2093 2114 2094 Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } -
branches/HTM-12.1-dev0/source/Lib/TLibCommon/TypeDef.h
r1078 r1081 369 369 #define H_MV_HLS_PTL_LIMITS 0 370 370 #define H_MV_HLS7_GEN 0 // General changes (not tested) 371 371 #define H_MV_ALIGN_HM_15 1 372 372 373 373 // POC … … 418 418 #define SAO_SGN_FUNC 1 419 419 420 #define TILE_SIZE_CHECK 1 421 420 422 #define FIX1172 1 ///< fix ticket #1172 421 423 … … 433 435 #define MAX_NESTING_NUM_LAYER 64 434 436 437 #if H_MV 435 438 #define MAX_VPS_NUM_HRD_PARAMETERS 1024 439 #else 440 #define MAX_VPS_NUM_HRD_PARAMETERS 1 441 #endif 436 442 #if H_MV 437 443 #define MAX_NUM_SUB_LAYERS 7
Note: See TracChangeset for help on using the changeset viewer.