Opened 14 years ago Closed 13 years ago #128 closed defect (fixed)Wrap-around problem with return variables from xCheckBestMVP
Description
In some cases the ME (xMotionEstimation) is bypassed, but the function xCheckBestMVP is still invoked. In those cases the input variable uiBitsTemp holds the number of bits of the partition, but without the MV bits.
Here's what happens in xCheckBestMVP:
uiBitsTemp = uiBitsTemp - iOrgMvBits + iBestMvBits
where iOrgMvBits is the bit-cost when original predictor is used, and iBestMvBits is the bit-cost for the new best predictor. It can happen that the difference of the original MV bits and new MV bits is larger than uiBitsTemp. This results in wrap around to the values from the upper end of the UInt range. Consequently, ruiBits and ruiCost (uiBitsTemp and uiCostTemp) values returned from the function xCheckBestMVP are wrong. This may affect result of the selection of MVs since uiBits[iRefList] = uiBitsTemp, and uiBits is used later in mode selection. Probably has only a minor effect on the results as the conditions are relatively rare. Attachments (1)Change History (7)comment:1 Changed 14 years ago by nsprljanChanged 14 years ago by nsprljancomment:2 Changed 14 years ago by nsprljan
The bug described above reappeared again in HM3.0, but affects only RA configuration.
It does not occur often - only in the instances when a better than the initial MVP is found for L1 list references, and when the difference in bits is larger then the already counted bits. To detect it it is enough to set a breakpoint on bits counter in the MVP estimation function that triggers when it goes to negative value.
Patch that can be applied to HM-3.0 is attached (ticket-128bugfix.patch, should be fine for HM-3.1 too). Note that a simplex fix is possible where a negative value us prevented by clipping to zero, however that does not lead to a gain as with the provided fix.
The full sequence results obtained for HM-3.0-dev-bugfix indicate average gain of 0.1%:
Class A -0.1 -0.2 0.1 -0.2 -0.3 -0.1 comment:3 Changed 13 years ago by fbossen
Fixed in r1008 comment:4 Changed 13 years ago by davidf
Updating component after adding WD (Text) tickets comment:5 Changed 13 years ago by davidf
comment:6 Changed 13 years ago by davidf
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
|
Update on the conditions under which this bug affects the performance: