A method of decoding video data, the method comprising: determining a decoded syntax element by applying binary arithmetic decoding to an offset value included in a bitstream, wherein applying the binary arithmetic decoding comprises: generating a bin stream, wherein generating the bin stream comprises: for at least one respective bin of the bin stream: determining a value of the respective bin based on a state for the respective bin, an interval for the respective bin, and the offset value; determining one or more Finite State Machine parameters for a next bin of the bin stream, the one or more FSM parameters for the next bin controlling how probability estimates for the next bin are computed from a state for the respective bin, the next bin of the bin stream following the respective bin in the bin stream; and determining a state for the next bin of the bin stream using a parameterized state updating function that takes as input the state for the respective bin, the one or more FSM parameters for the next bin of the bin stream, and the value of the respective bin; and debinarizing the bin stream to form the decoded syntax element; and reconstructing a picture of the video data based in part on the decoded syntax element, characterised in that determining the one or more FSM parameters for the next bin comprises, modifying the FSM parameters for the next bin based on a measure of past probability variation. determining a decoded syntax element by applying binary arithmetic decoding to an offset value included in a bitstream, wherein applying the binary arithmetic decoding comprises: generating a bin stream, wherein generating the bin stream comprises: for at least one respective bin of the bin stream: determining a value of the respective bin based on a state for the respective bin, an interval for the respective bin, and the offset value; determining one or more Finite State Machine parameters for a next bin of the bin stream, the one or more FSM parameters for the next bin controlling how probability estimates for the next bin are computed from a state for the respective bin, the next bin of the bin stream following the respective bin in the bin stream; and determining a state for the next bin of the bin stream using a parameterized state updating function that takes as input the state for the respective bin, the one or more FSM parameters for the next bin of the bin stream, and the value of the respective bin; and debinarizing the bin stream to form the decoded syntax element; and generating a bin stream, wherein generating the bin stream comprises: for at least one respective bin of the bin stream: determining a value of the respective bin based on a state for the respective bin, an interval for the respective bin, and the offset value; determining one or more Finite State Machine parameters for a next bin of the bin stream, the one or more FSM parameters for the next bin controlling how probability estimates for the next bin are computed from a state for the respective bin, the next bin of the bin stream following the respective bin in the bin stream; and determining a state for the next bin of the bin stream using a parameterized state updating function that takes as input the state for the respective bin, the one or more FSM parameters for the next bin of the bin stream, and the value of the respective bin; and determining a value of the respective bin based on a state for the respective bin, an interval for the respective bin, and the offset value; determining one or more Finite State Machine parameters for a next bin of the bin stream, the one or more FSM parameters for the next bin controlling how probability estimates for the next bin are computed from a state for the respective bin, the next bin of the bin stream following the respective bin in the bin stream; and determining a state for the next bin of the bin stream using a parameterized state updating function that takes as input the state for the respective bin, the one or more FSM parameters for the next bin of the bin stream, and the value of the respective bin; and debinarizing the bin stream to form the decoded syntax element; and reconstructing a picture of the video data based in part on the decoded syntax element, characterised in that determining the one or more FSM parameters for the next bin comprises, modifying the FSM parameters for the next bin based on a measure of past probability variation.