An encoding apparatus comprising a converting apparatus and an integer encoding unit, wherein the converting apparatus comprises: a unary coding unit that subjects an input sequence of non-negative integer values to unary coding to obtain a unary coded sequence, the input sequence of non-negative integer values being hereinafter referred to as a first integer sequence; a bit reversing unit that bit-flips the value of the bits in the unary coded sequence to obtain a bit-flipped code sequence; and a unary decoding unit that subjects the bit-flipped code sequence to decoding using the same unary coding rule as the unary coding unit in an inverse manner to obtain a sequence of non-negative integer values, the sequence of non-negative integer values being hereinafter referred to as a second integer sequence, the encoding apparatus further comprising: a parameter determining unit that obtains a Golomb parameter S for each of a prescribed amount of sample values included in the sequence of non-negative integer values input to the encoding apparatus, the sequence of non-negative integer values for the prescribed amount of sample values being referred to as an input integer sequence and a parameter code corresponding to the Golomb parameter s, wherein, when the Golomb parameter s is less than 1, the converting apparatus obtains the second integer sequence by using the input integer sequence as the first integer sequence, the integer encoding unit subjects the second integer sequence to Golomb coding by using the inverse of the Golomb parameter s obtained by the parameter determining unit as the Golomb parameter, to obtain an integer code, and when the Golomb parameter s is at least 1, the integer encoding unit subjects the input integer sequence to Golomb coding by using the Golomb parameter s obtained by the parameter determining unit as the Golomb parameter, to obtain an integer code. a unary coding unit that subjects an input sequence of non-negative integer values to unary coding to obtain a unary coded sequence, the input sequence of non-negative integer values being hereinafter referred to as a first integer sequence; a bit reversing unit that bit-flips the value of the bits in the unary coded sequence to obtain a bit-flipped code sequence; and a unary decoding unit that subjects the bit-flipped code sequence to decoding using the same unary coding rule as the unary coding unit in an inverse manner to obtain a sequence of non-negative integer values, the sequence of non-negative integer values being hereinafter referred to as a second integer sequence, the encoding apparatus further comprising: a parameter determining unit that obtains a Golomb parameter S for each of a prescribed amount of sample values included in the sequence of non-negative integer values input to the encoding apparatus, the sequence of non-negative integer values for the prescribed amount of sample values being referred to as an input integer sequence and a parameter code corresponding to the Golomb parameter s, wherein, when the Golomb parameter s is less than 1, the converting apparatus obtains the second integer sequence by using the input integer sequence as the first integer sequence, the integer encoding unit subjects the second integer sequence to Golomb coding by using the inverse of the Golomb parameter s obtained by the parameter determining unit as the Golomb parameter, to obtain an integer code, and when the Golomb parameter s is at least 1, the integer encoding unit subjects the input integer sequence to Golomb coding by using the Golomb parameter s obtained by the parameter determining unit as the Golomb parameter, to obtain an integer code. a parameter determining unit that obtains a Golomb parameter S for each of a prescribed amount of sample values included in the sequence of non-negative integer values input to the encoding apparatus, the sequence of non-negative integer values for the prescribed amount of sample values being referred to as an input integer sequence and a parameter code corresponding to the Golomb parameter s, wherein, when the Golomb parameter s is less than 1, the converting apparatus obtains the second integer sequence by using the input integer sequence as the first integer sequence, the integer encoding unit subjects the second integer sequence to Golomb coding by using the inverse of the Golomb parameter s obtained by the parameter determining unit as the Golomb parameter, to obtain an integer code, and when the Golomb parameter s is at least 1, the integer encoding unit subjects the input integer sequence to Golomb coding by using the Golomb parameter s obtained by the parameter determining unit as the Golomb parameter, to obtain an integer code.