Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecSlice.cpp


Ignore:
Timestamp:
20 Feb 2013, 22:07:43 (11 years ago)
Author:
tech
Message:

Reintegrated branch 5.1-dev0 rev. 295.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r210 r296  
    148148  UInt uiCol=0, uiLin=0, uiSubStrm=0;
    149149
    150 #if !REMOVE_TILE_DEPENDENCE
    151   Int iBreakDep;
    152 #endif
    153150  UInt uiTileCol;
    154151  UInt uiTileStartLCU;
     
    163160    pcCU = rpcPic->getCU( iCUAddr );
    164161    pcCU->initCU( rpcPic, iCUAddr );
    165 #if !REMOVE_TILE_DEPENDENCE
    166     iBreakDep = rpcPic->getPicSym()->getTileBoundaryIndependenceIdr();
    167 #endif
    168162    uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // what column of tiles are we in?
    169163    uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr();
     
    175169    uiLin     = iCUAddr / uiWidthInLCUs;
    176170    // inherit from TR if necessary, select substream to use.
    177 #if WPP_SIMPLIFICATION
    178171    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    {
    191173      if (pcSlice->getPPS()->getNumSubstreams() > 1)
    192 #else
    193       if (pcSlice->getPPS()->getEntropyCodingSynchro())
    194 #endif
    195 #endif
    196174      {
    197175        // independent tiles => substreams are "per tile".  iNumSubstreams has already been multiplied.
     
    207185      m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] );
    208186      // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.
    209 #if WPP_SIMPLIFICATION
    210187      if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX)
    211 #else
    212       if (pcSlice->getPPS()->getEntropyCodingSynchro() && uiCol == uiTileLCUX)
    213 #endif
    214188      {
    215189        // We'll sync if the TR is available.
     
    217191        UInt uiWidthInCU = rpcPic->getFrameWidthInCU();
    218192        TComDataCU *pcCUTR = NULL;
    219 #if WPP_SIMPLIFICATION
    220193        if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU)  )
    221194        {
    222195          pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 );
    223196        }
    224 #else
    225         if ( pcCUUp && ((iCUAddr%uiWidthInCU+pcSlice->getPPS()->getEntropyCodingSynchro()) < uiWidthInCU)  )
    226         {
    227           pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + pcSlice->getPPS()->getEntropyCodingSynchro() );
    228         }
    229 #endif
    230197        UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);
    231198
     
    233200             ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||
    234201             ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) ||
    235 #if !REMOVE_TILE_DEPENDENCE
    236              (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
    237 #else
    238202             ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
    239 #endif
    240203             ))||
    241204             (true/*bEnforceEntropySliceRestriction*/ &&
    242205             ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||
    243206             ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr()) ||
    244 #if !REMOVE_TILE_DEPENDENCE
    245              (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
    246 #else
    247207             ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
    248 #endif
    249208             ))
    250209           )
     
    260219      pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]);  //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
    261220    }
    262 #if WPP_SIMPLIFICATION
    263221    else if ( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() <= 1 )
    264 #else
    265     else if ( iSymbolMode && !pcSlice->getPPS()->getEntropyCodingSynchro() )
    266 #endif
    267222    {
    268223      // Set variables to appropriate values to avoid later code change.
     
    273228         (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())) // !1st in frame && !1st in slice
    274229    {
    275 #if WPP_SIMPLIFICATION
    276230      if (pcSlice->getPPS()->getNumSubstreams() > 1)
    277 #else
    278       if (pcSlice->getPPS()->getEntropyCodingSynchro())
    279 #endif
    280231      {
    281232        // We're crossing into another tile, tiles are independent.
     
    330281    }
    331282
    332 #if !REMOVE_TILE_DEPENDENCE
    333     if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )
    334     {   
    335       // Synchronize cabac probabilities with LCU among Tiles
    336       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         else
    357         {
    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 #endif
    365283
    366284
     
    368286    g_bJustDoIt = g_bEncDecTraceEnable;
    369287#endif
    370 #if SAO_UNIT_INTERLEAVING
    371288    if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() )
    372289    {
     
    384301      pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() );
    385302    }
    386 #endif
    387303
    388304    m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
     
    394310    if( iSymbolMode )
    395311    {
    396 #if OL_FLUSH
    397312      /*If at the end of a LCU line but not at the end of a substream, perform CABAC flush*/
    398 #if WPP_SIMPLIFICATION
    399313      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      {
    408315        if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight))
    409 #endif
    410316        {
    411317          m_pcEntropyDecoder->decodeFlush();
    412318        }
    413319      }
    414 #endif
    415320      pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
    416321
    417322      //Store probabilities of second LCU in line into buffer
    418 #if WPP_SIMPLIFICATION
    419323      if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiCol == uiTileLCUX+1))
    420 #else
    421       if (pcSlice->getPPS()->getEntropyCodingSynchro() && (uiCol == uiTileLCUX+pcSlice->getPPS()->getEntropyCodingSynchro()))
    422 #endif
    423324      {
    424325        m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );
     
    426327
    427328    }
    428 #if !REMOVE_TILE_DEPENDENCE
    429     if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )
    430     {
    431       pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
    432        //Store probabilties for next tile
    433       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 #endif
    440329  }
    441330
Note: See TracChangeset for help on using the changeset viewer.