A method of encoding video data, the method comprising: determining, for a current picture of the video data, one or more least significant bits of a picture order count value that identifies a long-term reference picture to be used when encoding at least a portion of the current picture; encoding at least the portion of the current picture using the long-term reference picture; when one or more least significant bits of any other picture order count values that identify any other picture stored to the decoded picture buffer to which the long-term reference picture is also stored are not the same as the determined one or more least significant bits of the picture order count value, specifying only the determined one or more least significant bits of the picture order count value in a bitstream representative of an encoded version of the video data; and when the one or more least significant bits of any other picture order count values that identify any other picture stored to the decoded picture buffer to which the long-term reference picture is also stored are the same as the determined one or more least significant bits of the picture order count value, specifying both the determined one or more least significant bits and one or more most significant bits of the picture order count value in the bitstream representative of an encoded version of the video data, characterized in that the number of one or more most significant bits that is specified in the bitstream is selected based on an analysis of all the pictures stored in the decoded picture buffer in such a way that the one or more most significant bits allow to disambiguate the picture order count value that identifies the long-term reference picture in the decoded picture buffer, and such that the method supports that the number of the one or more least significant bits when added to the selected number of the one or more most significant bits results in a total that is less than a total number of bits to specify the picture order count value. determining, for a current picture of the video data, one or more least significant bits of a picture order count value that identifies a long-term reference picture to be used when encoding at least a portion of the current picture; encoding at least the portion of the current picture using the long-term reference picture; when one or more least significant bits of any other picture order count values that identify any other picture stored to the decoded picture buffer to which the long-term reference picture is also stored are not the same as the determined one or more least significant bits of the picture order count value, specifying only the determined one or more least significant bits of the picture order count value in a bitstream representative of an encoded version of the video data; and when the one or more least significant bits of any other picture order count values that identify any other picture stored to the decoded picture buffer to which the long-term reference picture is also stored are the same as the determined one or more least significant bits of the picture order count value, specifying both the determined one or more least significant bits and one or more most significant bits of the picture order count value in the bitstream representative of an encoded version of the video data, characterized in that the number of one or more most significant bits that is specified in the bitstream is selected based on an analysis of all the pictures stored in the decoded picture buffer in such a way that the one or more most significant bits allow to disambiguate the picture order count value that identifies the long-term reference picture in the decoded picture buffer, and such that the method supports that the number of the one or more least significant bits when added to the selected number of the one or more most significant bits results in a total that is less than a total number of bits to specify the picture order count value.