﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
589	inconsistent definition and usage of scaling window parameters	taoranlu		"In VVC D7-v9 (JVET-P2001-v9), the definition and usage of scaling window parameters are confusing. 

The semantics state that they are defined '''in units of luma samples''':
 
scaling_win_left_offset, scaling_win_right_offset, scaling_win_top_offset, and scaling_win_bottom_offset specify the offsets, in units of luma samples, that are applied to the picture size for scaling ratio calculation. When sclaing_window_flag is equal to 0, the values of scaling_win_left_offset, scaling_win_right_offset, scaling_win_top_offset, and scaling_win_bottom_offset are inferred to be equal to 0.

If this is the design intention, the following semantics are wrong:
  The value of SubWidthC * ( scaling_win_left_offset + scaling_win_right_offset ) shall be less than pic_width_in_luma_samples, and the value of SubHeightC * ( scaling_win_top_offset + scaling_win_bottom_offset ) shall be less than pic_height_in_luma_samples.

  The variables PicOutputWidthL and PicOutputHeightL are derived as follows:

  PicOutputWidthL = pic_width_in_luma_samples −SubWidthC * ( scaling_win_right_offset + scaling_win_left_offset )     (7-39)
  PicOutputHeightL = pic_height_in_pic_size_units − SubHeightC * ( scaling_win_bottom_offset + scaling_win_top_offset )     (7-40)	


They should be corrected by removing the SubWidthC and SubHeightC:

  The value of ( scaling_win_left_offset + scaling_win_right_offset ) shall be less than pic_width_in_luma_samples, and the value of ( scaling_win_top_offset + scaling_win_bottom_offset ) shall be less than pic_height_in_luma_samples.

  The variables PicOutputWidthL and PicOutputHeightL are derived as follows:
  PicOutputWidthL = pic_width_in_luma_samples − ( scaling_win_right_offset + scaling_win_left_offset )    (7-39)
  PicOutputHeightL = pic_height_in_pic_size_units − ( scaling_win_bottom_offset + scaling_win_top_offset )    (7-40)	


----

If the design intention is to follow the way that conformance window parameters are defined (in units of chroma samples), then the following need to be addressed instead:

1: the semantics:
should remove ""in units of luma samples"".

2: in clause 8.5.6.3.1, where scaling_win_left_offset and scaling_win_top_offset are referenced (and is used in unit of luma samples), the SubWidthC and SubHeightC should be added, as follows:

The variable fRefLeftOffset is set equal to ( (SubWidthC * scaling_win_left_offset )  <<  10 ), where scaling_win_left_offset is the scaling_win_left_offset for the reference picture.
The variable fRefTopOffset is set equal to ( ( SubHeightC * scaling_win_top_offset ) <<  10 ), where scaling_win_top_offset is the scaling_win_top_offset for the reference picture.

 …..
refxSbL = ( ( ( xSb − SubWidthC * scaling_win_left_offset )  <<  4 ) + refMvLX[ 0 ] ) * scalingRatio[ 0 ]	(8-738)
refySbL = ( ( ( ySb − SubHeightC * scaling_win_top_offset ) <<  4 ) + refMvLX[ 1 ] ) * scalingRatio[ 1 ]	(8-740)
…..
refxSbC = ( ( ( xSb − SubWidthC * scaling_win_left_offset ) / SubWidthC  <<  5 ) + mvLX[ 0 ] ) *scalingRatio[ 0 ]	(8-746)
refySbC =  ( ( ( ySb − SubHeightC * scaling_win_top_offset ) / SubHeightC  <<  5 ) + mvLX[ 1 ] ) *scalingRatio[ 1 ]	(8-748)


"	defect	closed	minor		spec		fixed	scaling window	ksuehring bbross XiangLi fbossen jvet@…
