Changeset 880 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 29 Aug 2014, 23:48:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r834 r880 146 146 UInt uiTilesAcross = rpcPic->getPicSym()->getNumColumnsMinus1()+1; 147 147 TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx()); 148 #if !WPP_FIX 148 149 Int iNumSubstreams = pcSlice->getPPS()->getNumSubstreams(); 150 #endif 149 151 150 152 // delete decoders if already allocated in previous slice … … 193 195 UInt uiWidthInLCUs = rpcPic->getPicSym()->getFrameWidthInCU(); 194 196 //UInt uiHeightInLCUs = rpcPic->getPicSym()->getFrameHeightInCU(); 197 198 #if WPP_FIX 199 UInt uiTileCol; 200 UInt uiTileLCUX; 201 const Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag(); 202 const UInt startTileIdx=rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr); 203 TComTile *pCurrentTile=rpcPic->getPicSym()->getTComTile(startTileIdx); 204 UInt uiTileStartLCU = pCurrentTile->getFirstCUAddr(); // Code tidy 205 206 // The first LCU of the slice is the first coded substream, but the global substream number, as calculated by getSubstreamForLCUAddr may be higher. 207 // This calculates the common offset for all substreams in this slice. 208 const UInt subStreamOffset=rpcPic->getSubstreamForLCUAddr(iStartCUAddr, true, pcSlice); 209 #else 195 210 UInt uiCol=0, uiLin=0, uiSubStrm=0; 196 211 … … 201 216 Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag(); 202 217 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr(); 218 #endif 203 219 if( depSliceSegmentsEnabled ) 204 220 { 221 #if WPP_FIX 222 if( (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->isNextSlice()) && iStartCUAddr != uiTileStartLCU) // Code tidy // Is this a dependent slice segment and not the start of a tile? 223 #else 205 224 if( (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->isNextSlice()) && 206 225 iStartCUAddr != rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr()) 226 #endif 207 227 { 208 228 if(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) 209 229 { 230 #if WPP_FIX 231 uiTileCol = startTileIdx % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // Code tidy 232 #else 210 233 uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); 234 #endif 211 235 m_pcBufferSbacDecoders[uiTileCol].loadContexts( CTXMem[1] );//2.LCU 236 #if WPP_FIX 237 if ( pCurrentTile->getTileWidth() < 2) 238 { 239 CTXMem[0]->loadContexts(pcSbacDecoder); // If tile width is less than 2, need to ensure CTX states get initialised to un-adapted CABAC. Set here, to load a few lines later (!) 240 } 241 #else 212 242 if ( (iStartCUAddr%uiWidthInLCUs+1) >= uiWidthInLCUs ) 213 243 { … … 219 249 } 220 250 } 251 #endif 221 252 } 222 253 pcSbacDecoder->loadContexts(CTXMem[0] ); //end of depSlice-1 254 #if WPP_FIX 255 pcSbacDecoders[0].loadContexts(pcSbacDecoder); // The first substream used for the slice will always be 0. (The original code was equivalent) 256 #else 223 257 pcSbacDecoders[uiSubStrm].loadContexts(pcSbacDecoder); 258 #endif 224 259 } 225 260 else … … 239 274 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr(); 240 275 uiTileLCUX = uiTileStartLCU % uiWidthInLCUs; 276 #if WPP_FIX 277 UInt uiCol = iCUAddr % uiWidthInLCUs; 278 UInt uiSubStrm=rpcPic->getSubstreamForLCUAddr(iCUAddr, true, pcSlice)-subStreamOffset; 279 #else 241 280 uiCol = iCUAddr % uiWidthInLCUs; 242 281 // The 'line' is now relative to the 1st line in the slice, not the 1st line in the picture. 243 282 uiLin = (iCUAddr/uiWidthInLCUs)-(iStartCUAddr/uiWidthInLCUs); 283 #endif 244 284 // inherit from TR if necessary, select substream to use. 245 285 if( (pcSlice->getPPS()->getNumSubstreams() > 1) || ( depSliceSegmentsEnabled && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) )) 246 286 { 287 #if !WPP_FIX 247 288 // independent tiles => substreams are "per tile". iNumSubstreams has already been multiplied. 248 289 iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles(); 249 290 uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(iCUAddr)*iNumSubstreamsPerTile 250 291 + uiLin%iNumSubstreamsPerTile; 292 #endif 251 293 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] ); 252 294 // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line. … … 280 322 pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders) 281 323 } 324 #if !WPP_FIX 282 325 else if ( pcSlice->getPPS()->getNumSubstreams() <= 1 ) 283 326 { … … 285 328 iNumSubstreamsPerTile = 1; 286 329 } 330 #endif 287 331 288 332 if ( (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) && // 1st in tile.
Note: See TracChangeset for help on using the changeset viewer.