Ticket #635: j0033-80dev-r2753.patch

File j0033-80dev-r2753.patch, 5.7 KB (added by gordon, 12 years ago)
  • source/Lib/TLibDecoder/TDecSlice.cpp

     
    210210    uiTileWidth = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileWidth();
    211211    uiTileHeight = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileHeight();
    212212    uiCol     = iCUAddr % uiWidthInLCUs;
    213     uiLin     = iCUAddr / uiWidthInLCUs;
     213    // The 'line' is now relative to the 1st line in the slice, not the 1st line in the picture.
     214    uiLin     = (iCUAddr/uiWidthInLCUs)-(iStartCUAddr/uiWidthInLCUs);
    214215    // inherit from TR if necessary, select substream to use.
    215216#if DEPENDENT_SLICES
    216217#if TILES_WPP_ENTROPYSLICES_FLAGS
  • source/Lib/TLibDecoder/TDecGop.cpp

     
    130130  m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC );
    131131  m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder);
    132132
    133   UInt uiNumSubstreams = pcSlice->getPPS()->getNumSubstreams();
     133#if TILES_WPP_ENTROPYSLICES_FLAGS
     134  UInt uiNumSubstreams = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams();
     135#else
     136  UInt uiNumSubstreams = pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc() == 2 ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams();
     137#endif
    134138
    135139  // init each couple {EntropyDecoder, Substream}
    136140  UInt *puiSubstreamSizes = pcSlice->getSubstreamSizes();
  • source/Lib/TLibDecoder/TDecCAVLC.cpp

     
    15591559      else if ( pps->getEntropyCodingSyncEnabledFlag() )
    15601560#endif
    15611561      {
    1562         Int numSubstreams = pps->getNumSubstreams();
     1562      Int numSubstreams = rpcSlice->getNumEntryPointOffsets()+1;
    15631563        rpcSlice->allocSubstreamSizes(numSubstreams);
    15641564        UInt *pSubstreamSizes       = rpcSlice->getSubstreamSizes();
    15651565        for (Int idx=0; idx<numSubstreams-1; idx++)
  • source/Lib/TLibEncoder/TEncGOP.cpp

     
    10331033              }
    10341034            }
    10351035#endif
    1036             for ( UInt ui = 0 ; ui < pcSlice->getPPS()->getNumSubstreams(); ui++ )
    1037             {
    1038               pcOut->addSubstream(&pcSubstreamsOut[ui]);
     1036          Int offs = 0;
     1037          Int nss = pcSlice->getPPS()->getNumSubstreams();
     1038#if TILES_WPP_ENTROPYSLICES_FLAGS
     1039          if (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
     1040#else
     1041          if (pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc() == 2)
     1042#endif
     1043          {
     1044            // 1st line present for WPP.
     1045            offs = pcSlice->getSliceCurStartCUAddr()/pcSlice->getPic()->getNumPartInCU()/pcSlice->getPic()->getFrameWidthInCU();
     1046            nss  = pcSlice->getNumEntryPointOffsets()+1;
     1047          }
     1048          for ( UInt ui = 0 ; ui < nss; ui++ )
     1049          {
     1050            pcOut->addSubstream(&pcSubstreamsOut[ui+offs]);
    10391051            }
    10401052          }
    10411053
  • source/Lib/TLibEncoder/TEncCavlc.cpp

     
    11151115  }
    11161116
    11171117  UInt numEntryPointOffsets = 0, offsetLenMinus1 = 0, maxOffset = 0;
     1118  Int  numZeroSubstreamsAtStartOfSlice  = 0;
    11181119  UInt *entryPointOffset = NULL;
    11191120#if TILES_WPP_ENTROPYSLICES_FLAGS
    11201121  if ( pSlice->getPPS()->getTilesEnabledFlag() )
     
    11471148  else if (tilesOrEntropyCodingSyncIdc == 2) // wavefront
    11481149#endif
    11491150  {
    1150     Int  numZeroSubstreamsAtEndOfSlice  = 0;
    11511151    UInt* pSubstreamSizes               = pSlice->getSubstreamSizes();
    1152     // Find number of zero substreams at the end of slice
    1153     for (Int idx=pSlice->getPPS()->getNumSubstreams()-2; idx>=0; idx--)
    1154     {
    1155       if ( pSubstreamSizes[ idx ] ==  0 )
    1156       {
    1157         numZeroSubstreamsAtEndOfSlice++;
    1158       }
    1159       else
    1160       {
    1161         break;
    1162       }
    1163     }
    1164     numEntryPointOffsets       = pSlice->getPPS()->getNumSubstreams() - 1 - numZeroSubstreamsAtEndOfSlice;
     1152    Int maxNumParts                       = pSlice->getPic()->getNumPartInCU();
     1153    numZeroSubstreamsAtStartOfSlice       = pSlice->getSliceCurStartCUAddr()/maxNumParts/pSlice->getPic()->getFrameWidthInCU();
     1154    Int  numZeroSubstreamsAtEndOfSlice    = pSlice->getPic()->getFrameHeightInCU()-1 - ((pSlice->getSliceCurEndCUAddr()-1)/maxNumParts/pSlice->getPic()->getFrameWidthInCU());
     1155    numEntryPointOffsets                  = pSlice->getPPS()->getNumSubstreams() - numZeroSubstreamsAtStartOfSlice - numZeroSubstreamsAtEndOfSlice - 1;
     1156    pSlice->setNumEntryPointOffsets(numEntryPointOffsets);
    11651157    entryPointOffset           = new UInt[numEntryPointOffsets];
    11661158    for (Int idx=0; idx<numEntryPointOffsets; idx++)
    11671159    {
    1168       entryPointOffset[ idx ] = ( pSubstreamSizes[ idx ] >> 3 ) ;
     1160      entryPointOffset[ idx ] = ( pSubstreamSizes[ idx+numZeroSubstreamsAtStartOfSlice ] >> 3 ) ;
    11691161      if ( entryPointOffset[ idx ] > maxOffset )
    11701162      {
    11711163        maxOffset = entryPointOffset[ idx ];