﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1059	Issue on ApplyLfnstFlag	moonmo.koo		"In current VVC WD (JVET-R2001-v9), the variable ApplyLfnstFlag is defined in lfnst_idx semantics as the following:

{{{
'''lfnst_idx''' specifies whether and which one of the two low frequency non-separable transform kernels in a selected transform set is used. lfnst_idx equal to 0 specifies that the low frequency non-separable transform is not used in the current coding unit.

When lfnst_idx is not present, it is inferred to be equal to 0.

The variable ApplyLfnstFlag is derived as follows:
-  If treeType is equal to SINGLE_TREE, the following applies:
     ApplyLfnstFlag = ( lfnst_idx > 0 && cIdx  = =  0 ) ? 1 : 0
-  Otherwise, the following applies:
     ApplyLfnstFlag = ( lfnst_idx > 0 ) ? 1 : 0
}}}

However, the variable cIdx indicating a color component is not defined or passed as a parameter in coding_unit syntax table where lfnst_idx is signalled. Moreover, in order to enable LFNST only for Luma in single-tree case, ApplyLfnstFlag must be adjusted as cIdx varies from 0 to 2 (e.g. ApplyLfnstFlag must be zero for Cb/Cr.). But, any implication of this adjustment cannot be found in the above definition of ApplyLfnstFlag.

For resolving this ambiguity, the following fix can be suggested, which employs a 1-D array of ApplyLfnstFlag indexed by locally defined cIdx:

{{{
'''lfnst_idx''' specifies whether and which one of the two low frequency non-separable transform kernels in a selected transform set is used. lfnst_idx equal to 0 specifies that the low frequency non-separable transform is not used in the current coding unit.

When lfnst_idx is not present, it is inferred to be equal to 0.

The variable ApplyLfnstFlag[ cIdx ] is derived as follows for cIdx = 0..2:
    ApplyLfnstFlag[ 0 ] = ( lfnst_idx > 0  &&  treeType  !=  DUAL_TREE_CHROMA  ) ? 1 : 0
    ApplyLfnstFlag[ 1 ] = ApplyLfnstFlag[ 2 ] = ( lfnst_idx > 0  &&  treeType  = =  DUAL_TREE_CHROMA ) ? 1 : 0
}}}

With the above definition of the ApplyLfnstFlag array, the followig two spots referring ApplyLfnstFlag should be modified with ApplyLfnstFlag[cIdx] accordingly:

{{{
...
'''8.7.3   Scaling process for transform coefficients'''
...
For the derivation of the scaled transform coefficients d[ x ][ y ] with x = 0..nTbW − 1, y = 0..nTbH − 1, the following applies:
   - The intermediate scaling factor m[ x ][ y ] is derived as follows:
     - If one or more of the following conditions are true, m[ x ][ y ] is set equal to 16:
     - sh_explicit_scaling_list_used_flag is equal to 0.
     - transform_skip_flag[ xTbY ][ yTbY ][ cIdx ] is equal to 1.
     - sps_scaling_matrix_for_lfnst_disabled_flag is equal to 1 and ApplyLfnstFlag[ cIdx ] is equal to 1.
     - sps_scaling_matrix_for_alternative_colour_space_disabled_flag is equal to 1 and sps_scaling_matrix_designated_colour_space_flag is equal to cu_act_enabled_flag[ xTbY ][ yTbY ].
...
'''8.7.4 Transformation process for scaled transform coefficients
8.7.4.1 General
'''
...
When ApplyLfnstFlag[ cIdx ] is equal to 1, transform_skip_flag[ xTbY ][ yTbY ][ cIdx ] is equal to 0 and both nTbW and nTbH are greater than or equal to 4, the following applies:
...
The variables nonZeroW and nonZeroH are derived as follows:
  - If ApplyLfnstFlag[ cIdx ] is equal to 1 and nTbW is greater than or equal to 4 and nTbH is greater than or equal to 4, the following applies:
     nonZeroW = ( nTbW  = =  4  | |  nTbH  = =  4 ) ? 4 : 8
     nonZeroH = ( nTbW  = =  4  | |  nTbH  = =  4 ) ? 4 : 8
...
}}}

"	defect	closed	blocker	VVC D10	spec	VVC D9 vB	fixed		ksuehring bbross XiangLi fbossen jvet@…
