[go: up one dir, main page]

CN101729899A - Method and device for encoding discrete cosine transform coefficient - Google Patents

Method and device for encoding discrete cosine transform coefficient Download PDF

Info

Publication number
CN101729899A
CN101729899A CN200910237035A CN200910237035A CN101729899A CN 101729899 A CN101729899 A CN 101729899A CN 200910237035 A CN200910237035 A CN 200910237035A CN 200910237035 A CN200910237035 A CN 200910237035A CN 101729899 A CN101729899 A CN 101729899A
Authority
CN
China
Prior art keywords
component
dct coefficient
coding
random number
current
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
CN200910237035A
Other languages
Chinese (zh)
Other versions
CN101729899B (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.)
Mid Star Technology Ltd By Share Ltd
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CN200910237035.6A priority Critical patent/CN101729899B/en
Publication of CN101729899A publication Critical patent/CN101729899A/en
Application granted granted Critical
Publication of CN101729899B publication Critical patent/CN101729899B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a method and device for encoding a discrete cosine transform coefficient. In the method and the device for encoding the discrete cosine transform coefficient, a first random number and a second random number for a current DCT coefficient are generated randomly. If the first random number is generated, all the continuous alternating current (AC) components with a value of 0 at the end are encoded into end of block (EOB) code words; if the second random number is generated, when the AC components with a continuous value of 0 are at the end of the current DCT coefficient, partial AC components with a value of 0 are encoded to obtain a plurality of zero retaining length (ZRL) code words, and residual AC components with a value of 0 are encoded into EOB code words. Therefore, for a plurality of groups of DCT coefficients ending by more than 16 AC components with a continuous value of 0 generally, the periodicity of the code stream data acquired after the encoding is damaged to some extent, so the electromagnetic interference (EMI) generated by the encoded code stream data of the DCT coefficient can be reduced.

Description

