Opened 14 years ago

Closed 10 years ago

#86 closed enhancement (invalid)

fWeight in TEncSearch::xMotionEstimation (TMuC 0.7)

Reported by: Xiang Li Owned by:
Priority: minor Milestone:
Component: HM Version:
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description

At the end of function TEncSearch::xMotionEstimation, we have the following line

ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) );

For P and B frames, fWeight=1 and 0.5, respectively. When we calculate the distortion (SAD/HAD) for B frames in motion estimation, we already used the average prediction of two hypotheses, such as in TComRdCost::xGetSADs32(). Then fWeight should also be set to 1 for B frames. To keep the original design (fWeight=0.5 for B frames) unchanged, during the calculation of sub-pixel distortion such as TComRdCost::xCalcHADs8x8, a one-bit left shift is applied after the difference calculation, i.e.,

pred = xClip( (piCur[i*iStep] + piRef[i] + bRound) >> 1 );
diff[k+i] = (piOrg[i] - pred) << 1;

which compensates the setting of fWeight=0.5. Such an implementation (fWeight=0.5 + one-bit left shift) is correct. However, the code is confused and difficult to understand. We hope it can be improved to be more clear. For example, set fWeight=1 for B frames while removing the left shift in functions like TComRdCost::xCalcHADs8x8.

Change History (4)

comment:1 Changed 13 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:2 Changed 13 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:3 Changed 13 years ago by davidf

  • Cc jct-vc@… added

comment:4 Changed 10 years ago by karlsharman

  • Resolution set to invalid
  • Status changed from new to closed

The particular variant of the function highlighted in this ticket
appears to have been removed in HM3.2-dev (r1102) - function:

UInt TComRdCost::xCalcHADs8x8( Pel *piOrg, Pel *piCur,
Int iStrideOrg, Int iStrideCur,
Int iStep, Pel* pRefY,
Int refYStride, Bool bRound )

If there is a related enhancement that can still be made, this
ticket should be re-opened with an updated report (and preferably
a patch).

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

  • David Flynn(Subscriber, Participant)
  • Frank Bossen(Subscriber)
  • jct-vc@…(Subscriber)
  • Karl Sharman(Participant)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Always)
  • Xiang Li(Reporter)