Background technology
Good video coding-decoding method, need be under the prerequisite that guarantees high as far as possible compression efficiency, can support random access operation effectively, promptly after decoder is passed in the visual address that has random access point, decoder can be correctly decoded the described image that has a random access point and should image after image.At present, the prediction mode that video image sequence is used to encode can be divided into following three classes: first kind prediction mode is to utilize the pixel data of having encoded in the same images that present picture element is encoded; The second class prediction mode is, utilizes time sequencing promptly to play or the reference picture data of DISPLAY ORDER before current image, comes current image is encoded; The 3rd class prediction mode is to utilize reference picture data and time sequencing the reference picture data current image before of time sequencing after current image to come current image is encoded.In these three kinds of resulting bitstream data of coded system, all be useful on the identity code of sign one images character, which class prediction mode this figure of this yard explanation has used encode.Above-mentioned said current image promptly is the image of encoding or decoding.A said images can be that a two field picture or a field pattern resemble.
First kind prediction mode is owing to only use the data in this image to handle, and its code efficiency is minimum; The second class prediction mode is owing to utilized the reference picture data of current visual place before the moment to predict current image, and its compression efficiency is than the compression efficiency height of first kind prediction mode; The 3rd class prediction mode utilizes the reference picture data of current visual place before the moment to predict current image again owing to both utilized the reference picture data of current visual place after the moment, and its compression efficiency is the highest in above-mentioned three kinds of coded systems.But, in the above-mentioned three class coding techniquess, have only the first kind can support random access operation.
Existing MPEG-2 video encoding and decoding standard and H.264 video encoding and decoding standard all mix and used above-mentioned three class Predicting Techniques, for ease of describing, to call the image of encoding with first kind prediction mode in the following text is the A image, the visual B image of second class prediction mode coding, the image of the 3rd class prediction mode coding is the C image.In MPEG-2, a video sequence is divided into a series of group of picture, and each group of picture all has a group of picture head, i.e. the description of this group of picture feature realizes to enter the random access of this group of picture by the origin identification sign indicating number of seeking the image head.In each group of picture, the A image so that support random access, then adopts B image or C image to improve compression efficiency followed by the group of picture head afterwards as much as possible.
In MPEG-2, when introduce adopting the C image in the coding, the situation after the A image that the C image of previous group of picture follows in next group of picture might appear originally belonging in the code stream.When random access took place, the C image between first non-B image of owing to can't obtain the pairing current group of picture of random access point image before, closely follow after the A of current group of picture image, described A image is follow-up is just possible can not normal decoder.In order to address this problem, MPEG-2 has reserved the group of picture sealing and has indicated that can this group of picture random access take place in the group of picture head.
Utilize sealing to indicate that the method for carrying out the video random access operation is as follows:
Judge whether the C image (if there is) after first A image has only adopted the 4th class prediction mode after the group of picture head in the code stream, this mode has utilized the reference picture data after the current in chronological order image to predict current image, perhaps adopted first kind prediction mode coding, if, the sealing sign is made as 1 so, otherwise is made as 0.When sealing was masked as 1, if random access takes place, even if the image before the current group of picture can not obtain, the image in the current group of picture still can normal decoder; If sealing is masked as 0, then abandon current group of picture is carried out random access, continue to search for backward new group of picture.
In H.264, B image and C image have used the multi-reference frame technology, i.e. reference picture number during its predictive coding is more than a width of cloth.When introducing the B image of C image that adopts the 3rd class prediction mode or the second class prediction mode in the coding with many reference pictures, C image before the A image might occur originally belonging in the code stream and follow situation described A image after, perhaps immediately following the situation of the image before the described A image of the visual forward reference of the B after the A image.When random access took place, the image before the current A image may can't obtain, and the B image of above-mentioned situation or C image occurring just might can not normal decoder.In order to address this problem, H.264 middle introducing instantaneous decoding upgrades visual identifier and supports random access.When if current image is the immediate updating image, all reference pictures all can be marked as unavailable before the then current image, promptly on coded sequence, coded sequence is the time sequencing that picture coding is handled, be in immediate updating image image afterwards, all can not use immediate updating image image before when it is carried out second class prediction mode coding as the reference image.By using the immediate updating image, also can be good at realizing the video random access in H.264.
Though above-mentioned prior art has solved the problem of video random access, but bring new problem, that makes code efficiency reduce exactly.Because according to MPEG-2 or H.264 solve the method for random access in the standard, immediately following being subjected to certain restriction on the prediction direction of C image the A image after or B image and the optional reference picture number, will cause code efficiency reduction of this group C image or B image like this.Specifically, after the A image and one group of C image before the B image after the described A image can only carry out the 4th class prediction mode coding, and can't carry out the 3rd class prediction mode coding; And can only forward reference one images immediately following first B image after the A image, but and the reference picture of B image thereafter also can be subjected to numerical limitations.For the many video sequences of random access point, for example the broadcast video sequence requires a random access point was just arranged in average 0.5 second, and the problem that the code efficiency that existing video method of random access brings reduces is just more outstanding.
Summary of the invention
In view of this, the objective of the invention is to, propose a kind of method for video coding, when realizing, reduce the reduction of the video sequence coding efficient of bringing because of the random access technology again the video flowing random access.Described coding method comprises the steps:
A, do not judge whether to occur random access incision image in the encoded video sequence, if then the incision of the random access in described not encoded video sequence image is adopted first kind prediction mode coding;
B, with coded sequence be positioned at n images after the described random access incision image with described random access incision image as encoding with the 4th class prediction mode with reference to image, n is predefined positive integer;
C, for coded sequence other coding image not after described random access incision image, with described random access incision image or/and described random access incision image coding image afterwards encode as the reference image.
Another purpose of the present invention is, proposes and above-mentioned coding method corresponding decoding method, comprises the steps:
A, will be not random access incision image decoding in the decoding video sequence;
B, for the image decoding that the n width of cloth of decoding order after described random access incision image encoded with the 4th class coded system, n is predefined positive integer;
C, described random access incision is visual, and after the described random access incision image with the decoded picture of the 4th class coded system coding as the decoding reference picture, to decoding order after described random access incision image other not decoded picture decode.
The present invention also aims to, propose a kind of video coding encoding apparatus and decoding apparatus.Described code device comprises as lower module:
The random access judge module, be used to receive not encoded video sequence, judge that whether the current image that is received random access incision image occurs, if then current image and follow-up image are delivered to the random access coding module, otherwise is sent to the normal encoding module with described not encoded video sequence;
The random access coding module is used for current random access incision image and the image afterwards thereof received are encoded the video sequence behind the output encoder according to the random access coding rule;
The normal encoding module is used for current image and the image afterwards thereof received being encoded the video sequence behind the output encoder according to the normal encoding rule.
Described decoding device comprises as lower module:
The random access judge module, be used for the receiver, video sequence, it is visual to judge that whether institute's current decoded picture that receives is that random access is cut, if then described video sequence is sent to the random access decoder module, otherwise described video sequence is sent to the normal decoder module;
The random access decoder module is used for video sequence random access incision image and the image afterwards thereof received are decoded the video sequence behind the output decoder according to random access decoding rule;
The normal encoding module is used for the video sequence of being received is decoded according to the normal decoder rule, and the video sequence behind the output decoder.
The invention allows for the coding and decoding device of forming by above-mentioned encoding apparatus and decoding apparatus.
As can be seen from the above technical solutions, when coding, adopt the 4th class prediction mode to encode at least one images after the random access incision image; For other image after the random access incision image, just can encode as the reference image like this with the image of random access incision image and/or above-mentioned the 4th class prediction mode coding.Because the reference picture of random access incision image and image afterwards thereof can not comprise the image before the random access incision image, when decoding, just can realize that with random access incision image be the random access of cutting point.Compared with the prior art, the present invention program need not restriction is forced in the selection of reference picture when decoding, and its code check also has improvement significantly.
Embodiment
Core concept of the present invention is: random access point image is afterwards all encoded as the reference image without the image before the random access point, so just can realize according to random access point video sequence being carried out random access.This random access point promptly is the cutting point of video random access, can be the image that a width of cloth has the random access identifier in code stream, abbreviates random access incision image as.
The embodiment of the invention rationally uses the 4th class prediction mode to assist the video image random access, and the 4th class prediction mode promptly utilizes on the DISPLAY ORDER reference picture data after the current image to come current image is encoded.Below for convenience of explanation and corresponding with prior art, to be called the A image by the image that first kind prediction mode coding obtains, the image that is obtained by second class prediction mode coding is called the B image, the image that is obtained by the 3rd class prediction mode coding is called the C image, and the image that is obtained by the 4th class prediction mode coding is called the D image.Wherein, the compression efficiency of A image is lower, but supports random access; The compression efficiency of B image and C image improves successively, but because they need to be positioned on the decoding order their images before as with reference to image, does not support random access; The D image has good compression efficiency, and does not need to be positioned on the decoding order A image image before as the reference image.
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is further elaborated below in conjunction with accompanying drawing.
Embodiment one, if being located at one section coding method of video sequence is, between A image and the B image or between B image and the B image two C images arranged, and between A image and the A image 4 B images arranged, and promptly coded sequence is as follows: A1B4C2C3B7C5C6B10C8C9B13C11C12A16C14C15B19C17C18...
Simultaneously, this section video sequence can be expressed as on the time order and function order that shows: A1C2C3B4C5C6B7C8C9B10C11C12B13C14C15A16C17C18B19..., below abbreviate the time order and function that shows as DISPLAY ORDER in proper order.
Wherein index number is the sequence number of this images on DISPLAY ORDER.When normal encoding, visual C14, visual C15And visual B19But forward reference image B13If visual A16Be set to the random access incision image of this section video, then according to the present invention program, at visual A16After being encoded, with visual A16Back and visual B19Any C image before changes into the 4th class prediction mode encodes, and for example in this example coded sequence is closelyed follow at visual A16First the image encode original so visual C with the 4th class prediction mode14Become visual D14, its reference picture is visual A16Image D14With visual B14Identical on DISPLAY ORDER and coded sequence.Then the coded sequence of this section video becomes: A1B4C2C3B7C5C6B10C8C9B13C11C12A16D14C15B19C17C18....
According to the present invention program, visual D14Can be used as visual C15And visual B19The coded reference image, and visual C15And visual B19Can not use coded sequence at A16Image before is as the coded reference image.When decoding, when the random access that is set to this section video is cut visual A16During appearance, at first use first kind predictive coding mode to visual A16Decode, then with decoding order at visual A16After first width of cloth decode with the image of the 4th class prediction mode coding, and allow this images as immediately following first C image after this images and the reference picture of first B image.Finish decoding according to aforesaid operations, this section video can be realized with A16For cutting the random access of image.
From the concrete application of the invention described above scheme, as can be seen, encoding scheme of the present invention has following key point:
A, adopt first kind prediction mode coding for random access incision image;
One or more image on B, the coded sequence after random access incision image is encoded with the 4th class prediction mode, and its reference picture is a random access incision image;
C, for coded sequence other coding image not after described random access incision image, with described random access incision image or/and described random access incision image coding image afterwards encode as the reference image.Especially, the image that the image and/or the 4th class coded system of above-mentioned first kind predictive coding mode coding are encoded is as the reference image.
The encoding process flow process of the embodiment of the invention two comprises the steps: as shown in Figure 1
Step 101: judge that whether current image is set to random access incision image, if then execution instep 102, otherwise handles according to the normal encoding flow process.
Step 102: random access incision image is encoded with first kind prediction mode, obtain the A image.
Step 103: coded sequence is positioned at described random access incision image one or more image afterwards encodes with the 4th class prediction mode, reference picture is described A image, obtains the corresponding D image.In the present embodiment coded sequence is encoded with the 4th class prediction mode immediately following an images of described random access incision image.
Step 104: with described on coded sequence the coding image after A image and the A image, before the current image as with reference to image current image is carried out the second class prediction mode or the 3rd class prediction mode coding, obtain B image or C image.
Step 105: judge whether to also have uncoded image, if execution instep 106 then, otherwise finish this coding flow process.
Step 106: judge whether new random access incision image to occur,, otherwise go tostep 104 if then go tostep 102.
Corresponding decoding processing flow process comprises the steps: as shown in Figure 2
Step 201: if judge that current decoded image is random access incision image in the video sequence, then execution instep 202, otherwise handle according to the normal decoder flow process.
Step 202: the corresponding A image of random access incision image is decoded.
Step 203: the D image of will be on decoding order cutting after the visual A image immediately following described random access is decoded, and reference picture is the A image.
Step 204: as with reference to image, current decoded picture is decoded with the image after the described random access incision image, before the current decoded picture.
Step 205: judge whether to also have not decoded video image, if execution instep 206 then, otherwise finish this coding flow process.
Step 206: judge whether new random access incision image to occur,, otherwise go tostep 204 if then go tostep 202.
The image that adopts the 4th class prediction mode to encode among the embodiment two is next images of random access incision image on the coded sequence.In the prior art, A image and A image first B image afterwards, the number of the C image between perhaps adjacent two B images is generally a fixed value, is made as m.Thereby any one or a plurality of the changing into encoding by the 4th class prediction mode among the present invention program in this m the C image can be obtained the D image.
The embodiment of the invention three is for being used to realize the present invention program's random access encoding apparatus and decoding apparatus.Wherein, the random access code device comprises as shown in Figure 3:
Randomaccess judge module 301, be used to receive not encoded video sequence, judge whether the current image that is received is random access incision image, image is sent to randomaccess coding module 302 if then reach described current image thereafter, and image is sent tonormal encoding module 303 otherwise reach described current image thereafter.
Randomaccess coding module 302 be used for random access incision image and the image afterwards thereof received are encoded according to the random access coding rule, and the video sequence after will encoding is sent to memory module 304.Wherein, the random access coding rule satisfies following flow process in principle:
A, current random access incision image is encoded with first kind predictive coding mode;
B, with in the described not encoded video sequence, the n images of coded sequence after described random access incision image is visual as reference with described random access incision image, encodes with the 4th class predictive coding mode, n is predefined positive integer;
C, for coded sequence other coding image not after described random access incision image, with described random access incision image or/and described random access incision image coding image afterwards encode as the reference image.
The particular content of random access coding rule will be decided according to the concrete form of video sequence.For example adopt the code stream of embodiment one described coded system to encode with reference to the coded system of the embodiment of the invention one.
Normal encoding module 303, be used for to the current image received and thereafter image encode according to the normal encoding rule, and the video sequence after will encoding is sent to memory module 304.Described normal encoding rule can be any video sequence coding method that need not to realize random access, for example carries out coding method etc. with the second class prediction mode or the 3rd class prediction mode.
Memory module 304 is used to store the video sequence of being received, and with the video sequence output of being stored.
The random access decoding device of the embodiment of the invention comprises as shown in Figure 4:
Randomaccess judge module 401, be used for the receiver, video sequence, judge whether the image that is received is random access incision image, if then described video sequence is sent to randomaccess decoder module 402, otherwise described video sequence is sent tonormal decoder module 403;
Randomaccess decoder module 402 is used for the video sequence random access sign of being received corresponding image and image afterwards thereof are decoded the video sequence behind the output decoder according to random access decoding rule.Described random access decoding rule is corresponding mutually with random access coding rule in the above-mentioned code device, follows following flow process:
A, will be not random access incision image decoding in the decoding video sequence;
B, for the image decoding that the n width of cloth of decoding order after described random access incision image encoded with the 4th class coded system, n is predefined positive integer;
C, described random access incision is visual, and/or after the described random access incision image with the decoded picture of the 4th class coded system coding as the decoding reference picture, to decoding order after described random access incision image other not decoded picture decode.
Normal encoding module 403 is used for the video sequence of being received is decoded according to the normal decoder rule, and the video sequence behind the output decoder.
Display module 404 is used to receive the decoded video sequence from randomaccess decoder module 402 ornormal encoding module 403, and described video codes sequence is shown as video image.
Show by a large amount of experiments, under the same situation of supporting random access, the present invention program and MPEG-2 and H.264 the method for random access compare, can significantly save code check.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.