Ticket #516: weighted_pred_bug.patch

File weighted_pred_bug.patch, 1.2 KB (added by bheng, 12 years ago)
  • Lib/TLibCommon/TComPrediction.cpp

     
    523523    }
    524524    else
    525525    {
    526       if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() )
     526      if ( ( pcCU->getSlice()->getPPS()->getUseWP()       && pcCU->getSlice()->getSliceType() == P_SLICE ) ||
     527           ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() && pcCU->getSlice()->getSliceType() == B_SLICE ) )
    527528      {
    528529        xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
    529530      }
     
    534535    }
    535536  }
    536537
    537   if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() )
     538  if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() && pcCU->getSlice()->getSliceType() == B_SLICE  )
    538539  {
    539540    xWeightedPredictionBi( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
     541  } 
     542  else if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType() == P_SLICE )
     543  {
     544    xWeightedPredictionUni( pcCU, &m_acYuvPred[0], uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, rpcYuvPred, iPartIdx );
    540545  }
    541546  else
    542547  {