The coding method of discrete cosine transform coefficient and device
Technical field
The present invention relates to video coding technique, particularly a kind of discrete cosine transform (Discrete CosineTransform, DCT) code device of the coding method of coefficient and a kind of DCT coefficient.
Background technology
The DCT coefficient is used to characterize the intensity of illumination variation situation of vedio data by the frequency data that Y, U, V component (if then only there is the Y component in black and white image) in the vedio data calculate.As shown in Figure 1, each DCT coefficient is one 8 * 8 a matrix, the intensity of illumination change frequency that raises gradually on the from left to right corresponding successively horizontal direction of 8 column elements, the intensity of illumination change frequency that raises gradually on the corresponding successively from top to bottom vertical direction of 8 row elements, in each matrix of 8 * 8, the element of first row, first row is 1 direct current (DC) component (shown in shaded block among Fig. 1), the intensity of illumination change frequency that its corresponding horizontal direction and vertical direction are minimum, and all the other 63 elements are interchange (AC) component (shown in Fig. 1 empty piece).The monochrome pixels distribution that the intensity of illumination change frequency that raises gradually on the horizontal direction is caused is illustrated in proper order by Fig. 2 a~Fig. 2 d; The monochrome pixels distribution that the intensity of illumination change frequency that raises gradually on the vertical direction is caused is illustrated in proper order by Fig. 3 a~Fig. 3 d.
For common common scene, the high-frequency AC component in 63 AC components generally a little less than; In addition, human vision property has determined that human eye is lower to the composition susceptibility of high frequency.Therefore, can take some measures 63 AC components usually for prior art and to remove or significantly weaken the high-frequency AC component, and can not cause being discovered by human eye.For example, utilize quantization table that the DCT coefficient of 8 * 8 matrixes is carried out quantification treatment, the quantization parameter of corresponding high-frequency AC component is all bigger in this quantization table, so, in 8 * 8 matrix D CT coefficients after quantizing, the value of the high-frequency AC component in 63 AC components will be 0 even all equal 0 by majority, for example, the high-frequency AC component of supposing last 1 row, last 1 row in 8 * 8 matrixes is 40, its corresponding quantitative coefficient is 99, then the value of this AC component can become 40/99=0.404 after having quantized, and promptly becomes 0 behind the round.After this, can transmit after again the DCT coefficient after quantizing being encoded.
In cataloged procedure, can encode according to default DC component Huffman table for 1 DC component, and for 63 AC components, then according to default AC component Huffman table, and begin to encode successively according to the zigzag scanning sequency from the DC component, promptly the AC component that begins to be scanned up to high frequency from lowest frequency AC component finishes, as shown in Figure 4, the broken line arrow is represented scanning pattern in a zigzag, and the sequence number in the blank block of expression AC component, then identified the order of this AC component in scanning in a zigzag, certainly, zigzag scanning shown in Figure 4 only illustrates, and can also adopt other modes in the prior art.According to the zigzag scanning sequency as shown in Figure 5 to the flow process of 63 AC component codings:
Step 500 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 501 scans next AC component, makes K=K+1.
Step 502 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 503, otherwise execution in step 506.
Step 503 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 505, otherwise execution in step 504.
Step 504 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, be back to step 501 then.
Step 505, value according to last the AC component that scans in a zigzag is 0, promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, in the end the value of 1 AC component is 0 o'clock, as long as the value of continuous several A C component before last AC component also is 0, all then that ending place is continuous values are that 0 AC component Unified coding is 1 block end (End Of Block, EOB) code word, process ends then.
Suppose that in 63 AC components, the value of last 6 AC components is in proper order: the arbitrary value of non-zero, 0,0,0,0,0, then continuous 50 of occurring in place, end are encoded to 1 EOB code word.
Step 506, the current AC component value ZZ (K) that scans is a nonzero value, judges that whether having before the AC component of this value non-zero more than 15 continuous values is that 0 AC component is encoded, be whether R is greater than 15, if then execution in step 507, otherwise execution in step 508.
Step 507, according to AC component Huffman table, with continuous 16 values is that 0 AC component Unified coding is 1 zero persistence length (Zero Run Length, ZRL) code word, and from the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16, even R=R-16 returns step 506 cycling, the continuous value before the AC of the value non-zero component and is 16 of 0 AC component number less thaies then.
Suppose, preceding 31 AC component values are 0, are R=31, the 32nd then is non-0, then earlier preceding 16 AC component Unified coding are 1 ZRL code word and make R=31-16=15, remain the 17th~31 value and be 16 of 0 AC component number less thaies, thus can execution in step 508 after step 506 is judged again.
Step 508, the continuous value before the AC component of value non-zero are 16 of 0 AC component number less thaies, are that 0 AC component Unified coding is a corresponding code word with the continuous value of 16 of the AC component of this value non-zero and less thaies before, and execution in step 509 then.
Step 509, be less than 16 continuous values before the AC component of the current value non-zero that scans and be 0 AC component, together encode at the step 508 and the AC component of the current value non-zero that scans, thereby to the continuous sweep of record to but the value of encoding is 0 AC component number zero clearing, even R=0, execution in step 510 then.
Step 510 judges whether the AC component of the current value non-zero that scans is last, if, process ends then, otherwise return step 501.
So far, this flow process finishes.
Though above-mentioned flow process can realize that there are the following problems to the coding of 63 AC components:
As previously mentioned, in the DCT coefficient after the quantification treatment, the value of the AC component of corresponding high more intensity of illumination change frequency might be 0 more, so, scan in a zigzag 63 AC components normally with a plurality of continuous 0 endings, therefore, all can comprise the EOB code word among the result behind every group of DCT coefficient coding;
And in the DCT coefficient after the quantification treatment, the value majority of 63 AC components is 0 even all equals 0, therefore, except the code word of DC component, probably only comprises the EOB code word among the result behind every group of DCT coefficient coding.
Thus, in the bit stream data that the DCT coefficient coding after continuous group of some quantifications is obtained, can be similar to code word and EOB code word that the DC component periodically alternately occurs basically; Further, for a kind of opposite extreme situations, in the DCT coefficient after the promptly continuous some groups of quantifications, 63 AC component values all are 0, so referring to Fig. 6, the DCT coefficient after continuous some quantifications to be encoded in the resulting code stream, the code word and the EOB code word of DC component will only alternately appear.
Further, if the DC component of these groups is all identical, then certain periodic regularity can appear in code stream.Perhaps, consider to exist in the image a kind of like this even brightness scene of similar sky, may every group 8 * 8 matrix identical, therefore the DC component, the AC component that obtain through dct transform, after quantizing of every group 8 * 8 matrix D CT coefficient all identical (may not 63 AC components all be 0), thereby the code word that obtains is also all in full accord, thereby also certain periodic regularity can appear in code stream.
Like this, bit stream data has the periodic regularity of basic fixed, and for the bit stream data with periodic regularity, it is by USB interface during from the transmission of camera chip between electric equipments such as PC, electromagnetic interference (the Electromagnetic Interference that can cause the bit stream data transmission, EMI) have a large amount of discrete peak values in the frequency spectrum, promptly cause stronger EMI to produce.
Summary of the invention
In view of this, the invention provides a kind of coding method of DCT coefficient and a kind of code device of DCT coefficient, can reduce the EMI that bit stream data produced behind the DCT coefficient coding.
The coding method of a kind of DCT coefficient provided by the invention, earlier current DCT coefficient is quantized, then to the direct current DC component coding in the current DCT coefficient after quantizing, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again, for not being the current DCT coefficient of 0 AC component ending with continuous value, earlier be that 0 AC component coding is zero persistence length ZRL code word, will remain continuous value again and be 0 AC component and encode with the AC component of value non-0 with the continuous value before the AC component of value non-0;
This coding method is that current DCT coefficient produces first random number or second random number at random, is the coded system of 0 AC component in order to select at random the continuous value of ending place in the current DCT coefficient, wherein, for the current DCT coefficient that with continuous value is the ending of 0 AC component, if what produce is first random number, all then that ending place is continuous values are that 0 AC component Unified coding is a block end EOB code word; If what produce is second random number, then earlier wherein the part value of front be that 0 AC component coding obtains some ZRL code words, wherein the residue value of back is that 0 AC component coding is the EOB code word again.
The code device of a kind of DCT coefficient provided by the invention comprises:
The quantification treatment unit is used for current DCT coefficient is quantized;
The DC component unit is used for the direct current DC component coding to the current DCT coefficient after quantizing;
The component scanning element is used for respectively exchanging the AC component with what the zigzag scanning sequency scanned current DCT coefficient;
The alternating current component unit, for not being the current DCT coefficient of 0 AC component ending with continuous value, being used for earlier is that 0 AC component coding is zero persistence length ZRL code word with the continuous value before the AC component of value non-0, will remain continuous value again and be 0 AC component and encode with the AC component of value non-0;
This code device also comprises: the random number generation unit is used to current DCT coefficient to produce first random number or second random number at random, is the coded system of 0 AC component in order to select at random the continuous value of ending place in the current DCT coefficient;
And the alternating current component unit is for the current DCT coefficient that with continuous value is the ending of 0 AC component, the random number generation unit produce be first random number time, all values that ending place is continuous are that 0 AC component Unified coding is a block end EOB code word; The random number generation unit produce be second random number time, wherein the part value of front is that 0 AC component coding obtains the ZRL code word earlier, wherein the residue value of back is that 0 AC component coding is the EOB code word again.
As seen from the above technical solution, the present invention produces first random number or second random number at random for current DCT coefficient, if what produce is first random number, then when current DCT coefficient is the ending of 0 AC component with continuous value, all values that ending place is continuous are that 0 AC component Unified coding is the EOB code word; If what produce is second random number, then when current DCT coefficient is the ending of 0 AC component with continuous value, with the part value of front wherein is that 0 AC component coding obtains zero persistence length ZRL code word, and wherein the residue value of back is that 0 AC component coding is the EOB code word again.Like this, for usually being each DCT coefficient of 0 AC component ending with continuous value, can be inserted the indefinite ZRL code word of quantity at random in the bit stream data that obtains behind the coding, thereby make being that the various periodic regularities that exist in the bit stream data of DCT coefficient behind coding of 0 AC coefficient ending are destroyed to some extent more than continuous 16 values, and then the discrete peak value in the EMI frequency spectrum of blanking code flow data transmission to a certain extent, promptly reduce the EMI that bit stream data produced behind the DCT coefficient coding.
Description of drawings
Fig. 1 is 8 * 8 matrix schematic diagrames of existing DCT coefficient;
The monochrome pixels distribution schematic diagram of Fig. 2 a~Fig. 2 d for raising gradually and caused along with horizontal direction intensity of illumination change frequency;
The monochrome pixels distribution schematic diagram of Fig. 3 a~Fig. 3 d for raising gradually and caused along with vertical direction intensity of illumination change frequency;
Fig. 4 carries out the schematic diagram of scanning in a zigzag for existing 8 * 8 matrixes to the DCT coefficient;
Fig. 5 is existing schematic flow sheet to AC component coding method in the DCT coefficient;
Fig. 6 is existing a kind of bit stream data schematic diagram that the DCT coefficient coding is obtained;
Fig. 7 a is a kind of bit stream data schematic diagram that the embodiment of the invention obtains the DCT coefficient coding;
Fig. 7 b is the another kind of bit stream data schematic diagram that the embodiment of the invention obtains the DCT coefficient coding;
Fig. 8 embodiment of the invention is to the exemplary flow schematic diagram of AC component coding method in the DCT coefficient;
Fig. 9 is to AC component coding schematic flow sheet in the DCT coefficient among the inventive method embodiment one;
Figure 10 is to AC component coding schematic flow sheet in the DCT coefficient among the inventive method embodiment two;
Figure 11 is to AC component coding schematic flow sheet in the DCT coefficient among the inventive method embodiment three;
Figure 12 is to AC component coding schematic flow sheet in the DCT coefficient among the inventive method embodiment four;
Figure 13 is to AC component coding schematic flow sheet in the DCT coefficient among the inventive method embodiment five;
Figure 14 is to AC component coding schematic flow sheet in the DCT coefficient among the inventive method embodiment six;
Figure 15 is the exemplary configurations schematic diagram of DCT coefficient coding device in the embodiment of the invention;
Figure 16 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment one;
Figure 17 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment two;
Figure 18 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment three;
Figure 19 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment four;
Figure 20 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment five;
Figure 21 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment six.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
The embodiment of the invention has proposed a kind of new AC component coding mode, this coded system can exist continuous when being 0 AC component ending more than 16 values at the DCT coefficient, at should Unified coding being that EOB code word ending place value is 0 AC component, coding earlier as much as possible obtains the ZRL code word, thereafter be that 0 AC component coding is EOB again with 16 values of ending place residue less than, being about to by ending place is the EOB code word that 0 AC component Unified coding obtains more than 16 values, is split as some ZRL code words, and be the EOB code word that 0 AC component coding obtains by the continuous value of ending residue.
But if only utilize above-mentioned new coded system, then for the described extreme case of background technology part, the ZRL code word of increase is still according to periodic regularity and is inserted in the bit stream data.Therefore, the embodiment of the invention also needs to select at random coded system or above-mentioned new coded system as shown in Figure 5 at continuous DCT coefficient, makes in the bit stream data behind the continuous DCT coefficient coding insertion position and the indefinite ZRL code word of quantity at random.
Referring to Fig. 7 a, in the DCT coefficient after continuous group of some quantifications, 63 AC components all are that a kind of extreme case of 0 is an example entirely, except the frequency of occurrences is the highest in an alternating manner DC component corresponding code word of institute and EOB code word, also inserted and be to have inserted some ZRL code words at random, thereby can upset the periodic regularity of corresponding code word of the DC component that alternately occurs in the bit stream data and EOB code word, and then reduce the EMI that bit stream data produced behind the DCT coefficient coding.
Referring to Fig. 7 b, in the DCT coefficient after continuous group of some quantifications, 63 AC components are not 0 entirely, but the identical another kind of extreme case of 63 AC components in every group of DCT coefficient is an example, except the order frequency of occurrences the highest corresponding code word of DC component in an alternating manner, the ZRL code word, outside non-zero codeword and the EOB code word, also between non-zero codeword and EOB code word, inserted, and be to have inserted some ZRL code words that quantity does not wait at random, thereby can upset the corresponding code word of the DC component that alternately occurs in the bit stream data, the ZRL code word, the periodic regularity that non-zero codeword and EOB code word constitute in proper order, and then the EMI that bit stream data produced behind the reduction DCT coefficient coding.
Below, earlier DCT coefficient coding method in the embodiment of the invention is elaborated.
DCT coefficient coding method in the embodiment of the invention, need according to existing mode current DCT coefficient to be quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Wherein, as shown in Figure 8, the AC component that respectively exchanges in the current DCT coefficient is encoded and comprised the steps:
Step 800, for current DCT coefficient produces first random number or second random number at random, is the coded system of 0 AC component in order to select at random the continuous value of ending place in the current DCT coefficient, if what produce is first random number, then jump to step 801, if what produce is second random number, then jump to step 802.
Step 801, for the current DCT coefficient that with continuous value is the ending of 0 AC component, all values that ending place is continuous are that 0 AC component Unified coding is the EOB code word; And for not being the current DCT coefficient of 0 AC component ending with continuous value, can be according to existing mode as step 306 among Fig. 5~309, earlier be that 0 AC component coding is the ZRL code word with the continuous value before the AC component of each value non-0, to remain continuous value again and be 0 AC component and encode, finish coding then current DCT coefficient with the AC component of this value non-0.
Step 802, for the current DCT coefficient that with continuous value is the ending of 0 AC component, wherein the part value of front is that 0 AC component coding obtains the ZRL code word earlier, wherein the residue value of back is that 0 AC component coding is the EOB code word again; And for not being the current DCT coefficient of 0 AC component ending with continuous value, can be according to existing mode as step 306 among Fig. 5~309, earlier be that 0 AC component coding is the ZRL code word with the continuous value before the AC component of each value non-0, to remain continuous value again and be 0 AC component and encode, finish coding then current DCT coefficient with the AC component of value non-0.
So far, this flow process finishes.
So, in the DCT of present embodiment coefficient coding method, when produce random number, when judge generation be first random number or second random number and how realize that aforementioned new coded system can have multiple implementation to insert the ZRL code word at random, therefore 6 kinds of method embodiment are provided below.
Method embodiment one
In the present embodiment, as shown in Figure 5 existing coded system and aforementioned new coded system are set, in beginning before the AC component encodes in to current DCT coefficient with the zigzag scanning sequency, earlier produce first random number or second random number at random, and the judgement generation is first random number or second random number for current DCT coefficient;
If what produce is first random number, then utilize existing coded system as shown in Figure 5, be after 0 in the AC component value of judging current scanning at every turn, judge again whether this AC component is last AC component of current DCT coefficient; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, then utilize aforementioned new coded system, in the AC component value of judging current scanning at every turn is after 0, as long as scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, and then judge that whether this AC component is last of current DCT coefficient 16 values; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning; When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
Like this, just make continuous DCT coefficient select existing as shown in Figure 5 coded system randomly for use, or aforementioned new coded system, thereby the combination of DC component code word and EOB code word can appear in the bit stream data behind the DCT coefficient coding continuously randomly, or DC component and ZRL code word and EOB code word, thereby make in the bit stream data behind the continuous DCT coefficient coding that no longer DC component code word and EOB code word only alternately appear in periodic regularity ground, and then the discrete peak value in the EMI frequency spectrum of blanking code flow data transmission to a certain extent, promptly reduce the EMI that bit stream data produced behind the DCT coefficient coding.
The coding method of DCT coefficient in the present embodiment, according to existing mode current DCT coefficient is quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Fig. 9 is to the schematic flow sheet of AC component coding method in the DCT coefficient among the inventive method embodiment one.Referring to Fig. 9, the coding method of DCT coefficient is encoded to 63 AC components in the current DCT coefficient that has quantized according to following steps in the present embodiment:
Step 900 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 901, for current DCT coefficient produces first random number or second random number at random, and what judge to produce is first random number or second random number, if first random number, then jump to the step 501 of flow process as shown in Figure 5, if second random number execution in step 902 then.
Step 902 scans next AC component, makes K=K+1.
Step 903 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 904, otherwise execution in step 909.
Step 904 judges that this value is that whether to have before 0 the AC component more than 15 continuous values be that 0 AC component is encoded, and promptly whether R greater than 15, if then execution in step 905, otherwise execution in step 906.
Step 905, according to AC component Huffman table, be that 0 AC component Unified coding is 1 ZRL code word with continuous 16 values, and from the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16, even R=R-16, execution in step 906 then.
Step 906 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 908, otherwise execution in step 907.
Step 907 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, be back to step 902 then.
Step 908, according to the value of last AC component of scanning in a zigzag is 0, and promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, with ending place this moment uncoded continuous value be that 0 AC component Unified coding is 1 EOB code word, process ends then.
Step 909~step 913 is identical with the processing mode of step 506 as shown in Figure 5~step 510, and the AC component of judging the current value non-zero that scans in step 913 process ends otherwise return step 902 during for last, concrete processing procedure does not repeat them here.
So far, this flow process finishes.
Method embodiment two
In the present embodiment, as shown in Figure 5 existing coded system and aforementioned new coded system are set, in beginning before the AC component encodes in to current DCT coefficient with the zigzag scanning sequency, earlier produce first random number or second random number at random, and the judgement generation is first random number or second random number for current DCT coefficient;
If what produce is first random number, then utilize existing coded system as shown in Figure 5, be after 0 in the AC component value of judging current scanning at every turn, judge again whether this AC component is last AC component of current DCT coefficient; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient; That is the processing mode when, producing first random number is identical with method embodiment one;
If what produce is second random number, then utilize aforementioned new coded system, be after 0 in the AC component value of judging current scanning at every turn, judge whether this AC component is last AC component of current DCT coefficient earlier; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, obtain as long as add up then scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, continue the next AC component of scanning then 16 values; When judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient; Promptly, processing mode when producing second random number is than method embodiment one, difference is, as long as the current value that has scanned is 0 AC component is not last, then scanned but uncoded value is 1 AC component of 0 earlier current, calculating is scanning but uncoded continuous value is within 0 the AC component total quantity, and then judge add up scanning of obtaining but uncoded continuous value be whether enough 16 of 0 AC number of components, and coding obtain the ZRL code word.
Like this, still can produce approximate technique effect with method embodiment one.
The coding method of DCT coefficient in the present embodiment, according to existing mode current DCT coefficient is quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Figure 10 is to the schematic flow sheet of AC component coding method in the DCT coefficient among the inventive method embodiment two.Referring to Figure 10, the coding method of DCT coefficient is encoded to 63 AC components in the current DCT coefficient that has quantized according to following steps in the present embodiment:
Step 1000 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 1001, for current DCT coefficient produces first random number or second random number at random, and what judge to produce is first random number or second random number, if first random number, then jump to the step 501 of flow process as shown in Figure 5, if second random number execution in step 1002 then.
Step 1002 scans next AC component, makes K=K+1.
Step 1003 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 1004, otherwise execution in step 1009.
Step 1004 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 1008, otherwise execution in step 1005.
Step 1005 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, execution in step 1006 then.
Step 1006 judges that this value is that whether to have before 0 the AC component more than 15 continuous values be that 0 AC component is encoded, and promptly whether R if then execution in step 1007, otherwise return step 1002 continues scanning next AC component greater than 15.
Step 1007, according to AC component Huffman table, with continuous 16 values is that 0 AC component Unified coding is 1 ZRL code word, and from the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16, even R=R-16 returns step 1002 then and continues the next AC component of scanning.
Step 1008, value according to last the AC component that scans in a zigzag is 0, promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, with ending place this moment uncoded continuous value be that 0 AC component Unified coding is 1 EOB code word, process ends then.
Step 1009~step 1013 is identical with the processing mode of step 506 as shown in Figure 5~step 510, and the AC component of judging the current value non-zero that scans in step 1013 process ends otherwise return step 1002 during for last, concrete processing procedure does not repeat them here.
So far, this flow process finishes.
Method embodiment three
In the present embodiment, as shown in Figure 5 existing coded system and aforementioned new coded system are set, in beginning before the AC component encodes in to current DCT coefficient with the zigzag scanning sequency, earlier produce first random number or second random number at random, and the judgement generation is first random number or second random number for current DCT coefficient;
If what produce is first random number, then utilize existing coded system as shown in Figure 5, be after 0 in the AC component value of judging current scanning at every turn, judge again whether this AC component is last AC component of current DCT coefficient; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient; That is the processing mode when, producing first random number is identical with method embodiment one, method embodiment two;
If what produce is second random number, then utilize aforementioned new existing coded system, the AC component value of at every turn judging current scanning is after 0, judges whether this AC component is last AC component of current DCT coefficient earlier; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, obtain as long as add up then scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, continue the next AC component of scanning then 16 values; When judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient; Promptly, processing mode when producing second random number, difference than method embodiment one, method embodiment two is, having only the scanning value is 0 and during as the AC component of current DCT coefficient ending, judging adds up again scanning of obtaining but uncoded continuous value be whether enough 16 of 0 AC number of components, and coding obtain the ZRL code word.
Like this, still can produce approximate technique effect with method embodiment one, method embodiment two.
The coding method of DCT coefficient in the present embodiment, according to existing mode current DCT coefficient is quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Figure 11 is to the schematic flow sheet of AC component coding method in the DCT coefficient among the inventive method embodiment three.Referring to Figure 11, the coding method of DCT coefficient is encoded to 63 AC components in the current DCT coefficient that has quantized according to following steps in the present embodiment:
Step 1100 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 1101, for current DCT coefficient produces first random number or second random number at random, and what judge to produce is first random number or second random number, if first random number, then jump to the step 501 of flow process as shown in Figure 5, if second random number execution in step 1102 then.
Step 1102 scans next AC component, makes K=K+1.
Step 1103 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 1104, otherwise execution in step 1109.
Step 1104 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 1106, otherwise execution in step 1105.
Step 1105 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, be back to step 1102 then.
Step 1106 judges that this value is that whether to have before 0 the AC component more than 15 continuous values be that 0 AC component is encoded, and promptly whether R greater than 15, if then execution in step 1107, otherwise execution in step 1108.
Step 1107, according to AC component Huffman table, with continuous 16 values is that 0 AC component Unified coding is 1 ZRL code word, even and to the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16 R=R-16, return step 1106 then.
Step 1108, value according to last the AC component that scans in a zigzag is 0, promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, with ending place this moment uncoded continuous value be that 0 AC component Unified coding is 1 EOB code word, process ends then.
Step 1109~step 1113 is identical with the processing mode of step 506 as shown in Figure 5~step 510, and the AC component of judging the current value non-zero that scans in step 1113 process ends otherwise return step 1102 during for last, concrete processing procedure does not repeat them here.
So far, this flow process finishes.
Above-mentioned three method embodiment are that existing coded system and aforementioned new coded system are set to two flow processs respectively, and select arbitrary flow process to be carried out according to random number.Yet, consider that there is the identical treatment step of part in existing coded system with aforementioned new coded system, thereby, can also come multiplexing identical treatment step by a handling process is set, specifically referring to follow-up method embodiment four~six in order to save the processing resource.
Method embodiment four
In the present embodiment, a coding flow process is set, this coding flow process comprises existing coded system and the aforementioned new common treatment step of coded system as shown in Figure 5, also comprises as shown in Figure 5 existing coded system and the aforementioned new different treatment step of coded system simultaneously.Like this, before needs were carried out different treatment steps, what judge generation was first random number or second random number, and then selected according to the random number that produces.
Present embodiment beginning with the zigzag scanning sequency to current DCT coefficient in after the AC component, the AC component value of at every turn judging current scanning is 0 o'clock to be that the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random, and judges that what produce is first random number or second random number;
If what produce is first random number, then when last AC component that to judge this AC component be not current DCT coefficient, adds up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, then as long as scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, judge then whether this AC component is last AC component of current DCT coefficient 16 values; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and continues the next AC component of scanning; When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
Like this, still can produce approximate technique effect with method embodiment one~three.In addition, present embodiment is than method embodiment one~three, and except resource was handled in further saving, because random number is to be that 0 AC component produces at each value, thereby it was also just higher to insert the randomness of ZRL code word.In other words, present embodiment one~depth of the night of code word combination kind ratio method embodiment that can produce many, with 63 AC components is that 0 extreme case is an example entirely, method embodiment one~three only can encode for 63 AC components in every group of DCT coefficient and obtain " ZRL; ZRL; ZRL; EOB ", or among " EOB " these two kinds any, present embodiment then can be encoded for 63 AC components in every group of DCT coefficient and be obtained " ZRL; ZRL; ZRL; EOB ", or " ZRL; ZRL; EOB ", or " ZRL; EOB ", or among " EOB " these four kinds any, thereby present embodiment is that 0 AC component generates a random number at each value, and comparing one group of DCT coefficient, unified to generate a random number more flexible.
The coding method of DCT coefficient in the present embodiment, according to existing mode current DCT coefficient is quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Figure 12 is to the schematic flow sheet of AC component coding method in the DCT coefficient among the inventive method embodiment four.Referring to Figure 12, the coding method of DCT coefficient is encoded to 63 AC components in the current DCT coefficient that has quantized according to following steps in the present embodiment:
Step 1200 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 1201 scans next AC component, makes K=K+1.
Step 1202 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 1203, otherwise execution in step 1209.
Step 1203, for the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random, and judge that what produce is first random number or second random number, if first random number, direct execution in step 1204 then is if second random number execution in step 1206 then.
Step 1204 judges that this value is that whether to have before 0 the AC component more than 15 continuous values be that 0 AC component is encoded, and promptly whether R greater than 15, if then execution in step 1205, otherwise execution in step 1206.
Step 1205, according to AC component Huffman table, be that 0 AC component Unified coding is 1 ZRL code word with continuous 16 values, and from the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16, even R=R-16, execution in step 1206 then.
Step 1206 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 1208, otherwise execution in step 1207.
Step 1207 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, return step 1201 then and continue the next AC component of scanning.
Step 1208, value according to last the AC component that scans in a zigzag is 0, promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, with ending place this moment uncoded continuous value be that 0 AC component Unified coding is 1 EOB code word, process ends then.
Step 1209~step 1213 is identical with the processing mode of step 506 as shown in Figure 5~step 510, and the AC component of judging the current value non-zero that scans in step 1213 process ends otherwise return step 1201 during for last, concrete processing procedure does not repeat them here.
So far, this flow process finishes.
Method embodiment five
In the present embodiment, a coding flow process is set, this coding flow process comprises existing coded system and the aforementioned new common treatment step of coded system as shown in Figure 5, also comprises as shown in Figure 5 existing coded system and the aforementioned new different treatment step of coded system simultaneously.Like this, before needs were carried out different treatment steps, what judge generation was first random number or second random number, and then selected according to the random number that produces.
Present embodiment beginning with the zigzag scanning sequency to current DCT coefficient in after the AC component, earlier judge whether this AC component is last AC component of current DCT coefficient, when judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, AC component for current scanning in the current DCT coefficient produces first random number or second random number at random then, and the judgement generation is first random number or second random number;
If what produce is first random number, then continue the next AC component of scanning; That is, the processing mode when producing first random number is close in fact with method embodiment four;
If what produce is second random number, obtain as long as then add up scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, continue the next AC component of scanning then 16 values; Promptly, processing mode when producing second random number is than method embodiment four, difference is, judge the difference on opportunity of random number, and, as long as the current value that has scanned is 0 AC component is not last, then scanned but uncoded value is 1 AC component of 0 earlier current, calculating is scanning but uncoded continuous value is within 0 the AC component total quantity, and then judge add up scanning of obtaining but uncoded continuous value be whether enough 16 of 0 AC number of components, and coding obtain the ZRL code word.
Like this, still can produce approximate technique effect with method embodiment one~four.In addition, present embodiment is than method embodiment one~three, and except resource was handled in further saving, because random number is to be that 0 AC component produces at each value, thereby it was also just higher to insert the randomness of ZRL code word.In other words, with method embodiment four in like manner, present embodiment one~depth of the night of code word combination kind ratio method embodiment that can produce many, thereby present embodiment is that 0 AC component generates a random number at each value, comparing one group of DCT coefficient, unified to generate a random number more flexible.
The coding method of DCT coefficient in the present embodiment, according to existing mode current DCT coefficient is quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Figure 13 is to the schematic flow sheet of AC component coding method in the DCT coefficient among the inventive method embodiment five.Referring to Figure 13, the coding method of DCT coefficient is encoded to 63 AC components in the current DCT coefficient that has quantized according to following steps in the present embodiment:
Step 1300 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 1301 scans next AC component, makes K=K+1.
Step 1302 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 1303, otherwise execution in step 1309.
Step 1303 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 1308, otherwise execution in step 1304.
Step 1304 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, execution in step 1305 then.
Step 1305, for the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random, and the judgement generation is first random number or second random number, if first random number, then directly return step 1301 and continue the next AC component of scanning, if second random number execution in step 1306 then.
Step 1306 judges that this value is that whether to have before 0 the AC component more than 15 continuous values be that 0 AC component is encoded, and promptly whether R greater than 15, if then execution in step 1305, otherwise execution in step 1307.
Step 1307, according to AC component Huffman table, with continuous 16 values is that 0 AC component Unified coding is 1 ZRL code word, and from the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16, even R=R-16 returns step 1301 then and continues the next AC component of scanning.
Step 1308, value according to last the AC component that scans in a zigzag is 0, promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, with ending place this moment uncoded continuous value be that 0 AC component Unified coding is 1 EOB code word, process ends then.
Step 1309~step 1313 is identical with the processing mode of step 506 as shown in Figure 5~step 510, and the AC component of judging the current value non-zero that scans in step 1313 process ends otherwise return step 1301 during for last, concrete processing procedure does not repeat them here.
So far, this flow process finishes.
Method embodiment six
In the present embodiment, a coding flow process is set, this coding flow process comprises existing coded system and the aforementioned new common treatment step of coded system as shown in Figure 5, also comprises as shown in Figure 5 existing coded system and the aforementioned new different treatment step of coded system simultaneously.Like this, before needs were carried out different treatment steps, what judge generation was first random number or second random number, and then selected according to the random number that produces.
Present embodiment beginning with the zigzag scanning sequency to current DCT coefficient in after the AC component, judge whether this AC component is last AC component of current DCT coefficient earlier; When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning; When judging this AC component and be last AC component, produce first random number or second random number at random for current DCT coefficient earlier, and what judge generation is first random number or second random number;
If what produce is first random number, all then that ending place of current DCT coefficient is continuous values are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient; That is, the processing mode when producing first random number is close in fact with method embodiment four and five;
If what produce is second random number, then as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL; Promptly, processing mode when producing second random number, difference than method embodiment four, method embodiment five is, judge the difference on opportunity of random number, and, having only the scanning value is 0 and during as the AC component of current DCT coefficient ending, judging adds up again scanning of obtaining but uncoded continuous value be whether enough 16 of 0 AC number of components, and coding obtain the ZRL code word.
Like this, still can produce approximate technique effect with method embodiment one~five.In addition, present embodiment further has and saves the technique effect of handling resource than method embodiment one~three.
The coding method of DCT coefficient in the present embodiment, according to existing mode current DCT coefficient is quantized earlier, with the AC component value that makes each the AC component in the DCT coefficient, especially corresponding high intensity of illumination change frequency as far as possible all is 0, and then according to existing mode to the direct current DC component coding in the current DCT coefficient after quantizing, at last, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again.
Figure 14 is to the schematic flow sheet of AC component coding method in the DCT coefficient among the inventive method embodiment six.Referring to Figure 14, the coding method of DCT coefficient is encoded to 63 AC components in the current DCT coefficient that has quantized according to following steps in the present embodiment:
Step 1400 is provided with parameter K, is used to represent that current AC component order that scans and the initial value that K is set are 0; Parameters R is set, be used to represent continuous sweep to but the value of encoding is that 0 AC component number and the initial value that R is set are 0.
Step 1401 scans next AC component, makes K=K+1.
Step 1402 judges whether the value ZZ (K) of K AC component is 0, if then execution in step 1403, otherwise execution in step 1409.
Step 1403 judges the current value that scans is whether 0 AC component is last, is whether K equals 63, if then execution in step 1405, otherwise execution in step 1404.
Step 1404 wouldn't be that 0 AC component is encoded to the current value that scans, and to continuous sweep to but the value of encoding is 0 AC component number adds up, make R=R+1, return step 1401 then and continue the next AC component of scanning.
Step 1405, for current DCT coefficient produces first random number or second random number at random, and what judge to produce is first random number or second random number, if first random number, direct execution in step 1408 then is if second random number execution in step 1406 then.
Step 1406 judges that this value is that whether to have before 0 the AC component more than 15 continuous values be that 0 AC component is encoded, and promptly whether R greater than 15, if, direct execution in step 1408 then, otherwise execution in step 1407.
Step 1407, according to AC component Huffman table, be that 0 AC component Unified coding is 1 ZRL code word with continuous 16 values, and from the continuous sweep of record to but the value of encoding is 0 AC component number deducts 16, even R=R-16, execution in step 1408 then.
Step 1408, value according to last the AC component that scans in a zigzag is 0, promptly 63 AC components are to be that 0 AC component is ending with value, according to AC component Huffman table, with ending place this moment uncoded continuous value be that 0 AC component Unified coding is 1 EOB code word, process ends then.
Step 1409~step 1413 is identical with the processing mode of step 506 as shown in Figure 5~step 510, and the AC component of judging the current value non-zero that scans in step 1413 process ends otherwise return step 1401 during for last, concrete processing procedure does not repeat them here.
So far, this flow process finishes.
Above-mentioned only is to have enumerated six method embodiment, in the practical application, basic principle based on these six method embodiment, select at random in order to realize aforementioned new coded system and to be implemented between existing coded system and the aforementioned new coded system, those skilled in the art can also list more embodiment, give unnecessary details no longer one by one at this.
Below, again the DCT coefficient coding device in the embodiment of the invention is elaborated.
Figure 15 is the exemplary configurations schematic diagram of DCT coefficient coding device in the embodiment of the invention.As shown in figure 15, the DCT coefficient coding device in the present embodiment comprises:
Quantification treatment unit 1501 is used for according to existing mode current DCT coefficient being quantized;
DC component unit 1502 is used for according to the direct current DC component coding of existing mode to the current DCT coefficient after quantizing;
Component scanning element 1503 is used for respectively exchanging the AC component according to existing mode with what the zigzag scanning sequency scanned current DCT coefficient;
Alternating current component unit 1505, for not being the current DCT coefficient of 0 AC component ending with continuous value, being used for earlier is that 0 AC component coding is the ZRL code word with the continuous value before the AC component of each value non-0, will remain continuous value again and be 0 AC component and encode with the AC component of this value non-0.
In addition, this code device also comprises:
Random number generation unit 1504 is used to current DCT coefficient to produce first random number or second random number at random, is the coded system of 0 AC component in order to select at random the continuous value of ending place in the current DCT coefficient;
And alternating current component unit 1505 is for the current DCT coefficient that with continuous value is the ending of 0 AC component, be used for the random number generation unit produce be first random number time, all values that ending place is continuous are that 0 AC component Unified coding is the EOB code word; The random number generation unit produce be second random number time, wherein the part value of front is that 0 AC component coding obtains zero persistence length ZRL code word earlier, wherein the residue value of back is that 0 AC component coding is the EOB code word again.
In the practical application, when random number generation unit 1504 produces random number, when alternating current component unit 1505 judges generation is first random number or second random number and how realizes that aforementioned new coded system is to insert the ZRL code word at random, multiple implementation can be arranged, thus, provide below 6 kinds the device embodiment, different alternating current component unit 1505 implementations are provided.
Device embodiment one
In the present embodiment, random number generation unit 1504 is before the AC component is encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random.And as shown in figure 16, the alternating current component unit 1505 in the DCT coefficient coding device in the present embodiment comprises:
The first chooser unit 1600, be used for before beginning current DCT coefficient AC component encoded, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the first coding subelement 1601, the random number generation unit produce be second random number time trigger the second coding subelement 1602;
The first coding subelement 1601, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and triggers the next AC component of component scanning element 1503 scannings; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The second coding subelement 1602, being used in the AC component value of judging current scanning at every turn is after 0, as long as scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word with 16 values, and will scan but uncoded continuous value is 0 AC number of components deducts 16, then, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and the next AC component of triggering component scanning element 153 scannings; When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The first coding subelement 1601 and the second coding subelement 1602, also all be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, when the AC component of judging current scanning is not last AC component of current DCT coefficient, trigger the next AC component of component scanning element 1503 scannings, when judging this AC component and be last AC component, finish coding current DCT coefficient.
In the present embodiment, the first coding subelement 1601 specifically can carry out above-mentioned processing according to having the coding flow process as shown in Figure 5 now, the second coding subelement 1602 is then handled according to the basic principle of aforementioned new coded system, thereby present embodiment to can be regarded as at value be 0 AC component, provide a separate cover to handle resource and simultaneously based on the another set of processing resource of aforementioned new coded system based on existing coded system.
Device embodiment two
In the present embodiment, random number generation unit 1504 is before the AC component is encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random.And as shown in figure 17, the alternating current component unit 1505 in the DCT coefficient coding device in the present embodiment comprises:
The second chooser unit 1700, be used for before beginning current DCT coefficient AC component encoded, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 3rd coding subelement 1701, the random number generation unit produce be second random number time trigger the 4th coding subelement 1702;
The 3rd coding subelement 1701, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and triggers the next AC component of component scanning element 1503 scannings; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The 4th coding subelement 1702, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, obtain as long as add up then scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word with 16 values, and will scan but uncoded continuous value is 0 AC number of components deducts 16, trigger the next AC component of component scanning element 1503 scannings then; When judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The 3rd coding subelement 1701, the 4th coding subelement 1702, also all be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, when the AC component of judging current scanning is not last AC component of current DCT coefficient, trigger the next AC component of component scanning element 1503 scannings, when judging this AC component and be last AC component, finish coding current DCT coefficient.
In the present embodiment, the 3rd coding subelement 1701 specifically can carry out above-mentioned processing according to having the coding flow process as shown in Figure 5 now, the 4th coding subelement 1702 is then handled according to the basic principle of aforementioned new coded system but concrete processing mode slightly is different from the coding of second among the device embodiment one subelement 1602, thereby present embodiment also to can be regarded as at value be 0 AC component, provide a separate cover to handle resource and simultaneously based on the another set of processing resource of aforementioned new coded system based on existing coded system.
Device embodiment three
In the present embodiment, random number generation unit 1504 is before the AC component is encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random.And as shown in figure 18, the alternating current component unit 1505 in the DCT coefficient coding device of present embodiment comprises:
The 3rd chooser unit 1800, be used for before beginning current DCT coefficient AC component encoded, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 5th coding subelement 1801, the random number generation unit produce be second random number time trigger the 6th coding subelement 1802;
The 5th coding subelement 1801, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and triggers the next AC component of component scanning element 1503 scannings; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The 6th coding subelement 1802, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and triggers the next AC component of component scanning element 1503 scannings; When judging this AC component and be last AC component, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL;
The 5th coding subelement 1801 and the 6th coding subelement 1802, also all be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, when the AC component of judging current scanning is not last AC component of current DCT coefficient, trigger the next AC component of component scanning element 1503 scannings, when judging this AC component and be last AC component, finish coding current DCT coefficient.
In the present embodiment, the 5th coding subelement 1801 specifically can carry out above-mentioned processing according to having the coding flow process as shown in Figure 5 now, the 6th coding subelement 1802 is then handled according to the basic principle of aforementioned new coded system, but concrete processing mode slightly is different from coding subelement 1602 of second among device embodiment one and two and the 4th coding subelement 1702, thereby present embodiment also to can be regarded as at value be 0 AC component, provide a separate cover to handle resource simultaneously based on existing coded system, and based on the another set of processing resource of aforementioned new coded system.
Above-mentioned three device embodiment, it all is 0 AC component at value, provide a separate cover to handle resource and simultaneously based on the another set of processing resource of aforementioned new coded system based on existing coded system, then, consider no matter be to adopt which cover to handle resource, at value is that 0 AC component all can exist the identical processing procedure of part, thereby can also multiplexing identical processing resource, specifically referring to follow up device embodiment four~six.
Device embodiment four
Figure 19 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment four.As shown in figure 19, the alternating current component unit 1505 in the DCT coefficient coding device of present embodiment comprises:
The first public subelement 19, whether the AC component value that is used to judge current scanning is 0;
The 4th chooser unit 1900, being used in the AC component value of judging current scanning at every turn is after 0, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 7th coding subelement 1901, the random number generation unit produce be second random number time trigger the 8th coding subelement 1902;
The 7th coding subelement 1901 is used for when last AC component that to judge this AC component be not current DCT coefficient, adds up to scan but uncoded continuous value is 0 AC number of components and triggers the next AC component of component scanning element 1503 scannings; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The 8th coding single 1902, be used for scanning but uncoded continuous value when being enough 16 of 0 AC number of components, earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16 with 16 values, then, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and triggers the next AC component of component scanning element 1503 scannings; When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The public subelement 1500 of non-zero, what no matter produce is first random number or second random number, all be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, when the AC component of judging current scanning is not last AC component of current DCT coefficient, trigger the next AC component of component scanning element 1503 scannings, when judging this AC component and be last AC component, finish coding current DCT coefficient.
And random number generation unit 1504 is after 0 in the AC component value of judging current scanning at every turn in the present embodiment, for the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random.
Than device embodiment one~three, whether the AC component value that is used to judge current scanning in the present embodiment is 0 processing resource and is re-used at the processing resource of the AC component of value non-zero.And because random number is to be that 0 AC component produces at each value, thereby it is also just higher to insert the randomness of ZRL code word.In other words, present embodiment one~depth of the night of code word combination kind analog device embodiment that can produce many, thereby present embodiment is that 0 AC component generates a random number at each value, comparing one group of DCT coefficient, unified to generate a random number more flexible.
Device embodiment five
Figure 20 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment five.As shown in figure 20, the alternating current component unit 1505 in the DCT coefficient coding device of present embodiment comprises:
The first public subelement 19, whether the AC component value that is used to judge current scanning is 0;
The second public subelement 20, being used in the AC component value of judging current scanning at every turn is after 0, judge whether this AC component is last AC component of current DCT coefficient, if not, then add up and scanned but uncoded continuous value is 0 AC number of components, if the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The 5th chooser unit 2000, be used for scanning but after uncoded continuous value is 0 AC number of components adding up at every turn, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 9th coding subelement 2001, the random number generation unit produce be second random number time trigger the tenth coding subelement 2002;
The 9th coding subelement 2001 is used to trigger the next AC component of component scanning element 1503 scannings;
The tenth coding subelement 2002, be used for when add up scanning of obtaining but uncoded continuous value are enough 16 of 0 AC number of components, earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, trigger the next AC component of component scanning element 1503 scannings then 16 values;
The public subelement 1500 of non-zero, what no matter produce is first random number or second random number, all be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, when the AC component of judging current scanning is not last AC component of current DCT coefficient, trigger the next AC component of component scanning element 1503 scannings, when judging this AC component and be last AC component, finish coding current DCT coefficient.
And in the present embodiment, random number generation unit 1504 scans but after uncoded continuous value is 0 AC number of components adding up at every turn, for the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random.
Than device embodiment one~three, whether the AC component value that is used to judge current scanning in the present embodiment be 0 processing resource, be used to judge this AC component whether be last AC component of current DCT coefficient the processing resource, be used to add up scanned but uncoded continuous value be 0 AC number of components the processing resource, the processing resource that obtains the EOB code word and be re-used at the processing resource of the AC component of value non-zero is used to encode.And because random number is to be that 0 AC component produces at each value, thereby it is also just higher to insert the randomness of ZRL code word.In other words, present embodiment one~depth of the night of code word combination kind analog device embodiment that can produce many, thereby present embodiment is that 0 AC component generates a random number at each value, comparing one group of DCT coefficient, unified to generate a random number more flexible.
Device embodiment six
Figure 21 is the structural representation of DCT coefficient coding device among apparatus of the present invention embodiment six.As shown in figure 21, the alternating current component unit 1505 in the DCT coefficient coding device of present embodiment comprises:
The first public subelement 19, whether the AC component value that is used to judge current scanning is 0;
The 3rd public subelement 21, being used in the AC component value of judging current scanning at every turn is after 0, judge whether this AC component is last AC component of current DCT coefficient, if not, then add up and scanned but uncoded continuous value is 0 AC number of components, if then trigger the 6th selected cell;
The 6th selected cell 2100, what be used to judge generation is first random number or second random number, and the random number generation unit produce be first random number time trigger the 11 coding subelement 2101, the random number generation unit produce be second random number time trigger the 12 coding subelement 2102;
The 11 coding subelement 2101, being used for all values that ending place of current DCT coefficient is continuous and being 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The 12 coding subelement 2102, be used for before this AC component, having scanned but uncoded continuous value when being enough 16 of 0 AC number of components, to scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL;
The public subelement 1500 of non-zero, what no matter produce is first random number or second random number, all be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, when the AC component of judging current scanning is not last AC component of current DCT coefficient, trigger the next AC component of component scanning element 1503 scannings, when judging this AC component and be last AC component, finish coding current DCT coefficient.
And in the present embodiment, random number generation unit 1504 is when judging this AC component and be last AC component, for current DCT coefficient produces first random number or second random number at random.
Than device embodiment one~three, whether the AC component value that is used to judge current scanning in the present embodiment be 0 processing resource, be used to judge this AC component whether be last AC component of current DCT coefficient the processing resource, be used to add up and scanned but uncoded continuous value is the processing resource of 0 AC number of components and is re-used at the processing resource of the AC component of value non-zero.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of being done, be equal to and replace and improvement etc., all should be included within protection scope of the present invention.

