Opened 13 years ago Closed 13 years ago #603 closed defect (fixed)Incorrect chroma offset in WP
Description
In the weighted prediction process, a chroma adjustment is defined in the semantics of delta_chroma_offset_l0:
where shift is 1 << BitDepth
In the HM, the shift value is set to the incorrect value of g_uiIBDI_MAX>>1 (e.g., 127 instead of 128). For example in line 2694 of TDecCAVLC.cpp: Attachments (1)Change History (4)comment:1 Changed 13 years ago by DefaultCC Plugin
Changed 13 years ago by Tanizawacomment:2 Changed 13 years ago by Tanizawacomment:3 Changed 13 years ago by fbossen
Fixed in r2485 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
|
Attached patch can fix this issue.
The original code:
wp[j].iOffset = iDeltaChroma - ( ( (g_uiIBDI_MAX>>1)*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) + (g_uiIBDI_MAX>>1);
The modified code:
Int Shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1)));
Int Pred = ( Shift - ( ( Shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
wp[j].iOffset = iDeltaChroma + Pred;