A method, performed by an encoder, for encoding a video sequence into a bitstream, wherein the bitstream is a High Efficiency Video Coding "HEVC" compliant bitstream, wherein the method is characterised by, when encoding a current picture of the video sequence: calculating an indication to a previous reference picture, wherein the previous reference picture is located before the current picture in decoding order, wherein the previous reference picture is, relatively to the current picture, a closest previous reference picture, in decoding order, that has a temporal identity equal to zero; creating a first set of indicators to previous pictures, wherein the first set comprises: the indication of the previous reference picture, a second set of indicators to all reference pictures included in a first reference picture set, "RPS", of the previous reference picture, and a third set of indicators to all pictures that follow the previous reference picture in decoding order and precede the current picture in decoding order; and when a long term reference picture in a second RPS of the current picture has least significant bits of a picture order count, for which more than one picture indicated in the first set share the same value of the least significant bits of picture order count as the long term reference picture, setting a flag for the long term reference picture, wherein the flag indicates use of a picture order count cycle and least significant bits of the picture order count to indicate the long term reference picture in the second RPS. calculating an indication to a previous reference picture, wherein the previous reference picture is located before the current picture in decoding order, wherein the previous reference picture is, relatively to the current picture, a closest previous reference picture, in decoding order, that has a temporal identity equal to zero; creating a first set of indicators to previous pictures, wherein the first set comprises: the indication of the previous reference picture, a second set of indicators to all reference pictures included in a first reference picture set, "RPS", of the previous reference picture, and a third set of indicators to all pictures that follow the previous reference picture in decoding order and precede the current picture in decoding order; and the indication of the previous reference picture, a second set of indicators to all reference pictures included in a first reference picture set, "RPS", of the previous reference picture, and a third set of indicators to all pictures that follow the previous reference picture in decoding order and precede the current picture in decoding order; and when a long term reference picture in a second RPS of the current picture has least significant bits of a picture order count, for which more than one picture indicated in the first set share the same value of the least significant bits of picture order count as the long term reference picture, setting a flag for the long term reference picture, wherein the flag indicates use of a picture order count cycle and least significant bits of the picture order count to indicate the long term reference picture in the second RPS.