A method of decoding from a video bitstream a transform unit of a video frame that is in a 4:2:2 format and that contains chroma residual samples , the transform unit containing two chroma residual coefficient arrays for each of two chroma channels, the method comprising: determining a transform size of the transform unit for the two chroma channels, the transform size being determined according to a transform depth value of the transform unit and a size of a coding unit that contains a transform tree that includes the transform unit and a parent node that has a coded block flag that indicates presence of at least one non-zero coefficient for a region which includes the transform unit, wherein the depth value corresponds to a hierarchical level of the transform unit within the transform tree that depends on a split transform flag that is encoded to the video bitstream if the transform depth value of the transform unit is less than a maximum allowed transform depth; decoding two coded block flag values for a first one of the two chroma channels of the transform unit and two coded block flag values for the second one of the two chroma channels of the transform unit from the video bitstream , wherein the transform unit has two chroma residual coefficient arrays for each of the chroma channels, and each coded block flag value of the two coded block flag values corresponds to one chroma residual coefficient array of the two chroma residual coefficient arrays ; decoding from the video bitstream each of the two chroma residual coefficient arrays for each of the chroma channels according to a corresponding coded block flag value of the two coded block flag values ; selecting a square inverse transform for the decoded chroma residual coefficient arrays , the square inverse transform being selected from a predetermined set of square inverse transforms according to the determined transform size; and applying the selected square inverse transform to each of the decoded chroma residual coefficient arrays to produce the chroma residual samples for the chroma channel of the transform unit . determining a transform size of the transform unit for the two chroma channels, the transform size being determined according to a transform depth value of the transform unit and a size of a coding unit that contains a transform tree that includes the transform unit and a parent node that has a coded block flag that indicates presence of at least one non-zero coefficient for a region which includes the transform unit, wherein the depth value corresponds to a hierarchical level of the transform unit within the transform tree that depends on a split transform flag that is encoded to the video bitstream if the transform depth value of the transform unit is less than a maximum allowed transform depth; decoding two coded block flag values for a first one of the two chroma channels of the transform unit and two coded block flag values for the second one of the two chroma channels of the transform unit from the video bitstream , wherein the transform unit has two chroma residual coefficient arrays for each of the chroma channels, and each coded block flag value of the two coded block flag values corresponds to one chroma residual coefficient array of the two chroma residual coefficient arrays ; decoding from the video bitstream each of the two chroma residual coefficient arrays for each of the chroma channels according to a corresponding coded block flag value of the two coded block flag values ; selecting a square inverse transform for the decoded chroma residual coefficient arrays , the square inverse transform being selected from a predetermined set of square inverse transforms according to the determined transform size; and applying the selected square inverse transform to each of the decoded chroma residual coefficient arrays to produce the chroma residual samples for the chroma channel of the transform unit . <EOS>