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

Claims (17)

1. the coding method of a discrete cosine transform coefficient, first current DCT coefficient is quantized, then to the direct current DC component coding in the current DCT coefficient after quantizing, then with zigzag scanning sequency, the AC component that respectively exchanges in current DCT coefficient is encoded
For not take the current DCT coefficient of the AC component ending that continuous value is 0, after scanning the AC component of value non-zero at every turn:
As long as scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be ZRL code word and at each circulation time to scanning but the AC number of components that uncoded continuous value is 0 subtracts 16;
The AC component that is 0 by the continuous value of residue that is not sufficient to encode as ZRL code word before this AC component and this AC component of value non-zero are together encoded, and will scan but AC number of components zero clearing that uncoded continuous value is 0;
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 the coding to current DCT coefficient;
It is characterized in that, this coding method is that current DCT coefficient produces the first random number or the second random number, the coded system in order to random selection to the AC component that in current DCT coefficient, the continuous value of ending place is 0 at random, wherein,
For take the current DCT coefficient of the AC component ending that continuous value is 0, if what produce is the first random number, the AC component Unified coding that is 0 by the continuous all values of ending place is block end EOB code word; If what produce is the second random number, first the AC component coding that wherein the part value of front is 0 is obtained to some ZRL code words, then be EOB code word by the AC component coding that wherein the residue value of back is 0.
2. coding method as claimed in claim 1, is characterized in that,
Before AC component is encoded in starting current DCT coefficient, for current DCT coefficient is random, produce the first random number or the second random number, and judgement generation is the first random number or the second random number;
If what produce is the first random number, the AC component value of at every turn judging current scanning is after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
If what produce is the second random number, the AC component value of at every turn judging current scanning is after 0, as long as scanned but enough 16 of AC number of components that uncoded continuous value is 0, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, it is EOB code word that ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0, and finishes the coding to current DCT coefficient.
3. coding method as claimed in claim 1, is characterized in that,
Before AC component is encoded in starting current DCT coefficient, for current DCT coefficient is random, produce the first random number or the second random number, and judgement generation is the first random number or the second random number;
If what produce is the first random number, the AC component value of at every turn judging current scanning is after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
If what produce is the second random number, the AC component value of at every turn judging current scanning is after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components that uncoded continuous value is 0, then as long as cumulative scanning but enough 16 of AC number of components that uncoded continuous value is 0 of obtaining, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then continues the next AC component of scanning;
When judging this AC component and be last AC component, the AC component Unified coding that the continuous value that ending place of current DCT coefficient is now encoded is not yet 0 is EOB code word, and finishes the coding to current DCT coefficient.
4. coding method as claimed in claim 1, is characterized in that,
Before AC component is encoded in starting current DCT coefficient, for current DCT coefficient is random, produce the first random number or the second random number, and judgement generation is the first random number or the second random number;
If what produce is the first random number, the AC component value of at every turn judging current scanning is after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
If what produce is the second random number, the AC component value of at every turn judging current scanning is after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, as long as scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be the ZRL code word of 16 integral multiple quantity, and then ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0 is EOB code word, and finish the coding to current DCT coefficient.
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 is at every turn after 0:
For random the first random number or second random number of producing of AC component of current scanning in current DCT coefficient, and judgement generation is the first random number or the second random number;
If what produce is the first random number:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
If what produce is the second random number, as long as scanned but enough 16 of AC number of components that uncoded continuous value is 0, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, it is EOB code word that ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0, 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 is at every turn after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components that uncoded continuous value is 0, then be random the first random number or second random number of producing of AC component of current scanning in current DCT coefficient, and judgement generation is the first random number or the second random number;
If what produce is the first random number, continue the next AC component of scanning;
If what produce is the second random number, as long as cumulative scanning but enough 16 of AC number of components that uncoded continuous value is 0 of obtaining, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then continues the next AC component of scanning;
When judging this AC component and be last AC component, the AC component Unified coding that the continuous value that ending place of current DCT coefficient is now encoded is not yet 0 is 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 is at every turn after 0:
When judging last AC component that this AC component is not current DCT coefficient, cumulative scanned but AC number of components that uncoded continuous value is 0, and continued the next AC component of scanning;
When judging this AC component and be last AC component, be first random the first random number or the second random number of producing of current DCT coefficient, and judgement produce is the first random number or the second random number,
If what produce is the first random number, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
If what produce is the second random number, as long as scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be the ZRL code word of 16 integral multiple quantity, and then ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0 is EOB code word, and finish the coding to current DCT coefficient.
8. a code device for discrete cosine transform coefficient, comprising:
Quantification treatment unit, for quantizing current DCT coefficient;
DC component unit, for the direct current DC component coding of the current DCT coefficient to after quantizing;
Component scanning element, respectively exchanges AC component for what scan current DCT coefficient with zigzag scanning sequency;
Alternating current component unit, for not take the current DCT coefficient of the AC component ending that continuous value is 0, after scanning the AC component of value non-zero at every turn, as long as scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be ZRL code word and at each circulation time to scanning but the AC number of components that uncoded continuous value is 0 subtracts 16; Then, the AC component that is 0 by the continuous value of residue that is not sufficient to encode as ZRL code word before this AC component, together encodes with this AC component of value non-zero, and will scan but AC number of components zero clearing that uncoded continuous value is 0; Finally, 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 judging when this AC component is last AC component;
It is characterized in that, this code device also comprises: random number generation unit, is used to current DCT coefficient random generation the first random number or the second random number, the coded system in order to random selection to the AC component that in current DCT coefficient, the continuous value of ending place is 0;
And alternating current component unit is for take the current DCT coefficient of the AC component ending that continuous value is 0, at random number generation unit, produce be the first random number time, the AC component Unified coding that is 0 by the continuous all values of ending place is block end EOB code word; At random number generation unit, produce be the second random number time, first the AC component coding that wherein the part value of front is 0 is obtained to ZRL code word, then is EOB code word by the AC component coding that wherein the residue value of back is 0.
9. code device as claimed in claim 8, is characterized in that, random number generation unit before in starting current DCT coefficient, AC component is encoded, is random the first random number or the second random number of producing of current DCT coefficient;
And alternating current component unit comprises:
The first chooser unit, for before starting the current DCT coefficient AC component to encode, what judgement produced is the first random number or the second random number, and at random number generation unit, produce be the first random number time trigger the first coding subelement, at random number generation unit, produce be the second random number time trigger the second coding subelement;
The first coding subelement, being used for is after 0 in the AC component value of judging current scanning at every turn, first judge whether this AC component is last AC component of current DCT coefficient, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
The second coding subelement, being used for is after 0 in the AC component value of judging current scanning at every turn, as long as scanned but enough 16 of AC number of components that uncoded continuous value is 0, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, it is EOB code word that ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0, and finishes the coding to current DCT coefficient.
10. code device as claimed in claim 9, 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 scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be ZRL code word and at each circulation time to scanning but the AC number of components that uncoded continuous value is 0 subtracts 16; Then, the AC component that is 0 by the continuous value of residue that is not sufficient to encode as ZRL code word before this AC component, together encodes with this AC component of value non-zero, and will scan but AC number of components zero clearing that uncoded continuous value is 0; Finally, 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 judging when this AC component is last AC component.
11. code devices as claimed in claim 8, is characterized in that, random number generation unit before in starting current DCT coefficient, AC component is encoded, is random the first random number or the second random number of producing of current DCT coefficient;
And alternating current component unit comprises:
The second chooser unit, for before starting the current DCT coefficient AC component to encode, what judgement produced is the first random number or the second random number, and at random number generation unit, produce be the first random number time trigger the 3rd coding subelement, at random number generation unit, produce be the second random number time trigger the 4th coding subelement;
The 3rd coding subelement, being used for is after 0 in the AC component value of judging current scanning at every turn, first judge whether this AC component is last AC component of current DCT coefficient, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
The 4th coding subelement, being used for is after 0 in the AC component value of judging current scanning at every turn, first judge whether this AC component is last AC component of current DCT coefficient, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components that uncoded continuous value is 0, then as long as cumulative scanning but enough 16 of AC number of components that uncoded continuous value is 0 of obtaining, the AC component coding that is first 0 by 16 values obtains ZRL code word, and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then the next AC component of driver sweep, when judging this AC component and be last AC component, the AC component Unified coding that the continuous value that ending place of current DCT coefficient is now encoded is not yet 0 is EOB code word, and finishes the coding to current DCT coefficient.
12. code devices as claimed in claim 11, 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 scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be ZRL code word and at each circulation time to scanning but the AC number of components that uncoded continuous value is 0 subtracts 16; Then, the AC component that is 0 by the continuous value of residue that is not sufficient to encode as ZRL code word before this AC component, together encodes with this AC component of value non-zero, and will scan but AC number of components zero clearing that uncoded continuous value is 0; Finally, 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 judging when this AC component is last AC component.
13. code devices as claimed in claim 8, is characterized in that, random number generation unit before in starting current DCT coefficient, AC component is encoded, is random the first random number or the second random number of producing of current DCT coefficient;
And alternating current component unit comprises:
The 3rd chooser unit, for before starting the current DCT coefficient AC component to encode, what judgement produced is the first random number or the second random number, and at random number generation unit, produce be the first random number time trigger the 5th coding subelement, at random number generation unit, produce be the second random number time trigger the 6th coding subelement;
The 5th coding subelement, being used for is after 0 in the AC component value of judging current scanning at every turn, first judge whether this AC component is last AC component of current DCT coefficient, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
The 6th coding subelement, being used for is after 0 in the AC component value of judging current scanning at every turn, first judge whether this AC component is last AC component of current DCT coefficient, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, as long as scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be the ZRL code word of 16 integral multiple quantity, and then ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0 is EOB code word, and finish the coding to current DCT coefficient.
14. code devices as claimed in claim 13, 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 scanned before this AC component but enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be ZRL code word and at each circulation time to scanning but the AC number of components that uncoded continuous value is 0 subtracts 16; Then, the AC component that is 0 by the continuous value of residue that is not sufficient to encode as ZRL code word before this AC component, together encodes with this AC component of value non-zero, and will scan but AC number of components zero clearing that uncoded continuous value is 0; Finally, 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 judging when this AC component is last AC component.
15. code devices as claimed in claim 8, is characterized in that, alternating current component unit comprises:
The first public subelement, for judging whether the AC component value of current scanning is 0;
The 4th chooser unit, being used for is after 0 in the AC component value of judging current scanning at every turn, what judgement produced is the first random number or the second random number, and at random number generation unit, produce be the first random number time trigger the 7th coding subelement, at random number generation unit, produce be the second random number time trigger the 8th coding subelement;
The 7th coding subelement, for when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, the AC component Unified coding that is 0 by the continuous all values of current DCT coefficient ending place is EOB code word, and finishes the coding to current DCT coefficient;
The 8th coding is single, for scanning but during enough 16 of AC number of components that uncoded continuous value is 0, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then, when judging last AC component that this AC component is not current DCT coefficient, cumulative scanning but AC number of components the next AC component of driver sweep that uncoded continuous value is 0; When judging this AC component and be last AC component, it is EOB code word that ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0, and finishes the coding to current DCT coefficient;
And random number generation unit is after 0 in the AC component value of judging current scanning at every turn, be random the first random number or second random number of producing of AC component of current scanning in current DCT coefficient.
16. code devices as claimed in claim 8, is characterized in that, alternating current component unit comprises:
The first public subelement, for judging whether the AC component value of current scanning is 0;
The second public subelement, being used for is 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, if not, cumulative scanning but AC number of components that uncoded continuous value is 0, if so, the AC component Unified coding that the continuous value that ending place of current DCT coefficient is now encoded is not yet 0 is EOB code word, and finishes the coding to current DCT coefficient;
The 5th chooser unit, for having scanned but after AC number of components that uncoded continuous value is 0 each cumulative, what judgement produced is the first random number or the second random number, and at random number generation unit, produce be the first random number time trigger the 9th coding subelement, at random number generation unit, produce be the second random number time trigger the tenth coding subelement;
The 9th coding subelement, for the next AC component of driver sweep;
The tenth coding subelement, for cumulative obtain scan but during enough 16 of AC number of components that uncoded continuous value is 0, the AC component coding that is first 0 by 16 values obtains ZRL code word and will scan but AC number of components that uncoded continuous value is 0 deducts 16, then triggers the next AC component of driver sweep;
And random number generation unit has scanned but after AC number of components that uncoded continuous value is 0, has been random the first random number or second random number of producing of AC component of current scanning in current DCT coefficient each cumulative.
17. code devices as claimed in claim 8, is characterized in that, alternating current component unit comprises:
The first public subelement, for judging whether the AC component value of current scanning is 0;
The 3rd public subelement, being used for is 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, if not, cumulative scanning but AC number of components that uncoded continuous value is 0, if so, trigger the 6th selected cell;
The 6th selected cell, for what judge generation, be the first random number or the second random number, and at random number generation unit, produce be the first random number time trigger the 11 coding subelement, at random number generation unit, produce be the second random number time trigger the 12 coding subelement;
The 11 coding subelement, for being 0 by the continuous all values of current DCT coefficient ending place, AC component Unified coding is EOB code word, and finishes the coding to current DCT coefficient;
The 12 coding subelement, for having scanned before this AC component but during enough 16 of AC number of components that uncoded continuous value is 0, first will scan but in AC component that uncoded continuous value is 0 the AC component loop coding of front be the ZRL code word of 16 integral multiple quantity, and then ending place of current DCT coefficient is not encoded as to the AC component Unified coding that the continuous value of residue of ZRL is 0 is EOB code word, and finish the coding to current DCT coefficient;
And random number generation unit, when judging this AC component and be last AC component, is random the first random number or the second random number of producing of current DCT coefficient.
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 CN101729899A (en) 2010-06-09
CN101729899B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120009618A (en) * 2010-07-19 2012-02-02 에스케이 텔레콤주식회사 Method and Apparatus for Partitioned-Coding of Frequency Transform Unit and Method and Apparatus for Encoding/Decoding of Video Data Thereof
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
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

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 株式会社东芝 Apparatus for image processing
CN102273080A (en) * 2008-12-03 2011-12-07 诺基亚公司 Switching between DCT coefficient coding 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 株式会社东芝 Apparatus for image processing
CN102273080A (en) * 2008-12-03 2011-12-07 诺基亚公司 Switching between DCT coefficient coding modes

