[Issue 1]

When the current luma coding block is 8x8 and MinTrafoSize is also 8 the following happens/may happen:

a) When CU is coded in INTRA_NxN mode, the 8x8 luma block is split into four 4x4 luma transform blocks (blkIdx=0,1,2,3) resulting in a luma transform smaller than MinTrafoSize.

b) When CU is not coded in INTRA_NxN mode, the 8x8 luma block is not split resulting in a 4x4 chroma transform block (blkIdx=0) which is not processed due to the "} else if( blkIdx = = 3 )" condition in transform_unit syntax.

[Fix 1]

The following restriction of the bitstream in log2_min_transform_size_minus2 semantics is missing:

**"The bitstream shall not contain data that result in Log2MinTrafoSize greater than or equal to Log2MinCbSize."**

[Issue 2]

The definition of log2TrafoSizeC in transform_unit syntax depends on Log2MinTrafoSizeC:

"log2TrafoSizeC = ( ( log2TrafoSize = = Log2MinTrafoSizeC ) ? log2TrafoSize : log2TrafoSize − 1 )"

Log2MinTrafoSizeC on the other hand depends on chroma_format_idc:

"Log2MinTrafoSizeC is set equal to Max( Log2MinTrafoSize − 1, 2 ) if chroma_format_idc is equal to 1 or 2, otherwise, it is set equal to Log2MinTrafoSize."

~~This is contradictory to Log2MinTrafoSize being the minimum transform size.~~

[Fix 2]

For the 4 occurences of Log2MinTrafoSizeC:

**Delete the derivation in SPS semantics** (1x)

Replace **Log2MinTrafoSizeC** by ~~Log2MinTrafoSize~~2 in transform_unit syntax (1x)

Replace **Log2MinTrafoSizeC + 1** by ~~Log2MinTrafoSize~~3 in 8.5.3.2 Decoding process for chroma residual blocks (2x)

Replace **if( firstChromaCbf | | log2TrafoSize > Log2MinTrafoSize )** by **if( firstChromaCbf | | log2TrafoSize > 2 )** in transform_tree syntax

Replace **Log2MinTrafoSize + 1** by **3** in InterTUSplitDirection derivation (4x)

[Issue 3]

The residual_coding syntax for chroma is called with the variable log2TrafoSizeC as input although it requires log2TrafoWidthC and log2TrafoHeightC.

[Fix 3]

**Remove log2TrafoSizeC.**

Replace

" if( log2TrafoSize > ~~Log2MinTrafoSize~~2 ) {

