A kind of video code flow decoding method and device
Technical field
The present invention relates to coding and decoding video fields, and in particular to a kind of decoding method and device of video code flow.
Background technology
Syntactic structure is to be generated by several syntactic elements according to tissue is sequentially carried out described in video encoding and decoding standard
Specified video code flow (syntax structure:Zero or more syntax elements present together
In the bitstream in a specified order), wherein syntactic element indicates the various coding informations in code stream
(syntax element:An element of data represented in the bitstream).Piece (Slice) is
A kind of division of coded image, it is contained, and by coding unit, (coding unit can be the MB in standards such as H.264
(MacroBlock) or the CU in HEVC (High efficiency video coding, high efficiency Video coding) standard
(Coding Unit) or LCU (Large Coding Unit)) scanning sequency several coding units.The syntactic structure of piece is
Most basic syntactic structure in video encoding and decoding standard is divided into two large divisions, respectively head (Slice Header) and the piece number
According to (Slice Data).The syntactic structure of head define in piece in all coding unit encoding-decoding process it is required use it is public
Information, such as flag bit (flags), sheet type, the position of piece address syntactic element and analytic method.The syntactic structure of sheet data
Define the tissue and analytic method of coding unit coding information all in piece.
Coding information caused by each function module in the syntactic structure regulation video encoding and decoding standard of coding unit
The method of tissue and coding.Meanwhile the syntactic structure of coding unit also influence video algorithm application-specific integrated circuit (ASIC,
Application Specific Integrated Circuit) design, to be generated very to the performance of video algorithm ASIC
Big influence.
Application-specific integrated circuit (ASIC) realizes video encoder, and typically function module different in encoder is to multiple
Coding unit carries out parallel pile line operation, and real time codec is carried out by coding unit.Which rank of function module is divided into
In assembly line, the dependence and complexity generally between function module are related, under normal circumstances pipeline processes at different levels
The time of coding unit data is suitable.The structure chart of one as shown in Figure 1 H.264 encoder, the encoder is by 4 function modules
Composition is divided into 3 grades of (stage) pipeline organizations.Figure includes prediction (Prediction) module, rebuild module (packet
Include residual computations Diff, transformation, quantization and reconstruction (Recon)), filter module (such as block-eliminating effect filtering (DF, Deblock
Filter)), residual information (mb infos) is inputted entropy code module by entropy code module (CABAC), rebuild module, will
Reconstruction information (rcn) inputs block-eliminating effect filtering module.
Traditional entropy coding function module is in the afterbody assembly line of encoder, is received front function module and was transmitted
The information (such as mb infos in Fig. 1) of the coding unit to be encoded come, and encoded.Inside the standard having, by
There is no data dependence relation (such as H.264 in DF modules) in some function module and entropy coding function module, it is possible to
It exists together assembly line afterbody with entropy code module, the progress that the two can be parallel.But in the video standard having, entropy coding
The input of function module, which not only has from its previous stage function module, transmits information to be encoded, while also having from the same level with it
Pipeline function module pass over information to be encoded, at this moment the processing sequence of entropy code module determines this function mould
Can block be in the same level-one of assembly line with entropy coding function module.
When there is multiple-stage filtering processing, such as filter module includes:DF submodules, SAO (Sample Adaptive
Offset, sample point adaptive-filtering) submodule and ALF (Adaptive loop filter, adaptive loop filter) submodule
Block as shown in Fig. 2, needing to encode the information of several function modules in the entropy coding function module CABAC of HEVC standard, including becomes
The filtered sao info of coding_tree infos, SAO after quantization are changed, may further include the filtered alf info of ALF
Deng.If entropy coding function module needs the information after encoded filter first, then entropy coding function module and filter module are just
Can only be serial, entropy coding function module needs after the completion of waiting for filter module processing, and entropy coding function module could work.
Entropy coding function module can only be individually placed on to afterbody at this time, will be increased before entropy coding function module corresponding slow
Punching needs the encoded element information encoded, as shown in Figure 3 to buffer previous stage.Therefore in this case, how one kind is designed
Rational syntactic structure, to improve the performance of encoder, and the expense for reducing its on piece memory seeks to solve the problems, such as.
Invention content
Technical problem to be solved by the invention is to provide a kind of video code flow decoding method and devices, can improve volume solution
The performance of code device.
In order to solve the above technical problems, the present invention provides a kind of coded video bit stream methods, including:
Entropy coding function module handles the sequencing of coding unit according to other function modules in encoder, to other work(
What energy resume module coding unit generated needs the information of entropy coding to carry out entropy coding, during carrying out entropy coding, per entropy
After coding completes the information of a coding unit, if the limitation for reaching default unit is judged, to where current coded unit
After the corresponding filtering information of maximum coding unit carries out entropy coding, this entropy coding function module is reset.
Further, the method further includes, after the information that a coding unit is completed per entropy coding, if judging not reach
To the limitation of default unit, then according to maximum coding unit where current coded unit, whether entropy coding finishes determines whether that entropy is compiled
The corresponding filtering information of the code maximum coding unit, continues the information of the lower coding unit of entropy coding.
Further, it if the limitation for judging to reach default unit, is encoded to maximum where current coded unit
After the corresponding filtering information of unit carries out entropy coding, this entropy coding function module is reset, including:
Judge that if it is the last one in default unit, first state mark is written in current coded unit in code stream
Note is based on the status indication after carrying out entropy coding to the corresponding filtering information of maximum coding unit where current coded unit
Reset entropy coding function module.
Further, if the limitation of the not up to default unit of the judgement, according to maximum where current coded unit
Whether entropy coding finishes coding unit determines whether the corresponding filtering information of maximum coding unit described in entropy coding, continues entropy coding
The information of next coding unit, including:
If judging current coded unit not to preset the last one in unit, current coded unit place is judged most
Whether entropy coding finishes big coding unit, if entropy coding finishes, to the corresponding filtering information of the maximum coding unit into
After row entropy coding, the entropy coding of the information of each coding unit in next maximum coding unit is carried out, if entropy coding does not finish,
Continue the information of other coding units in the current maximum coding unit of entropy coding.
Further, judge whether the limitation for reaching default unit in the following ways:Judge the coding being entropy encoded
Whether element number or size reach a default unit.
Further, the default unit is piece.
In order to solve the above technical problems, the present invention also provides a kind of video code flow coding/decoding methods, including:
During carrying out entropy decoding, after the information that a coding unit is completed per entropy decoding, if judging to reach pre-
If the limitation of unit, then after carrying out entropy decoding to the corresponding filtering information of maximum coding unit where current coded unit, resetting
This entropy decoding function module.
Further, the method further includes, after the information that a coding unit is completed per entropy decoding, if judging not reach
To the limitation of default unit, then according to maximum coding unit where current coded unit, whether entropy decoding finishes determines whether entropy solution
The corresponding filtering information of the code maximum coding unit, continues the information of the lower coding unit of entropy decoding.
Further, it if the limitation for judging to reach default unit, is encoded to maximum where current coded unit
After the corresponding filtering information of unit carries out entropy decoding, this entropy decoding function module is reset, including:
It is the last one in default unit according to the first state marker for judgment current coded unit in code stream, to current
After the corresponding filtering information of maximum coding unit where coding unit carries out entropy decoding, entropy decoding is reset based on the status indication
Function module.
Further, if the limitation of the not up to default unit of the judgement, according to maximum where current coded unit
Whether entropy decoding finishes coding unit determines whether the corresponding filtering information of maximum coding unit described in entropy decoding, continues entropy decoding
The information of next coding unit, including:
If according to the first state marker for judgment current coded unit in code stream not being the last one in default unit,
Whether entropy decoding finishes maximum coding unit where then judging current coded unit, if entropy decoding finishes, to the maximum
After the corresponding filtering information of coding unit carries out entropy decoding, the entropy of the information of each coding unit in next maximum coding unit is carried out
Decoding, if entropy decoding does not finish, continues the information of other coding units in the current maximum coding unit of entropy decoding.
Further, the default unit is piece.
In order to solve the above technical problems, the present invention also provides a kind of coded video bit stream device, including entropy coding function mould
Block, which is characterized in that the entropy coding function module includes the first entropy code unit, judging unit, the second entropy code unit, again
Unit is set, wherein:
First entropy code unit, the priority for handling coding unit according to other function modules in encoder are suitable
Sequence, the information for needing entropy coding generated to other function modules processing coding unit carry out entropy coding;
The judging unit is used for during first entropy code unit carries out entropy coding, in the first entropy coding
After unit completes the information of a coding unit per entropy coding, judge whether the limitation for reaching default unit;
Second entropy code unit, for the judging unit judgement reach the limitation of default unit when, to current
The corresponding filtering information of maximum coding unit where coding unit carries out entropy coding;
The reset cell, for after second entropy code unit carries out entropy coding to the filtering information, resetting
The entropy coding function module.
Further, second entropy code unit is additionally operable to judge the limit of not up to default unit in the judging unit
When processed, according to maximum coding unit where current coded unit, whether entropy coding finishes determines whether maximum coding described in entropy coding
The corresponding filtering information of unit.
Further, the judging unit is the limitation for judging whether to reach default unit in the following ways:Sentence
Whether disconnected current coded unit is the last one preset in unit, if it is, first state label is written in code stream;
The reset cell is for based on first state label resetting entropy coding function module.
Further, second entropy code unit is in the following ways according to maximum where current coded unit
Whether entropy coding finishes coding unit determines whether the corresponding filtering information of maximum coding unit described in entropy coding:Second entropy
Coding unit is after maximum coding unit entropy coding where current coded unit, filter corresponding to the maximum coding unit
Wave information carries out entropy coding.
Further, the judging unit is the limitation for judging whether to reach default unit in the following ways:Sentence
Whether the disconnected coding unit quantity being entropy encoded or size reach a default unit.
Further, the default unit is piece.
In order to solve the above technical problems, the present invention also provides a kind of video code flow entropy decoder, including entropy decoding function
Module, which is characterized in that the entropy decoding function module includes the first entropy decoding unit, judging unit, the second entropy decoding unit
And reset cell, wherein:
First entropy decoding unit is used for the information of entropy decoding coding unit;
The judging unit, after in first entropy decoding unit per the information of the complete coding unit of entropy decoding,
Judge whether the limitation for reaching default unit;
Second entropy decoding unit, for the judging unit judgement reach the limitation of default unit when, to current
The corresponding filtering information of maximum coding unit where coding unit carries out entropy decoding;
The reset cell, for carrying out entropy solution to the corresponding filtering information of maximum coding unit where current coded unit
After code, this entropy decoding function module is reset.
Further, second entropy decoding unit is additionally operable to judge the limit of not up to default unit in the judging unit
When processed, according to maximum coding unit where current coded unit, whether entropy decoding finishes determines whether maximum coding described in entropy decoding
The corresponding filtering information of unit.
Further, the judging unit is the limitation for judging whether to reach default unit in the following ways:Root
Whether it is the last one preset in unit according to the first state marker for judgment current coded unit in code stream;
Second entropy decoding unit is used for, in the judging unit judges current coded unit for default unit most
When the latter, entropy decoding is carried out to the corresponding filtering information of maximum coding unit where current coded unit;
The reset cell is for based on first state label resetting entropy decoding function module.
Further, second entropy decoding unit is in the following ways according to maximum where current coded unit
Whether entropy decoding finishes coding unit determines whether the corresponding filtering information of maximum coding unit described in entropy decoding:
Second entropy decoding unit after maximum coding unit entropy decoding where current coded unit, to it is described most
The corresponding filtering information of coding unit greatly carries out entropy decoding.
The video stream encoding and decoding method and device proposed using the embodiment of the present invention, is compiled again by first entropy coding residual information
Code filtering information, is conducive to encoder functionality modular concurrent, reduces pipeline series, reduces buffering, to reduce chip area,
In addition it can reduce delay, the performance of codec is improved, the expense of hardware is reduced.
Description of the drawings
Fig. 1 is a kind of schematic diagram that H.264 encoder functionality module divides;
Fig. 2 is a kind of schematic diagram that HEVC encoder functionalities module divides;
Fig. 3 is that first encoded filter information causes pipeline series and the increased schematic diagram of buffering;
Fig. 4 is 3 code device structural schematic diagram of the embodiment of the present invention;
Fig. 5 is 4 decoding apparatus structural schematic diagram of the embodiment of the present invention;
Fig. 6 is using coding method flow chart in example 1;
Fig. 7 is using coding/decoding method flow chart in example 2.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature mutually can arbitrarily combine.
Embodiment 1
This example demonstrates that a kind of coding method, including:
Entropy coding function module handles the sequencing of coding unit according to other function modules in encoder, to other work(
What energy resume module coding unit generated needs the information of entropy coding to carry out entropy coding, during carrying out entropy coding, per entropy
After coding completes the information of a coding unit, if the limitation for reaching default unit is judged, to where current coded unit
After the corresponding filtering information of maximum coding unit carries out entropy coding, this entropy coding function module is reset.
After the information that every entropy coding completes a coding unit, if judge the limitation of not up to default unit,
According to maximum coding unit where current coded unit, whether entropy coding finishes determines whether maximum coding unit described in entropy coding
Corresponding filtering information continues the information of the lower coding unit of entropy coding.
Specifically, when judging to reach the limitation of default unit, following manner realization can be used in above-mentioned flow:Judge current
If it is the last one in default unit first state label is written, to current coded unit in coding unit in code stream
After maximum coding unit corresponding filtering information in place carries out entropy coding, entropy coding function module is reset based on the status indication.
Refer to based on status indication resetting entropy coding functional unit, if it is determined that first state label indicates that current coded unit is
The last one in unit is preset, then resets entropy coding function module.
Specifically, when judging the limitation of not up to default unit, following manner realization can be used in above-mentioned flow:According to code
If the first state marker for judgment current coded unit in stream is not the last one in default unit, further judge to work as
Whether entropy coding finishes maximum coding unit where preceding coding unit, if entropy coding finishes, to the maximum coding unit
After corresponding filtering information carries out entropy coding, the entropy coding of the information of each coding unit in next maximum coding unit is carried out, such as
Fruit entropy coding does not finish, then continues the information of other coding units in the current maximum coding unit of entropy coding.
Whether the limitation setting of default unit is reached:Whether the coding unit quantity or size being entropy encoded reach one
Default unit.Preferably, which is piece.
Embodiment 2
This example demonstrates that a kind of coding/decoding method, including:
During carrying out entropy decoding, after the information that a coding unit is completed per entropy decoding, if judging to reach pre-
If the limitation of unit, then after carrying out entropy decoding to the corresponding filtering information of maximum coding unit where current coded unit, resetting
This entropy decoding function module.
After the information that every entropy decoding completes a coding unit, if judge the limitation of not up to default unit,
According to maximum coding unit where current coded unit, whether entropy decoding finishes determines whether maximum coding unit described in entropy decoding
Corresponding filtering information then proceedes to the information of the lower coding unit of entropy decoding.
Specifically, when judging to reach the limitation of default unit, following manner realization can be used in above-mentioned flow:According to code stream
In first state marker for judgment current coded unit be the last one in default unit, to maximum where current coded unit
After the corresponding filtering information of coding unit carries out entropy decoding, entropy decoding function module is reset based on the status indication.
Specifically, when judging not reaching the limitation of default unit, following manner realization can be used in above-mentioned flow:According to
If the first state marker for judgment current coded unit in code stream is not the last one in default unit, current compile is judged
Whether entropy decoding finishes maximum coding unit where code unit, if entropy decoding finishes, is corresponded to the maximum coding unit
Filtering information carry out entropy decoding after, the entropy decoding of the information of each coding unit in next maximum coding unit is carried out, if entropy
Decoding does not finish, then continues the information of other coding units in the current maximum coding unit of entropy decoding.
Embodiment 3
The code device of 1 coding method of embodiment is realized in the present embodiment introduction, which includes entropy coding function mould
Block, as shown in figure 4, entropy coding function module includes the first entropy code unit, the first judging unit, the second entropy code unit, the
One reset cell, wherein:
First entropy code unit, the sequencing for handling coding unit according to other function modules in encoder,
The information for needing entropy coding generated to other function modules processing coding unit carries out entropy coding;
First judging unit, for during first entropy code unit carries out entropy coding, being compiled in the first entropy
After code unit completes the information of a coding unit per entropy coding, judge whether the limitation for reaching default unit;
Second entropy code unit, for first judging unit judgement reach the limitation of default unit when, to working as
The corresponding filtering information of maximum coding unit where preceding coding unit carries out entropy coding;
First reset cell, after in second entropy code unit to filtering information progress entropy coding, weight
Set the entropy coding function module.
Preferably, which is additionally operable to judge the limit of not up to default unit in first judging unit
When processed, according to maximum coding unit where current coded unit, whether entropy coding finishes determines whether maximum coding described in entropy coding
The corresponding filtering information of unit.Specifically, the second entropy code unit maximum coding unit entropy coding where current coded unit
After, entropy coding just is carried out to the corresponding filtering information of the maximum coding unit.
Specifically, which is the limitation for judging whether to reach default unit in the following ways:Sentence
Whether disconnected current coded unit is the last one preset in unit, if it is, first state label is written in code stream;It should
First reset cell is based on first state label resetting entropy coding function module.
Embodiment 4
The decoding apparatus of 2 coding/decoding method of embodiment is realized in the present embodiment introduction, which includes entropy decoding function mould
Block, as shown in figure 5, entropy decoding function module includes the first entropy decoding unit, second judgment unit, the second entropy decoding unit and the
Two reset cells, wherein:
First entropy decoding unit is used for the information of entropy decoding coding unit;
The second judgment unit, for the information in first entropy decoding unit per the complete coding unit of entropy decoding
Afterwards, judge whether the limitation for reaching default unit;
Second entropy decoding unit, for the second judgment unit judgement reach the limitation of default unit when, to working as
The corresponding filtering information of maximum coding unit where preceding coding unit carries out entropy decoding;
Second reset cell, for carrying out entropy to the corresponding filtering information of maximum coding unit where current coded unit
After decoding, this entropy decoding function module is reset.
Preferably, the second entropy decoding unit is additionally operable to judge the limitation of not up to default unit in the second judgment unit
When, according to maximum coding unit where current coded unit, whether entropy decoding finishes determines whether that maximum coding described in entropy decoding is single
The corresponding filtering information of member.Specifically, the second entropy decoding unit maximum coding unit entropy decoding where current coded unit is complete
Bi Hou just carries out entropy decoding to the corresponding filtering information of the maximum coding unit.
Specifically, above-mentioned second judgment unit is the limitation for judging whether to reach default unit in the following ways:
Whether it is the last one preset in unit according to the first state marker for judgment current coded unit in code stream;Second entropy
Decoding unit is used for, when the judging unit judges current coded unit to preset the last one in unit, to currently compiling
The corresponding filtering information of maximum coding unit carries out entropy decoding where code unit;Second reset cell is for based on described the
One status indication resets entropy decoding function module.
It is provided below in conjunction with the accompanying drawings using example, above-described embodiment is described in further detail.
Fig. 2 is a kind of HEVC (High efficiency video coding) advanced video encoding and decoding standard encoder knot
Structure schematic diagram, wherein prediction module (Prediction) include the function modules such as intra prediction, inter-prediction, rebuild module
(Diff/Recon) include the function modules such as residual computations, change quantization and reconstruction, CABAC is entropy coding function module, DF
(Deblock Filter), SAO (Sample Adaptive Offset), ALF (Adaptive Loop Filter) are respectively
Block-eliminating effect filtering, sample point adaptive-filtering and adaptive intra-loop filtering function module.
Using example 1
The processing procedure of coding side is as shown in fig. 6, include:
Step 1:Each function module of encoder is handled coding unit according to HEVC video encoding and decoding standards successively,
Wherein, entropy coding function module handles the sequencing of coding unit according to other function modules in encoder, to other functions
What resume module coding unit generated needs the information of entropy coding to carry out entropy coding;
Step 2:Judge whether current coded unit reaches the limitation of a piece (to preset unit for a piece)
When, if so, executing step 3, otherwise, execute step 5;
The enabled state of coding unit end mark (last_CU_in_slice_flag) is written in step 3 in code stream
(being, for example, 1) indicates that the coding unit for including in current slice has been entropy encoded end, and current coded unit is the last one, is held
Row step 4;
Step 4, the corresponding filtering information of maximum coding unit where entropy coding current coded unit, such as the SAO in table 1
And/or ALF information, entropy coding function module is reset, is terminated;
Specifically, after the complete filtering information of entropy coding, piece is directly or indirectly obtained according to the value of coding unit end mark
The value of end-of-data mark (end_of_slice_flag) is somebody's turn to do (end_of_slice_flag) mark and indicates to work as shown in table 1
Anter end of data can reset entropy code module at this time;
Step 5, the not enabled state of write-in coding unit end mark (last_CU_in_slice_flag) is (for example,
0), indicate that the coding unit for including in current slice not yet terminates;
Step 6, whether entropy coding finishes the maximum coding unit for judging where current coded unit, if finished, executes
Otherwise step 7 executes step 8;
Step 7, to the corresponding filtering information of maximum coding unit where current coded unit (SAO in such as table 1 and/or
ALF information) entropy coding is carried out, the entropy that entropy coding function module carries out the information of each coding unit in next maximum coding unit is compiled
Code;
Step 8, entropy coding function module continue the information of other coding units in the current maximum coding unit of entropy coding;
The sheet data syntactic structure of encoder is as shown in table 1.
In this example, coding unit end mark, that is, status indication is not reached when current coded unit reaches piece limitation and
It is all labeled when being limited to piece, in other embodiments, also can only it be marked when reaching piece limitation.
Using example 2
Decoding end processing procedure as shown in fig. 7, comprises:
The first step:Each function module of decoder is decoded coding unit at place successively according to HEVC video encoding and decoding standards
Reason;
Second step:Entropy decoding, first entropy decoding current coded unit information are carried out according to sheet data syntactic structure shown in table 1
coding_tree;
Third walks:Decoding obtains coding unit end mark (last_CU_in_slice_flag);
4th step:Judge whether current coded unit reaches a piece according to the enabled state for terminating state, if it is holding
Otherwise the 5th step of row executes the 6th step;
5th step:Coding unit end mark is enabled state (being, for example, 1), indicates the coding unit for including in current slice
It is over, current coded unit is the last one, then the corresponding filter of maximum coding unit where entropy decoding current coded unit
Wave information resets entropy decoding function module such as SAO the and/or ALF information in table 1;
According to the value of the coding unit end mark last_CU_in_slice_flag decoded in step 3 directly or
The value of current slice end-of-data mark end_of_slice_flag is obtained indirectly, end_of_slice_flag marks indicate to work as
Anter end of data can reset entropy decoder module, later the next coding unit of further decoding or progress image output.
6th step, coding unit end mark are not enabler flags (being, for example, 0), indicate the coding list for including in current slice
Member not yet terminates, and as shown in table 2, whether entropy decoding finishes the maximum coding unit for judging where current coded unit, if it is
The 7th step is executed, the 8th step is otherwise executed;
7th step:Entropy decoding, entropy decoding are carried out to the corresponding filtering information of maximum coding unit where current coded unit
Function module carries out the entropy decoding of the information of each coding unit in next maximum coding unit;
8th step:Entropy decoding function module continues the information of other coding units in the current maximum coding unit of entropy decoding.
Remaining syntactic structure is generated according to HEVC video encoding and decoding standards in decoder.
The syntactic structure of 1 sheet data of table (Slice Data)
The syntactic structure of table 2 CU layers (Coding_tree)
Present invention utilizes in ASIC design the characteristics of the parallel processing of decoder internal function module, it is proposed that a kind of new
Coded video bit stream and coding/decoding method, this method can improve encoder in the case where not influencing Video coding compression ratio
Degree of parallelism, and the demand of encoder on ASIC for caching is reduced, to improve the efficiency and performance of encoder.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program
Related hardware is completed, and described program can be stored in computer readable storage medium, such as read-only memory, disk or CD
Deng.Optionally, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly
Ground, the form that hardware may be used in each module/unit in above-described embodiment are realized, the shape of software function module can also be used
Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
Certainly, the invention may also have other embodiments, without deviating from the spirit and substance of the present invention, ripe
It knows those skilled in the art and makes various corresponding change and deformations, but these corresponding changes and change in accordance with the present invention
Shape should all belong to the protection domain of appended claims of the invention.