CN101930744B - Handshake protocol method for AAC audio coding - Google Patents
Handshake protocol method for AAC audio coding Download PDFInfo
- Publication number
- CN101930744B CN101930744B CN2010102745097A CN201010274509A CN101930744B CN 101930744 B CN101930744 B CN 101930744B CN 2010102745097 A CN2010102745097 A CN 2010102745097A CN 201010274509 A CN201010274509 A CN 201010274509A CN 101930744 B CN101930744 B CN 101930744B
- Authority
- CN
- China
- Prior art keywords
- fpga
- data
- out data
- data buffer
- encoded
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
(一)技术领域: (1) Technical field:
本发明涉及一种握手协议方法,尤其是一种AAC音频编码的握手协议方法。属于通信领域。The invention relates to a handshake protocol method, in particular to a handshake protocol method of AAC audio coding. belongs to the field of communication.
(二)背景技术: (two) background technology:
AAC(Advanced Audio Coding)标准完成于1997年,经BBC(British BroadcastingCorporation)和NHK(Japan Broadcasting Corporation)使用并测试表明其对低比特率的多声道编码能提供相当高的声音质量。在相同音质情况下,AAC压缩率比MP3高30%,并且在立体声128kbps下,可达到接近CD的音质。The AAC (Advanced Audio Coding) standard was completed in 1997. It has been used and tested by BBC (British Broadcasting Corporation) and NHK (Japan Broadcasting Corporation) to show that it can provide quite high sound quality for low bit rate multi-channel coding. In the case of the same sound quality, the compression rate of AAC is 30% higher than that of MP3, and under the stereo 128kbps, it can reach the sound quality close to CD.
在AAC的实际应用中,通常对声音信号的采样率和编码后的码流速率有一定要求,而声音采样时钟和输出码流时钟可能是非同源的,输出码流速率恒定难以保证;且由于AAC编码的压缩率与输入有关,在输入声音信号变化的情况下,若无相应的调节机制,输出码流的速率恒定也难以保证。In the practical application of AAC, there are usually certain requirements on the sampling rate of the sound signal and the coded stream rate, but the sound sampling clock and the output stream clock may be non-homologous, and it is difficult to guarantee the constant output stream rate; and because The compression rate of AAC encoding is related to the input. In the case of changes in the input sound signal, if there is no corresponding adjustment mechanism, it is difficult to guarantee the constant rate of the output code stream.
(三)发明内容: (3) Contents of the invention:
本发明的目的在于提出一种AAC音频编码的握手协议方法,以解决现有技术实际应用中在特定采样率下,要求输出码流保持速率恒定的问题。The purpose of the present invention is to propose a handshake protocol method for AAC audio coding, so as to solve the problem that the output code stream is required to maintain a constant rate at a specific sampling rate in the actual application of the prior art.
本发明的技术方案概括为:语音信号经模数转换芯片(AD)采样后进入FPGA,被缓存在FPGA的先入先出的数据缓存器(FIFO)中,当FIFO存储数据量大于AAC编码所需的一帧数量,将指示信号1设置为高,否则置为低;DSP若检测到指示信号1为低,则继续检测,若检测到指示信号1为高,则取走一帧数据,进行编码;编码后DSP检测FPGA端指示信号2(FPGA内存储编码后数据的FIFO是否达到半满),若为高,则向FPGA发送长帧,若为低,则向FPGA发送短帧,通过FIFO缓存和长短帧机制保证AAC编码输出码流速率恒定。The technical scheme of the present invention is summarized as: voice signal enters FPGA after sampling by analog-to-digital conversion chip (AD), and is buffered in the first-in-first-out data buffer (FIFO) of FPGA, when FIFO storage data amount is greater than AAC encoding required The number of one frame, set the indicator signal 1 to high, otherwise set it to low; if the DSP detects that the indicator signal 1 is low, it will continue to detect, if it detects that the indicator signal 1 is high, then take a frame of data and encode ; After encoding, the DSP detects the FPGA terminal indication signal 2 (whether the FIFO storing the encoded data in the FPGA is half full), if it is high, it sends a long frame to the FPGA, if it is low, it sends a short frame to the FPGA, and caches it through the FIFO And the long and short frame mechanism ensures that the rate of the AAC encoded output stream is constant.
本发明一种AAC音频编码的握手协议方法,其具体步骤如下:A kind of handshake protocol method of AAC audio coding of the present invention, its concrete steps are as follows:
步骤1:step 1:
语音信号经模数转换芯片采集后,得到的PCM编码进入FPGA并存储在FPGA内的FIFO中,当FIFO内存储的数据达到AAC编码所需一帧的数量,将该FIFO对应的指示信号置为高;若FIFO内数据数量小于AAC编码所需的一帧数量,对应的指示信号被置为低。After the voice signal is collected by the analog-to-digital conversion chip, the obtained PCM code enters the FPGA and is stored in the FIFO in the FPGA. When the data stored in the FIFO reaches the number of one frame required by the AAC code, the corresponding indicator signal of the FIFO is set to High; if the amount of data in the FIFO is less than the number of frames required for AAC encoding, the corresponding indicator signal is set to low.
步骤2:Step 2:
DSP检测FPGA内存储待编码数据FIFO的指示信号1,指示信号1表征FPGA内存储编码后数据FIFO的数据数量,若该指示信号为低,则继续检测该信号;若该指示信号为高,从FIFO中取走一帧数据,然后DSP对该帧数据进行编码操作。DSP detects the indication signal 1 of storing the data FIFO to be encoded in the FPGA, and the indication signal 1 represents the data quantity of the data FIFO after encoding in the FPGA, if the indication signal is low, then continue to detect the signal; if the indication signal is high, from A frame of data is taken from the FIFO, and then the DSP encodes the frame of data.
步骤3:Step 3:
编码完成后,DSP检测FPGA的指示信号2,指示信号2表征FPGA内存储编码后数据FIFO的数据数量,若存储编码后数据FIFO内数据量大于FIFO容量的一半,则将指示信号2置为低;否则,将指示信号2置为高。DSP若检测到指示信号2为高,则向FPGA发送长帧数据,若检测到指示信号2为低,则向FPGA发送短帧数据。After the encoding is completed, the DSP detects the indication signal 2 of the FPGA. The indication signal 2 represents the data quantity of the FIFO storing the encoded data in the FPGA. If the data volume in the FIFO storing the encoded data is greater than half of the FIFO capacity, the indication signal 2 is set to low. ; Otherwise, set indicator signal 2 high. If the DSP detects that the indication signal 2 is high, it sends long-frame data to the FPGA, and if it detects that the indication signal 2 is low, it sends short-frame data to the FPGA.
步骤4:Step 4:
FPGA将存储在FIFO中的编码后的数据以恒定速率发送出去,DSP继续检测FPGA内存储待编码数据FIFO的指示信号。The FPGA sends the encoded data stored in the FIFO at a constant rate, and the DSP continues to detect the indication signal of the FIFO storing the data to be encoded in the FPGA.
本发明优点及功效在于:通过对数据流进行缓存,并通过握手机制使用长短帧保证输出码流速率恒定,适用于AAC音频编码的要求。The advantages and effects of the present invention are: by buffering the data stream and using long and short frames through the handshake mechanism to ensure the constant rate of the output code stream, it is suitable for the requirements of AAC audio coding.
(四)附图说明: (4) Description of drawings:
图1为本发明的硬件架构图。FIG. 1 is a hardware architecture diagram of the present invention.
图2为本发明的DSP的握手流程图。Fig. 2 is the handshake flowchart of DSP of the present invention.
(五)具体实施方法:(5) Specific implementation methods:
本发明的技术方案概括为:语音信号经模数转换芯片(AD)采样后进入FPGA,被缓存在FPGA的先入先出的数据缓存器(FIFO)中,当FIFO1存储数据量大于AAC编码所需的一帧数据,将指示信号1设置为高,否则置为低;DSP若检测到指示信号1为低,则继续检测,若检测到指示信号1为高,则取走一帧数据,进行编码;编码后,DSP检测FPGA端指示信号2(FIFO2是否达到半满),若为高,则向FPGA发送长帧,若为低,则发送短帧,通过FIFO缓存和长短帧机制保证AAC编码输出码流速率恒定。The technical scheme of the present invention is summarized as: speech signal enters FPGA after sampling by analog-to-digital conversion chip (AD), and is buffered in the first-in-first-out data buffer (FIFO) of FPGA, when FIFO1 storage data amount is greater than AAC encoding required For one frame of data, set the indicator signal 1 to high, otherwise set it to low; if the DSP detects that the indicator signal 1 is low, it will continue to detect, if it detects that the indicator signal 1 is high, it will take a frame of data and encode ;After encoding, the DSP detects the FPGA terminal indication signal 2 (whether FIFO2 is half full), if it is high, it sends a long frame to the FPGA, if it is low, it sends a short frame, and the AAC code output is guaranteed through the FIFO buffer and the long and short frame mechanism The stream rate is constant.
下面结合附图对本发明的技术方案作进一步的详细描述。主要步骤如下:The technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings. The main steps are as follows:
步骤1:step 1:
如图1所示,连接硬件设备。语音信号经AD采集后,得到的PCM(脉冲编码调制)编码进入FPGA并存储在FPGA内的FIFO1中。其中AD芯片采用TI公司的PCM4204,采样频率为44100Hz,工作在主模式,数据格式为I2S;FPGA采用Altera公司的CycloneEP1C12Q240C8;FIFO的深度为1024,宽度为32,存储的数据为16位PCM编码。当FIFO内存储的数据达到AAC编码所需一帧数量,将该FIFO对应的指示信号1置为高;若FIFO内数据数量小于AAC编码所需一帧数量,对应的指示信号被置为低。其中,AAC编码所需一帧数据为1024个采样点,16位PCM编码。As shown in Figure 1, connect hardware devices. After the voice signal is collected by AD, the obtained PCM (pulse code modulation) is coded into FPGA and stored in FIFO1 in FPGA. Among them, the AD chip adopts PCM4204 of TI Company, the sampling frequency is 44100Hz, works in the main mode, and the data format is I2S; the FPGA adopts CycloneEP1C12Q240C8 of Altera Company; the depth of FIFO is 1024, the width is 32, and the stored data is 16-bit PCM code. When the data stored in the FIFO reaches the number of one frame required by AAC encoding, the corresponding indicator signal 1 of the FIFO is set to high; if the amount of data in the FIFO is less than the number of one frame required by AAC encoding, the corresponding indicator signal is set to low. Among them, one frame of data required by AAC encoding is 1024 sampling points, and 16-bit PCM encoding.
步骤2:Step 2:
如图2上半部分所示,DSP检测FPGA内存储待编码数据FIFO1对应的指示信号1,若该指示信号为低,则继续检测该信号;若该指示信号为高,从FIFO中取走一帧数据,然后DSP对该帧数据进行编码操作。DSP采用TI公司的TMS320C6727,通过EMIF口(DSP的外部存储器接口)从FIFO1中读取数据。As shown in the upper part of Figure 2, the DSP detects the indication signal 1 corresponding to the FIFO1 storing the data to be encoded in the FPGA. If the indication signal is low, continue to detect the signal; if the indication signal is high, take a Frame data, and then DSP encodes the frame data. DSP adopts TMS320C6727 of TI Company, reads data from FIFO1 through EMIF mouth (DSP's external memory interface).
步骤3:Step 3:
如图2下半部分所示,编码完成后,DSP检测FPGA的指示信号2,该信号表征FPGA内存储编码后数据FIFO2的数据数量,若FIFO2内数据量大于FIFO容量的一半,则该信号置为低;否则,该信号置为高。DSP若检测到指示信号2为高,则向FPGA发送长帧编码后数据,若检测到该指示信号为低,则向FPGA发送短帧编码后数据。其中FPGA中FIFO2的深度为512,宽度为32位;DSP通过EMIF口向FIFO2中写入数据;长帧数据长度为372字节,短帧数据长度为360字节。通过缓冲机制和长短帧机制,保证FIFO2内始终缓存一定数量的数据,FIFO2不会出现空或满的情况。As shown in the lower part of Figure 2, after the encoding is completed, the DSP detects the indicating signal 2 of the FPGA. This signal represents the data quantity of the encoded data FIFO2 stored in the FPGA. If the amount of data in FIFO2 is greater than half of the FIFO capacity, the signal is set to is low; otherwise, the signal is set high. If the DSP detects that the indication signal 2 is high, it sends the long-frame encoded data to the FPGA, and if it detects that the indication signal is low, it sends the short-frame encoded data to the FPGA. Among them, the depth of FIFO2 in FPGA is 512, and the width is 32 bits; DSP writes data into FIFO2 through EMIF port; the length of long frame data is 372 bytes, and the length of short frame data is 360 bytes. Through the buffer mechanism and the long and short frame mechanism, it is guaranteed that a certain amount of data is always buffered in FIFO2, and FIFO2 will not appear empty or full.
步骤4:Step 4:
FPGA将存储在FIFO2中的编码后的数据以恒定速率发送出去,DSP继续检测FPGA的指示信号1。其中FPGA发送编码后的数据的速率为128kbps。由于FIFO2中始终缓存一定数量的数据,不会出现空或满的情况,可保证输出码流的速率恒定。FPGA sends out the coded data stored in FIFO2 at a constant rate, and DSP continues to detect the indicating signal 1 of FPGA. Among them, the rate at which the FPGA sends encoded data is 128kbps. Since a certain amount of data is always buffered in FIFO2, there will be no empty or full situation, which can ensure a constant output stream rate.
说明书附图中出现的英文缩写,其含义如下:The meanings of the English abbreviations appearing in the accompanying drawings of this manual are as follows:
PCM:脉冲编码调制;PCM: pulse code modulation;
FIFO:先入先出的数据缓存器;FIFO: first-in-first-out data buffer;
AD:模数转化芯片。AD: Analog-to-digital conversion chip.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010102745097A CN101930744B (en) | 2010-09-07 | 2010-09-07 | Handshake protocol method for AAC audio coding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010102745097A CN101930744B (en) | 2010-09-07 | 2010-09-07 | Handshake protocol method for AAC audio coding |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101930744A CN101930744A (en) | 2010-12-29 |
CN101930744B true CN101930744B (en) | 2012-06-06 |
Family
ID=43369877
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010102745097A Expired - Fee Related CN101930744B (en) | 2010-09-07 | 2010-09-07 | Handshake protocol method for AAC audio coding |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101930744B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102543023B (en) * | 2012-01-10 | 2014-04-02 | 硅谷数模半导体(北京)有限公司 | Receiving equipment and method, device and system for controlling video refreshing rate |
CN107295689B (en) * | 2016-04-13 | 2019-11-12 | 中兴通讯股份有限公司 | A kind of resource regulating method and device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07202820A (en) * | 1993-12-28 | 1995-08-04 | Matsushita Electric Ind Co Ltd | Bit rate control system |
KR960008470B1 (en) * | 1994-01-18 | 1996-06-26 | Daewoo Electronics Co Ltd | Apparatus for transferring bit stream data adaptively in the moving picture |
JP4003948B2 (en) * | 2002-10-07 | 2007-11-07 | 株式会社日立製作所 | Digital broadcast content transmission side device, reception side device, broadcast system, and broadcast method |
CN101287112B (en) * | 2008-06-03 | 2010-12-22 | 方春 | Optimizing method controlled by adaptive code rate |
-
2010
- 2010-09-07 CN CN2010102745097A patent/CN101930744B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN101930744A (en) | 2010-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102667924B (en) | Selectivity power is utilized to control the method and system of decoding to voice data | |
CN101217038B (en) | An encoding method of audio data SBC algorithm and Bluetooth stereo subsystem | |
US8589720B2 (en) | Synchronizing timing mismatch by data insertion | |
BRPI0906619B1 (en) | METHODS TO ENCODE MULTI-CHANNEL AUDIO, TO DECODE A LOSS-LESS VARIABLE BIT RATE MULTI-CHANNEL AUDIO STREAM, AND TO INITIATE DECODING A VARIABLE BIT-RATE MULTI-CHANNEL AUDIO BIT STREAM, ONE OR MORE COMPUTER READABLE MEDIA, A OR MORE SEMICONDUCTOR DEVICES, AND, MULTI-CHANNEL AUDIO DECODER | |
CN103795950A (en) | Television audio signal processing device | |
WO2022100414A1 (en) | Audio encoding and decoding method and apparatus | |
CN103346830A (en) | Voice transmission method and device based on Beidou satellite | |
CN101930744B (en) | Handshake protocol method for AAC audio coding | |
CN105321522A (en) | Audio data processing and transmitting method and device | |
CN111313984B (en) | Testing device and method for various audio codes of Bluetooth headset | |
TW200816655A (en) | Method and apparatus for an audio signal processing | |
CN103369365A (en) | Audio and video synchronous recording device | |
CN100590588C (en) | A conversion method and system from USB/PCIe to VGA/DVI | |
CN101645967B (en) | Mobile terminal for processing multimedia data in user-defined format and realization method thereof | |
CN110033780B (en) | Audio and video data transmission method based on FFmpeg and EMIF driver | |
CN102790671B (en) | ZigBee technology-based wireless full-duplex real-time voice transmission device and method | |
CN104050968B (en) | Embedded type audio acquisition terminal AAC audio coding method | |
CN103050123B (en) | A kind of method and system of transmitting voice information | |
CN101741391A (en) | Method of Optimizing Memory Space in MP3 Audio Decoding by Fixed-point DSP | |
CN103227802B (en) | Based on many metadata transmission methods of UDP/TCP agreement | |
CN102063906A (en) | AAC audio real-time decoding fault-tolerant control method | |
CN100458683C (en) | Audio-frequency inputting method and system | |
TWI265732B (en) | Digital video storage system and related method of storing digital video data | |
CN102969011B (en) | Based on real-time voice storage system and the storage means of DSP and USB | |
CN102665073B (en) | Device and method for forwarding SDI audio and video data |
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 | ||
C53 | Correction of patent for invention or patent application | ||
CB03 | Change of inventor or designer information |
Inventor after: Mao Xia Inventor after: Wang Qunyang Inventor after: Huang Ronglin Inventor after: Yang Hong Inventor after: Li Wei Inventor after: Zhao Jiming Inventor after: Chen Xiaoguang Inventor after: Xiong Songning Inventor after: Xue Yuli Inventor after: Hu Haiyong Inventor after: Chen Lijiang Inventor after: Wang Haitao Inventor after: Jiang Lei Inventor after: Diao Weihe Inventor after: Wu Xingyu Inventor before: Mao Xia Inventor before: Jiang Lei |
|
COR | Change of bibliographic data |
Free format text: CORRECT: INVENTOR; FROM: |
|
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120606 Termination date: 20120907 |