Opened 13 years ago

Closed 13 years ago

#195 closed defect (fixed)

Uninitialized context model used in xQuadTreeDecisionFunc (SAO)

Reported by: Heiner Kirchhoffer Owned by:
Priority: major Milestone: HM-4.0
Component: HM Version:
Keywords: SAO Cc: fbossen, ksuehring, davidf, jct-vc@…

Description

Context model m_cAOUvlcSCModel.get( 0, 0, 0 ) is used uninitialized during estimation.

This can be reproduced by setting variable m_ucState of class ContextModel to 126 in the constructor (126 can never occur otherwise) and by adding a breakpoint in function getState that triggers when m_ucState equals 126. See the attached svn diff of ContextModel.cpp.

Attachments (1)

ContextModel.patch (1.2 KB) - added by Heiner Kirchhoffer 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by Heiner Kirchhoffer

comment:1 Changed 13 years ago by chihming.fu

The modified xQuadTreeDecisionFunc function can solve this issue

Void TEncSampleAdaptiveOffset::xQuadTreeDecisionFunc(SAOQTPart *psQTPart, Int iPartIdx, Double &dCostFinal, Int iMaxLevel, Double dLambda)
{
  SAOQTPart*  pOnePart = &(psQTPart[iPartIdx]);

  UInt uiDepth = pOnePart->PartLevel;
  UInt uhNextDepth = uiDepth+1;

  if (iPartIdx == 0)
  {
    dCostFinal = 0;
  }

  //QAO for this part
  if(!pOnePart->bProcessed)
  {
    xQAOOnePart (psQTPart, iPartIdx, dLambda);
  }

  //QAO for sub 4 parts
  if (pOnePart->PartLevel < iMaxLevel)
  {
    Double      dCostNotSplit = dLambda + pOnePart->dMinCost;
    Double      dCostSplit    = dLambda;

    for (Int i=0; i< NUM_DOWN_PART ;i++)
    {
      if( m_bUseSBACRD )  
      {
        if ( 0 == i) //initialize RD with previous depth buffer
        {
          m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
        }
        else
        {
          m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]->load(m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]);
        }
      }  
      xQuadTreeDecisionFunc(psQTPart, pOnePart->DownPartsIdx[i], dCostFinal, iMaxLevel, dLambda);
      dCostSplit += dCostFinal;
      if( m_bUseSBACRD )
      {
        m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]->load(m_pppcRDSbacCoder[uhNextDepth][CI_TEMP_BEST]);
      }
    }


    if(dCostSplit < dCostNotSplit)
    {
      dCostFinal = dCostSplit;
      pOnePart->bSplit      = true;
      pOnePart->bEnableFlag = false;
      pOnePart->iLength     =  0;
      pOnePart->iBestType   = -1;
      if( m_bUseSBACRD )
      {
        m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]->load(m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]);
      }
    }
    else
    {
      dCostFinal = dCostNotSplit;
      pOnePart->bSplit = false;
      for (Int i=0; i<NUM_DOWN_PART; i++)
      {
        xPartTreeDisable(psQTPart, pOnePart->DownPartsIdx[i]);
      }
      if( m_bUseSBACRD )
      {
        m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]->load(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
      }
    }
  }
  else
  {
    dCostFinal = pOnePart->dMinCost;
  }
}

comment:2 Changed 13 years ago by ksuehring

  • Milestone set to HM-4.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r1279 (3.4-dev-cleanup)

comment:3 Changed 13 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:4 Changed 13 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:5 Changed 13 years ago by davidf

  • Cc jct-vc@… added
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • Chih-Ming Fu(Participant)
  • David Flynn(Subscriber, Participant)
  • Frank Bossen(Subscriber)
  • Heiner Kirchhoffer(Reporter)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Participant, Always)