A second candidate group may be determined based on at least one of the above-described embodiments 1) to 3) or may be determined based on a combination of at least two of embodiments 1 to 3.
Meanwhile, the above-determined second candidate group may include a mode overlapped with the above-determined MPM. A mode overlapped with the MPM may be removed from a second candidate group. As a result of the removal, the number of intra prediction modes belonging to a second candidate group may be less than the maximum number of a second candidate group (MaxNumNonMPM). In this case, an intra prediction mode according to the above-described embodiment 2 or 3 may be added to a second candidate group. The addition may be repeatably performed until the number of intra prediction modes belonging to a second candidate group is the same as MaxNumNonMPM. The MaxNumNonMPM may be the fixed number which is pre-promised in an encoding/decoding device or may be variably determined based on the number of MPM belonging to a candidate mode list.
An encoding device may encode remaining mode information based on remaining modes (a third candidate group) other than a second candidate group among the non-MPM.
In the encoding, remaining mode information may be encoded based on a truncated binary coding method. For convenience of description, it is assumed that 67 intra prediction modes and 6 MPM are used.