Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecSlice.cpp
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r210 r296 148 148 UInt uiCol=0, uiLin=0, uiSubStrm=0; 149 149 150 #if !REMOVE_TILE_DEPENDENCE151 Int iBreakDep;152 #endif153 150 UInt uiTileCol; 154 151 UInt uiTileStartLCU; … … 163 160 pcCU = rpcPic->getCU( iCUAddr ); 164 161 pcCU->initCU( rpcPic, iCUAddr ); 165 #if !REMOVE_TILE_DEPENDENCE166 iBreakDep = rpcPic->getPicSym()->getTileBoundaryIndependenceIdr();167 #endif168 162 uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // what column of tiles are we in? 169 163 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr(); … … 175 169 uiLin = iCUAddr / uiWidthInLCUs; 176 170 // inherit from TR if necessary, select substream to use. 177 #if WPP_SIMPLIFICATION178 171 if( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() > 1 ) 179 #else 180 if( iSymbolMode && pcSlice->getPPS()->getEntropyCodingSynchro() ) 181 #endif 182 { 183 #if !REMOVE_TILE_DEPENDENCE 184 #if WPP_SIMPLIFICATION 185 if (iBreakDep && pcSlice->getPPS()->getNumSubstreams() > 1) 186 #else 187 if (iBreakDep && pcSlice->getPPS()->getEntropyCodingSynchro()) 188 #endif 189 #else 190 #if WPP_SIMPLIFICATION 172 { 191 173 if (pcSlice->getPPS()->getNumSubstreams() > 1) 192 #else193 if (pcSlice->getPPS()->getEntropyCodingSynchro())194 #endif195 #endif196 174 { 197 175 // independent tiles => substreams are "per tile". iNumSubstreams has already been multiplied. … … 207 185 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] ); 208 186 // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line. 209 #if WPP_SIMPLIFICATION210 187 if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX) 211 #else212 if (pcSlice->getPPS()->getEntropyCodingSynchro() && uiCol == uiTileLCUX)213 #endif214 188 { 215 189 // We'll sync if the TR is available. … … 217 191 UInt uiWidthInCU = rpcPic->getFrameWidthInCU(); 218 192 TComDataCU *pcCUTR = NULL; 219 #if WPP_SIMPLIFICATION220 193 if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU) ) 221 194 { 222 195 pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 ); 223 196 } 224 #else225 if ( pcCUUp && ((iCUAddr%uiWidthInCU+pcSlice->getPPS()->getEntropyCodingSynchro()) < uiWidthInCU) )226 {227 pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + pcSlice->getPPS()->getEntropyCodingSynchro() );228 }229 #endif230 197 UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1); 231 198 … … 233 200 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 234 201 ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) || 235 #if !REMOVE_TILE_DEPENDENCE236 (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))237 #else238 202 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))) 239 #endif240 203 ))|| 241 204 (true/*bEnforceEntropySliceRestriction*/ && 242 205 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 243 206 ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr()) || 244 #if !REMOVE_TILE_DEPENDENCE245 (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))246 #else247 207 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))) 248 #endif249 208 )) 250 209 ) … … 260 219 pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders) 261 220 } 262 #if WPP_SIMPLIFICATION263 221 else if ( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() <= 1 ) 264 #else265 else if ( iSymbolMode && !pcSlice->getPPS()->getEntropyCodingSynchro() )266 #endif267 222 { 268 223 // Set variables to appropriate values to avoid later code change. … … 273 228 (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())) // !1st in frame && !1st in slice 274 229 { 275 #if WPP_SIMPLIFICATION276 230 if (pcSlice->getPPS()->getNumSubstreams() > 1) 277 #else278 if (pcSlice->getPPS()->getEntropyCodingSynchro())279 #endif280 231 { 281 232 // We're crossing into another tile, tiles are independent. … … 330 281 } 331 282 332 #if !REMOVE_TILE_DEPENDENCE333 if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )334 {335 // Synchronize cabac probabilities with LCU among Tiles336 if( (uiTileLCUX != 0) &&337 (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) )338 {339 TComDataCU *pcCULeft = pcCU->getCULeft();340 UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);341 342 if ( (true/*bEnforceSliceRestriction*/ &&343 ((pcCULeft==NULL) || (pcCULeft->getSlice()==NULL) ||344 ((pcCULeft->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr())345 )346 )||347 (true/*bEnforceEntropySliceRestriction*/ &&348 ((pcCULeft==NULL) || (pcCULeft->getSlice()==NULL) ||349 ((pcCULeft->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr())350 )351 )352 )353 {354 // Left not available.355 }356 else357 {358 // Left is available, we use it.359 pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferLowLatSbacDecoders[uiTileCol-1] );360 pcSbacDecoder->loadContexts(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)361 }362 }363 }364 #endif365 283 366 284 … … 368 286 g_bJustDoIt = g_bEncDecTraceEnable; 369 287 #endif 370 #if SAO_UNIT_INTERLEAVING371 288 if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() ) 372 289 { … … 384 301 pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() ); 385 302 } 386 #endif387 303 388 304 m_pcCuDecoder->decodeCU ( pcCU, uiIsLast ); … … 394 310 if( iSymbolMode ) 395 311 { 396 #if OL_FLUSH397 312 /*If at the end of a LCU line but not at the end of a substream, perform CABAC flush*/ 398 #if WPP_SIMPLIFICATION399 313 if (!uiIsLast && pcSlice->getPPS()->getNumSubstreams() > 1) 400 #else 401 if (!uiIsLast && pcSlice->getPPS()->getCabacIstateReset()) 402 #endif 403 { 404 #if !REMOVE_TILE_DEPENDENCE 405 if ((iBreakDep && (uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight)) 406 || (!iBreakDep && (uiCol == uiWidthInLCUs-1) && (uiLin+iNumSubstreams < pcCU->getPic()->getFrameHeightInCU()))) 407 #else 314 { 408 315 if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight)) 409 #endif410 316 { 411 317 m_pcEntropyDecoder->decodeFlush(); 412 318 } 413 319 } 414 #endif415 320 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder); 416 321 417 322 //Store probabilities of second LCU in line into buffer 418 #if WPP_SIMPLIFICATION419 323 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiCol == uiTileLCUX+1)) 420 #else421 if (pcSlice->getPPS()->getEntropyCodingSynchro() && (uiCol == uiTileLCUX+pcSlice->getPPS()->getEntropyCodingSynchro()))422 #endif423 324 { 424 325 m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] ); … … 426 327 427 328 } 428 #if !REMOVE_TILE_DEPENDENCE429 if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )430 {431 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);432 //Store probabilties for next tile433 if( (uiLin == (rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr() / uiWidthInLCUs )) &&434 (uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU()) )435 {436 m_pcBufferLowLatSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );437 }438 }439 #endif440 329 } 441 330
Note: See TracChangeset for help on using the changeset viewer.