CN101198054A - Variable length coding and decoding method and its coding and decoding device - Google Patents

Variable length coding and decoding method and its coding and decoding device Download PDF

Info

Publication number
CN101198054A
CN101198054A CN 200610163459 CN200610163459A CN101198054A CN 101198054 A CN101198054 A CN 101198054A CN 200610163459 CN200610163459 CN 200610163459 CN 200610163459 A CN200610163459 A CN 200610163459A CN 101198054 A CN101198054 A CN 101198054A
Authority
CN
China
Prior art keywords
nonzero coefficient
coefficient
current block
amplitude
nonzero
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.)
Granted
Application number
CN 200610163459
Other languages
Chinese (zh)
Other versions
CN100542293C (en
Inventor
林四新
周建同
曾鹏鑫
熊联欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN 200610163459 priority Critical patent/CN100542293C/en
Publication of CN101198054A publication Critical patent/CN101198054A/en
Application granted granted Critical
Publication of CN100542293C publication Critical patent/CN100542293C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a variable length coding method which comprises the following steps: nonzero coefficient number and number of coefficients the amplitude of which is larger than one in the prior block are computed; entry bit streams of the statistic nonzero coefficient number are coded; entry bit streams of various nonzero coefficient symbols in the prior block and corresponding zero coefficients before nonzero coefficients are coded; moreover, entry bit streams of the statistic number of coefficients the amplitude of which is larger than 1 are coded; entry bit streams of amplitudes of the corresponding nonzero coefficients in the prior block are coded. Correspondingly, the invention also discloses a corresponding variable length decoding method and a variable length codec. The invention can further improve coding efficiency of entropy coding and at the same time the coding process is based on a simpler code list structure, thereby complexity of switching computation is lowered and occupancy of memory space is reduced.

Description

Variable-length code decode method and codec thereof
Technical field
The present invention relates to the video image encoding and decoding technical field, especially relate to a kind of variable-length code decode method and codec thereof.
Background technology
Entropy coding is the technology that is widely used in field of video encoding, wherein the entropy coding processing section is last part of whole video coding framework, be illustrated in figure 1 as the composition frame chart of present AVS video encoder, as seen the entropy coding processing section is in afterbody, and the code stream behind its coding is directly as the bit stream that transmits.A series of syntactic elements to all processing sections generations before liking of entropy coding, comprise macro block type information, reference frame index information, block encoding mode (CBP, Coded Block Pattern) information, quantization step (QP) information, the residual information of motion vector, the residual error coefficient information behind the transform and quantization etc.In all these syntactic elements, the data volume that the amount of information of residual error coefficient and final coding back form all is maximum, it also is to take the encoding compression space most simultaneously, and therefore the encoded question of residual error coefficient all is the research emphasis in entropy coding field all the time.
Variable-length encoding (VLC has appearred on this basis, Variable Length Coding) technology, this technology is by zig-zag scan image piece, the image block coefficient table is shown as (the number run of zero coefficient before the nonzero coefficient, nonzero coefficient level) several to form, and adopt a variable length code this (run that encodes, level) several right, this coding techniques is generally used for discrete cosine transform (DCT) coefficient is carried out elongated entropy coding, and typical two-dimensional variable length coding techniques (2D-VLC) has obtained MPEG-1, MPEG-2 and reached H.261 adopting of standard.
Development subsequently H.263, in the MPEG-4 standard, for improving block end mark (EOB, End ofBlock) code efficiency, and then three-dimensional variable-length encoding (3D-VLC) technology proposed again, promptly pass through (last, run, level) array is carried out combined coding, and wherein last represents whether this coefficient is last interior nonzero coefficient of piece.Reach H.263 at MPEG-2/4 simultaneously and all occurred designing the method for VLC code table more targetedly at macro block (mb) type (comprising intra piece or inter piece etc.) respectively in the standard.
Wherein in standard H.264/AVC, developed the elongated entropy coding based on image context, a kind of typical technology is that level and run value are set up separately coding of context respectively, and this technology is adopted by standard H.264; Another kind of typical technology is based on the context coding technology of 2D-VLC, and the core of its realization is the use of contextual information and the switching using method of each code table.
In present advanced audio/video the 7th part of encoding---adopted self-adaption two-dimensional VLC entropy coding in the mobile video (AVS-P7), its cataloged procedure will based in AVS-P7 by standardized 18 code tables, wherein these 18 code tables are divided into 3 classes, are respectively applied for the coding of intra Block Brightness coefficient, inter Block Brightness coefficient and chrominance block coefficient.Be illustrated in figure 2 as the self-adaption two-dimensional VLC entropy coding design philosophy schematic diagram that adopts in AVS-P7, for one 4 * 4 coefficient, the main points of coding are described below:
Piece coefficients by using 2D-VLC after the scanning encodes, promptly adopt (level, run)+coded system of EOB;
In Fig. 2, if 4 * 4 (level that coefficient forms after zig-zag scanning, run) sequence is a forward sequence, promptly the order from the low frequency to the high frequency is a forward sequence, and (level run) severally then adopts reverse order to encoding to above-mentioned here, in the reverse coding process, switch coding between 18 2D-VLC code tables, carry out the code table hand-off process according to last level value of having encoded between a plurality of code tables at every turn, wherein the coding to first coefficient then adopts independent code table;
Can adopt Exp-Golomb sign indicating number or Hybrid-Golomb sign indicating number to encode to all syntactic elements in the cataloged procedure.
But the code efficiency of above-mentioned 2D-VLC entropy coding is also lower, await further improving code efficiency, and this coded system need be carried out self adaptation and be switched between 18 code tables in cataloged procedure, therefore for these code tables of storage will take a large amount of internal memories, its handoff procedure is also comparatively complicated.
Summary of the invention
The present invention proposes a kind of variable-length code decode method, and with the code efficiency of further raising entropy coding, cataloged procedure switches the complexity of calculating and reduces taking of memory headroom thereby reduce based on more simple code table structure simultaneously.
The invention allows for a kind of variable-length code decode device accordingly.
For addressing the above problem, the technical scheme that the present invention proposes is as follows:
A kind of variable length encoding method comprises step: the number of nonzero coefficient and amplitude are greater than 1 coefficient number in the statistics current block; The nonzero coefficient number encoder that statistics is obtained advances code stream; The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; And the amplitude that statistics is obtained is greater than 1 the coefficient number into code stream of encoding; The amplitude coding of corresponding nonzero coefficient in the current block is advanced code stream.
A kind of variable length decoding method comprises step: the nonzero coefficient number of the current block that decoding receives; According to the nonzero coefficient number that decoding obtains, in current block, decode the number of zero coefficient before the nonzero coefficient symbol of corresponding number and the corresponding nonzero coefficient; And the amplitude of decoding current block is greater than 1 coefficient number; The amplitude that obtains according to decoding decodes the amplitude of corresponding nonzero coefficient greater than 1 coefficient number in current block.
A kind of variable length encoder comprises: be used for adding up the number of current block nonzero coefficient and the amplitude unit greater than 1 coefficient number; A nonzero coefficient number encoder that is used for that statistics is obtained enters the unit of code stream; Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream; With the amplitude that is used for statistics is obtained greater than 1 the coefficient number into unit of code stream of encoding; Be used for the amplitude coding of the corresponding nonzero coefficient of current block is advanced the unit of code stream.
A kind of length variable decoder comprises: the unit of the nonzero coefficient number of the current block that receives of being used to decode; Be used for the nonzero coefficient number that obtains according to decoding, in current block, decode the unit of the number of zero coefficient before the nonzero coefficient symbol of corresponding number and the corresponding nonzero coefficient; With the amplitude of the current block that is used to decode unit greater than 1 coefficient number; The amplitude that the user obtains according to decoding decodes the unit of the amplitude of corresponding nonzero coefficient greater than 1 coefficient number in current block.
A kind of variable length encoding method comprises step: the number of nonzero coefficient in the statistics current block; The nonzero coefficient number encoder that statistics is obtained advances code stream; The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; And the amplitude coding of corresponding nonzero coefficient in the current block advanced code stream; In code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
A kind of variable length decoding method comprises step: the nonzero coefficient number of the current block that decoding receives; According to the nonzero coefficient number that decoding obtains, in current block, decode the number of zero coefficient before the nonzero coefficient symbol of corresponding number and the corresponding nonzero coefficient; In current block, decode the amplitude of corresponding nonzero coefficient; And decoding obtains being used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
A kind of variable length encoder comprises: the unit that is used for adding up current block nonzero coefficient number; A nonzero coefficient number encoder that is used for that statistics is obtained enters the unit of code stream; Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream; With the unit that is used for the amplitude coding of the corresponding nonzero coefficient of current block is advanced code stream; Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient amplitude encoded at code stream.
A kind of length variable decoder comprises: the unit of the nonzero coefficient number of the current block that receives of being used to decode; Be used for the nonzero coefficient number that obtains according to decoding, in current block, decode the nonzero coefficient symbol of corresponding number and the unit of corresponding nonzero coefficient leading zero coefficient number; Be used for decoding the unit of corresponding nonzero coefficient amplitude at current block; Obtain being used to identify the end of block flag that the nonzero coefficient amplitude has been encoded with being used to decode.
A kind of variable length encoding method comprises step: amplitude is greater than 1 coefficient number in the statistics current block; The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; And in code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient symbol has been encoded; The amplitude that statistics is obtained is greater than 1 the coefficient number into code stream of encoding; The amplitude coding of corresponding nonzero coefficient in the current block is advanced code stream.
A kind of variable length decoding method comprises step: the number that decodes zero coefficient before nonzero coefficient symbol and the corresponding nonzero coefficient in current block; And decoding is used to identify the end of block flag that the nonzero coefficient symbol has been encoded in current block; Amplitude is greater than 1 coefficient number in the decoding current block; The amplitude that obtains according to decoding decodes the amplitude of corresponding nonzero coefficient greater than 1 coefficient number in current block.
A kind of variable length encoder comprises: be used for adding up the unit of current block amplitude greater than 1 coefficient number; Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream; Be coded into the unit that is used to identify the end of block flag that the nonzero coefficient symbol encoded with being used at code stream; Be used for amplitude that statistics is obtained greater than 1 the coefficient number into unit of code stream of encoding; Be used for the amplitude coding of the corresponding nonzero coefficient of current block is advanced the unit of code stream.
A kind of length variable decoder comprises: the unit that is used for decoding at current block nonzero coefficient symbol and corresponding nonzero coefficient leading zero coefficient number; Be used for being used to identify the unit of the end of block flag that the nonzero coefficient symbol encoded in current block decoding; The unit of current block amplitude greater than 1 coefficient number is used for decoding; Be used for the amplitude that obtains according to decoding greater than 1 coefficient number, in current block, decode the unit of corresponding nonzero coefficient amplitude.
A kind of variable length encoding method comprises step: the individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; In code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient symbol has been encoded; The amplitude coding of corresponding nonzero coefficient is advanced code stream; And in code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
A kind of variable length decoding method comprises step: the number that decodes zero coefficient before nonzero coefficient symbol and the corresponding nonzero coefficient in current block; And decode and be used to identify the end of block flag that the nonzero coefficient symbol has been encoded; In current block, decode the amplitude of corresponding nonzero coefficient; And decode and be used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
A kind of variable length encoder comprises: the unit that is used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced code stream; Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient symbol encoded at code stream; With the unit that is used for the amplitude coding of corresponding nonzero coefficient is advanced code stream; Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient amplitude encoded at code stream.
A kind of length variable decoder comprises: the unit that is used for decoding at current block nonzero coefficient symbol and corresponding nonzero coefficient leading zero coefficient number; Be used to decode the unit that is used to identify the end of block flag that the nonzero coefficient symbol encoded; Be used for decoding the unit of corresponding nonzero coefficient amplitude at current block; Be used to decode the unit that is used to identify the end of block flag that the nonzero coefficient amplitude encoded.
The beneficial effect that the present invention can reach is as follows:
After technical solution of the present invention is utilized the residual error coefficient process transform and quantization of image block through obtaining after the zig-zag scanning, in general distance of swimming run is enlarging state gradually from low frequency to high frequency, and the nonzero coefficient amplitude is to be the data source statistical property that reduces state gradually to high frequency from low frequency, proposition is when carrying out the VLC coding to each current image block, the individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream, and the amplitude coding of corresponding nonzero coefficient in the current block advanced code stream, therefore compare with existing scheme, further reduced encoder bit rate, saved encoding code stream, thereby improved code efficiency, and the present invention program no longer need store 18 code tables of the prior art in internal memory, but needed code table is set voluntarily according to circumstances, therefore save the shared memory headroom of a plurality of code tables, and reduced the complexity of in cataloged procedure, between a plurality of code tables, switching.
Description of drawings
Fig. 1 is the composition frame chart of present AVS video encoder;
The self-adaption two-dimensional VLC entropy coding design philosophy schematic diagram of Fig. 2 in AVS-P7, adopting;
Fig. 3 is for carrying out the embodiment processing procedure that VLC encodes to one 4 * 4 image block.
Embodiment
By self-adaption two-dimensional VLC entropy coding design philosophy schematic diagram shown in Figure 2 in the above-mentioned prior art as can be seen, the residual error coefficient that obtains after zig-zag scanning in the image block is through behind the transform and quantization, in general distance of swimming run is enlarging state gradually from low frequency to high frequency, and the nonzero coefficient amplitude is to be to high frequency from low frequency to reduce state gradually, therefore technical solution of the present invention takes into full account the statistical property of utilizing this data source, obtain a kind of new VLC encoding scheme, thereby improve the code efficiency of VLC entropy coding.
According to the statistical property to data source, the main design philosophy of the VLC encoding scheme that the present invention proposes is as follows:
Image block (as 4 * 4 image blocks) is carried out zig-zag scanning, obtain coefficient sequence; Nonzero coefficient in the coefficient sequence that obtains is carried out symbolism handle,, reach negative nonzero coefficient symbol is turned to-1 as positive nonzero coefficient symbol is turned to 1;
For each nonzero coefficient, the zero coefficient number before this nonzero coefficient of encoding and the symbol sign of this nonzero coefficient, promptly to (run, sign) several to encoding;
In the coefficient sequence that obtains, determine the amplitude (amplitude is the absolute value of nonzero coefficient) of each nonzero coefficient then, and the nonzero coefficient amplitude of respective number is encoded respectively as leaving over information.
For example, at first scan and will obtain following coefficient sequence by the zig-zag mode for 4 * 4 among above-mentioned Fig. 2:
9,2,-3,0,0,0,0,0,1,0,0,0,0,0,0,0;
The nonzero coefficient number n umCoef1 that comprises in the coefficient sequence that coding side at first the obtains scanning into code stream of encoding, with 4 * 4 among above-mentioned Fig. 2 be example, coding side needs at first numCoef1=4 is encoded into code stream;
Nonzero coefficient in the coefficient sequence that above-mentioned scanning is obtained carries out symbolism to be handled, and will obtain following coefficient sequence:
1,1,-1,0,0,0,0,0,1,0,0,0,0,0,0,0;
For each nonzero coefficient, the zero coefficient number before this nonzero coefficient of encoding and the symbol of this nonzero coefficient, as needs respectively to (0 ,+), (0 ,+), (0,-), (5 ,+) 4 arrays are encoded;
In the coefficient sequence that above-mentioned scanning obtains, determine the amplitude of each nonzero coefficient then, specific as follows:
9,2 3 1;
The amplitude that comprises in coding side and then the coefficient sequence that scanning is obtained is greater than 1 the nonzero coefficient number n umCoef2 into code stream of encoding, with 4 * 4 among above-mentioned Fig. 2 be example, the coding side and then the into code stream of numCoef2=3 need being encoded;
At last the amplitude of definite nonzero coefficient is encoded respectively as leaving over information.
On the other hand, the into code stream if the nonzero coefficient number n umCoef1 that comprises in the coefficient sequence that coding side is not selected scanning is obtained encodes can be considered to (0 ,+), (0, +), (0,-), (5, +) after 4 number group codings finish, and then coding advances the sign EOB1 of nonzero coefficient end-of-encode in an expression of the code stream current block, is used for being identified at current block and finishes the nonzero coefficient symbol is encoded.
On the other hand, if the amplitude that comprises in the coefficient sequence that coding side is not selected scanning is obtained is greater than 1 the nonzero coefficient number n umCoef2 into code stream of encoding, can consider after the amplitude of nonzero coefficient of having encoded, and then coding advances the sign EOB2 greater than 1 nonzero coefficient end-of-encode of amplitude in an expression of the code stream current block, is used for being identified at current block and finishes the nonzero coefficient amplitude is encoded.
As shown in Figure 3, be design philosophy, one 4 * 4 image block is carried out the embodiment processing procedure that VLC encodes according to such scheme, specific as follows:
Step1: at first current block is scanned by the zig-zag mode, obtain a coefficient sequence; Nonzero coefficient number n umCoef1 in the coefficient sequence statistics current block that obtains based on scanning, and with the numCoef1 that statistics obtains the into code stream of encoding.
If before step1 handles, whether can access about all coefficients of this current block is complete zero mark, promptly there is a nonzero coefficient in the numCoef1 that then can judge current block at least necessarily greater than 0, just needs to continue to carry out following step2 in this case; Whether be complete zero mark, the numCoef1 that then can judge current block might be zero if can not obtain about all coefficients of this current block else if, when numCoef1 is zero, can directly finishes the entropy coding of current block and handle.
Step2: begin each coefficient in the current block is encoded, respectively the number of zero coefficient before each nonzero coefficient symbol in the current block and the nonzero coefficient is encoded.
Setp3: amplitude is greater than 1 coefficient number numCoef2 in the coding current block.
Step4: judge that whether amplitude in the current block is zero greater than 1 coefficient number numCoef2, if be zero, then directly finishes the entropy coding of current block; Otherwise the amplitude of corresponding nonzero coefficient in the coding current block.
In addition in another embodiment, the processing procedure that one 4 * 4 image block is carried out the VLC coding is as follows:
Step2: at first current block is scanned by the zig-zag mode, obtain a coefficient sequence; Begin each coefficient in the current block is encoded, respectively the number of zero coefficient before each nonzero coefficient symbol in the current block and the nonzero coefficient is encoded; Then coding advances an EOB sign of code stream (being defined as EOB1 here) then;
Step4: the amplitude of corresponding nonzero coefficient in the coding current block; Then coding advances an EOB sign of code stream (being defined as EOB2 here) then.
Wherein in the above embodiments processing procedure, for the coded system of nonzero coefficient number n umCoef1 in the coding current block among the step1 can but be not limited to adopt following dual mode:
Mode one, no matter current block is a luminance block, chrominance block, or Intra-coded blocks also is that non-Intra-coded blocks is all unified according to the Golomb coding method of blocking current 4 * 4 middle nonzero coefficient number n umCoef1 (1<=numCoef1<=16) that encode, promptly according to following table 1 coding numCoef1:
Table 1:numCoef1 coding code table
Value Code word
0 0
1 10
2 110
3 1110
4 11110
5 111110
6 1111110
7 11111110
8 111111110
9 1111111110
10 11111111110
11 111111111110
12 1111111111110
13 11111111111110
14 111111111111110
15 111111111111111
Mode two, if current 4 * 4 is first 4 * 4 of image band, perhaps the macro block at its adjacent block place is the skip macro block, and perhaps its adjacent block is complete zero piece, then the code table that directly provides according to table 1 in the aforesaid way one nonzero coefficient number n umCoef1 in the current block that encodes; If current block can not satisfy above-mentioned condition simultaneously, then need according to current 4 * 4 nonzero coefficient number n umCoef1 predicted value numCoef1 that encodes, its concrete cataloged procedure is as follows:
Substep1 generates current 4 * 4 different numCoef1 predicted values according to following different situations;
(1) if current 4 * 4 left side piece and top piece is all available, the nonzero coefficient number of supposing left side piece is left_numCoef1, the top piece be top_numCoef1, the nonzero coefficient number n umCoef1 predicted value predNumCoef1=(left_numCoef1+top_numCoef1)/2 of current block then;
(2) if current 4 * 4 are had only left side piece available, numCoef1 predicted value=left_numCoef1 then;
(3) if current 4 * 4 are had only the top piece available, numCoef1 predicted value predNumCoef1=top_numCoef1 then;
Substep2, according to current 4 * 4 numCoef1 predicted value, again according to following 3 kinds of situations current 4 * 4 numCoef1 that encodes:
(1) if the macro block at current 4 * 4 places is intra type blocks, and current 4 * 4 predNumCoef1 satisfies 5<=predNumCoef1<=12, then earlier current 4 * 4 nonzero coefficient number NumCoef1 is mapped out the value of a correspondence according to a predetermined mapped table, then the code table that provides based on table 1 in the aforesaid way one this mapping value of encoding; Otherwise the nonzero coefficient number NumCoef1 that the direct code table that provides based on table 1 in the aforesaid way one is encoded current 4 * 4.Wherein the mapping table here can specifically be set according to concrete performance.
(2) if the macro block at current 4 * 4 places is inter type blocks, and current 4 * 4 predNumCoef1 satisfies 2<=predNumCoef1<=9, then earlier current 4 * 4 nonzero coefficient number NumCoef1 is mapped out the value of a correspondence according to a predetermined mapped table, then the code table that provides based on table 1 in the aforesaid way one this mapping value of encoding; Otherwise the nonzero coefficient number NumCoef1 that the direct code table that provides based on table 1 in the aforesaid way one is encoded current 4 * 4.Wherein the mapping table here can specifically be set according to concrete performance.
(3) if current 4 * 4 is chrominance block, the nonzero coefficient number NumCoef1 that the then direct code table that provides based on above-mentioned table 1 is encoded current 4 * 4.
In the Step2 of the foregoing description, coding side can but be not limited to adopt following dual mode the encode symbol (sign) of each nonzero coefficient and the zero coefficient number before the corresponding nonzero coefficient in the current block:
Mode one: scan current 4 * 4 according to the zig-zag mode from the low frequency to the high frequency, obtain current 4 * 4 coefficient sequence, the zero coefficient number run1 of nonzero coefficient symbol sign and its front in the coefficient sequence that definite scanning obtains is mapped to a symbol sym2D with each run1 and sign array respectively according to following mapping method then:
When a two field picture or an image band begin, at first array giSign[2 is counted in one of initialization], each image block is being carried out in the zig-zag scanning process, during whenever to the nonzero coefficient of a positive sign, giSign[0] add 1, and during whenever to the nonzero coefficient of a negative sign, giSign[1] add 1, giSign[0 wherein] and giSign[1] be counting array giSign[2] in two element values.
Like this as giSign[0]>=giSign[1] time, sym2D=2 * run1+ (level[yy] [xx]>0)? 0:1;
Level[yy in this formula wherein] [xx] be illustrated in that coordinate is (xx in the current block, yy) nonzero coefficient, (level[yy] [xx]>0)? 0:1 represents as level[yy] when [xx]>0 condition is set up, (level[yy] [xx]>0)? 0:1 directly gets 0, otherwise as level[yy] when [xx]>0 condition is false, (level[yy] [xx]>0)? 0:1 direct 1.
And as giSign[0]<giSign[1] time, sym2D=2 * run1+ (level[yy] [xx]>0)? 1:0;
Promptly (level[yy] [xx]>0)? 1:0 represents as level[yy] when [xx]>0 condition is set up, (level[yy] [xx]>0)? 1:0 directly gets 1, otherwise (level[yy] [xx]>0)? 0:1 direct 0.
Simultaneously as this counting array giSign[2] in element sum when surpassing the threshold value of a regulation, will update this counting array giSign[2], for example work as giSign[0]+giSign[1]>2 12The time, can will upgrade giSign[0]=giSign[0]/2 4, and upgrade giSign[1]=giSign[1]/2 4
Respectively the symbol sym2D that each mapping obtains is encoded according to the Golomb coded system of blocking then, wherein the false code that each symbol sym2D is encoded is as follows:
For(idx=0;sym2D>=idx&&idx<(16-numCoef1-codedRun)×2+1;idx++)
{
Setflag(sym2D>idx);
}
Wherein in above-mentioned false code, idx is used for counting, and codedRun represents the zero coefficient number of having encoded in the current block; Function S etflag represents to enroll 1 in code stream, otherwise enroll 0 in code stream when sym2D>idx condition is set up.Finish until NumCoef1 nonzero coefficient of current block all encoded according to above-mentioned cataloged procedure.
Mode two: according to zig-zag mode forward scan current block, when running into first nonzero coefficient, the zero coefficient number run1 before this nonzero coefficient and the symbol sign of this nonzero coefficient encode, wherein when coding run1, the macro block of judging the current block place earlier is luminance block or chrominance block, when being luminance block, judged result to and then judge also that the macro block at current block place is Intra-coded blocks or inter-coded block, thereby select different code tables according to judged result, can be that the macro block at current block place is in the frame during luminance block for example, select the code table a that presets in judged result; In judged result is the macro block at current block place when being the interframe luminance block, selects the code table b that presets; In judged result is the macro block at current block place when being chrominance block, select the code table c that presets, and then according to selected code table coding run1, code table a, the b that wherein presets, c can specifically set according to concrete performance; Then when coding sign, when sign value greater than 0 the time in code stream coding advance 0, when the sign value encodes 1 less than 0 the time in code stream.In the follow up scan process, whenever to a nonzero coefficient, just select a code table that presets according to the nonzero coefficient number NumCoef1 of current block, previous run1 value of having encoded, and based on the zero coefficient number run1 value of the current nonzero coefficient front of selecting that runs into of code table coding, the symbol sign of the current nonzero coefficient that runs into then then encodes, when the sign value greater than 0 the time in code stream coding advance 0, when sign value encodes 1 less than 0 the time in code stream.Finish until NumCoef1 nonzero coefficient of current block all encoded according to above-mentioned cataloged procedure.
In the above embodiments step3, coding side can but be not limited to adopt following dual mode to encode amplitude in the current block greater than 1 nonzero coefficient number NumCoef2:
Mode one: statistics scans current 4 * 4 and the amplitude that comprises in the coefficient sequence that obtains greater than 1 nonzero coefficient number NumCoef2 based on the zig-zag mode, according to the Golomb coded system coding NumCoef2 that blocks, wherein as follows then to the false code that NumCoef2 encodes:
For(idx=0;NumCoef2>=idx&&idx<NumCoef1;idx++)
{
Setflag(NumCoef2>idx);
}
Wherein function S etflag represents to enroll 1 in code stream, otherwise enroll 0 in code stream when NumCoef2>idx condition is set up.
Mode two: if current 4 * 4 when being first piece of image band or image, can select a code table that presets according at least one property value among macro block (mb) type, QP value and the NumCoef1 at current block place, and based on the code table of the selecting NumCoef2 that encodes, the code table that wherein presets can specifically be set according to concrete performance.If current 4 * 4 when not being first piece of image band or image, need select a code table that presets according to the adjacent left piece and the adjacent NumCoef2 that goes up piece of current block, and based on the encode NumCoef2 of current block of the code table of selecting, in like manner this code table that presets also can specifically be set according to concrete performance.
In the above embodiments step4, coding side can but be not limited to adopt the encode amplitude of each nonzero coefficient in the current block of following dual mode:
Mode one: according to zig-zag mode reverse scanning current block, when running into first amplitude greater than 1 nonzero coefficient, establishing its amplitude is sym, according to following false code this amplitude sym that encodes:
Sym=sym-1;
For(idx=1;idx<=sym;idx++)
{
Setflag(sym>idx);
}
Wherein function S etflag represents to enroll 1 in code stream, otherwise enroll 0 in code stream when sym>idx condition is set up.Continue the reverse scanning current block, follow-up during whenever to a nonzero coefficient, according to following false code its amplitude sym that encodes, all nonzero coefficient amplitudes are all encoded and are finished in current block:
For(idx=1;idx<=sym;idx++)
{
Setflag(sym>idx);
}
Wherein function S etflag represents to enroll 1 in code stream, otherwise enroll 0 in code stream when sym>idx condition is set up.
Mode two: according to zig-zag mode reverse scanning current block, when running into first amplitude greater than 1 nonzero coefficient, the amplitude information of this coefficient and the coefficient number run2 that the amplitude in this coefficient front equals 1 encode, suppose that this amplitude is level greater than 1 zero coefficient values, then carries out encoding process to level2=|level|-1 when the amplitude of this nonzero coefficient is encoded.First amplitude of coding current block, is encoded to level2 and run2 based on the code table of selecting according to code table that presets of type selecting of current block place macro block then greater than before 1 the nonzero coefficient; Scan second amplitude greater than 1 nonzero coefficient, select a code table that presets according to the last level2 that has encoded, and based on the code table of selecting the encode level2 and the run2 of current nonzero coefficient; When scanning each amplitude greater than 1 nonzero coefficient later on, all encode according to above-mentioned processing procedure, all amplitudes are all encoded greater than 1 nonzero coefficient amplitude and are finished in current block.
Carry out the embodiment processing procedure that VLC encodes corresponding to above-mentioned coding side, the embodiment that decoding end is carried out the corresponding decoding processing can be divided into four kinds of situations, introduces respectively below:
The first decoding embodiment:
Step10: nonzero coefficient number n umCoef1 in the current block that the decoding end decoding receives;
Step11: and then numCoef1 nonzero coefficient symbol in the current block of decoding respectively, and the number of the preceding zero coefficient of each nonzero coefficient; According to decoded result, zero coefficient and nonzero coefficient symbol are formed coefficient sequence in order be written in the present image blocks of data;
Step12: amplitude is greater than 1 nonzero coefficient number n umCoef2 in the decoding current block;
Step13: if decoding obtains numCoef2 is zero, then can directly finish the decoding processing of current block, otherwise the amplitude of the corresponding nonzero coefficient of in the current block that receives, decoding respectively, then with being written on the corresponding nonzero coefficient sign bit in the current image date piece of its correspondence, thereby finish the decoding processing of decoding end.
The second decoding embodiment:
Step20: each nonzero coefficient symbol in the current block that the decoding end decoding receives, and the number of the preceding zero coefficient of each nonzero coefficient; According to decoded result, zero coefficient and nonzero coefficient symbol are formed coefficient sequence in order be written in the present image blocks of data;
Step21: be used to identify the end of block flag EOB1 that the nonzero coefficient symbol has been encoded according to what be decoded to then, and then the amplitude of corresponding nonzero coefficient in the decoding current block, being written on the corresponding nonzero coefficient sign bit in the current image date piece its correspondence then, last identify the end of block flag EOB2 that the nonzero coefficient amplitude has been encoded according to being used to of being decoded to, begin the decoding processing of next piece.
The 3rd decoding embodiment:
Step30: nonzero coefficient number n umCoef1 in the current block that the decoding end decoding receives;
Step31: and then numCoef1 nonzero coefficient symbol in the current block of decoding respectively, and the number of the preceding zero coefficient of each nonzero coefficient; According to decoded result, zero coefficient and nonzero coefficient symbol are formed coefficient sequence in order be written in the present image blocks of data;
Step32: in the current block that receives, decode the respectively amplitude of corresponding nonzero coefficient of decoding end, being written on the corresponding nonzero coefficient sign bit in the current image date piece its correspondence then, last identify the end of block flag EOB2 that the nonzero coefficient amplitude has been encoded according to being used to of being decoded to, begin the decoding processing of next piece.
The 4th decoding embodiment:
Step40: each nonzero coefficient symbol in the current block that the decoding end decoding receives, and the number of the preceding zero coefficient of each nonzero coefficient; According to decoded result, zero coefficient and nonzero coefficient symbol are formed coefficient sequence in order be written in the present image blocks of data;
Step41: be used to identify the end of block flag EOB1 that the nonzero coefficient symbol has been encoded according to what be decoded to then, and then in the decoding current block amplitude greater than 1 nonzero coefficient number n umCoef2;
Step42: if decoding obtains numCoef2 is zero, then can directly finish the decoding processing of current block, otherwise the amplitude of the corresponding nonzero coefficient of in the current block that receives, decoding respectively, then with being written on the corresponding nonzero coefficient sign bit in the current image date piece of its correspondence, thereby finish the decoding processing of decoding end.
In above-mentioned embodiment processing procedure of current block being carried out VLC coding, for two kinds of given processing modes of any one step among step1, step2, step3 and the step4, thereby can carry out the embodiment processing procedure that combination in any is finished VLC coding of the present invention, like this based on each above-mentioned processing mode, can be combined into the embodiment of 16 kinds of VLC codings, certainly the technology of the present invention thought is not limited to 16 kinds of given execution modes here, can also expand more implementation process according to design philosophy.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (38)

1. a variable length encoding method is characterized in that, comprises step:
The number of nonzero coefficient and amplitude are greater than 1 coefficient number in the statistics current block;
The nonzero coefficient number encoder that statistics is obtained advances code stream;
The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; And
The amplitude that statistics is obtained is greater than 1 the coefficient number into code stream of encoding;
The amplitude coding of corresponding nonzero coefficient in the current block is advanced code stream.
2. the method for claim 1 is characterized in that, adopts the Golomb coded system of blocking that the number encoder of the nonzero coefficient in the current block is advanced code stream.
3. the method for claim 1 is characterized in that, according to the type of current block and the predicted value of current block nonzero coefficient number thereof the number encoder of the nonzero coefficient in the current block is advanced code stream.
4. the method for claim 1 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Number with zero coefficient before each the nonzero coefficient symbol in the current block and this nonzero coefficient is mapped to corresponding symbol respectively;
Symbolic coding after the Golomb coded system that employing is blocked will be shone upon is advanced code stream.
5. method as claimed in claim 4 is characterized in that, the process that described number with zero coefficient before nonzero coefficient symbol and this nonzero coefficient is mapped to corresponding symbol specifically comprises:
When scanning each nonzero coefficient, the relation of positive number number and negative number in the nonzero coefficient that judgement has scanned; And
In the positive number number during more than or equal to the negative number, if the current nonzero coefficient that scans is a positive number, then based on two times of the numbers of zero coefficient before the current nonzero coefficient of asking for that scans with 0 and as the symbol after the mapping; If the current nonzero coefficient that scans is negative, then based on two times of the numbers of zero coefficient before the current nonzero coefficient of asking for that scans with 1 and as the symbol after the mapping;
In the positive number number during less than the negative number, if the current nonzero coefficient that scans is a positive number, then based on two times of the numbers of zero coefficient before the current nonzero coefficient of asking for that scans with 1 and as the symbol after the mapping; If the current nonzero coefficient that scans is negative, then based on two times of the numbers of zero coefficient before the current nonzero coefficient of asking for that scans with 0 and as the symbol after the mapping.
6. the method for claim 1 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Based on zig-zag mode forward scan current block, when scanning first nonzero coefficient, the number of zero coefficient and the symbol of this nonzero coefficient before this nonzero coefficient that scans of encoding;
Follow-up when scanning a nonzero coefficient at every turn, number based on zero coefficient before the number of current block nonzero coefficient, the last nonzero coefficient of having encoded, the encode number of zero coefficient before the current nonzero coefficient that scans, and and then the symbol of the current nonzero coefficient that scans of encoding.
7. the method for claim 1 is characterized in that, adopt the Golomb coded system block with the amplitude in the current block greater than 1 the coefficient number into code stream of encoding.
8. the method for claim 1 is characterized in that, describedly encodes into greater than 1 coefficient number the amplitude in the current block that the process of code stream specifically comprises:
Judge that whether current block is first piece in band or the image; And
When current block is first piece, according to the attribute information of current block with amplitude in the current block greater than 1 the coefficient number into code stream of encoding;
When current block is not first piece, according to the adjacent left piece of current block and the adjacent amplitude that goes up piece greater than 1 coefficient number information with amplitude in the current block greater than 1 the coefficient number into code stream of encoding.
9. method as claimed in claim 8 is characterized in that, the attribute information of described current block is:
The type information of current block place macro block; Or
The quantization step value information of current block; Or
The nonzero coefficient number information of current block.
10. the method for claim 1, it is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream is specially: based on zig-zag mode reverse scanning current block, when scanning first amplitude greater than 1 nonzero coefficient, the nonzero coefficient that begins respectively each to be scanned the into code stream of encoding.
11. the method for claim 1 is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream specifically comprises:
Based on zig-zag mode reverse scanning current block, when scanning first amplitude, begin to encode this current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 greater than 1 nonzero coefficient;
Follow-up when scanning an amplitude at every turn greater than 1 nonzero coefficient, greater than 1 nonzero coefficient, encode the current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 based on last amplitude of having encoded.
12. a variable length decoding method is characterized in that, comprises step:
The nonzero coefficient number of the current block that decoding receives;
According to the nonzero coefficient number that decoding obtains, in current block, decode the number of zero coefficient before the nonzero coefficient symbol of corresponding number and the corresponding nonzero coefficient; And
The amplitude of decoding current block is greater than 1 coefficient number;
The amplitude that obtains according to decoding decodes the amplitude of corresponding nonzero coefficient greater than 1 coefficient number in current block.
13. a variable length encoder is characterized in that, comprising:
Be used for adding up the number of current block nonzero coefficient and amplitude unit greater than 1 coefficient number;
A nonzero coefficient number encoder that is used for that statistics is obtained enters the unit of code stream;
Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream; With
Be used for amplitude that statistics is obtained greater than 1 the coefficient number into unit of code stream of encoding;
Be used for the amplitude coding of the corresponding nonzero coefficient of current block is advanced the unit of code stream.
14. a length variable decoder is characterized in that, comprising:
The unit of nonzero coefficient number of the current block that receives is used to decode;
Be used for the nonzero coefficient number that obtains according to decoding, in current block, decode the unit of the number of zero coefficient before the nonzero coefficient symbol of corresponding number and the corresponding nonzero coefficient; With
Be used to decode the amplitude of current block greater than the unit of 1 coefficient number;
The amplitude that the user obtains according to decoding decodes the unit of the amplitude of corresponding nonzero coefficient greater than 1 coefficient number in current block.
15. a variable length encoding method is characterized in that, comprises step:
The number of nonzero coefficient in the statistics current block;
The nonzero coefficient number encoder that statistics is obtained advances code stream;
The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; And
The amplitude coding of corresponding nonzero coefficient in the current block is advanced code stream;
In code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
16. method as claimed in claim 15 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Number with zero coefficient before each the nonzero coefficient symbol in the current block and this nonzero coefficient is mapped to corresponding symbol respectively;
Symbolic coding after the Golomb coded system that employing is blocked will be shone upon is advanced code stream.
17. method as claimed in claim 15 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Based on zig-zag mode forward scan current block, when scanning first nonzero coefficient, the number of zero coefficient and the symbol of this nonzero coefficient before this nonzero coefficient that scans of encoding;
Follow-up when scanning a nonzero coefficient at every turn, number based on zero coefficient before the number of current block nonzero coefficient, the last nonzero coefficient of having encoded, the encode number of zero coefficient before the current nonzero coefficient that scans, and and then the symbol of the current nonzero coefficient that scans of encoding.
18. method as claimed in claim 15, it is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream is specially: based on zig-zag mode reverse scanning current block, when scanning first amplitude greater than 1 nonzero coefficient, the nonzero coefficient that begins respectively each to be scanned the into code stream of encoding.
19. method as claimed in claim 15 is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream specifically comprises:
Based on zig-zag mode reverse scanning current block, when scanning first amplitude, begin to encode this current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 greater than 1 nonzero coefficient;
Follow-up when scanning an amplitude at every turn greater than 1 nonzero coefficient, greater than 1 nonzero coefficient, encode the current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 based on last amplitude of having encoded.
20. a variable length decoding method is characterized in that, comprises step:
The nonzero coefficient number of the current block that decoding receives;
According to the nonzero coefficient number that decoding obtains, in current block, decode the number of zero coefficient before the nonzero coefficient symbol of corresponding number and the corresponding nonzero coefficient;
In current block, decode the amplitude of corresponding nonzero coefficient; And
Decoding obtains being used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
21. a variable length encoder is characterized in that, comprising:
Be used for adding up the unit of current block nonzero coefficient number;
A nonzero coefficient number encoder that is used for that statistics is obtained enters the unit of code stream;
Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream; With
Be used for the amplitude coding of the corresponding nonzero coefficient of current block is advanced the unit of code stream;
Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient amplitude encoded at code stream.
22. a length variable decoder is characterized in that, comprising:
The unit of nonzero coefficient number of the current block that receives is used to decode;
Be used for the nonzero coefficient number that obtains according to decoding, in current block, decode the nonzero coefficient symbol of corresponding number and the unit of corresponding nonzero coefficient leading zero coefficient number;
Be used for decoding the unit of corresponding nonzero coefficient amplitude at current block; With
Be used to decode and obtain being used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
23. a variable length encoding method is characterized in that, comprises step:
Amplitude is greater than 1 coefficient number in the statistics current block;
The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream; And
In code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient symbol has been encoded;
The amplitude that statistics is obtained is greater than 1 the coefficient number into code stream of encoding;
The amplitude coding of corresponding nonzero coefficient in the current block is advanced code stream.
24. method as claimed in claim 23 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Number with zero coefficient before each the nonzero coefficient symbol in the current block and this nonzero coefficient is mapped to corresponding symbol respectively;
Symbolic coding after the Golomb coded system that employing is blocked will be shone upon is advanced code stream.
25. method as claimed in claim 23 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Based on zig-zag mode forward scan current block, when scanning first nonzero coefficient, the number of zero coefficient and the symbol of this nonzero coefficient before this nonzero coefficient that scans of encoding;
Follow-up when scanning a nonzero coefficient at every turn, number based on zero coefficient before the number of current block nonzero coefficient, the last nonzero coefficient of having encoded, the encode number of zero coefficient before the current nonzero coefficient that scans, and and then the symbol of the current nonzero coefficient that scans of encoding.
26. method as claimed in claim 23, it is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream is specially: based on zig-zag mode reverse scanning current block, when scanning first amplitude greater than 1 nonzero coefficient, the nonzero coefficient that begins respectively each to be scanned the into code stream of encoding.
27. method as claimed in claim 23 is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream specifically comprises:
Based on zig-zag mode reverse scanning current block, when scanning first amplitude, begin to encode this current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 greater than 1 nonzero coefficient;
Follow-up when scanning an amplitude at every turn greater than 1 nonzero coefficient, greater than 1 nonzero coefficient, encode the current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 based on last amplitude of having encoded.
28. a variable length decoding method is characterized in that, comprises step:
In current block, decode the number of zero coefficient before nonzero coefficient symbol and the corresponding nonzero coefficient; And
Decoding is used to identify the end of block flag that the nonzero coefficient symbol has been encoded in current block;
Amplitude is greater than 1 coefficient number in the decoding current block;
The amplitude that obtains according to decoding decodes the amplitude of corresponding nonzero coefficient greater than 1 coefficient number in current block.
29. a variable length encoder is characterized in that, comprising:
Be used for adding up the unit of current block amplitude greater than 1 coefficient number;
Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream; With
Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient symbol encoded at code stream;
Be used for amplitude that statistics is obtained greater than 1 the coefficient number into unit of code stream of encoding;
Be used for the amplitude coding of the corresponding nonzero coefficient of current block is advanced the unit of code stream.
30. a length variable decoder is characterized in that, comprising:
Be used for decoding the unit of nonzero coefficient symbol and corresponding nonzero coefficient leading zero coefficient number at current block;
Be used for being used to identify the unit of the end of block flag that the nonzero coefficient symbol encoded in current block decoding;
The unit of current block amplitude greater than 1 coefficient number is used for decoding;
Be used for the amplitude that obtains according to decoding greater than 1 coefficient number, in current block, decode the unit of corresponding nonzero coefficient amplitude.
31. a variable length encoding method is characterized in that, comprises step:
The individual number encoder of zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient is advanced code stream;
In code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient symbol has been encoded;
The amplitude coding of corresponding nonzero coefficient is advanced code stream; And
In code stream, be coded into and be used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
32. method as claimed in claim 31 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Number with zero coefficient before each the nonzero coefficient symbol in the current block and this nonzero coefficient is mapped to corresponding symbol respectively;
Symbolic coding after the Golomb coded system that employing is blocked will be shone upon is advanced code stream.
33. method as claimed in claim 31 is characterized in that, the process that described individual number encoder with zero coefficient before each nonzero coefficient symbol in the current block and the corresponding nonzero coefficient advances code stream specifically comprises:
Based on zig-zag mode forward scan current block, when scanning first nonzero coefficient, the number of zero coefficient and the symbol of this nonzero coefficient before this nonzero coefficient that scans of encoding;
Follow-up when scanning a nonzero coefficient at every turn, number based on zero coefficient before the number of current block nonzero coefficient, the last nonzero coefficient of having encoded, the encode number of zero coefficient before the current nonzero coefficient that scans, and and then the symbol of the current nonzero coefficient that scans of encoding.
34. method as claimed in claim 31, it is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream is specially: based on zig-zag mode reverse scanning current block, when scanning first amplitude greater than 1 nonzero coefficient, the nonzero coefficient that begins respectively each to be scanned the into code stream of encoding.
35. method as claimed in claim 31 is characterized in that, the process that described amplitude coding with corresponding nonzero coefficient in the current block advances code stream specifically comprises:
Based on zig-zag mode reverse scanning current block, when scanning first amplitude, begin to encode this current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 greater than 1 nonzero coefficient;
Follow-up when scanning an amplitude at every turn greater than 1 nonzero coefficient, greater than 1 nonzero coefficient, encode the current nonzero coefficient that scans and nonzero coefficient number that the amplitude that scanned before greater than 1 nonzero coefficient to next amplitude in follow up scan equals 1 based on last amplitude of having encoded.
36. a variable length decoding method is characterized in that, comprises step:
In current block, decode the number of zero coefficient before nonzero coefficient symbol and the corresponding nonzero coefficient; And
Decode and be used to identify the end of block flag that the nonzero coefficient symbol has been encoded;
In current block, decode the amplitude of corresponding nonzero coefficient; And
Decode and be used to identify the end of block flag that the nonzero coefficient amplitude has been encoded.
37. a variable length encoder is characterized in that, comprising:
Be used for the individual number encoder of zero coefficient before each the nonzero coefficient symbol of current block and the corresponding nonzero coefficient is advanced the unit of code stream;
Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient symbol encoded at code stream; With
Be used for the amplitude coding of corresponding nonzero coefficient is advanced the unit of code stream;
Be used for being coded into the unit that is used to identify the end of block flag that the nonzero coefficient amplitude encoded at code stream.
38. a length variable decoder is characterized in that, comprising:
Be used for decoding the unit of nonzero coefficient symbol and corresponding nonzero coefficient leading zero coefficient number at current block; With
Be used to decode the unit that is used to identify the end of block flag that the nonzero coefficient symbol encoded;
Be used for decoding the unit of corresponding nonzero coefficient amplitude at current block;
Be used to decode the unit that is used to identify the end of block flag that the nonzero coefficient amplitude encoded.
CN 200610163459 2006-12-05 2006-12-05 Variable-length code decode method and codec thereof Active CN100542293C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610163459 CN100542293C (en) 2006-12-05 2006-12-05 Variable-length code decode method and codec thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610163459 CN100542293C (en) 2006-12-05 2006-12-05 Variable-length code decode method and codec thereof

Publications (2)

Publication Number Publication Date
CN101198054A true CN101198054A (en) 2008-06-11
CN100542293C CN100542293C (en) 2009-09-16

Family

ID=39548148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610163459 Active CN100542293C (en) 2006-12-05 2006-12-05 Variable-length code decode method and codec thereof

Country Status (1)

Country Link
CN (1) CN100542293C (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752592A (en) * 2012-06-20 2012-10-24 深圳广晟信源技术有限公司 Entropy coding method of video transformation coefficient
CN103024370A (en) * 2011-09-23 2013-04-03 中兴通讯股份有限公司 Secondary compression encoding and decoding method and device for motion vectors
CN103188486A (en) * 2011-12-28 2013-07-03 联芯科技有限公司 Variable-length encoding method and system for H.263 video encoding
CN103428492A (en) * 2013-07-16 2013-12-04 山东大学 Fast zig-zag scanning method for high-definition AVS coding
CN106162201A (en) * 2015-03-26 2016-11-23 北京君正集成电路股份有限公司 A kind of image data compression method based on sign bit packet and device
CN108809521A (en) * 2018-06-26 2018-11-13 中国联合网络通信集团有限公司 A kind of variable length decoding method, device and length variable decoder
WO2023240662A1 (en) * 2022-06-17 2023-12-21 Oppo广东移动通信有限公司 Encoding method, decoding method, encoder, decoder, and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024370A (en) * 2011-09-23 2013-04-03 中兴通讯股份有限公司 Secondary compression encoding and decoding method and device for motion vectors
CN103024370B (en) * 2011-09-23 2018-03-23 中兴通讯股份有限公司 A kind of motion vector second-compressed decoding method and device
CN103188486A (en) * 2011-12-28 2013-07-03 联芯科技有限公司 Variable-length encoding method and system for H.263 video encoding
CN103188486B (en) * 2011-12-28 2016-04-20 联芯科技有限公司 H.263 the variable-length coding method of Video coding and system
CN102752592A (en) * 2012-06-20 2012-10-24 深圳广晟信源技术有限公司 Entropy coding method of video transformation coefficient
CN102752592B (en) * 2012-06-20 2015-02-11 深圳广晟信源技术有限公司 Entropy coding method of video transformation coefficient
CN103428492A (en) * 2013-07-16 2013-12-04 山东大学 Fast zig-zag scanning method for high-definition AVS coding
CN106162201A (en) * 2015-03-26 2016-11-23 北京君正集成电路股份有限公司 A kind of image data compression method based on sign bit packet and device
CN106162201B (en) * 2015-03-26 2019-02-15 北京君正集成电路股份有限公司 A kind of image data compression method and device based on sign bit grouping
CN108809521A (en) * 2018-06-26 2018-11-13 中国联合网络通信集团有限公司 A kind of variable length decoding method, device and length variable decoder
CN108809521B (en) * 2018-06-26 2020-09-11 中国联合网络通信集团有限公司 Variable length decoding method and device and variable length decoder
WO2023240662A1 (en) * 2022-06-17 2023-12-21 Oppo广东移动通信有限公司 Encoding method, decoding method, encoder, decoder, and storage medium

Also Published As

Publication number Publication date
CN100542293C (en) 2009-09-16

Similar Documents

Publication Publication Date Title
CN102656890B (en) For the method and apparatus of Video coding
CN101411196B (en) Method and system for coding and decoding information associated with video compression
CN102316320B (en) Skip macroblock coding
CN100542293C (en) Variable-length code decode method and codec thereof
JP5474546B2 (en) Method and apparatus for reduced resolution segmentation
CN100488254C (en) Entropy coding method and decoding method based on text
KR101622450B1 (en) Video encoding and decoding using transforms
CN101448162B (en) Method for processing video image
EP2782342B1 (en) Method and device for intra-frame prediction mode processing
US20160373767A1 (en) Encoding and Decoding Methods and Apparatuses
CN103597838B (en) The method and apparatus that the position of last position coefficient of efficiency is encoded and decoded
US20140119439A1 (en) Method and apparatus of intra mode coding
US20070200737A1 (en) Entropy Coding Method For Coding Video Prediction Residual Coefficients
CN102067608A (en) Fragmented reference in temporal compression for video coding
CN101411197A (en) Methods and systems for refinement coefficient coding in video compression
CN1757240A (en) Video encoding
CN101267553A (en) A method and device for coding and decoding
CN102857746A (en) Method and device for coding and decoding loop filters
CN101742330B (en) Image coding method and device
JP3278948B2 (en) Variable length coding method
CN100551064C (en) Variable length encoding method and device
CN101790096B (en) Encoding and decoding method and device based on double prediction
CN109417622A (en) Use the method and apparatus of the improved validity flag decoding of simple local fallout predictor
CN104854871A (en) Deblocking filter with reduced line buffer
CN113508588A (en) Encoding and decoding images

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
TR01 Transfer of patent right

Effective date of registration: 20210427

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Device Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right