Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
A kind of code-transferring method that the embodiment of the invention provides thes contents are as follows: the self-adapting code book gain g that obtains the current subframe in the end code stream of sourcepScale factor γ with fixed codebook gainGcAccording to zoom factor α, to γGcCarry out convergent-divergent and handle, obtain α * γGcAccording to the quantification criterion of destination end, to α * γGcAnd gpQuantize, realize transcoding.By introducing zoom factor to fixed codebook gain scale factor γGcAfter carrying out convergent-divergent, adopt new quantification criterion in the gain code table of subject encoder, to search for again, finish the transcoding of gain parameter, thereby reduce the computation complexity of gain parameter transcoding effectively, improve the quality of transcoding voice.The method of the transcoding that provides at the embodiment of the invention is elaborated below, sees following each embodiment for details.
Embodiment 1
Referring to Fig. 2, the embodiment of the invention provides a kind of code-transferring method, and the system chart that provides with Fig. 1 is that example describes, and detailed content is as follows:
101: the self-adapting code book gain g of the current subframe in the code stream that the obtaining communication device A sends overpScale factor γ with fixed codebook gainGc, concrete grammar is as follows:
At first, source demoder received communication device A transmitted stream is also decoded, and from the demoder code stream of source, gain index information is decoded, utilize the gain quantization code table of the gain index information searching source encoder that decoding obtains again, get access to the self-adapting code book gain g of current subframepScale factor γ with fixed codebook gainGc
The scale factor γ of the fixed codebook gain that wherein, relates in this step
Gc=g
c/ g '
c, wherein, g
cBe the current subframe fixed codebook gain value that coding is tried to achieve, g '
cThe current subframe fixed codebook gain value that obtains for prediction, wherein,
In this formula
Be the prediction term that obtains by prediction algorithm to current subframe gain; E
IBe the total energy term of current subframe fixed code book; E is the average energy quantifier (wherein, different CELP voice coding standard correspondence is different) of current subframe fixed code book.
102: utilize zoom factor α, to γGcCarry out convergent-divergent and handle, obtain α * γGc
Wherein, α * γGcScale factor for the fixed codebook gain of target communication device B correspondence; Above-mentioned, α is γGcZoom factor, before gain parameter is carried out transcoding, with the scale factor γ of fixed codebook gainGcThe purpose that adopts zoom factor α to carry out convergent-divergent is in order to remedy different (they specifically being because the average energy quantifier difference of current subframe fixed code book separately) of source end (communication facilities A) voice coding standard and destination end (communication facilities B) voice coding standard, and the influence of the amplitude distortion of the transcoding voice that cause.
103: according to quantizing criterion, to α * γGcAnd gpCarry out quantification treatment, realize transcoding gain parameter.
Wherein, according in the subject encoder to self-adapting code book gain gpWith fixed code book scale factor γGcQuantization method, when adopting new quantification criterion in the gain code table of subject encoder, to search for again, because different voice coding standard is to self-adapting code book gain gpWith fixed code book scale factor γGcWhen quantizing, can there be different quantification demands, for example, for the voice coding standard of G..729a pattern, need be to gpAnd γGcThe associating quantification, and for the voice coding standard of AMR7.95kbit/s pattern, then need gpAnd γGcCarry out independent quantification, so, correspondingly, carrying out gpAnd γGcQuantification the time, can be in the following way:
(1) self-adapting code book gain g in subject encoderpWith fixed code book scale factor γGcWhen quantizing, adopt the following quantification criterion of uniting for uniting:
Wherein, β is gp(size of β is according to g for weight factorpAnd γGcThe scope of value is selected, and the β value is 1 usually), g in the following formulapAnd γGcBe respectively the self-adapting code book gain of the current subframe that source end demoder obtains and the scale factor of fixed codebook gain; gpkAnd γGckK code word when vector quantization is carried out in gain in the code table for the scrambler of destination end; N is the size of code table in the subject encoder, satisfies following formula and makes E value minimum by searching the gain code table of subject encoder, obtaining, and promptly satisfies near α * γ simultaneouslyGc, gpK code word γGckAnd gpkThereby, realize the quantification of gain parameter.
(2) self-adapting code book gain g in subject encoderpWith fixed code book scale factor γGcFor carrying out independence when quantizing, adopts following independent quantification criterion:
Wherein, γ
GcIt is the scale factor of the fixed codebook gain of the current subframe that obtains of source end demoder;
Then the fixed code book scale factor is carried out k in the vector quantization code table for the target code end
1Individual code word; N
1For quantizing the size of fixed code book scale factor code table in the subject encoder; α is γ
GcZoom factor; g
pIt is the self-adapting code book gain of the current subframe that obtains of source end demoder;
Then be the k that quantizes in the subject encoder in the self-adapting code book gain code table
2Individual code word; N
2For quantizing the size of self-adapting code book gain code table in the subject encoder.
Further, when carrying out self-adapting code book gain gpWith fixed code book scale factor γGcDuring independent the quantification, can also use following absolute quantification criterion according to the real needs of trans-coding system:
Wherein, the concrete implication of each parameter of above-mentioned formula is the same, repeats no more.
To sum up, successfully realized the transcoding of the gain parameter in the transcoding process that different token sounds is carried out, reduced the computation complexity of gain parameter transcoding, improved the quality of transcoding voice by above-mentionedsteps 101 to 103.
Below, specifically how to determine that at above-mentioned zoom factor α is described in detail, usually when definite this zoom factor α, the data of training can obtain (so difference is all calculated α in each sequence by adopting the large sample statistics to obtain or each sequence being calculated the dual mode that obtains, still large sample statistics α is as the fixedly α value of each sequence), two kinds of method steps are identical, and referring to Fig. 3, the concrete steps of definite zoom factor α that the embodiment of the invention provides the contents are as follows:
201, according to the average energy E2 of the fixed code book of the average energy E1 of the fixed code book of source end voice coding standard and destination end voice coding standard, determine the objective ideal value α of zoom factor αL
For example, adopt computing formula,E1 ≠ E2, as mentioned before, the average energy of the fixed code book of different CELP standard correspondences is inequality.
202, according to αLDetermine the span [a1, a2] of zoom factor α, wherein, when determining this span, can choose, for example, work as α according to system's needsLValue is 1.6 o'clock, can select this span to be [1.5,2], can also select this span to be [1,2], and the embodiment of the invention is not limited in concrete mode and the method that is adopted when determining this span.
203, select suitable quantification criterion according to the quantization method to gain parameter in the subject encoder, according to determined quantification criterion, get access to the α in the span of determined α according to default selective rule, each α that obtains is carried out gain parameter transcoding training experiment, test obtains MOS-LQO ((the Mean Opinion Score-ListeningQuality Objective of the synthetic speech of each α, objective voice quality average score), wherein, this mark has been represented the quality of synthetic speech, and the quality of the high more corresponding synthetic speech of mark is high more; And calculate the average segmentation energy of synthetic speech of each α and the average segmentation energy of raw tone;
For example, default selective rule be to serve as that the interval obtains element in the span [a1, a2] of zoom factor α with 0.05, and each the element α that gets access to is carried out gain parameter transcoding training experiment.
204, divide and the average segmentation energy of synthetic speech and the degree of closeness of the average segmentation energy of raw tone by MOS-LQO according to the synthetic speech of each α, select the α value of optimum, and this α value that will select is as fixed codebook gain scale factor γGcValues of zoom factor.Wherein, different zoom factor α can produce different synthetic speechs, can formulate according to the concrete needs of system and select the rule of optimum α value as zoom factor α, and the embodiment of the invention does not limit the formulation mode and the content of this concrete rule.
Referring to Fig. 4, the embodiment of the invention provides a kind of gain parameter conversion block diagram, wherein, only need obtain self-adapting code book gain gpScale factor γ with fixed code bookGc, adopt γGcCarrying out transcoding trains the zoom factor α that obtains to γGcCarried out after convergent-divergent handles, only need to after handling to α * γGcAnd gpCarry out quantification treatment, thereby realized transcoding, reduced the computation complexity of gain parameter transcoding, improved the quality of transcoding voice gain parameter.
For the method for the transcoding that further embodiment of the invention provided describes, set forth with a concrete example below, wherein, the source end is for adopting the communication facilities A of the AMR 7.95kbit/s pattern in the CELP standard, destination end is for adopting the communication facilities B of the G..729a pattern in the CELP standard, when communication facilities A desire realizes communicating by letter with communication facilities B, because it is operated under the different voice coding standards, in order to realize its communication, need be by AMR 7.95kbit/s pattern to G, the transcoding of 729a pattern, this transcoding process are finished by the intermediate equipment C of the communication link that is arranged in communication facilities A and communication facilities B usually:
(1) when carrying out linear spectral LSP parameter transcoding, adopt the method for interpolation, as shown in the formula:
Wherein, ΩkAMRLSP parameter vector for AMR k frame; ΩK-1AMRLSP parameter vector for AMR k-1 frame; Ω2k-1729aBe G, the LSP parameter vector of 729a 2k-1 frame; Ω2k729aBe G, the LSP parameter vector of 729a 2k frame.
(2) when carrying out integer and mark pitch delay parameter transcoding, directly basis of integer value and the mark pitch value with each subframe of AMR passes to G.729a each subframe.Other need judge that whether the fundamental tone of AMR even number subframe surpasses fundamental tone scope G.729a, if exceed, then gets the up-and-down boundary of fundamental tone scope G.729a.
(3) when carrying out fixed code book (being algebraic-codebook) symbol, location parameter transcoding, need carry out earlier being passed to G.729a each subframe again behind the gray code decoder after AMR decodes algebraic-codebook information, G.729a the pulse position that transmission is obtained carries out writing code stream behind the recompile.
(4) when carrying out the gain parameter transcoding, adopt the mode of large sample statistics, be that training data is selected from NTT (NipponTelegraph and Telephone Corporation, NTT Co., Ltd.) Chinese speech in the database: each 4 people of men and women speaker, 8 seconds voice of each speaker 12 segment length, voice length is 768 seconds altogether.Wherein, the average energy of used fixed code book is 36dB under the AMR7.95kbit/s pattern, and the average energy of used fixed code book is 30dB in G.729a.Weight factor β is defaulted as 1.
At first, determine the objective ideal value α of zoom factor αLAs follows:
Secondly, according to α
LDetermine the subjective span of zoom factor α, because
So zoom factor α ∈ [1,2].Wherein,
Expression with the radix point among the digital W after second round up to obtain having only one fractional value behind the radix point.
Once more,, select each α in this scope according to preset rules according to the subjective span of zoom factor α, each α that obtains is carried out gain parameter transcoding training experiment after, obtain the value of optimum α, for example, α=1.3.
At last, owing to G.729a in the pattern quantification is united in self-adapting code book gain and fixed code book scale factor, select the associating quantizing rule, thereby successfully realized the gain parameter transcoding.Wherein, it is as follows with reference to formula to unite quantification:
Wherein, gpAnd γGcBe the self-adapting code book gain of the current subframe that decoding obtains in the AMR7.95kbit/s code stream and the scale factor of fixed codebook gain; gpkAnd γGckThen be k code word in code table when G.729a coding side carries out vector quantization to gain; In coding G.729a is 128 for the used code table size of gain quantization, so N gets 128, satisfies following formula and makes E value minimum by searching the gain code table of subject encoder, obtaining, and promptly satisfies near α * γ simultaneouslyGc, gpThe γ of k code wordGckAnd gpkThereby, realized quantification.
The code-transferring method that the inventor adopts the embodiment of the invention to provide, by 480 language material objective examinations are tested, obtain following result: at AMR7.95 when G.729a carrying out transcoding, the average MOS-LQO of the synthetic speech that use DTE method obtains must be divided into 3.343035417, and the average MOS-LQO of the synthetic speech that the code-transferring method that utilizes the embodiment of the invention to provide obtains must be divided into 3.51400625, as can be seen, the code-transferring method that the embodiment of the invention provides not only can reduce the computation complexity of gain parameter transcoding, can also improve the quality of transcoding voice greatly.
In sum, the embodiment of the invention provides a kind of code-transferring method, by introducing zoom factor to fixed codebook gain scale factor γGcCarry out carrying out transcoding according to determined quantization error criterion behind the convergent-divergent, thereby reduce the computation complexity of gain parameter transcoding greatly, can also improve the quality of transcoding voice greatly, the code-transferring method that the embodiment of the invention provides is applicable to any situation based on the code book gain parameter transcoding between the different CELP speech coding algorithms of prediction of gain vector quantization.
Embodiment 2
The embodiment of the invention provides a kind of code-transferring method, utilizes the mode of setting up the mapping code table, reduces the operation of the re-quantization of gain parameter transcoding part, further reduces the computation complexity of gain parameter part, and method thes contents are as follows:
At first, shine upon according to the zoom factor α value of determining and selected quantification criterion code table gain quantization in the code table of gain quantization in the source encoder and the subject encoder.
Wherein, when definite zoom factor α value, definite method that can similarly adopt embodiment 1 to provide, present embodiment still is defaulted as 1 with the β value and describes.
Wherein, when the gain quantization code table shines upon in gain quantization code table and the subject encoder in the source encoder, can adopt following mapping method:
Wherein, in the following formula
Gain index for source encoder; Q
s-1For source encoder gain inverse quantization is handled; Q
gFor after the gain information that decoding is obtained according to the zoom factor α that determines carries out convergent-divergent, carry out quantification treatment again according to the quantification criterion in the selected subject encoder;
For carrying out the gain index value behind the re-quantization in the subject encoder.
Then, the index value that obtains after code words all in the source encoder handled by above-mentioned mapping is preserved, and for example, sets up the mapping code table, preserves with the form of form.
At last, when carrying out the gain parameter transcoding, can realize transcoding to gain parameter by directly looking into above-mentioned mapping code table.
Referring to Fig. 5, the embodiment of the invention provides a kind of gain parameter transcoding block diagram, receive the code stream of source encoder after, solve self-adapting code book gain and scale factor after, thereby successfully realized transcoding by searching default mapping code table to gain parameter.
Referring to Fig. 6, the embodiment of the invention provides another block diagram of gain parameter transcoding, further, those skilled in the art can also be known, the thought that code table is shone upon in the introducing of adopting present embodiment to provide, can also for, at first the gain code stream of source encoder is provided with the corresponding mapping code table of bit stream with the gain code stream of subject encoder according to the values of zoom factor of determining and selected quantification criterion, then, when carrying out transcoding, directly to the source encoder transmitted stream according to the mapping of tabling look-up of this mapping code table, referring to table 1, a kind of mapping code table is provided, as shown in table 1, when the gain code stream of source encoder is 100101, look into this table and can obtain under the situation of α=1.4, the subject encoder gain code stream of 100101 correspondences is 100011, has so just successfully realized the transcoding to gain parameter.
Table 1
| α | Source encoder gain code stream | Subject encoder gain code stream |
| 1.4 | 100101 | 100011 |
| 2.0 | 100101 | 100100 |
| ...... | ...... | ...... |
The code-transferring method that the embodiment of the invention provides, by searching default mapping code table, omit the re-quantization operation in the gain parameter transcoding algorithm, can realize under the prerequisite that the transcoding voice quality improves the computation complexity when reducing the gain parameter transcoding further.
Embodiment 3
Referring to Fig. 7, the embodiment of the invention provides a kind of transcoding device, and this device comprises:
Acquisition module is used for obtaining the self-adapting code book gain g of the current subframe of source end code streampScale factor γ with fixed codebook gainGc
Zoom module is used for the γ that acquisition module is got access to according to zoom factor αGcCarry out convergent-divergent and handle, obtain α * γGc
Quantization modules is used for the quantification criterion according to destination end, to α * γGcAnd gpQuantize, realize transcoding.
Wherein, in order to determine above-mentioned zoom factor α, device also comprises:
Zoom factor α acquisition module is used to obtain zoom factor α;
Wherein, above-mentioned zoom factor α acquisition module specifically comprises:
First acquiring unit is used for the average energy according to the fixed code book of source end and destination end, determines the objective ideal value α of zoom factor αL
Second acquisition unit is used for the α that obtains according to first acquiring unitL, determine the span of zoom factor α;
The 3rd acquiring unit is used for obtaining the test number that is used to test according to default selective rule from the span that second acquisition unit obtains; Test number is at least one;
The 4th acquiring unit is used for getting access to zoom factor α according to default test order from the test number that the 3rd acquiring unit obtains.
Wherein, above-mentioned the 3rd acquiring unit specifically is used for according to default interval, and the numerical value in the span that second acquisition unit is obtained is sampled, and obtains the test number that is used to test;
The 4th acquiring unit specifically is used to obtain objective voice quality average score, the average segmentation energy of synthetic speech and the average segmentation energy of raw tone of the synthetic speech of test number; Average segmentation energy of objective voice quality average score, synthetic speech and the average segmentation energy of raw tone according to synthetic speech obtain zoom factor α from test number.
Since in the different CELP voice coding standards to self-adapting code book gain gpScale factor γ with fixed codebook gainGcCan adopt different quantization methods when quantizing, as unite quantification, independent quantification etc., correspondingly, the embodiment of the invention provides the quantization modules in the transcoding device, is specifically as follows:
(1) when destination end to the self-adapting code book g that gainspScale factor γ with fixed codebook gainGcUnite when quantizing;
The embodiment of the invention provides the transcoding device also to comprise:
Weight factor β acquisition module is used for according to self-adapting code book gain gpScale factor γ with fixed codebook gainGc, determine weight factor β.
Correspondingly,
Quantization modules is specially quantifying unit, is used for according to the gain vector code table that obtains destination end, to α * γGcAnd gpThe quantization code word in the gain vector code table is obtained in the associating quantification, realizes the transcoding of gain parameter, wherein, unites when quantizing, and quantizing rule is:
(2), when destination end to the self-adapting code book g that gainspScale factor γ with fixed codebook gainGcWhen carrying out the independence quantification;
Quantization modules is specially quantifying unit, is used for according to destination end fixed code book scale factor code table and self-adapting code book gain code table, respectively to α * γGcAnd gpQuantize, obtain the quantification self-adaptation code word in quantification fixed codeword in the quantization scaling factor code table and the self-adapting code book gain code table, realize the transcoding of gain parameter, wherein, quantizing rule is:
Further, can also be according to the concrete needs of transcoding, above-mentioned quantization modules is specially absolute quantifying unit, is used for according to destination end fixed code book scale factor code table and self-adapting code book gain code table, respectively to α * γGcAnd gpDefinitely quantize, obtain the quantification self-adaptation code word in quantification fixed codeword in the quantization scaling factor code table and the self-adapting code book gain code table, realize the transcoding of gain parameter, wherein, absolute quantizing rule is:
In order to reduce the operation of gain parameter transcoding re-quantization partly, further reduce the computation complexity of gain parameter part, referring to Fig. 8, the transcoding device that the embodiment of the invention provides can also comprise:
Mapping code table generation module is used for according to zoom factor α and weight factor β, gain quantization code table in source end gain quantization code table and the subject encoder is shone upon obtain shining upon code table;
Processing module is used for the self-adapting code book gain g according to the current subframe of the source end code stream that obtainspScale factor γ with fixed codebook gainGc, search the mapping code table, realize transcoding.
Wherein, mapping code table generation module specifically comprises:
First processing unit according to the gain index of source end scrambler, is handled the gain index inverse quantization of source end scrambler;
Second processing unit is used for according to zoom factor α, and convergent-divergent is carried out in the gain that obtains after the first processing unit inverse quantization is handled;
The 3rd processing unit is used for the quantizing rule according to destination end, quantizes the gain behind the second processing unit convergent-divergent;
The manages the unit everywhere, is used to obtain the gain index value after the 3rd processing unit quantizes, and the gain index value after the quantification forms the mapping code table.
Those skilled in the art can also be known, the thought that code table is shone upon in the introducing of in like manner adopting above-mentioned present embodiment to provide, and the transcoding device that the embodiment of the invention provides can also comprise:
Mapping code table generation module is used for according to zoom factor α and weight factor β, and the quantizing rule of destination end, and the code stream of source end scrambler and the code stream of destination end scrambler are shone upon, and obtains shining upon code table;
Processing module is used to obtain the code stream of source end, searches the mapping code table, realizes transcoding.
In sum, the transcoding device that the embodiment of the invention provides is by introducing zoom factor to fixed codebook gain scale factor γGcAfter carrying out convergent-divergent, adopt new quantification criterion in the gain code table of subject encoder, to search for again, finish the transcoding of gain parameter, thereby reduce the computation complexity of gain parameter transcoding effectively, improve the quality of transcoding voice.
Part steps in the embodiment of the invention can utilize software to realize that corresponding software programs can be stored in the storage medium that can read, as CD or hard disk etc.
The above only is specific embodiments of the invention;, for those skilled in the art, not all under the prerequisite that does not break away from the principle of the invention in order to restriction the present invention; any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.