if( cbf_cb[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( x0, y0, **log2TrafoSizeC, trafoDepth**, scanIdxC, 1 )

if( cbf_cr[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( x0, y0, **log2TrafoSizeC, trafoDepth**, scanIdxC, 2 )

} else if( blkIdx = = 3 ) {

if( cbf_cb[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( xC, yC, **log2TrafoSizeC, trafoDepth**, scanIdxC, 1 )

if( cbf_cr[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( xC, yC, **log2TrafoSizeC, trafoDepth**, scanIdxC, 2 )

}"

with

" if( log2TrafoSize > ~~Log2MinTrafoSize~~2 ) {

if( cbf_cb[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( x0, y0, **log2TrafoWidth-1, log2TrafoHeight-1**, scanIdxC, 1 )

if( cbf_cr[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( x0, y0, **log2TrafoWidth-1, log2TrafoHeight-1**, scanIdxC, 2 )

} else if( blkIdx = = 3 ) {

if( cbf_cb[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( xC, yC, **log2TrafoWidth, log2TrafoHeight**, scanIdxC, 1 )

if( cbf_cr[ x0 ][ y0 ][ trafoDepth ] )

residual_coding( xC, yC, **log2TrafoWidth, log2TrafoHeight**, scanIdxC, 2 )

}".

[Issue 4]

When log2TrafoSize is equal to Log2MinTrafoSize and firstChromaCbf is equal to 0, both chroma cbfs are not present and inferred to be equal to 0.

This is not correct since in that case they should be inferred to be equal to the one from one depth above (TrafoDepth-1)

Furthermore the chroma cbf parsing is a bit inconsistent since for some case it is inferred to be equal to 1 in the syntax table and for some cases it is inferred to be equal to 0 in the semantics.

[Fix 4]

Replace in transform_tree syntax

" readCbf = TRUE

**if( blkIdx = = 3 && log2TrafoSize < Log2MaxTrafoSize )**

**readCbf = cbf_cb[ xBase ][ yBase ][ trafoDepth ] | |**

**cbf_cb[ xBase + ( 1 << log2TrafoWidth ) ][ yBase ][ trafoDepth ] | | **

**cbf_cb[ xBase ][ yBase + ( 1 << log2TrafoHeight ) ][ trafoDepth ]**

**if( !readCbf )**

**cbf_cb[ x0 ][ y0 ][ trafoDepth ] = 1**

**else**

**cbf_cb[ x0 ][ y0 ][ trafoDepth ]**

"

with

" **if( blkIdx < 3 | | log2TrafoSize = = Log2MaxTrafoSize | | **

**cbf_cb[ xBase ][ yBase ][ trafoDepth ] | | **

**cbf_cb[ xBase + ( 1 << log2TrafoWidth ) ][ yBase ][ trafoDepth ] | |**

**cbf_cb[ xBase ][ yBase + ( 1 << log2TrafoHeight ) ][ trafoDepth ] )**

**cbf_cb[ x0 ][ y0 ][ trafoDepth ]**

"

Replace in transform tree semantics

"When cbf_cb[ x0 ][ y0 ][ trafoDepth ] is not present** and PredMode is not equal to MODE_INTRA**, the value of cbf_cb[ x0 ][ y0 ][ trafoDepth ] is inferred **to be equal to 0.**"

with

"When cbf_cb[ x0 ][ y0 ][ trafoDepth ] is not present, the value of cbf_cb[ x0 ][ y0 ][ trafoDepth ] is inferred **as follows.**

- – If all of the following conditions are true, cbf_cb[ x0 ][ y0 ][ trafoDepth ] is inferred to be equal to 1.

**– blkIdx is equal to 3**

**– log2TrafoSize is less than Log2MaxTrafoSize**

**– cbf_cb[ xBase ][ yBase ][ trafoDepth ] is equal to 0**

**– cbf_cb[ xBase + ( 1 << log2TrafoWidth ) ][ yBase ][ trafoDepth ] is equal to 0**

**– cbf_cb[ xBase ][ yBase + ( 1 << log2TrafoHeight ) ][ trafoDepth ] is equal to 0**

**• – Otherwise if firstChromaCbf is equal to 0 and log2TrafoSize is equal to Log2MinTrafoSize, cbf_cb[ x0 ][ y0 ][ trafoDepth ] is inferred to be equal to cbf_cb[ xBase ][ yBase ][ trafoDepth − 1 ]**

**• – Otherwise, cbf_cb[ x0 ][ y0 ][ trafoDepth ] is inferred to be equal to 0.".**

Note that the condition on intra is a leftover from when chroma cbf handling was different for inter and intra.

Same fixes and cleanups apply for cbf_cr.

The cleanup for the derivation when not present also applies for cbf_luma with the difference that it is only inferred to be equal to 1 when not present.

[cleanup 1]

Move parsing of and conditioning on no_residual_data_flag to coding unit syntax since it affects trafoDepth 0 (root) only and is not changed during recursion.

[cleanup 2]

Similarly, maxDepth can be derived once in coding unit syntax.

[cleanup 3]

Replace intraSplitFlag by (IntraSplitFlag && trafoDepth == 0 ) to avoid confusion with IntraSplitFlag

[cleanup 4]

interSplitFlag is only needed to derive split_transform_flag when not present. Consequently the derivation can be moved to split_transform_flag semantics and excluded in MaxDepth calculation since the related max_transform_hierarchy_depth_inter equal to 0 prevents the signaling of split_transform_flag then.

Fix based on dI