[go: up one dir, main page]

CN101308657B - Code stream synthesizing method based on advanced audio coder - Google Patents

Code stream synthesizing method based on advanced audio coder Download PDF

Info

Publication number
CN101308657B
CN101308657B CN2007101484562A CN200710148456A CN101308657B CN 101308657 B CN101308657 B CN 101308657B CN 2007101484562 A CN2007101484562 A CN 2007101484562A CN 200710148456 A CN200710148456 A CN 200710148456A CN 101308657 B CN101308657 B CN 101308657B
Authority
CN
China
Prior art keywords
subband
coding
codebook
code book
code
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.)
Active
Application number
CN2007101484562A
Other languages
Chinese (zh)
Other versions
CN101308657A (en
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2007101484562A priority Critical patent/CN101308657B/en
Publication of CN101308657A publication Critical patent/CN101308657A/en
Application granted granted Critical
Publication of CN101308657B publication Critical patent/CN101308657B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种基于先进音频编码器的码流合成方法,包含如下步骤:A、量化编码:对待编码的码流进行量化编码处理,得到多个编码子带;B、码书合并:计算各编码子带使用不同码书时的参考比特消耗值,确定各编码子带使用的码书:按编码顺序,对于第一个编码子带,选择各码书中参考比特消耗值最小的码书作为使用码书;对于第一个编码子带之后的每一个编码子带,若当前编码子带的量化谱不全为0,选择各码书中使当前编码子带与上一编码子带的总参考比特消耗值最小的码书作为使用码书;C、码流合成:对各编码子带,选择步骤B中确定的使用码书进行编码,完成码流合成处理。本发明减少了熵编码的比特开销,提高了先进音频编码器的编码效率。

The invention discloses a code stream synthesis method based on an advanced audio encoder, comprising the following steps: A, quantization encoding: perform quantization encoding processing on the code stream to be encoded to obtain a plurality of encoding subbands; B, codebook merging: calculation The reference bit consumption value when different codebooks are used for each coding subband, and determine the codebook used by each coding subband: according to the coding sequence, for the first coding subband, select the codebook with the smallest reference bit consumption value in each codebook As the use of codebooks; for each coded subband after the first coded subband, if the quantization spectrum of the current coded subband is not all 0, select each codebook so that the total of the current coded subband and the previous coded subband Refer to the codebook with the smallest bit consumption value as the codebook for use; C. Code stream synthesis: For each coded subband, select the codebook for use determined in step B for encoding, and complete the code stream synthesis process. The invention reduces the bit overhead of entropy coding and improves the coding efficiency of the advanced audio coder.

Description

一种基于先进音频编码器的码流合成方法A Code Stream Synthesis Method Based on Advanced Audio Encoder

技术领域technical field

本发明涉及MPEG-4(运动图像专家组制定的一种动态图像标准)的先进音频编码(Advanced Audio Coding,AAC),具体地说涉及一种基于先进音频编码器的码流合成方法。The present invention relates to the advanced audio coding (Advanced Audio Coding, AAC) of MPEG-4 (a kind of dynamic picture standard formulated by the Motion Picture Experts Group), in particular to a code stream synthesis method based on an advanced audio coder.

背景技术Background technique

音频编码技术是诸如数字音频广播,互联网的传播音乐和音频通讯等多媒体应用技术的核心,这些应用极大地受益于音频编码器压缩性能的提高。感知音频编码器作为有损变换域编码的一种,是现代的主流音频编码器。感知音频编码器依赖于人耳的听觉感知特性研究,对编码噪声进行感知整形,以较高的编码压缩比获得较低感知质量下降的编码效果。在感知音频编码算法中,音频信号的变换域谱经过量化后,需要使用熵编码器对量化谱进行编码,以减少信息冗余。作为一种感知音频编码器,在MPEG-4AAC中,量化以子带为单位,子带中的MDCT(改进的离散余弦变换)谱经量化后得到整数量化谱,整数量化谱以子带为单位使用霍夫曼码书进行熵编码。MPEG-4AAC中霍夫曼码书包含码字码书HWk和码长码书HLk,k代表码书序号,取1到11,代表11种不同性质的霍夫曼码书,它们列于表1中。对码字码书检索得到霍夫曼码字,对码长码书检索得到霍夫曼码字的长度,即码长。Audio coding technology is at the heart of multimedia applications such as digital audio broadcasting, music dissemination over the Internet, and audio communications, which benefit greatly from improvements in the compression performance of audio encoders. As a kind of lossy transform domain coding, perceptual audio coder is the modern mainstream audio coder. The perceptual audio coder relies on the study of the auditory perception characteristics of the human ear, performs perceptual shaping on the coding noise, and obtains a coding effect with a lower perceptual quality degradation with a higher coding compression ratio. In the perceptual audio coding algorithm, after the transform domain spectrum of the audio signal is quantized, an entropy encoder is needed to encode the quantized spectrum to reduce information redundancy. As a perceptual audio coder, in MPEG-4AAC, quantization is in units of subbands, and the MDCT (modified discrete cosine transform) spectrum in the subbands is quantized to obtain integer quantization spectra, and the integer quantization spectrum is in units of subbands Entropy coding using Huffman codebook. The Huffman codebook in MPEG-4AAC includes the codeword codebook HW k and the code length codebook HL k , k represents the serial number of the codebook, ranging from 1 to 11, representing 11 different Huffman codebooks, which are listed in in FIG. 1. The Huffman codeword is obtained by retrieving the codeword codebook, and the length of the Huffman codeword is obtained by retrieving the code length codebook, that is, the code length.

表1MPEG-4AAC中霍夫曼码书及其性质Table 1 Huffman codebook and its properties in MPEG-4AAC

  码书序号codebook serial number   符号symbol   维数 dimension   最大绝对值Maximum absolute value   总个数 The total number of   1 1   有 have   44   1 1   8181   2 2   有 have   44   1 1   8181   33   无 none   44   2 2   8181   44   无 none   44   2 2   8181   55   有 have   2 2   44   8181   66   有 have   2 2   44   8181   77   无 none   2 2   77   6464   8 8   无 none   2 2   77   6464   9 9   无 none   2 2   1212   169169

  1010   无 none   2 2   1212   169169   1111   无 none   2 2   1515   289289

表1中,有符号代表该码书直接对整数量化谱编码;无符号代表该码书仅对整数量化谱的绝对值编码。n维码书代表n个整数量化谱对应一个霍夫曼码字;最大绝对值代表能使用该码书编码的子带中整数量化谱最大绝对值。对熵编码码长进行检索,首先求得子带中整数量化谱的最大绝对值tmax,依次将子带中相邻的四个整数量化谱组成四维矢量[t1 t2 t3 t4]作为索引去查找,累加求得不同码书熵编码所需码长的总数,其中,有符号码书的索引要加上最大绝对值作为偏移,而无符号码书的索引则加上1,四维码书使用[t1 t2 t3 t4]作为每一维的索引检索,二维码书使用[t1 t2],[t3 t4]分别检索两次。传统的检索码书的流程根据tmax判断如下:In Table 1, a sign means that the codebook directly encodes the integer quantized spectrum; an unsigned means that the codebook only encodes the absolute value of the integer quantized spectrum. The n-dimensional codebook represents that n integer quantization spectra correspond to one Huffman codeword; the maximum absolute value represents the maximum absolute value of the integer quantization spectrum in the subbands that can be coded using the codebook. To retrieve the code length of the entropy code, first obtain the maximum absolute value t max of the integer quantization spectrum in the sub-band, and sequentially form the four-dimensional vector [t 1 t 2 t 3 t 4 ] of four adjacent integer quantization spectra in the sub-band Use it as an index to search and accumulate to obtain the total number of code lengths required for entropy encoding of different codebooks. Among them, the index of the signed codebook should be added with the maximum absolute value as the offset, while the index of the unsigned codebook should be added with 1. The four-dimensional code book uses [t 1 t 2 t 3 t 4 ] as the index search for each dimension, and the two-dimensional code book uses [t 1 t 2 ] and [t 3 t 4 ] to search twice. The traditional codebook retrieval process is judged according to t max as follows:

tmax=1,检索1,2,3,4,5,6,7,8,9,10,11号码书t max =1, search 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 number books

tmax=2,检索3,4,5,6,7,8,9,10,11号码书t max = 2, search 3, 4, 5, 6, 7, 8, 9, 10, 11 number books

2<tmax□4,检索5,6,7,8,9,10,11号码书2<t max □4, search 5, 6, 7, 8, 9, 10, 11 number books

4<tmax□7,检索7,8,9,10,11号码书4<t max □7, search 7, 8, 9, 10, 11 number books

7<tmax□12,检索9,10,11号码书7<t max □12, search 9, 10, 11 number book

12<tmax□15,检索11号码书12<t max □15, retrieve book number 11

16£tmax,检索11号码书,启动溢出保护机制其中的溢出保护机制,在tmax 316时先以16替代大于16的整数谱t作为索引进行检索,然后在这个霍夫曼码字后面,为大于等于16的索引依次添加逃避序列。逃避序列(escape sequence)由以下三部分组成:16 £ t max , search for the number 11 book, start the overflow protection mechanism in the overflow protection mechanism, first use 16 to replace the integer spectrum t greater than 16 as the index to search when t max 3 16, and then follow the Huffman code word , sequentially add escape sequences for indexes greater than or equal to 16. An escape sequence consists of the following three parts:

[escape_prefix][escape_separator][escape_word][escape_prefix][escape_separator][escape_word]

其中[escape_prefix]是N个‘1’,[escape_separator]是一个‘0’,[escape_word]是一个N+4比特的无符号整型数,t满足t=2N+4+[escape_word],增加比特数为2int[log2(t+1)+1]-5。Where [escape_prefix] is N '1', [escape_separator] is a '0', [escape_word] is an unsigned integer of N+4 bits, t satisfies t=2 N+4 +[escape_word], increase The number of bits is 2int[log2(t+1)+1]-5.

通过检索码长得到第n子带整数量化谱使用m号码书的比特消耗参考值,并以码书号和整数量化谱的子带号为行列参数,将比特消耗参考值记录在参考比特消耗矩阵refBits(m,n)中。refBits作为确定每个子带最终使用的码书序号的依据。AAC的码流合成需要额外的比特存储每个子带使用的码书序号,从第一个子带开始,它用4个比特表示码书序号,用5个比特表示连续使用该序号码书的子带数,如果连续使用该序号码书的子带数达到或超过31,那么再增加5个比特用于表示连续子带数减去31的数值。这样,通常情况下,只增加9比特用于表示码书序号的开销。实际上,因为子带量化谱最大值不尽相同,且同子带使用不同码书,其量化谱熵编码消耗的比特数差别很大,子带使用同一个码书不能在码流合成时节约比特开销,确定每个子带的最优子带序号,对使用同一个码书的连续子带进行合并,是一个复杂的优化过程。传统的做法有,不考虑优化,为每个子带选择比特消耗最小的码书;固定长度码书合并,强制另相邻的三个或多个子带使用比特消耗最少的同一个码书等。这些方法消耗的比特数仍较多,影响了熵编码的效率。Obtain the bit consumption reference value of the nth subband integer quantization spectrum using the m number book by searching the code length, and record the bit consumption reference value in the reference bit consumption matrix refBits with the codebook number and the subband number of the integer quantization spectrum as the row and column parameters (m, n). refBits is used as the basis for determining the sequence number of the codebook finally used by each subband. The code stream synthesis of AAC requires additional bits to store the codebook number used by each subband. Starting from the first subband, it uses 4 bits to represent the codebook number, and 5 bits to represent the subbands that continuously use the codebook. Band number, if the number of subbands using the serial number book reaches or exceeds 31, then add 5 bits to represent the value of the number of continuous subbands minus 31. In this way, usually, only 9 bits are added to represent the overhead of the codebook serial number. In fact, because the maximum value of the sub-band quantization spectrum is not the same, and different codebooks are used for the same sub-band, the number of bits consumed by the quantization spectrum entropy coding is very different, and the use of the same codebook for the sub-bands cannot save energy when the code stream is synthesized. It is a complex optimization process to determine the optimal sub-band sequence number of each sub-band, and to combine consecutive sub-bands using the same codebook for bit overhead. Traditional methods include, regardless of optimization, selecting the codebook with the least bit consumption for each subband; merging fixed-length codebooks, forcing three or more adjacent subbands to use the same codebook with the least bit consumption, etc. These methods still consume a large number of bits, which affects the efficiency of entropy coding.

发明内容Contents of the invention

本发明所要解决的技术问题是提供一种基于先进音频编码器的码流合成方法,能够更好的优化码书合并过程,从而提高码流合成效果,进而提高整个音频编码器的性能。The technical problem to be solved by the present invention is to provide a code stream synthesis method based on an advanced audio encoder, which can better optimize the codebook merging process, thereby improving the code stream synthesis effect and further improving the performance of the entire audio encoder.

为了解决上述技术问题,本发明采用如下技术方案:In order to solve the above technical problems, the present invention adopts the following technical solutions:

一种基于先进音频编码器的码流合成方法,包含如下步骤:A code stream synthesis method based on an advanced audio encoder, comprising the steps of:

A、量化编码:对待编码的码流进行量化编码处理,得到多个编码子带;A. Quantization coding: perform quantization coding processing on the code stream to be coded to obtain multiple coding subbands;

B、码书合并:计算各编码子带使用不同码书时的参考比特消耗值,确定各编码子带使用的码书:按编码顺序,对于第一个编码子带,选择各码书中参考比特消耗值最小的码书作为使用码书;对于第一个编码子带之后的每一个编码子带,若当前编码子带的量化谱不全为0,选择各码书中使当前编码子带与上一编码子带的总参考比特消耗值最小的码书作为使用码书;B. Codebook merging: calculate the reference bit consumption value when each coding subband uses different codebooks, and determine the codebook used by each coding subband: according to the coding order, for the first coding subband, select the reference in each codebook The codebook with the smallest bit consumption value is used as the codebook; for each coded subband after the first coded subband, if the quantization spectrum of the current coded subband is not all 0, select each codebook so that the current coded subband and The codebook with the smallest total reference bit consumption value of the last coded subband is used as the codebook;

C、码流合成:对各编码子带,选择步骤B中确定的使用码书进行编码,完成码流合成处理。C. Code stream synthesis: for each coded sub-band, select the codebook determined in step B for encoding, and complete the code stream synthesis process.

所述步骤B中第一个编码子带之后的每一个编码子带选择码书是通过如下原则确定:Each coding subband selection codebook after the first coding subband in the step B is determined by the following principles:

获取当前编码子带使用各码书的参考比特消耗值,若参考比特消耗值最小的码书与上一编码子带使用的码书相同,当前编码子带使用该码书,否则,按以下三种方式分别计算当前编码子带与上一编码子带的总参考比特消耗值并按照使当前编码子带与上一编码子带的总参考比特消耗值最小的方式选择使用码书:Obtain the reference bit consumption value of each codebook used in the current coding subband. If the codebook with the smallest reference bit consumption value is the same as the codebook used in the previous coding subband, use this codebook for the current coding subband. Otherwise, proceed as follows: Calculate the total reference bit consumption value of the current coded subband and the previous coded subband in two ways, and choose to use the codebook in a way that minimizes the total reference bit consumption value of the current coded subband and the previous coded subband:

1)取上一编码子带已选码书作为当前编码子带的候选码书,总参考比特消耗值等于两个编码子带的参考比特消耗值之和;1) Take the selected codebook of the previous coding subband as the candidate codebook of the current coding subband, and the total reference bit consumption value is equal to the sum of the reference bit consumption values of the two coding subbands;

