Vector quantization
10665247 ยท 2020-05-26
Assignee
Inventors
Cpc classification
G10L25/93
PHYSICS
G10L19/22
PHYSICS
International classification
G10L19/00
PHYSICS
G10L19/22
PHYSICS
H03M7/30
ELECTRICITY
Abstract
It is inter alia disclosed to determine a first quantized representation of an input vector, and to determine a second quantized representation of the input vector based on a codebook depending on the first quantized representation.
Claims
1. A method performed by an apparatus comprising a codec, said method comprising: quantizing an input vector using a first quantization stage resulting in a residual vector, wherein the first quantization stage comprises a codebook having a plurality of codevectors, and wherein the quantized input vector is represented as a codevector index; splitting a plurality of vector components of the residual vector into said at least two groups of vector components; swapping a vector component of a first group of the at least two groups of vector components for a vector component of a second group of the at least two groups of vector components until each group of the at least two groups of vector components fulfils a rule; and quantizing at least one of the at least two groups of vector components with a second quantization stage comprising a plurality of lattice structures, wherein a lattice structure used for the quantization of the at least one of the at least two groups of vector components is selected from the plurality of lattice structures based on the codevector index from the first quantization stage.
2. The method according to claim 1, wherein said rule is one of: a rule based on energy values associated with the vector components; and a rule based on a predefined norm associated with the vector components.
3. The method according to claim 2, wherein said rule specifies that the vector components of each of the at least two groups of vector components must fulfil a predefined energy characteristic.
4. The method according to claim 3, wherein said rule specifies that an energy value associated with a respective vector component of each vector component of the first group of the at least two groups of vector components is higher than an energy value associated with a respective vector component of each vector component of each group of the remaining groups of the at least two groups of vector components.
5. The method according to claim 1, wherein the at least two groups of vector components represent n groups of vector components g.sub.x with x{1, 2, . . . n} with n2, wherein an xth group g.sub.x of the at least two groups of vector components comprises l.sub.x vector coefficients of a plurality of vector coefficients of a first quantized representation of the input vector, and wherein said rule specifies that the l.sub.x vector coefficients of the xth group g.sub.x represent the
6. The method according to claim 1, further comprising determining information being configured to determine the input vector comprising the plurality of vector components based on the at least two groups of vector components.
7. An apparatus comprising a codec, the apparatus further comprising at least one processor; and at least one memory including computer program code, said at least one memory and said computer program code configured to, with said at least one processor, cause said apparatus at least to: quantize an input vector using a first quantization stage resulting in a residual vector, wherein the first quantization stage comprises a codebook having a plurality of codevectors, and wherein the quantized input vector is represented as a codevector index; split a plurality of vector components of the residual vector into said at least two groups of vector components; swap a vector component of a first group of the at least two groups of vector components for a vector component of a second group of the at least two groups of vector components until each group of the at least two groups of vector components fulfils a rule; and quantize at least one of the at least two groups of vector components with a second quantization stage comprising a plurality of lattice structures, wherein a lattice structure used for the quantization of the at least one of the at least two groups of vector components is selected from the plurality of lattice structures based on the codevector index from the first quantization stage.
8. The apparatus according to claim 7, wherein said rule is one of: a rule based on energy values associated with the vector components; and a rule based on a predefined norm associated with the vector components.
9. The apparatus according to claim 8, wherein said rule specifies that the vector components of each of the at least two groups of vector components must fulfil a predefined energy characteristic.
10. The apparatus according to claim 9, wherein said rule specifies that an energy value associated with a respective vector component of each vector component of the first group of the at least two groups of vector components is higher than an energy value associated with a respective vector component of each vector component of each group of the remaining groups of the at least two groups of vector components.
11. The apparatus according to claim 7, wherein the at least two groups of vector components represent n groups of vector components g.sub.x with x{1, 2, . . . n} with n2, wherein an xth group g.sub.x of the at least two groups of vector components comprises l.sub.x vector coefficients of a plurality of vector coefficients of a first quantized representation of the input vector, and wherein said rule specifies that the l.sub.x vector coefficients of the xth group g.sub.x represent the
12. The apparatus according to claim 7, wherein said at least one memory and said computer program code are further configured to, with said at least one processor, further cause said apparatus to determine information being configured to determine the input vector comprising the plurality of vector components based on the at least two groups of vector components.
Description
BRIEF DESCRIPTION OF THE FIGURES
(1) In the figures show:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION
(13)
(14) Apparatus 1 may for instance be configured to determine a first quantized representation of an input vector, and to determine a second quantized representation of the input vector based on a codebook depending on the first quantized representation in accordance with a first aspect of the invention.
(15) Alternatively, or, additionally, apparatus 1 may for instance be configured to determine a first quantized representation of an input vector, the first quantized representation comprising a plurality of vector components, to group said plurality of vector components into at least two groups of vector components in accordance with a rule based on energy values associated with the vector components, wherein each group of the at least two groups of vector components comprises at least one vector component of the plurality of vector components, and to determine, for at least one of the at least two groups of vector components, a quantized representation of the respective group of vector components based on a codebook in accordance with a third aspect of the invention.
(16) Apparatus 1 may for instance be embodied as a module. Non-limiting examples of apparatus 1 are a mobile phone, a personal digital assistant, a portable multimedia (audio and/or video) player, and a computer (e.g. a laptop or desktop computer).
(17) Apparatus 1 comprises a processor 10, which may for instance be embodied as a microprocessor, Digital Signal Processor (DSP) or Application Specific Integrated Circuit (ASIC), to name but a few non-limiting examples. Processor 10 executes a program code stored in program memory 11, and uses main memory 12 as a working memory, for instance to at least temporarily store intermediate results, but also to store for instance pre-defined and/or pre-computed databases. Some or all of memories 11 and 12 may also be included into processor 10. Memories 11 and/or 12 may for instance be embodied as Read-Only Memory (ROM), Random Access Memory (RAM), to name but a few non-limiting examples. One of or both of memories 11 and 12 may be fixedly connected to processor 10 or removable from processor 10, for instance in the form of a memory card or stick.
(18) Processor 10 further controls an input/output (I/O) interface 13, via which processor receives or provides information to other functional units.
(19) As will be described below, processor 10 is at least capable to execute program code for providing the first and/or second and/or third and/or fourth aspect of the invention. However, processor 10 may of course possess further capabilities. For instance, processor 10 may be capable of at least one of speech, audio and video encoding, for instance based on sampled input values. Processor 10 may additionally or alternatively be capable of controlling operation of a portable communication and/or multimedia device.
(20) Apparatus 1 of
(21) The circuitry formed by the components of apparatus 1 may be implemented in hardware alone, partially in hardware and in software, or in software only, as further described at the end of this specification.
(22)
(23)
(24) In a step 210, a first quantized representation of an input vector is determined. For instance, said first quantized representation may represent a quantized vector of the input vector. As an example, this quantized vector may comprise a plurality of bits, but any other well-suited quantized representation of the input vector may be used for the first quantized representation.
(25) As a non-limiting example, the input vector may represent a vector comprising Line Spectral Frequencies (LSF) of an input signal, wherein this input signal may represent at least a part audio signal, e.g. a part of a voice signal or a part of a non-voice signal, wherein this audio signal may comprise voiced and/or unvoiced and/or generic and/or transition and/or CNG parts. For instance, the input signal to be quantized may represent residual data of an audio signal to be encoded, e.g. a residual of a Line Spectral Frequency (LSF) vector.
(26) As an example, the first quantized representation may be determined by means of a first quantization stage being performed based on a plurality of codevectors. This plurality of codevectors of the first quantization stage may represent a first stage codebook.
(27) For instance, the first quantized representation may represent the codevector selected from the plurality of codevectors for quantizing the input vector. As another example, the first quantized representation may represent an identifier of the selected codevector, wherein this identifier may represent a codevector index. Thus, for instance, if the first quantized representation may comprise n bits, the first stage codebook may comprise a maximum of 2.sup.n codevectors.
(28) In a step 220, a second quantized representation of the input vector is determined based on a codebook depending on the first quantized representation.
(29) For instance, it may be assumed that this second quantized representation is performed by means of a second quantization stage. This second quantization stage may perform a quantization based on a plurality of codebooks, wherein each of this plurality of codebooks comprises at least one codevector.
(30) The codebook used for the quantization of the input vector in the second stage depends on the first quantized representation. Thus, as an example, the codebook used in the second stage may be selected from the plurality of codebooks of the second stage based on the first quantized representation of the input vector.
(31) For instance, there may be defined a mapping between a codevector of the plurality of codevectors of the first stage and a codebook of the plurality of codebooks of the second stage. Accordingly, such a mapping may be defined for each codevector of the plurality of codevectors of the first stage and a respective codebook of the plurality of codebooks of the second stage. Thus, based on the first quantized representation of the input vector, wherein this first quantized representation may represent the codevector selected in the first stage or may represent in indicator of the codevector selected in the first stage, the codebook for performing quantization in the second stage may be selected from the plurality of codebooks of the second stage.
(32) This may show the advantage that specific codebooks may be defined for the second stage, wherein each specific codebook is adapted to the quantization performed in the first stage. Thus, at least one codebook of the plurality of codebooks of the second stage may represent a specific codebook tuned for the particular residual data associated with this codebook to be encoded which may improve the coding efficiency.
(33) For instance, the codebooks of the second stage may represent lattice codebooks.
(34) As an example, the first quantized representation of the input vector may represent a codevector index being indicative of the codevector selected in the first stage. Then, in step 220, a codebook of the plurality of codebooks is selected which is associated with the codevector index of the first quantized representation. For instance, each codevector index of first stage may be associated with a corresponding codebook of the plurality of codebooks of the second stage.
(35) Then, in step 220, based on the selected codebook, a codevector of the selected codebook may be determined, e.g. based on a distortion metric. For instance, the codevector of the selected codebook may be determined for quantizing the input vector having the lowest distortion with respect to the input vector, wherein the distortion is determined based on the distortion metric. As an example, the distortion metric may represent a distance between the codevector and the input vector. For instance, a Hamming distance or an Euclidean distance or any other distance may be used.
(36)
(37) For instance, this method 300 may be used for determining the second quantized representation of the input vector in step 220 of method 200 depicted in
(38) In a step 310, the input vector is normalized based on the first quantized representation. For instance, said normalizing may comprise multiplying the vector components of the input vector with normalization coefficients in order to obtain a normalized representation of the input vector, where the normalization coefficients depend on the first quantized representation of the input vector.
(39) The normalization is performed based on the first quantized representation. For instance, there may be defined a plurality of sets of normalization coefficients, each set of normalization coefficients comprising at least one normalization coefficient to be used for normalizing the input vector, wherein one set of normalization coefficients is selected from the plurality of sets of normalization coefficients based on the first quantized representation of the input vector.
(40) For instance, there may be defined a mapping between a codevector of the plurality of codevectors of the first stage and a set of normalization coefficients of the plurality of sets of normalization coefficients. Accordingly, such a mapping may be defined for each codevector of the plurality of codevectors of the first stage and a respective set of normalization coefficients of the plurality of normalization coefficients. Thus, based on the first quantized representation of the input vector, wherein this first quantized representation may represent the codevector selected in the first stage or may represent in indicator of the codevector selected in the first stage, the set of normalization coefficients for performing normalization of the input vector in step 310 may be selected from the plurality of sets of normalization coefficients.
(41) As an example, if the input vector comprises n vector coefficients, a set of normalization coefficients may comprise n normalization coefficients. Then, normalization of the input vector may be performed by multiplying a vector component of the plurality of vector components of the input vector with an associated normalization coefficient of the selected set of normalization coefficients. This may be performed for each vector component of the input vector, wherein a respective vector component is multiplied with the respective normalization coefficients of the set of normalization coefficients in order to obtain a normalized representation of the input vector.
(42) As an example, the first quantized representation of the input vector may represent a codevector index being indicative of the codevector selected in the first stage. Then, in step 310, a set of normalization coefficients of the plurality of sets of normalization coefficients is selected which is associated with the codevector index of the first quantized representation. For instance, each codevector index of first stage may be associated with a corresponding set of normalization coefficients of the plurality of sets of normalization coefficients.
(43) Then, in a step 320 the second quantized representation of the normalized input vector is determined depending on the first quantized representation. Determining the second quantized representation in step 320 may be performed as described with respect to step 220 in
(44)
(45) For instance, this method 400 may be used for determining the second quantized representation of the input vector in step 220 of method 200 depicted in
(46) In a step 410, a codebook is selected of a plurality of codebooks based on the first quantized representation. For instance, this selection may be performed as explained with respect to the first example embodiment of a method 200.
(47) Each codebook of the plurality of codebooks is defined by an associated set of basis codevectors and an associated at least one scale representative.
(48) Each set of basis codevectors comprises at least one basis codevector. Since each set of basis codevectors is associated with at least one scale representative of a plurality of scale representatives, a codevector can be determined based on a basis codevector of a set of potential basis codevectors and a scale representative of the at least one scale representative associated with the set of potential basis codevectors, i.e. the codevector may be represented based on a basis codevector scaled by the respective scale representative. For instance, the scale representative may represent a scale value, wherein a codevector may be determined based on a multiplication of a basis codevector and the respective scale value.
(49) For instance, at least one set of basis codevectors is associated with at least two scale representatives.
(50) Accordingly, as an example, a codebook may comprise a set of codevectors comprising codevectors based on the plurality of sets of basis codevectors and based on the respective at least one scale value associated with a respective set of basis codevectors of the plurality of basis codevectors. This set of codevectors may comprise, for each basis codevector of each set of basis codevectors and for each of the at least one scale representative associated with a respective set of basis codevectors, a codevector based on the respective basis codevector scaled by the respective scale representative.
(51) For instance, said sets of basis codevectors may represent leader classes, wherein each leader class comprises a different leader vector and permutations of said leader vector. Thus, said leader vector and the permutations of said leader vector may represent the basis codevectors of the respective set of basis codevectors.
(52) The plurality of sets of basis codevectors may represent a subset of a second plurality of sets of basis codevectors. For instance, under the assumption that each set of basis codevectors represents a leader class, the plurality of leader classes may represent a subset of a second plurality of leader classes. Thus, the plurality of leader classes may be considered as a truncated plurality of leaders classes with respect to the second plurality of leader classes.
(53)
(54)
(55) For instance, in case the values b.sub.x,y,t of the basis codevectors b.sub.x,y=[b.sub.x,y,0, b.sub.x,y,1, . . . , b.sub.x,y,n1] represent absolute values, wherein to {0, 1, . . . n1} holds and n represents the length of the respective basis codevector b.sub.x,y, and if the absolute valued input vector is used for determining the potential codevector of a respective set of basis codevectors, the sign of each value b.sub.x,y,t at the (t+1)th position of the determined nearest basis codevector b.sub.x,y may be assigned based on the sign of the respective value i.sub.t at the (t+1)th position of the input vector i, before determining a codevector c.sub.x,z,y based on basis codevector b.sub.x,y and based on a scale representative s.sub.z is performed, as exemplarily depicted in
(56) For instance, the sign of each value b.sub.x,y,t at the (t+1)th position of the determined nearest basis codevector b.sub.x,y may be assigned to the sign of the respective value i.sub.t at the (t+1)th position of the input vector, respectively, wherein this may hold if the parity of the basis codevectors b.sub.x,y of the set of basis codevectors b.sub.x is 0. As another example, if the parity of the basis codevectors b.sub.x,y of the set of basis codevectors b.sub.x is 1, the signs of the values b.sub.x,y,t of the potential basis codevector may be assigned corresponding to the signs of the values of the input vector at the same position in the vector, respectively, and if there are not an odd number of negative components, the value b.sub.x,y,t in the potential basis codevector having the lowest non-null absolute value may change its sign. Or, as another example, if the parity of the basis codevectors b.sub.x,y of the set of basis codevectors b.sub.x is +1, the signs of the values b.sub.x,y,t of the potential basis codevector may be assigned corresponding to the signs of the values of the input vector at the same position in the vector, respectively, and if there are not an even number of negative components, the value b.sub.x,y,t in the potential basis codevector having the lowest non-null absolute value may change its sign
(57) As a non-limiting example, a codevector c.sub.x,z,y may be determined based on a basis codevector by b.sub.x and based on a scale representative s.sub.z by c.sub.x,z,y=[b.sub.x,y,0.Math.s.sub.z, b.sub.x,y,1.Math.s.sub.z, . . . , b.sub.x,y,n1.Math.s.sub.z].
(58) Each of the scale representatives s.sub.z, wherein z{0, 1, . . . S1} holds, is associated with at least one set of basis codevectors. For instance, as a non-limiting example this respective at least one set of basis codevectors may be represented by the set of basis codevectors b.sub.x, with x{0, 1, . . . n.sub.z1}, wherein n.sub.z may represent the number of sets of basis codevectors associated with the respective scale representative s.sub.z, wherein 0<n.sub.z<X holds. Based on this linkage between a respective scale representative s.sub.z and the associated at least one set of basis codevectors b.sub.x, with x{0, 1, . . . n.sub.z1}, the associated at least one set of codevectors c.sub.x,z,y, with x{0, 1, . . . n.sub.z1} and y{0, 1, . . . B.sub.x1} and z{0, 1, . . . S1}, can be determined.
(59) Thus, as an example, a codebook structure of the above mentioned codebook may be defined by the plurality of scale representatives s.sub.z, the plurality of sets of basis codevectors b.sub.x, and the linkage between each scale representative with the associated at least one set of basis codevectors.
(60) Since at least one set of basis codevectors, e.g. at least the set of basis codevectors b.sub.0, is associated with at least two scale representatives, the same set of basis codevectors can be used to construct codevectors of the at least one set of codevectors associated with a first scale representative and to construct codevectors of the at least one set of codevectors associated with at least one further scale representative.
(61) For instance, the codebooks of the plurality of codebooks of step 410 may be defined based on the above-mentioned second plurality of leader classes, wherein each leader class of the second plurality of leader classes is associated with a different leader vector, and wherein a set of basis codevector associated with a respective leader class may be represented by the respective leader vector and permutations of the this leader vector. Then, as an example, each codebook of the plurality of codebooks may be defined by at least one truncation associated with a respective codebook, wherein each truncation of the at least one truncation associated with a respective codebook is associated with at least one leader class of the second plurality of leader classes and with a respective scale representative such that the leader class vector of the respective leader class scaled with respective scale representative and permutations of this scaled leader class vector represent codevectors of the respective truncation of the at least one truncation of the respective codebook.
(62) As a non-limiting example, an example of 16 exemplary leader classes may be defined by:
(63) float p1[ ]={1, 1, 0, 0, 0, 0, 0, 0,
(64) 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
(65) 1, 1, 1, 1, 0, 0, 0, 0,
(66) 2, 0, 0, 0, 0, 0, 0, 0,
(67) 1.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, //5
(68) 1, 1, 1, 1, 1, 1, 0, 0,
(69) 2, 1, 1, 0, 0, 0, 0, 0,
(70) 1.5, 1.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
(71) 1, 1, 1, 1, 1, 1, 1, 1,
(72) 2, 1, 1, 1, 1, 0, 0, 0, //10
(73) 2, 2, 0, 0, 0, 0, 0, 0,
(74) 1.5, 1.5, 1.5, 0.5, 0.5, 0.5, 0.5, 0.5,
(75) 2.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
(76) 2, 1, 1, 1, 1, 1, 1, 0,
(77) 2, 2, 1, 1, 0, 0, 0, 0, //15
(78) 3, 1, 0, 0, 0, 0, 0, 0};
(79) For instance, these 16 leader classes may define the above mentioned second plurality of sets of basis codevectors, wherein a codebook structure may be defined by a plurality of set of basis codevectors representing a subset of said second plurality of sets of basis codevectors.
(80) As an example, a plurality of an example of 16 exemplary codebook structures may be defined as
(81) int no_lead[ ][ ]={
(82) {8, 9, 3, 2, 2, 1},
(83) {10, 9, 3, 2, 2, 0},
(84) {7, 6, 2, 2, 3, 0},
(85) {2, 2, 1,10, 9, 2},
(86) {6, 2, 0, 5, 3, 0},
(87) {13, 3, 0, 2, 2, 0},
(88) {10, 9, 3, 2, 2, 0},
(89) {10, 9, 3, 2, 2, 0},
(90) {10, 9, 3, 2, 2, 0},
(91) {5, 3, 0, 6, 2, 0},
(92) {8, 5, 2, 4, 0, 0},
(93) {10, 9, 3, 2, 2, 0},
(94) {9, 9, 3, 2, 2, 2},
(95) {10, 9, 3, 2, 2, 0},
(96) {11, 9, 3, 2, 2, 0},
(97) {8, 10, 7, 2, 2, 01}};
(98) wherein each vector no_lead[ ][1] (wherein l{0, 1, . . . 16 holds) defines a respective codebook structure comprising a plurality of truncations. For instance, with l=2 the vector no_lead[ ][2]=(10, 9, 3, 2, 2, 0) defines respective codebook structure signifying that the first truncation, i.e., the first union of leader classes, may be composed of the first 8 leader classes, the second one by the first 9 leader classes, the third one by the first 3 leader classes, and so on.
(99) To each truncation of a respective codebook structure a respective scale representation may be assigned (e.g. through training), e.g.:
(100) float scales[ ][16]={
(101) {0.947f, 1.574f, 2.432f, 1.281f, 2.249f, 5.562f}, {0.887f, 1.635f, 2.626f, 1.263f, 2.736f, 0.0f}, {1.005f, 1.683f, 3.539f, 1.071f, 1.895f, 0.0f}, {1.055f, 2.491f, 6.473f, 0.959f, 1.930f, 2.455f,}, {1.195f, 3.650f, 0.0f, 1.225f, 2.172f, 0.0f}, {1.070f, 2.998f, 0.0f, 1.296f, 2.389f, 0.0f}, {0.919f, 1.558f, 3.924f, 1.261f, 2.495f, 0.0f}, {0.918f, 1.557f, 2.240f, 1.256f, 2.439f, 0.0f}, {0.907f, 1.955f, 3.210f, 1.334f, 3.132f, 0.0f}, {1.098f, 1.960f, 0.0f, 1.222f, 3.658f, 0.0f}, {1.082f, 1.913f, 2.942f, 1.436f, 0.0f, 0.0f}, {0.940f, 1.620f, 2.512f, 1.336f, 3.017f, 0.0f}, {0.949f, 1.539f, 2.587f, 1.148f, 2.125f, 5.231f}, {0.945f, 1.954f, 2.468f, 1.275f, 2.635f, 0.0f}, {0.916f, 1.660f, 2.852f, 1.242f, 2.432f, 0.0f}, {0.838f, 1.253f, 2.108f, 1.256f, 2.456f, 0.0f}};
(102) Thus, as an example, an lth codebook of the plurality of codebooks may be defined by the plurality of truncations defined by the respective vector no_lead[ ][1] and the respective vector of scale representations scales[ ][1], wherein each truncation k no_lead[k][1] is scaled with a respective scale representation scales [k][1] associated with this truncation. Thus, a first set of codevectors of a plurality of codevectors of an lth codebook is defined by the first truncation scaled by the respective first scale representation, i.e., under the assumption of l=2 the first scale representation would be 0.887 in the above-mentioned example, a second set of codevectors of the plurality of codevectors lth codebook is defined by the second truncation scaled by the respective second scale representation, i.e., under the assumption of l=2 the second scale representation would be 1.635 in the above-mentioned example, and so on.
(103) For instance, the number of codebooks of the plurality of codebooks may correspond to the number of codevectors of the first stage, wherein each codevector of the first stage is associated with a respective codebook of the second stage. As an example, the first quantized representation of the input vector may represent a codevector index being indicative of the codevector selected in the first stage. Then, in step 310, a corresponding codebook of the plurality of codebooks is selected based on the codevector index. For instance, each codevector index of first stage may be associated with a corresponding codebook of the second stage.
(104) As a non limiting example, the codevector index may be denoted as 1 and the corresponding codebook may be defined by the a respective leader vector no_lead[ ][1[ ] and a respective vector of scale representations scales[ ][1].
(105) Then, at a step 420 a second quantized representation of the input vector is determined based on the selected codebook.
(106) It has to be understood, that this input vector may represent to normalized input vector or the non-normalized input vector.
(107) For instance, said determining a second quantized representation of the input vector may comprise determining
(108) a codevector of the plurality of codevectors of the selected codebook which has a minor or minimum distortion compared to the input vector.
(109) As an example, a distortion metric may be used for determining the distortion of a codevector and the input vector. For instance, said distortion metric may be based on any kind of suitable distance between a codevector and the input vector. As an example, a Hamming distance or an Euclidean distance or any other distance may be used. As an example, the codevector for which the distortion metric is to be calculated must not necessarily determined and the distortion metric may be calculated by inherently considering the respective codevector associated with the selected scale representation and the set of basis codevectors associated with this selected scale representation.
(110) For instance, if c.sub.x,z,y=[c.sub.x,z,y,0, c.sub.x,z,1, . . . , c.sub.x,z,n1] represents the codevector and i=[i.sub.0, i.sub.1, . . . , i.sub.n1] represents the input vector, a distance d may be calculated based on
(111)
(112) As an example, the respective codevector represents an n-dimensional vector comprising codevector values c.sub.0 . . . .sub.n1 and the input vector represents an n-dimensional vector comprising input vector values i.sub.0 . . . i.sub.n1, wherein determining the respective distance d is performed based on calculating d
(113)
(114) This distortion metric (2) may be considered to represent a simplified metric of metric (1) without any loss of quality.
(115) Furthermore, as an example, the distortion metric may be determined based on a weighting function.
(116) For instance, the respective codevector represents an n-dimensional vector comprising codevector values c.sub.0 . . . .sub.n1 and the input vector represents an n-dimensional vector comprising input vector values i.sub.0 . . . i.sub.n1, wherein determining the respective distance d.sub.w is performed based on calculating
(117)
wherein w.sub.k represent weighting factors of the weighting function.
(118) Accordingly, in step 420 a codevector of the plurality of codevectors may be determined based on the applied distortion metric, wherein this determining may for instance comprise calculating the distortion for at least one codevector of the plurality of codevectors, wherein the codevector of the at least one codevector is selected for quantization in step 420 which has the lowest distortion in accordance with the determined distortion metric. For instance, said at least one codevector may represent all codevectors of the plurality of codevectors of the selected codebook or a subset of codevectors of the plurality of codevectors of the selected codebook.
(119)
(120) For instance, this method 400 may be used for dequantizing the input vector quantized by any of the methods of the first aspect of the invention.
(121) At a step 430, a codebook of a plurality of codebooks is selected based on a first quantized representation of a vector. This first quantized representation may represent any of the first quantized representations of the input vector described with respect to the first aspect of the invention. This selection of a codebook may be performed as described with respect to the first aspect of the invention.
(122) For instance, the plurality of codebooks represent the plurality of codebooks used in step 220 depicted in
(123) At a step 440, a second quantized representation of the vector is dequantized based on the selected codebook. This second quantized representation may represent any of the second quantized representations of the input vector described with respect to the first aspect of the invention.
(124) Thus, step 440 performs a reverse quantization of the second stage quantization of the first aspect of the invention in accordance with the selected codebook. Accordingly, all explanations given with respect to the second stage quantization in the first aspect of the invention also hold for the dequantization performed in step 440.
(125) The dequantized second quantized representation of the vector may then correspond to the input vector of the first aspect of the invention.
(126) If a normalization of the input vector has been performed in the first aspect of the invention, method 400 may comprise reversing this normalization by selected a normalization representation based on the first quantized representation.
(127) For instance, said input vector may comprise a plurality of vector components, and said reverse normalization may comprise dividing at least one vector component of the dequantized input vector with a respective normalization coefficient depending on the first quantized representation.
(128) As an example, a set of normalization coefficients may be selected from a plurality of sets of normalization coefficients based on the first quantized representations, as described with respect to the first aspect of the invention, and wherein the respective normalization coefficient to be divided with respect to one of the at least one vector component of the dequantized input vector is from the selected set of normalization coefficients.
(129) For instance, any explanations presented with respect to the first aspect of the invention may also hold for the second aspect of the invention.
(130)
(131) For instance, in input vector comprising a plurality of vector coefficients may be provided, wherein this input vector may represent a vector quantization resulting in a residual vector representation, wherein the residual vector representation may represent the input vector. As a non-limiting example, the input vector may represent a vector comprising Line Spectral Frequencies (LSF) of an input signal, wherein this input signal may represent at least a part audio signal, e.g. a part of a voice signal or a part of a non-voice signal, wherein this audio signal may comprise voiced and/or unvoiced and/or generic and/or transition and/or CNG parts. For instance, the input signal to be quantized may represent residual data of an audio signal to be encoded.
(132) As an example, the input vector may be defined as vector i=[i.sub.0, i.sub.1, . . . , i.sub.k] comprising k vector components i.sub.x with x{0, 1, . . . k1}. It has to be understood that other representations may be used as well.
(133) At a step 520, said plurality of vector components is grouped into at least two groups of vector components in accordance with a rule based on the vector components.
(134) As an example, it may be defined that each group of the at least two groups of vector components comprises a predefined number of vector components. For instance, each vector component of the plurality of vector components may be associated with a respective group of the at least two groups of vector components, i.e., the vector components of the at least two groups of vector components represent the plurality of vector components, or, as another example, the vector components of the at least two groups of vector components may represent a subset of vector components of the plurality of vector components.
(135) For instance, said rule may specify that the vector components of each of the at least two groups of vector components must fulfill a predefined energy characteristic. As an example, this rule may define that vector components of a group of the at least two groups of vector components may have similar energy values, and/or, for instance, said rule may specify that a first group of the at least two groups of vector components, this first group comprising l.sub.1<k vector components, comprises the l.sub.1 most or less energetic vector components of the plurality of vector components, whereas the remaining kl.sub.1 vector components of the plurality of vector components are associated with the remaining at least one group of the at least two groups of vector components not representing the first group of vector components.
(136) For instance, said rule may represent a rule based on energy values associated with the vector components. As an example, the energy value associated with a respective vector component may for instance represent the energy value of the respective vector component, or a value being proportional to the energy value of the respective vector component, or an energy value representing the energy value of the respective vector component weighted with a weighting factor associated with this vector component, or a value being proportional to the energy value representing the energy value of the respective vector component weighted with a weighting factor associated with this vector component, or the energy rank of the respective vector component with respect to the energy ranks of the remaining vector components of the plurality of vector components. For instance, the vector component being associated with the lowest energy value of the plurality of vector components may be associated with the lowest energy rank, e.g. rank=1 or rank=k, and the vector component being associated with the highest energy value of the plurality of vector component may be associated with the highest energy rank, e.g. rank=k or rank=1. Thus, the energy rank of a vector component may indicate the position of the respective vector component with regard to its energy compared to energy of all other remaining vector components of the plurality of vector components.
(137) The energy value e.sub.x of a vector component i.sub.x with x{0, 1, . . . k1} may for instance be calculated based on
e.sub.x=i.sub.x{circumflex over ()}2
or based on any other well-suited definition of an energy value.
(138) If a vector component i.sub.x with x{0, 1, . . . k1} is weighted with a corresponding weighting factor w.sub.x, then the energy value weighted with the corresponding weighting factor might for instance be calculated based on
e.sub.x=w.sub.xi.sub.x{circumflex over ()}2.
(139) Furthermore, as another example, said rule may be a rule based on a predefined norm associated with the vector components. This rule may define that vector components of a group of the at least two groups of vector components may fulfill a specific norm or are in predefined range based on the specific norm, wherein this norm for instance may represent a respective Lp-norm of a corresponding Lp-space, wherein p1 holds or any other well-suited norm.
(140) For instance, the rule may define that a specific norm applied to the vector components of a first group of the at least two groups of vector components is within first predefined range, and that the specific norm applied to the vector components of a second group of the at least two groups of vector coefficients is within a second predefined range, and so on, wherein the first and second predefined range differ from each other.
(141) As an example, the at least two groups of vector components represent n groups of vector components g.sub.x with x{1, 2, . . . n} with n2, wherein an xth group g.sub.x of the at least two groups of vector components comprises l.sub.x vector coefficients of the plurality of vector coefficients of the input vector, and wherein said rule specifies that the specific norm of the l.sub.x vector coefficients of an xth group g.sub.x is within a predefined range r.sub.x associated with this xth group g.sub.x. Thus, a plurality of x ranges l.sub.x may be defined, wherein each range r.sub.x associated with a respective xth group g.sub.x may represent a different range.
(142) For instance, if the specific norm represents the lp norm, and the l.sub.x vector coefficients of an xth group g.sub.x may be denoted as g.sub.x,0, g.sub.x,1, . . . , g.sub.x,1x1, this norm may be calculated for the l.sub.x vector coefficients of an xth group g.sub.x as follows:
(143)
(144) For instance, an l1 norm (i.e., p=1) may be used, or an l2 norm (i.e., p=2) may be used, or any other well-suited norm.
(145) For instance, the grouping said plurality of vector components into at least two groups of vector components in step 520 may comprise an initialisation by an initial defining said at least two groups of vector components, wherein each of group of said at least two groups of vector components comprises at least one vector component of the plurality of vector components in accordance with an initial mapping of vector components of the plurality of vector components of the input vector to the at least two groups of vector components, and wherein vector components of different groups of the at least two groups of vector components are swapped between the different groups so long until the rule based on energy values associated with the vector components is fulfilled, i.e., until the vector components of each group of the at least two groups of vector components fulfill this rule.
(146) Or, as another example, said initial mapping of vector components of the plurality of vector components of the first quantized representation to the at least two groups of vector components may be performed in a way that the vector components are mapped to the at least two groups of vector components in accordance with the rule based on energy values associated with the vector components. Thus, the mapping algorithm may consider the rule when mapping the vector components of the plurality of vector components to the at least two groups of vector components.
(147) Accordingly, after the grouping in step 520 has been performed, the vector components of each group of the at least two groups of vector components fulfill the rule based on energy values associated with the vector components of the plurality of vector components.
(148) At a step 530, for each group of at least one group of the at least two groups of vector components a quantized representation of the respective group of vector components is determined based on a codebook associated with the respective group of vector components. Accordingly, at least one quantized representation of at least one group of vector components is determined in step 530, wherein each of the at least one quantized representation of the at least one group of vector components is associated with a corresponding group of vector components of the at least one group of vector components. For instance, each group of the at least two groups vector components may be quantized in step 530.
(149) For instance, the same codebook may be used for quantizing each of the at least one group of vector components in step 530.
(150) Or, as another example, a codebook used for quantizing a group of vector components of the at least one group of vector components to be quantized in step 530 may be chosen from a plurality of codebooks depending on the codevectors of the respective group of vector components. Thus, for instance, a group of vector components comprising vector components being associated with lower/low energy values may be quantized based on a codebook optimized for low energy vector components, whereas a group of vector components comprising vector component being associated with higher/high energy values (e.g. higher energy values as the group of vector components comprising vector components being associated with lower/low energy values) may be quantized based on a codebook optimized for high energy vector components. Accordingly, for instance, a well-suited codebook for quantizing a respective group of at least one group of vector components to be quantized may be selected in step 530. Thus, as an example, due to fulfillment of the rule based on energy values associated with the vector components of the at least two groups of vector components the specific energy characteristic of a respective group of vector components may be used for selected a respective codebook of the plurality of codebooks, wherein codebooks of the plurality of codebooks may be optimized for different energy characteristics of vector components.
(151) For instance, each of the at least one group of the at least two groups to be encoded in step 530 may be encoded by applying the two-stage quantization in accordance with the first aspect of the invention, i.e., as an example, step 530 comprise performing any of the methods 200, 300 and 400 of the first aspect for the invention for each of the at least one group of vector components, i.e., the respective group of vector components of the at least one group of vector components to be encoded in step 530 represents a respective input vector in accordance with the first aspect of the invention.
(152) The at least one quantized representation of the at least one group of codevectors of the at least two groups of codevectors obtained in step 530 may be considered as a second quantized representation of the input vector in accordance with the first aspect of the invention.
(153) Furthermore, as an example, method 500 may comprise
(154) determining information being configured to determine the (input) vector comprising the plurality of vector components based on the at least two groups of vector components. For instance, said information may comprise information on the swapping performed between the vector components of different groups of the at least two groups of vector components. Accordingly, as an example, at a receiver said swapping may be done in a reverse order in order to obtain the initial two groups of at least two groups of vector components, which may not fulfill the rule but which can be used to reconstruct the input vector. For instance, defining said initial at least two groups of vector components based on the plurality of vector components may be performed in a predefined manner, wherein this predefined manner may be known to the receiver.
(155) This information being configured to determine the input vector comprising the plurality of vector components based on the at least two groups of vector components may be included as additional information in said second quantized representation of the input vector.
(156)
(157) At a step 610 the plurality of vector components of the input vector are split into at the at least two groups of vector components. For instance, said splitting may represent an example of the above mentioned initial grouping of the vector components of the plurality of vector components in order to obtain the initial at least two groups of vector components, which may not fulfill the rule.
(158) Under the assumption that the input vector may be defined as vector i=[i.sub.0, i.sub.1, . . . , i.sub.k] comprising k vector components i.sub.x with x{0, 1, . . . k1} said k vector components i.sub.0, i.sub.1, . . . , i.sub.k are split into the at least two groups of the at least two groups of vector components in accordance with a predefined manner in step 610. For instance, a first initial group of the at least two groups of vector components may comprise l1 vector components, wherein this l1 vector components may represent the first l.sub.1 vector components of the input vector representation, i.e., i.sub.0, . . . , i.sub.l11. The second group of vector components may comprise l2 vector components, wherein this l2 vector component may represent the l2 vector components of the plurality of vector components directly succeeding after the vector component of the preceding group of the second group, i.e., the first group of vector components, wherein this l2 vector components may represent i.sub.l1, . . . , i.sub.l1+l21. If the at least two groups of vector components represent more than two groups of vector components, then each of the further group of vector components comprises a number of neighboured vector components of the plurality of vector components, wherein said neighboured vector components are obtained through splitting the plurality of vector coefficients into said at least two groups of vector coefficients. For instance, each group of the at least two group may comprise the same number of vector coefficients, or, as another example, the number of vector coefficients may vary for different groups of the at least two groups of vector coefficients.
(159) In the sequel, for instance, it may be assumed without any limitations that the input vector represents a vector comprising k vector components, wherein this vector is split into to groups g.sub.1 and g.sub.2 of vector components:
(160)
(161) At a step 620, it is checked whether each group of the at least two groups of vector components fulfills the rule.
(162) If each of the at least two groups fulfills the rule then there is no need for rearranging vector coefficients between two different groups of the at least two groups of vector coefficients and the method 600 may proceed at reference sign 640 where it may jump to 530 of method 500 depicted in
(163) If it is determined at step 620 that at least one group of the at least one group does not fulfill the rule the method 600 proceeds with swapping a vector component of a first group of the at least two groups for a vector component of a second group of the at least two groups of vector components in a step 630. This swapping is performed in way that the first group and the respective vector coefficient of the first group to be swapped and that the corresponding second group and the respective vector coefficient of the second group to be swapped are chosen based on the rule such that after the swapping the rule is fulfilled, or, if more than one couple of coefficients has to be swapped in order to fulfill the rule, that the selected vector coefficient of the selected first group and the selected vector coefficient of the selected second group represent one couple of coefficients of the more than one couple of coefficients to be swapped in order to fulfill the rule.
(164) As an example, it may be necessary to swap i.sub.l11 of the first group of vector coefficients g.sub.1 for i.sub.l1 of the second group of vector coefficients, wherein this swapping may result in rearranged groups of vector coefficients as follows:
(165)
(166) Thus, as an example, each group of said at least two groups of vector coefficients may be associated with fixed positions of vector i of the input vector, wherein said swapping may be performed by exchanging the positions of the vector coefficients to be swapped in vector i, wherein vector i may represent the input vector after the swapping.
(167) Then, it may be checked in step 620 whether each group of the at least two groups of vector coefficients fulfills the rule. If no, then the method once again proceeds with swapping two vector coefficients of different groups for each other. Accordingly, the loop defined in
(168) For instance, it may be assumed that the said rule may specify that a first group of the at least two groups of vector components comprises the l.sub.1 most energetic vector components (or the l.sub.1 less energetic vector components) of the plurality of vector components, whereas the remaining kl.sub.1 vector components of the plurality of vector components are associated with the remaining at least one group of the at least two groups of vector components not representing the first group of vector components. Furthermore, as an example, in accordance with this rule, a second group of the at least two groups of vector components may comprise the l.sub.2 most energetic vector components (or the l.sub.2 less energetic vector components) of the remaining kl.sub.1 vector components of the plurality of vector components.
(169) Thus, for instance, under the assumption that n groups of vector coefficients g.sub.x with x{1, 2, . . . n} are used, wherein an xth group g.sub.x comprises (or is associated with) l.sub.x vector coefficients of the plurality of vector coefficients of the the input vector, in accordance with the rule the l.sub.x vector coefficients of an xth group g.sub.x must represent the
(170)
most energetic (or less energetic) vector coefficients of the plurality of vector coefficients.
(171) Or, as another example, the above described rule based on a predefined norm may associated with the vector components may be applied.
(172) For instance, the order of the vector coefficients within a respective group of the at least two groups may be irrelevant for the applied rule.
(173) As another example, the input vector may comprise 16 vector coefficients and the at least two groups of vector components are exactly two groups of vector components, each of the two groups comprising 8 vector components, wherein initially the first group may comprise the first 8 vector components i.sub.0, . . . , i.sub.7 and the second group may comprise the remaining 8 vector components i.sub.8, . . . , i.sub.15 of the plurality of vector coefficients, e.g. obtained by step 610:
(174)
wherein the order of the energy values of the components may be in an example such that the rank of each component (corresponding the respective position in vector i) is: 1 4 5 6 2 9 3 7 11 12 10 8 13 14 15 16,
wherein 1 indicates that the respective vector component i.sub.0 has the highest rank regarding the energy values of all vector components, and so on, i.e. 16 in indicates that vector component i.sub.15 has the 16.sup.th highest rank regarding the energy values.
(175) Then, for instance, at step 620 it is checked whether the rule is fulfilled or each of the two groups of vector coefficients g.sub.1 and g.sub.2. E.g., the rule may represent the above mentioned rule that the l.sub.x vector coefficients of an xth group g.sub.x must represent the
(176)
most energetic vector coefficients of the plurality of vector coefficients.
(177) Accordingly, it is detected in step 620 that the first and second group do not fulfill this rule, since the first group g.sub.1 does not comprise the 1th to 8.sup.th most energetic vector coefficients because vector coefficient i.sub.7 of the first group of vector component represents the 9.sup.th most energetic vector coefficient, and since the second group g.sub.2 does not comprise the 9.sup.th to 16.sup.th most energetic vector coefficients because vector coefficient i.sub.l1 of the second group of vector coefficients represents the 8.sup.th most energetic vector coefficients.
(178) Thus, in step 620 those vector coefficients may be identified which do not comply with the applied rule, i.e., and these vector coefficients are swapped until the rule is fulfilled.
(179) Accordingly, in this example, vector coefficient i.sub.7 of the first group of vector component is swapped for vector coefficient i.sub.l1 of the second group of vector coefficients in order to rearrange the first and second group of vector coefficients, wherein the rearranged groups of vector coefficients may be expressed as follows:
(180)
(181) Thus, the order of the energy values of the rearranged vector i (or of the rearranged groups of vector coefficients) is: 1 4 5 6 2 8 3 7 11 12 10 9 13 14 15 16,
(182) Then, at step 620 it is detected that the first group g.sub.1 does comprise the lth to 8.sup.th most energetic vector coefficients and that the second group g.sub.2 does comprise the 9.sup.th to 16.sup.th most energetic vector coefficients and thus the rule is fulfilled for each group of the two vector groups.
(183) Then the method 600 may then proceed at reference sign 640 and may jump to step 530 of method 500.
(184)
(185) The steps of this flowchart 700 may for instance be defined by respective program code 32 of a computer program 31 that is stored on a tangible storage medium 30, as shown in
(186) For instance, this method 700 may be used for dequantizing the quantized representations of the groups of vector components obtained by any of the methods of the third aspect of the invention, e.g. obtained by step 530 of
(187) At a step 710 each quantized representation of a group of vector components of at least two groups of vector components is dequantized. These quantized at least two groups of vector components may represent at least two quantized groups of vector components obtained by any of the methods of the third aspect of the invention, e.g. by means of step 530 of
(188) Thus, said dequantizing of step 710 may be performed in a reverse order with respect of step 530 of
(189) At a step 720, a vector comprising a plurality of vector components is determined based on the at least two dequantized groups of vector components based on information configured to determine the vector comprising the plurality of vector components based on the at least two dequantized groups of vector components. This information configured to determine the vector comprising the plurality of vector components based on the at least two dequantized groups of vector components may represent the information configured to determine the input vector comprising the plurality of vector components based on the at least two dequantized groups of vector components described in the third aspect of the invention may for instance be received at a receiver together with at least two dequantized groups of vector components.
(190) For instance, step 720 may comprise a re-swapping of vector components between different groups of the at least two dequantized groups of vector components. As an example, the information may comprise information on swapping performed between vector components of different groups of the at least two groups of vector components, e.g., this information may comprise information on each swap performed at step 630 defining of a vector component of a first group of the at least two groups of vector components for a vector component of a second group of the at least two groups of vector component. Thus, as an example, based on the information comprising information on swapping performed between vector components of different groups of the at least two groups of vector components, the swaps performed by method 600 may be undone with respect to the at least two dequantized groups of vector components until the at least two dequantized groups of vector coefficients correspond to the initial at least two groups of vector components of the third aspect of the invention before the swapping has been performed. Then, based on these at least two dequantized groups of vector coefficients the first representation of the input vector can be obtained, e.g., by merging the at least two dequantized groups of vector coefficients together in order to undo the splitting of the plurality of components of the input vector performed at the third aspect of the invention. For instance, if no swapping was necessary at method 600, then this may be indicated by the information and the at least two dequantized groups of vector coefficients may for instance be merged without any swap together for obtaining the input vector.
(191) Or, as another example, if the initial mapping of vector components of the plurality of vector components of the input vector to the at least two groups of vector components in the third aspect has been performed in a way that the vector components are mapped to the at least two groups of vector components in accordance with the rule based on energy values associated with the vector components, the information configured to determine the vector comprising the plurality of vector components based on the at least two dequantized groups of vector components is indicative of this mapping and in step 720 the first quantized representation is obtained by performing a corresponding reverse mapping of vector coefficients of the at least two dequantized groups of vector coefficients to the plurality of vector components of the (input) vector.
(192) For instance, any explanations presented with respect to the third aspect of the invention may also hold for the fourth aspect of the invention.
(193) It has to be understood that the loops in these pseudo code examples are not limiting and may be arranged in a different way in order to extract the at least two codevector indexes from the single codevector index.
(194) As used in this application, the term circuitry refers to all of the following:
(195) (a) hardware-only circuit implementations (such as implementations in only analog and/or digital circuitry) and
(196) (b) combinations of circuits and software (and/or firmware), such as (as applicable):
(197) (i) to a combination of processor(s) or
(198) (ii) to portions of processor(s)/software (including digital signal processor(s)), software, and memory(ies) that work together to cause an apparatus, such as a mobile phone or a positioning device, to perform various functions) and
(199) (c) to circuits, such as a microprocessor(s) or a portion of a microprocessor(s), that require software or firmware for operation, even if the software or firmware is not physically present.
(200) This definition of circuitry applies to all uses of this term in this application, including in any claims. As a further example, as used in this application, the term circuitry would also cover an implementation of merely a processor (or multiple processors) or portion of a processor and its (or their) accompanying software and/or firmware. The term circuitry would also cover, for example and if applicable to the particular claim element, a baseband integrated circuit or applications processor integrated circuit for a mobile phone or a positioning device.
(201) With respect to the aspects of the invention and their embodiments described in this application, it is understood that a disclosure of any action or step shall be understood as a disclosure of a corresponding (functional) configuration of a corresponding apparatus (for instance a configuration of the computer program code and/or the processor and/or some other means of the corresponding apparatus), of a corresponding computer program code defined to cause such an action or step when executed and/or of a corresponding (functional) configuration of a system (or parts thereof).
(202) The aspects of the invention and their embodiments presented in this application and also their single features shall also be understood to be disclosed in all possible combinations with each other. It should also be understood that the sequence of method steps in the flowcharts presented above is not mandatory, also alternative sequences may be possible.
(203) The invention has been described above by non-limiting examples. In particular, it should be noted that there are alternative ways and variations which are obvious to a skilled person in the art and can be implemented without deviating from the scope and spirit of the appended claims.