Ticket #1054: Ticket_1054_r1.patch

File Ticket_1054_r1.patch, 4.2 KB (added by rickard, 11 years ago)

New patch Ticket_1054_r1.patch attached which solves problems that the previous patch did not. NOTE: The attached patch file was created with respect to HM-10.0-dev r3391.

  • source/Lib/TLibCommon/TComSlice.cpp

     
    254254  while ( iterPic != rcListPic.end() )
    255255  {
    256256    pcPic = *(iterPic);
    257     if (pcPic)
     257    if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced())
    258258    {
    259259      Int picPoc = pcPic->getPOC();
    260260      if (!pocHasMsb)
     
    836836  TComPic* rpcPic;
    837837  Int i, isReference;
    838838
    839   Int j = 0;
    840839  // loop through all pictures in the reference picture buffer
    841840  TComList<TComPic*>::iterator iterPic = rcListPic.begin();
    842841  while ( iterPic != rcListPic.end())
    843842  {
    844     j++;
    845843    rpcPic = *(iterPic++);
    846844
     845    if(!rpcPic->getSlice( 0 )->isReferenced())
     846    {
     847      continue;
     848    }
     849
    847850    isReference = 0;
    848851    // loop through all pictures in the Reference Picture Set
    849852    // to see if the picture should be kept as reference picture
     
    880883    // the Reference Picture Set
    881884    if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && isReference == 0)   
    882885    {           
    883       rpcPic->getSlice( 0 )->setReferenced( false );   
     886      rpcPic->getSlice( 0 )->setReferenced( false );
     887      rpcPic->setUsedByCurr(0);
    884888      rpcPic->setIsLongTerm(0);
    885889    }
    886890    //check that pictures of higher temporal layers are not used
     
    903907Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
    904908{
    905909  TComPic* rpcPic;
    906   Int i, isAvailable, j;
     910  Int i, isAvailable;
    907911  Int atLeastOneLost = 0;
    908912  Int atLeastOneRemoved = 0;
    909913  Int iPocLost = 0;
     
    912916  // to see if the picture should be kept as reference picture
    913917  for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++)
    914918  {
    915     j = 0;
    916919    isAvailable = 0;
    917920    // loop through all pictures in the reference picture buffer
    918921    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
    919922    while ( iterPic != rcListPic.end())
    920923    {
    921       j++;
    922924      rpcPic = *(iterPic++);
    923925      if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
    924926      {
     
    941943      iterPic = rcListPic.begin();
    942944      while ( iterPic != rcListPic.end())
    943945      {
    944         j++;
    945946        rpcPic = *(iterPic++);
    946947
    947948        Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     
    986987        }
    987988      }
    988989    }
    989   } 
     990  }
    990991  // loop through all short-term pictures in the Reference Picture Set
    991992  // to see if the picture should be kept as reference picture
    992993  for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++)
    993994  {
    994     j = 0;
    995995    isAvailable = 0;
    996996    // loop through all pictures in the reference picture buffer
    997997    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
    998998    while ( iterPic != rcListPic.end())
    999999    {
    1000       j++;
    10011000      rpcPic = *(iterPic++);
    10021001
    10031002      if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced())
  • source/Lib/TLibDecoder/TDecCAVLC.cpp

     
    974974          {
    975975            READ_UVLC( uiCode, "delta_poc_msb_cycle_lt[i]" );
    976976            Bool deltaFlag = false;
    977             //            First LTRP                               || First LTRP from SH           || curr LSB    != prev LSB
    978             if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) || (pocLsbLt != prevLSB) )
     977            //            First LTRP                               || First LTRP from SH
     978            if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) )
    979979            {
    980980              deltaFlag = true;
    981981            }