1. An image encoding method comprising the steps of: receiving a coding unit to be encoded; performing one of inter-frame prediction and intra-frame prediction on the coding unit to generate a prediction block; generating a residual prediction block based on the generated prediction block and the coding unit; and applying one transform matrix among a plurality of predetermined transform matrixes to the generated residual prediction block to transform the residual prediction block, wherein the step of applying one transform matrix among a plurality of predetermined transform matrixes to the generated residual prediction block to transform the residual prediction block includes, in a case where the intra-frame prediction is performed and the transformed residual prediction block has a size of 4×4 or 8×8 pixels, applying all of 9 transform matrixes to each residual prediction block and then transforming the residual prediction block by applying the one transform matrix among the plurality of predetermined transform matrixes.