2)在除上一编码子带已选码书外的其他所有码书中,选择使得两个编码子带的参考比特消耗值之和最小的码书作为当前编码子带和上一编码子带的共同候选码书,总参考比特消耗值等于两个编码子带的参考比特消耗值之和,如果上一编码子带和上上一编码子带使用的是同一码书,总参考比特消耗值等于两个编码子带的参考比特消耗值之和加上码书切换开销。2) In all other codebooks except the selected codebook for the previous coding subband, select the codebook that minimizes the sum of the reference bit consumption values of the two coding subbands as the current coding subband and the previous coding subband The total reference bit consumption value is equal to the sum of the reference bit consumption values of the two coded sub-bands. If the previous coded sub-band and the previous coded sub-band use the same codebook, the total reference bit consumption value It is equal to the sum of the reference bit consumption values of the two coded subbands plus the codebook switching overhead.

3)选择当前编码子带参考比特消耗值最小的码书作为候选码书,总参考比特消耗值等于上一编码子带和当前编码子带的参考比特消耗值之和加上码书切换开销。3) Select the codebook with the smallest reference bit consumption value of the current coding subband as the candidate codebook, and the total reference bit consumption value is equal to the sum of the reference bit consumption values of the previous coding subband and the current coding subband plus the codebook switching overhead.

