Reference prediction mode values, also referred to as most probable modes, usable for encoding or decoding of a prediction mode related to a current coding unit, are derived. First and second reference prediction mode values are derived (S402) from respective prediction modes of at least two neighbouring coding units of the current coding unit. The first and second reference prediction modes are different. A third reference prediction mode value is derived (S403) from the first and second reference prediction mode values. The third reference prediction mode is different from each of said first and second reference prediction mode values. By deriving three MPMs instead of two for comparison with the prediction mode of the current coding block the coding efficiency is improved. This is due to the increase in the probability that the prediction mode of the current coding block corresponds to one of the derived most probable modes.