Alternatively, when candIntraPredModeA and candIntraPredModeB are not the same and both candIntraPredModeA and candIntraPredModeB are not nondirectional modes, a second candidate group may include at least one of candIntraPredModeA, candIntraPredModeB, (maxAB?n), (maxAB+n), (minAB?n), (minAB+n) or a nondirectional mode. Herein, maxAB and minAB may mean the maximum value and the minimum value of candIntraPredModeA and candIntraPredModeB, respectively, and n may be an integer such as 1, 2, or more. The nondirectional mode may include at least one of a Planar mode or a DC mode. In an example, a candidate mode of a second candidate group may be determined as in the following Table 10 based on a difference value (D) between candIntraPredModeA and candIntraPredModeB.