Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In the embodiment of the invention, will long piece and short block digital signal, all transform 6 DCT-IV type computing.Therefore can to unify be 6 DCT-IV computings in all computings, can realize the shared of arithmetic element on this basis.
At first, it is as follows MDCT and IMDCT to be transformed 6 the derivation of DCT-IV type computing:
For IMDCT:
n=0~(N-1)(5)
Because symmetry is arranged:
As long as so obtain c (n) [0, the N/2) value on, just can obtain y (n) [0, N) Shang Mian value, for long piece, c (n) is 18 DCT-IV computing, for short block, c (n) then is 6 DCT-IV computing.
For MDCT:
n=0~(N/2-1)(7)
If:
Then:
N=0~(N/2-1), promptly identical with formula (6), just can obtain y (n) as long as calculate c (n).For long piece, c (n) is 18 DCT-IV computing, and for short block, c (n) then is 6 DCT-IV computing.
As from the foregoing, long piece IMDCT and MDCT can obtain by 18 DCT-IV computing, and short block IMDCT and MDCT can obtain by 6 DCT-IV computing.
For 18 DCT-IV computing shown in formula (6) and formula (8), can be converted into 36 DCT-IV computing in the following manner:
n=0~(N/2-1)(9)
If:
So, calculate A (n), B (n) and C (n) at 6, just can obtain 18 c (n).
If:
θ
k=(2k+1)π/N (12)
Derive through arrangement, can obtain formula (13):
n=0~(N/6-1)
n=0~(N/6-1)
n=0~(N/6-1)
(13)
If: am
k=f
k-g '
k-h
k, k=0,1... (N/6-1)
k=0,1...(N/6-1)
k=0,1...(N/6-1)(14)
A (n), B (n) and C (n) are 6 DCT-IV type computings as can be seen by formula (13) and (14), so far, no matter be long piece, short block, MDCT or IMDCT, can shared identical arithmetic element (6 DCT-IV computings), add that pre-service and aftertreatment realize.
Fig. 3 shows the realization flow of the coding method that the embodiment of the invention provides, and for convenience of description, only shows the part relevant with present embodiment.
The long piece that provides for the outside or the digital audio and video signals of short block, at first to carry out pre-treatment so that long or short block are converted to discrete cosine transform four type DCT-IV computings, then long piece or short block digital signal after handling are carried out MDCT or IMDCT computing, wherein above-mentioned MDCT or IMDCT computing are to finish in same its main operational unit, after computing finishes, carry out aftertreatment output MDCT or IMDCT operation result.
Fig. 4 shows the specific implementation process flow diagram of the coding method that the embodiment of the invention provides, the discrete cosine transform MDCT computing that this coding method improves described digital signal, and details are as follows:
Steps A. at least one audio digital signals is provided, and this digital signal is long piece or short block;
Step B. carries out the MDCT computing to this digital signal, comprises to the MDCT computing of long piece or to the MDCT computing of short block, all converts discrete cosine transform four type DCT-IV computings to the MDCT computing of long piece with to the MDCT computing of short block.。
In above-mentioned steps B, the MDCT computing specifically comprises pre-treatment, computing, aftertreatment three phases, and each stage, the concrete operation of carrying out was as follows:
B1. digital signal is done pre-treatment, this pre-treatment converts long MDCT computing and short block MDCT computing to the DCT-IV computing;
B2. the digital signal through pre-treatment is input to and carries out the DCT-IV computing in the arithmetic element, when digital signal is short block, carry out a DCT-IV computing, when digital signal is long piece, carry out three DCT-IV computings;
B3. the DCT-IV operation result is carried out aftertreatment, output MDCT operation result.
According to the difference of long piece, short block, the concrete operations of pretreatment stage are also different, and for example long piece also need long piece pre-treatment after the MDCT pre-treatment, so step B1 specifically comprises again:
B11. judge that digital signal is long piece or short block, when digital signal is short block, execution in step B12, when digital signal is long piece, execution in step B13;
B12. carry out short block MDCT pre-treatment, short block MDCT pre-treatment is to utilize symmetry the MDCT computing of short block is converted to 6 DCT-IV computing; Execution in step B15;
B13. executive chairman's piece MDCT pre-treatment, long piece MDCT pre-treatment are to utilize symmetry the MDCT computing of long piece is converted to 18 DCT-IV computing;
In the embodiment of the invention, above-mentioned steps B.12 and the short block MDCT pre-treatment B.13 and long piece MDCT pre-treatment carry out according to following formula:
a(k)=X(k-N/4)-X((3N/4-1)-k),k=N/4~(N/2-1)
a(k)=-X(3N/4+k)-X((3N/4-1)-k),k=0~(N/4-1)
Wherein, X is that length is the input signal of N, and k is a running index, and in the short block MDCT pre-treatment, N is 12, and in the long piece MDCT pre-treatment, N is 36.
B14. to the long piece pre-treatment of the data after the long piece MDCT pre-treatment, described long piece pre-treatment converts 18 DCT-IV computing to 6 DCT-IV computing;
Above-mentioned long piece pre-treatment is carried out according to following formula:
am
k=f
k-g′
k-h
k,k=0,1...(N/6-1)
k=0,1...(N/6-1)
k=0,1...(N/6-1)
Wherein, N is 36, am
k, bm
k, cm
kBe respectively the digital signal of 3 groups 6 suitable DCT-IV computing, the f in the above-mentioned formula
k, g
k, h
k, f '
k, g '
k, φ
N, kBe defined as follows respectively:
f
k=a(k)
g
k=a(N/6+k)
h
k=a(N/3+k),k=0,1...(N/6-1)
f′
k=f
N/6-1-k
g′
k=g
N/6-1-k
θ
k=(2k+1)π/N,
I.e. formula above (11) and (12), wherein function a is the digital signal of after the pre-treatment 18 or 6 s' suitable DCT-IV computing, i.e. the definition of formula (8).
B15. pre-treatment finishes.
Post-processing stages specifically need be carried out following operation:
B31. judge that digital signal is long piece or short block, when digital signal is short block, execution in step B32; When digital signal is long piece, execution in step B33;
B32. with the DCT-IV operation result of short block, promptly the MDCT operation result is exported, execution in step B34;
B33. the long piece aftertreatment of three DCT-IV operation results that will long piece, the long aftertreatment of determining converts three DCT-IV operation results of long to 18 DCT-IV operation results, and promptly the MDCT operation result is exported;
Above-mentioned long piece aftertreatment is carried out according to following formula:
n=0~(N/6-1)
c(3n+1)=A(n),n=0~(N/6-1)
n=0~(N/6-1)
Wherein, N is 36, and A (n), B (n), C (n) are respectively and are defined as follows:
n=0~(N/6-1)
n=0~(N/6-1)
n=0~(N/6-1)
I.e. formula above (13), the f in the above-mentioned formula
k, g
k, h
k, f '
k, g '
k, φ
N, kBe defined as follows respectively:
f
k=a(k)
g
k=a(N/6+k)
h
k=a(N/3+k),k=0,1...(N/6-1)
f′
k=f
N/6-1-k
g′
k=g
N/6-1-k
θ
k=(2k+1)π/N,
Function a is the digital signal after the pre-treatment.
B34. aftertreatment finishes.
Fig. 5 shows the specific implementation process flow diagram of the coding/decoding method that the embodiment of the invention provides, the discrete cosine transform IMDCT computing that this coding/decoding method is oppositely improved described digital signal, and details are as follows:
Steps A. at least one audio digital signals is provided, and this digital signal is long piece or short block;
Step B. carries out the IMDCT computing to this digital signal, comprises to the IMDCT computing of long piece or to the IMDCT computing of short block, converts discrete cosine transform four type DCT-IV computings to the IMDCT computing of long piece or to the IMDCT computing of short block.
In above-mentioned steps B, the IMDCT computing comprises pre-treatment, computing, aftertreatment three phases equally, and each stage, the concrete operation of carrying out was as follows:
B1. digital signal is done pre-treatment, this pre-treatment converts long IMDCT computing and short block IMDCT computing to the DCT-IV computing;
B2. the digital signal through pre-treatment is input to and carries out the DCT-IV computing in the arithmetic element, when digital signal is short block, carry out a DCT-IV computing, when digital signal is long piece, carry out three DCT-IV computings;
B3. the DCT-IV operation result is carried out aftertreatment, output IMDCT operation result.
According to the difference of long piece, short block, the concrete operations of pretreatment stage are also different, so step B1 specifically comprises again:
B11. judge that digital signal is long piece or short block, when digital signal is short block, execution in step B13, when digital signal is long piece, execution in step B12;
B12. when digital signal is long piece, the pre-treatment of executive chairman's piece, long piece pre-treatment is the IMDCT computing of long piece is converted to 6 DCT-IV computing;
B13. pre-treatment finishes.
Above-mentioned long piece pre-treatment is carried out according to following formula:
am
k=f
k-g′
k-h
k,k=0,1...(N/6-1)
k=0,1...(N/6-1)
k=0,1...(N/6-1)
Wherein, N is 36, am
k, bm
k, cm
kBe respectively the digital signal of 3 groups 6 suitable DCT-IV computing, the fk in the above-mentioned formula, g
k, h
k, f '
k, g '
k, φ
N, kBe defined as follows respectively:
f
k=a(k)
g
k=a(N/6+k)
h
k=a(N/3+k),k=0,1...(N/6-1)
f′
k=f
N/6-1-k
g′
k=g
N/6-1-k
θ
k=(2k+1)π/N,
I.e. formula above (11) and (12), wherein function alpha is the digital signal of after the pre-treatment 18 or 6 s' suitable DCT-N computing, i.e. the definition of formula (8).
Post-processing stages specifically need be carried out following operation:
B31. judge that digital signal is long piece or short block, when digital signal is short block, execution in step B32; When digital signal is long piece, execution in step B33;
B32. the DCT-IV operation result with short block carries out the IMDCT aftertreatment, and the IMDCT aftertreatment converts the DCT-IV operation result of short block to the output of short block IMDCT operation result, execution in step B35;
B33. the long piece aftertreatment of three DCT-IV operation results that will long piece, long piece aftertreatment converts three DCT-IV operation results of long to 18 DCT-IV operation results;
B34. 18 DCT-IV operation results are carried out the IMDCT aftertreatment, the IMDCT aftertreatment is the output of 18 DCT-IV operation result conversion growth piece IMDCT operation results;
B35. aftertreatment finishes.
Above-mentioned long piece aftertreatment is carried out according to following formula:
n=0~(N/6-1)
c(3n+1)=A(n),n=0~(N/6-1)
n=0~(N/6-1)
Wherein, N is 36, and A (n), B (n), C (n) are respectively and are defined as follows:
n=0~(N/6-1)
n=0~(N/6-1)
n=0~(N/6-1)
I.e. formula above (13), the f in the above-mentioned formula
k, g
k, h
k, f '
k, g '
k, φ
N, kBe defined as follows respectively:
f
k=a(k)
g
k=a(N/6+k)
h
k=a(N/3+k),k=0,1...(N/6-1)
f′
k=f
N/6-1-k
g′
k=g
N/6-1-k
θ
k=(2k+1)π/N,
Function a is the digital signal after the pre-treatment.
The above-mentioned IMDCT of stating aftertreatment is carried out according to following formula:
When carrying out short block IMDCT aftertreatment, N is 12; When carrying out short block IMDCT aftertreatment, N is 36.Y (n) is the final output result of IMDCT computing, and function c is the operation result of 18 DCT-IV.
Fig. 6 shows the specific implementation process flow diagram of the decoding method that the embodiment of the invention provides, and details are as follows:
Steps A. at least one audio digital signals is provided, and this digital signal is long piece or short block;
Step B. carries out MDCT computing to this digital signal to these digital signal encoding and decoding when coding, when decoding this digital signal is carried out the IMDCT computing, and MDCT computing and IMDCT computing all convert discrete cosine transform four type DCT-IV computings to.。
In the embodiment of the invention, MDCT computing and IMDCT computing all convert the DCT-IV computing to.
The concrete respectively operation of carrying out of pre-treatment in above-mentioned steps B, computing, aftertreatment three phases is as follows:
B1. digital signal is done pre-treatment, this pre-treatment all converts MDCT computing and IMDCT computing to the DCT-IV computing;
B2. the digital signal through pre-treatment is input to and carries out the DCT-IV computing in the arithmetic element, when digital signal is short block, carry out a DCT-IV computing, when digital signal is long piece, carry out three DCT-IV computings;
B3. the DCT-IV operation result is carried out aftertreatment, when carrying out the MDCT computing, aftertreatment converts the DCT-IV operation result output of to MDCT operation result; When carrying out the IMDCT computing, aftertreatment converts the DCT-IV operation result output of to IMDCT operation result.
According to the difference of long piece, short block, the concrete operations of pretreatment stage are also different, so step B1 specifically comprises again:
B11. judge it is to carry out MDCT computing or IMDCT computing, when carrying out the MDCT computing, execution in step B12; When carrying out the IMDCT computing, execution in step B16;
B12. judge that digital signal is short block or long piece, when digital signal is short block, execution in step B13; When digital signal is long piece, execution in step B14;
B13. carry out short block MDCT pre-treatment, short block MDCT pre-treatment utilizes symmetry the MDCT computing of short block is converted to 6 DCT-IV computing, execution in step B18;
B14. when digital signal was long piece, executive chairman's piece MDCT pre-treatment, long piece MDCT pre-treatment utilized symmetry the MDCT computing of long piece is converted to 18 DCT-IV computing;
B15. to the long piece pre-treatment of the data after the long piece MDCT pre-treatment, long piece pre-treatment converts 18 DCT-IV computing to 6 DCT-IV computing, execution in step B18;
B16. judge that digital signal is short block or long piece, when digital signal is short block, execution in step B18; When digital signal is long piece, execution in step B17;
B17. to the long piece pre-treatment of digital signal, long piece pre-treatment is the IMDCT computing of digital signal is converted to 6 DCT-IV computing;
B18. pre-treatment finishes.
Post-processing stages specifically need be carried out following operation:
B31. judge it is to carry out MDCT computing or IMDCT computing, when carrying out the MDCT computing, execution in step B32; When carrying out the IMDCT computing, execution in step B34;
B32. judge that digital signal is short block or long piece, when digital signal is short block, with short block DCT-IV operation result, i.e. short block MDCT operation result output, execution in step B37; When digital signal is long piece, execution in step B33;
B33. executive chairman's piece aftertreatment, long piece aftertreatment will long piece three DCT-IV operation results convert 18 DCT-IV operation result to, promptly long piece MDCT operation result output, execution in step B37;
B34. judge that digital signal is short block or long piece, when digital signal is short block, execution in step B36; When digital signal is long piece, execution in step B35;
B35. executive chairman's piece aftertreatment, described long piece aftertreatment will long piece three DCT-IV operation results convert 18 DCT-IV operation result to;
B36. carry out the IMDCT aftertreatment, when carrying out short block IMDCT computing, described IMDCT aftertreatment converts short block DCT-IV operation result the output of to IMDCT operation result; When executive chairman's piece IMDCT computing, described IMDCT aftertreatment converts described DCT-IV operation result the output of to IMDCT operation result at 18;
B37. aftertreatment finishes.
Fig. 7 shows the audio coding that the embodiment of the invention provides and/or the structural principle of decode system, and Fig. 8 then is the structural drawing that system shown in Figure 7 is realized with the integrated circuit form, and wherein frame of broken lines represents that inner cellular construction can be integrated on the integrated circuit.For convenience of description, in Fig. 7, Fig. 8, only show the part relevant with present embodiment.
With reference to Fig. 7, Fig. 8, IO interface 3 is used for communicating by letter with external logic 1, receives at least one pending audio digital signals in the lump, and this digital signal is long piece or short block, mainly finishes the function that receives control signal and feedback compute mode; Registers group 2 is mainly other each unit functions such as data are temporary, state demonstration, parameter configuration is provided; Generation, computing and the storage of the data of computing in the Operations Analysis 4 major control arithmetic elements 6; 5 main conversions of being responsible between the computing flow process of logic control element are as the conversion between beginning, intermediate treatment, end and each state; RAM and ROM 7 are memory device.Operations Analysis 4, logic control element 5 and registers group 2 are connected, and are used for from registers group 2 access datas, and control is carried out computing to data, operation result is stored among the RAM after finishing related operation again.
Arithmetic element 6 is connected with Operations Analysis 4 with registers group 2, and the long piece digital signal or the short block digital signal that are used under the control of logic control element 5 and Operations Analysis 4 described IO interface being received are carried out MDCT and/or IMDCT computing.The principle of work of system is described during hereinafter respectively to coding, decoding, three kinds of situations of encoding and decoding.
1, when said system is used to encode separately.Arithmetic element 6 is done pre-treatment to digital signal under the control of 6 Operations Analysis 4 and logic control element 5, pre-treatment converts long MDCT computing and short block MDCT computing to the DCT-IV computing; And, when digital signal is short block, carry out a DCT-IV computing to digital signal execution DCT-IV computing through pre-treatment, when digital signal is long piece, carry out three DCT-IV computings; Arithmetic element 6 is carried out aftertreatment to described DCT-IV operation result under the control of Operations Analysis 4 and described logic control element 5, output MDCT operation result.
Operations Analysis 4 is used to also judge that the digital signal that IO interface 3 receives is long piece or short block; When judging that digital signal is short block, arithmetic element 6 is carried out short block MDCT pre-treatment under the control of Operations Analysis 4 and logic control element 5, and short block MDCT pre-treatment utilizes symmetry the MDCT computing of short block is converted to 6 DCT-IV computing; When judging that described digital signal is long piece, arithmetic element 6 is executive chairman's piece MDCT pre-treatment under the control of Operations Analysis 4 and logic control element 5, and described long piece MDCT pre-treatment utilizes symmetry the MDCT computing of long piece is converted to 18 DCT-IV computing; And further to the long piece pre-treatment of the data after the described long piece MDCT pre-treatment, described long piece pre-treatment converts 18 DCT-IV computing to 6 DCT-IV computing.
Wherein, carry out describe in the same writing coding method of formula of short block MDCT pre-treatment and long piece MDCT pre-treatment, long piece pre-treatment time institute foundation identical, repeat no more herein.
Operations Analysis 4 is used to also judge that the digital signal that IO interface 3 receives is long piece or short block; When judging that described digital signal is short block, with the DCT-IV operation result of described short block, promptly export by the MDCT operation result under the control of Operations Analysis 4 and logic control element 5 for arithmetic element 6; When judging that digital signal is long piece, arithmetic element 6 under the control of Operations Analysis 4 and logic control element 5 with the long piece aftertreatment of three DCT-IV operation results of described long piece, described long piece aftertreatment converts three DCT-IV operation results of described long piece to 18 DCT-IV operation results, i.e. MDCT operation result output.
Wherein, that describes in the same writing coding method of formula of long piece aftertreatment time institute foundation is identical, repeats no more herein.
2, when said system is used to encode separately.Arithmetic element 4 is done pre-treatment to digital signal under the control of Operations Analysis 6 and logic control element 5, described pre-treatment converts long IMDCT computing or short block IMDCT computing to discrete cosine transform four type DCT-IV computings; And carry out the DCT-IV computing in the arithmetic element to being input to through the digital signal of pre-treatment, and when described digital signal is short block, carry out a DCT-IV computing, when described digital signal is long piece, carry out three DCT-IV computings; Arithmetic element 4 is carried out aftertreatment to described DCT-IV operation result under the control of Operations Analysis 6 and logic control element 5, output IMDCT operation result.
Operations Analysis 4 is used to also judge that the digital signal that IO interface 3 receives is long piece or short block; When judging that digital signal is short block, do not do pre-treatment; When judging that digital signal is long piece, arithmetic element 6 is executive chairman's piece MDCT pre-treatment under the control of Operations Analysis 4 and logic control element 5, and described long piece pre-treatment is the IMDCT computing of long piece is converted to 6 DCT-IV computing.
Operations Analysis 4 is used to also judge that the digital signal that IO interface 3 receives is long piece or short block; When judging that digital signal is short block, arithmetic element 6 is carried out the IMDCT aftertreatment with the DCT-IV operation result of described short block under the control of Operations Analysis 4 and logic control element 5, described IMDCT aftertreatment converts the DCT-IV operation result of short block the output of to short block IMDCT operation result; When judging that described digital signal is long piece, arithmetic element 6 under the control of Operations Analysis 4 and logic control element 5 with the long piece aftertreatment of three DCT-IV operation results of described long piece, described long piece aftertreatment converts three DCT-IV operation results of described long piece to 18 DCT-IV operation results, and described 18 DCT-IV operation results are carried out the IMDCT aftertreatment, described IMDCT aftertreatment is the output of 18 DCT-IV operation results conversion growth piece IMDCT operation results.
Wherein, that describes in the same above coding/decoding method of the formula of the pre-treatment of executive chairman's piece, long piece aftertreatment, IMDCT aftertreatment time institute foundation is identical, repeats no more herein.
3, when said system is used for encoding and decoding.Arithmetic element 6 all converts MDCT computing and IMDCT computing to discrete cosine transform four type DCT-IV computings under the control of Operations Analysis 4 and logic control element 5.
Under the control of Operations Analysis 4 and logic control element 5,6 pairs of digital signals of arithmetic element are done pre-treatment, and described pre-treatment all converts MDCT computing and IMDCT computing to discrete cosine transform four type DCT-IV computings; Digital signal after 6 pairs of pre-treatments of arithmetic element is carried out the DCT-IV computing, when described digital signal is short block, carries out a DCT-IV computing, when described digital signal is long piece, carries out three DCT-IV computings; Arithmetic element 6 is carried out aftertreatment to the result of described DCT-IV computing again, and when carrying out the MDCT computing, described aftertreatment converts the DCT-IV operation result output of to MDCT operation result; When carrying out the IMDCT computing, described aftertreatment converts the DCT-IV operation result output of to IMDCT operation result.
It need execution MDCT computing still be the IMDCT computing that Operations Analysis 4 also is used to judge current, judges that simultaneously the digital signal that IO interface 3 receives is long piece or short block; When Operations Analysis 4 is judged as current when need carrying out short block MDCT computing, arithmetic element 6 is carried out short block MDCT pre-treatment under the control of Operations Analysis 4 and logic control element 5, described short block MDCT pre-treatment utilizes symmetry the MDCT computing of short block is converted to 6 DCT-IV computing; When Operations Analysis 4 is judged as current when needing executive chairman's piece MDCT computing, arithmetic element 6 is executive chairman's piece MDCT pre-treatment under the control of Operations Analysis 4 and logic control element 5, and described long piece MDCT pre-treatment utilizes symmetry the MDCT computing of long piece is converted to 18 DCT-IV computing; And to the long piece pre-treatment of the data after the described long piece MDCT pre-treatment, described long piece pre-treatment converts 18 DCT-IV computing to 6 DCT-IV computing; When Operations Analysis 4 is judged as current when needing executive chairman's piece IMDCT computing, arithmetic element 6 is carried out long piece IMDCT pre-treatment under the control of Operations Analysis 4 and logic control element 5, described long piece pre-treatment is the IMDCT computing of described digital signal is converted to 6 DCT-IV computing.
What Operations Analysis 4 also was used to judge current execution is MDCT computing or IMDCT computing, judges that simultaneously the digital signal that IO interface 3 receives is long piece or short block; When Operations Analysis 4 be judged as current execution be short block MDCT computing the time, arithmetic element 6 under the control of Operations Analysis 4 and logic control element 5 with short block DCT-IV operation result, i.e. short block MDCT operation result output; When Operations Analysis 4 be judged as current execution be long piece MDCT computing the time, arithmetic element 6 is the aftertreatment of executive chairman's piece under the control of Operations Analysis 4 and logic control element 5, described long piece aftertreatment will long piece three DCT-IV operation results convert 18 DCT-IV operation result to, promptly long piece MDCT operation result output; When Operations Analysis 4 be judged as current execution be long piece IMDCT computing the time, arithmetic element 6 is the aftertreatment of executive chairman's piece under the control of Operations Analysis 4 and logic control element 5, and three DCT-IV operation results that described long piece aftertreatment will long piece convert 18 DCT-IV operation result to; And carry out the IMDCT aftertreatment, described IMDCT aftertreatment converts described DCT-IV operation result the output of to IMDCT operation result at 18; When Operations Analysis 4 be judged as current execution be short block IMDCT computing the time, arithmetic element 6 converts IMDCT operation result output at following short block DCT-IV operation result of the control of Operations Analysis 4 and logic control element 5.
Fig. 9 is the structure principle chart of Operations Analysis 4, Operations Analysis 4 mainly generates subelement 46 by main control state machine 44 and arithmetic element control signal and finishes s operation control work, wherein main control state machine 44 is connected with logic control element 5 among Fig. 4, also with length piece judgment sub-unit 41, encoding and decoding judgment sub-unit 42 (be used for coding separately, when being used to decode separately, this subelement does not need), counter 45 connects, and is used to judge the type of calculating and the state exchange that control is calculated.The arithmetic element control signal generates subelement 46 and is connected with arithmetic element 6 among Fig. 4, also is connected with main control state machine 44, counter 45, is used to generate the s operation control signal.Auxiliary control signal generates subelement 47 and generates some auxiliary control signals, as length block mark and encoding and decoding sign etc.; Length piece judgment sub-unit 41 is used to judge that the digital signal of input is long piece digital signal or short block digital signal; Encoding and decoding judgment sub-unit 42 is used to judge that the digital signal of input is coded digital signal or decoded digital signal; Coefficient generates subelement 43 and is connected with arithmetic element control signal generation subelement 47, is used for generating the access signal of calculating process fixed coefficient.Counter 45 is responsible for counting.The arithmetic element control signal generate signal that subelement 46 generates mainly comprise add/down control signal, take advantage of/take advantage of increase control signal, arithmetic element registers group control signal, RAM (random accessmemory, random access memory) read-write control signal etc.
The major function of Operations Analysis 4 is an access data from RAM, ROM 7, under the effect of s operation control signal, data are sent into registers group 2, and enter arithmetic element 6 and carry out computing, finish behind the related operation again the result is stored among the RAM in the storer 7.
Figure 10 is the structural drawing of logic control element 5, realization flow according to hardware is divided, logic control element 5 is divided into 6 parts, be MDCT pre-treatment logic control circuit 51 (not needing when being used to decode separately), long piece pre-treatment logic control circuit 52, multiplex circuit logic control circuit 53, long piece aftertreatment logic control circuit 54, IMDCT aftertreatment logic control circuit 55 (not needing when being used to encode separately), and state conversion logic 56 between the each several part.51,52,53,54 and 55 unified be connected to Operations Analysis 4 and IO interface 3,56 also is connected to Operations Analysis 4, control the memory access accessing operation of corresponding calculating process, s operation control and and IO interface communication.
Wherein, MDCT pre-treatment control circuit 51 is used for carrying out the MDCT pre-treatment with the coded digital signal of 6 pairs of inputs of Operations Analysis 4 common control and calculation unit.Long piece pre-treatment control circuit 52 is used for the long piece pre-treatment of long piece digital signal with 6 pairs of inputs of Operations Analysis 4 common control and calculation unit.Multiplexing arithmetic element control circuit 53 is used to control the multiplexing logic control to arithmetic element 6, no matter long piece, short block, MDCT still is the IMDCT computing, its most computing is all finished in this part, add some pre-treatments (51,52) and aftertreatment (54,55), just can finish required computing.Long piece aftertreatment control circuit 54 be used for 6 pairs of computings of Operations Analysis 4 common control and calculation unit after the long piece aftertreatment of long piece digital signal.IMDCT aftertreatment control circuit 55 is used for carrying out the IMDCT aftertreatment with 6 pairs of result of decoding operation of Operations Analysis 4 common control and calculation unit.State conversion logic 56 is used for controlling the state exchange of calculating process between each nonidentity operation stage, as the conversion between beginning, intermediate treatment, end and each state of computing.
Figure 11 is the structural drawing of arithmetic element 6, and arithmetic element 6 is mainly finished plus-minus method and the multiplying in the whole calculating process.Comprise RAM 601, be used to store the digital signal for the treatment of the encoding and decoding computing and the intermediate operations result of input; ROM 602, are used to store operation coefficient; First register 603, its input end is connected with described RAM; Second register 604, its input end is connected with ROM602; Multiplier 605, two input end are connected with the output terminal of first register 603 and the output terminal of second register 604 respectively; The 3rd register 606, its input end is connected with the output terminal of multiplier 605; First selector 607, its first data input pin is connected with the output terminal of first register 603; Second selector 608, its first data input pin is connected with the output terminal of first register 603, and second data input pin is connected with the output terminal of the 3rd register 606; Add/subtracter 609, two input end is connected with the output terminal of first selector 607 and the output terminal of second selector 608 respectively; The 4th register 610, its input end with add/output terminal of subtracter 609 is connected, its output terminal is connected with second data input pin of first selector 607; Address control unit 611, it is connected with ROM 602 with RAM 601, is used to generate the address of access data; Register selected cell 612, it is connected with first register 603, second register 604, the 3rd register 606, the 4th register 610 and registers group 2, is used to select to participate in the register of computing; Multiplier control module 613, it is connected with multiplier 605, is used to control the computing of multiplier 605; Selector switch control module 614, it is connected with second selector 608 with first selector 607, is used for from the data selection suitable data output of two inputs of first selector 607 and second selector 608; Add/subtracter control module 615, its with add/subtracter 610 is connected, be used to control add/computing of subtracter 610.
The principle of work of arithmetic element shown in Figure 11 is described below: the digital signal of input will be stored in RAM 601 before carrying out MDCT or IMDCT.In whole calculating process, RAM 601 also will be used to store intermediate result.The coefficient that needs in the hardware circuit to use all will be stored in coefficients R OM 602.Multiplier 605 is mainly finished the multiplying in the calculating process: the data of reading from RAM 601 will be temporarily stored in first register 603, the coefficient of reading from ROM 602 will be temporarily stored in the register the 2 604, the value of the register the 1 and second register 604 will be admitted to multiplier 605 and carry out multiplying then, and the result of multiplying will be temporarily stored in the 3rd register 606.The output of the 4th register 610 and first register 603 is respectively two inputs of first selector 607, the output of the 3rd register 606 and first register 603 is respectively two inputs of second selector 608, wherein, first register 603 is output as the data of storage among the RAM 601, the 3rd register 606 is output as the operation result of multiplier 605, and the 4th register 610 is output as and adds/operation result of subtracter 609.Like this, add/subtracter 609 just can finish the plus-minus method hybrid operation of following several situations: 1, the addition of data or subtraction among the RAM 601,2 data of coming out from RAM 601 enter first selector 607 and second selector 608 respectively through first register 603, enter then to add/subtracter 609 finishes and adds/subtraction; 2, the multiply accumulating computing, the result of multiplying for the first time will enter by second selector 608 and add/subtracter 609, be temporarily stored in then in the 4th register 610, so that provide the input data for first selector 607.Secondary multiplication result will enter by second selector 608 and add/B of subtracter 609 end, being temporarily stored in result in the 4th register 610 will enter and add/the A end of subtracter 609, the result of both computings will be temporarily stored in the 4th register 610, so that provide the input data for first selector 607.The process of multiply accumulating will finish until multiply accumulating always by top method circulation.The arithmetic operation of the MDCT pre-treatment control circuit 51 among Fig. 6, long piece pre-treatment control circuit 52, multiplexing arithmetic element control circuit 53, long piece aftertreatment control circuit 54 and IMDCT aftertreatment control circuit 5, can be decomposed into memory addressing, register addressing, plus-minus method and multiplying.With multiplexing 6 the DCT-IV computing of arithmetic element is example, formula as follows:
n=0~5
At first read a (k) from RAM, coefficient is read again to registers group in k=0~5 from Rom
The input of multiplier is selected by selecting device then to registers group in n=0~5, k=0~5, and an input of multiplier obtains from the register of storage a (k), and another input is from storage
Register obtain, and then finish a in the multiplier (k) with
Multiplication, last same selection adds, the input of subtracter, is adding, is finishing adding up of multiplication result in the subtracter, until all computings are finished, the storage operation result is in RAM.
Figure 12 is the work synoptic diagram of the MDCT pre-treatment control circuit 51 in the logic control element, and wherein, X0-X35 represents input signal, a0---a17 represents through the output result after MDCT pre-treatment control circuit 51 and the arithmetic element 6.With first is example, at first from RAM 601, take out the 28th input data and the 25th input data, deliver to selector switch 607 and selector switch 608 respectively, enter then add/A, the B of subtracter 609 end finishes and adds/subtraction, at last operation result is left among the RAM 601.Also can executive chairman's short block determining step S804 after computing finishes, to determine next step computing.
Figure 13,14 and 15 is synoptic diagram of long piece pre-treatment step S805, the input data am of A (n), B (n) and C (n)
k, bm
kAnd cm
kThe pre-treatment difference, need to handle respectively.Am
kCalculating as shown in figure 13, bm
kCalculating as shown in figure 14, cm
kCalculating as shown in figure 15.Long piece pre-treatment step need carry out plus-minus method and multiplication/multiply accumulating computing to the input data, and need store corresponding multiplication coefficient at ROM.Earlier read a (k) from RAM during processing, multiplication/multiply accumulating and plus and minus calculation are carried out these data with from the corresponding coefficient that ROM obtains then in k=0~17 in registers group, at last the am as a result that obtains
k, k=0,1...5, bm
k, k=0,1...5 and cm
kK=0,1...5 deposits back among the RAM and goes.This part comprises operation registers, produces the input selection control and the output control logic of the read-write logic of RAM and ROM, generation adder-subtractor and multiplier.
The hardware realization flow figure of arithmetic element 6 is as shown in figure 16:
Step S1601: flow process begins;
Step S1602: the address that generates the input data;
Step S1603: the input Data Loading is advanced registers group;
Step S1604: carry out corresponding multiplication, signed magnitude arithmetic(al) according to steering logic;
Step S1605: intermediate result is also deposited in registers group;
Step S1606: judge to calculate whether finish, short block only need enter multiplexing its main operational unit and calculate once, long piece then needs cycle calculations 3 times;
Step S1607: output results to RAM;
Step S1608: its main operational finishes.
Long piece post processing operations as shown in figure 17, the operation result of 3 groups 6 DCT-IV is converted into the operation result of 18 DCT-IV, be the described computing of formula (10), computing is fairly simple, only needs simple signed magnitude arithmetic(al) and regenerate memory address to get final product.
The available Figure 18 A of the operation of IMDCT aftertreatment and Figure 18 B describe: promptly carry out the IMDCT aftertreatment if desired, can be with after passing through multiplexing its main operational element circuit step or long piece post-processing step, the value that is kept among the RAM is divided into 2 parts, represents with A, the B shown in Figure 18 A respectively, carry out the IMDCT aftertreatment after, output data quantitatively is 2 times before the output, it is B in proper order ,-B ,-A,-A is shown in Figure 18 B.
In the embodiment of the invention, by will long piece MDCT, short block MDCT, long piece IMDCT, short block IMDCT all be converted to 6 DCT-IV type computing, thereby can realize that MDCT and IMDCT, long piece and short block can shared main arithmetic elements, and this unit is simple in structure, and circuit can be highly multiplexing, saved circuit area, the multiplying amount only is 114 during long piece, short block multiplication amount is 36 only, has reduced operand, has reduced power consumption.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.