所述步骤B的码书合并过程中,若一个编码子带或多个连续编码子带的量化谱全为0,统计该编码子带或该多个连续编码子带采用前一个不全为0的编码子带使用的码书进行编码的参考比特消耗值或参考比特消耗值之和,若该参考比特消耗值或参考比特消耗值之和大于码书切换开销,所述编码子带或多个连续编码子带使用0号码书编码;否则,使用前一个不全为0的编码子带使用的码书编码。In the codebook merging process of the step B, if the quantized spectrum of one coded subband or multiple consecutive coded subbands is all 0, count the coded subband or the multiple consecutive coded subbands using the previous one that is not all 0 The reference bit consumption value or the sum of the reference bit consumption values encoded by the codebook used by the coding subband, if the reference bit consumption value or the sum of the reference bit consumption value is greater than the codebook switching overhead, the coding subband or multiple consecutive Coded sub-bands are coded using the 0 codebook; otherwise, codebook codes used by the previous coded sub-band that is not all 0s are used.

所述参考比特消耗值预存于二维数组refBits中,refBits(m,n)为数组refBits中第m行第n列的元素值,其表示第n子带的整数量化谱使用m号码书的参考比特消耗值,refBits(m,n)的初始值置为最大65535。The reference bit consumption value is pre-stored in the two-dimensional array refBits, and refBits(m, n) is the element value of the mth row and the nth column in the array refBits, which indicates that the integer quantization spectrum of the nth subband uses m number book reference Bit consumption value, the initial value of refBits(m, n) is set to a maximum of 65535.

若当前编码子带的整数量化谱全为0,该子带对应的码书参考比特消耗值为refBits(m,n)=bwsfb(n)*CW0(m),其中,bwsfb和CW0为一维数组,bwsfb(n)为数组bwsfb中第n个元素值,其表示编码子带n的带宽,CW0(m)为数组CW0中第m个元素值,其表示用码书m编码0值的整数量化谱所消耗的每谱线比特数。If the integer quantization spectrum of the current coded subband is all 0, the codebook reference bit consumption value corresponding to the subband is refBits(m, n)=bw sfb (n)*CW 0 (m), where bw sfb and CW 0 is a one-dimensional array, bw sfb (n) is the value of the nth element in the array bw sfb , which represents the bandwidth of the coding subband n, and CW 0 (m) is the value of the mth element in the array CW 0 , which is represented by The number of bits per spectral line consumed by codebook m to encode an integer quantized spectrum of 0 values.

还包括数组预处理,所述数组预处理利用如下公式进行:若refBits(m,n+1)=65535,则refBits(m,n)=refBits(m,n)+C,其中refBits(m,n)为当前编码子带的参考比特消耗值,refBits(m,n+1)为下一编码子带的参考比特消耗值,C为码书切换开销。Also includes array preprocessing, the array preprocessing is carried out using the following formula: if refBits (m, n+1) = 65535, then refBits (m, n) = refBits (m, n) + C, where refBits (m, n) is the reference bit consumption value of the current coding subband, refBits(m, n+1) is the reference bit consumption value of the next coding subband, and C is the codebook switching overhead.

所述一维数组CW0=[0.250.750.2510.520.52.50.532]。The one-dimensional array CW 0 =[0.250.750.2510.520.52.50.532].

所述码书为霍夫曼码书,包含11个序号的码书。The codebook is a Huffman codebook, which contains 11 serial numbers.

所述参考比特消耗值是通过以编码子带的整数量化谱为索引检索所述霍夫曼码书得到的。The reference bit consumption value is obtained by searching the Huffman codebook with the integer quantization spectrum of the coded subband as an index.

本发明通过保证编码时总参考比特消耗值最小的原则,对每一个编码子带,都选择其与前一编码子带的总参考比特消耗值最小时使用的码书确定各编码子带使用的码书,利用这种一阶回溯的方式优化了码流合成中的码书合并过程,从而减少了比特开销,提高了码流合成的效果,进而提高了先进音频编码器的编码效率。In the present invention, by ensuring the minimum total reference bit consumption value during encoding, for each coded subband, the codebook used when the total reference bit consumption value of the previous coded subband is the smallest is selected to determine the codebook used by each coded subband. Codebook, using this first-order backtracking method to optimize the codebook merging process in codestream synthesis, thereby reducing bit overhead, improving the effect of codestream synthesis, and thus improving the coding efficiency of advanced audio encoders.

进一步的,在编码子带的整数量化谱全为0时,比较编码子带采用前一编码子带使用的码书和采用0号码书两种情况下的不同总参考比特消耗值,并选择使总参考比特消耗值更小的码书作为整数量化谱全为0的编码子带编码时所采用的码书。Further, when the integer quantization spectrum of the coded subband is all 0, compare the different total reference bit consumption values in the two cases where the codebook used by the previous coded subband and the 0 codebook are used for the coded subband, and choose to use A codebook with a smaller total reference bit consumption value is used as a codebook for encoding subbands whose integer quantization spectrum is all 0.

更进一步的,对参考比特消耗值数组进行预处理,对后向孤立的数组单元(即后列为65535)加上码书切换开销,通过考虑了一阶后向的情况,提高了码书合并的优化效果。Furthermore, the reference bit consumption value array is preprocessed, and the codebook switching overhead is added to the backward isolated array unit (that is, the rear column is 65535). By considering the first-order backward situation, the codebook merging is improved. optimization effect.

附图说明Description of drawings

图1是本发明具体实施方式的处理流程图;Fig. 1 is the processing flowchart of the specific embodiment of the present invention;

图2是在100帧80kbps立体声编码下,现有技术中的各种码书合并方法与本发明具体实施方式采用的码书合并方法相对于最小值比特消耗的比特消耗比较效果;Fig. 2 is under 100 frames of 80kbps stereo encoding, various codebook merging methods in the prior art and the codebook merging method adopted in the specific embodiment of the present invention are compared to the bit consumption comparison effect of the minimum value bit consumption;

图3是在100帧128kbps立体声编码下,现有技术中的各种码书合并方法与本发明具体实施方式采用的码书合并方法相对于最小值比特消耗的比特消耗比较效果;Fig. 3 is under 100 frames of 128kbps stereo coding, various codebook merging methods in the prior art and the codebook merging method adopted in the specific embodiment of the present invention are compared with respect to the bit consumption effect of the minimum value bit consumption;

图4是在100帧192kbps立体声编码下,现有技术中的各种码书合并方法与本发明具体实施方式采用的码书合并方法相对于最小值比特消耗的比特消耗比较效果;Fig. 4 is under 100 frames of 192kbps stereo encoding, various codebook merging methods in the prior art and the codebook merging method adopted in the specific embodiment of the present invention are compared with respect to the bit consumption effect of the minimum bit consumption;

图5是在100帧256kbps立体声编码下,现有技术中的各种码书合并方法与本发明具体实施方式采用的码书合并方法相对于最小值比特消耗的比特消耗比较效果;Fig. 5 is under 100 frames of 256kbps stereo encoding, various codebook merging methods in the prior art and the codebook merging method adopted in the specific embodiment of the present invention are compared with respect to the bit consumption effect of the minimum value bit consumption;

图6是不同比特多种类型音频编码下,现有技术中的各种码书合并方法与本发明具体实施方式采用的码书合并方法相对于最小值比特消耗的比特消耗比较效果。Fig. 6 is a comparison effect of various codebook merging methods in the prior art and the codebook merging method adopted in the specific embodiment of the present invention with respect to the minimum bit consumption under different bit and multiple types of audio coding.

具体实施方式Detailed ways

下面对照附图结合具体实施方式对本发明作详细说明。The present invention will be described in detail below in conjunction with specific embodiments with reference to the accompanying drawings.

如图1,MPEG-4AAC的码流合成,需要对待编码的码流进行量化处理后形成的多个编码子带选择不同的码书进行编码,这称为码书合并过程。码书合并是否优化,直接影响到码流合成的效果,从而影响到整个编码器的编码效率。本方法的具体实施方式的处理过程包括:As shown in Figure 1, in the code stream synthesis of MPEG-4AAC, it is necessary to select different codebooks for encoding the multiple coding sub-bands formed after the code stream is quantized. This is called the codebook merging process. Whether codebook merging is optimized directly affects the effect of code stream synthesis, thereby affecting the coding efficiency of the entire encoder. The processing procedure of the specific embodiment of this method comprises:

一、量化编码:对待编码的码流进行量化编码处理,得到多个编码子带;1. Quantization coding: perform quantization coding processing on the code stream to be coded to obtain multiple coding subbands;

二、码书合并:2. Codebook merger:

1、预置二维数组refBits(m,n),n表示待编码的码流量化编码后得到的整数量化谱的第n个编码子带,m表示编码时各编码子带使用的码书序号;refBits(m,n)代表第n子带的整数量化谱使用m号码书的参考比特消耗值;数组中的各值的初始值置为最大值65535。本实施例中采用霍夫曼码书,包括11个序号的码书。1. Preset the two-dimensional array refBits(m, n), where n represents the nth coding subband of the integer quantization spectrum obtained after flow coding of the code to be coded, and m represents the serial number of the codebook used by each coding subband during coding ;refBits(m,n) represents the reference bit consumption value of the nth sub-band integer quantization spectrum using the m number book; the initial value of each value in the array is set to the maximum value of 65535. In this embodiment, a Huffman codebook is used, including a codebook with 11 serial numbers.

2、计算所有编码子带在各码书中的参考比特消耗值并将其存放于二维数组refBits(m,n)。2. Calculate the reference bit consumption values of all coded subbands in each codebook and store them in the two-dimensional array refBits(m, n).

3、当某子带不用编码时(即该子带的量化谱全为0),该子带对应的码书参考比特消耗值为refBits(m,n)=bwsfb(n)*CW0(m),其中,bwsfb(n)为当前编码子带n的带宽,CW0(m)为用码书m编码0值的整数量化谱所消耗的每谱线比特数,这称为零子带跳跃规避原则。3. When a subband does not need to be coded (that is, the quantized spectrum of the subband is all 0), the reference bit consumption value of the codebook corresponding to the subband is refBits(m, n)=bw sfb (n)*CW 0 ( m), where bw sfb (n) is the bandwidth of the currently coded subband n, and CW 0 (m) is the number of bits per spectral line consumed by encoding an integer quantized spectrum of 0 values with the codebook m, which is called the null subband With jump avoidance principle.

4、对数组进行预处理,考虑码书切换需要增加C比特的开销。预处理的方法是:若refBits(m,n+1)=65535,则refBits(m,n)=refBits(m,n)+C。即若后面的子带没有用到当前子带的码书,当前子带对应的码书的参考比特消耗值加C。码书切换开销C用4个比特表示码书序号,用5个比特表示连续使用该序号码书的子带数。4. Perform preprocessing on the array, considering that codebook switching needs to increase the overhead of C bits. The preprocessing method is: if refBits(m, n+1)=65535, then refBits(m, n)=refBits(m, n)+C. That is, if the following subband does not use the codebook of the current subband, the reference bit consumption value of the codebook corresponding to the current subband is added by C. The codebook switching overhead C uses 4 bits to represent the codebook sequence number, and 5 bits to represent the number of subbands that continuously use the sequence numberbook.

5、通过一阶回溯码书合并方法,选择比特开销最小的码书组合。5. Through the first-order backtracking codebook merging method, select the codebook combination with the smallest bit overhead.

5.1按编码顺序,对于第一个编码子带,在霍夫曼码书的11个序号的码书中选择参考比特消耗值最小的码书。5.1 According to the coding sequence, for the first coding subband, select the codebook with the smallest reference bit consumption value from the 11 codebooks in the Huffman codebook.

5.2对于第一个编码子带之后的每一个编码子带,分量化谱全为0与不全为0两种情况;5.2 For each coded subband after the first coded subband, the componentized spectrum is all 0 or not all 0;

5.3当前子带k的量化谱不全为0的情况:5.3 The case where the quantization spectrum of the current subband k is not all 0:

5.3.1若各序号码书中使得当前子带参考比特消耗值最小的码书与上一子带取的码书相同,则选择该序号码书作为当前子带使用的码书。5.3.1 If the codebook with the smallest reference bit consumption value of the current subband in each sequence number book is the same as the codebook selected for the previous subband, then select the sequence number book as the codebook used by the current subband.

