CN102263960B - Rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method - Google Patents
Rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method Download PDFInfo
- Publication number
- CN102263960B CN102263960B CN2011102324868A CN201110232486A CN102263960B CN 102263960 B CN102263960 B CN 102263960B CN 2011102324868 A CN2011102324868 A CN 2011102324868A CN 201110232486 A CN201110232486 A CN 201110232486A CN 102263960 B CN102263960 B CN 102263960B
- Authority
- CN
- China
- Prior art keywords
- amplitude
- table number
- code table
- code
- code word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention belongs to the technical field of digital video signal coding and decoding, and particularly discloses a rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method. In the method, the number of candidate code tables for decoding non-zero coefficient amplitudes is reduced from 7 to 2, and after the length of a first codeword is obtained, the computation of a second codeword can be started. When a second codeword of the non-zero coefficient amplitude is decoded, two possibly adopted code tables are computed at the same time by adopting a two-path parallel decoding method to obtain two possible decoding results. After the amplitude and code table information updating of the first codeword is finished, an accurate result can be selected from the two results. In such a way, a key path of a decoding flow can be shortened, thereby realizing the simultaneous decoding of two non-zero coefficient amplitudes within a clock cycle. Because the codeword of the non-zero coefficient amplitude is the most frequently occurring codeword in CAVLC, the data processing capability of a hardware decoder is greatly improved by the method.
Description
Technical field
The invention belongs to digital video signal encoding and decoding technique field, be specifically related to a kind of method of the CAVLC of decoding nonzero coefficient amplitude.
Background technology
H.264/AVC (Advanced Video Coding) combined and formulated the international video encoding standard formed by international telecommunication tissue (ITU) and Motion Picture Experts Group (MPEG), in the multimedia audio-video field, is widely used at present.H.264/AVC in, stipulate that its entropy coding can adopt in two ways: hereinafter self-adapting changeable long codes (CAVLC) and context-adaptive arithmetic coding (CABAC).CABAC has higher code efficiency, but the complexity of encoding and decoding also increases greatly, and CAVLC has equilibrium preferably on code efficiency and complexity.With last generation video standard such as MPEG-1, MPEG-2 compares, and the code efficiency of CAVLC has remarkable lifting.
Video heads information in video code flow and information of forecasting generally adopt fixed length code or the index Columbus code of lower complexity, and the information of residual error coefficient has occupied the overwhelming majority of video code flow, the coding of this part information need to adopt more efficient CAVLC coded system.The code word of CAVLC always has 5 classes:
1. Coeff_token: this code word represents the number of nonzero coefficient and the number (TrailingOnes) of hangover 1.
2. Sign_trail: this code word is the symbol of hangover 1.Each symbolic coding is a bit, and 0 means that positive 1,1 means negative 1.
3. Levels: the amplitude of the nonzero coefficient of other that this code word refers to that TrailingOnes is outer.
4. Total_zeros: the number of the total zero coefficient when it is coded in anti-Zig-Zag scanning sequency after first nonzero coefficient.
5. Run_before: this code word refers to the number of zero before each nonzero coefficient.
For the hardware decoding, the amplitude of calculating nonzero coefficient is the most time-consuming process in whole CAVLC decode procedure.For a length be highly all the graph block of 4 pixels, if adopt the CAVLC coded system, some code word such as Coeff_token, sign_trial and Total_zero only need to once decode in decode procedure, and the code word of nonzero coefficient amplitude can reach at most 16.Simultaneously, due to CAVLC, introduced the coded system of context-adaptive, the amplitude of current nonzero coefficient not only depends on code word itself, the decoded result that also depends on previous code word, the code word of each nonzero coefficient amplitude of can only decoding successively in order during decoding, can't promote decoding speed by simple increase hardware degree of parallelism.
Summary of the invention
The object of the invention is to propose a kind of method of fast decoding CAVLC nonzero coefficient amplitude, be applicable to the H.264 CAVLC decode procedure of video specification defined, can within a clock cycle, complete the decoding of two nonzero coefficient amplitudes.After in decoding, obtaining the length of first code word, the decode procedure of second code word just can start, and needn't wait until that all information of first code word all complete decoding.The input of decode procedure is the code table number of using in video code flow to be decoded and front once decoding, and output is the code table number of amplitude, length and the use of two nonzero coefficients.Concrete decode procedure is as follows:
(1), for first code word, calculate code word size and the decoded value (value that is called for short the amplitude prefix) of its amplitude prefix;
(2) calculate the length of first code word;
(3) calculate the amplitude of first code word;
(4), for the second code word, calculate code word size and the decoded value of its amplitude prefix;
(5) calculating two kinds of second code word may length and amplitude;
(6) upgrade the code table number of first code word output;
(7), for second code word, select correct amplitude and length as output;
(8) upgrade the code table number of second code word output.
In the present invention, by analyzing H.264 video standard, optimized the renewal process of code table number, candidate's code table number has been reduced to 2 by 7.H.264 CAVLC has stipulated 7 possible code table numbers, is respectively 0,1,2,3,4,5,6.This method dopes according to current code table number may be for the new code table number of next codeword decoding.If current code table number is 0, so new code table number is 1; If current code table number is 1, new code table number has two candidate values: 1,2; If current code table number is 2, new code table number has two candidate values: 2,3; If current code table number is 3, new code table number has two candidate values: 3,4; If current code table number is 4, new code table number has two candidate values: 4,5; If current code table number is 5, new code table number has two candidate values: 5,6; If current code table number is 6, new code table number is 6.
In the present invention, the correlation of code word before and after having eliminated, when the amplitude of calculating second nonzero coefficient and code word size, adopt the parallel method in 2 tunnels to start in advance decoding, according to two different Candidate key table numbers, calculate in advance length and the amplitude of second code word, rather than first code word complete decoding just starts after finishing by the time, can shorten the critical path on hardware time order like this, accelerates decoding process.
Beneficial effect of the present invention:
Can only decode within the clock cycle amplitude of a nonzero coefficient of existing method, and the method for describing in the present invention can double speed, within a clock cycle, can decode and obtain the amplitude of two nonzero coefficients, thereby improve the decoding speed of CAVLC integral body.Be applicable to the various H.264 electronic equipments of video decode function that have.
The accompanying drawing explanation
Fig. 1: the computational process of amplitude suffix length.
Fig. 2: the entire block diagram of two CALVC nonzero coefficient amplitudes of fast decoding.
Embodiment
The present invention will be further described below in conjunction with accompanying drawing.
The embodiment of fast decoding nonzero coefficient amplitude of the present invention is as follows:
(1) calculate the amplitude prefix (level_prefix) of first code word.The computational methods of amplitude prefix are as shown in table 1.The value of amplitude prefix can obtain by calculating in current video code stream code stream leading 0 number, the number that the value of amplitude prefix equals leading 0.The value that the code word size of amplitude prefix equals the amplitude prefix adds 1 again.
(2) calculate the length of first code word.The length that the length of first code word equals amplitude suffix (level_suffix) adds the length of amplitude prefix.As shown in Figure 1, the length of amplitude suffix is determined by amplitude prefix and current code table number the process of decoding amplitude suffix.When the amplitude prefix was less than 14, the length of amplitude suffix equaled a yard table number, and when the amplitude prefix equaled 14, the length of amplitude suffix was 4 bits, and when the amplitude prefix was greater than 14, the value that the length of amplitude suffix equals the amplitude prefix subtracted 3.
(3) calculate the amplitude of first code word.The amplitude of first code word can be obtained through logical operation by amplitude prefix, amplitude suffix and code table number, detailed process is by H.264 standard code, as shown in table 2, being explained as follows of each variable in table: level represents the amplitude of current code word, level_prefix is the amplitude prefix, level_suffix is the amplitude suffix, the number of trailingone representative hangover 1, and suffixLength represents current code table number; And<<representing respectively right-shift operation and shift left operation, % represents the operation of remainder number, and abs () means to ask the operation of absolute value, and min () is illustrated in two numbers and selects a less conduct output , & & Represent logical AND, || represent logic OR.
(4) calculate the amplitude prefix of second code word.The same step of this step (1).
(5) calculate the length of second code word.Because second code table number corresponding to code word not yet produces, need to calculate simultaneously two kinds of possible length, calculate the same step of concrete steps (2) of every kind of possibility length; Calculate the amplitude of second code word, in like manner, need to calculate simultaneously two kinds of possible amplitudes, calculate the same step of concrete steps (3) of every kind of possibility length.
(6) upgrade the code table number of first code word output.If the code table number equals 6, so new code table number is 6; If the code table number is 0, so new code table number is 1; Otherwise new code table number will according to the size of code word amplitude, determine whether equaling current code table number or current code table number adds 1.
(7) simultaneously, according to the new code table number of first code word output, from two candidate result that obtain step (5), selecting correct amplitude and the code word size decoded result as second nonzero coefficient code word.
(8) upgrade the code table number of second code word output.First calculate for two kinds of second code word possible new code table numbers, the same step of computational methods (6), and then, according to the code table number that first code word is exported, select correct code table number as final output.
As shown in Figure 2, through above-mentioned steps, the size of two adjacent nonzero coefficient amplitudes and code word size just can obtain the overall flow of two CALVC nonzero coefficient amplitudes of fast decoding within a clock cycle, and simultaneously up-to-date code table number has also obtained renewal.
Table 1: the decoding code table of amplitude prefix
The value of amplitude prefix | Video bit stream |
0 | 1 |
1 | 01 |
2 | 001 |
3 | 0001 |
4 | 00001 |
5 | 000001 |
6 | 0000001 |
7 | 00000001 |
8 | 000000001 |
9 | 0000000001 |
10 | 00000000001 |
11 | 000000000001 |
12 | 0000000000001 |
13 | 00000000000001 |
14 | 000000000000001 |
15 | 0000000000000001 |
… | … |
Table 2: the computational methods of nonzero coefficient amplitude
level = ( Min( 15, level_prefix ) << suffixLength ) |
if( suffixLength > 0 | | level_prefix >= 14 ) |
level = level + level_suffix |
if( level_prefix > = 15 && suffixLength = = 0 ) |
level = level + 15 |
if( level_prefix > = 16 ) |
level = level + ( 1 << ( level_prefix – 3 ) ) – 4096 |
if( (i = = TrailingOnes) && (TrailingOnes < 3) ) |
level = level + 2 |
if( level % 2 = = 0 ) |
level = ( level + 2 ) >> 1 |
Else |
level = ( –level – 1 ) >> 1 |
if( suffixLength = = 0 ) |
suffixLength = 1 |
if( Abs( level ) > ( 3 << ( suffixLength – 1 ) ) && suffixLength < 6 ) |
suffixLength=suffixLength+1 |
Claims (4)
1. the method for a fast decoding CAVLC nonzero coefficient amplitude is characterized in that concrete steps are as follows:
(1), for first code word, calculate code word size and the decoded value of its amplitude prefix;
(2) calculate the length of first code word;
(3) calculate the amplitude of first code word;
(4), for the second code word, calculate code word size and the decoded value of its amplitude prefix;
(5) calculating two kinds of second code word may length and amplitude;
(6) upgrade the code table number of first code word output;
(7), for second code word, select correct amplitude and length as output;
(8) upgrade the code table number of second code word output;
According to 7 of the regulation of CAVLC H.264 possible code table numbers: 0,1,2,3,4,5,6, according to current code table number, doping may be for the new code table number of next codeword decoding: if a current code table number is 0, a so new code table number is 1; If current code table number is 1, new code table number has two candidate values: 1,2; If current code table number is 2, new code table number has two candidate values: 2,3; If current code table number is 3, new code table number has two candidate values: 3,4; If current code table number is 4, new code table number has two candidate values: 4,5; If current code table number is 5, new code table number has two candidate values: 5,6; If current code table number is 6, new code table number is 6;
The method of the code table number of first code word output of described renewal is: if the code table number equals 6, so new code table number is 6; If the code table number is 0, so new code table number is 1; Otherwise new code table number determines whether equaling current code table number according to the size of code word amplitude or current yard table number adds 1; Simultaneously, according to the new code table number of first code word output, from two candidate result that obtain step (5), selecting correct amplitude and the code word size decoded result as second nonzero coefficient code word;
The method of the code table number of second code word output of described renewal is: first by the method for the code table number that upgrades first code word output, calculate for two kinds of second code word possible new code table numbers, and then, according to the code table number that first code word is exported, select correct code table number as final output.
2. the method for fast decoding CAVLC nonzero coefficient amplitude according to claim 1, it is characterized in that when the amplitude of calculating second nonzero coefficient and code word size, adopt the parallel method in 2 tunnels to start in advance decoding, namely according to two different Candidate key table numbers, calculate in advance length and the amplitude of second code word.
3. the method for fast decoding CAVLC nonzero coefficient amplitude according to claim 2, the value that it is characterized in that the amplitude prefix of first code word obtains by calculating in current video code stream code stream leading 0 number, the number that the value of amplitude prefix equals leading 0; The value that the code word size of amplitude prefix equals the amplitude prefix adds 1 again.
4. the length that the method for fast decoding CAVLC nonzero coefficient amplitude according to claim 3, the length that it is characterized in that first code word equal the amplitude suffix adds the length of amplitude prefix; And the length of decoding amplitude suffix is determined by amplitude prefix and current code table number: when the amplitude prefix is less than 14, the length of amplitude suffix equals a yard table number, when the amplitude prefix equals 14, the length of amplitude suffix is 4 bits, when the amplitude prefix was greater than 14, the value that the length of amplitude suffix equals the amplitude prefix subtracted 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011102324868A CN102263960B (en) | 2011-08-15 | 2011-08-15 | Rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011102324868A CN102263960B (en) | 2011-08-15 | 2011-08-15 | Rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102263960A CN102263960A (en) | 2011-11-30 |
CN102263960B true CN102263960B (en) | 2013-11-27 |
Family
ID=45010388
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011102324868A Expired - Fee Related CN102263960B (en) | 2011-08-15 | 2011-08-15 | Rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102263960B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101309423A (en) * | 2008-06-26 | 2008-11-19 | 四川虹微技术有限公司 | Method for decoding number of non-zero coefficient and number tailing coefficient |
CN101370138A (en) * | 2007-08-17 | 2009-02-18 | 中国科学院计算技术研究所 | Decoding method for H.264 standard CAVLC residual error coefficient |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100959532B1 (en) * | 2003-12-18 | 2010-05-27 | 엘지전자 주식회사 | Decoding method of CAVLC |
-
2011
- 2011-08-15 CN CN2011102324868A patent/CN102263960B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101370138A (en) * | 2007-08-17 | 2009-02-18 | 中国科学院计算技术研究所 | Decoding method for H.264 standard CAVLC residual error coefficient |
CN101309423A (en) * | 2008-06-26 | 2008-11-19 | 四川虹微技术有限公司 | Method for decoding number of non-zero coefficient and number tailing coefficient |
Also Published As
Publication number | Publication date |
---|---|
CN102263960A (en) | 2011-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11750826B2 (en) | Context and bypass encoding video | |
JP5733590B2 (en) | A context modeling technique for encoding transform coefficient levels. | |
US7501964B2 (en) | Entropy coding for digital codecs | |
US7564384B2 (en) | Binarizing method and device thereof | |
CN100553152C (en) | Coding method and equipment and coding/decoding method and equipment based on CABAC | |
KR101571618B1 (en) | Methods and devices for coding and decoding the position of the last significant coefficient | |
KR100717055B1 (en) | Method of decoding bin values using pipeline architecture, and decoding apparatus therefor | |
US8378862B2 (en) | Method and device for compression of binary sequences by grouping multiple symbols | |
MX2013013523A (en) | Method and apparatus for coding of intra prediction mode. | |
US20140286417A1 (en) | Data encoding and decoding | |
JP2008289125A (en) | Arithmetic decoding apparatus and method thereof | |
WO2012006738A1 (en) | Methods and devices for data compression using context-based coding order | |
KR101739603B1 (en) | Method and apparatus for reusing tree structures to encode and decode binary sets | |
US20130243102A1 (en) | Method and apparatus for arithmetic coding and termination | |
KR101511082B1 (en) | Method and apparatus for entropy encoding and decoding using least significant bits | |
KR101882543B1 (en) | Techniques for context-adaptive binary data arithmetic coding(cabac) decoding | |
CN100551064C (en) | Variable length encoding method and device | |
CN111818335A (en) | Entropy coding method and device and electronic equipment | |
CN102263960B (en) | Rapid context-adaptive variable-length coding (CAVLC) non-zero coefficient amplitude decoding method | |
JP2008118303A (en) | Decoding device and decoding method | |
CN112449201B (en) | Decoding method, encoding method, corresponding devices, electronic equipment and storage medium | |
Lee et al. | High-throughput low-cost VLSI architecture for AVC/H. 264 CAVLC decoding | |
CN102572437B (en) | Hardware realization method for rapidly decoding CAVLC (context-adaptive variable-length coding) run_before code | |
He et al. | Video coding technology proposal by RIM | |
US9973209B2 (en) | Processor and data processing method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20131127 Termination date: 20160815 |