Claims (19)

1. the coding method of a discrete cosine transform DCT coefficient, earlier current DCT coefficient is quantized, to the direct current DC component coding in the current DCT coefficient after quantizing, with the zigzag scanning sequency AC component that respectively exchanges in the current DCT coefficient is encoded again then
For not being the current DCT coefficient of 0 AC component ending with continuous value, earlier be that 0 AC component coding is zero persistence length ZRL code word, will remain continuous value again and be 0 AC component and encode with the AC component of value non-0 with the continuous value before the AC component of value non-0;
It is characterized in that this coding method is that current DCT coefficient produces first random number or second random number at random, is the coded system of 0 AC component in order to select at random the continuous value of ending place in the current DCT coefficient, wherein,
For the current DCT coefficient that with continuous value is the ending of 0 AC component, if what produce is first random number, all then that ending place is continuous values are that 0 AC component Unified coding is a block end EOB code word; If what produce is second random number, then earlier wherein the part value of front be that 0 AC component coding obtains some ZRL code words, wherein the residue value of back is that 0 AC component coding is the EOB code word again.
2. coding method as claimed in claim 1 is characterized in that,
Before the AC component was encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random, and the judgement generation was first random number or second random number;
If what produce is first random number, the AC component value of then at every turn judging current scanning is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, the AC component value of then at every turn judging current scanning is after 0, as long as scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16 with 16 values, then:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
3. coding method as claimed in claim 1 is characterized in that,
Before the AC component was encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random, and the judgement generation was first random number or second random number;
If what produce is first random number, the AC component value of then at every turn judging current scanning is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, the AC component value of then at every turn judging current scanning is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, obtain as long as add up then scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, continue the next AC component of scanning then 16 values;
When judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
4. coding method as claimed in claim 1 is characterized in that,
Before the AC component was encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random, and the judgement generation was first random number or second random number;
If what produce is first random number, the AC component value of then at every turn judging current scanning is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, the AC component value of then at every turn judging current scanning is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL.
5. coding method as claimed in claim 1 is characterized in that, the AC component value that current scanning is judged in this coding method at every turn is after 0:
For the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random, and judge that what produce is first random number or second random number;
If what produce is first random number, then:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, then as long as scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16 with 16 values, then:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
6. coding method as claimed in claim 1 is characterized in that, the AC component value that current scanning is judged in this coding method at every turn is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, AC component for current scanning in the current DCT coefficient produces first random number or second random number at random then, and the judgement generation is first random number or second random number;
If what produce is first random number, then continue the next AC component of scanning;
If what produce is second random number, obtain as long as then add up scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, continue the next AC component of scanning then 16 values;
When judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
7. coding method as claimed in claim 1 is characterized in that, the AC component value that current scanning is judged in this coding method at every turn is after 0:
When last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, and continues the next AC component of scanning;
When judging this AC component and be last AC component, produce first random number or second random number at random for current DCT coefficient earlier, and what judge generation is first random number or second random number,
If what produce is first random number, all then that ending place of current DCT coefficient is continuous values are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
If what produce is second random number, then as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL.
8. as each described coding method in the claim 2 to 7, it is characterized in that, scan after the AC component of value non-zero at every turn:
As long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16;
With the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component is that 0 AC component and this AC component of value non-zero are together encoded, and will scan but uncoded continuous value is 0 AC number of components zero clearing;
Then, when the AC component of judging current scanning is not last AC component of current DCT coefficient, continue the next AC component of scanning; When judging this AC component and be last AC component, finish coding to current DCT coefficient.
9. the code device of a discrete cosine transform DCT coefficient comprises:
The quantification treatment unit is used for current DCT coefficient is quantized;
The DC component unit is used for the direct current DC component coding to the current DCT coefficient after quantizing;
The component scanning element is used for respectively exchanging the AC component with what the zigzag scanning sequency scanned current DCT coefficient;
The alternating current component unit, for not being the current DCT coefficient of 0 AC component ending with continuous value, being used for earlier is that 0 AC component coding is zero persistence length ZRL code word with the continuous value before the AC component of value non-0, will remain continuous value again and be 0 AC component and encode with the AC component of value non-0;
It is characterized in that this code device also comprises: the random number generation unit is used to current DCT coefficient to produce first random number or second random number at random, is the coded system of 0 AC component in order to select at random the continuous value of ending place in the current DCT coefficient;
And the alternating current component unit is for the current DCT coefficient that with continuous value is the ending of 0 AC component, the random number generation unit produce be first random number time, all values that ending place is continuous are that 0 AC component Unified coding is a block end EOB code word; The random number generation unit produce be second random number time, wherein the part value of front is that 0 AC component coding obtains the ZRL code word earlier, wherein the residue value of back is that 0 AC component coding is the EOB code word again.
10. code device as claimed in claim 9 is characterized in that, the random number generation unit is before the AC component is encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random;
And the alternating current component unit comprises:
The first chooser unit, be used for before beginning current DCT coefficient AC component encoded, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the first coding subelement, the random number generation unit produce be second random number time trigger the second coding subelement;
The first coding subelement, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The second coding subelement, being used in the AC component value of judging current scanning at every turn is after 0, as long as scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16 with 16 values, then, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
11. code device as claimed in claim 10, it is characterized in that, the first coding subelement and the second coding subelement, be further used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, the next AC component of driver sweep when the AC component of judging current scanning is not last AC component of current DCT coefficient finishes the coding to current DCT coefficient when judging this AC component and be last AC component.
12. code device as claimed in claim 9 is characterized in that, the random number generation unit is before the AC component is encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random;
And the alternating current component unit comprises:
The second chooser unit, be used for before beginning current DCT coefficient AC component encoded, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 3rd coding subelement, the random number generation unit produce be second random number time trigger the 4th coding subelement;
The 3rd coding subelement, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The 4th coding subelement, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components, obtain as long as add up then scan but uncoded continuous value is enough 16 of 0 an AC number of components, then earlier be that 0 AC component coding obtains the ZRL code word with 16 values, and will scan but uncoded continuous value is 0 AC number of components deducts 16 the next AC component of driver sweep then; When judging this AC component and be last AC component, the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient.
13. code device as claimed in claim 12, it is characterized in that, the 3rd coding subelement and the 4th coding subelement, be further used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, the next AC component of driver sweep when the AC component of judging current scanning is not last AC component of current DCT coefficient finishes the coding to current DCT coefficient when judging this AC component and be last AC component.
14. code device as claimed in claim 9 is characterized in that, the random number generation unit is before the AC component is encoded in beginning current DCT coefficient, for current DCT coefficient produces first random number or second random number at random;
And the alternating current component unit comprises:
The 3rd chooser unit, be used for before beginning current DCT coefficient AC component encoded, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 5th coding subelement, the random number generation unit produce be second random number time trigger the 6th coding subelement;
The 5th coding subelement, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The 6th coding subelement, being used in the AC component value of judging current scanning at every turn is after 0, earlier judge whether this AC component is last AC component of current DCT coefficient, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL.
15. code device as claimed in claim 14, it is characterized in that, the 5th coding subelement and the 6th coding subelement, be further used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, the next AC component of driver sweep when the AC component of judging current scanning is not last AC component of current DCT coefficient finishes the coding to current DCT coefficient when judging this AC component and be last AC component.
16. code device as claimed in claim 9 is characterized in that, the alternating current component unit comprises:
The first public subelement, whether the AC component value that is used to judge current scanning is 0;
The 4th chooser unit, being used in the AC component value of judging current scanning at every turn is after 0, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 7th coding subelement, the random number generation unit produce be second random number time trigger the 8th coding subelement;
The 7th coding subelement is used for when last AC component that to judge this AC component be not current DCT coefficient, adds up to scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, all values that ending place of current DCT coefficient is continuous are that 0 AC component Unified coding is the EOB code word, and finish the coding to current DCT coefficient;
The 8th coding is single, be used for scanning but uncoded continuous value when being enough 16 of 0 AC number of components, earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16 with 16 values, then, when last AC component that to judge this AC component be not current DCT coefficient, add up and scan but uncoded continuous value is 0 AC number of components and the next AC component of driver sweep; When judging this AC component and be last AC component, the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
And the random number generation unit is after 0 in the AC component value of judging current scanning at every turn, for the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random.
17. code device as claimed in claim 9 is characterized in that, the alternating current component unit comprises:
The first public subelement, whether the AC component value that is used to judge current scanning is 0;
The second public subelement, being used in the AC component value of judging current scanning at every turn is after 0, judge whether this AC component is last AC component of current DCT coefficient, if not, then add up and scanned but uncoded continuous value is 0 AC number of components, if the continuous value that current DCT coefficient ending place is encoded this moment not yet is that 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The 5th chooser unit, be used for scanning but after uncoded continuous value is 0 AC number of components adding up at every turn, what judge to produce is first random number or second random number, and the random number generation unit produce be first random number time trigger the 9th coding subelement, the random number generation unit produce be second random number time trigger the tenth coding subelement;
The 9th coding subelement is used for the next AC component of driver sweep;
The tenth coding subelement, be used for when add up scanning of obtaining but uncoded continuous value are enough 16 of 0 AC number of components, earlier be that 0 AC component coding obtains the ZRL code word, and will scan but uncoded continuous value is 0 AC number of components deducts 16, trigger the next AC component of driver sweep then 16 values;
And the random number generation unit scans but after uncoded continuous value is 0 AC number of components adding up at every turn, for the AC component of current scanning in the current DCT coefficient produces first random number or second random number at random.
18. code device as claimed in claim 9 is characterized in that, the alternating current component unit comprises:
The first public subelement, whether the AC component value that is used to judge current scanning is 0;
The 3rd public subelement, being used in the AC component value of judging current scanning at every turn is after 0, judge whether this AC component is last AC component of current DCT coefficient, if not, then add up and scanned but uncoded continuous value is 0 AC number of components, if then trigger the 6th selected cell;
The 6th selected cell, what be used to judge generation is first random number or second random number, and the random number generation unit produce be first random number time trigger the 11 coding subelement, the random number generation unit produce be second random number time trigger the 12 coding subelement;
The 11 coding subelement, being used for all values that ending place of current DCT coefficient is continuous and being 0 AC component Unified coding is the EOB code word, and finishes the coding to current DCT coefficient;
The 12 coding subelement, be used for before this AC component, having scanned but uncoded continuous value when being enough 16 of 0 AC number of components, to scan earlier but uncoded continuous value is that the AC component loop coding of front is the ZRL code word of 16 integral multiple quantity in 0 the AC component, and then be that 0 AC component Unified coding is the EOB code word, and finish coding to current DCT coefficient with the continuous value of residue that ending place of current DCT coefficient is not encoded as ZRL;
And the random number generation unit is when judging this AC component and be last AC component, for current DCT coefficient produces first random number or second random number at random.
19., it is characterized in that the alternating current component unit further comprises as each described code device of claim 16 to 18:
The public subelement of non-zero, be used for after scanning the AC component of value non-zero at every turn, as long as before this AC component, scanned but uncoded continuous value is enough 16 of 0 an AC number of components, then will scan earlier but uncoded continuous value be in 0 the AC component AC component loop coding of front be the ZRL code word and at each circulation time to scanning but uncoded continuous value is 0 AC number of components subtracts 16; Then, be 0 AC component with the continuous value of residue that is not sufficient to encode as the ZRL code word before this AC component, together encode with this AC component of value non-zero, and will scan but uncoded continuous value is 0 AC number of components zero clearing; At last, the next AC component of driver sweep when the AC component of judging current scanning is not last AC component of current DCT coefficient finishes the coding to current DCT coefficient when judging this AC component and be last AC component.
CN200910237035.6A 2009-11-02 2009-11-02 Method and device for encoding discrete cosine transform coefficient Active CN101729899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910237035.6A CN101729899B (en) 2009-11-02 2009-11-02 Method and device for encoding discrete cosine transform coefficient

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910237035.6A CN101729899B (en) 2009-11-02 2009-11-02 Method and device for encoding discrete cosine transform coefficient