5.3.2否则,计算以下三种候选方式的当前子带和上一子带的总参考比特消耗值,选择其中总参考比特消耗值最小的一种方式:5.3.2 Otherwise, calculate the total reference bit consumption value of the current subband and the previous subband in the following three candidate modes, and choose the mode with the smallest total reference bit consumption value:

5.3.2.1取上一个子带已经选择的码书作为当前子带的候选码书(两个子带用同一个码书),总参考比特消耗值等于两个子带的参考比特消耗值之和。5.3.2.1 Take the codebook that has been selected for the previous subband as the candidate codebook for the current subband (two subbands use the same codebook), and the total reference bit consumption value is equal to the sum of the reference bit consumption values of the two subbands.

5.3.2.2当前子带与上一个子带取同一个候选码书,遍历除了上一个子带已选的码书外的所有其他序号的码书,选择他们两个参考比特消耗值之和最小的码书作为两个子带的共同候选码书(两个子带用同一个码书)。此种情况下,上一子带使用的候选码书发生了改变,所以若上一个子带与上上一个子带用的是同一个码书,总参考比特消耗值还要加上码书切换的开销C。5.3.2.2 Take the same candidate codebook for the current subband and the previous subband, traverse all codebooks with serial numbers except the codebook selected for the previous subband, and select the one with the smallest sum of their two reference bit consumption values The codebook is used as a common candidate codebook for two subbands (two subbands use the same codebook). In this case, the candidate codebook used by the previous sub-band has changed, so if the previous sub-band and the previous sub-band use the same codebook, the total reference bit consumption value should be added to the codebook switch The cost of C.

5.3.2.3在各序号码书中选择使当前子带参考比特消耗值最小的码书作为候选码书(两个子带用不同码书),总参考比特消耗值等于上一子带的参考比特消耗值加上当前子带的最小参考比特消耗值,再加上码书切换开销C。5.3.2.3 Select the codebook that minimizes the reference bit consumption value of the current subband as the candidate codebook in each serial number book (two subbands use different codebooks), and the total reference bit consumption value is equal to the reference bit consumption value of the previous subband value plus the minimum reference bit consumption value of the current subband, plus the codebook switching overhead C.

5.4当前子带k的量化谱全为0的情况:5.4 The case where the quantized spectrum of the current subband k is all 0:

5.4.1对于此种情况,现有技术中一般直接采用0号码书,但这样的选择造成码书切换,从而增加了码书切换开销。而本实施例采用前一个子带(量化谱不全为0)的码书以避免码书切换。用前一个子带的码书量化0值的整数谱所消耗的比特数作为当前子带的参考比特消耗值,zeroBits=refBits[BookIndex(k-1),k],BookIndex(k-1)表示前一子带的码书。5.4.1 For such a situation, in the prior art, the number 0 book is generally used directly, but such selection causes codebook switching, thus increasing the codebook switching overhead. However, in this embodiment, the codebook of the previous subband (quantization spectrum is not all 0) is used to avoid codebook switching. Use the codebook of the previous subband to quantize the number of bits consumed by the 0-value integer spectrum as the reference bit consumption value of the current subband, zeroBits=refBits[BookIndex(k-1), k], BookIndex(k-1) means The codebook of the previous subband.

5.4.2若随后子带k+1的量化谱还是0,还是拿前一个量化谱不全为0的子带的码书来量化,用该码书量化0值的整数谱所消耗的比特数作为当前子带的参考比特消耗值。同时累加参考比特消耗值,即计算连续多个量化谱为0的编码子带的参考比特消耗值之和。zeroBits=zeroBits+refBits[BookIndex(k-1),k+1]。zeroBits是用k-1子带的码书来对随后连续的量化谱全为0的子带进行编码的总参考比特消耗值。5.4.2 If the quantized spectrum of the subsequent subband k+1 is still 0, the codebook of the previous subband whose quantized spectrum is not all 0 is still used for quantization, and the number of bits consumed by the codebook to quantize the integer spectrum with a value of 0 is used as The reference bit consumption value of the current subband. At the same time, the reference bit consumption value is accumulated, that is, the sum of the reference bit consumption values of multiple consecutive coded subbands whose quantization spectrum is 0 is calculated. zeroBits=zeroBits+refBits[BookIndex(k-1), k+1]. zeroBits is the total reference bit consumption value for encoding subsequent consecutive subbands whose quantization spectra are all 0 with the codebook of k-1 subbands.

5.4.3重复5.4.2步直到子带的量化谱不全为0。5.4.3 Repeat step 5.4.2 until the quantized spectrum of subbands is not all 0.

5.4.4若zeroBits>C,用0号码书对量化谱全为0的子带进行编码,C为码书切换的开销比特。5.4.4 If zeroBits>C, code the subband whose quantization spectrum is all 0 with the 0 number book, and C is the overhead bit for codebook switching.

5.4.5若zeroBits<=C,用k-1子带的码书来对随后连续的量化谱全为0的子带进行编码。5.4.5 If zeroBits<=C, use the codebook of k-1 subbands to encode the subsequent continuous subbands whose quantized spectra are all 0.

5.4.6若子带k+1的量化谱不全为0,即只是当前子带k一个编码子带的量化谱全为0,则若当前子带k的参考比特消耗值大于码书切换开销,当前子带k使用0号码书编码;否则,使用前一个不全为0的编码子带使用的码书编码。5.4.6 If the quantization spectrum of subband k+1 is not all 0, that is, only the quantization spectrum of one coded subband of the current subband k is all 0, then if the reference bit consumption value of the current subband k is greater than the codebook switching overhead, the current Subband k is encoded with a codebook of 0; otherwise, it is encoded with the codebook used by the previous encoded subband that is not all 0.

5.5重复5.3步,直到所有子带完成熵编码。5.5 Repeat step 5.3 until all subbands complete entropy coding.

三、码流合成:对各编码子带,选择步骤B中确定的使用码书进行编码,完成码流合成处理。3. Code stream synthesis: for each coded sub-band, select the codebook determined in step B for encoding, and complete the code stream synthesis process.

下面对上述步骤中的几个处理步骤作进一步说明。Several processing steps in the above steps will be further described below.

a、计算参考比特消耗值a. Calculate the reference bit consumption value

本发明实施例中,使用霍夫曼码书进行各编码子带的参考比特消耗值的计算。AAC中的霍夫曼码书一共有11个,其规格如表1,另外有0号码书用来表示量化谱全为0时使用的码书,所谓0号码书,实质上是一虚拟码书,用来指代该子带不进行编码。计算量化谱的比特消耗,计算过程为:首先求得子带中整数量化谱的最大绝对值tmax,依次将子带中相邻的四个整数量化谱组成四维矢量[t1 t2 t3 t4]作为索引去查找,累加求得不同码书熵编码所需码长的总数,其中,有符号码书的索引要加上最大绝对值作为偏移,而无符号码书的索引则加上1。检索方法为:In the embodiment of the present invention, a Huffman codebook is used to calculate the reference bit consumption value of each coding subband. There are 11 Huffman codebooks in AAC, and their specifications are shown in Table 1. In addition, there is a 0-numbered book used to indicate the codebook used when the quantized spectrum is all 0. The so-called 0-numbered book is actually a virtual codebook , which is used to indicate that the subband is not encoded. Calculate the bit consumption of the quantized spectrum, the calculation process is: first obtain the maximum absolute value t max of the integer quantized spectrum in the sub-band, and sequentially form the four-dimensional vector [t 1 t 2 t 3 t 4 ] as an index to search, and accumulate to obtain the total number of code lengths required for entropy encoding of different codebooks. Among them, the index of the signed codebook should be added with the maximum absolute value as the offset, while the index of the unsigned codebook should be added on 1. The search method is:

