WO2010051733A1 - 一种编码、解码、编解码方法、编解码系统以及相关装置 - Google Patents

一种编码、解码、编解码方法、编解码系统以及相关装置 Download PDF

Info

Publication number
WO2010051733A1
WO2010051733A1 PCT/CN2009/074604 CN2009074604W WO2010051733A1 WO 2010051733 A1 WO2010051733 A1 WO 2010051733A1 CN 2009074604 W CN2009074604 W CN 2009074604W WO 2010051733 A1 WO2010051733 A1 WO 2010051733A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
index value
amplitude
length
encoded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2009/074604
Other languages
English (en)
French (fr)
Inventor
李海婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP09824388.4A priority Critical patent/EP2295947B1/en
Publication of WO2010051733A1 publication Critical patent/WO2010051733A1/zh
Priority to US12/982,050 priority patent/US8731947B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/3082Vector coding
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/02Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using spectral analysis, e.g. transform vocoders or subband vocoders
    • G10L19/032Quantisation or dequantisation of spectral components
    • G10L19/038Vector quantisation, e.g. TwinVQ audio
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L2019/0001Codebooks
    • G10L2019/0004Design or structure of the codebook
    • G10L2019/0005Multi-stage vector quantisation
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L2019/0001Codebooks
    • G10L2019/0007Codebook element generation
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L2019/0001Codebooks
    • G10L2019/0013Codebook search algorithms

