Opened 12 years ago

Closed 12 years ago

#603 closed defect (fixed)

Incorrect chroma offset in WP

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

Description

In the weighted prediction process, a chroma adjustment is defined in the semantics of delta_chroma_offset_l0:
ChromaOffsetL0[ i ][ j ] = (delta_chroma_offset_l0[i][j] – 
( (shift*ChromaWeightL0[ i ][ j ]) >> ChromaLog2WeightDenom ) − shift )

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:
wp[j].iOffset = iDeltaChroma - ( ( (g_uiIBDI_MAX>>1)*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) + (g_uiIBDI_MAX>>1);

Attachments (1)

Bugfix_Ticket603.patch (2.4 KB) - added by Tanizawa 12 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 12 years ago by DefaultCC Plugin

  • Cc fbossen ksuehring davidf jct-vc@… added

Changed 12 years ago by Tanizawa

comment:2 Changed 12 years ago by Tanizawa

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;

comment:3 Changed 12 years ago by fbossen

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

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

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