A method of encoding significant-coefficient flags for a transform unit, the method comprising: encoding significant-coefficient-group flags, wherein the transform unit is partitioned into non- overlapping blocks, each block corresponds to a respective group of significant-coefficient flags, and wherein each significant-coefficient-group flag corresponds to a respective block and its respective group of significant-coefficient flags, wherein, if any member of a group of significant-coefficient flags is non-zero, the corresponding significant-coefficient-group flag is one, and zero otherwise, wherein encoding the significant-coefficient-group flags includes encoding at least some of the significant-coefficient-group flags into the bitstream, and further includes setting a significant-coefficient-group flag to be 1 without encoding the significant-coefficient-group flag on the basis that the significant-coefficient-group flag corresponds to the block containing the significant-coefficient flag for a last-significant coefficient or corresponds to the block containing the significant-coefficient flag for a DC coefficient; and encoding each significant-coefficient flag in a reverse scan order by: if the significant-coefficient-flag is at position (0,0) in its group, a corresponding significant- coefficient-group flag is non-zero, the group is not the DC block, and all the previous significant-coefficient flags in the group are zero, then setting the significant-coefficient-flag at position (0,0) in the group to be 1 without encoding the significant-coefficient-flag at position (0,0) into a bitstream, and otherwise encoding the significant-coefficient flag into the bitstream if the significant-coefficient flag is in a group that has a corresponding significant-coefficient-group flag that is non-zero, and if the significant-coefficient flag is in a group that has a corresponding significant-coefficient- group flag that is zero, setting the significant-coefficient flag to zero without encoding the significant-coefficient flag into the bitstream. encoding significant-coefficient-group flags, wherein the transform unit is partitioned into non- overlapping blocks, each block corresponds to a respective group of significant-coefficient flags, and wherein each significant-coefficient-group flag corresponds to a respective block and its respective group of significant-coefficient flags, wherein, if any member of a group of significant-coefficient flags is non-zero, the corresponding significant-coefficient-group flag is one, and zero otherwise, wherein encoding the significant-coefficient-group flags includes encoding at least some of the significant-coefficient-group flags into the bitstream, and further includes setting a significant-coefficient-group flag to be 1 without encoding the significant-coefficient-group flag on the basis that the significant-coefficient-group flag corresponds to the block containing the significant-coefficient flag for a last-significant coefficient or corresponds to the block containing the significant-coefficient flag for a DC coefficient; and encoding each significant-coefficient flag in a reverse scan order by: if the significant-coefficient-flag is at position (0,0) in its group, a corresponding significant- coefficient-group flag is non-zero, the group is not the DC block, and all the previous significant-coefficient flags in the group are zero, then setting the significant-coefficient-flag at position (0,0) in the group to be 1 without encoding the significant-coefficient-flag at position (0,0) into a bitstream, and otherwise encoding the significant-coefficient flag into the bitstream if the significant-coefficient flag is in a group that has a corresponding significant-coefficient-group flag that is non-zero, and if the significant-coefficient flag is in a group that has a corresponding significant-coefficient- group flag that is zero, setting the significant-coefficient flag to zero without encoding the significant-coefficient flag into the bitstream. if the significant-coefficient-flag is at position (0,0) in its group, a corresponding significant- coefficient-group flag is non-zero, the group is not the DC block, and all the previous significant-coefficient flags in the group are zero, then setting the significant-coefficient-flag at position (0,0) in the group to be 1 without encoding the significant-coefficient-flag at position (0,0) into a bitstream, and otherwise encoding the significant-coefficient flag into the bitstream if the significant-coefficient flag is in a group that has a corresponding significant-coefficient-group flag that is non-zero, and if the significant-coefficient flag is in a group that has a corresponding significant-coefficient- group flag that is zero, setting the significant-coefficient flag to zero without encoding the significant-coefficient flag into the bitstream.