codeLen1=Huf_Len1[t1+1][t2+1][t3+1][t4+1]codeLen1=Huf_Len1[t1+1][t2+1][t3+1][t4+1]

codeLen2=Huf_Len2[t1+1][t2+1][t3+1][t4+1]codeLen2=Huf_Len2[t1+1][t2+1][t3+1][t4+1]

codeLen5=Huf_Len5[t1+4][t2+4]+Huf_Len5[t3+4][t4+4]codeLen5=Huf_Len5[t1+4][t2+4]+Huf_Len5[t3+4][t4+4]

codeLen6=Huf_Len6[t1+4][t2+4]+Huf_Len6[t3+4][t4+4]codeLen6=Huf_Len6[t1+4][t2+4]+Huf_Len6[t3+4][t4+4]

t1=|t1|,t2=|t2|,t3=|t3|,t4=|t4|t1=|t1|, t2=|t2|, t3=|t3|, t4=|t4|

signLen=!!t1+!!t2+!!t3+!!t4signLen=! ! t1+! ! t2+! ! t3+! ! t4

codeLen3=Huf_Len3[t1][t2][t3][t4]+signLen    (1)codeLen3=Huf_Len3[t1][t2][t3][t4]+signLen (1)

codeLen4=Huf_Len4[t1][t2][t3][t4]+signLencodeLen4=Huf_Len4[t1][t2][t3][t4]+signLen

codeLen7=Huf_Len7[t1][t2]+Huf_Len7[t3][t4]+signLencodeLen7=Huf_Len7[t1][t2]+Huf_Len7[t3][t4]+signLen

codeLen8=Huf_Len8[t1][t2]+Huf_Len8[t3][t4]+signLencodeLen8=Huf_Len8[t1][t2]+Huf_Len8[t3][t4]+signLen

codeLen9=Huf_Len9[t1][t2]+Huf_Len9[t3][t4]+signLencodeLen9=Huf_Len9[t1][t2]+Huf_Len9[t3][t4]+signLen

codeLen10=Huf_Len10[t1][t2]+Huf_Len10[t3][t4]+signLencodeLen10=Huf_Len10[t1][t2]+Huf_Len10[t3][t4]+signLen

codeLen11=Huf_Len11[t1][t2]+Huf_Len11[t3][t4]+signLencodeLen11=Huf_Len11[t1][t2]+Huf_Len11[t3][t4]+signLen

!!运算符的运算原则是若t10,!!t=1,若t=0,!!t=0;! ! The operation principle of the operator is if t 1 0, ! ! t=1, if t=0, ! ! t=0;

检索码书的流程根据tmax判断如下:The process of retrieving the codebook is judged according to t max as follows:

Figure GSB00000529560700081
Figure GSB00000529560700081

溢出保护机制,tmax 316时先以16替代大于16的整数谱t作为索引进行检索,然后在这个霍夫曼码字后面,为大于等于16的索引依次添加逃避序列。逃避序列(escape sequence)由以下三部分组成:Overflow protection mechanism, when t max 3 16, first replace the integer spectrum t greater than 16 with 16 as the index for retrieval, and then add escape sequences for the index greater than or equal to 16 after the Huffman codeword. An escape sequence consists of the following three parts:

[escape_prefix][escape_separator][escape_word][escape_prefix][escape_separator][escape_word]

其中[escape_prefix]是N个‘1’,[escape_separator]是一个‘0’,[escape_word]是一个N+4比特的无符号整型数,t满足t=2N+4+[escape_word],增加比特数为2int[log2(t+1)+1]-5。Where [escape_prefix] is N '1', [escape_separator] is a '0', [escape_word] is an unsigned integer of N+4 bits, t satisfies t=2 N+4 +[escape_word], increase The number of bits is 2int[log2(t+1)+1]-5.

检索码长得到的第n子带整数量化谱使用m号码书的比特消耗参考值,记录在参考比特消耗矩阵refBits(m,n)中,没有计算到的记为65535。当前子带的参考比特消耗值为The nth sub-band integer quantization spectrum obtained by searching the code length uses the bit consumption reference value of the m number book, and records it in the reference bit consumption matrix refBits(m, n), and records the uncalculated one as 65535. The reference bit consumption value of the current subband is

sfbbit(n)=sfLen(n)+min(refBits(m,n)),m=1,2L,11(2)sfbbit(n)=sfLen(n)+min(refBits(m,n)), m=1, 2L, 11(2)

b、零子带跳跃规避b. Zero subband jump avoidance

为避免在不进行编码的子带发生多次码书序号切换,增加额外开销,在不需要对当前子带量化谱编码时,refBits相应的那一列的11个码书的参考比特消耗值为bwsfb(k)×[0.250.750.2510.520.52.50.532],上述值为查找码表所得,并在参考码书索引bookIndex中记录bookIndex(k)=0,其余子带的参考码书索引均为12。如表2中,其中第12、13子带的对应例为8×[0.250.750.2510.520.52.50.532],其中,8为第12、13子带的带宽值。In order to avoid multiple codebook serial number switching in subbands that are not encoded and increase additional overhead, when the quantization spectrum encoding of the current subband is not required, the reference bit consumption value of the 11 codebooks in the column corresponding to refBits is bw sfb (k)×[0.250.750.2510.520.52.50.532], the above values are obtained by looking up the code table, and record bookIndex(k)=0 in the reference codebook index bookIndex, and the reference codebook indexes of the other subbands are all 12 . As shown in Table 2, the corresponding example of the 12th and 13th subbands is 8×[0.250.750.2510.520.52.50.532], where 8 is the bandwidth value of the 12th and 13th subbands.

c.参考比特消耗值的预处理c. Preprocessing of reference bit consumption value

对refBits做预处理,如果refBits单元后向孤立(后列是65535),那该单元加上9(短块编码为7,长短块指AAC处理加窗的长短)。以表2为例,第2列的1、2、3、4行,第10列3、4行,第3列5、6、7、8行和第8列5、6、7、8行属于后向孤立单元。处理后的refBits见表3,表中经过加黑处理的数值对应的行号为各子带使用不同序号的码书进行编码时参考比特消耗值最少的码书的对应序号。Do preprocessing on refBits, if the refBits unit is isolated backwards (65535 in the back column), add 9 to the unit (the short block code is 7, and the long and short blocks refer to the length of the AAC processing window). Take Table 2 as an example, rows 1, 2, 3, and 4 in column 2, rows 3 and 4 in column 10, rows 5, 6, 7, and 8 in column 3, and rows 5, 6, 7, and 8 in column 8 Belongs to the backward isolated unit. The processed refBits are shown in Table 3. The row numbers corresponding to the blackened values in the table are the corresponding serial numbers of the codebook with the least reference bit consumption value when each sub-band is coded using codebooks with different serial numbers.

表2码书的比特开销数Table 2 Bit overhead number of codebook

Figure GSB00000529560700091
Figure GSB00000529560700091

表3码书的比特开销数Table 3 Bit overhead number of codebook

Figure GSB00000529560700092
Figure GSB00000529560700092

Figure GSB00000529560700101
Figure GSB00000529560700101

d.一阶回溯码书合并d. Merge of first-order backtracking codebooks

