The encoding device (100) includes a circuit and a memory connected to the circuit. When the circuit is in operation, if the video parameter set is used for encoding an image, it writes a first parameter to the video parameter set, the first parameter representing the maximum number of one or more temporal sub-
layers in a layer set unit, where the layer set unit is a unit corresponding to a
stream and is composed of one or more
layers. It also writes a second parameter to the sequence parameter set, the second parameter representing the maximum number of one or more temporal sub-
layers in a sequence unit, where the sequence unit is a unit corresponding to at least a part of a
stream and is a unit referencing the sequence parameter set. If the video parameter set is used for encoding an image, the second parameter is limited to a value less than or equal to the first parameter. If the video parameter set is not used for encoding an image, the second parameter is limited to a fixed value or less.