A method for decoding an intra-frame prediction mode, comprising: obtaining a first flag bit from a code stream, wherein the first flag bit is used to indicate whether an intra-frame prediction mode of a current intra-frame decoding block is the same as one of a predetermined number of reference prediction modes of the intra frame decoding block, and when the first flag bit indicates that the intra-frame prediction mode of the current intra-frame decoding block is different from all of the reference prediction modes, obtaining a fixed number of mode encoded bits from the code stream, wherein the intra-frame prediction mode is a prediction mode adopted when the intra-frame decoding block is pixel-decoded, wherein current intra-frame encoding blocks of different sizes all use the same prediction mode set, the different sizes include 4x4, 8x8, 16x16, 32x32 and 64x64, and the prediction mode set includes 35 prediction modes; obtaining a prediction mode encoding value according to the mode encoded bits, wherein the prediction mode encoding value has been determined in a method for encoding an intra-frame prediction mode by subtracting from the value of the intra-frame prediction mode of said current intra-frame decoding block the number of reference prediction modes with value less than said value of the intra-frame prediction mode; obtaining the values of the predetermined number of reference prediction modes of the intra-frame decoding block, wherein the reference prediction modes are intra-frame prediction modes of available adjacent blocks of the current intra-frame decoding block and, if there are insufficient distinct intra frame prediction modes of said available adjacent blocks, prediction modes in a preset backup reference mode set, wherein all prediction modes in the preset backup reference mode set belong to the prediction mode set; and obtaining said intra-frame prediction mode of the current intra-frame decoding block according to a size relationship between the prediction mode encoding value and said values of said predetermined number of reference prediction modes. obtaining a first flag bit from a code stream, wherein the first flag bit is used to indicate whether an intra-frame prediction mode of a current intra-frame decoding block is the same as one of a predetermined number of reference prediction modes of the intra frame decoding block, and when the first flag bit indicates that the intra-frame prediction mode of the current intra-frame decoding block is different from all of the reference prediction modes, obtaining a fixed number of mode encoded bits from the code stream, wherein the intra-frame prediction mode is a prediction mode adopted when the intra-frame decoding block is pixel-decoded, wherein current intra-frame encoding blocks of different sizes all use the same prediction mode set, the different sizes include 4x4, 8x8, 16x16, 32x32 and 64x64, and the prediction mode set includes 35 prediction modes; obtaining a prediction mode encoding value according to the mode encoded bits, wherein the prediction mode encoding value has been determined in a method for encoding an intra-frame prediction mode by subtracting from the value of the intra-frame prediction mode of said current intra-frame decoding block the number of reference prediction modes with value less than said value of the intra-frame prediction mode; obtaining the values of the predetermined number of reference prediction modes of the intra-frame decoding block, wherein the reference prediction modes are intra-frame prediction modes of available adjacent blocks of the current intra-frame decoding block and, if there are insufficient distinct intra frame prediction modes of said available adjacent blocks, prediction modes in a preset backup reference mode set, wherein all prediction modes in the preset backup reference mode set belong to the prediction mode set; and obtaining said intra-frame prediction mode of the current intra-frame decoding block according to a size relationship between the prediction mode encoding value and said values of said predetermined number of reference prediction modes.