CN101986388A - MP3 intelligent error detection method - Google Patents

MP3 intelligent error detection method Download PDF

Info

Publication number
CN101986388A
CN101986388A CN2010102746403A CN201010274640A CN101986388A CN 101986388 A CN101986388 A CN 101986388A CN 2010102746403 A CN2010102746403 A CN 2010102746403A CN 201010274640 A CN201010274640 A CN 201010274640A CN 101986388 A CN101986388 A CN 101986388A
Authority
CN
China
Prior art keywords
frame
data
information
frame head
head
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.)
Pending
Application number
CN2010102746403A
Other languages
Chinese (zh)
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.)
Jianrong Integrated Circuit Technology Zhuhai Co Ltd
Original Assignee
Jianrong Integrated Circuit Technology Zhuhai 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 Jianrong Integrated Circuit Technology Zhuhai Co Ltd filed Critical Jianrong Integrated Circuit Technology Zhuhai Co Ltd
Priority to CN2010102746403A priority Critical patent/CN101986388A/en
Publication of CN101986388A publication Critical patent/CN101986388A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides an MP3 intelligent error detection method and a corresponding device, the method can judge whether an error occurs in the current frame or not in an intelligent manner by comparing detailed frame head information of continuous two frames of MP3 data, if the error occurs, the frame is skipped, if frame data is correct, MP3 decoding is carried out and audio data is outputted. The decoding of the certain frame of MP3 comprises the following steps: firstly analyzing the current frame head data, obtaining the frame head information, calculating the position of the next frame head data through the frame head information, reading the next frame head data, then analyzing the frame head information, and judging whether the current frame data can carry out the MP3 decoding or not by contrasting frame head identification information of the two frames. The method and the device can effectively detect the frames with the errors in an MP3 file, skip the frames, and realize the correct playing of the MP3.

Description