Publications (2)

Publication Number Publication Date
CN101729899A true CN101729899A (en) 2010-06-09
CN101729899B CN101729899B (en) 2014-03-26

Family

ID=42449967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910237035.6A Active CN101729899B (en) 2009-11-02 2009-11-02 Method and device for encoding discrete cosine transform coefficient

Country Status (1)

Country Link
CN (1) CN101729899B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038770A (en) * 2014-06-05 2014-09-10 中国科学技术大学 Discrete cosine transform (DCT) implementation method and system based on randomized computation
CN105847845A (en) * 2010-07-19 2016-08-10 Sk电信有限公司 Video decoding method
CN110708512A (en) * 2019-10-17 2020-01-17 烟台艾易新能源有限公司 Intelligent household wireless network image encryption transmission optimization method
CN112449185A (en) * 2019-08-28 2021-03-05 腾讯科技(深圳)有限公司 Video decoding method, video encoding device, video encoding medium, and electronic apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003134466A (en) * 2001-10-29 2003-05-09 Victor Co Of Japan Ltd Device for recording and reproducing digital signal
CN1774932A (en) * 2003-05-16 2006-05-17 思科技术公司 Combined runlength coding and variable length coding for video compression
CN101355636A (en) * 2004-03-23 2009-01-28 株式会社东芝 image processing device
CN102273080A (en) * 2008-12-03 2011-12-07 诺基亚公司 Switch between DCT coefficient encoding modes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003134466A (en) * 2001-10-29 2003-05-09 Victor Co Of Japan Ltd Device for recording and reproducing digital signal
CN1774932A (en) * 2003-05-16 2006-05-17 思科技术公司 Combined runlength coding and variable length coding for video compression
CN101355636A (en) * 2004-03-23 2009-01-28 株式会社东芝 image processing device
CN102273080A (en) * 2008-12-03 2011-12-07 诺基亚公司 Switch between DCT coefficient encoding modes

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105847845A (en) * 2010-07-19 2016-08-10 Sk电信有限公司 Video decoding method
CN104038770A (en) * 2014-06-05 2014-09-10 中国科学技术大学 Discrete cosine transform (DCT) implementation method and system based on randomized computation
CN104038770B (en) * 2014-06-05 2017-11-28 中国科学技术大学 It is a kind of based on the discrete cosine transform realization method and system calculated at random
CN112449185A (en) * 2019-08-28 2021-03-05 腾讯科技(深圳)有限公司 Video decoding method, video encoding device, video encoding medium, and electronic apparatus
CN112449185B (en) * 2019-08-28 2022-01-25 腾讯科技(深圳)有限公司 Video decoding method, video encoding device, video encoding medium, and electronic apparatus
CN110708512A (en) * 2019-10-17 2020-01-17 烟台艾易新能源有限公司 Intelligent household wireless network image encryption transmission optimization method

