CN101572586B - Codec method, device and system - Google Patents
Codec method, device and system Download PDFInfo
- Publication number
- CN101572586B CN101572586B CN200810094441A CN200810094441A CN101572586B CN 101572586 B CN101572586 B CN 101572586B CN 200810094441 A CN200810094441 A CN 200810094441A CN 200810094441 A CN200810094441 A CN 200810094441A CN 101572586 B CN101572586 B CN 101572586B
- Authority
- CN
- China
- Prior art keywords
- sub
- index value
- value
- mlt
- band
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
本发明实施例公开了一种编解码方法、装置及系统,涉及通信技术,能够编码形成具有嵌入式结构的码流,获得较高质量的解码信号。本发明实施例提供的技术方案包括一种编码方法,该方法包括:获取信号的至少两个子带;获取所述各子带的幅度包络量化值;利用所述各子带的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;根据所述各子带的层次排序将所述各子带的编码信息写入码流。
The embodiment of the invention discloses an encoding and decoding method, device and system, which relate to communication technology and can be encoded to form a code stream with an embedded structure to obtain a higher-quality decoded signal. The technical solution provided by the embodiment of the present invention includes an encoding method, the method comprising: acquiring at least two subbands of the signal; acquiring the amplitude envelope quantization value of each subband; using the amplitude envelope quantization value of each subband Obtain the hierarchical ordering of the subbands and the encoding information of the subbands; write the encoding information of the subbands into the code stream according to the hierarchical ordering of the subbands.
Description
技术领域technical field
本发明涉及通信技术,尤其涉及一种编解码方法、装置及系统。The present invention relates to communication technology, in particular to a codec method, device and system.
背景技术Background technique
随着多媒体技术的快速发展,语音与音频编码技术得到了越来越广泛的应用。现有的语音和音频编码技术中,主要采用变换编码技术,先对语音和音频信号进行频域变换,例如,快速傅立叶变换(Fast Fourier Transform,FFT),修正的离散余弦变换(Modified Discrete Cosine Transform,MDCT),调制叠接变换(Modulated Lapped Transform,MLT)等,然后对获得的频域系数进行量化编码,将编码结果写入码流进行传输。通常采用的是基于MLT变换的哈夫曼编码方式。With the rapid development of multimedia technology, speech and audio coding technology has been more and more widely used. In the existing speech and audio coding technology, transform coding technology is mainly used, and the speech and audio signals are first transformed in the frequency domain, for example, Fast Fourier Transform (Fast Fourier Transform, FFT), Modified Discrete Cosine Transform (Modified Discrete Cosine Transform) , MDCT), Modulated Lapped Transform (MLT), etc., and then quantize and encode the obtained frequency domain coefficients, and write the encoding results into the code stream for transmission. Usually, the Huffman coding method based on MLT transform is adopted.
在实现本发明的过程中,发明人发现现有技术中至少存在如下问题:现有技术中提供的语音与音频编码方法是一种定速率的编码方式,不便于网络传输;并且解码时受网络丢包的的影响比较大,不能保证获得高质量的解码信号。In the process of realizing the present invention, the inventor found that there are at least the following problems in the prior art: the speech and audio encoding method provided in the prior art is a fixed-rate encoding method, which is not convenient for network transmission; The impact of packet loss is relatively large, and high-quality decoded signals cannot be guaranteed.
发明内容Contents of the invention
一方面,本发明实施例提供了一种编码方法,能够编码形成具有嵌入式结构的码流,对所述码流解码后获得较高质量的解码信号。On the one hand, the embodiment of the present invention provides an encoding method, which can encode and form a code stream with an embedded structure, and obtain a higher-quality decoded signal after decoding the code stream.
本发明实施例采用的技术方案如下:一种编码方法,该方法包括:The technical scheme that the embodiment of the present invention adopts is as follows: a kind of coding method, this method comprises:
获取信号的至少两个子带;acquiring at least two subbands of the signal;
获取所述各子带的幅度包络量化值;Acquiring the amplitude envelope quantization value of each sub-band;
利用所述各子带的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;Obtaining the hierarchical ordering of the subbands and the coding information of the subbands by using the amplitude envelope quantization values of the subbands;
根据所述各子带的层次排序将所述各子带的编码信息写入码流。Writing the encoding information of each sub-band into a code stream according to the hierarchical ordering of each sub-band.
另一方面,本发明实施例提供了一种编码装置,能够编码形成具有嵌入式结构的码流,对所述码流解码后获得较高质量的解码信号。On the other hand, an embodiment of the present invention provides an encoding device capable of encoding to form a code stream with an embedded structure, and obtaining a higher-quality decoded signal after decoding the code stream.
本发明实施例采用的技术方案如下:一种编码装置,该装置包括:The technical scheme adopted in the embodiment of the present invention is as follows: an encoding device, which comprises:
子带获取单元,用于获取信号的至少两个子带;a subband acquisition unit, configured to acquire at least two subbands of the signal;
幅度包络量化值获取单元,用于获取所述子带获取单元获取的子带的幅度包络量化值;an amplitude envelope quantization value acquisition unit, configured to acquire the amplitude envelope quantization value of the subband acquired by the subband acquisition unit;
层次排序和编码信息获取单元,用于利用所述各子带的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;a hierarchical ordering and coding information acquisition unit, configured to obtain the hierarchical ordering of the subbands and the coding information of the subbands by using the amplitude envelope quantization values of the subbands;
码流写入单元,用于根据由所述层次排序确定单元确定的层次排序,将所述编码信息获取单元获取的各子带的编码信息写入码流。The code stream writing unit is configured to write the encoding information of each sub-band obtained by the encoding information obtaining unit into the code stream according to the hierarchical order determined by the hierarchical order determining unit.
再一方面,本发明实施例提供了一种解码方法,能够获得较高质量的解码信号。In another aspect, an embodiment of the present invention provides a decoding method, which can obtain a higher-quality decoded signal.
本发明实施例采用的技术方案如下:一种解码方法,该方法包括:The technical scheme that the embodiment of the present invention adopts is as follows: a kind of decoding method, this method comprises:
从码流中获取解码信息;Obtain decoding information from the code stream;
根据所述解码信息确定信号中各子带的层次排序,所述信号包含至少两个子带;determining a hierarchical ordering of subbands in a signal according to the decoding information, the signal including at least two subbands;
根据所述层次排序,对所述解码信息进行解码,获取解码后的信号。Decoding the decoded information according to the hierarchical ordering to obtain a decoded signal.
再一方面,本发明实施例提供了一种解码装置,能够获得较高质量的解码信号。In another aspect, an embodiment of the present invention provides a decoding device capable of obtaining a higher-quality decoded signal.
本发明实施例采用的技术方案如下:一种解码装置,该装置包括:The technical scheme adopted in the embodiment of the present invention is as follows: a decoding device, which comprises:
解码信息获取单元,用于从码流中获取解码信息;a decoding information obtaining unit, configured to obtain decoding information from the code stream;
层次排序获取单元,用于根据所述解码信息获取单元获取的解码信息,确定信号中各子带的层次排序,所述信号包含至少两个子带;A hierarchical ordering acquisition unit, configured to determine the hierarchical ordering of each subband in the signal according to the decoding information acquired by the decoding information acquisition unit, and the signal includes at least two subbands;
解码信号获取单元,用于根据所述层次排序获取单元获取的层次排序,对所述解码信息获取单元获取的解码信息进行解码,获取解码后的信号。The decoded signal acquiring unit is configured to decode the decoded information acquired by the decoded information acquiring unit according to the layer order acquired by the layer order acquire unit, and acquire a decoded signal.
再一方面,本发明实施例提供了一种编解码系统,该系统包括编码装置和解码装置,所述编码装置包括:In another aspect, an embodiment of the present invention provides a codec system, the system includes an encoding device and a decoding device, and the encoding device includes:
子带获取模块,用于获取信号的至少两个子带;A subband acquisition module, configured to acquire at least two subbands of the signal;
幅度包络量化值获取模块,用于获取所述子带获取模块获取的子带的幅度包络量化值;An amplitude envelope quantization value acquisition module, configured to acquire the amplitude envelope quantization value of the subband acquired by the subband acquisition module;
层次排序和编码信息获取模块,用于利用所述幅度包络量化值获取模块获取的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;A hierarchical ordering and coding information acquisition module, configured to obtain the hierarchical ordering of each sub-band and the encoding information of each sub-band by using the amplitude envelope quantization value acquired by the amplitude envelope quantization value acquisition module;
码流写入模块,用于根据由所述层次排序确定模块确定的层次排序,将所述编码信息获取模块获取的各子带的编码信息写入码流。The code stream writing module is configured to write the coding information of each sub-band acquired by the coding information obtaining module into the code stream according to the hierarchical order determined by the hierarchical order determining module.
所述解码装置包括:The decoding device includes:
解码信息获取模块,用于从码流中获取解码信息;A decoding information acquisition module is used to obtain decoding information from the code stream;
层次排序获取模块,用于根据所述解码信息获取模块获取的解码信息,确定信号中各子带的层次排序,所述信号包含至少两个子带;A hierarchical ordering acquisition module, configured to determine the hierarchical ordering of each subband in the signal according to the decoding information acquired by the decoding information acquisition module, the signal including at least two subbands;
解码信号获取模块,用于根据所述层次排序获取模块获取的层次排序,对所述解码信息获取模块获取的解码信息进行解码,获取解码后的信号。The decoding signal obtaining module is configured to decode the decoding information obtained by the decoding information obtaining module according to the hierarchical ordering obtained by the hierarchical ordering obtaining module, and obtain a decoded signal.
本发明实施例采用的技术方案,首先为信号中的各个不同子带确定层次排序,所述层次排序将各子带按照其所携带信息的重要性从大到小进行排序,在编写码流时根据所述层次排序,依次按照重要性从大到小写入相应子带的编码信息,先写入携带较重要信息的子带的编码信息,从而,使编写出的码流结构,根据携带信息重要性的不同分为不同的层次,形成了一种具有嵌入式结构的码流,能够根据网络状况及用户对服务质量要求的不同,传输具有不同层次的码流。解码时根据各个子带的所述排列顺序,依次按照所述重要性的大小,对所述各子带的解码信息进行解码,先解码出具有较高重要性的解码信息,从而,即使所述码流中缺失了部分重要性较低的解码信息,本发明实施例提供的技术方案也能够获得较高质量的解码信号。The technical solution adopted in the embodiment of the present invention first determines the hierarchical ordering for each different subband in the signal, and the hierarchical ordering sorts each subband according to the importance of the information it carries, and when writing the code stream According to the hierarchical ordering, the coding information of the corresponding sub-bands is written in order according to the importance from large to small, and the coding information of the sub-bands carrying more important information is written first, so that the code stream structure written is based on the carried information. The difference in importance is divided into different levels, forming a code stream with an embedded structure, which can transmit code streams with different levels according to network conditions and user requirements for service quality. During decoding, according to the arrangement order of each sub-band, the decoding information of each sub-band is decoded in sequence according to the magnitude of the importance, and the decoding information with higher importance is decoded first, so that even if the Part of the decoding information of low importance is missing in the code stream, and the technical solution provided by the embodiment of the present invention can also obtain a higher-quality decoding signal.
附图说明Description of drawings
图1为本发明实施例一提供的编码方法流程图;FIG. 1 is a flowchart of an encoding method provided by Embodiment 1 of the present invention;
图2为本发明实施例二提供的编码方法流程图;FIG. 2 is a flowchart of an encoding method provided by Embodiment 2 of the present invention;
图3为本发明实施例提供的码流结构示意图;FIG. 3 is a schematic diagram of a code stream structure provided by an embodiment of the present invention;
图4为本发明实施例提供的码流发生截断时的截断点位置示意图;Fig. 4 is a schematic diagram of the position of the truncation point when the code stream is truncated according to the embodiment of the present invention;
图5为本发明实施例提供的码流截断示意图;FIG. 5 is a schematic diagram of code stream truncation provided by an embodiment of the present invention;
图6为本发明实施例提供的解码方法流程图;FIG. 6 is a flowchart of a decoding method provided by an embodiment of the present invention;
图7为本发明实施例提供的编解码系统示意图;FIG. 7 is a schematic diagram of a codec system provided by an embodiment of the present invention;
图8为本发明实施例一提供的编码装置结构图;FIG. 8 is a structural diagram of an encoding device provided in Embodiment 1 of the present invention;
图9为本发明实施例二提供的编码装置结构图;FIG. 9 is a structural diagram of an encoding device provided in Embodiment 2 of the present invention;
图10为本发明实施例一提供的解码装置结构图;FIG. 10 is a structural diagram of a decoding device provided by Embodiment 1 of the present invention;
图11为本发明实施例二提供的解码装置结构图。FIG. 11 is a structural diagram of a decoding device provided by Embodiment 2 of the present invention.
具体实施方式Detailed ways
为了更清楚地说明本发明实施例的技术方案,下面将结合附图对本发明的实施例进行详细的介绍,下面的描述仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些实施例获得本发明的其他的实施方式。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. The following descriptions are only some embodiments of the present invention. For those of ordinary skill in the art, On the premise of not paying creative efforts, other implementation modes of the present invention can also be obtained according to these embodiments.
为了解决现有技术中采用基于MLT变换的编码方式,不便于网络传输,解码时受网络丢包的影响比较大,获取的语音与音频质量不佳的问题,本发明实施例提供了一种编解码方法、装置和系统。下面对本发明实施例进行详细介绍。In order to solve the problem that the encoding method based on MLT transformation in the prior art is not convenient for network transmission, the decoding is greatly affected by network packet loss, and the quality of the acquired voice and audio is not good, the embodiment of the present invention provides an encoding Decoding method, device and system. The following describes the embodiments of the present invention in detail.
本发明实施例提供了一种编码方法,如图1所示,该方法包括如下步骤:The embodiment of the present invention provides an encoding method, as shown in Figure 1, the method includes the following steps:
步骤11、获取信号的至少两个子带;
步骤12、获取所述各子带的幅度包络量化值;
步骤13、利用所述各子带的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;
步骤14、根据所述各子带的层次排序将所述各子带的编码信息写入码流。Step 14: Write the encoding information of each sub-band into a code stream according to the hierarchical ordering of each sub-band.
本发明实施例采用的技术方案,首先为信号中的各个不同子带确定层次排序,所述层次排序将各子带按照其所携带信息的重要性从大到小进行排序,在编写码流时根据所述层次排序,依次按照重要性从大到小写入相应子带的编码信息,先写入携带较重要信息的子带的编码信息,从而,使编写出的码流结构,根据携带信息重要性的不同分为不同的层次,形成了一种具有嵌入式结构的码流,能够根据网络状况及用户对服务质量要求的不同,传输具有不同层次的码流。解码时根据各个子带的所述排列顺序,依次按照所述重要性的大小,对所述各子带的解码信息进行解码,先解码出具有较高重要性的解码信息,从而,即使所述码流中缺失了部分重要性较低的解码信息,本发明实施例提供的技术方案也能够获得较高质量的解码信号。The technical solution adopted in the embodiment of the present invention first determines the hierarchical ordering for each different subband in the signal, and the hierarchical ordering sorts each subband according to the importance of the information it carries, and when writing the code stream According to the hierarchical ordering, the coding information of the corresponding sub-bands is written in order according to the importance from large to small, and the coding information of the sub-bands carrying more important information is written first, so that the code stream structure written is based on the carried information. The difference in importance is divided into different levels, forming a code stream with an embedded structure, which can transmit code streams with different levels according to network conditions and user requirements for service quality. During decoding, according to the arrangement order of each sub-band, the decoding information of each sub-band is decoded in sequence according to the magnitude of the importance, and the decoding information with higher importance is decoded first, so that even if the Part of the decoding information of low importance is missing in the code stream, and the technical solution provided by the embodiment of the present invention can also obtain a higher-quality decoding signal.
如图2所示,下面对本发明实施例提供的编码方法进行详细介绍。As shown in FIG. 2 , the encoding method provided by the embodiment of the present invention will be described in detail below.
本发明实施例提供的编码方法基于MLT变换,本发明实施例所述的信号包括语音信号和音频信号中的至少一种,所述的信号可以表示为x(n),n表示时域采样点的标号。The encoding method provided by the embodiment of the present invention is based on MLT transform. The signal described in the embodiment of the present invention includes at least one of a speech signal and an audio signal, and the signal can be expressed as x(n), where n represents a sampling point in the time domain label.
步骤201、获取信号中的调制叠接变换MLT系数。
在编码端,首先,将语音与音频信号加上正弦窗和变换因子,进行MLT变换,获得MLT系数mlt(m),采用的变换公式为:At the encoding end, firstly, add a sine window and a transformation factor to the speech and audio signals, and perform MLT transformation to obtain the MLT coefficient mlt(m). The transformation formula used is:
其中,
本发明实施例在一帧信号中取320个采样点,即N=320,能够获得320个MLT系数。In the embodiment of the present invention, 320 sampling points are taken in one frame signal, that is, N=320, and 320 MLT coefficients can be obtained.
步骤202、将所述MLT系数分为至少两组,所述的每组MLT系数为一个子带。
本发明实施例将每20个MLT系数划分为一组,作为一个子带,本发明实施例包括16个子带。In the embodiment of the present invention, every 20 MLT coefficients are divided into a group, and as a subband, the embodiment of the present invention includes 16 subbands.
步骤203、根据所述各子带中的MLT系数获取所述各子带的幅度包络值。
本发明实施例中子带的幅度包络值为该子带内包含的MLT系数的均方根,可按下列公式(2)获得:In the embodiment of the present invention, the amplitude envelope value of the subband is the root mean square of the MLT coefficient contained in the subband, which can be obtained according to the following formula (2):
其中,r为子带的标号,rms(r)为第r个子带的幅度包络值。Among them, r is the label of the subband, and rms(r) is the amplitude envelope value of the rth subband.
步骤204、根据所述幅度包络值获取所述各子带的幅度包络量化值。
根据获取的各子带的最大和最小幅度包络值,确定量化区间,采用标量量化的方法获取所述各子带的幅度包络量化值。A quantization interval is determined according to the acquired maximum and minimum amplitude envelope values of each sub-band, and the quantization value of the amplitude envelope of each sub-band is acquired by using a scalar quantization method.
步骤205、利用所述各子带的幅度包络量化值确定各子带的层次排序。
本发明实施例提供的层次排序是一种能量排序,较大的幅度包络量化值对应的子带具有较大的能量,所以,本发明实施例按照所述各子带的幅度包络量化值从大到小的顺序对各子带进行排序,所述各子带的层次排序为按照各子带相应的幅度包络量化值从大到小的排列顺序。The hierarchical sorting provided by the embodiment of the present invention is an energy sorting, and the subband corresponding to the larger amplitude envelope quantization value has greater energy, so the embodiment of the present invention is based on the amplitude envelope quantization value of each subband The sub-bands are sorted in descending order, and the sub-bands are hierarchically sorted according to the order in which the corresponding amplitude envelope quantization values of the sub-bands are arranged in descending order.
所述各子带的编码信息包括:各子带的幅度包络索引值,比特分类控制信息和各子带中的MLT系数量化索引值。The coding information of each sub-band includes: the amplitude envelope index value of each sub-band, the bit classification control information and the MLT coefficient quantization index value of each sub-band.
步骤206、根据所述各子带的幅度包络量化值获取所述各子带的幅度包络索引值。
本发明实施例通过对所述各子带的幅度包络量化值进行哈夫曼编码,得到所述各子带幅度包络量化索引值。In the embodiment of the present invention, Huffman coding is performed on the amplitude envelope quantization value of each sub-band to obtain the amplitude envelope quantization index value of each sub-band.
步骤207、根据编码码率和所述各子带的幅度包络量化值获取所述比特分类控制信息。
根据所述编码码率确定每一帧语音与音频信号所占的总比特数。The total number of bits occupied by each frame of speech and audio signals is determined according to the encoding rate.
每一帧中所述比特分类控制信息占4比特,该比特分类控制信息表示了所述各子带的分类方法,所述分类方法为一种对所述各子带进行比特分配和矢量划分的方法。下面对获取所述比特分类控制信息的方法进行详细介绍。The bit classification control information in each frame occupies 4 bits, and the bit classification control information indicates the classification method of each subband, and the classification method is a method of bit allocation and vector division for each subband method. The method for obtaining the bit classification control information will be described in detail below.
所述比特分类控制信息为每个子带确定一个分类方法,该分类方法确定了各子带在所述码流中所占的比特数和各子带中MLT系数的矢量划分方法。不同的分类情况为所述各子带分配的比特数和对各子带中所述矢量的划分不同。The bit classification control information determines a classification method for each subband, and the classification method determines the number of bits occupied by each subband in the code stream and the vector division method of the MLT coefficients in each subband. The different classification situations are that the number of bits allocated to each sub-band and the division of the vectors in each sub-band are different.
先对各子带进行初步分类,如表1所示,每个子带有8种分类情况可供选择(分类0~分类7),每个分类与表中相应的分配比特数对应。Initially classify each sub-band, as shown in Table 1, each sub-band has 8 classifications to choose from (class 0 to class 7), and each class corresponds to the corresponding number of allocated bits in the table.
根据幅度包络量化值进行比特分配,幅度包络量化值较大的子带重要性比较大,因此选择标号较小的分类方法,为该子带分配的比特数较多;反之,幅度包络量化值较小的子带重要性较小,选择标号较大的分类情况,为该子带分配的比特数较少。The bit allocation is carried out according to the quantization value of the amplitude envelope, and the importance of the subband with a larger quantization value of the amplitude envelope is relatively greater, so the classification method with a smaller label is selected to allocate more bits for the subband; otherwise, the magnitude envelope The sub-band with a smaller quantization value is less important, and the classification situation with a larger label is selected, and the number of bits allocated to the sub-band is less.
表1Table 1
根据上述由编码速率确定的每一帧语音与音频信号所占的总比特数,和比特分类控制信息(占4比特)之差,得到剩余编码比特数。为所述各子带分配的总的比特数应该接近但不大于所述剩余编码比特数。下面对为每个子带确定所属分类的方法进行介绍。According to the difference between the total number of bits occupied by each frame of speech and audio signals determined by the encoding rate and the bit classification control information (occupying 4 bits), the number of remaining encoding bits is obtained. The total number of bits allocated for each subband should be close to but not greater than the number of remaining coded bits. The method for determining the category to which each subband belongs is introduced below.
首先确定一个偏移量范围,本发明实施例取[-32,31],在该偏移量范围中选择一个初始的偏移量,通过下式(3)初步确定一个子带所属的分类:First determine an offset range, the embodiment of the present invention takes [-32, 31], select an initial offset in the offset range, and preliminarily determine the category to which a subband belongs by the following formula (3):
category(r)=MAX{0,MIN{7,(offset-rms′(r))/2}} (3)category(r)=MAX{0, MIN{7, (offset-rms′(r))/2}} (3)
其中,offset为偏移量,rms′(r)为子带r的幅度包络量化值,category(r)表示子带r所属的分类(分类0~分类7)。Wherein, offset is the offset, rms'(r) is the amplitude envelope quantization value of subband r, and category(r) indicates the category (category 0 to category 7) to which subband r belongs.
在选择的初始偏移量下,所有子带分配的总比特数如下式(4)所示:Under the selected initial offset, the total number of bits allocated for all subbands is shown in equation (4):
其中,expected_bits_table(category(r))表示子带r属于分类category(r)时需要的比特数,number_of_region为总的子带个数,expected_number_of_code_bits表示为所有子带分配的总比特数。Among them, expected_bits_table(category(r)) indicates the number of bits required when subband r belongs to category category(r), number_of_region is the total number of subbands, and expected_number_of_code_bits indicates the total number of bits allocated for all subbands.
在[-32,31]范围内调整offset值,在不同的偏移量下,重复计算所述为所有子带分配的总比特数,选择最接近但不超过所述剩余编码比特数的所述所有子带的总比特数对应的分类方法,作为初始的分类方法。Adjust the offset value in the range of [-32, 31], under different offsets, repeatedly calculate the total number of bits allocated for all subbands, and select the one closest to but not exceeding the number of remaining coded bits The classification method corresponding to the total number of bits of all subbands is used as the initial classification method.
对得到的初始分类方法进行调整,找到最合适的分类方法。调整分类时,共有16种调整分类方法,根据所述剩余编码比特数和所述编码码率,所属领域的技术人员可以通过现有技术中公开的方法,获得一种最优的分类方法,从而,确定为所述各子带分配的比特数和对所述各子带中MLT系数的矢量划分方法。最优分类方法对应的标号,即比特分类控制信息,在码流中占用4个比特。Adjust the obtained initial classification method to find the most suitable classification method. When adjusting the classification, there are 16 kinds of adjustment classification methods. According to the number of remaining coding bits and the coding rate, those skilled in the art can obtain an optimal classification method through the methods disclosed in the prior art, thereby , determining the number of bits allocated for each subband and the vector division method for the MLT coefficients in each subband. The label corresponding to the optimal classification method, that is, the bit classification control information, occupies 4 bits in the code stream.
步骤208、根据所述各子带中的MLT系数和幅度包络量化值获取所述各子带中的MLT系数量化索引值。所述MLT系数量化索引值包括MLT系数幅度索引值和MLT系数符号索引值,该步骤具体包括:Step 208: Obtain quantization index values of MLT coefficients in each subband according to the MLT coefficients and amplitude envelope quantization values in each subband. The MLT coefficient quantization index value includes an MLT coefficient amplitude index value and an MLT coefficient sign index value, and this step specifically includes:
步骤S1、将所述各子带中的MLT系数除以相应的所述各子带的幅度包络量化值,获取所述各子带中MLT系数的归一化值;Step S1. Dividing the MLT coefficients in each subband by the corresponding amplitude envelope quantization value of each subband to obtain the normalized value of the MLT coefficient in each subband;
步骤S2、将所述各子带中MLT系数的归一化值进行量化,获取所述各子带中MLT系数的归一化值的量化值;Step S2, quantizing the normalized value of the MLT coefficient in each subband, and obtaining the quantized value of the normalized value of the MLT coefficient in each subband;
步骤S3、按照所述比特分类控制信息将所述各子带中MLT系数的归一化量化值划分为至少两个矢量,所述矢量包括幅度和符号;Step S3, divide the normalized quantization values of the MLT coefficients in each subband into at least two vectors according to the bit classification control information, the vectors include magnitude and sign;
步骤S4、根据所述各矢量的幅度获取所述各子带中各矢量相应的MLT系数幅度索引值;Step S4, obtaining the corresponding MLT coefficient magnitude index value of each vector in each subband according to the magnitude of each vector;
步骤S5、根据所述各矢量的符号获取所述各子带中各矢量相应的MLT系数符号索引值,所述MLT系数符号索引值表示了其相应的MLT系数幅度索引值的正负。Step S5 , according to the signs of the vectors, obtain the MLT coefficient sign index value corresponding to each vector in each subband, and the MLT coefficient sign index value indicates the sign of its corresponding MLT coefficient magnitude index value.
步骤209、将所述各子带的幅度包络索引值写入码流。
步骤210、将所述比特分类控制信息写入码流。
步骤211、根据所述各子带的层次排序和所述比特分类控制信息,依次将所述各子带中各矢量的所述MLT系数量化索引值,即所述MLT系数幅度索引值和MLT系数符号索引值,写入码流。
码流写入完毕后,获得的码流结构如图3所示,从码流的首位到末位依次包括所述各子带的幅度包络索引值、比特分类控制信息和所述MLT系数量化索引值三部分。After the code stream is written, the obtained code stream structure is shown in Figure 3, which includes the amplitude envelope index value of each sub-band, bit classification control information and the quantization of the MLT coefficients from the first bit to the last bit of the code stream. The index value has three parts.
本发明实施例提供的编码方法,通过对所述各子带的层次排序,保证了语音与音频信号中重要的信息存储在了码流的前部,即码流的低层,次重要信息存储在了码流的后部,即码流的高层。The encoding method provided by the embodiment of the present invention ensures that the important information in the speech and audio signals is stored in the front part of the code stream by sorting the levels of the sub-bands, that is, the lower layer of the code stream, and the secondary important information is stored in the The rear part of the code stream, that is, the upper layer of the code stream.
本发明实施例提供的编码方法,生成了一种具有较高编码速率的码流,该较高编码速率是相对于在实际网络中传输所需的码率,所述的较高编码速率不小于传输所需的码率。当网络传输中所需的码率比该编码码率低时,将所述码流进行截断,获得所需码率下的码流。The coding method provided by the embodiment of the present invention generates a code stream with a higher coding rate, which is relative to the code rate required for transmission in an actual network, and the higher coding rate is not less than The required code rate for transmission. When the code rate required in network transmission is lower than the encoding code rate, the code stream is truncated to obtain a code stream at the required code rate.
本发明实施例提供的编码方法还包括:The encoding method provided by the embodiment of the present invention also includes:
根据所述编码码率和当前所需码率,对所述码流中的MLT系数量化索引值进行截断,获取截断点。根据所述截断点获取所需码流,所述所需码流包括各子带的幅度包络索引值,比特分类控制信息和按照所述层次排序所述截断点以前各子带的所述MLT系数量化索引值。According to the encoding code rate and the currently required code rate, truncate the MLT coefficient quantization index value in the code stream to obtain a truncation point. Acquire the required code stream according to the truncation point, the required code stream includes the amplitude envelope index value of each subband, bit classification control information and the MLT of each subband before the truncation point according to the hierarchical ordering Coefficient quantization index value.
所述截断点的位置有三种,如图4所示,There are three positions of the truncation point, as shown in Figure 4,
第一种情况(如图4中A处所示)、所述截断点位于所述MLT系数符号索引值与MLT系数幅度索引值的交界处。In the first case (as shown at A in FIG. 4 ), the truncation point is located at the junction of the MLT coefficient sign index value and the MLT coefficient amplitude index value.
第二种情况(如图4中B处所示)、所述截断点位于所述MLT系数符号索引值中。In the second case (as shown at B in FIG. 4 ), the truncation point is located in the MLT coefficient sign index value.
第三种情况(如图4中C处所示)、所述截断点位于所述MLT系数幅度索引值中。In the third case (as shown at C in FIG. 4 ), the truncation point is located in the magnitude index value of the MLT coefficient.
本发明实施例中,编码端是对7kHz带宽范围的MLT系数以16kbit/s(比特每秒)码率进行的编码,每帧有320比特的编码信息。如图5所示,如果需要8kbit/s传输,则要对320比特信息的码流进行截断,保留前160bits的信息,即截断后获得的所需码流,用于网络通信,丢弃截断点后的160bits信息。码流中的三部分信息:幅度包络索引值、比特分类控制信息和所述MLT系数量化索引值,前两个部分所占比特数相对较少,远小于160bits,所以截断后的获得的所需码流包含了原始语音与音频信号的基本信息,能够保证通信质量。In the embodiment of the present invention, the encoding end encodes the MLT coefficients in the 7 kHz bandwidth range at a code rate of 16 kbit/s (bits per second), and each frame has 320 bits of encoding information. As shown in Figure 5, if 8kbit/s transmission is required, the code stream of 320-bit information should be truncated, and the information of the first 160 bits should be retained, that is, the required code stream obtained after truncation is used for network communication, and after the truncation point is discarded 160bits information. There are three parts of information in the code stream: the amplitude envelope index value, the bit classification control information and the MLT coefficient quantization index value. The number of bits occupied by the first two parts is relatively small, far less than 160 bits, so the truncated The required code stream contains the basic information of the original voice and audio signal, which can guarantee the communication quality.
本发明实施例还提供了一种解码方法,能够获得较高质量的解码信号。一种解码方法,如图6所示,该方法包括如下步骤:The embodiment of the present invention also provides a decoding method capable of obtaining a higher-quality decoded signal. A decoding method, as shown in Figure 6, the method comprises the following steps:
步骤601、从码流中获取解码信息;
步骤602、根据所述解码信息确定信号中各子带的层次排序,所述信号包含至少两个子带;
步骤603、根据所述层次排序,对所述解码信息进行解码,获取解码后的信号。Step 603: Decode the decoded information according to the hierarchical ordering, and obtain a decoded signal.
下面对本发明实施例进行详细介绍。The following describes the embodiments of the present invention in detail.
步骤601、从码流中获取解码信息。
本发明实施例中所述信号包括语音信号和音频信号中的至少一种。The signal in the embodiment of the present invention includes at least one of a voice signal and an audio signal.
所述解码信息包括:各子带的幅度包络索引值,比特分类控制信息和各子带中的MLT系数量化索引值。The decoding information includes: the amplitude envelope index value of each subband, the bit classification control information and the MLT coefficient quantization index value in each subband.
步骤602、根据解码信息确定所述信号中各子带的层次排序的步骤包括:
步骤T1、根据所述各子带的幅度包络索引值获取所述各子带的幅度包络量化值;Step T1, obtaining the amplitude envelope quantization value of each sub-band according to the amplitude envelope index value of each sub-band;
在本发明实施例中,由于编码时采用哈夫曼编码方式获取所述幅度包络量化索引值,因此,在本发明实施例中进行解码时,通过对所述哈夫曼码进行解码,恢复出各子带的幅度包络量化值。In the embodiment of the present invention, since the Huffman coding method is used to obtain the quantized index value of the amplitude envelope during encoding, when decoding in the embodiment of the present invention, the Huffman code is decoded to recover Output the amplitude envelope quantization value of each subband.
步骤T2、根据所述各子带的幅度包络量化值确定各子带的层次排序。Step T2. Determine the hierarchical order of each sub-band according to the amplitude envelope quantization value of each sub-band.
在解码时,所述各子带的层次排序也为按照所述各子带的幅度包络量化值从大到小的顺序对各子带进行排序。由于解码时获得的所述各子带的层次排序与编码中的所述各子带的层次排序相同,从而保证了解码后能够获得准确的语音与音频信号。During decoding, the hierarchical ordering of the subbands is also to sort the subbands in descending order of the magnitude envelope quantization values of the subbands. Since the hierarchical order of the subbands obtained during decoding is the same as the hierarchical order of the subbands during encoding, it is ensured that accurate speech and audio signals can be obtained after decoding.
步骤603、根据所述层次排序,对所述解码信息进行解码,获取解码后的信号,该步骤具体包括:Step 603: Decode the decoded information according to the hierarchical ordering, and obtain a decoded signal. This step specifically includes:
所述MLT系数量化索引值包括MLT系数幅度索引值和MLT系数符号索引值。The MLT coefficient quantization index value includes an MLT coefficient magnitude index value and an MLT coefficient sign index value.
步骤U1、根据所述码流的编码码率、所述比特分类控制信息和所述各子带的幅度包络量化值获取所述各子带的分类方式;Step U1. Obtain the classification mode of each sub-band according to the coding rate of the code stream, the bit classification control information and the quantized value of the amplitude envelope of each sub-band;
所述比特分类控制信息表示了编码时选取的最优分类方法的标号,根据所述标号对应的最优分类方法,和所述码流的编码码率及和所述各子带的幅度包络量化值,获得所述各子带归属的分类方式,即获取了所述各子带占用的比特数和所述各子带中矢量的划分方法。所述码流的编码码率为编码时生成原始嵌入式结构码流时使用的编码码率。The bit classification control information indicates the label of the optimal classification method selected during encoding, according to the optimal classification method corresponding to the label, the coding rate of the code stream and the amplitude envelope of each sub-band The quantization value is used to obtain the classification method of the sub-bands, that is, to obtain the number of bits occupied by the sub-bands and the division method of the vectors in the sub-bands. The encoding rate of the code stream is the encoding rate used when generating the original embedded structure code stream during encoding.
步骤U2、根据所述各子带的层次排序和所述各子带的分类方式,利用所述各子带中的MLT系数幅度索引值和MLT系数符号索引值,获取所述各子带中的MLT系数;Step U2, according to the hierarchical ordering of the subbands and the classification method of the subbands, using the MLT coefficient amplitude index value and the MLT coefficient sign index value in the subbands to obtain the subbands in the subbands MLT coefficient;
根据所述各子带的层次排序,先对最先写入码流的子带,即携带较重要信息的子带进行解码,再依次对携带次重要信息的子带进行解码。由所述各子带的分类方式得到所述各子带所占的比特数和所述各子带中矢量的划分方式,获取各子带中所有的MLT系数幅度索引值和MLT系数符号索引值。利用所述幅度与符号索引值解码获得所述各子带中的MLT系数。According to the hierarchical ordering of the sub-bands, the sub-band written into the code stream first, that is, the sub-band carrying more important information is first decoded, and then the sub-bands carrying less important information are sequentially decoded. The number of bits occupied by each subband and the division method of vectors in each subband are obtained from the classification method of each subband, and all MLT coefficient amplitude index values and MLT coefficient sign index values in each subband are obtained . The MLT coefficients in each subband are obtained by decoding using the amplitude and sign index values.
步骤U3、对所述各子带的MLT系数进行逆调制叠接变换,获取解码后的语音与音频信号。Step U3. Perform inverse modulation concatenation transformation on the MLT coefficients of each sub-band to obtain decoded speech and audio signals.
当码流存在网络丢包或发生截断,造成所述MLT系数量化索引值不完整时,本发明实施例提供的解码方法利用噪声填充获取缺失的所述MLT系数量化索引值对应的所述各子带的MLT系数,可分为两种情况:When network packet loss or truncation occurs in the code stream, resulting in incomplete quantization index values of the MLT coefficients, the decoding method provided by the embodiment of the present invention uses noise filling to obtain the sub-values corresponding to the missing quantization index values of the MLT coefficients The MLT coefficient of the band can be divided into two cases:
第一种情况、当所述MLT系数符号索引值发生全部缺失时(如图4中A、C处),将所述缺失的MLT系数符号索引值对应的子带的幅度包络量化值,与预定的衰减因子的乘积,作为所述子带的MLT系数的幅度值。In the first case, when all the MLT coefficient sign index values are missing (as shown at A and C places in Figure 4), the amplitude envelope quantization value of the subband corresponding to the missing MLT coefficient sign index value, and The product of predetermined attenuation factors is used as the amplitude value of the MLT coefficient of the subband.
第二种情况、当所述MLT系数符号索引值发生部分缺失时(如图4中B处),将所述MLT系数符号索引值缺失部分对应的子带的幅度包络量化值,与预定的衰减因子的乘积,作为所述MLT系数符号索引值缺失部分,即B所在符号索引的右侧部分的MLT系数值。而对B所在符号索引的左侧部分,依然利用得到的符号索引,结合其对应的幅度索引,解码其相应的MLT系数。上述解码方法保证了码流中的有效信息最大限度地被解码出来。In the second case, when the MLT coefficient sign index value is partially missing (as at B in Figure 4), the amplitude envelope quantization value of the subband corresponding to the missing part of the MLT coefficient sign index value is compared with the predetermined The product of the attenuation factor is used as the missing part of the symbol index value of the MLT coefficient, that is, the MLT coefficient value of the right part of the symbol index where B is located. For the left part of the symbol index where B is located, the obtained symbol index is still used in combination with its corresponding amplitude index to decode its corresponding MLT coefficient. The above decoding method ensures that the effective information in the code stream is decoded to the maximum extent.
本发明实施例采用的解码方法,当对码流进行解码时,通过获取所述码流中语音与音频信号各子带的所述层次排序,获得了所述各子带按照其所携带信息的重要性从大到小的排列顺序,解码时根据各个子带的所述排列顺序,依次按照所述重要性的大小,对所述各子带的解码信息进行解码,先解码出具有较高重要性的解码信息,从而,即使所述码流中缺失了部分重要性较低的解码信息,最终能够获得较高质量的解码信号。In the decoding method adopted in the embodiment of the present invention, when decoding the code stream, by obtaining the hierarchical ordering of the speech and audio signal sub-bands in the code stream, the sub-bands are obtained according to the information carried by the sub-bands. Arrangement order of importance from large to small, during decoding, according to the arrangement order of each sub-band, and in turn according to the magnitude of the importance, decode the decoding information of each sub-band, first decode the information with higher importance Therefore, even if some decoding information of low importance is missing in the code stream, a higher-quality decoding signal can be finally obtained.
如图7所示,本发明实施例还提供了一种编解码系统,该系统包括编码装置和解码装置,所述编码装置包括:As shown in Figure 7, an embodiment of the present invention also provides a codec system, the system includes an encoding device and a decoding device, and the encoding device includes:
子带获取模块701,用于获取信号的至少两个子带;A
幅度包络量化值获取模块702,用于获取所述子带获取模块获取的子带的幅度包络量化值;An amplitude envelope quantization
层次排序和编码信息获取模块703,用于利用所述幅度包络量化值获取模块获取的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;A hierarchical ordering and encoding
码流写入模块704,用于根据由所述层次排序确定模块确定的层次排序,将所述编码信息获取模块获取的各子带的编码信息写入码流。The code
所述解码装置包括:The decoding device includes:
解码信息获取模块705,用于从码流中获取解码信息;Decoding
层次排序获取模块706,用于根据所述解码信息获取模块获取的解码信息,确定信号中各子带的层次排序,所述信号包含至少两个子带;A hierarchical
解码信号获取模块707,用于根据所述层次排序获取模块获取的层次排序,对所述解码信息获取模块获取的解码信息进行解码,获取解码后的信号。The decoded
在本发明实施例中,所述信号包括语音信号和音频信号中的至少一种。In the embodiment of the present invention, the signal includes at least one of a speech signal and an audio signal.
所述层次排序和编码信息获取模块包括编码排序模块,用于按照所述各子带的幅度包络量化值从大到小的顺序对各子带进行排序。The layer sorting and coding information acquisition module includes a coding sorting module, configured to sort the subbands according to the descending order of the amplitude envelope quantization values of the subbands.
所述层次排序获取模块包括解码排序模块,用于按照所述各子带的幅度包络量化值从大到小的顺序对各子带进行排序。The hierarchical sorting acquisition module includes a decoding sorting module, configured to sort the subbands in descending order of the amplitude envelope quantization values of the subbands.
本发明实施例还提供了一种编码装置,如图8所示,该装置包括:The embodiment of the present invention also provides an encoding device, as shown in Figure 8, the device includes:
子带获取单元81,用于获取信号的至少两个子带;A
幅度包络量化值获取单元82,用于获取所述子带获取单元获取的子带的幅度包络量化值;An amplitude envelope quantization
层次排序和编码信息获取单元83,用于利用所述幅度包络量化值获取模块获取的幅度包络量化值获取所述各子带的层次排序和所述各子带的编码信息;A hierarchical ordering and encoding
码流写入单元84,用于根据由所述层次排序和编码信息获取单元获取的层次排序,将所述编码信息获取单元获取的各子带的编码信息写入码流。The code
下面对本发明实施例进行详细描述。The embodiments of the present invention are described in detail below.
在本发明实施例中,所述信号包括语音信号和音频信号中的至少一种。In the embodiment of the present invention, the signal includes at least one of a speech signal and an audio signal.
如图9所示,所述子带获取单元81包括:As shown in Figure 9, the
MLT系数获取模块811,用于获取所述信号中的MLT系数;MLT
子带划分模块812,用于将由所述MLT系数获取模块获取的MLT系数分为至少两组,所述的每组MLT系数为一个子带。The
幅度包络量化值获取单元82,用于获取所述子带获取单元获取的子带的幅度包络量化值。The amplitude envelope quantization
本发明实施例提供的层次排序是一种能量排序,较大的幅度包络量化值对应的子带具有较大的能量,所以,本发明实施例按照所述各子带的幅度包络量化值从大到小的顺序对各子带进行排序,所述各子带的层次排序为按照具有的幅度包络量化值从大到小的排列顺序,即子带的从低层到高层的排序对应幅度包络量化值的从大到小的排序。所述层次排序和编码信息获取单元83包括:The hierarchical sorting provided by the embodiment of the present invention is an energy sorting, and the subband corresponding to the larger amplitude envelope quantization value has greater energy, so the embodiment of the present invention is based on the amplitude envelope quantization value of each subband The sub-bands are sorted in order from large to small, and the hierarchical order of the sub-bands is the order in which the quantized values of the amplitude envelopes are arranged from large to small, that is, the order of the sub-bands from the lower layer to the higher layer corresponds to the amplitude Largest to smallest ordering of envelope quantization values. The hierarchical ordering and encoding
层次排序确定模块831,用于按照所述各子带的幅度包络量化值从大到小的顺序对各子带进行排序。The hierarchy sorting
本发明实施例提供的编码装置,通过所述层次排序确定单元,保证了语音与音频信号中重要的信息存储在了码流的前部,即码流的低层,次重要信息存储在了码流的后部,即码流的高层。The encoding device provided by the embodiment of the present invention, through the hierarchical order determination unit, ensures that the important information in the voice and audio signals is stored in the front part of the code stream, that is, the lower layer of the code stream, and the secondary important information is stored in the code stream The rear part of the code stream is the upper layer.
在本发明实施例中,所述各子带的编码信息包括:各子带的幅度包络索引值,比特分类控制信息和各子带中的MLT系数量化索引值,所述层次排序和编码信息获取单元83包括:In the embodiment of the present invention, the encoding information of each subband includes: the amplitude envelope index value of each subband, the bit classification control information and the MLT coefficient quantization index value in each subband, and the hierarchical ordering and encoding
幅度包络索引值获取模块832,用于根据所述各子带的幅度包络量化值获取所述各子带的幅度包络索引值;An amplitude envelope index
比特分类控制信息获取模块833,用于根据编码码率和所述各子带的幅度包络量化值获取所述比特分类控制信息;A bit classification control
MLT系数量化索引值获取模块834,用于根据所述各子带中的MLT系数、幅度包络量化值和所述比特分类控制信息获取模块获取的比特分类控制信息获取所述各子带中的MLT系数量化索引值。The MLT coefficient quantization index
在本发明实施例中,所述MLT系数量化索引值包括MLT系数幅度索引值和MLT系数符号索引值,所述MLT系数量化索引值获取模块933进一步包括:In this embodiment of the present invention, the MLT coefficient quantization index value includes an MLT coefficient magnitude index value and an MLT coefficient sign index value, and the MLT coefficient quantization index value acquisition module 933 further includes:
归一化值获取模块,用于将所述各子带中的MLT系数除以相应的所述各子带的幅度包络量化值,获取所述各子带中MLT系数的归一化值;A normalized value acquisition module, configured to divide the MLT coefficients in the subbands by the corresponding amplitude envelope quantization values of the subbands to obtain the normalized values of the MLT coefficients in the subbands;
归一化量化值获取模块,用于获取所述归一化值获取模块获取的MLT系数归一化值的量化值;A normalized quantized value obtaining module, configured to obtain the quantized value of the normalized value of the MLT coefficient obtained by the normalized value obtaining module;
矢量划分模块,用于根据所述比特分类控制信息将由所述归一化量化值获取模块获取的归一化量化值,划分为至少两个矢量,所述矢量包括幅度和符号;A vector division module, configured to divide the normalized quantized value obtained by the normalized quantized value obtaining module into at least two vectors according to the bit classification control information, and the vector includes magnitude and sign;
MLT系数幅度索引值获取模块,用于根据所述各矢量的幅度获取所述各子带中各矢量相应的MLT系数幅度索引值;The MLT coefficient magnitude index value acquisition module is used to obtain the MLT coefficient magnitude index value corresponding to each vector in each subband according to the magnitude of each vector;
MLT系数符号索引值获取模块,用于根据所述各矢量的符号获取所述各子带中各矢量相应的MLT系数符号索引值。The MLT coefficient sign index value acquiring module is configured to acquire the MLT coefficient sign index value corresponding to each vector in each subband according to the sign of each vector.
所述码流写入单元84包括:The code
幅度包络索引值写入模块841,用于将所述各子带的幅度包络索引值写入码流;The amplitude envelope index
比特分类控制信息写入模块842,用于将所述比特分类控制信息写入码流;A bit classification control
MLT系数量化索引值写入模块843,用于根据所述各子带的层次排序和所述比特分类控制信息,依次将所述各子带中各矢量的所述MLT系数幅度索引值和MLT系数符号索引值写入码流。The MLT coefficient quantization index
本发明实施例提供的编码装置,生成了一种具有较高编码速率的码流,该较高编码速率是相对于在实际网络中传输所需的码率,所述的较高编码速率不小于传输所需的码率。当网络传输中所需的码率比该编码码率低时,将所述码流进行截断,获得所需码率下的码流。当实际传输中所需的码率小于编码码率时,所述编码装置还包括:The coding device provided by the embodiment of the present invention generates a code stream with a higher coding rate, which is relative to the code rate required for transmission in an actual network, and the higher coding rate is not less than The required code rate for transmission. When the code rate required in network transmission is lower than the encoding code rate, the code stream is truncated to obtain a code stream at the required code rate. When the code rate required in actual transmission is less than the code rate, the encoding device also includes:
截断点获取单元,用于根据所述编码码率和当前所需码率,对所述码流中的MLT系数量化索引值进行截断,获取截断点;所述截断点的位置有三种,如图4所示,The truncation point acquisition unit is used to truncate the MLT coefficient quantization index value in the code stream according to the encoding code rate and the current required code rate to obtain a truncation point; there are three positions of the truncation point, as shown in FIG. 4,
第一种情况(如图4中A处所示)、所述截断点位于所述MLT系数符号索引值与MLT系数幅度索引值的交界处。In the first case (as shown at A in FIG. 4 ), the truncation point is located at the junction of the MLT coefficient sign index value and the MLT coefficient amplitude index value.
第二种情况(如图4中B处所示)、所述截断点位于所述MLT系数符号索引值中。In the second case (as shown at B in FIG. 4 ), the truncation point is located in the MLT coefficient sign index value.
第三种情况(如图4中C处所示)、所述截断点位于所述MLT系数幅度索引值中。In the third case (as shown at C in FIG. 4 ), the truncation point is located in the magnitude index value of the MLT coefficient.
所需码流获取单元,用于根据所述截断点获取单元获取的截断点,获取所需码流,所述所需码流包括各子带的幅度包络索引值,比特分类控制信息和按照所述层次排序所述截断点以前各子带的所述MLT系数量化索引值。The required code stream acquisition unit is used to obtain the required code stream according to the truncation point obtained by the truncation point acquisition unit, and the required code stream includes the amplitude envelope index value of each sub-band, bit classification control information and according to The hierarchy sorts the MLT coefficient quantization index values of the subbands before the truncation point.
本发明实施例提供的编码装置,首先为语音与音频信号中的各个不同子带确定层次排序,所述层次排序将各子带按照其所携带信息的重要性从大到小进行排序,在编写码流时根据所述层次排序,依次按照重要性从大到小写入相应子带的编码信息,先写入携带较重要信息子带的编码信息,从而,使编写出的码流结构,根据携带信息重要性的不同分为不同的层次,形成了一种具有嵌入式结构的码流,能够根据网络状况及用户对服务质量要求的不同,传输具有不同层次的码流,适用于当前的网络通信;同时,当网络传输中所需的码率比该编码码率低时,将所述码流进行截断,获得所需码率下的码流,由于码流具有嵌入式结构,因此,截断后的获得的所需码流包含了原始语音与音频信号的基本信息,能够保证通信质量。The encoding device provided by the embodiment of the present invention firstly determines the hierarchical ordering for each different subband in the speech and audio signal, and the said hierarchical ordering sorts each subband according to the importance of the information it carries. When the code stream is sorted according to the levels, the coded information of the corresponding subbands is written in order according to the importance from large to small, and the coded information of the subbands carrying more important information is written first, so that the code stream structure is written according to The importance of carrying information is divided into different levels, forming a code stream with an embedded structure, which can transmit code streams with different levels according to network conditions and user requirements for service quality, and is suitable for current networks Communication; at the same time, when the code rate required in network transmission is lower than the encoding code rate, the code stream is truncated to obtain the code stream at the required code rate. Since the code stream has an embedded structure, the truncation The required code stream obtained later contains the basic information of the original voice and audio signal, which can guarantee the communication quality.
本发明实施例还提供了一种解码装置,如图10所示,该装置包括:The embodiment of the present invention also provides a decoding device, as shown in Figure 10, the device includes:
解码信息获取单元101,用于从码流中获取解码信息;Decoding
层次排序获取单元102,用于根据所述解码信息获取单元获取的解码信息,确定语音与音频信号中各子带的层次排序,所述语音与音频信号包含至少两个子带;A hierarchy
解码信号获取单元103,用于根据所述层次排序获取单元获取的层次排序,对所述解码信息获取单元获取的解码信息进行解码,获取解码后的语音与音频信号。The decoded
下面对本发明实施例进行详细介绍。The following describes the embodiments of the present invention in detail.
在本发明实施例中,所述解码信息包括:各子带的幅度包络索引值,比特分类控制信息和各子带中的MLT系数量化索引值;In the embodiment of the present invention, the decoding information includes: the amplitude envelope index value of each subband, the bit classification control information and the MLT coefficient quantization index value in each subband;
如图12所示,所述层次排序获取单元102包括:As shown in Figure 12, the hierarchical
幅度包络量化值获取模块1021,用于根据所述各子带的幅度包络索引值获取所述各子带的幅度包络量化值;An amplitude envelope quantization
层次排序获取模块1022,用于根据所述幅度包络量化值获取模块获取的幅度包络量化值,确定各子带的层次排序。The hierarchical
所述MLT系数量化索引值包括MLT系数幅度索引值和MLT系数符号索引值;The MLT coefficient quantization index value includes an MLT coefficient magnitude index value and an MLT coefficient sign index value;
所述解码信号获取单元103包括:The decoded
分类获取模块1031,用于根据所述码流的编码码率、所述比特分类控制信息和所述各子带的幅度包络量化值获取所述各子带的分类方式;A
MLT系数获取模块1032,用于根据所述各子带的层次排序和所述各子带的分类方式,利用所述各子带中的MLT系数幅度索引值和MLT系数符号索引值,获取所述各子带中的MLT系数;The MLT
解码信号获取模块1033,用于对所述各子带的MLT系数进行逆调制叠接变换,获取解码后的语音与音频信号。The decoded
当码流存在网络丢包或发生截断,造成所述MLT系数量化索引值不完整时,本发明实施例提供的解码装置利用噪声填充获取缺失的所述MLT系数量化索引值对应的所述各子带的MLT系数,所述MLT系数获取模块包括:When network packet loss or truncation occurs in the code stream, causing the MLT coefficient quantization index value to be incomplete, the decoding device provided by the embodiment of the present invention uses noise padding to obtain the subfields corresponding to the missing MLT coefficient quantization index value. The MLT coefficient of band, described MLT coefficient obtaining module comprises:
缺失索引值的MLT系数获取模块,用于当所述MLT系数量化索引值不完整时,利用噪声填充获取缺失的所述MLT系数量化索引值对应的所述各子带的MLT系数,可分为两种情况:The MLT coefficient acquisition module of the missing index value is used to obtain the MLT coefficients of the sub-bands corresponding to the missing MLT coefficient quantization index values by using noise filling when the quantization index value of the MLT coefficient is incomplete, which can be divided into Two situations:
第一种情况、当所述MLT系数符号索引值发生全部缺失时(如图4中A、C处),所述缺失索引值的MLT系数获取模块将所述缺失的MLT系数符号索引值对应的子带的幅度包络量化值,与预定的衰减因子的乘积,作为所述子带的MLT系数的幅度值。In the first case, when all the MLT coefficient sign index values are missing (as shown at A and C places in Figure 4), the MLT coefficient acquisition module of the missing index value corresponding to the missing MLT coefficient sign index value The product of the quantized value of the amplitude envelope of the subband and the predetermined attenuation factor is used as the amplitude value of the MLT coefficient of the subband.
第二种情况、当所述MLT系数符号索引值发生部分缺失时(如图4中B处),所述缺失索引值的MLT系数获取模块将所述MLT系数符号索引值缺失部分对应的子带的幅度包络量化值,与预定的衰减因子的乘积,作为所述MLT系数符号索引值缺失部分,即B所在符号索引的右侧部分的MLT系数值。而对B所在符号索引的左侧部分,依然利用得到的符号索引,结合其对应的幅度索引,解码其相应的MLT系数。上述解码方法保证了码流中的有效信息最大限度地被解码出来。In the second case, when the MLT coefficient sign index value is partially missing (as at B in Figure 4), the MLT coefficient acquisition module of the missing index value will use the subband corresponding to the missing part of the MLT coefficient sign index value The product of the amplitude envelope quantization value of , and a predetermined attenuation factor is used as the missing part of the sign index value of the MLT coefficient, that is, the MLT coefficient value of the right part of the sign index where B is located. For the left part of the symbol index where B is located, the obtained symbol index is still used in combination with its corresponding amplitude index to decode its corresponding MLT coefficient. The above decoding method ensures that the effective information in the code stream is decoded to the maximum extent.
本发明实施例提供的解码装置对码流进行解码时,通过获取码流中语音与音频信号各子带的所述层次排序,即获得了所述各子带按照其所携带信息的重要性从大到小的排列顺序,解码时根据各个子带的所述排列顺序,依次按照所述重要性的大小,对所述各子带的解码信息进行解码,从而保证了解码获得准确的语音与音频信号;同时,先解码出具有较高重要性的解码信息,从而,即使所述码流中缺失了部分重要性较低的解码信息,最终获得较高质量的解码信号。When the decoding device provided by the embodiment of the present invention decodes the code stream, by obtaining the hierarchical ordering of the subbands of the voice and audio signals in the code stream, the subbands are obtained according to the importance of the information they carry. Arrangement order from large to small, when decoding, according to the arrangement order of each sub-band, the decoding information of each sub-band is decoded according to the magnitude of the importance, thus ensuring accurate speech and audio by decoding At the same time, the decoded information with higher importance is decoded first, so that even if some decoded information with lower importance is missing in the code stream, a higher-quality decoded signal is finally obtained.
本领域普通技术人员可以理解实现上述实施例中的全部或部分步骤,可以通过程序指令相关硬件完成。所述实施例对应的软件可以存储在一个计算机可存储读取的介质中。Those of ordinary skill in the art can understand that all or part of the steps in the above embodiments can be implemented through program instructions and related hardware. The software corresponding to the embodiments may be stored in a computer-readable medium.
当然,本发明的实施例还可有很多种,在不背离本发明的实施例精神及其实质的情况下,本领域技术人员当可根据本发明的实施例做出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明的实施例所附的权利要求的保护范围。Of course, there are many other embodiments of the present invention, and those skilled in the art can make various corresponding changes and modifications according to the embodiments of the present invention without departing from the spirit and essence of the embodiments of the present invention. , but these corresponding changes and modifications should all belong to the protection scope of the appended claims of the embodiments of the present invention.
Claims (23)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810094441A CN101572586B (en) | 2008-04-30 | 2008-04-30 | Codec method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810094441A CN101572586B (en) | 2008-04-30 | 2008-04-30 | Codec method, device and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101572586A CN101572586A (en) | 2009-11-04 |
CN101572586B true CN101572586B (en) | 2012-09-19 |
Family
ID=41231830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200810094441A Expired - Fee Related CN101572586B (en) | 2008-04-30 | 2008-04-30 | Codec method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101572586B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2014247000B2 (en) * | 2013-04-05 | 2017-04-20 | Dolby International Ab | Audio encoder and decoder |
CN105957533B (en) * | 2016-04-22 | 2020-11-10 | 杭州微纳科技股份有限公司 | Voice compression method, voice decompression method, audio encoder and audio decoder |
CN115116451B (en) * | 2022-06-15 | 2024-11-08 | 腾讯科技(深圳)有限公司 | Audio decoding, encoding method, device, electronic device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1210651A (en) * | 1996-11-06 | 1999-03-10 | 松下电器产业株式会社 | Image encoding and decoding method, image encoding and decoding device, and image encoding and decoding program recording medium |
CN1239569A (en) * | 1997-09-30 | 1999-12-22 | 西门子股份公司 | A method of encoding speech signals |
-
2008
- 2008-04-30 CN CN200810094441A patent/CN101572586B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1210651A (en) * | 1996-11-06 | 1999-03-10 | 松下电器产业株式会社 | Image encoding and decoding method, image encoding and decoding device, and image encoding and decoding program recording medium |
CN1239569A (en) * | 1997-09-30 | 1999-12-22 | 西门子股份公司 | A method of encoding speech signals |
Also Published As
Publication number | Publication date |
---|---|
CN101572586A (en) | 2009-11-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10546592B2 (en) | Audio signal coding and decoding method and device | |
JP7581265B2 (en) | Speech and audio encoding device, speech and audio decoding device, speech and audio encoding method, and speech and audio decoding method | |
CN102081927B (en) | Layering audio coding and decoding method and system | |
CN102222505B (en) | Hierarchical audio coding and decoding methods and systems and transient signal hierarchical coding and decoding methods | |
CN103778918B (en) | The method and apparatus of the bit distribution of audio signal | |
JP2013156667A (en) | Transient signal encoding method, decoding method, and computer readable medium | |
RU97122037A (en) | METHOD AND DEVICE FOR SCALABLE ENCODING / DECODING OF THE AUDIO SIGNAL | |
CN103544957A (en) | Method and device for bit distribution of sound signal | |
CN101572087B (en) | Embedded voice or audio signal codec method and device | |
CN105745703B (en) | Signal encoding method and apparatus, and signal decoding method and apparatus | |
CN103971693A (en) | Forecasting method for high-frequency band signal, encoding device and decoding device | |
CN101572586B (en) | Codec method, device and system | |
CN101562015A (en) | Audio-frequency processing method and device | |
CN101800050A (en) | Audio fine scalable coding method and system based on perception self-adaption bit allocation | |
EP2447943A1 (en) | Coding method, decoding method, and device and program using the methods | |
CN101685637B (en) | Audio frequency coding method and apparatus, audio frequency decoding method and apparatus | |
CN102479514A (en) | Encoding method, decoding method, device and system | |
Jia et al. | A novel embedded speech and audio codec based on ITU-T Recommendation G. 722.1 | |
CN101605017A (en) | Method and device for allocating coded bits | |
Baek et al. | A Study of Speech Coding for the Transmission on Network by the Wavelet Packets |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120919 Termination date: 20190430 |