预处理后,从第一个子带开始,码书索引为最小值的行号(若有相同,取行号大者),即BookIndex(1)=m,refBits[m,1]=min(refBits[11 to1,1]),如表3,BookIndex(1)=6。After preprocessing, starting from the first sub-band, the codebook index is the row number of the minimum value (if there are the same, get the larger row number), i.e. BookIndex(1)=m, refBits[m, 1]=min( refBits[11 to1, 1]), as shown in Table 3, BookIndex(1)=6.

如前述原则,子带C2应用规则5.3.1,取BookIndex(2)=6,子带C3应用规则5.3.2.2,取BookIndex(3)=6,子带C4应用规则5.3.2.2,取BookIndex(4)=10,并把BookIndex(3)修改成10、C5应用规则5.3.1,,BookIndex(5)=10,对于子带12、13,根据步骤5.4,用0号码书进行编码BookIndex(12)=0,BookIndex(13)=0。As mentioned above, rule 5.3.1 is applied to sub-band C2, BookIndex(2)=6, rule 5.3.2.2 is applied to sub-band C3, BookIndex(3)=6, rule 5.3.2.2 is applied to sub-band C4, BookIndex( 4)=10, and BookIndex(3) is revised into 10, C5 application rule 5.3.1,, BookIndex(5)=10, for subband 12,13, according to step 5.4, encode BookIndex(12 with 0 number book )=0, BookIndex(13)=0.

按照以上步骤确定了各编码子带使用的码书后,对各编码子带进行熵编码,完成码流合成。After the codebook used by each coded subband is determined according to the above steps, entropy coding is performed on each coded subband to complete code stream synthesis.

本发明基于一阶回溯技术,以简单高效的码书合并方法求得优化的子带的码书序号,从而可以减少熵编码时的比特开销,提高了码流合成的效果,进而提高了整个音频编码器的编码效率。Based on the first-order backtracking technology, the present invention uses a simple and efficient codebook merging method to obtain the codebook serial number of the optimized subband, thereby reducing the bit overhead during entropy coding, improving the effect of codestream synthesis, and further improving the overall audio quality. The encoding efficiency of the encoder.

以Megal AAC编码器作为测试平台来验证本发明的有效性,Megal AAC编码器为应用本发明的码流合成方法实现的MPEG-4AAC编码器。测试对8段44100Hz采样,16比特量化的立体声剪辑进行,每段剪辑持续11.63秒,剪辑曲目见表3,每次测试结果取8段剪辑的平均值。测试在载有一颗主频为1.86GHz的Intel E6300处理器的工作站上进行。编码测试的平均码率设定为80kbps,128kbps,192kbps,256kbps共4组。分别采用全部选取最小值合并,强制3子带合并,强制6子带合并,强制9子带合并和本实施例的码书合并分别计算每一帧的熵编码消耗值,其中提供给码书合并算法的参考比特消耗值是相同的。The effectiveness of the present invention is verified with a Megal AAC encoder as a test platform, and the Megal AAC encoder is an MPEG-4AAC encoder implemented by applying the code stream synthesis method of the present invention. The test is performed on 8 stereo clips sampled at 44100Hz and quantized by 16 bits. Each clip lasts for 11.63 seconds. The clips are shown in Table 3. The average value of the 8 clips is taken for each test result. Tests were performed on a workstation with an Intel E6300 processor clocked at 1.86GHz. The average bit rate of the encoding test is set to 80kbps, 128kbps, 192kbps, 256kbps, a total of 4 groups. Respectively adopt all selected minimum values to merge, force 3 sub-bands to merge, force 6 sub-bands to merge, force 9 sub-bands to merge and the codebook merge of this embodiment to calculate the entropy coding consumption value of each frame respectively, wherein provide to the codebook merge The reference bit consumption values of the algorithms are the same.

表4测试剪辑Table 4 Test Clips

Figure GSB00000529560700111
Figure GSB00000529560700111

图2,3,4,5分别为剪辑1的前100帧分别在80kbps,128kbps,192kbps,256kbps码率编码时,强制3子带合并,强制6子带合并,强制9子带合并和本方法分这四种码书合并算法相对于最小值合并比特消耗的每一帧之比。图6是这8个剪辑分别在80kbps,128kbps,192kbps,256kbps码率编码时,强制3子带合并,强制6子带合并,强制9子带合并和本实施例这四种码书合并算法相对于最小值比特消耗之比的平均值。从实验数据可以得到本实施例相对于各种码书合并算法提高编码器的效率达10%到15%,这在中低码率尤为明显。Figures 2, 3, 4, and 5 are the first 100 frames of clip 1 respectively encoded at 80kbps, 128kbps, 192kbps, and 256kbps bit rates, 3 subbands are forced to merge, 6 subbands are forced to merge, 9 subbands are forced to merge and this method Divide the ratio of each frame consumed by these four codebook merging algorithms relative to the minimum value merging bits. Fig. 6 shows that when these 8 clips are encoded at 80kbps, 128kbps, 192kbps, and 256kbps code rates, 3 sub-bands are forced to merge, 6 sub-bands are forced to merge, 9 sub-bands are forced to merge and these four codebook merger algorithms in this embodiment are compared. The average value of the ratio of the bit consumption to the minimum value. From the experimental data, it can be obtained that this embodiment improves the efficiency of the encoder by 10% to 15% compared with various codebook merging algorithms, which is especially obvious at low and medium code rates.

Claims (7)

1. the code stream synthesizing method based on advanced audio coder is characterized in that, comprises following steps:
A, quantization encoding: code stream to be encoded is carried out quantization encoding handle, obtain a plurality of coding subbands;
B, code book merge: the reference bits consumption figures when calculating the subband of respectively encoding and using different code book, the code book that definite subband of respectively encoding uses: press coded sequence, for first coding subband, the code book of selecting reference bits consumption figures minimum in each code book is as using code book; For each the coding subband after first coding subband, if the quantized spectrum of present encoding subband is not 0 entirely, select to make in each code book a present encoding subband and a last coding subband always with reference to the code book of bit consumption value minimum as using code book, specifically comprise: obtain the reference bits consumption figures that the present encoding subband uses each code book, if the code book of reference bits consumption figures minimum is identical with the code book that a last coding subband uses, the present encoding subband uses this code book, otherwise, always always select to use code book by what following three kinds of modes were calculated a present encoding subband and a last coding subband respectively with reference to the mode of bit consumption value minimum with reference to the bit consumption value and according to what make that present encoding subband and last encodes subband:
1) get a coding subband the code selection book always equal the reference bits consumption figures sum of two subbands of encoding as candidate's code book of present encoding subband with reference to the bit consumption value;
2) except that on a coding subband in other all code books the code selection book, selection make two the coding subbands reference bits consumption figures sum minimum code book as the present encoding subband and last one the coding subband common candidate's code book, always equal the reference bits consumption figures sum of two coding subbands with reference to the bit consumption value, if what a last coding subband and a last coding subband used is same code book, always the reference bits consumption figures sum that equals two subbands of encoding with reference to the bit consumption value adds the code book handover overhead.
3) code book of selecting present encoding subband reference bits consumption figures minimum always equals the last one reference bits consumption figures sum of encoding subband and present encoding subband with reference to the bit consumption value and adds the code book handover overhead as candidate's code book;
If the quantized spectrum of a coding subband or a plurality of continuous programming code subbands is 0 entirely, add up reference bits consumption figures or reference bits consumption figures sum that a plurality of continuous programming code subbands of this coding subband or this adopt the previous code book that is not 0 coding subband uses entirely to encode, if this reference bits consumption figures or reference bits consumption figures sum are greater than the code book handover overhead, described coding subband or a plurality of continuous programming code subband use 0 number book coding; Otherwise using previous is not the code book coding that 0 coding subband uses entirely.
C, code stream synthesize: to each coding subband, the use code book of selecting to determine among the step B is encoded, and finishes the synthetic processing of code stream.
2. code stream synthesizing method as claimed in claim 1, it is characterized in that, described reference bits consumption figures is pre-stored among the two-dimensional array refBits, refBits (m, n) be the element value of the capable n row of m among the array refBits, it represents the reference bits consumption figures of the integer quantisation spectrum use m number book of n subband, and (m, initial value n) are changed to maximum 65535 to refBits.
3. code stream synthesizing method as claimed in claim 2 is characterized in that, if the integer quantisation of present encoding subband spectrum is 0 entirely, the code book reference bits consumption figures of this subband correspondence be refBits (m, n)=bw Sfb(n) * CW 0(m), wherein, bw SfbAnd CW 0Be one-dimension array, bw Sfb(n) be array bw SfbIn n element value, the bandwidth of its presentation code subband n, CW 0(m) be array CW 0In m element value, its expression is composed the every spectral line bit number that is consumed with the integer quantisation of code book m coding 0 value.
4. code stream synthesizing method as claimed in claim 3 is characterized in that, also comprises the array pre-service, described array pre-service utilizes following formula to carry out: if refBits (m, n+1)=65535, then refBits (m, n)=refBits (m, n)+C, wherein (m n) is the reference bits consumption figures of present encoding subband, refBits (m to refBits, n+1) be the reference bits consumption figures of next coding subband, C is the code book handover overhead.
5. code stream synthesizing method as claimed in claim 4 is characterized in that, described one-dimension array CW 0=[0.25 0.75 0.251 0.5 2 0.5 2.5 0.5 3 2].
6. code stream synthesizing method as claimed in claim 1 is characterized in that described code book is the Huffman code book, comprises the code book of 11 sequence numbers.
7. code stream synthesizing method as claimed in claim 6 is characterized in that, described reference bits consumption figures is to be that the described Huffman code book of indexed search obtains by the integer quantisation spectrum with the coding subband.
CN2007101484562A 2007-05-16 2007-08-21 Code stream synthesizing method based on advanced audio coder Active CN101308657B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101484562A CN101308657B (en) 2007-05-16 2007-08-21 Code stream synthesizing method based on advanced audio coder

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN200710074479 2007-05-16
CN200710074479.3 2007-05-16
CN2007101484562A CN101308657B (en) 2007-05-16 2007-08-21 Code stream synthesizing method based on advanced audio coder

Publications (2)

Publication Number Publication Date
CN101308657A CN101308657A (en) 2008-11-19
CN101308657B true CN101308657B (en) 2011-10-26

Family

ID=40125070

Family Applications (2)

Application Number Title Priority Date Filing Date
CN2007101484562A Active CN101308657B (en) 2007-05-16 2007-08-21 Code stream synthesizing method based on advanced audio coder
CN2007101484543A Expired - Fee Related CN101308661B (en) 2007-05-16 2007-08-21 Quantizer code rate distortion controlling means based on advanced audio coder

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN2007101484543A Expired - Fee Related CN101308661B (en) 2007-05-16 2007-08-21 Quantizer code rate distortion controlling means based on advanced audio coder

Country Status (1)

Country Link
CN (2) CN101308657B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8781822B2 (en) 2009-12-22 2014-07-15 Qualcomm Incorporated Audio and speech processing with optimal bit-allocation for constant bit rate applications
TR201900411T4 (en) * 2011-04-05 2019-02-21 Nippon Telegraph & Telephone Acoustic signal decoding.
CN107480572B (en) * 2017-08-15 2020-06-23 北京安云世纪科技有限公司 Method and system for identifying coded data by using general service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5420639A (en) * 1993-04-01 1995-05-30 Scientific-Atlanta, Inc. Rate adaptive huffman coding
CN1284791A (en) * 1999-04-20 2001-02-21 松下电器产业株式会社 Encoder
US6198412B1 (en) * 1999-01-20 2001-03-06 Lucent Technologies Inc. Method and apparatus for reduced complexity entropy coding
US6542863B1 (en) * 2000-06-14 2003-04-01 Intervideo, Inc. Fast codebook search method for MPEG audio encoding

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003066998A (en) * 2001-08-28 2003-03-05 Mitsubishi Electric Corp Acoustic signal encoding device
CN100370836C (en) * 2004-08-02 2008-02-20 华为技术有限公司 Motion Prediction Method Based on Rate-Distortion Optimization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5420639A (en) * 1993-04-01 1995-05-30 Scientific-Atlanta, Inc. Rate adaptive huffman coding
US6198412B1 (en) * 1999-01-20 2001-03-06 Lucent Technologies Inc. Method and apparatus for reduced complexity entropy coding
CN1284791A (en) * 1999-04-20 2001-02-21 松下电器产业株式会社 Encoder
US6542863B1 (en) * 2000-06-14 2003-04-01 Intervideo, Inc. Fast codebook search method for MPEG audio encoding

Also Published As

Publication number Publication date
CN101308661A (en) 2008-11-19
CN101308661B (en) 2011-07-13
CN101308657A (en) 2008-11-19

Similar Documents

Publication Publication Date Title
EP2267698B1 (en) Entropy coding by adapting coding between level and run-length/level modes.
CN101223573B (en) Selectively using multiple entropy models in adaptive coding and decoding
RU2522020C1 (en) Hierarchical audio frequency encoding and decoding method and system, hierarchical frequency encoding and decoding method for transient signal
US20020049586A1 (en) Audio encoder, audio decoder, and broadcasting system
US7680670B2 (en) Dimensional vector and variable resolution quantization
CN101160726B (en) Parameter compression unit and decoder and corresponding method
US7689427B2 (en) Methods and apparatus for implementing embedded scalable encoding and decoding of companded and vector quantized audio data
CA2601821A1 (en) Planar multiband antenna
WO2007083264A1 (en) Audio coding
WO2003096326A9 (en) Audio compression
JP2010501089A (en) Speech coding system
JP2004206129A (en) Method and apparatus for improved audio encoding and / or decoding using time-frequency correlation
Drweesh et al. Audio compression based on discrete cosine transform, run length and high order shift encoding
CN101308657B (en) Code stream synthesizing method based on advanced audio coder
JP4800379B2 (en) Lossless coding of information to guarantee maximum bit rate
JP3557164B2 (en) Audio signal encoding method and program storage medium for executing the method
CN1527282A (en) Method and device for scalable encoding and decoding of audio data
CN101771416B (en) Bit-plane coding and decoding method, communication system and related equipment
CN101160725A (en) Lossless information coding ensuring maximum bit rate
CN101290771B (en) Bit consumption controlling method based on advanced audio decoder
KR101644883B1 (en) A method and an apparatus for processing an audio signal
Singh et al. An Enhanced Low Bit Rate Audio Codec Using Discrete Wavelet Transform
CN118197348A (en) Audio perception hash retrieval method and device based on nonnegative matrix factorization, and medium equipment
Shoham Variable-size vector entropy coding of speech and audio
HK1110708B (en) Lossless encoding of information with guaranteed maximum bitrate

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