Opened 5 years ago
Closed 4 years ago
#855 closed defect (fixed)
Bug in Table 131
Reported by: | peterchuang | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | VVC D10 |
Component: | spec | Version: | VVC D9 vB |
Keywords: | Cc: | ksuehring, bbross, XiangLi, fbossen, jvet@… |
Description
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs >= 0 && !slice_ts_residual_coding_disabled_flag
should be
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs > 0 && !slice_ts_residual_coding_disabled_flag
the ">=" should be ">"
Change history (8)
comment:1 Changed 5 years ago by sunmi.yoo
comment:2 Changed 5 years ago by wangyang.cs
In residual_ts_coding(), coeff_sign_flag is context coded in the first scan pass. RemCcbs could be equal to 3 in the first scan pass since sig_coeff_flag may be decoded and RemCcbs will minus 1.
coeff_sign_flag is bypass coded in the remainder scan pass in residual_ts_coding(). RemCcbs could be less than or equal to 3.
Only changing Table 131 is not enough to distinguish whether coeff_sign_flag is bypass or context coded in residual_ts_coding(). To fix this problem, RemCcbs could be set equal to 0 before the remainder scan pass in residual_ts_coding().
My suggestion is as follows:
In JVET-R2001-vA
7.3.10.11 Residual coding syntax
residual_ts_coding( x0, y0, log2TbWidth, log2TbHeight, cIdx ) { | Descriptor |
... | |
/* remainder scan pass */ | |
RemCcbs = 0 | |
for( n = 0; n <= numSbCoeff − 1; n++ ) { | |
xC = ( xS << log2SbW ) + DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 0 ] | |
yC = ( yS << log2SbH ) + DiagScanOrder[ log2SbW ][ log2SbH ][ n ][ 1 ] |
Table 131 could be changed from
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 0 | | RemCcbs == 0 | | sh_ts_residual_coding_disabled_flag
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs >= 0 && ! sh_ts_residual_coding_disabled_flag
to
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 0 | | RemCcbs == 0 | | sh_ts_residual_coding_disabled_flag
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs > 0 && ! sh_ts_residual_coding_disabled_flag
comment:3 Changed 5 years ago by sunmi.yoo
As wangyang.cs commented, my previous suggestion cannot fix the bug in the case when RemCcbs is 4 before coeff_sig_flag is parsed and RemCcb is decremented after coeff_sig_flag.
However, if the spec is modified as the wangyang's suggestion, only coeff_sign_flag in the first CG of a TU can be context coded, otherwise always coeff_sign_flag is bypassed since RemCcbs is set to 0 in the first CG. Another suggestion in Table 131 (+ no modification in 7.3.10.11) is as follows :
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 0 | | ( RemCcbs < 3 && lastScanPosPass1 = -1 ) | | sh_ts_residual_coding_disabled_flag
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs >= 3 && ! sh_ts_residual_coding_disabled_flag
comment:4 Changed 5 years ago by m.sarwer
I also agree that the conditions in Table 131 is not correct in some cases. However, I am not sure how the solution proposed here will work in following case:
Assume, there are 4 CG and after coding 3 CG, the RemCcbs is equal to 3. Based on the above solution, following condition is true which means coeff_sign_flag is context coded.
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs >= 3 && ! sh_ts_residual_coding_disabled_flag
But actually in VTM implementation and the intention in the above mentioned example, coeff_sign_flag is by-pass coded.
Below is an alternative solution to fix that. Following are the required changes.
Changes in Table 131:
Bypass condition:
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 0 | | n > lastScanPosPass1 | | sh_ts_residual_coding_disabled_flag
Condition for context coded:
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && n <= lastScanPosPass1 && !sh_ts_residual_coding_disabled_flag
Changes in the syntax table:
The variable “ lastScanPosPass1 = n” need to define at the beginning of the first pass loop instead of end of the loop.
comment:5 Changed 5 years ago by sunmi.yoo
@m.sarwer,
I also agree with your point that my second suggestion still does not solve the issue.
However, in your solution, it seems that there is no chance for coeff_sign_flag[] to be context coded in every first non-zero coefficient in the CG, because lastScanPosPass1 is initialized to be -1 in every CG and updated after the first non-zero coefficient is parsed.
We'd better look for possible solutions.
comment:6 Changed 5 years ago by sunmi.yoo
@m.sarwer,
Your suggestion seems to solve the issue.
I missed your last sentence for the changes in the syntax table
The variable “ lastScanPosPass1 = n” need to define at the beginning of the first pass loop instead of end of the loop.
comment:7 Changed 4 years ago by bbross
- Milestone set to VVC D10
- Version changed from VVC D8 vB to VVC D9 vB
comment:8 Changed 4 years ago by bbross
- Resolution set to fixed
- Status changed from new to closed
This will be fixed in JVET-S2001-v7 with the adoption of JVET-S0215.
Currently, checking ccbs is conducted at a pass level, which means it does not decrease syntax element by syntax element. Therefore, the bug in Table 131 can be fixed from :
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 0 | | RemCcbs == 0 | | slice_ts_residual_coding_disabled_flag
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs >= 0 && !slice_ts_residual_coding_disabled_flag
to
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 0 | | RemCcbs < 4 | | slice_ts_residual_coding_disabled_flag
coeff_sign_flag[ ]
transform_skip_flag[ x0 ][ y0 ][ cIdx ] = = 1 && RemCcbs >= 4 && !slice_ts_residual_coding_disabled_flag