Definitions

  • the present invention relates to the field of data processing, and in particular, to a coding, decoding, codec method, codec system, and related apparatus.
  • the latest wideband embedded variable rate encoder G.718 of the International Telecommunication Union Telecommunication Standardization Sector uses a hierarchical combination of lattice codebook index coding methods.
  • the main steps include:
  • the symbol of the coded vector is encoded, and an absolute value vector corresponding to the vector to be encoded is obtained;
  • each Leader vector stored in advance a vector representing the size of each layer removed element and a number of bits required to represent the symbol encoding, the number of layers of the layered coding, and the vector dimension of the absolute value of each layer except the highest layer
  • the layered combination coding parameter vector sequentially removes the corresponding elements in the absolute value vector to be encoded, and encodes the position of the remaining elements in the upper layer, and finally accumulates the coding values of the layers, and considers the symbol of the vector to be encoded.
  • the encoded value is contributed to obtain the index value of the final vector to be encoded.
  • Embodiments of the present invention provide an encoding, decoding, encoding and decoding method, a codec system, and related devices, which can reduce storage complexity and improve encoding performance.
  • the encoding method provided by the embodiment of the present invention includes: acquiring an amplitude vector and a length vector corresponding to a vector to be encoded; sorting the amplitude vector and the length vector; obtaining a position according to the sorted amplitude vector and the sorted length vector Index value.
  • the decoding method provided by the embodiment of the present invention includes: receiving a lattice codebook index value sent by the encoding end; acquiring an amplitude vector and a length vector; sorting the amplitude vector and the length vector; and according to the sorted amplitude vector and The sorted length vector is decoded to obtain a vector.
  • the encoding and decoding method provided by the embodiment of the present invention includes: the encoding device queries the offset of the codebook index value corresponding to the vector to be encoded in the preset codebook index value offset table; and the encoding device acquires the vector corresponding to the code to be encoded.
  • the codec system includes: an encoding device, configured to query, in a preset codebook index value offset table, a codebook index value offset corresponding to a vector to be encoded, and obtain a vector to be encoded.
  • the codebook index value offset with the largest value and the largest value, and the element value, the amplitude vector, and the length vector included in the vector are obtained according to the obtained codebook index value offset, and subtracted from the lattice codebook index value.
  • the codebook index value offset obtains a new index value, and the amplitude vector and the length vector are sorted, and the vector is obtained according to the obtained new index value, the sorted amplitude vector, and the sorted length vector.
  • the codec system includes: an encoding device, configured to query, in a preset codebook index value offset table, a codebook index value offset corresponding to a vector to be encoded, and a symbol in a vector
  • the vector is separately coded to obtain the symbol index value, and the amplitude vector and the length vector corresponding to the vector to be encoded are obtained, and the amplitude vector and the length vector are sorted, and the position order of each element of the unsigned vector to be encoded is subjected to permutation coding.
  • a position index value which is based on a codebook index value offset, a symbol index value, a position index value, and a lattice codebook index value of the vector, and sends the lattice codebook index value to the decoding device; and a decoding device, configured to receive the encoding device The value of the code book index value to be sent, and the offset of the code book index value which is smaller than the value of the lattice code book index value and the largest value in the preset code book index value offset table, according to the code book index value of the query The offset acquires the element value, the amplitude vector, and the length vector contained in the vector, and subtracts the codebook index value offset from the lattice codebook index value.
  • the amplitude vector, and the sorted length vector are decoded to obtain an unsigned vector, and the vector is calculated according to the obtained non-zero element symbol vector and the unsigned vector.
  • the encoding apparatus includes: a query unit, configured to query, in a preset codebook index value offset table, a codebook index value offset corresponding to a vector to be encoded; an acquiring unit, configured to acquire An amplitude vector and a length vector corresponding to the vector to be encoded; a sorting unit, configured to sort the amplitude vector and the length vector acquired by the obtaining unit; and a permutation coding unit, configured to sort the length vector and the amplitude vector according to the sorting unit, according to The optimal element removal order is performed by permuting and encoding the position order of each element of the vector to be encoded to obtain a position index value; the execution unit is obtained according to the code book index value offset and the permutation coding unit queried by the query unit.
  • the position index value is used to calculate a lattice codebook index value corresponding to the final vector to be encoded, and send the lattice codebook index value to the decoding device.
  • the decoding apparatus includes: a receiving unit, configured to receive a lattice codebook index value sent by the encoding device; and a searching unit, configured to query, in the preset codebook index value offset table, less than received The code book index value and the code book index value offset with the largest value, and obtain the element value, the amplitude vector and the length vector contained in the vector according to the offset of the code book index value; the generating unit is used for Subtracting the codebook index value offset from the lattice codebook index value to obtain a new index value; The method is used for sorting the amplitude vector and the length vector acquired by the searching unit.
  • the decoding unit is configured to obtain a vector according to the new index value acquired by the generating unit and the amplitude vector after sorting by the sorting unit.
  • the embodiments of the present invention have the following advantages:
  • the amplitude vector and the length vector corresponding to the vector are obtained according to the vector to be encoded, and the permutation coding, the amplitude vector and the length vector are obtained according to the sorted amplitude vector and the sorted length vector. It is performed in real time along with the codec process, so there is no need to store a vector corresponding to each leader to remove the value of each layer removed element and a vector representing the hierarchical combined coding parameter, so that the storage complexity can be effectively reduced;
  • a regular vector is obtained, so that the position order of each element of the vector to be encoded can be permuted and encoded according to the optimal element removal order.
  • FIG. 1 is a schematic diagram of an embodiment of an encoding method according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of an embodiment of a decoding method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of another embodiment of an encoding method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of another embodiment of a decoding method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an embodiment of a codec system according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an embodiment of an encoding apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of an embodiment of a decoding apparatus according to an embodiment of the present invention.
  • the broadband embedded variable rate encoder G.718 in the prior art specifically uses a separate index value encoding for the symbol and absolute value vector of the vector to be encoded, and the index value encoding for the absolute value vector is based on hierarchical combination.
  • the trellis codebook index coding method causes the method to store a vector corresponding to the size of each layer removed element and a vector representing the hierarchical combined coding parameter corresponding to each leader, thereby increasing storage complexity.
  • Embodiments of the present invention provide an encoding, decoding, encoding and decoding method, a codec system, and related devices, which are used to reduce storage complexity and improve encoding performance.
  • the coding method provided in the embodiment of the present invention is as shown in FIG. 1 , and specifically includes:
  • a codebook index value offset table is pre-stored on the encoding end, and the table is used to indicate a correspondence between a vector and an amplitude absolute value vector and a symbol vector, and the table and the code in the prior art.
  • the book index value offset table is similar and is not limited here.
  • the corresponding codebook index value offset can be determined according to the vector to be encoded, and is used to represent the amplitude absolute value index value and the symbol index value.
  • the corresponding amplitude vector and length vector can be obtained according to the vector to be encoded, which can be obtained according to the Leader vector to which the vector to be encoded belongs, and can also be calculated according to the vector to be encoded.
  • the magnitude vector corresponding to a vector represents an element having different magnitudes in the vector; the length vector corresponding to a vector represents the number of times each element in the amplitude vector appears in the vector.
  • the specific sorting method may first rearrange the elements of the amplitude vector according to a certain rule, and adjust the order of each element in the length vector accordingly, and then rearrange the elements of the length vector according to a certain rule, and adjust the amplitude accordingly.
  • the optimal element is removed.
  • the position order of each element of the vector to be encoded is permuted and encoded to obtain a position index value.
  • the optimal removal order is the order of the elements of the magnitude vector corresponding to the elements in the length vector from the largest to the smallest.
  • the amplitude vector and the length vector corresponding to the vector are obtained according to the vector to be encoded, and the permutation coding, the amplitude vector and the length are performed according to the optimal element removal order according to the sorted amplitude vector and the length vector.
  • the acquisition of the vector is performed in real time with the encoding process, so there is no need to store a vector corresponding to each leader to remove the value of each layer removed element and a vector representing the hierarchical combined encoding parameter, so that the storage complexity can be effectively reduced;
  • a regular vector is obtained, so that the position order of each element of the vector to be encoded can be permuted and encoded according to the optimal element removal order.
  • an embodiment of a decoding method in an embodiment of the present invention includes:
  • Query in a preset codebook index value offset table, a codebook index value offset that is smaller than a received lattice codebook index value and has the largest value;
  • the decoding end after receiving the trellis codebook index value sent by the encoding end, the decoding end searches for the code smaller than the received trellis codebook index value in the same codebook index value offset table as the encoding end. The book index value offset, and then the largest codebook index value offset is taken from the found codebook index value offset.
  • the element values included in the vector are determined according to the label in the codebook index value offset table according to the codebook index value offset, and the corresponding amplitude vector and length vector are obtained.
  • Sort the amplitude vector and the length vector according to a preset sorting rule; In this embodiment, the order of the elements in the amplitude vector and the length vector is sorted according to the same sorting rule as the encoding end, but the order of sorting the amplitude vector and the length vector is not limited.
  • the position vector is decoded by the new index value, and a new vector is generated according to the amplitude vector, the length vector and the position vector, and the vector is The vector corresponding to the received lattice code index value.
  • the invention is applied to the codebook index codec based on the Gosset lattice-based lattice vector quantizer.
  • the codebook of the lattice vector quantizer based on Gosset lattice is generated by the most basic Root Leader vector through element symbol and position change. Each Root Leader vector only changes the element symbol to form a series of Leader vectors. Each Leader vector changes the position of the element and finally forms the entire code book. Each element in the Root Leader vector is non-negative and is arranged in descending order.
  • the lattice vector quantizer based on Gosset lattice only the amplitude vector and length vector corresponding to all Root Leader vectors are stored.
  • the amplitude vector corresponding to the Root Leader vector represents the size of the different element values in the corresponding vector, and the element values are arranged in descending order.
  • the length vector corresponding to the Root Leader vector represents the number of times each element value in the corresponding vector appears.
  • the corresponding Root Leader vector can be easily calculated from the amplitude vector and the length vector corresponding to the Root Leader vector. According to the transformation rules of the Root Leader and the element symbol, the corresponding Leader vector and Leader vector corresponding to each Root Leader vector can be calculated. Amplitude vector and length vector.
  • the encoding end searches the code book for the vector closest to the vector to be quantized, obtains the vector to be encoded, and obtains the corresponding Root Leader vector and Leader vector.
  • Root Leader is also known as the root boot entry.
  • this vector is called the Root Leader vector, and these codewords belong to the same Root Leader.
  • the elements in the Root Leader vector are all non-negative The number is usually also arranged in descending order of element values. For example, codewords [200], [020], [002], [-200], [0-20], [00 -2] can all be obtained by a vector [200] through element symbol and positional order transformation, then The vector [200] is the Root Leader vector to which the six codewords belong.
  • Leader can also be called a guide item.
  • this vector is called the Leader vector, and these codewords belong to the same leader.
  • Elements in the Leader vector are usually arranged in descending order of element values. For example, the code words [200], [020], [002] can all be obtained by a vector [200] through the transformation of the element position order, then the vector [200] is the leader vector to which the three code words belong; [-20 0], [0-20], [00 -2] can all be obtained by a vector [00 -2] through the transformation of the element position order, then the vector [00 -2] is the code of the three code words. Leader vector.
  • the lattice vector quantizer contains the Root Leader vector: the 0th Root Leader vector [2 2 0 0 0 0 0] and the 1st Root Leader vector [1 1 1 1 1 1 1].
  • the Leader vector corresponding to the 0th Root Leader vector includes: 0th Leader vector [2 2 0 0 0 0 0 0], 1st Leader vector [2 0 0 0 0 0 -2], 2nd Leader vector [0 0 0 0 0 0 -2 -2];
  • the Leader vector corresponding to the 1st Root Leader vector includes: 0th Leader vector [1 1 1 1 1 1], 1st Leader vector [1 1 1 1 1 1 -1 — 1] , the second leader vector [1 1 1 1 —1 —1 —1 —1] , the third leader vector [1 1 -1 -1 -1 -1 -1] 4th leader vector
  • the Vector vector corresponding to the vector X to be encoded is [2 0 0 0 0 0 0 -2]. Since the Leader vector [2 0 0 0 0 0 0 -2] can obtain the X vector after the change of the element position, the Vector vector corresponding to the vector X to be encoded is [2 0 0 0 0 0 -2]. Since the Root Leader vector [2 2 0 0 0 0 0 0 0] can obtain the X vector through the change of the element symbol and position, the Root Leader vector corresponding to the vector X to be encoded is [2 2 0 0 0 0 0 0].
  • the encoding method applied to the lattice vector quantizer of the Gosset lattice includes:
  • the amplitude absolute value vector and the symbol vector corresponding to the vector to be encoded are index encoded.
  • the symbol and amplitude values of each element in the vector to be encoded are jointly encoded, and the codebook index value offset corresponding to the vector to be encoded is searched in the codebook index value offset table.
  • Offset_table[2] [5]
  • the row index of the table represents the label of the Root Leader vector corresponding to the vector to be encoded in the codebook (
  • the vector X belongs to the 0th Root Leader vector, so the row subscript is 0)
  • the column subscript of the table represents the label of the Leader vector corresponding to the vector to be encoded to which the Root Leader vector belongs (the vector X in this embodiment)
  • the first Leader vector belonging to the 0th Root Leader vector, so the column is labeled 1).
  • the codebook index value offset can be written as idxOffset.
  • the label of each element symbol in the vector to be encoded (1 in this embodiment) may be obtained according to the symbol difference between the Root Leader vector corresponding to the vector to be encoded and the vector to be encoded, and the label is corresponding.
  • the label of the leader vector which is the label of the column subscript.
  • the number of symbols representing the elements in the vector to be encoded is calculated according to the number of symbols of the non-zero elements having the same absolute value in the vector to be encoded. Then, according to the label of the Root Leader vector corresponding to the vector to be encoded in the codebook (0 in this embodiment) and the label of each element symbol in the vector to be encoded obtained in the above (in this embodiment, 1), in the code
  • the book index value offset table searches for the corresponding codebook index value offset (that is, the codebook index value offset is the value of the 0th row and the first column of the table: 28).
  • the codebook index value offset table is calculated and stored in advance based on the structure of the Gosset lattice based codebook.
  • the value of the jth column in the i-th row of the table is the number of all codewords that can be generated from the 0th to the ith-1th Root Leader vector plus the 0th to j-1th leaders to which the i-th Root Leader vector belongs. All codewords that the vector can generate Number.
  • the 0th Root Leader vector can obtain 112 codewords after the element symbol and the position change, and the first Root Leader vector belongs to the first
  • the amplitude vector and the length vector may be obtained according to the Leader vector to which the vector to be encoded belongs.
  • the vector to which the vector to be encoded belongs is [2 0 0 0 0 0 -2]
  • the amplitude vector is ⁇ ⁇ . . ⁇ ⁇ [2 0 - 2]
  • V where is the dimension of the magnitude vector and the length vector, representing the number of elements with different element values in the vector to be encoded.
  • L p is the dimension vector and the dimension of the length vector, indicating the number of elements with different element values in the vector to be encoded.
  • the elements of the amplitude vector may be rearranged according to the law from large to small, and the order of each element in the length vector is adjusted accordingly, and the elements of the adjusted length vector are followed from large to small. Regularly rearrange and adjust the order of the elements in the magnitude vector accordingly.
  • the elements of the original amplitude vector are already arranged in descending order, and only the elements of the length vector need to follow the law from large to small. Perform rearrangement and adjust the order of the elements in the magnitude vector accordingly.
  • the original amplitude vector is
  • the sorted length vector is denoted as WW n W, W [6 1 1].
  • the amplitude vector and the length vector obtained from the Leader vector to which the vector to be encoded belongs, since the elements of the original amplitude vector are already arranged in descending order, only the elements of the length vector need to be as large as possible. Regularly rearrange. According to the vector to be encoded
  • the original length vector obtained by the Leader vector is W Wn W, w [1 6 1] ,
  • the order of the obtained amplitude vector [0 2 - 2].
  • the sorted length vector is denoted as W Wn W, w [6 1 1].
  • the elements of the length vector may be rearranged according to the law from large to small, and the order of the elements in the amplitude vector may be adjusted accordingly; for the case where the elements in the length vector after sorting are equal, the corresponding amplitude vector
  • the elements in the element should be adjusted again according to the law from large to small: Take the amplitude vector and the length vector obtained from the vector to be encoded as an example, and in the encoding process (ie, in step 103), the elements in the original length vector are followed. Rearranged from large to small
  • the sorted length vector is denoted as W Wn W, W [6 1 1].
  • the rules used for the ordering of the amplitude vector and the length vector may be performed in descending order; they may all be performed in ascending order; or the amplitude vector may be In the small order, the length vectors are performed in order from small to large; it is also possible to perform the length vectors in descending order, and the magnitude vectors are in descending order:
  • the elements of the amplitude vector are first rearranged according to the law from large to 'j.
  • the element removal order in this embodiment refers to an order in which the frequency of occurrence of elements in the vector to be encoded is high to low, that is, an element having a large number of occurrences. Remove first. Specifically, the element removal may be performed in the order of the corresponding elements in the sorted amplitude vector corresponding to the sorted length vector element values from large to small.
  • the elements to be encoded are to be encoded.
  • the vector is decomposed into the L p layer, and the vector to be encoded is used as the highest layer vector.
  • the index value encoding method based on hierarchical combination is used, and the elements of the vector to be encoded appear according to the length vector and the amplitude vector sorted in the previous step.
  • the positional order is permuted and encoded to obtain a position index value.
  • the position index value idxVecLocal can be obtained by the following process:
  • the layer 0 vector is the vector to be encoded.
  • the layer 0 vector is the vector to be encoded, [0 0 0 - 2 0 2 0 0].
  • the encoding of the position vector of the current layer (n-th layer) vector associated with the upper layer (n-1th layer) vector is based on the permutation combination function, and its index value is denoted as mid_idx n .
  • the position vector index value can be obtained by the following formula:
  • idxVecLocal idxVecLocal*C mn + mid idx
  • idxVecLocal is initialized to 0 before step (1).
  • P. , , P 2 ... are the element values contained in the nth layer position vector, according to the range of layers from the left to the right of the position vector;
  • m n4 is the upper layer (the n-1th layer) dimension;
  • ! 3 ⁇ 4 is the dimension of the current layer (n-th layer) vector;
  • the dimension of the vector to be encoded All possible 1 values can be stored in a table in advance, which avoids factorial calculations in the program.
  • the index value idxVecLocal of the nth layer is multiplied by the total number C of possible index values of the current layer, and then the current layer index value mid_idx n is added , and the index value idxVecLocal of the current layer is obtained.
  • the upper layer (level 1) has a dimension of 2, so 1
  • the position index value calculated in this embodiment is 38. It should be noted that the optimal removal order in step 104 in the above embodiment is always performed according to the frequency of occurrence of elements in the vector to be encoded from high to low. If the elements in the length vector are rearranged in the order of small to large in step 103 in the above embodiment, the order of removal is removed in descending order of the corresponding amplitude vector subscripts after sorting.
  • the rule used in sorting is to perform the order of the magnitude vectors in descending order, and the length vectors are in the order of small to large.
  • step (2) of step 104 of the embodiment at the nth layer (0 ⁇ n ⁇ L p ), from the upper layer
  • the lattice codebook index value corresponding to the final vector to be encoded is calculated according to the codebook index value offset and the position index value.
  • Query in a preset codebook index value offset table, a codebook index value offset that is smaller than a received lattice codebook index value and has the largest value;
  • all the codebook index value offsets smaller than the lattice codebook index value are queried in the preset codebook index value offset table, and then determined in the codebook index value offsets.
  • the maximum codebook index value offset is the codebook index value offset.
  • the trellis codebook index value received by the decoding end is 66, and the query is performed in the following codebook index value offset table:
  • Offset_table[2][5]
  • the codebook index value offset table is identical to the codebook index value offset table stored in the encoding end. From the codebook index value offset table, 0 ⁇ 28 ⁇ 66 ⁇ 84 is found, that is, there are two offsets of the codebook index value smaller than 66, respectively 0 and 28, and then in the two codes. The book index value offset takes the maximum value, so the codebook index value offset is 28.
  • the decoding end can adopt the same sorting method as the encoding end, first rearrange the elements of the amplitude vector according to the law from large to small, and adjust the order of each element in the length vector accordingly, and then adjust the elements of the length vector. Rearrange the rules from large to small and adjust the order of the elements in the magnitude vector accordingly.
  • the order of the elements from the largest to the smallest is selected for the amplitude vector, and the amplitude vectors corresponding to the Leader vector obtained by the decoding end are arranged in this order, so only the elements of the length vector need to follow the law from large to small. Perform rearrangement and adjust the order of the elements in the magnitude vector accordingly.
  • the length vector is
  • the decoding end may also first rearrange the elements in the length vector according to the law from large to small, and adjust the order of the elements in the amplitude vector accordingly. For the case where the elements in the length vector after sorting are equal, the corresponding amplitude vector The elements should be adjusted again in accordance with the law from large to small.
  • the decoding end can sort the amplitude vector and then sort the length vector, or first sort the length vector and then sort the amplitude vector.
  • the decoding end can sort the amplitude vector and then sort the length vector, or sort the length vector and then sort the amplitude vector.
  • the order of the elements to be followed in the ordering of the internal elements of the codec length vector must be consistent: The order of the elements in the inner length of the encoding end length vector is from large to small, and the decoding end must also be from large to small. The order of the elements to be followed when sorting the internal elements of the encoder length vector is from small to large, and the decoding end must also be small to large. Similarly, the order of the elements to be followed in the ordering of the internal elements of the codec amplitude vector must be consistent: the order of the elements in the ordering of the internal elements of the encoding end is from large to small, and the decoding end must also be large to small. . The order of the elements to be followed when ordering the inner elements of the encoder's amplitude vector is from small to large, and the decoding end must also be small to large.
  • This step may specifically include:
  • the new index value idxVecLocal is decomposed into several intermediate index values corresponding to the respective layers from the lowest layer to the highest layer.
  • the new index value idxVecLocal is used as the starting value of the corresponding lowest layer.
  • the intermediate index value of each lower layer is obtained by dividing the index value by the total number C of possible index values, the quotient is the index value of the next lower layer, and the remainder is the intermediate index value mid_idx n of the current layer.
  • n The number of layers n is gradually decreasing ( Lrita > n >0).
  • mid _ idx idxVecLocal % C
  • idxVecLocal [idxVecLocal / C ⁇ "
  • % means taking the remainder operation
  • L means rounding down
  • m n — ⁇ is the dimension of the previous layer (the n-1th layer)
  • m n is the dimension of the current layer (the nth layer).
  • Position vector decoding The intermediate index value mid_idx n of each lower layer is decoded based on the permutation combination function, and a position vector corresponding to each lower layer of the upper layer vector is obtained. In order to obtain the position vector from the intermediate vector at each lower layer, this algorithm applies a permutation combination function to estimate
  • the value of pos is continuously increased from ⁇ ⁇ 4 +1 until the intermediate index value mid_idx n is no longer greater than d c : , where P w is the position value decoded by the previous step;
  • steps 3 and 4 are repeated until all position values contained in the current layer position sequence are decoded.
  • each lower layer vector is used to replace some of the elements of the upper layer vector, and the highest layer vector decoded is the vector of the output.
  • the vector contains only one element value category, which can be obtained from the reordered magnitude vector.
  • the lowest layer vector is passed to the next layer, and another element value category is added in the next step. This new element value is also derived from the reordered magnitude vector. This process is repeated until the highest level vector is generated.
  • step 205 If the elements in the length vector are rearranged in the order of small to large in step 204 in the above embodiment, correspondingly, in step 205:
  • the permutation coding is performed according to the optimal element removal order, and the amplitude vector sum is The acquisition of the length vector is performed with the coding process, so there is no need to store the vector corresponding to the value of each layer removal element and the vector representing the hierarchical combination coding parameter corresponding to each leader, so the storage complexity can be effectively reduced.
  • the sequence has a regular vector, so the order of the positions of the elements of the vector to be encoded can be permuted and encoded according to the optimal element removal order, thereby reducing the computational complexity of the encoding process and improving the encoding performance.
  • the codec process in this embodiment can also be based on the codebook index of the lattice vector quantizer of the RE8 lattice. Decoding, or codebook index encoding and decoding of other types of lattice vector quantizers.
  • Another encoding method is described below.
  • another embodiment of the encoding method in the embodiment of the present invention includes:
  • 301 Query a codebook index value offset corresponding to a vector to be encoded in a preset codebook index value offset table
  • the encoding end finds the grid point closest to the vector to be quantized, and this grid point is the vector to be encoded.
  • the corresponding codebook index value offset idxOffset is searched for in the previously stored codebook index value offset table according to the Root Leader vector to which the vector to be encoded belongs.
  • the symbol vector of the vector to be encoded is separated, and symbol coding is performed separately to obtain a symbol index value idxSign.
  • the number of bits N required for encoding is equal to the number of non-zero elements in the vector to be encoded.
  • the total number of all possible symbol codes is 2 N .
  • the symbol vector is [0 0 0 -1 0 1 0 0]
  • the encoding value is binary number 01, which is converted to a decimal number of 1.
  • steps 303 to 305 in this embodiment are similar to steps 102 to 104 in the first embodiment of the coding method in the embodiment of the present invention, and details are not described herein.
  • the vector to which the unsigned code is encoded belongs to the Root Leader vector corresponding to the amplitude vector [2 0], the length vector is [2 6], and the unsigned vector to be encoded is [0 0 0 2 0 2 0 0].
  • another embodiment of the decoding method in the embodiment of the present invention includes:
  • the decoding end After receiving the trellis codebook index value, the decoding end searches for the codebook index value offset smaller than the received trellis codebook index value in the codebook index value offset table, and then searches for the code.
  • the largest value of the book index value offset is taken as the codebook index value offset idxOffset.
  • the label in the codebook determines the amplitude vector corresponding to the Root Leader vector to which the vector belongs, and the length vector arranged according to the element value in descending order, and the length vector representing the number of occurrences of different element values. .
  • the symbol vector of the non-zero element is decoded according to the symbol index value idxSign.
  • 1 is used to indicate that the symbol is positive, 0 is negative, and the symbol vector of the non-zero element is [-1 1 ].
  • steps 406 to 407 in this embodiment are similar to the steps 204 to 205 in the first embodiment of the decoding method in the embodiment of the present invention, and details are not described herein again.
  • the final vector is generated from the unsigned vector and the symbol vector of the non-zero element.
  • the unsigned vector is [0 0 0 2 0 2 0 0]
  • the symbol vector of the non-zero element is [-1 1]
  • the final vector is [0 0 0 -2 0 2 0 0].
  • the codebook index codec process applied to the Gosset cell and the trellis vector quantizer applied to the RE8 cell is introduced. It can be understood that, in practical applications, the codec process described in the embodiment of the present invention is used. It can also be applied to other similar lattice vector quantizers, and the specific types are not limited herein.
  • the permutation coding is performed according to the optimal element removal order.
  • the acquisition of the amplitude vector and the length vector is performed with the coding process, so there is no need to store a vector corresponding to the value of each layer removed element and a vector representing the hierarchical combination coding parameter corresponding to each leader, so that it can effectively The storage complexity is reduced.
  • a regular vector is obtained, so that the position of each element of the vector to be encoded can be obtained according to the optimal element removal order.
  • the ordering of the magnitude vector and the length vector in the encoding process can be done in a variety of ways, This can increase the flexibility of the encoding method.
  • the codec system in the embodiment of the present invention includes:
  • the encoding device 501 is configured to query the offset of the codebook index value corresponding to the vector to be encoded in the preset codebook index value offset table, obtain the amplitude vector and the length vector corresponding to the vector to be encoded, and the amplitude vector and The length vector is sorted according to a preset sorting rule, and the position order of each element of the vector to be encoded is subjected to permutation coding to obtain a position index value, and the final vector to be encoded is calculated according to the codebook index value offset and the position index value.
  • the trellis codebook index value is sent to the decoding device 502 for the trellis codebook index value;
  • the decoding device 502 is configured to receive the trellis codebook index value sent by the encoding device 501, and query the preset codebook index value offset table to query the codebook index value that is smaller than the received trellis codebook index value and has the largest value. Offset, according to the obtained codebook index value offset, obtain the element value, the amplitude vector and the length vector contained in the vector, and subtract the offset of the codebook index value from the lattice codebook index value to obtain a new index. The value, the amplitude vector and the length vector are sorted according to a preset sorting rule, and the vector is obtained according to the obtained new index value, the sorted amplitude vector, and the sorted length vector.
  • the above codec system can be applied to the codec process of the lattice vector quantizer of the Gosset lattice, and can also be applied to the codec process of the lattice vector quantizer of the RE8 lattice, or can be applied to other types of lattice vector quantization.
  • the codec process of the device the following describes another alternative codec solution.
  • the codec system includes:
  • the encoding device 501 is configured to query the offset of the codebook index value corresponding to the vector to be encoded in the preset codebook index value offset table, separately encode the symbol vector in the vector to obtain a symbol index value, and obtain an unsigned symbol.
  • the amplitude vector and the length vector corresponding to the vector to be encoded are sorted according to a preset sorting rule for the amplitude vector and the length vector, and the position index is obtained by permuting the position order of each element of the unsigned vector to be encoded, according to the code a book index value offset, a symbol index value, a bit index code value of the position index value calculation vector, and the trellis codebook index value is transmitted to the decoding device 502; the decoding device 502 is configured to receive the cell type transmitted by the encoding device 501
  • the codebook index value is used to query the offset of the codebook index value that is smaller than the lattice codebook index value and the largest value in the preset codebook index value offset table, according to the
  • the element values contained in the vector, the magnitude vector, and The length vector is obtained by subtracting the offset of the codebook index value from the index value of the codebook to obtain a new index value, separating the symbol index value and the position index value from the new index value, and decoding the non-zero element symbol according to the symbol index value.
  • Vector, sorting the amplitude vector and the length vector according to a preset sorting rule, and according to the obtained position index value, the sorted amplitude vector, and the sorted length vector decoding to obtain an unsigned vector, according to the obtained non-zero element Symbol vectors and unsigned vector calculations yield vectors.
  • the encoding device 501 can obtain the amplitude vector and the length vector corresponding to the vector obtained according to the vector to be encoded, and perform permutation coding according to the optimal element removal order according to the sorted amplitude vector and the length vector.
  • the acquisition of the amplitude vector and the length vector is performed with the coding process, so there is no need to store a vector corresponding to the value of each layer removed element of each layer and a vector representing the hierarchical combination coding parameter, so that it can be effective Reduce storage complexity.
  • an embodiment of an encoding apparatus in an embodiment of the present invention includes:
  • the query unit 601 is configured to query, in the preset codebook index value offset table, a codebook index value offset corresponding to the vector to be encoded;
  • the obtaining unit 602 is configured to obtain an amplitude vector and a length vector corresponding to the vector to be encoded, and a sorting unit 603, configured to sort the amplitude vector and the length vector acquired by the obtaining unit 602 according to a preset sorting rule;
  • the permutation coding unit 604 is configured to perform permutation coding according to the order of the positions of the elements of the vector to be encoded according to the length vector and the amplitude vector sorted by the sorting unit 603, to obtain the position index value;
  • the executing unit 605 calculates the trellis codebook index value corresponding to the final vector to be encoded according to the codebook index value offset queried by the query unit 601 and the position index value acquired by the permutation coding unit 604, and outputs the trellis codebook index value to the decoding device.
  • the specific code calculation process is the same as the calculation process in the foregoing coding method embodiment, and is not described here.
  • the above coding apparatus can be applied to the coding and decoding process of the lattice vector quantizer of the Gosset lattice, and can also be applied to the coding and decoding process of the lattice vector quantizer of the RE8 lattice, or can be applied to other types of coding.
  • the encoding and decoding process of the trellis vector quantizer, and the following another alternative encoding and decoding scheme, the encoding apparatus in this embodiment may further include:
  • the query unit 601 is configured to query, in the preset codebook index value offset table, a codebook index value offset corresponding to the vector to be encoded;
  • a separating unit 606 configured to separate a symbol vector from a vector to be encoded
  • a symbol coding unit 607 configured to separately code the separated symbol vector to obtain a symbol index value
  • the obtaining unit 602 is configured to obtain an amplitude vector and a length vector corresponding to the unsigned vector to be encoded;
  • a sorting unit 603, configured to sort the amplitude vector and the length vector acquired by the obtaining unit 602 according to a preset sorting rule
  • the permutation coding unit 604 is configured to perform permutation coding on the position order of each element of the unsigned to be encoded according to the optimal length of the element removal according to the ordered length vector and the amplitude vector, to obtain the position index value. ;
  • the executing unit 605 is configured to replace the position index value acquired by the encoding unit 604 and the symbol index value acquired by the symbol encoding unit 607 according to the codebook index value offset queried by the query unit 601, and calculate the final vector to be encoded.
  • the value of the code book index value is sent to the decoding device, and the specific code calculation process is the same as the calculation process in the foregoing coding method embodiment, and details are not described herein again.
  • the sorting unit 603 sorts the amplitude vector and the length vector, and is replaced by the permutation encoding unit 604. According to the sorting result of the sorting unit 603, the permutation coding is performed in the optimal element removal order to obtain the position index value, so the execution unit 605 can obtain the codebook index value offset and the permutation coding unit 604 that are queried according to the query unit 601.
  • the position index value is used to calculate the lattice codebook index value corresponding to the final vector to be encoded, and the acquisition of the amplitude vector and the length vector is performed with the coding process, so there is no need to store each layer corresponding to each leader.
  • the vector of the element value size and the vector characterizing the hierarchical combination coding parameters are removed, so that the storage complexity can be effectively reduced.
  • an embodiment of a decoding apparatus in the embodiment of the present invention includes:
  • the receiving unit 701 is configured to receive a trellis codebook index value sent by the encoding device.
  • the searching unit 702 is configured to query, in the preset codebook index value offset table, a codebook index value offset that is smaller than the received lattice codebook index value and has the largest value, and according to the queryed codebook index
  • the value offset obtains the element value, the amplitude vector, and the length vector contained in the vector;
  • a generating unit 703 configured to subtract the offset of the codebook index value from the lattice codebook index value to obtain a new index value
  • a sorting unit 704 configured to sort the amplitude vector and the length vector acquired by the searching unit 702 according to a preset sorting rule
  • the decoding unit 705 is configured to: according to the new index value acquired by the generating unit 703, and the amplitude vector after sorting by the sorting unit 704, the length vector is decoded to obtain a vector, and the specific calculation process is consistent with the calculation process used in the foregoing decoding method embodiment. , will not repeat them here.
  • the above decoding apparatus can be applied to the codec process of the lattice vector quantizer of the Gosset lattice, and can also be applied to the encoding and decoding process of the lattice vector quantizer of the RE8 lattice, or can be applied to other types of The encoding and decoding process of the trellis vector quantizer, and the following another alternative encoding and decoding scheme, the decoding apparatus in this embodiment may further include:
  • the index value separating unit 706, in this manner, the decoding device specifically includes:
  • the receiving unit 701 is configured to receive a trellis codebook index value sent by the encoding device.
  • the searching unit 702 is configured to query, in the preset codebook index value offset table, a codebook index value offset that is smaller than the received lattice codebook index value and has the largest value, and according to the queryed codebook index
  • the value offset obtains the element value, the amplitude vector, and the length vector contained in the vector;
  • a generating unit 703 configured to subtract the offset of the codebook index value from the lattice codebook index value to obtain a new index value
  • the index value separating unit 706 is configured to separate the symbol index value and the position index value from the new index value generated by the generating unit 703;
  • a sorting unit 704 configured to sort the amplitude vector and the length vector acquired by the searching unit 702 according to a preset sorting rule
  • the decoding unit 705 is configured to decode the sort result of the sorting unit 704 according to the position index value separated by the index value separating unit 706 to obtain an unsigned vector, and decode the symbol index value separated by the index value separating unit 706 to obtain a non-zero element.
  • the symbol vector, and then the vector is calculated according to the obtained non-zero element symbol vector and the unsigned vector, and the specific calculation process and the foregoing decoding method The calculation process is the same and will not be described here.
  • the medium can be a read only memory, a magnetic disk or a compact disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

一种编码、 解码、 编解码方法、 编解码系统以及相关装置 本申请要求于 2008 年 11 月 10 日提交中国专利局、 申请号为 200810175265.X, 发明名称为 "一种编码、 解码、 编解码方法、 编解码系统以 及相关装置"的中国专利申请的优先权,其全部内容通过引用结合在本申请中。 技术领域
本发明涉及数据处理领域, 尤其涉及一种编码、 解码、 编解码方法、 编解 码系统以及相关装置。
背景技术
近年来, 随着承载技术的发展, 用户对音频编码器的编码质量提出了越来 越高的要求。 在追求语音通话的同时, 用户希望获得更高质量、 更丰富的媒体 服务。 一方面, 在通信领域, 用户越来越不满足于窄带语音编解码器的质量, 因此语音编解码器已逐步向宽带、 超宽带扩展。 另一方面, 应用于多媒体技术 领域的音频编码器也逐渐朝着能够提供低速率高质量的音频编码质量方向努 力。
目前已经标准化的音频编码器大都是采用变换编码、心理声学模型和格型 矢量量化技术相结合的方法对信号进行编码。
现有技术中, 国际电信联盟电信标准局 ( ITU-T , International Telecommunication Union Telecommunication Standardization Sector ) 最新的宽 带嵌入式变速率编码器 G.718 中使用了基于分层组合的格型码书索引编码方 法, 其主要步骤包括:
首先对待编码矢量的符号进行编码,并得到与待编码矢量相对应的绝对值 矢量;
其次, 根据事先存储的每一个 Leader矢量对应的表征各层移除元素数值 大小的矢量和一个表征符号编码所需比特数、分层编码的层数以及除最高层外 各层绝对值矢量维数的分层组合编码参数矢量,依次移除待编码的绝对值矢量 中相应元素,并对所剩元素在上一层中的位置进行编码,最后累计各层编码值, 并考虑待编码矢量的符号编码值贡献, 得到最终的待编码矢量的索引值。
但是, 上述技术方案增加了存储复杂度, 特别是对于编码比特数较高, Leader码字较多的格型矢量量化器,增加的存储复杂度几乎和码书自身的存储 复杂度相当。
发明内容
本发明实施例提供了一种编码、 解码、 编解码方法、 编解码系统以及相关 装置, 能够减少存储复杂度, 提高编码性能。
本发明实施例提供的编码方法, 包括: 获取待编码的矢量对应的幅度矢量 和长度矢量; 对所述幅度矢量以及长度矢量进行排序; 根据排序后的幅度矢量 以及排序后的长度矢量, 得到位置索引值。
本发明实施例提供的解码方法,包括:接收编码端发送的格型码书索引值; 获取幅度矢量以及长度矢量; 对所述幅度矢量以及长度矢量进行排序; 根据所 述排序后的幅度矢量以及排序后的长度矢量解码得到矢量。
本发明实施例提供的编解码方法, 包括: 编码装置在预置的码书索引值偏 移量表中查询待编码的矢量对应的码书索引值偏移量;编码装置获取待编码的 矢量对应的幅度矢量和长度矢量; 编码装置对幅度矢量以及长度矢量进行排 序; 编码装置根据排序后的幅度矢量以及长度矢量, 按照最优元素移除顺序, 对待编码的矢量各元素出现的位置顺序进行置换编码得到位置索引值;编码装 置根据所述码书索引值偏移量和位置索引值,计算最终的待编码的矢量对应的 格型码书索引值, 并向解码装置发送所述格型码书索引值; 解码装置在预置的 码书索引值偏移量表中查询小于接收到的格型码书索引值且数值最大的码书 索引值偏移量;解码装置根据查询到的码书索引值偏移量获取矢量中包含的元 素值, 幅度矢量以及长度矢量; 解码装置从所述格型码书索引值中减去该码书 索引值偏移量得到新索引值; 解码装置对幅度矢量以及长度矢量进行排序; 解 码装置根据获取到的新索引值,排序后的幅度矢量, 以及排序后的长度矢量解 码得到矢量。
本发明实施例提供的编解码系统, 包括: 编码装置, 用于在预置的码书索 引值偏移量表中查询待编码的矢量对应的码书索引值偏移量,获取待编码的矢 量对应的幅度矢量和长度矢量,对幅度矢量以及长度矢量进行排序,对待编码 的矢量各元素出现的位置顺序进行置换编码得到位置索引值,根据所述码书索 引值偏移量和位置索引值, 计算最终的待编码的矢量对应的格型码书索引值, 向解码装置发送该格型码书索引值; 解码装置, 用于接收编码装置发送的格型 码书索引值,在预置的码书索引值偏移量表中查询小于接收到的格型码书索引 值且数值最大的码书索引值偏移量,根据查询到的码书索引值偏移量获取矢量 中包含的元素值, 幅度矢量以及长度矢量,从所述格型码书索引值中减去该码 书索引值偏移量得到新索引值,对幅度矢量以及长度矢量进行排序,根据获取 到的新索引值, 排序后的幅度矢量, 以及排序后的长度矢量解码得到矢量。
本发明实施例提供的编解码系统, 包括: 编码装置, 用于在预置的码书索 引值偏移量表中查询待编码的矢量对应的码书索引值偏移量,对矢量中的符号 矢量进行单独编码得到符号索引值,获取无符号待编码的矢量对应的幅度矢量 和长度矢量,对幅度矢量以及长度矢量进行排序,对无符号待编码的矢量各元 素出现的位置顺序进行置换编码得到位置索引值,根据码书索引值偏移量,符 号索引值,位置索引值计算矢量的格型码书索引值, 向解码装置发送该格型码 书索引值; 解码装置, 用于接收编码装置发送的格型码书索引值, 在预置的码 书索引值偏移量表中查询小于格型码书索引值且数值最大的码书索引值偏移 量,根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢量以及 长度矢量,从格型码书索引值中减去该码书索引值偏移量得到新索引值,从新 索引值中分离出符号索引值和位置索引值,根据符号索引值解码出非零元素符 号矢量, 对幅度矢量以及长度矢量进行排序, 根据获取到的位置索引值, 排序 后的幅度矢量, 以及排序后的长度矢量解码得到无符号矢量,根据获取到的非 零元素符号矢量以及无符号矢量计算得到矢量。
本发明实施例提供的编码装置, 包括: 查询单元, 用于在预置的码书索引 值偏移量表中查询待编码的矢量对应的码书索引值偏移量; 获取单元, 用于获 取待编码的矢量对应的幅度矢量和长度矢量; 排序单元, 用于对获取单元获取 到的幅度矢量以及长度矢量进行排序; 置换编码单元, 用于根据排序单元排序 后的长度矢量和幅度矢量,按照最优的元素移除顺序,对待编码的矢量各元素 出现的位置顺序进行置换编码, 得到位置索引值; 执行单元, 根据查询单元查 询到的码书索引值偏移量和置换编码单元获取到的位置索引值,计算最终的待 编码的矢量对应的格型码书索引值, 并向解码装置发送该格型码书索引值。
本发明实施例提供的解码装置, 包括: 接收单元, 用于接收编码装置发送 的格型码书索引值; 查找单元, 用于在预置的码书索引值偏移量表中查询小于 接收到的格型码书索引值且数值最大的码书索引值偏移量,并根据查询到的码 书索引值偏移量获取矢量中包含的元素值,幅度矢量以及长度矢量;生成单元, 用于从格型码书索引值中减去该码书索引值偏移量得到新索引值; 排序单元, 用于对查找单元获取到的幅度矢量以及长度矢量进行排序; 解码单元, 用于根 据生成单元获取到的新索引值, 以及排序单元排序后的幅度矢量, 长度矢量解 码得到矢量。
从以上技术方案可以看出, 本发明实施例具有以下优点:
本发明实施例中,由于可以获取根据待编码的矢量获取得到该矢量对应的 幅度矢量和长度矢量,并根据排序后的幅度矢量以及排序后的长度矢量进行置 换编码, 幅度矢量和长度矢量的获取是随编解码过程实时进行的, 所以也就无 需存储每个 Leader对应的表征各层移除元素数值大小的矢量和表征分层组合 编码参数的矢量, 因此能够有效地减少存储复杂度;
其次, 本发明实施例中,在对幅度矢量以及长度矢量进行排序后得到的是 顺序有规律的矢量,因此能够按照最优元素移除顺序对待编码的矢量各元素出 现的位置顺序进行置换编码,从而能够降低编码过程的计算复杂度,提高编码 性能。
附图说明
图 1为本发明实施例中编码方法一个实施例示意图;
图 2为本发明实施例中解码方法一个实施例示意图;
图 3为本发明实施例中编码方法另一实施例示意图;
图 4为本发明实施例中解码方法另一实施例示意图;
图 5为本发明实施例中编解码系统实施例示意图;
图 6为本发明实施例中编码装置实施例示意图;
图 7为本发明实施例中解码装置实施例示意图。
具体实施方式
由于现有技术中的宽带嵌入式变速率编码器 G.718具体采用的是对待编码 矢量的符号和绝对值矢量进行单独的索引值编码,而对绝对值矢量的索引值编 码使用基于分层组合的格型码书索引编码方法, 导致该方法需要存储每个 Leader对应的表征各层移除元素数值大小的矢量和表征分层组合编码参数的 矢量, 从而增加了存储复杂度。
本发明实施例提供了一种编码、 解码、 编解码方法、 编解码系统以及相关 装置, 用于减少存储复杂度, 提高编码性能。 本发明实施例中提供的编码方法如图 1所示, 具体包括:
101、 在预置的码书索引值偏移量表中查询待编码的矢量对应的码书索引 值偏移量;
本实施例中, 在编码端预先存储有一个码书索引值偏移量表, 该表用于指 示矢量与幅度绝对值矢量和符号矢量之间的对应关系,该表与现有技术中的码 书索引值偏移量表类似, 此处不做限定。
根据待编码的矢量即可确定对应的码书索引值偏移量,用以表示幅度绝对 值索引值和符号索引值。
102、 获取待编码的矢量对应的幅度矢量和长度矢量;
本步骤中, 根据待编码的矢量即可获取到对应的幅度矢量以及长度矢量, 具体可以根据待编码的矢量所属的 Leader矢量获取得到, 同样也可以根据待 编码的矢量计算得到。
需要说明的是,一个矢量对应的幅度矢量表示该矢量中包含的具有不同数 值大小的元素;一个矢量对应的长度矢量表示幅度矢量中每一个元素在该矢量 中出现的次数。
103、 对幅度矢量以及长度矢量按照预置的排序规则进行排序;
本实施例中, 为了能够按照最优元素移除顺序进行置换编码, 因此本步骤 中需要首先对幅度矢量以及长度矢量进行排序。
具体排序的方法可以先对幅度矢量的元素按照一定的规律进行重新排列, 并相应地调整长度矢量中各元素的顺序,再对长度矢量的元素按照一定的规律 进行重新排列, 并相应地调整幅度矢量中各元素的顺序;
也可以是对长度矢量中的元素按照一定的规律进行重新排列,并相应地调 整幅度矢量中元素的顺序,对于排序后长度矢量中元素相等的情况, 其相应幅 度矢量中的元素应该按照一定的规律再进行一次调整。
此外, 排序使用的规律也有很多种, 可以按照从大到小的顺序进行, 也可 以按照从小到大的顺序进行, 此处不做限定。
104、 对待编码的矢量各元素出现的位置顺序进行置换编码得到位置索引 值;
本实施例中,根据排序后的长度矢量和幅度矢量,按照最优的元素移除顺 序, 对待编码的矢量各元素出现的位置顺序进行置换编码, 得到位置索引值。 最优移除顺序即按照长度矢量中元素由大到小顺序所对应的幅度矢量的 元素顺序。
105、 根据码书索引值偏移量和位置索引值, 计算最终的待编码的矢量对 应的格型码书索引值。
本实施例中,由于可以根据待编码的矢量获取得到该矢量对应的幅度矢量 和长度矢量, 并根据排序后的幅度矢量以及长度矢量,按照最优元素移除顺序 进行置换编码, 幅度矢量和长度矢量的获取是随编码过程实时进行的, 所以也 就无需存储每个 Leader对应的表征各层移除元素数值大小的矢量和表征分层 组合编码参数的矢量, 因此能够有效地减少存储复杂度;
其次, 本发明实施例中,在对幅度矢量以及长度矢量进行排序后得到的是 顺序有规律的矢量,因此能够按照最优元素移除顺序对待编码的矢量各元素出 现的位置顺序进行置换编码,从而能够降低编码过程的计算复杂度,提高编码 性能。
上述描述了本实施例中的编码过程,下面描述与上述编码过程对应的解码 过程:
请参阅图 2, 本发明实施例中解码方法一个实施例包括:
201、 在预置的码书索引值偏移量表中查询小于接收到的格型码书索引值 且数值最大的码书索引值偏移量;
本实施例中, 当解码端接收到编码端发送的格型码书索引值后,在与编码 端相同的码书索引值偏移量表中查找小于接收到的格型码书索引值的码书索 引值偏移量,之后再在查找到的码书索引值偏移量中取最大的码书索引值偏移 量。
202、 根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢 量以及长度矢量;
根据此码书索引值偏移量在码书索引值偏移量表中的标号确定矢量中包 含的元素值, 并得到对应的幅度矢量和长度矢量。
203、 从格型码书索引值中减去该码书索引值偏移量得到新索引值;
204、 对幅度矢量以及长度矢量按照预置的排序规则进行排序; 本实施例中,对幅度矢量和长度矢量中的元素顺序按照与编码端相同的排 序规则进行排序, 但是对幅度矢量和长度矢量排序的先后顺序不做限定。
205、 根据获取到的新索引值, 排序后的幅度矢量, 以及排序后的长度矢 量解码得到矢量。
根据排序后的长度矢量和幅度矢量, 按照与编码端相同的元素移除顺序, 由新的索引值解码出位置矢量, 并得到按照幅度矢量、长度矢量和位置矢量生 成新矢量, 该矢量即为接收到的格型码书索引值对应的矢量。
需要说明的是,在实际应用中,上述编码方法以及解码方法可以结合使用, 也可以独立使用。 述:
发明应用到基于 Gosset格的格型矢量量化器的码书索引编解码中。 基于 Gosset格的格型矢量量化器的码书由最基本的 Root Leader矢量经过元素符号 以及位置的变化产生。 每一个 Root Leader矢量只经过元素符号的变化后构成 一系列 Leader矢量, 每一个 Leader矢量再经过元素位置的变化, 最终构成整 个码书。 Root Leader矢量中各元素均为非负数, 且按照从大到小的顺序排列。 在基于 Gosset格的格型矢量量化器中只存储了所有 Root Leader矢量对应的幅 度矢量和长度矢量。 Root Leader矢量对应的幅度矢量表征了对应的矢量中不 同元素数值的大小, 元素值按照由大到小的顺序排列。 Root Leader矢量对应 的长度矢量表征了对应的矢量中不同元素值各自出现的次数。 由 Root Leader 矢量对应的幅度矢量和长度矢量可以很容易地计算相应的 Root Leader矢量, 根据 Root Leader及元素符号的变换规律,可以计算出每一个 Root Leader矢量 下对应的 Leader矢量及 Leader矢量对应的幅度矢量和长度矢量。
编码端在码书中搜索与待量化矢量距离最近的矢量, 得到待编码的矢量, 同时可以得到相应的 Root Leader矢量、 Leader矢量。
首先对 Root Leader矢量以及 Leader矢量进行筒要介绍:
Root Leader又可称为根引导项。 在格型码书中, 如果一些码字可以由一 个矢量通过元素符号和位置顺序的变换得到, 这个矢量就称为 Root Leader矢 量, 这些码字就属于同一个 Root Leader。 Root Leader矢量中的元素均为非负 数,通常也按照元素值由大到小的顺序排列。例如码字 [200]、 [020]、 [002] 、 [-200]、 [0-20]、 [00 -2]均可以由一个矢量 [200]经过元素符号和位置顺序的 变换得到, 那么矢量 [200] 就是这六个码字所属的 Root Leader矢量。
Leader又可称为引导项。在格型码书中,如果一些码字可以由一个矢量通 过元素位置顺序的变换得到, 这个矢量就称为 Leader矢量, 这些码字就属于 同一个 Leader。 Leader矢量中的元素通常按照元素值由大到小的顺序排列。例 如码字 [200]、 [020]、 [002]均可以由一个矢量 [200]经过元素位置顺序的变 换得到,那么矢量 [200] 就是这三个码字所属的 Leader矢量;又例如码字 [-20 0]、 [0-20]、 [00 -2]均可以由一个矢量 [00 -2]经过元素位置顺序的变换得到, 那么矢量 [00 -2]就是这三个码字所属的 Leader矢量。
下面进行具体介绍:
以一个 8比特量化的 8维 Gosset格型矢量量化器为例, 该格型矢量量化 器包含的 Root Leader矢量: 第 0个 Root Leader矢量 [2 2 0 0 0 0 0 0]和 第 1个 Root Leader矢量 [1 1 1 1 1 1 1 1]。 第 0个 Root Leader矢量对应的 Leader矢量包括: 第 0个 Leader矢量 [2 2 0 0 0 0 0 0], 第 1个 Leader 矢量 [2 0 0 0 0 0 0 -2], 第 2个 Leader矢量 [0 0 0 0 0 0 -2 -2]; 第 1 个 Root Leader 矢量对应的 Leader 矢量包括: 第 0 个 Leader 矢量 [1 1 1 1 1 1 1 1],第 1个 Leader矢量 [1 1 1 1 1 1 -1 — 1] ,第 2个 Leader 矢 量 [1 1 1 1 —1 —1 —1 —1] , 第 3 个 Leader 矢 量 [1 1 -1 -1 -1 -1 -1 -1] 第 4 个 Leader 矢 量
Figure imgf000009_0001
i设待编码的矢量为 X = [0 0 0 -2 0 2 0 0]。 由于 Leader 矢量 [2 0 0 0 0 0 0 -2]经过元素位置的变化可以得到 X 矢量, 因此待编码的 矢量 X对应的 Leader矢量为 [2 0 0 0 0 0 0 -2]。 由于 Root Leader矢量 [2 2 0 0 0 0 0 0]经过元素符号和位置的变化可以得到 X矢量,因此待编 码的矢量 X对应的 Root Leader矢量为 [2 2 0 0 0 0 0 0]。
同样请参阅图 1,应用于 Gosset格的格型矢量量化器中时的编码方法具体 包括:
101、 在预置的码书索引值偏移量表中查询待编码的矢量对应的码书索引 值偏移量;
对待编码的矢量对应的幅度绝对值矢量和符号矢量进行索引编码。这里对 待编码的矢量中各元素的符号和幅度值进行联合编码,在码书索引值偏移量表 中查找待编码的矢量对应的码书索引值偏移量。
本实施例中的码书索引值偏移量表具体可以为:
Offset_table[2] [5]= {
{ 0, 28, 84 } ,
{ 112, 113, 141, 211, 239 } 其中, 表格的行数对应了量化器包含的 Root Leader矢量的个数, 各行的 列数为量化器包含的该 Root Leader矢量所属的 Leader矢量的个数。 在码书索 引值偏移量表中查找待编码的矢量对应的码书索引值偏移量时,表格的行下标 代表了与待编码的矢量对应的 Root Leader矢量在码书中的标号 (本实施例矢 量 X属于第 0个 Root Leader矢量, 因此行下标为 0 ) ,表格的列下标代表了该 Root Leader矢量所属的待编码的矢量对应的 Leader矢量的标号 (本实施例矢 量 X属于第 0个 Root Leader矢量的第 1个 Leader矢量, 因此列下标为 1 )。
该码书索引值偏移量可以记作 idxOffset。具体地, 可以根据与待编码的矢 量对应的 Root Leader矢量和待编码的矢量之间的符号差异得到表征待编码的 矢量中各元素符号的标号 (本实施例为 1 ), 该标号即为对应的 Leader矢量的 标号, 也就是列下标的标号。
由于 Root Leader矢量中的元素均为非负数, 因此也可以说是根据待编码 的矢量中绝对值相同的非零元素的符号的个数,计算出表征待编码的矢量中各 元素符号的标号。 然后根据与待编码的矢量对应的 Root Leader矢量在码书中 的标号(本实施例为 0 ) 以及上面得到的表征待编码的矢量中各元素符号的标 号 (本实施例为 1 ), 在码书索引值偏移量表中查找对应的码书索引值偏移量 (即码书索引值偏移量即表格第 0行、 第 1列的值: 28 )。 码书索引值偏移量 表是根据基于 Gosset格的格型码书的结构事先计算并存储的。 表格第 i行第 j 列的值为第 0到第 i-1个 Root Leader矢量所能生成的所有码字的个数加上第 i 个 Root Leader矢量所属的第 0到第 j-1个 Leader矢量所能生成的所有码字的 个数。 在本实施例中, 以第 1行第 1列为例, 第 0个 Root Leader矢量经过元 素符号和位置变化后可以得到 112个码字, 第 1个 Root Leader矢量所属的第
0个 Leader矢量经过元素位置变化后可以得到 1个码字,因此第 1行第 1列的 值为 112+1=113。
102、 获取待编码的矢量对应的幅度矢量和长度矢量;
本实施例中, 幅度矢量和长度矢量可以根据待编码的矢量所属的 Leader 矢量获得, 例如待编码的矢量所属的 Leader矢量为 [2 0 0 0 0 0 0 -2] , 则 幅 度 矢 量 为 μ μ。 Α··· ν [2 0 - 2] 长 度 矢 量 为 W Wn W, W [1 6 1] , Lp =3 , Lp
V 其中 为幅度矢量和长度矢量的维数, 表示待编码的矢量中元素值不同的元素的数目。
幅度矢量和长度矢量也可以根据待编码的矢量获得,例如待编码的矢量为 X = [0 0 0 - 2 0 2 0 0] , 贝1 J 对 应 的 幅 度 矢 量 为 μ [0 - 2 2] , 长度矢量为 W Wn w, w : [6 1 1] , Lp =3 ,
V
其中 Lp为幅度矢量和长度矢量的维数, 表示待编码的矢量中元素值不同的元 素的数目。
103、 对幅度矢量以及长度矢量按照预置的排序规则进行排序;
本实施例中, 可以先对幅度矢量的元素按照从大到小的规律进行重新排 列, 并相应地调整长度矢量中各元素的顺序,再对调整后的长度矢量的元素按 照从大到小的规律进行重新排列, 并相应地调整幅度矢量中各元素的顺序。
如果幅度矢量和长度矢量是根据待编码的矢量所属的 Leader矢量获得的, 那么原始幅度矢量的元素已经是按照从大到小的顺序排列,只需要对长度矢量 的元素按照从大到小的规律进行重新排列,并相应地调整幅度矢量中各元素的 顺序即可。
若根据待编码的矢量获得的幅度矢量和长度矢量, 则原始的幅度矢量为
[0 2] ,长度矢量为 W Wn W, w [6 1 1]
V 。先对幅 度 矢 量 的 元 素 按 照 从 大到 小 的 规律进行重 新排 列 得 到
, 并相应地调整长度矢量中各元素的顺序得到 ; 再对调整后的长度矢量的元素按照从大到小的
Figure imgf000011_0001
规律进行重新排列得到 Wn W, W [6 1 1] ,
V 并相应地调整幅度矢量 中各元素的顺序得 - 2]
- 。 将最终得到的排序后的幅度 矢量 己为 μ = [0 排序后 的 长度矢量记为 W Wn W, W [6 1 1]。
V
若根据待编码的矢量所属的 Leader矢量获得的幅度矢量和长度矢量, 则 由于原始幅度矢量的元素已经是按照从大到小的顺序排列,因此只需要对长度 矢量的元素按照从大到小的规律进行重新排列。 根据待编码的矢量所属的
Leader矢量获得的原始长度矢量为 W Wn W, w [1 6 1] ,
V 原始幅度矢量 为 Ά [2 0 - 2],长度矢量按照元素从大到小的顺序重新排列后 变为 W' =「w w卜 w [6 1 1] , 然后相应的调整幅度矢量中各元素的顺序, 得到调整后的幅度矢量 : [0 2 - 2]。 将最终得到的排序后的 幅度矢量记为 μ' = [o ■2] 排序后的长度矢量记为 W Wn W, w [6 1 1]。
V
需要说明的是,也可以先对长度矢量的元素按照从大到小的规律进行重新 排列, 并相应地调整幅度矢量中元素的顺序; 对于排序后长度矢量中元素相等 的情况, 其相应幅度矢量中的元素应该按照从大到小的规律再进行一次调整: 以根据待编码的矢量获得的幅度矢量和长度矢量为例, 在编码过程中(即 步骤 103中)对原始长度矢量中的元素按照从大到小的规律进行重新排列得到
W Wn W, ••wLp = [6 1 1] , 并相应地调整原始幅度矢量中元素的顺序得到
[0 -2 2]; 对于排序后长度矢量中元素相等的情况(排序后 长度矢量中下标为 1和 2的元素均为 1 ), 其相应幅度矢量中的元素应该按照 从大到小的规律再进行一次调整,即按照从大到小的规律调整幅度矢量中下标 为 1和 2的元素得到 μ" ' - 2]
- 。 将最终得到的排序后的幅 度矢量记为 μ' ) " - /"LP-I = [0 排序后的长度矢量记为 W Wn W, W [6 1 1]。
V
由此可知, 无论是根据待编码的矢量所属的 Leader矢量获得的幅度矢量 和长度矢量,还是根据待编码的矢量获得的幅度矢量和长度矢量, 经过重新排 列后的幅度矢量和长度矢量是一致的。
此外,幅度矢量和长度矢量排序时所使用的规律可以是均按照从大到小的 顺序进行; 可以是均按照从小到大的顺序进行; 也可以是对幅度矢量按照从大 到小的顺序进行,对长度矢量按照从小到大的顺序进行; 还可以是对长度矢量 按照从大到小的顺序进行, 对幅度矢量按照从小到大的顺序进行:
例如, 先对幅度矢量的元素按照从大到 ' j、的规律进行重新排列得到
[2 0 -2] ,
1 并相应地调整长度矢量中各元素的顺序得到
W wn w, w
V =[1 6 1];
再对调整后的长度矢量的元素按照从小到大的规律进行重新排列得到 W Wn W, W =[1 1 6]
1 , 并相应地调整幅度矢量中各元素的顺序得 μ ) A ··· " [2 -2 0]。
V】
104、 对待编码的矢量各元素出现的位置顺序进行置换编码得到位置索引 本实施例中的元素移除顺序是指待编码矢量中元素出现频率由高到低的 顺序, 即是出现次数多的元素先移除。 具体地, 元素移除可以按照排序后的长 度矢量元素值由大到小对应的排序后的幅度矢量中对应的元素顺序进行。
在 本 实 施 例 中 最 终 得 到 的 排 序 后 的 长 度 矢 量 为 W' =「w wi' w p— i] = [6 1 1] , 4非 序 后 的 幅 度 矢 量 为 =[ ;… / — ^ = [0 2 -2]。 由于长度矢量中元素是按照由大到小顺序重新 排列的,因此只要按照排序后相应的幅度矢量下标从小到大的顺序移除就可以 了。本实施例中将待编码的矢量分解为 Lp层,并以待编码的矢量作为最高层矢 量, 采用基于分层组合的索引值编码方法,根据上一步排序后的长度矢量和幅 度矢量,对待编码的矢量各元素出现的位置顺序进行置换编码,得到位置索引 值。 具体可以通过如下过程得到该位置索引值 idxVecLocal:
(1)将待编码的矢量分解为 Lp层, 以待编码的矢量作为最高层矢量。 换 句话说第 0层矢量为待编码的矢量。继续上面的例子, 第 0层矢量为待编码的 矢量, [0 0 0 -2 0 2 0 0]。
(2)增加 n值。 在第 n层(0< n<LP), 通过从上一层 ( n-1层) 矢量中 移除出现频率最高的元素 ( )得到一个新的矢量, 这个当前层的新的矢量 是由剩余的元素构成的, 新矢量中元素的位置顺序根据第 n-1层矢量有关。 所 有的剩余元素的位置值构成了一个位置矢量。 继续上面的例子, 层数 Lp=3, 在第 1层, 从第 0层矢量(原始的矢量)
Figure imgf000013_0001
=0 , 则第 1层得 到的新的矢量为 [-2 2], 位置矢量为 [3 5] ; 在第 2层, 从第 1层矢量 [-2 2]中 移除元素 ^ ;二 , 则第 2层得到的新的矢量为 [-2] , 位置矢量为 [0]。
(3)对与上一层 (第 n-1层) 矢量相关的当前层 (第 n层) 矢量的位置 矢量的编码是基于排列组合函数进行的, 其索引值记作 mid_idxn。 对于当前层 的新的矢量, 位置矢量索引值可以由以下的计算公式得到:
mid_idXn =C-:i -C-:i_Po +∑( !-^ - :——― P, )
i=l
idxVecLocal = idxVecLocal*Cmn + mid idx
idxVecLocal在步骤( 1 )之前被初始化为 0。 其中, P。、 、 P2……是第 n 层位置矢量包含的元素值,根据其层数范围为从位置矢量左侧到右侧的所有元 素; mn4为上一层(第 n-1层) 矢量的维数; !¾为当前层(第 n层) 矢量的维 数; C 代表排列组合公式 C = ^ '· 、 , p,m={l, ,L}, 且 p > m, L为 m - p— my.
待编码的矢量的维数。 所有可能的 1的值可以事先存在一个表格中, 这样可 以避免程序中的阶乘计算。 第 n-l层的索引值 idxVecLocal乘以当前层的可能 索引值的总数 C 之后再加上当前层索引值 mid_idxn , 就得到了当前层的索引 值 idxVecLocal。
按照本实施例中的例子, 在第 1层, 上一层(第 0层) 矢量的维数是 8, 因此 mn4=8, 当前层(第 1层)新的矢量的维数是 2, 因此 mn=2, 则索引值:
i<mn
mid_idXl = C- -C- _Po +∑ (d i -C--, )
i=l
—C8 _C8— p。 + ^(c _P _C8Pi)— C8 _C8p。 + C8_po_1 _C8
= C8 2 - C— 3 + c _3_1 - C— 5 =28-10+4-3=19 ,
idxVecLocal = idxVecLocal*Cm» +mid index =0*CS 2 +19=19。
在第 2层, 上一层 (第 1层) 矢量的维数是 2, 因此 1
2层)新的矢量的维数是 1, 因此 mn=l, 那么索引值:
i<mn
mid— inde^ = C^ -C- _Po +∑ (C^, -C^ ) 一 C2 _ C2_po— C2— C2— o—2-2—0 ,
idxVecLocal = idx VecLocal*Cmn +mid index =19* C1? +0=19*2+0=38 c
即本实施例中计算得到的位置索引值为 38。 需要说明的是,在上述实施例中的步骤 104中最优的移除顺序始终是按照 待编码的矢量中元素出现频率由高到低进行的。 若在上述实施例中的步骤 103 中长度矢量中元素是按照由小到大顺序重新排列的,移除顺序则按照排序后相 应的幅度矢量下标从大到小的顺序移除。以排序时使用的规律为对幅度矢量按 照从大到小的顺序进行,对长度矢量按照从小到大的顺序进行为例,排序后的 长度矢量记为 W' = |w w; . " w p—」= [1 1 6] , 相应的排序后的幅度矢量记为 μ' = A'… ij= [2 - 2 0]。
在本实施例的步骤 104的步骤(2 ) 中: 在第 n层 (0< n < Lp ), 从上一层
( n-1 层) 矢量中移除出现频率最高的元素, 这个元素从原来的 ^, 变成了 η。
105、 根据码书索引值偏移量和位置索引值, 计算最终的待编码的矢量对 应的格型码书索引值。
本实施例中,根据码书索引值偏移量和位置索引值, 计算最终的待编码的 矢量对应的格型码书索引值。具体地, 最终的待编码的矢量对应的格型码书索 引值 indexVector_NT = idxOffset + idxVecLocal。
按照本实施例中前述计算得到的格型码书索引值以及位置索引值可知: indexVector_NT = idxOffset + idxVecLocal=28+38=66。
上述介绍了本实施例中的编码方法详细流程,下面介绍与上述编码方法对 应的解码方法, 具体同样请参阅图 2, 包括:
201、 在预置的码书索引值偏移量表中查询小于接收到的格型码书索引值 且数值最大的码书索引值偏移量;
本实施例中,在预置的码书索引值偏移量表中查询比格型码书索引值小的 全部码书索引值偏移量,之后再在这些码书索引值偏移量中确定最大的码书索 引值偏移量。
本实施例中, 解码端接收到的格型码书索引值为 66, 在如下码书索引值 偏移量表中进行查询:
Offset_table[2][5]= {
{0, 28, 84 } ,
{ 112, 113, 141, 211, 239}
}; 该码书索引值偏移量表与编码端中存储的码书索引值偏移量表一致。 从该码书索引值偏移量表中查找到 0<28<66<84,即比 66小的码书索引值 偏移量有两个, 分别为 0和 28, 之后再在这两个码书索引值偏移量中取最大 值, 所以码书索引值偏移量为 28。
202、 根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢 量以及长度矢量;
码书索引值偏移量 28 在码书索引值偏移量表中对应的表征所属 RootLeader的标号为 0、 表征元素符号的标号为 1 , 表示第 0个 RootLeader所 属的第 1个 Leader。 经过编码端元素符号标号计算的逆过程, 由元素符号的标 号为 1可知 Root Leader矢量和 Leader矢量之间的符号差异为第 1种情况, 即 非零元素相差 1 个符号。 由 RootLeader矢量可以得到相应的 Leader矢量为 [2 0 0 0 0 0 0 -2] ,则幅度矢量为〃 = [ 。 ·· = [2 0 —2] ,长度矢量 为\^ =「\¥。 Wf WLp— ^ = [1 6 1]。
203、 从格型码书索引值中减去该码书索引值偏移量得到新索引值; 从格型码书索引值中减去码书索引值偏移量,得到新的索引值。格型码书 索弓 I值记作 indexVector_NT , 码书索引值偏移量记作 idxOffset , 新的索引值记 作贝1 J idxVecLocal , 贝1 J idxVecLocal = indexVector_NT - idxOffset。 列: ¾口, idxVecLocal= indexVector_NT - idxOffset = 66-28 =38。
204、 对幅度矢量以及长度矢量按照预置的排序规则进行排序;
解码端可以采用和编码端相同的排序方法,先对幅度矢量的元素按照从大 到小的规律进行重新排列, 并相应地调整长度矢量中各元素的顺序,再对调整 后的长度矢量的元素按照从大到小的规律进行重新排列,并相应地调整幅度矢 量中各元素的顺序。
由于本实施例中对幅度矢量选择了由大到小的元素排列顺序,而解码端获 得 Leader矢量对应的幅度矢量已经按此顺序排列, 因此只需要对长度矢量的 元素按照从大到小的规律进行重新排列,并相应地调整幅度矢量中各元素的顺 序即可。 例如, 原始的幅度矢量为 = [ 。 · · ι] = [2 0 - 2] , 长度矢量为
W w0 w - - wLp_ [1 6 1] , 其中 LP=3。 则按照长度矢量中元素值由大到小 的顺序重新排列后的长度矢量变为 W' Wn W, w [6 1 1]
V , 相应的调碧 幅度矢量中各元素的顺序后得到幅度矢量 ) Α··· [0 2] 解码端也可以先对长度矢量中的元素按照从大到小的规律进行重新排列, 并相应地调整幅度矢量中元素的顺序, 对于排序后长度矢量中元素相等的情 况, 其相应幅度矢量中的元素应该按照从大到小的规律再进行一次调整。
需要说明的是,编解码端对幅度矢量和长度矢量排序的先后顺序可以不一 样,但是排序时所遵守的预置的排序规则必须一致。编码端先排序幅度矢量再 排序长度矢量, 则解码端可以先排序幅度矢量再排序长度矢量, 也可以先排序 长度矢量再排序幅度矢量。编码端先排序长度矢量再排序幅度矢量, 则解码端 可以先排序幅度矢量再排序长度矢量, 也可以先排序长度矢量再排序幅度矢 量。 但是编解码端长度矢量内部元素排序时所遵守的元素顺序规律必须一致: 编码端长度矢量内部元素排序时所遵守的元素顺序规律是从大到小,则解码端 也必须是从大到小。编码端长度矢量内部元素排序时所遵守的元素顺序规律是 从小到大, 则解码端也必须是从小到大。 同样, 编解码端幅度矢量内部元素排 序时所遵守的元素顺序规律必须一致:编码端幅度矢量内部元素排序时所遵守 的元素顺序规律是从大到小, 则解码端也必须是从大到小。编码端幅度矢量内 部元素排序时所遵守的元素顺序规律是从小到大, 则解码端也必须是从小到 大。
205、 根据获取到的新索引值, 排序后的幅度矢量, 以及排序后的长度矢 量解码得到矢量。
本步骤具体可以包括:
( 1 )得到索引值 mid_idxn: 新的索引值 idxVecLocal被分解成几个中间索 引值, 这些中间索引值分别对应从最低层到最高层的各个层。 以新的索引值 idxVecLocal作为对应最低层的起始值。 每一个较低层的中间索引值是由索引 值除以可能索引值的总数 C 得到的, 商为下一个较低层的索引值, 余数为当 前层的中间索引值 mid_idxn
层数 n 逐渐递减( L„ > n >0) 。 mid _ idx = idxVecLocal % C , idxVecLocal = [idxVecLocal / C^」,%表示取余数运算, L.」表示向下取整运算, mn—丄 为上一层 (第 n-1层) 的维数, mn为当前层(第 n层) 的维数,
Figure imgf000017_0001
对应编码端的例子, 索引值 idxVecLocal=38, 该索引值被分解成为 Lp -1=2
Lp-l Lp - 1
个中间索引值: 对于 n= Lp -l=2, m2 =∑w; = w =l , = w; = w; + w =l+l=2,
i=2 i=l
mid_idx = idxVecLocal % C"» =38 % C"2 =38%2=0, idxVecLocal = I L idxVecLocal I Cm nil2 |=19
对于 n=l , m Z w[ = w0 +wj + Wj =6+1+1=8, mid idx, = idxVecLocal % Cm» =19 % Cmi =19%28=19,
idxVecLocal = I idxVecLocal I Cmi |=0
(2)位置矢量解码: 基于排列组合函数对每一个较低层的中间索引值 mid_idxn进行解码, 得到对应于上一层矢量的每一个较低层的位置矢量。 为了 在每一个较低层由中间矢量得到位置矢量,此算法应用了排列组合函数来估计
11
位置序列。 估计的步骤如下: 0
Λ
第一步,初始化 i=l,从 0开始增力。 pos的值, 直到中间索引值 mid_idxn不 再大于 C -Cm- ;,
第二步,取 P=p0S-l作为位置矢量的第一个元素值,从中间索引值 mid_idxn 中减去 C -Cm" ;
第三步, 从 Ρι4+1开始继续增加 pos的值, 直到中间索引值 mid_idxn不再大 于 d c: , 其中 Pw为前一步解码出的位置值;
第四步, 取 Pi=p0S—i 作为位置矢量中标号为 i 的元素值, 从中间索引值 mid_idxn中减去 , i=i+l;
第五步, 重复第三步和第四步, 直到当前层位置序列包含的所有位置值都 被解码出来。
具体到上述实例中,对于 n=l层来说, midjdx^l^ mn4 = m =8, mn = mi=2, 弟¾:一一 -步:
pos: =0, - 2
^8
pos: =pos+l=l, 一 2 2
~~ ^8 ^8-1 =7<19;
pos: =pos+l=2, 一 2 2 =13<19;
pos: =pos+l=3, 一 2 2
― ^8 ^8-3 =18<19;
pos: =pos+l=4, 一 2 2 =22>19,
P =pos-l=3, mid idx, = mid idx,-(cm- -Cm" )=19-( 2 -C„%) =19-18=1: noUs¾=P rG +1=4, ' C °mm,n_~, -{ _, -1 _ °mm,-_~,{ =Γ ^82-31-1 -Γ ^82-41 =0 W 11 ' , pos=pos+l=5, i - = C8 2: - C8 2—- =l=mid_idXl
pos=pos+l=6, 「「 。 S = C8 2— - - C8 2— 2>1, 停止;
第四步:
Pi=p0S-l=5。 当前层位置序列包含的所有位置值都被解码出来了。
同理, 对于 n=2层来说 mid_idx2=0, P0=0
(3)产生矢量: 从最低层到最高层一层一层进行。 根据位置参数, 每一 个较低层矢量被用来替换上一层矢量的部分元素,解码出的最高层矢量为输出 的矢量。 对于最低层来说, 矢量中只包含一个元素值种类, 这个值可以根据重 新排序后的幅度矢量得到。 最低层的矢量被传递到下一层,在下一步中另一个 元素值种类被加进来。 这个新的元素值也是根据重新排序后的幅度矢量得到。 此过程被重复, 直到最高层矢量产生完毕。
按照上述实例:
在第 0层, μ0' =0, 第 0层矢量 Υ=[00000000];
在第 1层层, Α' =2, Ρ=[35], 第 1层矢量 Υ=[00020200];
在第 2层, =-2, Ρ=[0], 第 2层矢量 Υ=[000-20200];
由于总层数为 3层, 因此第 2层矢量即为最高层矢量, 所以 Υ=[000-20
200]为最终得到的矢量。
需要说明的是,若在上述实施例中的步骤 204中长度矢量中元素是按照由 小到大顺序重新排列的, 相应的, 在步骤 205中:
(1)和(2) 步骤中的表示当前层(第 η层) 维数的 !¾的计算公式由变
Lp-1-n
成了 mn = ;
i=0
(3)步骤中, 从第 0层到第 Lp-1层新元素的添加顺序不再是 而变成 了 d-n
上述实施例中,由于可以获取根据待编码的矢量获取得到该矢量对应的幅 度矢量和长度矢量, 并根据排序后的幅度矢量以及长度矢量,按照最优元素移 除顺序进行置换编码, 幅度矢量和长度矢量的获取是随编码过程时实进行的, 所以也就无需存储每个 Leader对应的表征各层移除元素数值大小的矢量和表 征分层组合编码参数的矢量, 因此能够有效地减少存储复杂度;
其次, 本发明实施例中,在对幅度矢量以及长度矢量进行排序后得到的是 顺序有规律的矢量,因此能够按照最优元素移除顺序对待编码的矢量各元素出 现的位置顺序进行置换编码,从而能够降低编码过程的计算复杂度,提高编码 性能。
上述描述了基于 Gosset格的格型矢量量化器的码书索引编解码的过程, 在实际应用, 本实施例中的编解码过程同样还可以基于 RE8格的格型矢量量 化器的码书索引编解码, 或者其他类型的格型矢量量化器的码书索引编解码。
下面介绍另外一种编码方法, 具体请参阅图 3 , 本发明实施例中编码方法 另一实施例包括:
301、 在预置的码书索引值偏移量表中查询待编码的矢量对应的码书索引 值偏移量;
本实施例中, 编码端找到离待量化矢量最近的格点, 此格点即为待编码的 矢量。
根据待编码的矢量所属的 Root Leader矢量, 在事先存储好的码书索引值 偏移量表中查找相应的码书索引值偏移量 idxOffset。
302、 对矢量中的符号矢量进行单独编码得到符号索引值;
本实施例中, 将待编码的矢量的符号矢量分离出来, 单独进行符号编码, 得到符号索引值 idxSign。
编码所需的比特数 N等于待编码的矢量中非零元素的个数。 所有可能的 符号编码的总数为 2N。 例如, 待编码的矢量为 X = [0 0 0 - 2 0 2 0 0] , 则 符号矢量为 [0 0 0 -1 0 1 0 0] , 去除零元素后为 [-1 1] , 假设用 1表示符号为正, 0表示符号为负 (可以理解的是, 同样也可以用 0表示正, 1表示负)进行编 码, 编码值为二进制数 01 , 转换为十进制数即 1。 待编码的矢量中非零元素的 个数 N=2, 因此所有可能的符号编码的总数为 2N =4。
303、 获取无符号待编码的矢量对应的幅度矢量和长度矢量;
304、 对幅度矢量以及长度矢量按照预置的排序规则进行排序;
305、 对无符号待编码的矢量各元素出现的位置顺序进行置换编码得到位 置索引值;
需要说明的是,本实施例中的步骤 303至步骤 305与本发明实施例中编码 方法第一实施例中的步骤 102至步骤 104类似, 此处不再赘述, 具体结果为: 无符号待编码的矢量所属 Root Leader矢量对应的幅度矢量为 [2 0] , 长度矢量 为 [2 6] , 无符号待编码的矢量为 [ 0 0 0 2 0 2 0 0]。
306、 根据码书索引值偏移量, 符号索引值, 位置索引值计算矢量的格型 码书索引值。
根据得到的符号索引值、位置索引值及码书索引值偏移量, 计算最终的待 编码的矢量对应的格型码书索引值 indexVector_NT。 具体地, 最终的待编码的 矢量对应的格型码书索引值 indexVector_NT = idxOffset + 2N * idxVecLocal + idxSigri。
下面介绍与上述编码方法对应的解码方法实施例:
请参阅图 4, 本发明实施例中的解码方法另一实施例包括:
401、 在预置的码书索引值偏移量表中查询小于接收到的格型码书索引值 且数值最大的码书索引值偏移量;
解码端在接收到格型码书索引值之后,在码书索引值偏移量表中查找小于 接收到的格型码书索引值的码书索引值偏移量,之后再在查找到的码书索引值 偏移量中取最大的值作为码书索引值偏移量 idxOffset。
402、 根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢 量以及长度矢量;
根据步骤 401 中的码书索引值偏移量在码书中的标号确定矢量所属的 Root Leader矢量对应的按照元素数值由大到小顺序排列的幅度矢量和表征不 同元素值各自出现次数的长度矢量。
403、 从格型码书索引值中减去该码书索引值偏移量得到新索引值; 从格型码书索引值中减去码书索引值偏移量,得到新的索引值。格型码书 索弓 I值记作 indexVector_NT , 码书索引值偏移量记作 idxOffset , 新的索引值记 作则 rank, 贝1 J rank=indexVector_NT-idxOffset。
404、 从新索引值中分离出符号索引值和位置索引值;
根据所属的 Root Leader矢量中非零元素的个数 N, 从新的索引值 rank中 分离 出符号索引值 idxSign 和位置索引值 idxVecLocal。 具体地: idxSign=rank% 2N , idxVecLocal = [rank /2N J, %表示取余数运算, L」表示向下取 405、 根据符号索引值解码出非零元素符号矢量;
根据符号索引值 idxSign解码出非零元素的符号矢量。 例如, 符号索引值 idxSign=l , 变换成二进制数为 01 , 根据与编码端相同的编码准则, 用 1表示 符号为正, 0表示符号为负, 则非零元素的符号矢量为 [-1 1]。
406、 对幅度矢量以及长度矢量按照预置的排序规则进行排序;
407、 根据位置索引值, 排序后的幅度矢量, 以及排序后的长度矢量, 解 码得到无符号矢量;
需要说明的是,本实施例中的步骤 406至步骤 407与本发明实施例中解码 方法第一实施例中的步骤 204至步骤 205类似, 此处不再赘述。
408、 根据获取到的非零元素符号矢量以及无符号矢量计算得到矢量。 本实施例中, 根据无符号的矢量和非零元素的符号矢量生成最终的矢量。 例如, 无符号的矢量为 [0 0 0 2 0 2 0 0] , 非零元素的符号矢量为 [-1 1] , 则最终 的矢量为 [0 0 0 -2 0 2 0 0]。
需要说明的是,在实际应用中,上述编码方法以及解码方法可以结合使用, 也可以独立使用。
上述实施例中介绍了应用于 Gosset格以及应用于 RE8格的格型矢量量化 器的码书索引编解码过程, 可以理解的是, 在实际应用中, 本发明实施例中所 描述的编解码过程还可以应用于其他类似的格型矢量量化器中,具体类型此处 不做限定。
在上面描述的编码方法中,由于可以获取根据待编码的矢量获取得到该矢 量对应的幅度矢量和长度矢量, 并根据排序后的幅度矢量以及长度矢量,按照 最优元素移除顺序进行置换编码,幅度矢量和长度矢量的获取是随编码过程时 实进行的, 所以也就无需存储每个 Leader对应的表征各层移除元素数值大小 的矢量和表征分层组合编码参数的矢量, 因此能够有效地减少存储复杂度; 其次, 本发明实施例中,在对幅度矢量以及长度矢量进行排序后得到的是 顺序有规律的矢量,因此能够按照最优元素移除顺序对待编码的矢量各元素出 现的位置顺序进行置换编码,从而能够降低编码过程的计算复杂度,提高编码 性能;
再次, 编码过程中对幅度矢量以及长度矢量的排序可以采用多种方式, 因 此能够提高编码方法的灵活性。
下面介绍本发明实施例中的编解码系统, 请参阅图 5 , 本发明实施例中的 编解码系统包括:
编码装置 501以及解码装置 502;
编码装置 501 用于在预置的码书索引值偏移量表中查询待编码的矢量对 应的码书索引值偏移量, 获取待编码的矢量对应的幅度矢量和长度矢量,对幅 度矢量以及长度矢量按照预置的排序规则进行排序,对待编码的矢量各元素出 现的位置顺序进行置换编码得到位置索引值,根据码书索引值偏移量和位置索 引值,计算最终的待编码的矢量对应的格型码书索引值, 向解码装置 502发送 该格型码书索引值;
解码装置 502用于接收编码装置 501发送的格型码书索引值,在预置的码 书索引值偏移量表中查询小于接收到的格型码书索引值且数值最大的码书索 引值偏移量,根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度 矢量以及长度矢量,从格型码书索引值中减去该码书索引值偏移量得到新索引 值,对幅度矢量以及长度矢量按照预置的排序规则进行排序,根据获取到的新 索引值, 排序后的幅度矢量, 以及排序后的长度矢量解码得到矢量。
上述的编解码系统可以应用于 Gosset格的格型矢量量化器的编解码过程, 同样可以应用于 RE8格的格型矢量量化器的编解码过程, 或者还可以应用于 其他类型的格型矢量量化器的编解码过程,下面介绍另外一种可替代的编解码 方案, 具体地, 该种编解码系统包括:
编码装置 501 用于在预置的码书索引值偏移量表中查询待编码的矢量对 应的码书索引值偏移量, 对矢量中的符号矢量进行单独编码得到符号索引值, 获取无符号待编码的矢量对应的幅度矢量和长度矢量,对幅度矢量以及长度矢 量按照预置的排序规则进行排序,对无符号待编码的矢量各元素出现的位置顺 序进行置换编码得到位置索引值, 根据码书索引值偏移量, 符号索引值, 位置 索引值计算矢量的格型码书索引值, 向解码装置 502发送该格型码书索引值; 解码装置 502用于接收编码装置 501发送的格型码书索引值,在预置的码 书索引值偏移量表中查询小于格型码书索引值且数值最大的码书索引值偏移 量,根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢量以及 长度矢量,从格型码书索引值中减去该码书索引值偏移量得到新索引值,从新 索引值中分离出符号索引值和位置索引值,根据符号索引值解码出非零元素符 号矢量,对幅度矢量以及长度矢量按照预置的排序规则进行排序,根据获取到 的位置索引值,排序后的幅度矢量, 以及排序后的长度矢量解码得到无符号矢 量, 根据获取到的非零元素符号矢量以及无符号矢量计算得到矢量。
上述编解码系统中,由于编码装置 501可以获取根据待编码的矢量获取得 到该矢量对应的幅度矢量和长度矢量, 并根据排序后的幅度矢量以及长度矢 量,按照最优元素移除顺序进行置换编码, 幅度矢量和长度矢量的获取是随编 码过程时实进行的, 所以也就无需存储每个 Leader对应的表征各层移除元素 数值大小的矢量和表征分层组合编码参数的矢量,因此能够有效地减少存储复 杂度。
请参阅图 6, 本发明实施例中的编码装置实施例包括:
查询单元 601 , 用于在预置的码书索引值偏移量表中查询待编码的矢量对 应的码书索引值偏移量;
获取单元 602, 用于获取待编码的矢量对应的幅度矢量和长度矢量; 排序单元 603 , 用于对获取单元 602获取到的幅度矢量以及长度矢量按照 预置的排序规则进行排序;
置换编码单元 604,用于根据排序单元 603排序后的长度矢量和幅度矢量, 按照最优的元素移除顺序,对待编码的矢量各元素出现的位置顺序进行置换编 码, 得到位置索引值;
执行单元 605 , 根据查询单元 601查询到的码书索引值偏移量和置换编码 单元 604获取到的位置索引值,计算最终的待编码的矢量对应的格型码书索引 值, 并向解码装置发送该格型码书索引值, 具体的计算过程与前述编码方法实 施例中的计算过程一致, 此处不再赘述。
可以理解的是, 上述的编码装置可以应用于 Gosset格的格型矢量量化器 的编解码过程, 同样可以应用于 RE8格的格型矢量量化器的编解码过程, 或 者还可以应用于其他类型的格型矢量量化器的编解码过程,下面介绍另外一种 可替代的编解码方案, 则本实施例中的编码装置还可以进一步包括:
分离单元 606以及符号编码单元 607 , 则在该实施例中: 查询单元 601 , 用于在预置的码书索引值偏移量表中查询待编码的矢量对 应的码书索引值偏移量;
分离单元 606, 用于从待编码的矢量中分离出符号矢量;
符号编码单元 607, 用于对分离出的符号矢量进行单独编码得到符号索引 值;
获取单元 602 , 用于获取无符号待编码的矢量对应的幅度矢量和长度矢 量;
排序单元 603 , 用于对获取单元 602获取到的幅度矢量以及长度矢量按照 预置的排序规则进行排序;
置换编码单元 604,用于根据排序单元 603排序后的长度矢量和幅度矢量, 按照最优的元素移除顺序,对无符号待编码的矢量各元素出现的位置顺序进行 置换编码, 得到位置索引值;
执行单元 605 , 根据查询单元 601查询到的码书索引值偏移量, 置换编码 单元 604获取到的位置索引值以及符号编码单元 607获取到的符号索引值,计 算最终的待编码的矢量对应的格型码书索引值,并向解码装置发送该格型码书 索引值, 具体的计算过程与前述编码方法实施例中的计算过程一致, 此处不再 赘述。
本实施例中的编码装置中,由于获取单元 602可以获取根据待编码的矢量 获取得到该矢量对应的幅度矢量和长度矢量,排序单元 603对幅度矢量和长度 矢量进行排序, 并由置换编码单元 604根据排序单元 603的排序结果,按照最 优的元素移除顺序进行置换编码得到位置索引值,因此执行单元 605可以根据 查询单元 601查询到的码书索引值偏移量和置换编码单元 604获取到的位置索 引值,计算最终的待编码的矢量对应的格型码书索引值, 幅度矢量和长度矢量 的获取是随编码过程时实进行的, 所以也就无需存储每个 Leader对应的表征 各层移除元素数值大小的矢量和表征分层组合编码参数的矢量,因此能够有效 地减少存储复杂度。
下面介绍本发明实施例中的解码装置实施例, 请参阅图 7, 本发明实施例 中的解码装置实施例包括:
接收单元 701 , 用于接收编码装置发送的格型码书索引值; 查找单元 702, 用于在预置的码书索引值偏移量表中查询小于接收到的格 型码书索引值且数值最大的码书索引值偏移量,并根据查询到的码书索引值偏 移量获取矢量中包含的元素值, 幅度矢量以及长度矢量;
生成单元 703 , 用于从格型码书索引值中减去该码书索引值偏移量得到新 索引值;
排序单元 704, 用于对查找单元 702获取到的幅度矢量以及长度矢量按照 预置的排序规则进行排序;
解码单元 705 , 用于根据生成单元 703获取到的新索引值, 以及排序单元 704排序后的幅度矢量, 长度矢量解码得到矢量, 具体的计算过程与前述解码 方法实施例中所采用的计算过程一致, 此处不再赘述。
可以理解的是, 上述的解码装置可以应用于 Gosset格的格型矢量量化器 的编解码过程, 同样可以应用于 RE8格的格型矢量量化器的编解码过程, 或 者还可以应用于其他类型的格型矢量量化器的编解码过程,下面介绍另外一种 可替代的编解码方案, 则本实施例中的解码装置还可以进一步包括:
索引值分离单元 706, 该方式中, 解码装置具体包括:
接收单元 701 , 用于接收编码装置发送的格型码书索引值;
查找单元 702, 用于在预置的码书索引值偏移量表中查询小于接收到的格 型码书索引值且数值最大的码书索引值偏移量,并根据查询到的码书索引值偏 移量获取矢量中包含的元素值, 幅度矢量以及长度矢量;
生成单元 703 , 用于从格型码书索引值中减去该码书索引值偏移量得到新 索引值;
索引值分离单元 706, 用于从生成单元 703生成的新索引值中分离出符号 索引值和位置索引值;
排序单元 704, 用于对查找单元 702获取到的幅度矢量以及长度矢量按照 预置的排序规则进行排序;
解码单元 705 , 用于根据索引值分离单元 706分离出的位置索引值对排序 单元 704的排序结果进行解码得到无符号矢量,根据索引值分离单元 706分离 出的符号索引值进行解码得到非零元素的符号矢量,之后再根据获取到的非零 元素符号矢量以及无符号矢量计算得到矢量,具体的计算过程与前述解码方法 中的计算过程一致, 此处不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可 读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
以上对本发明所提供的一种编码、 解码、 编解码方法、 编解码系统以及相 关装置进行了详细介绍,对于本领域的一般技术人员,依据本发明实施例的思 想, 在具体实施方式及应用范围上均会有改变之处, 综上所述, 本说明书内容 不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种编码方法, 其特征在于, 包括:
获取待编码的矢量对应的幅度矢量和长度矢量;
对所述幅度矢量以及长度矢量进行排序;
根据排序后的幅度矢量以及排序后的长度矢量, 得到位置索引值。
2、 根据权利要求 1所述的方法, 其特征在于,
所述对幅度矢量以及长度矢量进行排序, 具体为: 对所述幅度矢量以及长 度矢量按照预置的排序规则进行排序;
所述预置的排序规则为按照元素从大到小的顺序进行排列,或者是按照元 素从小到大的顺序进行排列。
3、 根据权利要求 1所述的方法, 其特征在于, 所述根据排序后的幅度矢 量以及排序后的长度矢量, 得到位置索引值具体为:
根据排序后的幅度矢量以及排序后的长度矢量, 按照最优元素移除顺序, 对待编码的矢量各元素出现的位置顺序进行置换编码得到位置索引值。
4、 根据权利要求 1或 3所述的方法, 其特征在于, 所述方法还包括: 在预置的码书索引值偏移量表中查询待编码的矢量对应的码书索引值偏 移量;
根据所述码书索引值偏移量以及所述位置索引值获取待编码的矢量对应 的格型码书索引值。
5、 根据权利要求 1至 3中任一项所述的方法, 其特征在于, 所述获取待 编码的矢量对应的幅度矢量和长度矢量包括:
查询所述待编码的矢量所属的 Leader矢量;
根据所述 Leader矢量获取对应的幅度矢量以及长度矢量, 所述幅度矢量 指示所述 Leader矢量中包含的具有不同数值大小的元素, 所述长度矢量指示 所述幅度矢量中每一个元素在所述 Leader矢量中出现的次数。
6、 根据权利要求 2所述的方法, 其特征在于, 所述对幅度矢量以及长度 矢量按照预置的排序规则进行排序包括:
对幅度矢量的元素进行重新排列,并按照重新排列后的幅度矢量的元素顺 序调整长度矢量中各元素的顺序;
对调整过元素顺序的长度矢量的元素进行重新排列,并按照重新排列后的 长度矢量的元素顺序调整幅度矢量中各元素的顺序。
7、 根据权利要求 2所述的方法, 其特征在于, 所述对幅度矢量以及长度 矢量按照预置的排序规则进行排序包括:
对长度矢量中的元素进行重新排列,并按照重新排列后的长度矢量的元素 顺序调整幅度矢量中元素的顺序;
若重新排列后的长度矢量中存在相等的元素,则按照预置规则对所述相等 元素在幅度矢量中对应的元素顺序进行调整。
8、 根据权利要求 3所述的方法, 其特征在于, 所述根据排序后的幅度矢 量以及排序后的长度矢量,按照最优元素移除顺序,对待编码的矢量各元素出 现的位置顺序进行置换编码得到位置索引值包括:
对待编码的矢量进行分层, 分层的数目等于所述幅度矢量的维数; 将待编码的矢量作为最高层矢量;
从最高层矢量开始,移除所述排序后的长度矢量元素值由大到小对应的排 序后的幅度矢量中对应的元素得到新的矢量, 将该新的矢量作为次高层矢量; 依次执行, 直至处理完所有分层;
根据分层处理的结果以及每个分层新矢量的维数计算位置索引值。
9、 根据权利要求 4所述的方法, 其特征在于, 所述根据码书索引值偏移 量以及所述位置索引值获取待编码的矢量对应的格型码书索引值包括:
将所述码书索引值偏移量与所述位置索引值的和作为格型码书索引值。
10、 根据权利要求 1所述的方法, 其特征在于, 所述获取待编码的矢量对 应的幅度矢量和长度矢量之前包括:
对待编码的矢量对应的符号矢量进行单独编码得到符号索引值; 所述获取待编码的矢量对应的幅度矢量和长度矢量具体为:
获取无符号待编码的矢量对应的幅度矢量和长度矢量;
所述根据排序后的幅度矢量以及排序后的长度矢量,得到位置索引值具体 为:
根据排序后的幅度矢量以及排序后的长度矢量,对无符号待编码的矢量各 元素出现的位置顺序进行置换编码得到位置索引值;
所述根据排序后的幅度矢量以及排序后的长度矢量,得到位置索引值之后 还包括:
根据所述码书索引值偏移量,符号索引值以及所述位置索引值计算矢量的 格型码书索引值。
11、 一种解码方法, 其特征在于, 包括:
接收编码端发送的格型码书索引值;
获取幅度矢量以及长度矢量;
对所述幅度矢量以及长度矢量进行排序;
根据所述排序后的幅度矢量以及排序后的长度矢量解码得到矢量。
12、 根据权利要求 11所述的方法, 其特征在于, 所述获取幅度矢量以及 长度矢量包括:
在预置的码书索引值偏移量表中查询小于所述格型码书索引值且数值最 大的码书索引值偏移量;
根据查询到的码书索引值偏移量获取矢量中包含的元素值,幅度矢量以及 长度矢量。
13、 根据权利要求 12所述的方法, 其特征在于, 所述方法还包括: 从格型码书索引值中减去所述码书索引值偏移量得到新索引值;
所述根据排序后的幅度矢量以及排序后的长度矢量解码得到矢量的步骤 具体为:
根据新索引值,排序后的幅度矢量,以及排序后的长度矢量解码得到矢量。
14、 根据权利要求 13所述的方法, 其特征在于, 所述从格型码书索引值 中减去所述码书索引值偏移量得到新索引值之后包括:
从所述新索引值中分离出符号索引值和位置索引值;
根据所述符号索引值解码出非零元素符号矢量;
所述根据新索引值,排序后的幅度矢量, 以及排序后的长度矢量解码得到 矢量具体为:
根据所述位置索引值,排序后的幅度矢量以及排序后的长度矢量解码得到 无符号矢量;
根据所述非零元素符号矢量以及所述无符号矢量计算得到矢量。
15、 根据权利要求 11至 14中任一项所述的方法, 其特征在于, 所述对幅 度矢量以及长度矢量进行排序, 具体为:
对所述幅度矢量以及长度矢量按照预置的排序规则进行排序;
所述预置的排序规则为按照元素从大到小的顺序进行排列,或者是按照元 素从小到大的顺序进行排列。
16、 一种编解码方法, 其特征在于, 包括: 编码装置在预置的码书索引值偏移量表中查询待编码的矢量对应的码书 索引值偏移量;
编码装置获取待编码的矢量对应的幅度矢量和长度矢量;
编码装置对幅度矢量以及长度矢量进行排序;
编码装置根据排序后的幅度矢量以及长度矢量, 按照最优元素移除顺序, 对待编码的矢量各元素出现的位置顺序进行置换编码得到位置索引值;
编码装置根据所述码书索引值偏移量和位置索引值,计算最终的待编码的 矢量对应的格型码书索引值, 并向解码装置发送所述格型码书索引值;
解码装置在预置的码书索引值偏移量表中查询小于接收到的格型码书索 引值且数值最大的码书索引值偏移量;
解码装置根据查询到的码书索引值偏移量获取矢量中包含的元素值,幅度 矢量以及长度矢量;
解码装置从所述格型码书索引值中减去该码书索引值偏移量得到新索引 值;
解码装置对幅度矢量以及长度矢量进行排序;
解码装置根据获取到的新索引值,排序后的幅度矢量, 以及排序后的长度 矢量解码得到矢量。
17、 一种编解码系统, 其特征在于, 包括:
编码装置,用于在预置的码书索引值偏移量表中查询待编码的矢量对应的 码书索引值偏移量, 获取待编码的矢量对应的幅度矢量和长度矢量,对幅度矢 量以及长度矢量进行排序,对待编码的矢量各元素出现的位置顺序进行置换编 码得到位置索引值,根据所述码书索引值偏移量和位置索引值, 计算最终的待 编码的矢量对应的格型码书索引值, 向解码装置发送该格型码书索引值; 解码装置, 用于接收编码装置发送的格型码书索引值,在预置的码书索引 值偏移量表中查询小于接收到的格型码书索引值且数值最大的码书索引值偏 移量,根据查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢量以 及长度矢量, 从所述格型码书索引值中减去该码书索引值偏移量得到新索引 值, 对幅度矢量以及长度矢量进行排序, 根据获取到的新索引值, 排序后的幅 度矢量, 以及排序后的长度矢量解码得到矢量。
18、 一种编解码系统, 其特征在于, 包括:
编码装置,用于在预置的码书索引值偏移量表中查询待编码的矢量对应的 码书索引值偏移量,对矢量中的符号矢量进行单独编码得到符号索引值, 获取 无符号待编码的矢量对应的幅度矢量和长度矢量,对幅度矢量以及长度矢量进 行排序,对无符号待编码的矢量各元素出现的位置顺序进行置换编码得到位置 索引值, 根据码书索引值偏移量, 符号索引值, 位置索引值计算矢量的格型码 书索引值, 向解码装置发送该格型码书索引值;
解码装置, 用于接收编码装置发送的格型码书索引值,在预置的码书索引 值偏移量表中查询小于格型码书索引值且数值最大的码书索引值偏移量,根据 查询到的码书索引值偏移量获取矢量中包含的元素值, 幅度矢量以及长度矢 量,从格型码书索引值中减去该码书索引值偏移量得到新索引值,从新索引值 中分离出符号索引值和位置索引值, 根据符号索引值解码出非零元素符号矢 量, 对幅度矢量以及长度矢量进行排序, 根据获取到的位置索引值, 排序后的 幅度矢量, 以及排序后的长度矢量解码得到无符号矢量,根据获取到的非零元 素符号矢量以及无符号矢量计算得到矢量。
19、 一种编码装置, 其特征在于, 包括:
查询单元,用于在预置的码书索引值偏移量表中查询待编码的矢量对应的 码书索引值偏移量;
获取单元, 用于获取待编码的矢量对应的幅度矢量和长度矢量; 排序单元, 用于对获取单元获取到的幅度矢量以及长度矢量进行排序; 置换编码单元, 用于根据排序单元排序后的长度矢量和幅度矢量,按照最 优的元素移除顺序,对待编码的矢量各元素出现的位置顺序进行置换编码,得 到位置索引值;
执行单元,根据查询单元查询到的码书索引值偏移量和置换编码单元获取 到的位置索引值, 计算最终的待编码的矢量对应的格型码书索引值, 并向解码 装置发送该格型码书索引值。
20、 根据权利要求 19所述的编码装置, 其特征在于, 所述编码装置还包 括:
分离单元, 用于从待编码的矢量中分离出符号矢量;
符号编码单元, 用于对分离出的符号矢量进行单独编码得到符号索引值; 所述获取单元, 用于获取无符号待编码的矢量对应的幅度矢量和长度矢 量;
所述置换编码单元,用于对无符号待编码的矢量各元素出现的位置顺序进 行置换编码, 得到位置索引值;
所述执行单元, 用于根据所述码书索引值偏移量,位置索引值以及符号索 引值计算最终的待编码的矢量对应的格型码书索引值。
21、 一种解码装置, 其特征在于, 包括:
接收单元, 用于接收编码装置发送的格型码书索引值;
查找单元,用于在预置的码书索引值偏移量表中查询小于接收到的格型码 书索引值且数值最大的码书索引值偏移量,并才艮据查询到的码书索引值偏移量 获取矢量中包含的元素值, 幅度矢量以及长度矢量;
生成单元,用于从格型码书索引值中减去该码书索引值偏移量得到新索引 值;
排序单元, 用于对查找单元获取到的幅度矢量以及长度矢量进行排序; 解码单元, 用于根据生成单元获取到的新索引值, 以及排序单元排序后的 幅度矢量, 长度矢量解码得到矢量。
22、 根据权利要求 21所述的解码装置, 其特征在于, 所述解码装置还包 括:
索引值分离单元,用于从生成单元生成的新索引值中分离出符号索引值和 位置索引值;
所述解码单元,用于根据所述位置索引值以及排序单元的排序结果进行解 码得到无符号矢量,根据符号索引值进行解码得到非零元素符号矢量,再根据 获取到的非零元素符号矢量以及无符号矢量计算得到矢量。
PCT/CN2009/074604 2008-11-10 2009-10-26 一种编码、解码、编解码方法、编解码系统以及相关装置 Ceased WO2010051733A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP09824388.4A EP2295947B1 (en) 2008-11-10 2009-10-26 Coding method, decoding method,and coding apparatus
US12/982,050 US8731947B2 (en) 2008-11-10 2010-12-30 Coding method, decoding method, codec method, codec system and relevant apparatuses

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810175265XA CN101430881B (zh) 2008-11-10 2008-11-10 一种编码、解码、编解码方法、编解码系统以及相关装置
CN200810175265.X 2008-11-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/982,050 Continuation US8731947B2 (en) 2008-11-10 2010-12-30 Coding method, decoding method, codec method, codec system and relevant apparatuses

Publications (1)

Publication Number Publication Date
WO2010051733A1 true WO2010051733A1 (zh) 2010-05-14

Family

ID=40646235

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/074604 Ceased WO2010051733A1 (zh) 2008-11-10 2009-10-26 一种编码、解码、编解码方法、编解码系统以及相关装置

Country Status (4)

Country Link
US (1) US8731947B2 (zh)
EP (1) EP2295947B1 (zh)
CN (1) CN101430881B (zh)
WO (1) WO2010051733A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2668651A1 (en) * 2011-01-28 2013-12-04 Nokia Corp. Coding through combination of code vectors

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2931964A1 (fr) * 2008-06-02 2009-12-04 Centre Nat Rech Scient Procede de denombrement des vecteurs dans les reseaux reguliers de points.
CN101430881B (zh) 2008-11-10 2013-04-17 华为技术有限公司 一种编码、解码、编解码方法、编解码系统以及相关装置
CN101577551A (zh) * 2009-05-27 2009-11-11 华为技术有限公司 一种生成格型矢量量化码书的方法及装置
US20100324913A1 (en) * 2009-06-18 2010-12-23 Jacek Piotr Stachurski Method and System for Block Adaptive Fractional-Bit Per Sample Encoding
CN102158692B (zh) 2010-02-11 2013-02-13 华为技术有限公司 编码方法、解码方法、编码器和解码器
CN102025998B (zh) * 2010-12-28 2013-05-08 重庆邮电大学 一种数字图像信号矢量量化码书设计方法
US9471308B2 (en) 2013-01-23 2016-10-18 International Business Machines Corporation Vector floating point test data class immediate instruction
US9778932B2 (en) 2013-01-23 2017-10-03 International Business Machines Corporation Vector generate mask instruction
US9513906B2 (en) 2013-01-23 2016-12-06 International Business Machines Corporation Vector checksum instruction
US9823924B2 (en) 2013-01-23 2017-11-21 International Business Machines Corporation Vector element rotate and insert under mask instruction
US9804840B2 (en) 2013-01-23 2017-10-31 International Business Machines Corporation Vector Galois Field Multiply Sum and Accumulate instruction
US9715385B2 (en) * 2013-01-23 2017-07-25 International Business Machines Corporation Vector exception code
JP6337122B2 (ja) * 2013-12-17 2018-06-06 ノキア テクノロジーズ オサケユイチア オーディオ信号エンコーダ
CN112435674B (zh) * 2020-12-09 2024-11-12 北京百瑞互联技术股份有限公司 优化频谱数据的lc3算术编码搜索表的方法、装置、介质
CN113473154B (zh) * 2021-06-30 2022-11-22 杭州海康威视数字技术股份有限公司 视频编码、视频解码方法、装置及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5263119A (en) * 1989-06-29 1993-11-16 Fujitsu Limited Gain-shape vector quantization method and apparatus
CN1188957A (zh) * 1996-09-24 1998-07-29 索尼公司 矢量量化方法和语音编码方法及其装置
CN1326159A (zh) * 2000-05-31 2001-12-12 三星电子株式会社 特征矢量数据空间的索引方法
JP2003345392A (ja) * 2002-05-23 2003-12-03 Matsushita Electric Ind Co Ltd 分割型スケーリング因子を用いたスペクトル包絡パラメータのベクトル量子化器
JP2004120623A (ja) * 2002-09-27 2004-04-15 Ntt Docomo Inc 符号化装置、符号化方法、復号装置及び復号方法
CN1540627A (zh) * 2003-10-30 2004-10-27 北京首信股份有限公司 用于语音编码的线谱对加权量化矢量快速搜索算法
CN101110214A (zh) * 2007-08-10 2008-01-23 北京理工大学 一种基于多描述格型矢量量化技术的语音编码方法
CN101430881A (zh) * 2008-11-10 2009-05-13 华为技术有限公司 一种编码、解码、编解码方法、编解码系统以及相关装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6728413B2 (en) 1998-01-19 2004-04-27 Canon Kabushiki Kaisha Lattice vector quantization in image compression and decompression
US7389227B2 (en) * 2000-01-14 2008-06-17 C & S Technology Co., Ltd. High-speed search method for LSP quantizer using split VQ and fixed codebook of G.729 speech encoder
CA2388358A1 (en) * 2002-05-31 2003-11-30 Voiceage Corporation A method and device for multi-rate lattice vector quantization
FR2897742A1 (fr) * 2006-02-17 2007-08-24 France Telecom Codage/decodage perfectionnes de signaux numeriques, en particulier en quantification vectorielle avec codes a permutation

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5263119A (en) * 1989-06-29 1993-11-16 Fujitsu Limited Gain-shape vector quantization method and apparatus
CN1188957A (zh) * 1996-09-24 1998-07-29 索尼公司 矢量量化方法和语音编码方法及其装置
CN1326159A (zh) * 2000-05-31 2001-12-12 三星电子株式会社 特征矢量数据空间的索引方法
JP2003345392A (ja) * 2002-05-23 2003-12-03 Matsushita Electric Ind Co Ltd 分割型スケーリング因子を用いたスペクトル包絡パラメータのベクトル量子化器
JP2004120623A (ja) * 2002-09-27 2004-04-15 Ntt Docomo Inc 符号化装置、符号化方法、復号装置及び復号方法
CN1540627A (zh) * 2003-10-30 2004-10-27 北京首信股份有限公司 用于语音编码的线谱对加权量化矢量快速搜索算法
CN101110214A (zh) * 2007-08-10 2008-01-23 北京理工大学 一种基于多描述格型矢量量化技术的语音编码方法
CN101430881A (zh) * 2008-11-10 2009-05-13 华为技术有限公司 一种编码、解码、编解码方法、编解码系统以及相关装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2295947A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2668651A1 (en) * 2011-01-28 2013-12-04 Nokia Corp. Coding through combination of code vectors
EP2668651A4 (en) * 2011-01-28 2014-07-30 Nokia Corp CODING BY COMBINING CODE VECTORS

Also Published As

Publication number Publication date
CN101430881B (zh) 2013-04-17
EP2295947B1 (en) 2013-04-10
EP2295947A1 (en) 2011-03-16
US8731947B2 (en) 2014-05-20
CN101430881A (zh) 2009-05-13
US20110093275A1 (en) 2011-04-21
EP2295947A4 (en) 2011-07-06

Similar Documents

Publication Publication Date Title
WO2010051733A1 (zh) 一种编码、解码、编解码方法、编解码系统以及相关装置
KR101190875B1 (ko) 차원 벡터 및 가변 분해능 양자화
JP4801160B2 (ja) 逐次改善可能な格子ベクトル量子化
MXPA04011841A (es) Metodo y sistema para la cuantificacion vectorial reticular multivelocidad de una senal.
WO2011063594A1 (zh) 格型矢量量化音频编解码方法和系统
WO2007083264A1 (en) Audio coding
CN110720222B (zh) 用于数字数据压缩的方法和设备
CN101981618B (zh) 复杂度减少的矢量编制索引和去索引
US20070223826A1 (en) Fine grained scalability ordering for scalable video coding
CN106228981B (zh) 一种基于压缩域的mp3自适应隐写方法
TW201015540A (en) Method, system, and apparatus for compression or decompression of digital signals
WO2011097963A1 (zh) 编码方法、解码方法、编码器和解码器
CN101266795A (zh) 一种格矢量量化编解码的实现方法及装置
Effros et al. Multiresolution vector quantization
CN101308657B (zh) 一种基于先进音频编码器的码流合成方法
CN102422541A (zh) 编码方法、装置与系统、解码方法、装置与系统
CN101771416B (zh) 位平面编码和解码方法、通信系统及相关设备
CN119450050B (zh) 分级编码解码方法及模型训练方法、装置、设备及介质
Perlmutter et al. Vector quantization with zerotree significance map for wavelet image coding
Amin et al. Vector quantization based lossy image compression using wavelets–a review
Huang et al. A security-based steganographic scheme in vector quantization coding between correlated neighboring blocks
CN101673547B (zh) 编码方法、解码方法及其装置
Ahn et al. Rate-distortion optimized image compression using generalized principal component analysis
CN101599273B (zh) 一种可分级矢量量化编解码方法
Jiang et al. A finite-state entropy-constrained vector quantizer for audio MDCT coefficients coding

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09824388

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 4970/KOLNP/2010

Country of ref document: IN

Ref document number: 2009824388

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE