Opened 14 years ago Closed 10 years ago #86 closed enhancement (invalid)fWeight in TEncSearch::xMotionEstimation (TMuC 0.7)
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.,
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
comment:2 Changed 13 years ago by davidf
comment:3 Changed 13 years ago by davidf
comment:4 Changed 10 years ago by karlsharman
The particular variant of the function highlighted in this ticket
If there is a related enhancement that can still be made, this 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
|
Updating component after adding WD (Text) tickets