Also Published As

Publication number Publication date
CN101729899B (en) 2014-03-26

Similar Documents

Publication Publication Date Title
CN1303820C (en) Quality based image compression
US10805644B2 (en) Device and method for entropy encoding and decoding
CN1140130C (en) Quantization matrix for still and motion picture encoding
KR100751869B1 (en) Context-based adaptive variable length coding for adaptive block transforms
CN108184120B (en) Methods for deriving quantization parameters
EP1834487B1 (en) Method for improved entropy coding
CN1431828A (en) Optimum scanning method for change coefficient in coding/decoding image and video
CN1497985A (en) Image code method and device and image decode method and device
CN105993173B (en) The improvement coding of block is skipped in the transformation of CABAC in HEVC
CN1592412A (en) Adaptive variable-length coding methods for image data
EP1625752A1 (en) Combined runlength coding and variable length coding for video compression
CN101729899B (en) Method and device for encoding discrete cosine transform coefficient
CN1589023A (en) Coding and decoding method and device for multiple coded list lengthening based on context
Ma et al. Convolutional neural network-based arithmetic coding of DC coefficients for HEVC intra coding
CN103843338B (en) The adaptive quantizing of in-frame encoding picture block
JP4440308B2 (en) Rate control method and system in image compression
CN101729900B (en) Quantification control method and quantification device for discrete cosine transform coefficient
KR20140005329A (en) Method and apparatus for unification of significance map context selection
US20040006582A1 (en) Digital image coding device and method
US20010011959A1 (en) Huffman encoder, huffman encoding method and recording medium having program for huffman encoding process recorded thereon
CN1195449A (en) Image encoding device, image decoding device and image transmission system
CN101707718A (en) Control method of discrete cosine transform and device thereof
GB2308771A (en) Video encoding based on inter block correlation
CN101394562A (en) Encoding method and apparatus for encoding image data having a plurality of pixels
US6324307B1 (en) System and method for reducing unwanted noise in digital data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20171221

Address after: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee after: Zhongxing Technology Co., Ltd.

Address before: 100083, Haidian District, Xueyuan Road, Beijing No. 35, Nanjing Ning building, 15 Floor

Patentee before: Beijing Vimicro Corporation

TR01 Transfer of patent right
CP01 Change in the name or title of a patent holder

Address after: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee after: Mid Star Technology Limited by Share Ltd

Address before: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee before: Zhongxing Technology Co., Ltd.

CP01 Change in the name or title of a patent holder