TW200843364A - An audio decoder and method thereof - Google Patents

An audio decoder and method thereof Download PDF

Info

Publication number
TW200843364A
TW200843364A TW96115163A TW96115163A TW200843364A TW 200843364 A TW200843364 A TW 200843364A TW 96115163 A TW96115163 A TW 96115163A TW 96115163 A TW96115163 A TW 96115163A TW 200843364 A TW200843364 A TW 200843364A
Authority
TW
Taiwan
Prior art keywords
audio
sampling frequency
frequency
ratio
decoding method
Prior art date
Application number
TW96115163A
Other languages
Chinese (zh)
Other versions
TWI337812B (en
Inventor
Jen-Ya Chou
Ryan Liu
Original Assignee
Magima Digital Information Co Ltd
Magima Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Magima Digital Information Co Ltd, Magima Technology Co Ltd filed Critical Magima Digital Information Co Ltd
Priority to TW96115163A priority Critical patent/TWI337812B/en
Publication of TW200843364A publication Critical patent/TW200843364A/en
Application granted granted Critical
Publication of TWI337812B publication Critical patent/TWI337812B/en

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

An audio decoder and a method thereof include a parsing unit for receiving and parsing audio data streams; a decoding unit for decoding the audio data streams and transforming the data streams, by IDCT and windowing, to achieve PCM samples; a resample unit for re-sampling the PCM samples according to predetermined sampling frequencies and then outputting the samples; and a controller for controlling the audio decoder. There sample unit alters the sampling frequencies to fine-adjust output rate of the audio samples.

Description

200843364 九、發明說明: 【發明所屬之技術領域】 本發明是有關於一種音頻解碼器及其方法。 ' 【先前技術】 , 音視頻傳輸技術廣泛應用於視頻會議、數位電視、網 路電話等各類資訊技術領域。由於音視頻資料具有数據量 大的特性,業界普遍採用編解碼技術來實現音視頻資料= • 傳輸。例如,按照一定的編碼規則在發送端編碼,並在接 收端按與發送端相對應的解碼規則來解碼。通常發送端在 編碼時會採用一定的編碼時脈,接收端在恢復音視頻資料 ¥,還需要設置與編碼時脈保持一致的解碼時脈,從而保 • 證音視頻資料的連續有序的播放。例如目前廣泛採用的音 : 視頻編碼標準,即移動圖像專家組(MPEG)系列標準,它 在視頻壓縮方面充分利用空間和時間上的冗餘而達到有效 的壓縮’而在音頻壓縮方面則主要利用人耳的主觀雜訊感 φ 知特性來達到壓縮的目的。例如,人耳的有效識別頻率範 圍在20〜20KHz,在進行音頻資料壓縮時可以相應地重點突 出該範圍以内的信號而忽略該範圍以外的信號,同時還可 以利用聲音頻譜的非平坦性從一個方面達到壓縮的目的。 W 但音頻解碼設備的發送端與接收端的採樣頻率碼制可 N 能有所不同,例如發送端編碼的採樣頻率與接收端的採樣 點輸出速率不一致,可能需要進行採樣頻率的轉換。另一 方面,由於通道的堵塞等原因,可能造成接收端本地時脈 與發送端編碼時脈的不匹配。例如,MPEG2中以節目流 5 200843364 (Program stream)或傳輪流(Transp〇nStream)的形式藉 由各種通道進行資料傳輸,例如,衛星傳輪、有線傳輸或 地面傳輸。通常由於通道的阻塞導致傳輸的漲落,可能引 起接收端本地時脈與發送端編碼時脈的不匹配。同時發送 端的編碼器的延遲等也可能導致接收端本地時脈與發送端 . 、編碼時脈的不匹配。時脈不匹産生的誤差f常會使播放 不連續。因而,人們採用了各種方法來消除這種誤差,例 如壓控晶振(VCO)、鎖相!裒(PLL)等。在一般的音頻解 Φ 碼器中,爲了實現音視頻的同步,常常等到誤差累積到一 定量時,例如偏差超過一幀,才進行調整或等待處理。這 時,常常需要做出跳幘等可能較大程度影響系統性能的措 施,這樣比較影響輸出效果,而且可能導致後果报嚴重的 顛簸現象。如果在鎖相環中採用能夠進行小數分頻的分頻 器,可以在一定程度上進行小步距的頻率調整。採用小數 分頻也有一定限制,例如在實現高精確度要求的頻率微調 時爲保持鎖相環的穩定需要使用大量的環濾波電容,因而 _ 不利於晶片的集成。並且,在輸出頻率與相位檢測器頻率 的比值較大時,會産生較大的雜訊,由此而帶來的相位的 抖動難以避免。此外,壓控晶振的成本比較高,不利於對 音頻解碼器晶片整體成本的控制。 . 【發明内容】 因此本發明之一方面提供一種音頻解碼器,使輪出之 音頻信號具有較高的頻率控制精確度,並且降低音頻解I 器之成本。 ' 6 200843364 依照本發明之一實施例,音頻解碼器係解碼一音頻編 碼器所輸出之至少一音頻碼流(audio data stream),此音頻 解碼器包含一解析單元、一解碼單元、一重採樣單元以及 一控制單元。解析單元接收外部之音頻碼流並進行解封 包,以獲得一音頻資料。解碼單元解碼音頻資料,並對解 碼後之音頻資料進行反離散餘弦轉換(IDCT)以及加窗處理 (Windowing),藉以獲得複數個脈波編碼調變採樣值(PCM sample)。重採樣單元按照一採樣頻率比值,對脈波編碼調 變採樣值進行重採樣(re-sampling)。控制單元控制音頻解碼 器之工作。 因此本發明之另一方面提供一種音頻解碼方法,使輸 出之音頻信號具有較高的頻率控制精確度,並且降低音頻 解碼器之成本。 依照本發明之另一實施例,音頻解碼方法包括:接收 外部之音頻碼流並進行解封包;對解封·包後之音頻碼流進 行解碼,並進行反離散餘弦轉換(IDCT)和加窗處理 (Windowing),以獲得複數個脈波編碼調變採樣值(PCM sample);以及按一預定採樣頻率比值,對脈波編碼調變採 樣值進行重採樣(Resample)後予以輸出。 依照本發明之又一實施例,音頻解碼方法包括:解析 音頻封包,以得到一音頻資料;對音頻資料進行一解碼程 序,以獲得至少一脈波編碼調變採樣值(at least one PCM sample);對該脈波編碼調變採樣值進行重採樣 (re-sampling);以及濾波(filtering)調整後之脈波編碼調變採 樣值。 7 200843364 根據上述實施例,重採樣單元藉由轉換音頻樣點採樣 頻率,對音頻輸出速率進行微調,同時可以藉由重採樣而 重構波形以適應不同碼制的音頻播放設備,而不會引起相 位抖動。上述實施例之音頻解碼器不需要使用VCO,大幅 降低了實現成本。同時可以重複使用音頻解碼器中的其他 元件來實現音頻解碼功能,因而也減少了晶片面積,降低 了實現成本。 【實施方式】 本發明揭示的一種音頻解碼器可以以系統單晶片的方 式集成在音視頻解碼晶片上,用於需要實現音視頻解碼的 電子産品中,如數位電視,機頂盒,DVD ;也可以單獨以 音頻解碼器電路形式製成。 請參閱第1圖,其係繪示本發明一實施例之音頻解碼 器的結構示意圖。音頻解碼器包括解析單元101、解碼單元 103、重採樣單元105和控制單元107。在本發明的一個實 施例中,控制單元107爲控制寄存器,外部處理器109藉 由控制寄存器控制音頻解碼器的工作。在本發明的其他實 施例中,也可以直接以處理器作爲控制單元107,而不用外 部處理器。解析單元101接收外部的音頻資料串流,解包 後送入解碼單元103;解碼單元103對音頻資料串流進行解 碼,以及IDCT變換和加窗(Window)處理,得到PCM採 樣值;重採樣單元105對PCM採樣值進行重採樣後輸出。 請參閱第2圖,其係繪示本發明一實施例之重採樣單 元的工作原理波形示意圖。重採樣單元105按照一定的重 8 200843364 而==對知樣值進行滤波,以重構採樣點輪出波形, - 祕點輪出速率。在此第2®巾,箭财序排列 ^的二間點,爲便於清楚顯示,圖中僅以較少的採樣 點作爲叫。在料雜鮮下核形A,#實際 樣點輸出速率大於音頻解碼器的播放速率来 洛,Γί 同的波形Β’但波形Β的採樣頻率提高; ^際(_樣_出速率小於音頻解碼200843364 IX. Description of the Invention: [Technical Field] The present invention relates to an audio decoder and a method thereof. [Prior Art] Audio and video transmission technology is widely used in various information technology fields such as video conferencing, digital TV, and network telephony. Due to the large amount of data in audio and video data, codec technology is commonly used in the industry to implement audio and video data = • transmission. For example, it is encoded at the transmitting end according to a certain encoding rule, and decoded at the receiving end according to a decoding rule corresponding to the transmitting end. Usually, the transmitting end uses a certain encoding clock when encoding, and the receiving end recovers the audio and video data ¥, and also needs to set the decoding clock that is consistent with the encoding clock, thereby ensuring the continuous and orderly playback of the audio and video data. . For example, the currently widely used audio: video coding standard, the Moving Picture Experts Group (MPEG) series of standards, which makes full use of space and time redundancy in video compression to achieve effective compression' while in audio compression The subjective sense of noise of the human ear is used to achieve the purpose of compression. For example, the effective recognition frequency of the human ear ranges from 20 to 20 kHz. When the audio data is compressed, the signal within the range can be highlighted accordingly, and the signals outside the range can be ignored, and the non-flatness of the sound spectrum can also be utilized from one. Aspects achieve the purpose of compression. W However, the sampling frequency of the audio decoding device can be different from the sampling frequency of the receiving end. For example, the sampling frequency encoded by the transmitting end is inconsistent with the sampling output rate of the receiving end, and the sampling frequency conversion may be required. On the other hand, due to the blockage of the channel, etc., it may cause a mismatch between the local clock at the receiving end and the encoded clock at the transmitting end. For example, in MPEG2, data is transmitted by various channels in the form of program stream 5 200843364 (Program stream) or Transp〇nStream, for example, satellite transmission, wired transmission or terrestrial transmission. Usually, the fluctuation of the transmission due to the blocking of the channel may cause a mismatch between the local clock at the receiving end and the encoded clock at the transmitting end. At the same time, the delay of the encoder of the transmitting end and the like may also cause the local clock of the receiving end to be mismatched with the transmitting end and the encoded clock. The error f generated by the clock does not cause the playback to be discontinuous. Therefore, various methods have been used to eliminate such errors, such as a voltage controlled crystal oscillator (VCO), phase lock 裒 (PLL), and the like. In the general audio solution Φ coder, in order to realize the synchronization of audio and video, it is often waited until the error accumulates to a certain amount, for example, the deviation exceeds one frame, and adjustment or waiting processing is performed. At this time, it is often necessary to make measures such as fleas that may affect the performance of the system to a large extent, which may affect the output effect, and may cause a serious bump in the consequences. If a frequency divider capable of fractional division is used in the phase-locked loop, the frequency adjustment of the small step can be performed to some extent. There are also limitations to the use of fractional division. For example, in order to maintain the stability of the phase-locked loop when high-accuracy frequency trimming is required, a large number of loop filter capacitors are required, which is disadvantageous for wafer integration. Moreover, when the ratio of the output frequency to the phase detector frequency is large, a large amount of noise is generated, and the phase jitter caused by this is difficult to avoid. In addition, the cost of the voltage controlled crystal oscillator is relatively high, which is not conducive to the control of the overall cost of the audio decoder chip. SUMMARY OF THE INVENTION It is therefore an aspect of the present invention to provide an audio decoder that provides a higher frequency control accuracy for the rotated audio signal and reduces the cost of the audio decoder. In accordance with an embodiment of the present invention, an audio decoder decodes at least one audio data stream output by an audio encoder, the audio decoder including a parsing unit, a decoding unit, and a resampling unit. And a control unit. The parsing unit receives the external audio stream and decapsulates the packet to obtain an audio material. The decoding unit decodes the audio data, and performs inverse discrete cosine transform (IDCT) and windowing processing on the decoded audio data to obtain a plurality of pulse code modulated sample values (PCM samples). The resampling unit resamples the pulse code modulated sample values according to a sampling frequency ratio. The control unit controls the operation of the audio decoder. It is therefore another aspect of the present invention to provide an audio decoding method that provides an output audio signal with higher frequency control accuracy and reduces the cost of the audio decoder. According to another embodiment of the present invention, an audio decoding method includes: receiving an external audio code stream and performing decapsulation; decoding the audio code stream after decapsulation/packet, and performing inverse discrete cosine transform (IDCT) and windowing Windowing is performed to obtain a plurality of pulse code modulated sample values (PCM samples); and the pulse code modulated sample values are resampled (Resample) according to a predetermined sampling frequency ratio, and then output. According to still another embodiment of the present invention, an audio decoding method includes: parsing an audio packet to obtain an audio material; performing a decoding process on the audio data to obtain at least one PCM sample at least one pulse coded sample value (at least one PCM sample) Re-sampling the pulse code modulated sample value; and filtering the adjusted pulse code modulated sample value. 7 200843364 According to the above embodiment, the resampling unit fine-tunes the audio output rate by converting the audio sample sampling frequency, and can reconstruct the waveform by resampling to adapt to different coded audio playback devices without causing Phase jitter. The audio decoder of the above embodiment does not require the use of a VCO, which greatly reduces the implementation cost. At the same time, other components in the audio decoder can be reused for audio decoding, which also reduces the chip area and reduces the implementation cost. [Embodiment] An audio decoder disclosed in the present invention can be integrated on an audio and video decoding chip in a system single chip manner, and is used in an electronic product that needs to implement audio and video decoding, such as a digital television, a set top box, a DVD, or can be separately used. Made in the form of an audio decoder circuit. Please refer to FIG. 1 , which is a schematic structural diagram of an audio decoder according to an embodiment of the present invention. The audio decoder includes a parsing unit 101, a decoding unit 103, a resampling unit 105, and a control unit 107. In one embodiment of the invention, control unit 107 is a control register and external processor 109 controls the operation of the audio decoder by means of a control register. In other embodiments of the invention, the processor may also be used directly as the control unit 107 without the use of an external processor. The parsing unit 101 receives the external audio data stream, and after unpacking, sends the stream to the decoding unit 103; the decoding unit 103 decodes the audio data stream, and the IDCT transform and the window processing to obtain the PCM sample value; the resampling unit 105 resamples the PCM sample value and outputs it. Please refer to FIG. 2, which is a schematic diagram showing the waveform of the working principle of the resampling unit according to an embodiment of the present invention. The resampling unit 105 filters the known value according to a certain weight 8 200843364 == to reconstruct the sampling point rounding waveform, - the secret point rounding rate. In this 2nd towel, the two points of the arrow are arranged in the order of ^, for the sake of clear display, only a few sampling points are called in the figure. Under the material, the core shape A, # actual sample output rate is greater than the audio decoder's playback rate, Γί the same waveform Β 'but the waveform Β sampling frequency is increased; ^ (_ sample _ output rate is less than audio decoding

時:藉由波形重建得到與波形Α相同的波形C,但波; 頻率降低。這裏採用的重構演算法例如可以爲插值 次异、、、短時傅立葉變換演算法或頻域預測演算法等,或 者其中任意幾種演算法的合理組合,如時域插值演算法與 傅立葉變換演算法相結合。例如在本發明的一個實施例 中’採用時域插值演算法,利用内插逐步逼近的方法完成 採樣頻率的變換,從而達到調整採樣點輸出速率的目的。 清參閱第3圖,其係繪示本發明一實施例之重採樣單 70結構框圖。重採樣單元1〇5設有檢測裝置13卜頻率比值 控制裝置132和頻率調整裝置133。 …拎測裝置131可以對採樣頻率的變換和/或採樣頻率的 誤差進行檢測。檢測裝置131根據接收到的資料串流 stream)中的資訊來確定是否需要調整採樣頻率。例如,檢 測裝置131可以根據音頻資料串流的基本封包的檔頭 (Header)資訊來確定是否需要進行採樣頻率的調整。頻^比 值控制裝置132根據檢測裝置131的輸出值計算得出頻率 調整參考值或直接記錄爲頻率調整參考值。當檢查到需要 變換採樣頻率而進行碼制轉換和/或存在採樣頻率的誤差 200843364 需要進行糾正時,由頻率調整裝置133根據頻率比值控制 裝置132的值對採樣頻率進行調整。調整的步長和精確度 範圍可以汉置成可變的。例如頻率調整裝置133調整的精 確度可以根據需要利用軟體編輯來設置。調整精確度值可 以設爲定點數(整數),誤差在調整時可以先行捨棄尾數。也 可以把調整精確度值設爲浮點數,這樣使用時精確度可以 很高,理論上可以完全消_收播放端本地時脈相對發送 端編碼時f的誤差。採樣頻率調整主要由濾波器重構波形 完成。這裏的濾波器可以直接複用音頻解碼器中解碼單元 的濾波器,因而可以從一個方面節省成本。 檢測裝置對編碼端原採樣頻率FS〇和解碼端的輸出採 樣頻率FS進行比較。當原採樣頻率FSQ和輸出採樣頻率 FS不相等時,爲頻率比值控制裝置提供頻率調整參考值。 在本發明的一個實施例中,頻率比值控制裝置132包 括X比值寄存器1321、γ比值寄存器1322和計算單元 1323。X比值寄存器1321和γ比值寄存器1322可以設置 在音頻解碼器的控制寄存器中。X比值寄存器1321和γ比 值寄存器1322的數值寫入方式,可由外部寫入,例如可以 藉由外部軟體寫入,或由檢測裝置把檢測結果直接輸入。 在本發明的一個實施例中,X比值寄存器〗321和γ比值寄 存器1322均設置爲變數;在本發明的其他實施例中,γ比 值寄存器1322設置成一個可配置的常量,χ比值寄存器 1321設置爲變數;或者X比值寄存器1321設置爲可配置 的常量,Y比值寄存器1322設置爲變數。γ比值寄存器1322 和X比值寄存器1321的值的關係如下: 200843364 (公式一) Y/X=FS/FS0 在檢測到有採樣頻率的誤差和/或需要變換採樣頻率 %,頻率調整裝置133根據頻率比值控制裝置的χ比值寄 存器1321和γ比值寄存器1322的值進行頻率變換。Time: The same waveform C as the waveform Α is obtained by waveform reconstruction, but the wave; the frequency is lowered. The reconstruction algorithm used here may be, for example, an interpolation sub-division, a short-time Fourier transform algorithm or a frequency domain prediction algorithm, or a reasonable combination of any of the several algorithms, such as a time domain interpolation algorithm and a Fourier transform. The algorithm is combined. For example, in an embodiment of the present invention, a time domain interpolation algorithm is used, and the sampling frequency is transformed by an interpolation stepwise approximation method, thereby achieving the purpose of adjusting the sampling point output rate. Referring to Figure 3, there is shown a block diagram of a resampling unit 70 in accordance with an embodiment of the present invention. The resampling unit 1〇5 is provided with a detecting means 13 and a frequency ratio controlling means 132 and a frequency adjusting means 133. The detecting means 131 can detect the conversion of the sampling frequency and/or the error of the sampling frequency. The detecting means 131 determines whether it is necessary to adjust the sampling frequency based on the information in the received data stream stream). For example, the detecting means 131 can determine whether or not the sampling frequency needs to be adjusted based on the header information of the basic packet of the audio stream. The frequency ratio control means 132 calculates a frequency adjustment reference value based on the output value of the detecting means 131 or directly records it as a frequency adjustment reference value. When it is checked that the sampling frequency needs to be converted and the code conversion is performed and/or there is an error in the sampling frequency. When the correction is required, the frequency adjustment means 133 adjusts the sampling frequency based on the value of the frequency ratio control means 132. The adjusted step size and accuracy range can be set to be variable. For example, the accuracy of the adjustment by the frequency adjustment means 133 can be set by software editing as needed. The adjustment accuracy value can be set to a fixed-point number (integer), and the error can be discarded before the adjustment. It is also possible to set the adjustment accuracy value to a floating point number, so that the accuracy can be very high in use, and theoretically, the error of the local clock of the playback end relative to the f of the transmission end can be completely eliminated. The sampling frequency adjustment is mainly done by the filter reconstructing the waveform. The filter here can directly multiplex the filter of the decoding unit in the audio decoder, thereby saving costs in one aspect. The detecting means compares the original sampling frequency FS of the encoding end with the output sampling frequency FS of the decoding end. When the original sampling frequency FSQ and the output sampling frequency FS are not equal, a frequency adjustment reference value is provided for the frequency ratio control device. In one embodiment of the invention, frequency ratio control means 132 includes an X ratio register 1321, a gamma ratio register 1322 and a computing unit 1323. The X ratio register 1321 and the gamma ratio register 1322 can be placed in the control register of the audio decoder. The numerical value writing mode of the X ratio register 1321 and the gamma ratio register 1322 can be externally written, for example, by external software writing, or by the detecting means to directly input the detection result. In one embodiment of the invention, both the X ratio register 321 and the gamma ratio register 1322 are set to variables; in other embodiments of the invention, the gamma ratio register 1322 is set to a configurable constant, and the ratio register 1321 is set. As a variable; or the X ratio register 1321 is set to a configurable constant, and the Y ratio register 1322 is set to a variable. The relationship between the values of the gamma ratio register 1322 and the X ratio register 1321 is as follows: 200843364 (Formula 1) Y/X=FS/FS0 When an error of the sampling frequency is detected and/or the sampling frequency % needs to be converted, the frequency adjusting means 133 according to the frequency The values of the ratio control register 1321 and the gamma ratio register 1322 of the ratio control means are frequency-converted.

