Opened 11 years ago

Closed 10 years ago

# Weighted Prediction Formula Bug in 8.5.2.2.3.2 Weighted sample prediction process

Reported by: Owned by: yul bbross critical D8 Text D8 (J1003) d7 weighted prediction bbross, wjhan, jct-vc@…

### Description

In Section 8.5.2.2.3.2 Weighted sample prediction process, Equations (8-227) and (8-229),
predSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, predSamplesL0[ x ][ y ] * w0 + o0 ) (8-227)
predSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, predSamplesL1[ x ][ y ] * w1 + o1 ) (8-229)
have fatal errors that predSamplesL0 and predSamplesL1 are not right-shifted by "shift1". Those errors result in predSamples are always equal to ( 1 << bitDepth ) − 1.

The correct equations are given as follows:
predSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, (predSamplesL0[ x ][ y ] + offset1 ) >> shift1 ) * w0 + o0 ) (8-227)
predSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, (predSamplesL1[ x ][ y ] + offset1 ) >> shift1 ) * w1 + o1 ) (8-229)

### comment:1 Changed 11 years ago by DefaultCC Plugin

• Cc bbross wjhan jct-vc@… added

### comment:2 Changed 11 years ago by yul

Sorry, the correct equations should as follows:
predSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, (predSamplesL0[ x ][ y ] * w0 + offset1 ) >> shift1 ) + o0 ) (8-227)
predSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, (predSamplesL1[ x ][ y ] * w1 + offset1 ) >> shift1 ) + o1 ) (8-229)

### comment:3 Changed 11 years ago by pandrivon

I think that original equations are right.
Please correct me if I am wrong, but equations (8-227) and (8-229) of J1003 d7 are only used when log2WD = 0 (as specified by the condition in equations (8-226) and (8-228) and min(log2WD) = 0). It means as log2WD = luma_log2_weight_denom + shift1 and as min(luma_log2_weight_denom) = 0 and as min(shift1) = 0 that both luma_log2_weight_denom and shift1 should be equals to 0 so that not shift (shift1=0) is required in that case (same for chroma component).

### comment:4 Changed 10 years ago by bbross

• Resolution set to fixed
• Status changed from new to closed
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

• Benjamin Bross(Owner, Subscriber, Participant)
• jct-vc@…(Subscriber)
• karl.sharman@…(Always)
• Karsten Suehring(Always)
• Pierre Andrivon(Participant)
• Woo-Jin Han(Subscriber)