﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
687	Missing clip in 8.6.5 Picture construction process prior to in-loop filter process?	agoudie	bbross	"In section 8.6.5 on ""Picture construction process prior to in-loop filter process"", either Inter or Intra predicted samples are added to residual samples to form reconstructed samples.

This process does not clip the reconstructed samples to be in the range 0 to (1<<BitDepth)-1. I can't see any subsequent stage which would clip the samples (where in-loop filter may not modify the samples) to ensure the reconstructed frames are clipped to the correct precision.

In the HM software, in TDecCu.cpp, for Inter data the function 'xReconInter' uses 'addClip' function, and for Intra data 'xReconIntraQT' calls 'xIntraLumaRecQT', which calls 'xIntraRecLumaBlk', which clips the luma samples (there is a similar function for chroma).

Unless I've a missed a clip operation somewhere else in the text, I beleive section 8.6.5 should be modified as follows;-

Depending on the colour component cIdx, the following assignments are made.
–	If cIdx is equal to 0, recSamples corresponds to the reconstructed picture sample array SL, and the function Clip1 corresponds to Clip1y.
–	Otherwise, if cIdx is equal to 1, recSamples corresponds to the reconstructed chroma sample array SCb, and the function Clip1 corresponds to Clip1c.
–	Otherwise (cIdx is equal to 2), recSamples corresponds to the reconstructed chroma sample array SCr, and the function Clip1 corresponds to Clip1c.

The (nS)x(nS) block of the reconstructed sample array recSamples at location ( xB, yB ) is derived as follows.
  recSamples[ xB+i ][ yB+j ] = Clip1(predSamples[ i ][ j ] + resSamples[ i ][ j ]), with i = 0..nS − 1, j = 0..nS − 1


"	defect	closed	minor		Text	D9 (K1003) v10	fixed	reconstructed clip	bbross wjhan jct-vc@…