頻率調整裝置U3主要爲錢器,先根據編碼端原採 樣頻率FSG構建波形,再根據輸出採樣頻率FS輸出pcMThe frequency adjustment device U3 is mainly a money device, first constructs a waveform according to the original sampling frequency FSG of the encoding end, and then outputs a pcM according to the output sampling frequency FS.

樣點。這裏的構建波形是利用前面所述的演算法來完成, 如插值演算法、短時傅立葉變換演算法或頻域預測演算法 等。參見圖2’按照原採樣頻率刚構建的波形a,波形函 數爲yn=f(Xn) (n=〇,1,2……)。在利用本發明的重採樣單元 105進行重採樣時’重雜的輪出波形B與編碼端編碼時 的波形A完全相同,但採樣頻率發生變化,輸出樣點數相 應變化。根據新採樣頻率Fs輸出pCM樣點時,波形㈣ 波形函數爲yn,=f(xn’)(㈣,u )β其波形由如下公式 ㈣’其中〜:分別表示波形Α和波形Β的輸出樣點的 Ν*間間隔’ χ〇爲起始採樣點:Sample. The constructed waveform here is done using the algorithm described above, such as interpolation algorithm, short-time Fourier transform algorithm or frequency domain prediction algorithm. Referring to Fig. 2', waveform a, which has just been constructed at the original sampling frequency, has a waveform function of yn = f(Xn) (n = 〇, 1, 2, ...). When the resampling unit 105 of the present invention performs resampling, the "heavy round-out waveform B" is exactly the same as the waveform A at the encoding end encoding, but the sampling frequency changes and the number of output samples changes accordingly. When the pCM sample is output according to the new sampling frequency Fs, the waveform (4) waveform function is yn, =f(xn')((4), u)β, and its waveform is obtained by the following formula (4) 'where ~: respectively, the waveform Α and the waveform Β are output samples. The Ν* interval of the point ' χ〇 is the starting sampling point:

