主权项 |
1. A transformation mode encoding method, comprising:
obtaining a prediction mode of a predicted data block that corresponds to a residual data block of a video image to be encoded; selecting a transformation mode corresponding to the prediction mode from a candidate transformation mode set; and performing a transformation operation on the residual data block of the video image based on the transformation mode, wherein the correspondence between the candidate transformation mode set and the prediction mode comprises:
if the prediction mode is an intra-frame prediction mode, when a quantity of pixels that are among predicted pixels in the prediction mode and are located at an upper boundary and an upper right boundary of an encoding unit exceeds a set quantity, selecting a latitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; when a quantity of pixels that are among the predicted pixels in the prediction mode and are located at a left boundary and a lower left boundary of the encoding unit exceeds the set quantity, selecting a longitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; otherwise, selecting a square block transformation as a transformation type corresponding to the prediction mode; orif the prediction mode is an intra-frame prediction mode, when a quantity of pixels that are among predicted pixels in the prediction mode and are located at an upper boundary and an upper right boundary of an encoding unit exceeds a set quantity, selecting a non-longitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; when a quantity of pixels that are among the predicted pixels in the prediction mode and are located at a left boundary and a lower left boundary of the encoding unit exceeds the set quantity, selecting a non-latitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; otherwise, selecting a preset transformation type in all transformation types as a transformation type corresponding to the prediction mode; orif prediction information represents a vertical texture, selecting a latitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; if the prediction information represents a horizontal texture, selecting a longitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; and if the prediction information represents no texture or an irregular texture, selecting a square block transformation as a transformation type corresponding to the prediction mode; orif prediction information represents a vertical texture, selecting a non-longitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; if the prediction information represents a horizontal texture, selecting a non-latitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; and if the prediction information represents no texture or an irregular texture, corresponding to all types of transformations; orif prediction information represents a latitudinal or non-longitudinal rectangular block transformation, selecting the latitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; if the prediction information represents a longitudinal or non-latitudinal rectangular block transformation, selecting the longitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; and if the prediction information represents a square block transformation, selecting the square block transformation as a transformation type corresponding to the prediction mode; orif prediction information represents a latitudinal or non-longitudinal rectangular block transformation, selecting the non-longitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; if the prediction information represents a longitudinal or non-latitudinal rectangular block transformation, selecting the non-latitudinal rectangular block transformation as a transformation type corresponding to the prediction mode; and if the prediction information represents a square block transformation, corresponding to all types of transformations. |