Ticket #735: HM-8.0-ticket735-fix.patch

File HM-8.0-ticket735-fix.patch, 2.7 KB (added by kchono, 10 years ago)
  • source/Lib/TLibCommon/TComLoopFilter.cpp

     
    648648        Int dq = dq0 + dq3;
    649649        Int d =  d0 + d3;
    650650       
    651         if (bPCMFilter)
     651        if (bPCMFilter || pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
    652652        {
    653           // Check if each of PUs is I_PCM
    654           bPartPNoFilter = (pcCUP->getIPCMFlag(uiPartPIdx));
    655           bPartQNoFilter = (pcCUQ->getIPCMFlag(uiPartQIdx));
     653          // Check if each of PUs is I_PCM with LF disabling
     654          bPartPNoFilter = (bPCMFilter && pcCUP->getIPCMFlag(uiPartPIdx));
     655          bPartQNoFilter = (bPCMFilter && pcCUQ->getIPCMFlag(uiPartQIdx));
     656
     657          // check if each of PUs is lossless coded
     658          bPartPNoFilter = bPartPNoFilter || (pcCUP->isLosslessCoded(uiPartPIdx) );
     659          bPartQNoFilter = bPartQNoFilter || (pcCUQ->isLosslessCoded(uiPartQIdx) );
    656660        }
    657         // check if each of PUs is lossless coded
    658         bPartPNoFilter = bPartPNoFilter || (pcCUP->isLosslessCoded(uiPartPIdx) );
    659         bPartQNoFilter = bPartQNoFilter || (pcCUQ->isLosslessCoded(uiPartQIdx) );
     661
    660662        if (d < iBeta)
    661663        {
    662664          Bool bFilterP = (dp < iSideThreshold);
     
    761763      Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET*(ucBs - 1) + (m_tcOffsetDiv2 << 1));
    762764      Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
    763765     
    764       if(bPCMFilter)
     766      if (bPCMFilter || pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
    765767      {
    766         // Check if each of PUs is IPCM
    767         bPartPNoFilter = (pcCUP->getIPCMFlag(uiPartPIdx));
    768         bPartQNoFilter = (pcCUQ->getIPCMFlag(uiPartQIdx));
     768        // Check if each of PUs is I_PCM with LF disabling
     769        bPartPNoFilter = (bPCMFilter && pcCUP->getIPCMFlag(uiPartPIdx));
     770        bPartQNoFilter = (bPCMFilter && pcCUQ->getIPCMFlag(uiPartQIdx));
     771
     772        // check if each of PUs is lossless coded
     773        bPartPNoFilter = bPartPNoFilter || (pcCUP->isLosslessCoded(uiPartPIdx));
     774        bPartQNoFilter = bPartQNoFilter || (pcCUQ->isLosslessCoded(uiPartQIdx));
    769775      }
    770776     
    771       // check if each of PUs is lossless coded
    772       bPartPNoFilter = bPartPNoFilter || (pcCUP->isLosslessCoded(uiPartPIdx));
    773       bPartQNoFilter = bPartQNoFilter || (pcCUQ->isLosslessCoded(uiPartQIdx));
    774777      for ( UInt uiStep = 0; uiStep < uiPelsInPartChroma; uiStep++ )
    775778      {
    776779        xPelFilterChroma( piTmpSrcCb + iSrcStep*(uiStep+iIdx*uiPelsInPartChroma), iOffset, iTc , bPartPNoFilter, bPartQNoFilter);