Ticket #1060: wpp_contexts_r2.patch

File wpp_contexts_r2.patch, 1.9 KB (added by ksuehring, 11 years ago)
  • source/Lib/TLibDecoder/TDecSlice.h

     
    8383  Void  decompressSlice   ( TComInputBitstream** ppcSubstreams,   TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders );
    8484  Void      initCtxMem(  UInt i );
    8585  Void      setCtxMem( TDecSbac* sb, Int b )   { CTXMem[b] = sb; }
     86  Int       getCtxMemSize( )                   { return (Int)CTXMem.size(); }
    8687};
    8788
    8889
  • source/Lib/TLibDecoder/TDecTop.cpp

     
    265265    assert (0);
    266266  }
    267267
     268  if( pps->getDependentSliceSegmentsEnabledFlag() )
     269  {
     270    Int NumCtx = pps->getEntropyCodingSyncEnabledFlag()?2:1;
     271
     272    if (m_cSliceDecoder.getCtxMemSize() != NumCtx)
     273    {
     274      m_cSliceDecoder.initCtxMem(NumCtx);
     275      for ( UInt st = 0; st < NumCtx; st++ )
     276      {
     277        TDecSbac* ctx = NULL;
     278        ctx = new TDecSbac;
     279        ctx->init( &m_cBinCABAC );
     280        m_cSliceDecoder.setCtxMem( ctx, st );
     281      }
     282    }
     283  }
     284
    268285  m_apcSlicePilot->setPPS(pps);
    269286  m_apcSlicePilot->setSPS(sps);
    270287  pps->setSPS(sps);
     
    612629  TComPPS* pps = new TComPPS();
    613630  m_cEntropyDecoder.decodePPS( pps );
    614631  m_parameterSetManagerDecoder.storePrefetchedPPS( pps );
    615 
    616   if( pps->getDependentSliceSegmentsEnabledFlag() )
    617   {
    618     Int NumCtx = pps->getEntropyCodingSyncEnabledFlag()?2:1;
    619     m_cSliceDecoder.initCtxMem(NumCtx);
    620     for ( UInt st = 0; st < NumCtx; st++ )
    621     {
    622       TDecSbac* ctx = NULL;
    623       ctx = new TDecSbac;
    624       ctx->init( &m_cBinCABAC );
    625       m_cSliceDecoder.setCtxMem( ctx, st );
    626     }
    627   }
    628632}
    629633
    630634Void TDecTop::xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType )