A kind of intraframe coding frame coding method based on the employing infra-frame prediction of predicting the piece group
Technical field
The invention belongs to the coding and decoding video field in the signal processing, particularly the coded prediction technology of intracoded frame.
Background technology
H.261 traditional video encoding standard such as ITU formulate, H.263, H.263+, the MPEG-1 that organizes to set up of the MPEG of standard and ISO H.264, MPEG-2, MPEG-4 etc. are based upon hybrid coding, promptly on the Hybrid Coding framework.So-called hybrid encoding frame is a kind of incorporation time space video encoding method, and this method comprises: carry out in the frame earlier, the prediction of interframe, to eliminate the correlation of time-domain; Then original image and the residual error that predicts the outcome are carried out two-dimensional transform (adopting discrete cosine transform or other linear transformation), eliminate spatial coherence; Carry out entropy coding then, remove statistical redundancy.
Two kinds of different coding methods of intracoded frame coding and inter-frame encoding frame coding have been comprised in the hybrid encoding frame.Traditional intracoded frame cataloged procedure is as follows: raw image data is carried out two-dimensional transform (adopting discrete cosine transform or integer transform); In transform domain, conversion coefficient is quantized then; Carry out entropy coding at last, i.e. Hunffman coding or arithmetic coding etc.The cataloged procedure of inter-frame encoding frame is as follows: adopt estimation to obtain motion vector, adopt inter prediction then based on motion compensation, then the residual block that inter prediction is obtained carries out two-dimensional transform, coefficient in transform domain is quantized again, and carries out entropy coding at last.
In order to improve compression efficiency, prediction is the most frequently used technology.In nearest H.264 video encoding standard, the coding of intracoded frame also uses intra-frame prediction method fully.Adopt the intraframe coding frame coding method of infra-frame prediction to be: the difference of the prediction piece that original picture block and intra-frame prediction method are obtained is carried out two-dimensional transform (employing discrete cosine transform or integer transform); In transform domain, conversion coefficient is quantized then; Carry out entropy coding at last, i.e. Huffman coding or arithmetic coding etc.
The existing intraframe coding frame coding method of infra-frame prediction that adopts comprises cataloged procedure and decode procedure, and the concrete steps of cataloged procedure wherein are:
1) from original image, extracts a prediction piece;
2) with various predictive modes each pixel in the prediction piece is carried out infra-frame prediction respectively, obtain the predicted value of the prediction piece under each predictive mode;
3) choose the predictive mode of the residual error minimum of interior raw image data of prediction piece and predicted value for the best;
4) residual error of raw image data and the predicted value of image under the predictive mode of the best in the prediction piece is carried out two-dimensional transform (adopting discrete cosine transform or integer transform); In transform domain, conversion coefficient is quantized then; At last coefficient after quantizing and best predictive mode are carried out entropy coding, i.e. Hunffman coding or arithmetic coding etc., and the data after will encoding write code stream.
The concrete steps of decode procedure are:
1) at first the data in the encoding code stream are carried out the decoding of entropy coding, decoded data are carried out inverse quantization and inverse transformation after, obtain the residual error data of this prediction piece, and judge optimum prediction mode selected in the cataloged procedure;
2) adopt selected optimum prediction mode,, predicted value is predicted and obtained to the prediction piece according to the reference pixel of prediction piece;
3) with 2) predicted value of the prediction piece that obtains of step adds 1) residual error data of the prediction piece that obtains of step, just obtained the data reconstruction of this prediction piece.
Prediction piece in the said method (Intra Predictive Block) has the prediction piece of two kinds of sizes: the rectangular block of macro block (16 * 16 pixel) and 4 * 4 pixels, as fundamental forecasting encoding and decoding unit, the intra prediction value of each pixel is to obtain by the encoded reference pixel with the piece of rebuilding around the prediction piece in the prediction piece with this prediction piece.Reference pixel described in the above-mentioned intra-frame prediction method must be a pixel encoded prior to this prediction piece and that rebuild.
In existing standard, the order of infra-frame prediction be level by left-to-right, therefore vertically from top to bottom, when each prediction piece is carried out infra-frame prediction, have only the encoded of the left side and top and the pixel of rebuilding may be brought as with reference to pixel.Every kind of predictive mode in the above-mentioned intra-frame prediction method corresponds respectively to different linear predictors.The parameter of linear fallout predictor is by the availability decision of the reference pixel of prediction piece top and left part.Every kind of linear predictor with reference pixel as input, output be the predicted value of corresponding predicted pixel.Said predictive mode in H.264, adopted level, vertical, tiltedly on and tiltedly the linear predictor of inferior a plurality of different directions current prediction piece predicted, wherein the rectangular block with 4 * 4 pixels serves as when predicting piece, adopted the linear predictor of 9 kinds of different directions, i.e. 9 kinds of predictive modes.When being the prediction piece, 4 kinds of predictive modes have been adopted with the macro block.
As mentioned above, in existing intraframe coding frame coding method prediction steps, the order of infra-frame prediction is that level is by left-to-right, vertically from top to bottom, Fig. 1 has marked the position relation of pixel (lowercase is represented) in the prediction piece of one 4 * 4 pixel size in H.264 and reference pixel (capitalization is represented) thereof.
As can be seen since in H.264, each prediction piece in the frame has been adopted simple by a left side and right, coded sequence from top to bottom, so reference pixel only may appear at the left side and the upside of prediction piece.When each prediction piece is carried out infra-frame prediction, the pixel possibility conduct of having only the encoded of the left side and top and rebuilding is with reference to pixel, because the raising that lacks meeting impact prediction efficient of reference pixel, can not satisfy the needs of various different motion images, hinder the further raising of video signal compression efficiencies.
Summary of the invention
The objective of the invention is in order to overcome the weak point of encoding and decoding technique in the existing frame, a kind of intraframe coding frame coding method of the employing infra-frame prediction based on intra-frame prediction block group (Intra Predictive Block Group) has been proposed, the present invention not only can improve infra-frame prediction efficient, thereby improve the compression efficiency of whole video signal, and can be applied to hybrid coding.
A kind of intraframe coding frame coding method that the present invention proposes based on the employing infra-frame prediction of predicting the piece group, it is characterized in that, set the prediction unit that predicts when infra-frame prediction is carried out in the piece conduct, this prediction piece is: x, y ∈ { 4,8,16}, wherein, x represents to predict the number of piece horizontal pixel, and y represents to predict the number of piece vertical pixel; It is to predict the piece group that said four continuous identical size prediction pieces are stitched together;
Described intraframe coding frame coding method comprises cataloged procedure and decode procedure, and wherein cataloged procedure may further comprise the steps:
1) from original image, extracts a prediction piece group of forming by 4 prediction pieces, and constitute the coded sequence of 24 kinds of prediction piece groups;
2) from said 24 kinds of coded sequences, choose coded sequence more than 2 kinds or 2 kinds, to with various predictive modes each pixel in the prediction piece being predicted respectively in the prediction piece group of wherein a kind of coded sequence, obtain the predicted value of the prediction piece under each predictive mode;
3) choose the predictive mode of the residual error minimum of interior raw image data of prediction piece and predicted value for the best;
4) residual error of raw image data and the predicted value of image under the predictive mode of the best in the prediction piece is encoded, and calculate coding cost when adopting this coded sequence;
5) to other selected coded sequence, repeat the above-mentioned the 2nd)-4) step, make every kind of coded sequence obtain the respective coding cost:
6) each coded sequence coding cost is down relatively chosen the minimum coded sequence for the best of coding cost; To write code stream corresponding to the coding result of forced coding order, and the forced coding order will be encoded, write code stream then;
This decode procedure may further comprise the steps:
1) at first the data in the encoding code stream is decoded and judge, obtain forced coding order selected in the cataloged procedure, forced coding optimum prediction mode in proper order down and the residual error data of predicting piece;
2) adopt selected forced coding order and the optimum prediction mode under the forced coding order,, predicted value is predicted and obtained to the prediction piece according to the reference pixel of prediction piece;
3) with the 2nd) predicted value of the prediction piece that obtains of step adds the 1st) residual error data of the prediction piece that obtains of step, just obtained the data reconstruction of this prediction piece.
Said every kind of predictive mode corresponds respectively to different fallout predictors; Every kind of fallout predictor with reference pixel as input, output be the predicted value of corresponding predicted pixel.
Principle of the present invention:
Intraframe coding frame coding method based on the employing infra-frame prediction of predicting the piece group of the present invention, be based on: the change of prediction group coded sequence makes the availability of right side and downside reference pixel become possibility in the prediction group, and Fig. 2 expresses the interior pixel (lowercase is represented) of prediction piece of one 4 * 4 pixel size that adopts the inventive method and the position relation of reference pixel (non-lowercase is represented) thereof.In the present invention, when each prediction piece adopts different coding order in to prediction piece group, reference element may also can appear at the right side and the downside of prediction piece, when according to different coded sequences to prediction piece group in each prediction piece when carrying out infra-frame prediction, pixel that can reference around each prediction piece can be different.The prediction effect that is drawn also can be different like this.As shown in Figure 3, each big square is represented a prediction piece group among the figure, and 4 blockages are represented 4 different prediction pieces in the big square.Arabic numerals 1-4 in the blockage represents the coded sequence of this prediction piece in prediction piece group.List 24 kinds of different coded sequences among Fig. 3 altogether.When for example being designated as 12 coded sequence down in adopting Fig. 3, when compiling the 4th prediction piece, owing to build 1,2,3 all encoded laying equal stress on, this prediction piece all can have reference pixel up and down so.For each prediction piece group, from different coded sequences, choose a kind of of the best, just choose the best coded sequence of prediction effect in fact, just might reach the purpose that improves code efficiency.
Characteristics of the present invention:
The present invention proposes to predict the intraframe coding structure of a kind of so new height adaptive of piece group, constructed a kind of intraframe coding scheme flexibly and effectively, it is single to overcome in the existing intraframe coding scheme reference pixel effectively, can not satisfy the shortcoming of various different motion image needs, can improve infra-frame prediction efficient, thereby improve the compression efficiency of whole video signal, and can be applied to hybrid coding.
Description of drawings
Fig. 1 concerns schematic diagram for the position of pixel (lowercase is represented) and reference pixel (capitalization is represented) thereof in the prediction piece of one 4 * 4 pixel size in H.264.
Fig. 2 concerns schematic diagram for the position of pixel (lowercase is represented) and reference pixel (non-lowercase is represented) thereof in the prediction piece of one 4 * 4 pixel size of employing the inventive method.
Fig. 3 is 24 kinds of different coded sequence schematic diagrames of the present invention.
Fig. 4 is a prediction piece schematic diagram of the present invention.
Fig. 5 is a prediction piece group schematic diagram of the present invention.
Embodiment
A kind of intraframe coding frame coding method based on the employing infra-frame prediction of predicting the piece group that the present invention proposes reaches embodiment in conjunction with the accompanying drawings and is described in detail as follows:
Prediction piece of the present invention is meant the prediction unit when carrying out infra-frame prediction, can be the rectangular block of size from 16 * 16 to 4 * 4, as shown in Figure 4, x, { 4,8,16}, x represent to predict the number of piece horizontal pixel to y ∈, and y represents to predict the number of piece vertical pixel.
Four continuous identical size prediction pieces are stitched together and are prediction piece group, as shown in Figure 5.
The present invention can be according to coding structure, the quantity of different coded sequences and different coded sequence is chosen in decision from 24 kinds of coded sequences shown in Figure 3, concrete principle: utilize prediction piece the got information of reference pixel on every side most possibly, obtain best predicting the outcome; The quantity of the coded sequence of choosing is as far as possible little of to reduce the coded sequence required bit of encoding.For example:
If the reference pixel of coding structure decision prediction piece top and left part can get, can select then that label is (1), (2), (3), 4 kinds of coded sequences of (4) (present embodiment just adopts this 4 kinds of coded sequences) among Fig. 3;
If the reference pixel of coding structure decision prediction piece right part can get, can select then that label is (8), 2 kinds of coded sequences of (13) among Fig. 3;
Above-mentioned again for choosing two examples of coded sequence quantity, the present invention can also adopt other the choosing of coded sequence.
The embodiment of intraframe coding frame coding method of the present invention comprises cataloged procedure and decode procedure, and wherein cataloged procedure may further comprise the steps:
1) from original image, extracts a prediction piece group of forming by 4 prediction pieces, and constitute the coded sequence of 24 kinds of prediction piece groups; As shown in Figure 3, number in the figure (1)-(24) are different coded sequences.
2) get the label shown in Fig. 3 and be (1), (2), (3), the prediction piece group of a kind of coded sequence in 4 kinds of coded sequences (4) (for example (1)), predict respectively predicting each pixel in the piece in this prediction group with various predictive modes respectively, obtain the predicted value of the prediction piece under each predictive mode;
3) choose the predictive mode of the residual error minimum of interior raw image data of prediction piece and predicted value for the best;
4) residual error of raw image data and the predicted value of image under the predictive mode of the best in the prediction piece is encoded (present embodiment adopts the residual error of raw image data and the predicted value of image under the predictive mode of the best in the prediction piece is carried out two-dimensional transform (adopting discrete cosine transform or integer transform); In transform domain, conversion coefficient is quantized then; At last coefficient after quantizing and best predictive mode are carried out entropy coding, be Hunffman coding or arithmetic coding etc., the particular content of described coding belongs to prior art, not within protection scope of the present invention), and the coding cost when calculate adopting this coded sequence;
5) be (2) to label, (3), 3 kinds of coded sequences of (4) repeat above-mentioned 2)-4) step, obtain every kind of coded sequence respective coding cost like this:
6) each coded sequence coding cost is down relatively chosen the minimum coded sequence for the best of coding cost; Will (present embodiment carries out entropy coding to the forced coding order corresponding to the coding of forced coding order; be Hunffman coding or arithmetic coding etc.; described entropy coding belongs to prior art; not within protection scope of the present invention) result writes code stream; and the forced coding order encoded, write code stream then.
Decode procedure may further comprise the steps:
1) at first the data in the encoding code stream is decoded and judge, obtain forced coding order selected in the cataloged procedure and the forced coding optimum prediction mode under in proper order;
2) adopt selected forced coding order and the optimum prediction mode under the forced coding order,, predicted value is predicted and obtained to the prediction piece according to the reference pixel of prediction piece;
3) with 2) predicted value of the prediction piece that obtains adds 1) residual error data of the prediction piece that obtains, just obtained the data reconstruction of this prediction piece.
Reference pixel described in the present invention is a pixel encoded prior to this prediction piece and that rebuild.Every kind of predictive mode among the present invention corresponds respectively to certain fallout predictor.Every kind of fallout predictor with reference pixel as input, output be the predicted value of corresponding predicted pixel.