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.