Also Published As

Publication number Publication date
CN101729899A (en) 2010-06-09

Similar Documents

Publication Publication Date Title
CN1232126C (en) Image code method and device and image decode method and device
US10805644B2 (en) Device and method for entropy encoding and decoding
CN1200568C (en) Optimum scanning method for change coefficient in coding/decoding image and video
US7843998B2 (en) Method for improved entropy coding
CN108184120B (en) Method for deriving quantization parameter
KR101261526B1 (en) An video encoding/decoding method and apparatus
CN101729899B (en) Method and device for encoding discrete cosine transform coefficient
US5831559A (en) Encoding/decoding video signals using multiple run-val mapping tables
US6580834B2 (en) Method and apparatus for encoding and decoding signals
US20130128958A1 (en) Video data encoding and decoding
CN1329440A (en) Static picture and cartoon cooding quantization matrix
CA2795479A1 (en) Method and apparatus for encoding and decoding image and method and apparatus for decoding image using adaptive coefficient scan order
CN1625893A (en) Compression of palettized color images with variable length color codes
KR100846774B1 (en) Filtering method for removing block artifacts and/or ringing noise and apparatus therefor
CN101039374A (en) Image lossless compression and image decompressing method
GB2496194A (en) Entropy encoding video data using reordering patterns
WO2013113088A1 (en) Methods and devices for context modeling to enable modular processing
GB2496201A (en) Context adaptive data encoding and decoding
CN103843338B (en) The adaptive quantizing of in-frame encoding picture block
CN109874012B (en) Video coding method, encoder, electronic device and medium
CN1917645B (en) Method for encoding block of coefficient
US5822000A (en) Video encoding using rearrangement of transform coefficients and inter-block correlation
CN101729900B (en) Quantification control method and quantification device for discrete cosine transform coefficient
EP2999218A1 (en) Method and apparatus for unification of significance map context selection
US6606039B2 (en) Huffman encoder, Huffman encoding method and recording medium having program for Huffman encoding process recorded thereon

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