A kind of MP3 intelligence error-detecting method
Technical field
The present invention relates to a kind of MP3 intelligence error-detecting method.
Background technology
Along with popularizing of the growing and network of audio compression techniques, the audio file of MP3 (MPEG Audio Layer III) form with its ratio of compression height, total harmonic distortion is low and open good and obtain increasing widespread use.The general structure of mp3 file is made up of MP3 sign 3 (ID3tag) and frame data as shown in Figure 2, and wherein ID3 tag data are optional, and the voice data of mp3 file all is to export by after decoding by a series of Frame.Mp3 file is made up of the MP3 frame, and the reproduction time of each MP3 frame is fixed, but the size of data of MP3 frame is not necessarily fixing.Usually mp3 file divides two kinds: constant bit rate (CBR) and variable bit rate (VBR), and wherein CBR is the mp3 file of constant frame sign, each MP3 frame data size of forming CBR is identical; VBR is the mp3 file that becomes the frame data size, and the size of data of each MP3 frame of composition VBR is not necessarily identical.
Mp3 file is in decode procedure, if running into mistake is identified as the MP3 frame data with ID3tag and maybe will has the MP3 frame of corrupted data to carry out decodes and plays, will bring the noise of some error data frames, whether therefore correct identification MP3 frame is wrong is very useful, can skip the frame that voice data damages, play normal MP3 frame data.The MP3 frame of mp3 file comprises frame head information and frame voice data; wherein frame head information is made up of 32bit data+16bit bug check data as shown in Figure 3, and wherein 16bit bug check data are optional; when safeguard bit is 0, then there are not 16bit bug check data.
Patent ZL03103557.4 proposition is a kind of judges by the 16bit bug check whether the MP3 frame is correct; shown in the process flow diagram of Fig. 1; but there is not the mp3 file of 16bit bug check position for some; just do not have CRC protection mechanism position mp3 file its do not check; and directly will give the decoder decode outputting audio data; potentially like this send the erroneous frame data to the MP3 decoding device, decoding output noise data.Therefore for the mp3 file that does not have 16bit bug check position, need carry out the noise problem that error detection could avoid the MP3 frame data of decoding error to bring fully to its frame data equally.
Summary of the invention
Technical matters to be solved by this invention is to overcome the deficiencies in the prior art, propose a kind of intelligence when playing mp3 file and check the method for frame mistake, this method does not rely on the error-checking position of 16bit and checks data, but compare to judge whether discern current MP3 frame correct according to the frame head information of the Frame of mp3 file own, the noise problem of avoiding the MP3 frame data of decoding error to bring fully.
The technical solution adopted in the present invention is: the present invention's intelligence checks that the method for frame mistake may further comprise the steps:
(1) searches the frame synchronization head;
(2) resolve the frame head information of present frame, go out the position of next frame data and parse the frame head information of described next frame data according to the frame head information calculations;
(3) relatively whether present frame is consistent with the identifying information of described next frame data, and described identifying information is the fix information in the frame head information of each frame;
(4) if present frame is identical with the identifying information of described next frame data, then current frame data is carried out the MP3 decoding outputting audio data; Otherwise return step (1).
As shown in Figure 3; the information of frame head described in the said method is resolved in order and is followed successively by frame synchronization head, sign, audio layer, safeguard bit, bit rate index, sampling rate index, filler, privately owned position, pattern, mode expansion, copyright, original, reinforcement; if wherein the numerical value of safeguard bit is, then also comprise the error-checking position at 1 o'clock.
Further, the fix information in the described frame head information comprises frame synchronization head, sign, audio layer, safeguard bit and sampling rate.
Further, the step of calculating the position of next frame data in the described step (2) comprises: the length of at first calculating present frame, the present frame address adds that the length of present frame is the position of next frame data, and the length of described present frame rounds for the value to (144 * bit rate/sampling rate)+filling place value gained.
The invention has the beneficial effects as follows:, promptly when safeguard bit is 0, then do not have the bug check data because the error-checking position in the frame head information of mp3 file Frame is optionally; If carry out error detection decoding output according to the CRC protection mechanism; this kind situation can directly be given the decoder decode outputting audio data; form noise data; and the present invention has overcome this defective fully; utilize the frame head information of Frame own that two frame data are compared; judge the correctness of current data frame, and then give the decoder decode outputting audio data or skip, the noise problem of avoiding the MP3 frame data decoding to mistake to be brought.
Description of drawings
Fig. 1 is the process flow diagram of the related method of patent ZL03103557.4 in the background technology;
Fig. 2 is the structural drawing of mp3 file;
Fig. 3 is the frame head information of MP3 and shared bit number structural drawing;
Fig. 4 is the process flow diagram of MP3 intelligence error-detecting method of the present invention.
Embodiment
Please refer to Fig. 4, Fig. 4 is a particular flow sheet of the present invention.
Step 401 is searched the frame synchronization head; The frame synchronization head of MP3 is made up of 12 bits, and it is bit+1 bit (MPEG version) of 1 continuously that these 12 bits can be divided into 11 again.The frame synchronization head of MP3 aligns by byte, therefore whether first byte that compares in the MP3 data stream earlier in search procedure is 0xFF, whether equal then more next byte has continuous 3 is 1 bit, if have then think that the present frame synchronous head finds, otherwise after taking byte of MP3 data stream away, continuing to search current byte is 0xFF, and next byte comprises the synchronous head information of 3 continuous bits 1, till finding synchronous head or mp3 file finish to withdraw from decoding.
Step 402; resolve the present frame header, carry out data parsing, resolve the 32bit data in order according to the frame head information table of Fig. 2; wherein 12bit is the frame synchronization head; 1bit is sign, and 2bit is an audio layer, and 1bit is a safeguard bit; 4bit is the bit rate index; 2bit is the sampling rate index, and 1bit is a filler, and 1bit is privately owned position; 2bit is a pattern; 2bit is a mode expansion, and 1bit is a copyright, and 1bit is original; 1bit is for strengthening; if wherein the numerical value of safeguard bit is, then get the error-checking position of 16bit, otherwise the frame head information analysis finishes at 1 o'clock.
Step 403 is calculated next frame head position, calculates the bit rate that next frame head position need obtain present frame, the filling place value that sampling rate and step 402 are obtained.After the frame head information that is resolved to according to step 402, obtain bit rate by looking into the bit rate concordance list, the corresponding relation such as the following table of MP3 frame bit rate index and bit rate:
Value Bit rate
0001 32kbps
0010 42kbps
0011 48kbps
0100 56kbps
0101 64kbps
0110 80kbps
0111 96kbps
1000 112kbps
1001 128kbps
1010 160kbps
1011 192kbps
1100 224kbps
1101 256kbps
1110 320kbps
After determining the bit rate of described present frame, also need to obtain the sampling rate of present frame, according to the sampling rate index value, by MP3 frame sampling rate index and sampling rate mapping table:
Value Bit rate
00 44100Hz
01 48000Hz
10 32000Hz
Determine sampling rate.
According to bit rate, sampling rate, and the filler information in the frame head information that step 402 was resolved to, according to relation:
Frame length=round ((144 * bit rate/sampling rate)+filling place value)
Calculate the size of described present frame, after obtaining the present frame size, the present frame address adds the position that current frame length can calculate next frame.
Step 404 is resolved the next frame header, and the Data Position of the next frame that calculates according to step 403 finds the Data Position of next frame and reads the data of next frame.Obtain after the data similarly, mainly resolve the next frame header and preserve, be used for the comparison of step 405 with step 402.
Step 405, whether present frame is consistent with next frame head identifying information, be to resolve two frame informations that obtain according to step 402 and step 404 to compare herein, for a mp3 file, it is to immobilize that the frame head information of its each frame has some, whether the data of discerning this two continuous frames by these fix informations of comparison are correct, can carry out the MP3 decoding outputting audio data.Intrinsic frame head information has synchronous head, sign, audio layer, safeguard bit, sampling rate; Therefore the identifying information of the frame synchronous head of frame just, frame identification, frame audio layer, frame safeguard bit, frame sampling rate.Relatively the identifying information of present frame equates with the identifying information of next frame, thinks that then current frame data does not have mistake, can carry out the MP3 decoding outputting audio data; If identifying information is unequal, then jump to the synchronous head that step 401 is searched frame again.
Step 406, the MP3 decoding outputting audio data, the MP3 frame data after receiving step 405 is judged through error detection herein, the MP3 frame data of this moment are can be by the correct voice data of output after the MP3 decoding.

