﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
735	HM8.0 bug in DBLK + lossless	madhukar		"Deblocking filter implmentation has a problem when both PCM and lossless is enabled at the same time.

In TComLoopFilter::xEdgeFilterLuma() (similar in TComLoopFilter::xEdgeFilterChroma()), 

{{{
  Bool  bPCMFilter = (pcCU->getSlice()->getSPS()->getUsePCM() && pcCU->getSlice()->getSPS()->getPCMFilterDisableFlag())? true : false;
  Bool  bPartPNoFilter = false;
  Bool  bPartQNoFilter = false;
  ....
  for ( UInt iIdx = 0; iIdx < uiNumParts; iIdx++ )
  ...
        if (bPCMFilter)
        {
          // Check if each of PUs is I_PCM
          bPartPNoFilter = (pcCUP->getIPCMFlag(uiPartPIdx));
          bPartQNoFilter = (pcCUQ->getIPCMFlag(uiPartQIdx));
        }
        // check if each of PUs is lossless coded
        bPartPNoFilter = bPartPNoFilter || (pcCUP->isLosslessCoded(uiPartPIdx) );
        bPartQNoFilter = bPartQNoFilter || (pcCUQ->isLosslessCoded(uiPartQIdx) );
  ...
}}}

When bPCMFilter = false (pcm_enabled_flag = 0 or pcm_loop_filter_disable_flag = 0), bPartPNoFilter (and bPartQNoFilter) is not reset in the for loop. Therefore, once it becomes true by a lossless-coded CU, it remains true for the rest of the loop. This disables the deblocking filter process for incorrect edges.

So, this part should be replaced with the following, for example (or equivalent code):         

        // Check if each of PUs is I_PCM
        bPartPNoFilter = bPCMFilter && (pcCUP->getIPCMFlag(uiPartPIdx));        // Modified
        bPartQNoFilter = bPCMFilter && (pcCUQ->getIPCMFlag(uiPartQIdx));       // Modified
        // check if each of PUs is lossless coded
        bPartPNoFilter = bPartPNoFilter || (pcCUP->isLosslessCoded(uiPartPIdx) );
        bPartQNoFilter = bPartQNoFilter || (pcCUQ->isLosslessCoded(uiPartQIdx) );"	defect	closed	minor	HM-8.1	HM	HM-8.0	fixed		fbossen ksuehring davidf jct-vc@…
