Changeset 916 in SHVCSoftware for branches/SHM-upgrade/source/Lib/TLibCommon/TComPicSym.cpp
- Timestamp:
- 12 Nov 2014, 08:09:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-upgrade/source/Lib/TLibCommon/TComPicSym.cpp
r823 r916 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2014, ITU/ISO/IEC … … 48 48 49 49 TComPicSym::TComPicSym() 50 :m_ uiWidthInCU(0)51 ,m_ uiHeightInCU(0)50 :m_frameWidthInCtus(0) 51 ,m_frameHeightInCtus(0) 52 52 ,m_uiMaxCUWidth(0) 53 53 ,m_uiMaxCUHeight(0) … … 55 55 ,m_uiMinCUHeight(0) 56 56 ,m_uhTotalDepth(0) 57 ,m_ uiNumPartitions(0)58 ,m_ uiNumPartInWidth(0)59 ,m_ uiNumPartInHeight(0)60 ,m_ uiNumCUsInFrame(0)57 ,m_numPartitionsInCtu(0) 58 ,m_numPartInCtuWidth(0) 59 ,m_numPartInCtuHeight(0) 60 ,m_numCtusInFrame(0) 61 61 ,m_apcTComSlice(NULL) 62 ,m_uiNumAllocatedSlice 63 ,m_ apcTComDataCU(NULL)64 ,m_ iNumColumnsMinus1(0)65 ,m_ iNumRowsMinus1(0)66 ,m_ puiCUOrderMap(0)62 ,m_uiNumAllocatedSlice(0) 63 ,m_pictureCtuArray(NULL) 64 ,m_numTileColumnsMinus1(0) 65 ,m_numTileRowsMinus1(0) 66 ,m_ctuTsToRsAddrMap(NULL) 67 67 ,m_puiTileIdxMap(NULL) 68 ,m_ puiInverseCUOrderMap(NULL)68 ,m_ctuRsToTsAddrMap(NULL) 69 69 ,m_saoBlkParams(NULL) 70 {} ;71 72 73 Void TComPicSym::create ( Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )70 {} 71 72 73 Void TComPicSym::create ( ChromaFormat chromaFormatIDC, Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ) 74 74 { 75 75 UInt i; 76 76 77 m_uhTotalDepth = uiMaxDepth;78 m_ uiNumPartitions= 1<<(m_uhTotalDepth<<1);79 80 m_uiMaxCUWidth = uiMaxWidth;81 m_uiMaxCUHeight = uiMaxHeight;82 83 m_uiMinCUWidth = uiMaxWidth >> m_uhTotalDepth;84 m_uiMinCUHeight = uiMaxHeight >> m_uhTotalDepth;85 86 m_ uiNumPartInWidth = m_uiMaxCUWidth / m_uiMinCUWidth;87 m_ uiNumPartInHeight = m_uiMaxCUHeight / m_uiMinCUHeight;88 89 m_ uiWidthInCU= ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth;90 m_ uiHeightInCU= ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight;91 92 m_ uiNumCUsInFrame = m_uiWidthInCU * m_uiHeightInCU;93 m_ apcTComDataCU = new TComDataCU*[m_uiNumCUsInFrame];94 77 m_uhTotalDepth = uiMaxDepth; 78 m_numPartitionsInCtu = 1<<(m_uhTotalDepth<<1); 79 80 m_uiMaxCUWidth = uiMaxWidth; 81 m_uiMaxCUHeight = uiMaxHeight; 82 83 m_uiMinCUWidth = uiMaxWidth >> m_uhTotalDepth; 84 m_uiMinCUHeight = uiMaxHeight >> m_uhTotalDepth; 85 86 m_numPartInCtuWidth = m_uiMaxCUWidth / m_uiMinCUWidth; // equivalent to 1<<m_uhTotalDepth 87 m_numPartInCtuHeight = m_uiMaxCUHeight / m_uiMinCUHeight; // equivalent to 1<<m_uhTotalDepth 88 89 m_frameWidthInCtus = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; 90 m_frameHeightInCtus = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; 91 92 m_numCtusInFrame = m_frameWidthInCtus * m_frameHeightInCtus; 93 m_pictureCtuArray = new TComDataCU*[m_numCtusInFrame]; 94 95 95 if (m_uiNumAllocatedSlice>0) 96 96 { … … 101 101 delete [] m_apcTComSlice; 102 102 } 103 m_apcTComSlice = new TComSlice*[m_ uiNumCUsInFrame];103 m_apcTComSlice = new TComSlice*[m_numCtusInFrame]; 104 104 m_apcTComSlice[0] = new TComSlice; 105 105 m_uiNumAllocatedSlice = 1; 106 for ( i=0; i<m_ uiNumCUsInFrame ; i++ )107 { 108 m_ apcTComDataCU[i] = new TComDataCU;109 m_ apcTComDataCU[i]->create( m_uiNumPartitions, m_uiMaxCUWidth, m_uiMaxCUHeight, false, m_uiMaxCUWidth >> m_uhTotalDepth106 for ( i=0; i<m_numCtusInFrame ; i++ ) 107 { 108 m_pictureCtuArray[i] = new TComDataCU; 109 m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, m_uiMaxCUWidth, m_uiMaxCUHeight, false, m_uiMaxCUWidth >> m_uhTotalDepth 110 110 #if ADAPTIVE_QP_SELECTION 111 111 , true 112 #endif 112 #endif 113 113 ); 114 114 } 115 115 116 m_puiCUOrderMap = new UInt[m_uiNumCUsInFrame+1]; 117 m_puiTileIdxMap = new UInt[m_uiNumCUsInFrame]; 116 m_ctuTsToRsAddrMap = new UInt[m_numCtusInFrame+1]; 117 m_puiTileIdxMap = new UInt[m_numCtusInFrame]; 118 m_ctuRsToTsAddrMap = new UInt[m_numCtusInFrame+1]; 119 118 120 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 119 m_piTileSetIdxMap = new Int[m_uiNumCUsInFrame]; 120 m_pucTileSetType = new UChar[m_uiNumCUsInFrame]; 121 m_pbSkippedTileSetFlag = new Bool[m_uiNumCUsInFrame]; 122 #endif 123 m_puiInverseCUOrderMap = new UInt[m_uiNumCUsInFrame+1]; 124 125 for( i=0; i<m_uiNumCUsInFrame; i++ ) 126 { 127 m_puiCUOrderMap[i] = i; 128 m_puiInverseCUOrderMap[i] = i; 129 } 130 131 m_saoBlkParams = new SAOBlkParam[m_uiNumCUsInFrame]; 121 m_piTileSetIdxMap = new Int[m_numCtusInFrame]; 122 m_pucTileSetType = new UChar[m_numCtusInFrame]; 123 m_pbSkippedTileSetFlag = new Bool[m_numCtusInFrame]; 124 #endif 125 126 for( i=0; i<m_numCtusInFrame; i++ ) 127 { 128 m_ctuTsToRsAddrMap[i] = i; 129 m_ctuRsToTsAddrMap[i] = i; 130 } 131 132 m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame]; 132 133 } 133 134 … … 143 144 } 144 145 m_apcTComSlice = NULL; 145 146 for (Int i = 0; i < m_ uiNumCUsInFrame; i++)147 { 148 m_ apcTComDataCU[i]->destroy();149 delete m_ apcTComDataCU[i];150 m_ apcTComDataCU[i] = NULL;151 } 152 delete [] m_ apcTComDataCU;153 m_ apcTComDataCU= NULL;154 155 delete [] m_ puiCUOrderMap;156 m_ puiCUOrderMap = NULL;146 147 for (Int i = 0; i < m_numCtusInFrame; i++) 148 { 149 m_pictureCtuArray[i]->destroy(); 150 delete m_pictureCtuArray[i]; 151 m_pictureCtuArray[i] = NULL; 152 } 153 delete [] m_pictureCtuArray; 154 m_pictureCtuArray = NULL; 155 156 delete [] m_ctuTsToRsAddrMap; 157 m_ctuTsToRsAddrMap = NULL; 157 158 158 159 delete [] m_puiTileIdxMap; … … 167 168 #endif 168 169 169 delete [] m_ puiInverseCUOrderMap;170 m_ puiInverseCUOrderMap = NULL;171 170 delete [] m_ctuRsToTsAddrMap; 171 m_ctuRsToTsAddrMap = NULL; 172 172 173 if(m_saoBlkParams) 173 174 { … … 178 179 Void TComPicSym::allocateNewSlice() 179 180 { 180 assert ((m_uiNumAllocatedSlice + 1) <= m_ uiNumCUsInFrame);181 assert ((m_uiNumAllocatedSlice + 1) <= m_numCtusInFrame); 181 182 m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice; 182 183 if (m_uiNumAllocatedSlice>=2) … … 201 202 } 202 203 203 UInt TComPicSym::getPicSCUEncOrder( UInt SCUAddr ) 204 { 205 return getInverseCUOrderMap(SCUAddr/m_uiNumPartitions)*m_uiNumPartitions + SCUAddr%m_uiNumPartitions; 206 } 207 208 UInt TComPicSym::getPicSCUAddr( UInt SCUEncOrder ) 209 { 210 return getCUOrderMap(SCUEncOrder/m_uiNumPartitions)*m_uiNumPartitions + SCUEncOrder%m_uiNumPartitions; 204 Void TComPicSym::initCtuTsRsAddrMaps() 205 { 206 //generate the Coding Order Map and Inverse Coding Order Map 207 for(Int ctuTsAddr=0, ctuRsAddr=0; ctuTsAddr<getNumberOfCtusInFrame(); ctuTsAddr++, ctuRsAddr = xCalculateNextCtuRSAddr(ctuRsAddr)) 208 { 209 setCtuTsToRsAddrMap(ctuTsAddr, ctuRsAddr); 210 setCtuRsToTsAddrMap(ctuRsAddr, ctuTsAddr); 211 } 212 setCtuTsToRsAddrMap(getNumberOfCtusInFrame(), getNumberOfCtusInFrame()); 213 setCtuRsToTsAddrMap(getNumberOfCtusInFrame(), getNumberOfCtusInFrame()); 211 214 } 212 215 … … 214 217 { 215 218 //set NumColumnsMinus1 and NumRowsMinus1 216 setNum ColumnsMinus1( pps->getNumTileColumnsMinus1() );217 setNum RowsMinus1( pps->getTileNumRowsMinus1());219 setNumTileColumnsMinus1( pps->getNumTileColumnsMinus1() ); 220 setNumTileRowsMinus1( pps->getNumTileRowsMinus1() ); 218 221 219 222 const Int numCols = pps->getNumTileColumnsMinus1() + 1; 220 const Int numRows = pps->get TileNumRowsMinus1() + 1;223 const Int numRows = pps->getNumTileRowsMinus1() + 1; 221 224 const Int numTiles = numRows * numCols; 222 225 … … 228 231 //set width and height for each (uniform) tile 229 232 for(Int row=0; row < numRows; row++) 230 {233 { 231 234 for(Int col=0; col < numCols; col++) 232 235 { 233 236 const Int tileIdx = row * numCols + col; 234 m_tileParameters[tileIdx].setTileWidth( (col+1)*getFrameWidthInCU()/numCols 235 - (col*getFrameWidthInCU())/numCols ); 236 m_tileParameters[tileIdx].setTileHeight( (row+1)*getFrameHeightInCU()/numRows 237 - (row*getFrameHeightInCU())/numRows ); 237 m_tileParameters[tileIdx].setTileWidthInCtus( (col+1)*getFrameWidthInCtus( )/numCols - (col*getFrameWidthInCtus( ))/numCols ); 238 m_tileParameters[tileIdx].setTileHeightInCtus( (row+1)*getFrameHeightInCtus()/numRows - (row*getFrameHeightInCtus())/numRows ); 238 239 } 239 240 } … … 245 246 { 246 247 Int cumulativeTileWidth = 0; 247 for(Int col=0; col < getNum ColumnsMinus1(); col++)248 { 249 m_tileParameters[row * numCols + col].setTileWidth ( pps->getTileColumnWidth(col) );248 for(Int col=0; col < getNumTileColumnsMinus1(); col++) 249 { 250 m_tileParameters[row * numCols + col].setTileWidthInCtus( pps->getTileColumnWidth(col) ); 250 251 cumulativeTileWidth += pps->getTileColumnWidth(col); 251 252 } 252 m_tileParameters[row * numCols + getNum ColumnsMinus1()].setTileWidth( getFrameWidthInCU()-cumulativeTileWidth );253 }253 m_tileParameters[row * numCols + getNumTileColumnsMinus1()].setTileWidthInCtus( getFrameWidthInCtus()-cumulativeTileWidth ); 254 } 254 255 255 256 //set the height for each tile … … 257 258 { 258 259 Int cumulativeTileHeight = 0; 259 for(Int row=0; row < getNum RowsMinus1(); row++)260 { 261 m_tileParameters[row * numCols + col].setTileHeight ( pps->getTileRowHeight(row) );260 for(Int row=0; row < getNumTileRowsMinus1(); row++) 261 { 262 m_tileParameters[row * numCols + col].setTileHeightInCtus( pps->getTileRowHeight(row) ); 262 263 cumulativeTileHeight += pps->getTileRowHeight(row); 263 264 } 264 m_tileParameters[getNum RowsMinus1() * numCols + col].setTileHeight( getFrameHeightInCU()-cumulativeTileHeight );265 m_tileParameters[getNumTileRowsMinus1() * numCols + col].setTileHeightInCtus( getFrameHeightInCtus()-cumulativeTileHeight ); 265 266 } 266 267 } … … 270 271 Int minHeight = 1; 271 272 const Int profileIdc = pps->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc(); 272 if ( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10) 273 if ( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10) //TODO: add more profiles to the tile-size check... 273 274 { 274 275 if (pps->getTilesEnabledFlag()) … … 283 284 { 284 285 const Int tileIdx = row * numCols + col; 285 assert (m_tileParameters[tileIdx].getTileWidth () >= minWidth);286 assert (m_tileParameters[tileIdx].getTileHeight () >= minHeight);286 assert (m_tileParameters[tileIdx].getTileWidthInCtus() >= minWidth); 287 assert (m_tileParameters[tileIdx].getTileHeightInCtus() >= minHeight); 287 288 } 288 289 } … … 300 301 for( Int i=0; i <= col; i++ ) 301 302 { 302 rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidth ();303 } 304 m_tileParameters[tileIdx].setRightEdgePosInC U(rightEdgePosInCTU-1);303 rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidthInCtus(); 304 } 305 m_tileParameters[tileIdx].setRightEdgePosInCtus(rightEdgePosInCTU-1); 305 306 306 307 //initialize the BottomEdgePosInCU for each tile … … 308 309 for( Int i=0; i <= row; i++ ) 309 310 { 310 bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeight ();311 } 312 m_tileParameters[tileIdx].setBottomEdgePosInC U(bottomEdgePosInCTU-1);311 bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeightInCtus(); 312 } 313 m_tileParameters[tileIdx].setBottomEdgePosInCtus(bottomEdgePosInCTU-1); 313 314 314 315 //initialize the FirstCUAddr for each tile 315 m_tileParameters[tileIdx].setFirstC UAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCU() - m_tileParameters[tileIdx].getTileHeight() + 1) * getFrameWidthInCU() +316 m_tileParameters[tileIdx].getRightEdgePosInCU() - m_tileParameters[tileIdx].getTileWidth()+ 1);316 m_tileParameters[tileIdx].setFirstCtuRsAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCtus() - m_tileParameters[tileIdx].getTileHeightInCtus() + 1) * getFrameWidthInCtus() + 317 m_tileParameters[tileIdx].getRightEdgePosInCtus() - m_tileParameters[tileIdx].getTileWidthInCtus() + 1); 317 318 } 318 319 } … … 322 323 323 324 //initialize the TileIdxMap 324 for( Int i=0; i<m_ uiNumCUsInFrame; i++)325 for( Int i=0; i<m_numCtusInFrame; i++) 325 326 { 326 327 for( Int col=0; col < numCols; col++) 327 328 { 328 if(i % getFrameWidthInC U() <= m_tileParameters[col].getRightEdgePosInCU())329 if(i % getFrameWidthInCtus() <= m_tileParameters[col].getRightEdgePosInCtus()) 329 330 { 330 331 columnIdx = col; … … 334 335 for(Int row=0; row < numRows; row++) 335 336 { 336 if(i / getFrameWidthInC U() <= m_tileParameters[row*numCols].getBottomEdgePosInCU())337 if(i / getFrameWidthInCtus() <= m_tileParameters[row*numCols].getBottomEdgePosInCtus()) 337 338 { 338 339 rowIdx = row; … … 343 344 } 344 345 } 345 346 UInt TComPicSym::xCalculateNxtCUAddr( UInt uiCurrCUAddr ) 347 { 348 UInt uiNxtCUAddr; 349 UInt uiTileIdx; 350 351 //get the tile index for the current LCU 352 uiTileIdx = this->getTileIdxMap(uiCurrCUAddr); 353 354 //get the raster scan address for the next LCU 355 if( uiCurrCUAddr % m_uiWidthInCU == this->getTComTile(uiTileIdx)->getRightEdgePosInCU() && uiCurrCUAddr / m_uiWidthInCU == this->getTComTile(uiTileIdx)->getBottomEdgePosInCU() ) 356 //the current LCU is the last LCU of the tile 357 { 358 if(uiTileIdx == (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)-1) 359 { 360 uiNxtCUAddr = m_uiNumCUsInFrame; 346 UInt TComPicSym::xCalculateNextCtuRSAddr( UInt currCtuRsAddr ) 347 { 348 UInt nextCtuRsAddr; 349 350 //get the tile index for the current CTU 351 const UInt uiTileIdx = getTileIdxMap(currCtuRsAddr); 352 353 //get the raster scan address for the next CTU 354 if( currCtuRsAddr % m_frameWidthInCtus == getTComTile(uiTileIdx)->getRightEdgePosInCtus() && currCtuRsAddr / m_frameWidthInCtus == getTComTile(uiTileIdx)->getBottomEdgePosInCtus() ) 355 //the current CTU is the last CTU of the tile 356 { 357 if(uiTileIdx+1 == getNumTiles()) 358 { 359 nextCtuRsAddr = m_numCtusInFrame; 361 360 } 362 361 else 363 362 { 364 uiNxtCUAddr = this->getTComTile(uiTileIdx+1)->getFirstCUAddr();365 } 366 } 367 else //the current LCU is not the last LCU of the tile368 { 369 if( uiCurrCUAddr % m_uiWidthInCU == this->getTComTile(uiTileIdx)->getRightEdgePosInCU() ) //the current LCU is on the rightmost edge of the tile370 { 371 uiNxtCUAddr = uiCurrCUAddr + m_uiWidthInCU - this->getTComTile(uiTileIdx)->getTileWidth() + 1;363 nextCtuRsAddr = getTComTile(uiTileIdx+1)->getFirstCtuRsAddr(); 364 } 365 } 366 else //the current CTU is not the last CTU of the tile 367 { 368 if( currCtuRsAddr % m_frameWidthInCtus == getTComTile(uiTileIdx)->getRightEdgePosInCtus() ) //the current CTU is on the rightmost edge of the tile 369 { 370 nextCtuRsAddr = currCtuRsAddr + m_frameWidthInCtus - getTComTile(uiTileIdx)->getTileWidthInCtus() + 1; 372 371 } 373 372 else 374 373 { 375 uiNxtCUAddr = uiCurrCUAddr + 1;376 } 377 } 378 379 return uiNxtCUAddr;380 } 381 382 Void TComPicSym::deriveLoopFilterBoundaryAvailibility(Int ctu ,374 nextCtuRsAddr = currCtuRsAddr + 1; 375 } 376 } 377 378 return nextCtuRsAddr; 379 } 380 381 Void TComPicSym::deriveLoopFilterBoundaryAvailibility(Int ctuRsAddr, 383 382 Bool& isLeftAvail, 384 383 Bool& isRightAvail, … … 392 391 { 393 392 394 isLeftAvail = (ctu % m_uiWidthInCU!= 0);395 isRightAvail = (ctu % m_uiWidthInCU != m_uiWidthInCU-1);396 isAboveAvail = (ctu >= m_uiWidthInCU);397 isBelowAvail = (ctu < m_uiNumCUsInFrame - m_uiWidthInCU);393 isLeftAvail = (ctuRsAddr % m_frameWidthInCtus != 0); 394 isRightAvail = (ctuRsAddr % m_frameWidthInCtus != m_frameWidthInCtus-1); 395 isAboveAvail = (ctuRsAddr >= m_frameWidthInCtus ); 396 isBelowAvail = (ctuRsAddr < m_numCtusInFrame - m_frameWidthInCtus); 398 397 isAboveLeftAvail = (isAboveAvail && isLeftAvail); 399 398 isAboveRightAvail= (isAboveAvail && isRightAvail); … … 401 400 isBelowRightAvail= (isBelowAvail && isRightAvail); 402 401 403 Bool isLoopFiltAcrossTilePPS = getC U(ctu)->getSlice()->getPPS()->getLoopFilterAcrossTilesEnabledFlag();404 405 { 406 TComDataCU* ctuCurr = getC U(ctu);407 TComDataCU* ctuLeft = isLeftAvail ?getC U(ctu-1):NULL;408 TComDataCU* ctuRight = isRightAvail?getC U(ctu+1):NULL;409 TComDataCU* ctuAbove = isAboveAvail?getC U(ctu-m_uiWidthInCU):NULL;410 TComDataCU* ctuBelow = isBelowAvail?getC U(ctu+m_uiWidthInCU):NULL;411 TComDataCU* ctuAboveLeft = isAboveLeftAvail ? getC U(ctu-m_uiWidthInCU-1):NULL;412 TComDataCU* ctuAboveRig tht= isAboveRightAvail? getCU(ctu-m_uiWidthInCU+1):NULL;413 TComDataCU* ctuBelowLeft = isBelowLeftAvail ? getC U(ctu+m_uiWidthInCU-1):NULL;414 TComDataCU* ctuBelowRight = isBelowRightAvail? getC U(ctu+m_uiWidthInCU+1):NULL;402 Bool isLoopFiltAcrossTilePPS = getCtu(ctuRsAddr)->getSlice()->getPPS()->getLoopFilterAcrossTilesEnabledFlag(); 403 404 { 405 TComDataCU* ctuCurr = getCtu(ctuRsAddr); 406 TComDataCU* ctuLeft = isLeftAvail ?getCtu(ctuRsAddr-1):NULL; 407 TComDataCU* ctuRight = isRightAvail?getCtu(ctuRsAddr+1):NULL; 408 TComDataCU* ctuAbove = isAboveAvail?getCtu(ctuRsAddr-m_frameWidthInCtus):NULL; 409 TComDataCU* ctuBelow = isBelowAvail?getCtu(ctuRsAddr+m_frameWidthInCtus):NULL; 410 TComDataCU* ctuAboveLeft = isAboveLeftAvail ? getCtu(ctuRsAddr-m_frameWidthInCtus-1):NULL; 411 TComDataCU* ctuAboveRight = isAboveRightAvail? getCtu(ctuRsAddr-m_frameWidthInCtus+1):NULL; 412 TComDataCU* ctuBelowLeft = isBelowLeftAvail ? getCtu(ctuRsAddr+m_frameWidthInCtus-1):NULL; 413 TComDataCU* ctuBelowRight = isBelowRightAvail? getCtu(ctuRsAddr+m_frameWidthInCtus+1):NULL; 415 414 416 415 { … … 418 417 if(ctuLeft != NULL) 419 418 { 420 isLeftAvail = (ctuCurr->getSlice()->getSliceCurStartC UAddr() != ctuLeft->getSlice()->getSliceCurStartCUAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true;419 isLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuLeft->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; 421 420 } 422 421 //above 423 422 if(ctuAbove != NULL) 424 423 { 425 isAboveAvail = (ctuCurr->getSlice()->getSliceCurStartC UAddr() != ctuAbove->getSlice()->getSliceCurStartCUAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true;424 isAboveAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuAbove->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; 426 425 } 427 426 //right 428 427 if(ctuRight != NULL) 429 428 { 430 isRightAvail = (ctuCurr->getSlice()->getSliceCurStartC UAddr() != ctuRight->getSlice()->getSliceCurStartCUAddr())?ctuRight->getSlice()->getLFCrossSliceBoundaryFlag():true;429 isRightAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuRight->getSlice()->getSliceCurStartCtuTsAddr())?ctuRight->getSlice()->getLFCrossSliceBoundaryFlag():true; 431 430 } 432 431 //below 433 432 if(ctuBelow != NULL) 434 433 { 435 isBelowAvail = (ctuCurr->getSlice()->getSliceCurStartC UAddr() != ctuBelow->getSlice()->getSliceCurStartCUAddr())?ctuBelow->getSlice()->getLFCrossSliceBoundaryFlag():true;434 isBelowAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuBelow->getSlice()->getSliceCurStartCtuTsAddr())?ctuBelow->getSlice()->getLFCrossSliceBoundaryFlag():true; 436 435 } 437 436 //above-left 438 437 if(ctuAboveLeft != NULL) 439 438 { 440 isAboveLeftAvail = (ctuCurr->getSlice()->getSliceCurStartC UAddr() != ctuAboveLeft->getSlice()->getSliceCurStartCUAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true;439 isAboveLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuAboveLeft->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; 441 440 } 442 441 //below-right 443 442 if(ctuBelowRight != NULL) 444 443 { 445 isBelowRightAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuBelowRight->getSlice()->getSliceCurStartCUAddr())?ctuBelowRight->getSlice()->getLFCrossSliceBoundaryFlag():true; 446 } 447 444 isBelowRightAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuBelowRight->getSlice()->getSliceCurStartCtuTsAddr())?ctuBelowRight->getSlice()->getLFCrossSliceBoundaryFlag():true; 445 } 448 446 449 447 //above-right 450 if(ctuAboveRig tht != NULL)451 { 452 Int curSliceStart EncOrder = ctuCurr->getSlice()->getSliceCurStartCUAddr();453 Int aboveRig thtSliceStartEncOrder = ctuAboveRigtht->getSlice()->getSliceCurStartCUAddr();454 455 isAboveRightAvail = (curSliceStart EncOrder == aboveRigthtSliceStartEncOrder)?(true):448 if(ctuAboveRight != NULL) 449 { 450 Int curSliceStartTsAddr = ctuCurr->getSlice()->getSliceCurStartCtuTsAddr(); 451 Int aboveRightSliceStartTsAddr = ctuAboveRight->getSlice()->getSliceCurStartCtuTsAddr(); 452 453 isAboveRightAvail = (curSliceStartTsAddr == aboveRightSliceStartTsAddr)?(true): 456 454 ( 457 (curSliceStart EncOrder > aboveRigthtSliceStartEncOrder)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag())458 :(ctuAboveRig tht->getSlice()->getLFCrossSliceBoundaryFlag())459 ); 455 (curSliceStartTsAddr > aboveRightSliceStartTsAddr)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag()) 456 :(ctuAboveRight->getSlice()->getLFCrossSliceBoundaryFlag()) 457 ); 460 458 } 461 459 //below-left 462 460 if(ctuBelowLeft != NULL) 463 461 { 464 Int curSliceStart EncOrder = ctuCurr->getSlice()->getSliceCurStartCUAddr();465 Int belowLeftSliceStart EncOrder = ctuBelowLeft->getSlice()->getSliceCurStartCUAddr();466 467 isBelowLeftAvail = (curSliceStart EncOrder == belowLeftSliceStartEncOrder)?(true):462 Int curSliceStartTsAddr = ctuCurr->getSlice()->getSliceCurStartCtuTsAddr(); 463 Int belowLeftSliceStartTsAddr = ctuBelowLeft->getSlice()->getSliceCurStartCtuTsAddr(); 464 465 isBelowLeftAvail = (curSliceStartTsAddr == belowLeftSliceStartTsAddr)?(true): 468 466 ( 469 (curSliceStart EncOrder > belowLeftSliceStartEncOrder)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag())467 (curSliceStartTsAddr > belowLeftSliceStartTsAddr)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag()) 470 468 :(ctuBelowLeft->getSlice()->getLFCrossSliceBoundaryFlag()) 471 469 ); 472 } 470 } 473 471 } 474 472 475 473 if(!isLoopFiltAcrossTilePPS) 476 { 477 isLeftAvail = (!isLeftAvail ) ?false:(getTileIdxMap( ctuLeft->getAddr() ) == getTileIdxMap( ctu )); 478 isAboveAvail = (!isAboveAvail ) ?false:(getTileIdxMap( ctuAbove->getAddr() ) == getTileIdxMap( ctu )); 479 isRightAvail = (!isRightAvail ) ?false:(getTileIdxMap( ctuRight->getAddr() ) == getTileIdxMap( ctu )); 480 isBelowAvail = (!isBelowAvail ) ?false:(getTileIdxMap( ctuBelow->getAddr() ) == getTileIdxMap( ctu )); 481 isAboveLeftAvail = (!isAboveLeftAvail ) ?false:(getTileIdxMap( ctuAboveLeft->getAddr() ) == getTileIdxMap( ctu )); 482 isAboveRightAvail= (!isAboveRightAvail) ?false:(getTileIdxMap( ctuAboveRigtht->getAddr() ) == getTileIdxMap( ctu )); 483 isBelowLeftAvail = (!isBelowLeftAvail ) ?false:(getTileIdxMap( ctuBelowLeft->getAddr() ) == getTileIdxMap( ctu )); 484 isBelowRightAvail= (!isBelowRightAvail) ?false:(getTileIdxMap( ctuBelowRight->getAddr() ) == getTileIdxMap( ctu )); 485 } 486 } 487 488 } 474 { 475 isLeftAvail = (!isLeftAvail ) ?false:(getTileIdxMap( ctuLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 476 isAboveAvail = (!isAboveAvail ) ?false:(getTileIdxMap( ctuAbove->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 477 isRightAvail = (!isRightAvail ) ?false:(getTileIdxMap( ctuRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 478 isBelowAvail = (!isBelowAvail ) ?false:(getTileIdxMap( ctuBelow->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 479 isAboveLeftAvail = (!isAboveLeftAvail ) ?false:(getTileIdxMap( ctuAboveLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 480 isAboveRightAvail= (!isAboveRightAvail) ?false:(getTileIdxMap( ctuAboveRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 481 isBelowLeftAvail = (!isBelowLeftAvail ) ?false:(getTileIdxMap( ctuBelowLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 482 isBelowRightAvail= (!isBelowRightAvail) ?false:(getTileIdxMap( ctuBelowRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); 483 } 484 } 485 486 } 487 489 488 490 489 TComTile::TComTile() 491 : m_uiTileWidth (0) 492 , m_uiTileHeight (0) 493 , m_uiRightEdgePosInCU (0) 494 , m_uiBottomEdgePosInCU (0) 495 , m_uiFirstCUAddr (0) 496 490 : m_tileWidthInCtus (0) 491 , m_tileHeightInCtus (0) 492 , m_rightEdgePosInCtus (0) 493 , m_bottomEdgePosInCtus (0) 494 , m_firstCtuRsAddr (0) 497 495 { 498 496 }
Note: See TracChangeset for help on using the changeset viewer.