Claims (3)

1. MP3 intelligence error-detecting method, whether the Frame of judging MP3 is made mistakes and correct Frame is carried out the MP3 decoding outputting audio data, it is characterized in that, may further comprise the steps:
(1) searches the frame synchronization head;
(2) resolve the frame head information of present frame, go out the position of next frame data and parse the frame head information of described next frame data according to the frame head information calculations;
(3) relatively whether present frame is consistent with the identifying information of described next frame data, and described identifying information is the fix information in the frame head information of each frame;
(4) if present frame is identical with the identifying information of described next frame data, then current frame data is carried out the MP3 decoding outputting audio data; Otherwise return step (1).
2. a kind of MP3 intelligence error-detecting method according to claim 1 is characterized in that the fix information in the described frame head information comprises frame synchronization head, sign, audio layer, safeguard bit and sampling rate.
3. a kind of MP3 intelligence error-detecting method according to claim 1, it is characterized in that, the step of calculating the position of next frame data in the described step (2) comprises: the length of at first calculating present frame, the present frame address adds that the length of present frame is the position of next frame data, and the length of described present frame rounds for the value to (144 * bit rate/sampling rate)+filling place value gained.
CN2010102746403A 2010-09-06 2010-09-06 MP3 intelligent error detection method Pending CN101986388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102746403A CN101986388A (en) 2010-09-06 2010-09-06 MP3 intelligent error detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102746403A CN101986388A (en) 2010-09-06 2010-09-06 MP3 intelligent error detection method

Publications (1)

Publication Number Publication Date
CN101986388A true CN101986388A (en) 2011-03-16

Family

ID=43710731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102746403A Pending CN101986388A (en) 2010-09-06 2010-09-06 MP3 intelligent error detection method

Country Status (1)