Δί2/ΔίΙ= psO/FS = X/Y (公式二) xn,=x0+(n-l) Δί2 / . i Ν ^〇+(η-1)χ/γ (η=〇12 (公式三) 。 yn,,) (公式四) 以下以付合MPEG標準的音頻解碼器爲例作進一步說 明0 1 ·誤差糾正的一個示例 MPEG2資料串流將多個由 丨固田相關音頻資料串流和視 料串流組劾節目,使用單_資心〇 ^㈣頻貝 貝枓串流藉由適當的傳輸介 11 200843364 質進行傳輸。通常打包的一個節目中的音頻資料串流和視 頻資料串流設置有共同的時間基以便於解碼時能夠同時播 放。MPEG2資料串流由系統層和壓縮層構成。壓縮層包括 需要播放的音視頻資料流。系統層主要包括音視頻同步、 流複用、包ID、錯誤檢測等資訊。通常打包的一個節目中 的音頻資料串流和視頻資料串流設置有共同的時間基以便 於解碼時能夠同時播放。MPEG2中設定了一個端對端的固 定延遲時間模型,假設所有數位圖像和音頻資料從編碼器 到解碼器的傳輸都用了同樣長的時間。系統層中設置了要 求固定延遲時間的節目時脈參考(PCR )。壓縮層的檔頭 (Header)包括顯示時間標籤/解碼時間標籤(PTS/DTS)。解 碼器的本地時脈(RTC )與編碼器的當地時脈具有大致相 同的頻率’通常爲27MHz。解碼器的本地時脈和編碼器的 菖地時脈藉由PCR來保持一致。在解碼器中,採用pcR來 糾正本地時脈,並藉由PTS來調整音視頻同步播放。pCR 域爲42位,包括33位的PCR基段和9位元的延伸段兩部 分。基段表徵90MHz的單位,延伸段表徵27MHz的單位。 PTS域爲33位元,表徵9〇KHz的單位,爲27MHz的3〇〇 分之一。在符合MPEG標準的音頻解碼器中,可以利用pTS 域的值來消除採樣頻率的誤差。 ”檢測裝置對資料串流中的PTS和本地時脈RTC進行比 ,後,發現二者不相-致,則將資料串流中的PTS和本地 時脈RTC同時輸出到頻率比值控制裂£ 132。在本發明的 :個實施例中,頻率比值控制裝置132進行計算後,把計 舁結果分料人X比值寄存器㈣和Y比值寄存器⑽。 12 200843364 按照下面的公式五,可以得到採樣頻率的誤差值M, 其中G爲分段量化因數,可用查表的形式將時域的時脈差 轉化爲頻域值,例如可以將G設置爲1/128。分段量化因數 G例如可以藉由軟體設置來改變。公式五中,RTC表示解 碼端音頻解碼器的本地時脈,PTS表示解碼端接收到的資 料串流所指示的顯示時脈。 AF = [(RTC-PTSrCF];(公式五) 按照下面的公式六,可以得到解碼端的輸出採樣頻率 值。公式六中&爲輸出採樣頻率值,^爲根據本地時脈的 原始採樣頻率值,~爲調整精確度,例如可以將~設置爲 2-16。調整精確度'例如可以藉由軟體設置來改變。在本 發明的一個實施例中,可以將心送入頻率比值控制裝置132 作爲X比值寄存器1321的值,將€送入頻率比值控制裝置 132作爲Y比值寄存器1322的值。Δί2/ΔίΙ= psO/FS = X/Y (Formula 2) xn,=x0+(nl) Δί2 / . i Ν ^〇+(η-1)χ/γ (η=〇12 (Formula 3). yn, , (Formula 4) The following is an example of an audio decoder that complies with the MPEG standard. 1 1 · An example of error correction MPEG2 data stream will be streamed and visually streamed by 丨固田 related audio data The group program is transmitted by using the appropriate transmission medium 11 200843364 using a single _ 资 〇 ^ (4) frequency Beibei 枓 stream. The audio data stream and the video data stream in a program that is usually packaged have a common time base so that they can be played simultaneously at the time of decoding. The MPEG2 data stream consists of a system layer and a compression layer. The compression layer includes the audio and video data streams that need to be played. The system layer mainly includes information such as audio and video synchronization, stream multiplexing, packet ID, and error detection. The audio stream and the video stream stream in a package that is usually packaged have a common time base so that they can be played simultaneously when decoding. An end-to-end fixed delay time model is set in MPEG2, assuming that all digital image and audio data are transmitted from the encoder to the decoder for the same amount of time. A program clock reference (PCR) requiring a fixed delay time is set in the system layer. The header of the compression layer includes a display time stamp/decoding time label (PTS/DTS). The local clock (RTC) of the decoder has approximately the same frequency as the local clock of the encoder', typically 27 MHz. The local clock of the decoder and the local clock of the encoder are consistent by PCR. In the decoder, pcR is used to correct the local clock, and PTS is used to adjust the audio and video synchronization. The pCR domain is 42 bits and includes a 33-bit PCR base segment and a 9-bit extension segment. The base segment characterizes the unit of 90 MHz and the extension segment characterizes the unit of 27 MHz. The PTS field is 33 bits and represents a unit of 9 〇 KHz, which is one third of 27 MHz. In an audio decoder conforming to the MPEG standard, the value of the pTS field can be utilized to eliminate the error of the sampling frequency. The detecting device compares the PTS in the data stream with the local clock RTC, and then finds that the two are not in phase, and simultaneously outputs the PTS and the local clock RTC in the data stream to the frequency ratio control split. In an embodiment of the present invention, after the frequency ratio control means 132 performs the calculation, the result is divided into a person X ratio register (4) and a Y ratio register (10). 12 200843364 According to the following formula 5, the sampling frequency can be obtained. The error value M, where G is a segmentation quantization factor, can be converted into a frequency domain value in the form of a look-up table, for example, G can be set to 1/128. The segmentation quantization factor G can be, for example, by software. Set to change. In Equation 5, RTC indicates the local clock of the decoder audio decoder, and PTS indicates the display clock indicated by the data stream received by the decoder. AF = [(RTC-PTSrCF]; (Formula 5) According to the following formula 6, the output sampling frequency value of the decoding end can be obtained. In the formula 6, & is the output sampling frequency value, ^ is the original sampling frequency value according to the local clock, and ~ is the adjustment precision, for example, the setting can be set to ~ 2-16. The adjustment accuracy ' can be changed, for example, by a software setting. In one embodiment of the invention, the heart can be fed into the frequency ratio control device 132 as the value of the X ratio register 1321, and the € is fed into the frequency. The ratio control means 132 serves as the value of the Y ratio register 1322.

Fs=Fs0+AF*Df (公式六) 在本發明的另一個實施例中,頻率比值控制裝置132 的Y比值寄存器1322可以設置成一個可配置的常量,例如 0X10000。X比值寄存器1321可以設置爲變數,控制單元 對進行計算後,把所得的結果寫入X比值寄存器1321。 2·變換採樣頻率而進行碼制轉換的示例 在本發明的一些實施例中,檢測裝置還可以根據音頻 資料串流的基本流的檔頭資訊來確定是否需要在不同採樣 頻率之間進行碼制轉換。在此仍以符合MPEG標準的音頻 解碼器爲例作進一步說明。 MPEG標準文件ISO/IEC11172-3中爲音頻接收與播放 13 200843364 系統定義了三種不同的音頻採樣頻率:48ΚΗζ、44·1ΚΗζ、 32ΚΗζ。此外ISO/IEC13818-3進一步定義了半頻採樣頻 率,即24ΚΗζ、22·05ΚΗζ、16ΚΗζ。在其他一些音頻接收 與播放系統中還定義了高頻採樣頻率,如96ΚΗζ、 88·2ΚΗζ、64ΚΗζ,以及甚高頻採樣頻率,如192ΚΗζ、 176·4ΚΗζ、128ΚΗζ。本發明的頻率轉換裝置可以在不同的 音頻採樣頻率之間進行變換,例如從48ΚΗζ轉換到 44.ΙΚΗζ;也可以對同一音頻採樣頻率在給定頻率的上下偏 差範圍内進行誤差的調整,例如從44.105KHz調整到 44·1ΚΗζ。 根據MPEG標準文件ISO/IEC11172-3,音頻資料串流 的基本流(ES)的檔頭資訊中包含2位元(bit)的採樣頻 率域(sampling_JVequency )。此標準中定義的採樣頻率與基 本流檔頭(Header)的對應如表1所示。MPEG標準文件 ISO/IEC13812-3進一步在音頻資料串流基本流檔頭設定了 1位元(bit)的ID域的含義。ID域值爲1,表示通常的三 種採樣頻率,44·1、48、32KHz ; ID域值爲0,表示三種半 頻的採樣頻率,22.05、24、16KHz。 採樣頻率 (KHz) 採樣頻率域 值 44.1 00 48 01 32 10 200843364Fs = Fs0 + AF * Df (Formula 6) In another embodiment of the present invention, the Y ratio register 1322 of the frequency ratio control means 132 may be set to a configurable constant such as 0X10000. The X ratio register 1321 can be set as a variable, and after the control unit pair is calculated, the result is written into the X ratio register 1321. 2. Example of performing code conversion by transforming the sampling frequency. In some embodiments of the present invention, the detecting device may further determine whether it is necessary to code between different sampling frequencies according to the header information of the elementary stream of the audio data stream. Conversion. Here, the audio decoder conforming to the MPEG standard is taken as an example for further explanation. The MPEG standard file ISO/IEC11172-3 for audio reception and playback 13 200843364 The system defines three different audio sampling frequencies: 48ΚΗζ, 44·1ΚΗζ, 32ΚΗζ. In addition, ISO/IEC13818-3 further defines the half-frequency sampling frequency, ie 24 ΚΗζ, 22·05 ΚΗζ, 16 ΚΗζ. High frequency sampling frequencies are also defined in other audio receiving and playback systems, such as 96ΚΗζ, 88·2ΚΗζ, 64ΚΗζ, and very high frequency sampling frequencies such as 192ΚΗζ, 176·4ΚΗζ, 128ΚΗζ. The frequency conversion device of the present invention can perform conversion between different audio sampling frequencies, for example, from 48 到 to 44 ΙΚΗζ; or the error adjustment of the same audio sampling frequency within a range of upper and lower deviations of a given frequency, for example, 44.105KHz is adjusted to 44·1ΚΗζ. According to the MPEG standard file ISO/IEC 11172-3, the header information of the elementary stream (ES) of the audio stream includes a 2-bit sampling frequency field (sampling_JVequency). The sampling frequency defined in this standard corresponds to the basic flow head (Header) as shown in Table 1. The MPEG standard file ISO/IEC13812-3 further sets the meaning of the 1-bit (ID) ID field in the audio stream stream elementary stream header. The ID field value is 1, indicating the usual three sampling frequencies, 44·1, 48, and 32 KHz; the ID field value is 0, indicating the sampling frequency of the three half frequencies, 22.05, 24, and 16 KHz. Sampling frequency (KHz) Sampling frequency domain Value 44.1 00 48 01 32 10 200843364

保留 u 出速131檢測到接收到的資料串流的採樣點輪 =率與g頻解碼器的採樣點播放速率不—致,將資Reserved u speed 131 detects the sample stream of the received data stream = rate and the sampling rate of the g-band decoder is not - the result will be

的編碼端的原採樣頻率和解碼器的播放採樣頻率提 ::率比值控制裝置。例如,可以直接把檢測 =出《頻率㈣送入γ比值寄存器1322,編竭: =樣:率值觸送入x比值寄存器1321。由頻率調 裝置133根據頻率比值控制裝置132的值進行波形重 構’從而調整採樣頻率。 在本發明的另一個實施例中,頻率比值控制裝置in 、比值寄存态1322可以設置成一個可配置的常量,例如 oxioooo,X比值寄存器1321可以設置爲資料串流指示的 編碼端的原採樣頻率與解碼端的播放採樣頻率的比值。由 ^率肩整裝置133根據頻率比值控制裝置132的值進行波 形重構,從而調整採樣頻率。 在本發明的一個實施例中,當檢查到需要變換採樣頻 率進行碼制轉換和/或存在採樣頻率的誤差需要進行糾正 每兩種重採樣的應用可以合成在同一個重採樣單元中進 仃次濾波,其中新的採樣頻率值fs可以將兩種應用中需 調整的採樣頻率值合成而獲得。例如碼制轉換的播放採樣 頻率爲48KHz,誤差糾正的^爲〇〇〇5 KHz,則可以直接 把一者相加,得到合成後的新採樣頻率48 〇〇5 KHz。 在本發明的另一個實施例中,兩種重採樣的應用可以 15 200843364 採用級聯的形式來實現。從形式上來說,可以先對一種重 採樣的應用進行濾波完成頻率變化,例如先將編碼端的 48.005KHZ變換到48ΚΗζ達成誤差糾正,再對另一種重採 樣的應用進行濾波完成頻率變化,例如再將48KHz變換到 32KHz。兩種重採樣之間可以用卷積的邏輯關係相連。 第4圖係繪示本發明一實施例之音頻解碼方法流程 圖。音頻解碼方法包括: 步驟401,接收外部的音頻碼流並進行解封包。 步驟403,對解封包後的音頻碼流進行解碼,並進行反 離散餘弦轉換(IDCT)以及加窗處理(Windowing),來獲得脈 波編碼調變採樣值(PCM samples)。 步驟405,對脈波編碼調變採樣值按預定採樣頻率比值 進行重採樣後予以輸出。 第5圖係繪示音頻解碼方法中步驟405的詳細流程 圖。其中,步驟405包括: 步驟501,對採樣頻率的變換和/或採樣頻率的誤差進 行檢測,並産生一個頻率調整比值參考值。 步驟503,根據頻率調整比值參考值輸出新採樣頻率和 原採樣頻率的比值。 步驟505,根據新採樣頻率和原採樣頻率的比值,採用 濾波方法重建波形,並對採樣頻率進行變換和/或調整,之 後輸出採樣點。 其中,重採樣步驟是按照一定的演算法採用濾波方法 重構採樣點的輸出波形而調整採樣點輸出速率。這種演算 法包括插值演算法、短時傅立葉變換演算法和頻域預測演 200843364 算法等演算法中的一種每多藉:當曾、土 種a夕種,貝异法進行濾波以重構波 形。 對PCM採樣值進行重採樣時,純頻率㈣採樣比值 2可變的。在本發明的__個實施例中,採樣頻率的精確度 範圍可以根據需要利用軟體編程來設置。 採樣頻率的重採樣比值可以根據音頻資料串流提供的 的資訊來設置。在符合MPEG標準的_些實施例中,對於 減頻率的誤差的調整,由採樣頻㈣錄樣比值根據音 • 頻資料串流的基本封包的檔頭資訊包含的PTS域的值來決 定;對於不同採樣頻率之間的變換,由採樣頻率的重採樣 比值根據音頻資料串流的基本流的檔頭資訊包含的 sampling freqUencey域的值來決定,並可結合基本流的檔頭 資訊包含的ID域的值。 雖然本發明已以一實施例揭露如上,然其並非用以限 定本發明,任何在本發明所屬技術領域中具有通常知識 者,在不脫離本發明之精神和範圍内,當可作各種之更動 _ 與潤飾,因此本發明之保護範圍當視後附之申請專利範圍 所界定者為準。 【圖式簡單說明】 為讓本發明之上述和其他目的、特徵、優點與實施例 能更明顯易懂,所附圖式之詳細說明如下·· 第1圖係繪示本發明一實施例之一種音頻解碼器結構 示意圖。 17 200843364 第2圖係繪示本發明一實施例之音頻解碼器中一個重 採樣單元的工作原理波形示意圖。 第3圖係繪示本發明一實施例之音頻解碼器的重採樣 單元結構框圖。 第4圖係繪示本發明一實施例之音頻解碼方法流程圖。 第5圖係繪示本發明一實施例之音頻解碼方法步驟 405的詳細流程圖。The original sampling frequency of the encoding end and the playback sampling frequency of the decoder provide a rate ratio control device. For example, the detection = out "frequency (4) can be directly sent to the gamma ratio register 1322, compiled: = sample: the rate value is touched into the x ratio register 1321. The frequency adjustment means 133 performs waveform reconstruction based on the value of the frequency ratio control means 132 to adjust the sampling frequency. In another embodiment of the present invention, the frequency ratio control device in, the ratio register state 1322 can be set to a configurable constant, such as oxioooo, and the X ratio register 1321 can be set to the original sampling frequency of the encoding end indicated by the data stream. The ratio of the playback sampling frequency of the decoder. The waveform reconstruction is performed by the rate shoulder device 133 based on the value of the frequency ratio control means 132, thereby adjusting the sampling frequency. In one embodiment of the present invention, when it is checked that the sampling frequency needs to be converted for code conversion and/or the error of the sampling frequency needs to be corrected, the application of each two resamplings can be synthesized in the same resampling unit. Filtering, wherein the new sampling frequency value fs can be obtained by synthesizing the sampling frequency values to be adjusted in the two applications. For example, the playback sampling frequency of the code conversion is 48KHz, and the error correction is 〇〇〇5 KHz, then one can be directly added to obtain a new sampling frequency of 48 〇〇 5 KHz after synthesis. In another embodiment of the invention, two resampling applications can be implemented in the form of a cascade of 15 200843364. Formally speaking, a resampling application can be first filtered to complete the frequency change. For example, the 48.005 KHZ of the encoding end is first transformed to 48 ΚΗζ to achieve error correction, and then another resampling application is filtered to complete the frequency change, for example, 48KHz conversion to 32KHz. The two types of resampling can be connected by a logical relationship of convolution. Figure 4 is a flow chart showing an audio decoding method according to an embodiment of the present invention. The audio decoding method includes: Step 401: Receive an external audio code stream and perform decapsulation. Step 403, decoding the decoded audio stream, performing inverse discrete cosine transform (IDCT) and windowing (Windowing) to obtain pulse code modulated samples (PCM samples). In step 405, the pulse code modulated sample value is resampled according to a predetermined sampling frequency ratio and then output. Fig. 5 is a detailed flow chart showing the step 405 in the audio decoding method. The step 405 includes: Step 501: detecting a conversion of the sampling frequency and/or an error of the sampling frequency, and generating a frequency adjustment ratio reference value. Step 503: Output a ratio of the new sampling frequency to the original sampling frequency according to the frequency adjustment ratio reference value. Step 505: According to the ratio of the new sampling frequency and the original sampling frequency, the filtering method is used to reconstruct the waveform, and the sampling frequency is transformed and/or adjusted, and then the sampling point is output. The resampling step is to adjust the output point of the sampling point by using a filtering method to reconstruct the output waveform of the sampling point according to a certain algorithm. This algorithm includes one of the algorithms such as interpolation algorithm, short-time Fourier transform algorithm and frequency domain prediction algorithm 200843364. Each of the algorithms is borrowed: when it is used, the soil is a kind, and the shell method is filtered to reconstruct the waveform. . When the PCM sample value is resampled, the pure frequency (four) sample ratio 2 is variable. In an embodiment of the invention, the accuracy of the sampling frequency can be set using software programming as needed. The resampling ratio of the sampling frequency can be set based on the information provided by the audio stream. In some embodiments conforming to the MPEG standard, for the adjustment of the error of the frequency reduction, the sampling frequency (four) recording ratio is determined according to the value of the PTS field included in the header information of the basic packet of the audio data stream; The conversion between different sampling frequencies is determined by the resampling ratio of the sampling frequency according to the value of the sampling freqUencey field included in the header information of the elementary stream of the audio data stream, and can be combined with the ID field included in the header information of the elementary stream. Value. Although the present invention has been disclosed in an embodiment of the present invention, it is not intended to limit the present invention, and any one of ordinary skill in the art to which the invention pertains may be modified in various ways without departing from the spirit and scope of the invention. The scope of protection of the present invention is defined by the scope of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS The above and other objects, features, advantages and embodiments of the present invention will become more <RTIgt; A schematic diagram of an audio decoder structure. 17 200843364 FIG. 2 is a schematic diagram showing the operation principle of a resampling unit in an audio decoder according to an embodiment of the present invention. Figure 3 is a block diagram showing the structure of a resampling unit of an audio decoder according to an embodiment of the present invention. FIG. 4 is a flow chart showing an audio decoding method according to an embodiment of the present invention. Figure 5 is a detailed flow chart showing the steps 405 of the audio decoding method in accordance with an embodiment of the present invention.

【主要元件符號說明】 101 :解析單元 103 :解碼單元 105 :重採樣單元 107 :控制單元 109 ··外部處理器 131 :檢測裝置 132 :頻率比值控制裝置 1321 : X比值寄存器 1322 : Y比值寄存器 1323 :計算單元 133 :頻率調整裝置 401、403、405 :音頻解碼方法之步驟 501、503、505 :重採樣步驟 18[Main component symbol description] 101: Parsing unit 103: Decoding unit 105: Resampling unit 107: Control unit 109 · External processor 131: Detection device 132: Frequency ratio control device 1321: X ratio register 1322: Y ratio register 1323 : Calculation unit 133: frequency adjustment means 401, 403, 405: steps 501, 503, 505 of the audio decoding method: resampling step 18

Claims (1)

200843364 十、申請專利範圍: 1. 一種音頻解碼器,以解碼一音頻編碼器所輸出之至少 一音頻碼流(audio data stream),包含: 一解析單元,用以接收外部之該音頻碼流並進行解封 包,以獲得一音頻資料; 一解碼單元,解碼該音頻資料,並對解碼後之該音頻 資料進行反離散餘弦轉換(IDCT)以及加窗處理 (Windowing),藉以獲得複數個脈波編碼調變採樣值(PCM sample); 一重採樣單元,按照一採樣頻率比值,對該些脈波編 碼調變採樣值進行重採樣(re-sampling);以及 一控制單元,用以控制該音頻解碼器之工作。 2. 如申請專利範圍第1項所述之音頻解碼器,其中該重 採樣單元包含: 一檢測裝置,係對一採樣頻率(sampling frequency)的 變換以及/或採樣頻率的誤差進行檢測,藉以産生一頻率調 整比值參考值; 一頻率比值控制裝置,根據該頻率調整比值參考值輸 出一採樣頻率比值;以及 一頻率調整裝置,根據該採樣頻率比值,採用濾波方 法(filtering)重建波形,藉以變換和/或調整該採樣頻率。 3·如申請專利範圍第2項所述之音頻解碼器,其中該頻 率比值控制裝置包含一 X比值寄存器(a X register)以及一 Y 19 200843364 比值寄存器(a Y register),藉以儲存數值。 4. 如申請專利範圍第3項所述之音頻解碼器,其中該頻 率比值控制裝置更包含一計算單元,用以依據該音頻資料 所記載之一顯示時間標籤(Presentation Time Stamp),以及 該音頻解碼器之一本地時脈(Real Time Clock)進行計算 後,並將一計算結果存入該X比值寄存器以及該Y比值寄 存器之一。 5. 如申請專利範圍第3項所述之音頻解碼器,其中該X 比值寄存器與該Y比值寄存器係儲存一常數以及/或一變 數。 6. 如申請專利範圍第3項所述之音頻解碼器,其中該X 比值寄存器以及該Y比值寄存器,係儲存該音頻編碼器之 一原採樣頻率以及該解碼單元之一播放採樣頻率值。 7. 如申請專利範圍第3項所述之音頻解碼器,其中該X 比值寄存器以及該Y比值寄存器,係儲存該音頻編碼器之 一原採樣頻率值以及該解碼單元之一播放採樣頻率值的比 值,以及可設定之一常數。 8. —種音頻解碼方法,係由一音頻解碼器解碼一音頻編 碼器所輸出之一音頻碼流(audio data stream),該音頻解碼 方法包含: 20 200843364 (a)接收外部之該音頻碼流並進行解封包,· $ (b)對解封包後之該音頻碼流進行解碼,並進行反離 、弦轉換(IDCT)和加窗處理(Wind〇wing卜以獲得複數個 脈波編碼調變採樣值(PCMsample);以及 # 、(C)按一預定採樣頻率比值,對該些脈波編碼調變採 '值進行重採樣(Re-samPle)後予以輸丨。200843364 X. Patent application scope: 1. An audio decoder for decoding at least one audio data stream output by an audio encoder, comprising: a parsing unit for receiving an external audio stream and Decapsulating the packet to obtain an audio data; a decoding unit, decoding the audio data, and performing inverse discrete cosine transform (IDCT) and windowing processing on the decoded audio data to obtain a plurality of pulse wave codes a PCM sample; a resampling unit that resamples the pulse code modulated samples according to a sampling frequency ratio; and a control unit for controlling the audio decoder Work. 2. The audio decoder of claim 1, wherein the resampling unit comprises: a detecting device that detects a sampling frequency and/or an error of a sampling frequency to generate a frequency adjustment ratio reference value; a frequency ratio control means for outputting a sampling frequency ratio according to the frequency adjustment ratio reference value; and a frequency adjusting means for reconstructing the waveform by filtering according to the sampling frequency ratio, thereby converting and / or adjust the sampling frequency. 3. The audio decoder of claim 2, wherein the frequency ratio control means includes an X-value register (a X register) and a Y 19 200843364 ratio register (a Y register) for storing the value. 4. The audio decoder of claim 3, wherein the frequency ratio control device further comprises a computing unit for displaying a time stamp (Presentation Time Stamp) according to one of the audio data records, and the audio After the Real Time Clock is calculated by one of the decoders, a calculation result is stored in the X ratio register and one of the Y ratio registers. 5. The audio decoder of claim 3, wherein the X ratio register and the Y ratio register store a constant and/or a variable. 6. The audio decoder of claim 3, wherein the X ratio register and the Y ratio register store an original sampling frequency of the audio encoder and a playback sampling frequency value of one of the decoding units. 7. The audio decoder of claim 3, wherein the X ratio register and the Y ratio register store an original sampling frequency value of one of the audio encoders and a playback frequency value of one of the decoding units. Ratio, and one constant can be set. 8. An audio decoding method, wherein an audio decoder outputs an audio data stream output by an audio decoder, the audio decoding method comprising: 20 200843364 (a) receiving the external audio stream And decapsulation, · $ (b) Decode the audio stream after decapsulation, and perform inverse, chord conversion (IDCT) and windowing (Wind〇wing) to obtain a plurality of pulse code modulation The sampled value (PCMsample); and #, (C) are resampled (Re-samPle) for the values of the pulse code modulation according to a predetermined sampling frequency ratio. 9·如申請專利範圍第8項所述之音頻解碼方法,其中該 步驟(c)包含: ^ )對採樣頻率(sa〇ipling frequency)之變換以及/ 或該採樣頻率之每I、仓 又為差進仃檢測,以產生一頻率調整比值參 考值; 〆 (C2)根據該頻率調整比值參考值,輸出一採樣頻率 比值;以及 (=)根據該採樣頻率比值,採用一濾波方法(filtering) 重建曰頻彳§#&quot;之波形,藉以對該採樣頻率進行變換以及/ 或調整。 ^ 10·如申請專利範圍第9項所述之音頻解碼方法,其中 田該步驟(cl)檢剛到該採樣頻率有變換時,完成該採樣 頻率之關轉換,Μ該步驟(ei)檢_該採樣頻率有 誤差時,収_樣頻率线差。 A U·如申凊專利範圍第10項所述之音頻解碼方法,其中 田該步驟到該採樣頻率有變換且該採樣頻率有誤 21 200843364 差時,將碼制轉換和誤差糾正合成進行一次濾波。 12. 如申請專利範圍第10項所述之音頻解碼方法,其中 當該步驟(cl)檢測到該採樣頻率有變換,且該採樣頻率 有誤差時,將碼制轉換和誤差糾正分開進行濾波,再從邏 - 輯上以卷積(convolution)形式合成。 13. 如申請專利範圍第9至12項所述之音頻解碼方法, φ 其中當該步驟(cl)檢測到該採樣頻率有誤差時,該採樣 頻率之誤差AF為: AF = [(RTC-PTSyCF] ^ 其中,其中爲步長係數(step Length Coefficient), RTC(Real Time Clock)表示該音頻解碼器之一本地時脈, PTS表示該音頻碼流所記載之一顯示時間標籤(Presentation Time Stamp) 〇 14·如申請專利範圍第13項所述之音頻解碼方法,其中 該步驟(cl)係使用如下之公式獲得該頻率調整比值參考 值: 其中,AF爲該採樣頻率之誤差,G。爲根據該本地時脈 之一原始採樣頻率值,Fs爲檢測到的一輸出採樣頻率值, &amp;爲調整精確度。 15·如申請專利範圍第9至12項所述之音頻解碼方法, 22 200843364 其中當該步驟(cl)檢測到該採樣頻率有變換時,將該音 頻碼流(audio stream)所紀錄之該音頻編碼器之該原始採樣 頻率和該音頻解碼器之一播放採樣頻率之比值作爲該頻率 調整比值參考值。 16.—種音頻解碼方法,係解碼一音頻編碼器所輸出之 至少一音頻封包,包含:. (a) 解析該音頻封包,以得到一音頻資料; (b) 對該音頻資料進行一解碼程序,以獲得至少一脈波 編碼調變採樣值(at least one PCM sample); (c) 對該脈波編碼調變採樣值進行重採樣 (re_sampling);以及 (句濾波(filtering)重採樣後之該脈波編碼調變採樣值。 17·如申請專利範圍第16項所述之音頻解碼方法,其中 該解碼程序包含對該音頻資料進行反離散餘弦轉換(IDCT) 以及加窗處理(Windowing)。 18·如申請專利範圍第16項所述之音頻解碼方法,其中 該步驟(c)包含: 檢測該音頻解碼器之一本地時脈(Real Time Clock)以 及該音頻封包所記載之一顯示時間標籤(Presentation Time Stamp),藉以得出一誤差頻率; 將該誤差頻率執行一數學運算,以獲得該音頻解碼器 之一撥放採樣頻率;以及 23 200843364 根據該撥放採樣頻率,調整該脈波編碼調變採樣值之 數目0 19. 如申請專利範圍第18項所述之音頻解碼方法,其中 該頻率誤差AF為: ,其中 爲步長係數(step Length Coefficient),RTC以及PTS分別為該本地時脈以及該顯示 時間標籤。 20. 如申請專利範圍第19項所述之音頻解碼方法,其 中該撥放採樣頻率巧為: 心爲該本地時脈之頻率,'爲調整精確 度0 249. The audio decoding method according to claim 8, wherein the step (c) comprises: ^) transforming a sampling frequency (sa〇ipling frequency) and/or each I and bin of the sampling frequency is Differential detection, to generate a frequency adjustment ratio reference value; 〆 (C2) adjust the ratio reference value according to the frequency, output a sampling frequency ratio; and (=) according to the sampling frequency ratio, using a filtering method (filtering) reconstruction The frequency of the §#&quot; waveform is used to transform and/or adjust the sampling frequency. [10] The audio decoding method according to claim 9, wherein the step (cl) is performed until the sampling frequency is changed, and the sampling frequency is switched, and the step (ei) is detected. When there is an error in the sampling frequency, the frequency line difference is received. A U. The audio decoding method according to claim 10, wherein the step of converting to the sampling frequency and the sampling frequency is incorrect. When the difference is 200843364, the code conversion and the error correction synthesis are performed once. 12. The audio decoding method according to claim 10, wherein when the step (cl) detects that the sampling frequency has a transformation, and the sampling frequency has an error, the code conversion and the error correction are separately filtered. It is synthesized from the logic in the form of convolution. 13. The audio decoding method according to claim 9 to 12, wherein φ, when the step (cl) detects that the sampling frequency has an error, the error AF of the sampling frequency is: AF = [(RTC-PTSyCF ] ^ where is the step length coefficient, RTC (Real Time Clock) indicates one of the local decoders of the audio decoder, and PTS indicates one of the recorded time stamps (Presentation Time Stamp) recorded in the audio stream. The audio decoding method of claim 13, wherein the step (cl) obtains the frequency adjustment ratio reference value using the following formula: where AF is the error of the sampling frequency, G. The original sampling frequency value of the local clock, Fs is the detected output sampling frequency value, and the adjustment accuracy is 15. The audio decoding method as described in claim 9th to 12th, 22 200843364 When the step (cl) detects that the sampling frequency has a transformation, the original sampling frequency of the audio encoder recorded by the audio stream and one of the audio decoders The ratio of the sampling frequency is used as the reference value of the frequency adjustment ratio. 16. An audio decoding method for decoding at least one audio packet output by an audio encoder, comprising: (a) parsing the audio packet to obtain an audio (b) performing a decoding process on the audio data to obtain at least one PCM sample; (c) resampling the pulse code modulated sample value (re_sampling) And the audio decoding method according to claim 16, wherein the decoding program includes inversely discretizing the audio data. The cosine transform (IDCT) and the windowing process. The audio decoding method according to claim 16, wherein the step (c) comprises: detecting a local clock of the audio decoder (Real Time) Clock) and one of the audio packets recorded by the presentation time stamp (Presentation Time Stamp), thereby obtaining an error frequency; performing a mathematical operation on the error frequency to One of the audio decoders is set to play the sampling frequency; and 23 200843364 adjusts the number of the pulse code modulated sample values according to the dialing sampling frequency. 19. 19. The audio decoding method according to claim 18, The frequency error AF is: where is a step length coefficient, and the RTC and the PTS are the local clock and the display time label, respectively. 20. The audio decoding method according to claim 19, wherein the dialing sampling frequency is: the heart is the frequency of the local clock, and the adjustment precision is 0 24
TW96115163A 2007-04-27 2007-04-27 An audio decoder and method thereof TWI337812B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW96115163A TWI337812B (en) 2007-04-27 2007-04-27 An audio decoder and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW96115163A TWI337812B (en) 2007-04-27 2007-04-27 An audio decoder and method thereof

Publications (2)

Publication Number Publication Date
TW200843364A true TW200843364A (en) 2008-11-01
TWI337812B TWI337812B (en) 2011-02-21

Family

ID=44822267

Family Applications (1)

Application Number Title Priority Date Filing Date
TW96115163A TWI337812B (en) 2007-04-27 2007-04-27 An audio decoder and method thereof

Country Status (1)

Country Link
TW (1) TWI337812B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123943A (en) * 2013-04-28 2014-10-29 安凯(广州)微电子技术有限公司 Audio signal resampling method and apparatus
CN106027541A (en) * 2016-06-17 2016-10-12 北京世纪东方通讯设备有限公司 Voice coding and decoding device and method used for GSM-R communication system
TWI624174B (en) * 2015-12-30 2018-05-11 矽力杰半導體技術(杭州)有限公司 Methods and a system for transmitting and receiving audio-video data.

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123943A (en) * 2013-04-28 2014-10-29 安凯(广州)微电子技术有限公司 Audio signal resampling method and apparatus
CN104123943B (en) * 2013-04-28 2017-05-31 安凯(广州)微电子技术有限公司 A kind of method and apparatus of audio signal resampling
TWI624174B (en) * 2015-12-30 2018-05-11 矽力杰半導體技術(杭州)有限公司 Methods and a system for transmitting and receiving audio-video data.
CN106027541A (en) * 2016-06-17 2016-10-12 北京世纪东方通讯设备有限公司 Voice coding and decoding device and method used for GSM-R communication system

Also Published As

Publication number Publication date
TWI337812B (en) 2011-02-21

Similar Documents

Publication Publication Date Title
JP4618960B2 (en) Clock recovery
US7359006B1 (en) Audio module supporting audio signature
US7414550B1 (en) Methods and systems for sample rate conversion and sample clock synchronization
US7130316B2 (en) System for frame based audio synchronization and method thereof
JP4643276B2 (en) Wireless receiver
CN100561582C (en) Audio decoder and audio-frequency decoding method
KR980010748A (en) Multiplexed data generating device, encoded data reproducing device, clock converting device, encoded data recording medium, encoded data transmission medium, multiplexed data generating method, encoded data reproducing method and clock converting method
JP2007501428A (en) Buffer management system, digital audio receiver, headphones, speaker, buffer management method
TW200843364A (en) An audio decoder and method thereof
EP1414247B1 (en) Data rate management system and method for A/V decoder
US6243032B1 (en) Decode apparatus that can accommodate dynamic change in sample data attribute during decoding process
WO2004093072A1 (en) Compressed data editing device
JP2007201983A (en) Broadcast station synchronization method, and control apparatus
JPH09261070A (en) Digital audio signal processing unit
JP4579877B2 (en) Playback apparatus and playback method
TWI328358B (en) An audio decoder and an audio decoding method
JP2002156998A (en) Bit stream processing method for audio signal, recording medium where the same processing method is recorded, and processor
JP2003162299A (en) Speech reproducing circuit, decoding circuit, and device and method for reproducing speech
JP2003339023A (en) Moving picture reproducing apparatus
US20060245311A1 (en) System and method for handling audio jitters
JP4332973B2 (en) Decoding device and decoding method
JP4651311B2 (en) System equipped with sampling conversion means and digital filter
JPH11272295A (en) Method and device for processing voice
JP2003208200A (en) Received signal reproducing method
JP2005277461A (en) Data transmission system

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees