A method of decoding a bitstream of encoded video by reconstructing significant-coefficient flags for a transform unit, the transform unit being partitioned into a plurality of block-based coefficient groups, the method comprising: for a significant-coefficient flag within a current coefficient group, determining whether that significant-coefficient flag is within the right-most column of the current coefficient group or the bottom row of the current coefficient group and, if so, then selecting a first set of nearby significant-coefficient flag positions relative to that significant-coefficient flag, and otherwise selecting a different, second set of nearby significant-coefficient flag positions relative to that significant-coefficient flag; determining a context for that significant-coefficient flag from a sum of the selected significant-coefficient flags in the positions in the selected set; entropy decoding that significant-coefficient flag using its determined context; and updating the determined context, wherein the first set excludes any significant-coefficient flags from outside the coefficient group except for the significant-coefficient flags in the column to the immediate right of the coefficient group, the significant-coefficient flags in the row immediately below the coefficient group, and the significant-coefficient flag diagonally adjacent the bottom-right corner of the coefficient group; and wherein the second set includes five significant-coefficient flag positions arranged as: x o o o o o wherein x indicates that significant-coefficient and o indicates the relative location of the nearby significant-coefficient flag positions in the second set. for a significant-coefficient flag within a current coefficient group, determining whether that significant-coefficient flag is within the right-most column of the current coefficient group or the bottom row of the current coefficient group and, if so, then selecting a first set of nearby significant-coefficient flag positions relative to that significant-coefficient flag, and otherwise selecting a different, second set of nearby significant-coefficient flag positions relative to that significant-coefficient flag; determining a context for that significant-coefficient flag from a sum of the selected significant-coefficient flags in the positions in the selected set; entropy decoding that significant-coefficient flag using its determined context; and updating the determined context, determining whether that significant-coefficient flag is within the right-most column of the current coefficient group or the bottom row of the current coefficient group and, if so, then selecting a first set of nearby significant-coefficient flag positions relative to that significant-coefficient flag, and otherwise selecting a different, second set of nearby significant-coefficient flag positions relative to that significant-coefficient flag; determining a context for that significant-coefficient flag from a sum of the selected significant-coefficient flags in the positions in the selected set; entropy decoding that significant-coefficient flag using its determined context; and updating the determined context, wherein the first set excludes any significant-coefficient flags from outside the coefficient group except for the significant-coefficient flags in the column to the immediate right of the coefficient group, the significant-coefficient flags in the row immediately below the coefficient group, and the significant-coefficient flag diagonally adjacent the bottom-right corner of the coefficient group; and wherein the second set includes five significant-coefficient flag positions arranged as: x o o o o o wherein x indicates that significant-coefficient and o indicates the relative location of the nearby significant-coefficient flag positions in the second set.