Country Link
CN (1) CN101986388A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517027A (en) * 2012-06-29 2014-01-15 联想(北京)有限公司 Video data processing method and electronic equipment
CN104835500A (en) * 2015-04-10 2015-08-12 广东欧珀移动通信有限公司 Method and device for acquiring audio information
CN105931656A (en) * 2016-04-14 2016-09-07 青岛海信移动通信技术股份有限公司 Audio editing method and device
CN110149171A (en) * 2019-06-25 2019-08-20 昆腾微电子股份有限公司 A kind of sending method, method of reseptance and the device of wireless audio data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1467635A (en) * 2002-06-21 2004-01-14 ӡ�����Ƽ��ɷ����޹�˾ Intelligent mp3 error checking method and mechanism
CN101030381A (en) * 2007-03-19 2007-09-05 北京中星微电子有限公司 Method and apparatus for extracting MP3 file sampling rate
CN101547369A (en) * 2008-03-26 2009-09-30 盛大计算机(上海)有限公司 Fault tolerance method for removing mosaic phenomenon in playing network video

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1467635A (en) * 2002-06-21 2004-01-14 ӡ�����Ƽ��ɷ����޹�˾ Intelligent mp3 error checking method and mechanism
CN101030381A (en) * 2007-03-19 2007-09-05 北京中星微电子有限公司 Method and apparatus for extracting MP3 file sampling rate
CN101547369A (en) * 2008-03-26 2009-09-30 盛大计算机(上海)有限公司 Fault tolerance method for removing mosaic phenomenon in playing network video

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517027A (en) * 2012-06-29 2014-01-15 联想(北京)有限公司 Video data processing method and electronic equipment
CN103517027B (en) * 2012-06-29 2017-05-24 联想(北京)有限公司 Video data processing method and electronic equipment
CN104835500A (en) * 2015-04-10 2015-08-12 广东欧珀移动通信有限公司 Method and device for acquiring audio information
CN104835500B (en) * 2015-04-10 2018-07-06 广东欧珀移动通信有限公司 The method and its device that a kind of audio-frequency information obtains
CN105931656A (en) * 2016-04-14 2016-09-07 青岛海信移动通信技术股份有限公司 Audio editing method and device
CN105931656B (en) * 2016-04-14 2019-07-05 青岛海信移动通信技术股份有限公司 A kind of method and device of audio clips
CN110149171A (en) * 2019-06-25 2019-08-20 昆腾微电子股份有限公司 A kind of sending method, method of reseptance and the device of wireless audio data
CN110149171B (en) * 2019-06-25 2022-04-26 昆腾微电子股份有限公司 Wireless audio data sending method, receiving method and device

Similar Documents

Publication Publication Date Title
US8121830B2 (en) Methods and apparatus to extract data encoded in media content
CN101221760B (en) Audio matching method and system
TWI745862B (en) Audio transmitter processor, audio receiver processor and related methods and computer programs
CN101986388A (en) MP3 intelligent error detection method
JP4053424B2 (en) Robust checksum
RU2010144057A (en) MASKING A TRANSFER ERROR IN A DIGITAL AUDIO SIGNAL IN THE HIERARCHICAL DECODING STRUCTURE
BRPI9904776B1 (en) Process of decoding an audio signal with correction of transmission errors
CN102047336B (en) Method and apparatus for generating or cutting or changing a frame based bit stream format file including at least one header section, and a corresponding data structure
CN101675473B (en) Method and apparatus for processing encoded audio data
CN103546239A (en) Blind test system and blind test method for LTE (long term evolution) downlink control channel
CN103269257B (en) A kind of method detecting variable-length encoding code stream mistake and decoding and error detector element
US10943573B2 (en) Audio output monitoring for failure detection of warning sound playback
CN102857833B (en) Audio decoding system and method adapted to android stagefright multimedia framework
EP2242048B1 (en) Method and apparatus for identifying frame type
US6959411B2 (en) Intelligent error checking method and mechanism
CN111726125A (en) Error-containing concatenated code identification method based on template matching
US20080226006A1 (en) Data player and data play method
US20110022399A1 (en) Auto Detection Method for Frame Header
US8577672B2 (en) Audible errors detection and prevention for speech decoding, audible errors concealing
CN100366034C (en) Blind transmission format detecting method suitable for broad band CDMA system
CN102238393A (en) Method and device for resynchronizing audio code streams
CN109558509B (en) Method and device for searching advertisements in broadcast audio
US20040261005A1 (en) Algorithm for a memory-based Viterbi decoder
CN108389582A (en) MPEG-2/4AAC audio decoders error detection and processing method
CN101626242B (en) Improved Huffman decoding method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110316