A method for coding an image block to generate a bitstream including four luma binary data and one chroma binary data, each of the four luma binary data indicating a luma intra prediction mode used to predict luma samples in each of four subblocks constituting the image block, and each of the four luma binary data comprising a luma context-dependent segment and a luma context-independent segment, the one chroma binary data indicating a chroma intra prediction mode used to predict chroma samples in the image block, and the one chroma binary data comprising a chroma context-dependent segment and a chroma context-independent segment, the method comprising:
- splitting each of the four luma binary data into a luma context-dependent segment and a luma context-independent segment;
- splitting the one chroma binary data into a chroma context-dependent segment and a chroma context-independent segment;
- grouping first coded data including four coded luma context-dependent segments, second coded data including four coded luma context-independent segments and third coded data including a coded chroma context-dependent segment and a coded chroma context-independent segment;
- performing context adaptive binary arithmetic coding on the first coded data using a variable probability to generate coded luma context-dependent segments, and separately performing context adaptive binary arithmetic coding on the chroma context-dependent segment to generate a coded chroma context-dependent segment;
- performing bypass coding on the second coded data using a fixed probability to generate coded luma context-independent segments, and separately performing bypass coding on the chroma context-independent segment to generate a coded chroma context-independent segment,
- wherein the bitstream includes, in a following order, the coded luma context-dependent segments, the coded luma context-independent segments, the coded chroma context-dependent segment and the coded chroma context-independent segment.