Embodiments of the present disclosure provide a decoding method, an encoding method, a decoder, and an
encoder. In the present disclosure, the decoder operates as follows. A current block is predicted in an optimal MIP mode and in a first intra prediction mode. The optimal MIP mode is designed to be an optimal MIP mode, determined based on
distortion costs corresponding to multiple MIP
modes, for predicting the current block. The first intra prediction mode is designed to include at least one of: a suboptimal MIP mode, determined based on the
distortion costs corresponding to the multiple MIP
modes, for predicting the current block, an intra prediction mode derived from a decoder side
intra mode derivation (DIMD) mode, or an intra prediction mode derived from a
template based intra mode derivation (TIMD).