A method of reconstructing a set of significant-coefficient flags in a reverse scan order for a transform unit from a bitstream of encoded data, the set of significant-coefficient flags corresponding to the transform unit, which is partitioned into nonwerlapping square blocks, each block corresponding to a respective group of the significant-coefficient flags, the method comprising: reconstructing significant-coefficient-group flags, wherein each significant-coefficient-group flag corresponds to one of the respective groups of significant-coefficient flags, by inferring the value of at least two significant-coefficient-group flags to be 1 without decoding those at least two significant-coefficient-group flags from the bitstream, the at least two significant-coefficient group flags being for the group containing the significant-coefficient flag for a last-significant coefficient and for the group containing the significant-coefficient flag for a DC coefficient, and by decoding at least one of the other significant-coefficient-group flags from the bitstream; and reconstructing each significant-coefficient flag by: if all of: the significant-coefficient-flag is at position (0,0) in a group, a corresponding significant-coefficient-group flag is non-zero, a transform unit size is at least 16x16, the corresponding group is not the DC block, and all the previous significant-coefficient flags in that group are zero; then inferring the significant-coefficient-flag at position (0,0) in that group to be 1; otherwise: decoding the significant-coefficient flag from the bitstream if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is non-zero, and inferring the significant-coefficient flag to be zero, if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is zero. reconstructing significant-coefficient-group flags, wherein each significant-coefficient-group flag corresponds to one of the respective groups of significant-coefficient flags, by inferring the value of at least two significant-coefficient-group flags to be 1 without decoding those at least two significant-coefficient-group flags from the bitstream, the at least two significant-coefficient group flags being for the group containing the significant-coefficient flag for a last-significant coefficient and for the group containing the significant-coefficient flag for a DC coefficient, and by decoding at least one of the other significant-coefficient-group flags from the bitstream; and reconstructing each significant-coefficient flag by: if all of: the significant-coefficient-flag is at position (0,0) in a group, a corresponding significant-coefficient-group flag is non-zero, a transform unit size is at least 16x16, the corresponding group is not the DC block, and all the previous significant-coefficient flags in that group are zero; then inferring the significant-coefficient-flag at position (0,0) in that group to be 1; otherwise: decoding the significant-coefficient flag from the bitstream if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is non-zero, and inferring the significant-coefficient flag to be zero, if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is zero. if all of: the significant-coefficient-flag is at position (0,0) in a group, a corresponding significant-coefficient-group flag is non-zero, a transform unit size is at least 16x16, the corresponding group is not the DC block, and all the previous significant-coefficient flags in that group are zero; the significant-coefficient-flag is at position (0,0) in a group, a corresponding significant-coefficient-group flag is non-zero, a transform unit size is at least 16x16, the corresponding group is not the DC block, and all the previous significant-coefficient flags in that group are zero; then inferring the significant-coefficient-flag at position (0,0) in that group to be 1; otherwise: decoding the significant-coefficient flag from the bitstream if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is non-zero, and inferring the significant-coefficient flag to be zero, if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is zero. decoding the significant-coefficient flag from the bitstream if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is non-zero, and inferring the significant-coefficient flag to be zero, if that significant-coefficient flag is in a group that has corresponding significant-coefficient-group flag that is zero.