[go: up one dir, main page]

CN101217660B - A kind of audio and video decoding method - Google Patents

A kind of audio and video decoding method Download PDF

Info

Publication number
CN101217660B
CN101217660B CN 200710116509 CN200710116509A CN101217660B CN 101217660 B CN101217660 B CN 101217660B CN 200710116509 CN200710116509 CN 200710116509 CN 200710116509 A CN200710116509 A CN 200710116509A CN 101217660 B CN101217660 B CN 101217660B
Authority
CN
China
Prior art keywords
byte
start code
value
current
code prefix
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
Application number
CN 200710116509
Other languages
Chinese (zh)
Other versions
CN101217660A (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.)
Hisense Group Co Ltd
Original Assignee
Hisense Group 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 Hisense Group Co Ltd filed Critical Hisense Group Co Ltd
Priority to CN 200710116509 priority Critical patent/CN101217660B/en
Publication of CN101217660A publication Critical patent/CN101217660A/en
Application granted granted Critical
Publication of CN101217660B publication Critical patent/CN101217660B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

本发明公开了一种音视频解码方法,以解决现有音视频解码技术中寻找起始码操作耗时大的问题。本发明根据起始码由N个字节的起始码前缀加上起始码值构成以及起始码前缀的特点,将传统的逐字节判断起始码前缀改为以N个字节为周期对音视频流进行搜索判断,实现对起始码前缀的寻找,从而大大加快了寻找起始码的速度。具体实现方法包括下述步骤:a、以N个字节为周期,判断当前字节值的大小;b、如果当前字节值属于集合Q,则进入具体的起始码前缀的判断过程;否则转入下一周期N个字节的判断过程。其中,集合Q为所述起始码前缀各字节所有取值的集合。该起始码寻找方法减少了读取片外存储器数据的操作耗时,提高了音视频流中信息获取的效率。

Figure 200710116509

The invention discloses an audio and video decoding method to solve the time-consuming problem of searching for a start code in the existing audio and video decoding technology. According to the characteristics that the start code is composed of the start code prefix of N bytes plus the start code value and the start code prefix, the present invention changes the traditional byte-by-byte judgment of the start code prefix to N bytes. Periodically search and judge the audio and video streams to realize the search for the prefix of the start code, thus greatly speeding up the search for the start code. The specific implementation method comprises the following steps: a, taking N bytes as a period, judging the size of the current byte value; b, if the current byte value belongs to the set Q, then enter the judgment process of the specific start code prefix; otherwise Turn to the judgment process of N bytes in the next cycle. Wherein, the set Q is a set of all values of each byte of the start code prefix. The method for finding the start code reduces the time-consuming operation of reading the data of the off-chip memory, and improves the efficiency of information acquisition in audio and video streams.

Figure 200710116509

Description

A kind of video/audio decoding method
Technical field
The invention belongs to digital audio/video encoding and decoding technique field, specifically, relate to a kind of video/audio decoding method of in decode procedure, seeking initial code fast.
Background technology
H.264, advanced video encoding at digital audio/video encoding and decoding technique standard A VS, general audio-visual service reaches in the video encoding and decoding standards such as the MPEG of dynamic image expert group, its video flowing structural group Chengdu is a video sequence (being also referred to as image sequence), as shown in Figure 1.Many width of cloth images are wherein arranged, a plurality of bands are arranged in piece image, in sequence, also have some extend informations.In the process of decoding, need segmentation to obtain the each several part relevant information, and initial code is a sign that separates each message segment.Seek relevant initial code during audio/video decoding earlier, read information needed then,, just reach a new initial code up to the information tail.And initial code normally adds that by start code prefix initial code value constitutes, and all is to adopt the start code prefix 0x000001 of one three byte to add that the initial code value of a byte constitutes such as initial code common in present Audio Video coding Standard.Like this, seek the initial code problem and just be converted into the problem of seeking start code prefix.
As mentioned above, AVS, the audio/video flow that H.264 reaches MPEG are cut apart each segment information with initial code, before the decoding, must first segmentation read information needed.Traditional method is byte-by-bytely to judge, sees whether a current byte and a back N-1 byte thereof have formed start code prefix.After finding start code prefix, read the initial code value of the byte in start code prefix back again, just obtained corresponding initial code.But because the image frame data amount is big, internal memory is limited in the sheet of embedded system, and deposit data is sought initial code and also operated on chip external memory on chip external memory, and speed is slower, and the method for byte-by-byte judgement initial code is consuming time bigger.When decoded portion optimization is good, seek the bottleneck that initial code can become decode procedure.
Summary of the invention
The present invention is directed to and seek initial code operation bigger technical problem consuming time in the prior art in the audio/video decoding course, a kind of video/audio decoding method that can seek initial code fast is provided, improved speed that information is obtained in the audio/video flow and efficient effectively.
For solving the problems of the technologies described above, the present invention is achieved by the following technical solutions:
A kind of video/audio decoding method, comprise the process of seeking initial code, described initial code adds that by the start code prefix of N byte initial code value constitutes, the set of each all value of byte of described start code prefix is Q, described N is a natural number, it is characterized in that the process of described searching initial code is to be the cycle audio/video flow to be searched for judgement with N byte, to seek the process of start code prefix.
Specifically, in the process of described searching initial code, may further comprise the steps:
A, be the cycle, judge the size of current byte value with N byte;
If the current byte value of b belongs to set Q, then enter the deterministic process of concrete start code prefix; Otherwise change the deterministic process of N of a following one-period byte over to.
Wherein, in described concrete start code prefix deterministic process, comprise following spreadability deterministic process:
B1, internal blas amount k of definition, the initial value of k is 1;
B2, judge whether have at least to belong to a set Q in N-k byte value of k byte value in current byte front and current byte back, if, execution in step b3 then; Otherwise, change the deterministic process of N of a following one-period byte over to;
B3, internal blas amount k value add 1;
B4, whether judge the k value less than N, if go to step b2; Otherwise, carry out the process of byte-by-byte judgement start code prefix.
Further, the described byte-by-byte process of judging start code prefix comprises whether continuously arranged N byte value that N byte-by-byte judgement comprises current byte equals the value of a start code prefix corresponding N byte respectively, if once byte-by-byte judgement is set up, judge that then comprising current byte constitutes start code prefix interior N byte; If all N time byte-by-byte judgement all is false, judge that then comprising current byte does not constitute start code prefix in an interior continuously arranged N byte.Because constituting N byte of start code prefix may be from current byte, also may be certain byte of front or certain byte of its back from current byte,, guarantee all possible situation is all judged so need byte-by-byte judgement N time.When carrying out byte-by-byte judgement, at first determine to constitute in the buffering area position of N byte of start code prefix, respectively this N byte value is compared with N byte of known start code prefix in order then, be first byte value in N the byte in the buffering area and first byte value comparison of known start code prefix, second byte value comparison of second byte value in N the byte in the buffering area and known start code prefix, until comparison to last byte value.
Further, described start code prefix comprises three bytes, is specially 0x000001; Be in the process of the cycle start code prefix being judged with three bytes, if current byte value smaller or equal to 1, then enters concrete start code prefix deterministic process; Otherwise three bytes that change following one-period over to are judged.
Start code prefix is under the situation of three bytes, comprises the steps: in concrete start code prefix deterministic process
Whether have a byte value at least smaller or equal to 1 in second byte in back of c1, first byte of front of judging current byte and current byte, if, execution in step c2; Otherwise three bytes that change following one-period over to are judged;
C2: judge in first byte of back of second byte in front of current byte and current byte whether have a byte value at least, if carry out the process of byte-by-byte judgement start code prefix smaller or equal to 1; Otherwise three bytes that change following one-period over to are judged.
Further again, in the process of the byte-by-byte judgement start code prefix of described step c1, comprise the judgement of three kinds of conditions: judge that whether start code prefix is from current byte; Judge that start code prefix is whether from first byte of front of current byte; Judge that start code prefix is whether from second byte in front of current byte.
Described start code prefix from the condition that current byte begins to satisfy is: current byte value is 0, and first byte value of the back of current byte is 0, and second byte value in the back of current byte is 1; Described start code prefix from the condition that first byte of front of current byte begins to satisfy is: current byte value is 0, and first byte value of the front of current byte is 0, and first byte value of the back of current byte is 1; Described start code prefix from the condition that second byte in front of current byte begins to satisfy is: current byte value is 1, and first byte value of the front of current byte is 0, and second byte value in the front of current byte is 0.
Further again, further comprising the steps of before described step a:
A1, in buffering area, determine two pointers: read pointer R and write pointer W, R points to current reading location, and W points to writing position;
A2, whether judge read pointer R less than W-N, if, execution in step a then; Otherwise, wait for that transfer of data is to buffering area.
Further again, in the process of described byte-by-byte judgement start code prefix, if comprising current byte does not constitute start code prefix in an interior continuously arranged N byte, then read pointer R adds N, and is back to step a2.
Preferably, above-mentioned video/audio decoding method be preferably applied to AVS, H.264 or in the audio/video decoding course such as MPEG.
Compared with prior art, advantage of the present invention and good effect are: audio/video decoding course of the present invention, when in buffering area, seeking initial code, the lower characteristics of ratio appear in the compositing characteristic and the initial code that have made full use of start code prefix in audio/video flow, the byte number N that byte-by-byte judgement start code prefix in the prior art is changed into start code prefix judges (N is a natural number) cycle, thereby greatly reduced and judged and to read the operation of chip external memory data consuming time, improve the matching problem of decoding speed in outer start code prefix recognition speed of sheet and the sheet, effectively improved speed that information is obtained in the audio/video flow and efficient.
Description of drawings
Fig. 1 is a video flowing structure composition diagram;
Fig. 2 is a video/audio decoding method basic principle schematic of the present invention;
Fig. 3 is a main program flow chart of seeking initial code in the video/audio decoding method proposed by the invention fast;
Fig. 4 is the subroutine flow chart of byte-by-byte searching start code prefix among Fig. 3;
Fig. 5 is the main program flow chart that start code prefix is sought initial code when being three bytes fast;
Fig. 6 is the subroutine flow chart of byte-by-byte searching start code prefix among Fig. 5.
Embodiment
Below in conjunction with accompanying drawing embodiments of the present invention are described in further detail.
At first, analyzing basic principle of the present invention, for the purpose of sake of clarity, is that example is specifically addressed with the start code prefix 0x000001 of three bytes.
Referring to Fig. 2, the scope that no symbol-byte can be expressed is from 0 to 255, and the start code prefix 0x000001 of three bytes only gets 0 and 1 by its value of byte, and promptly the set Q of each all value of byte of start code prefix is 0 and 1.With regard to ordinary circumstance, the probability that start code prefix occurs is 1/128.With three bytes is the cycle to seek start code prefix, if current byte value is less than or equal to 1, just enters concrete initial code and judges, otherwise skip to back three bytes.Like this, under 127/128 probability situation, save the time of judging, improved the matching problem of decoding speed in outer start code prefix recognition speed of sheet and the sheet.Analyze the situation of three judgement start code prefix 0x000001, R represents current byte location among Fig. 2, R-1 and R-2 represent second byte of first byte of current byte front and front respectively, and R+1 and R+2 represent second byte of first byte of current byte back and back respectively.The value that has all comprised current reading location R place under three kinds of estimate of situations if the value of reading location is not 0 or 1, does not promptly belong to set Q, can determine that immediately these three kinds of situations can not constitute start code prefix.So just can enter in the next judgement, and save the operation of reading the sheet external memory greatly with the fastest speed.Other byte can not play such effect separately, needs per two bytes to cooperate, and plays same effect.As R-2 among the figure and R+1, and R-1 and R+2.If the byte value of R-2 and R+1 is not 0 or 1, promptly not in set Q, can determine that these three kinds of situations can not constitute start code prefix yet.Byte for R-1 and R+2 is also similarly judged.Promptly increase following determining step: whether the byte value of judging R-1 and R+2 all greater than 1, if then skip to three bytes of following one-period; Otherwise whether the byte value of judging R-2 and R+1 all greater than 1, if then skip to three bytes of following one-period; Otherwise, enter concrete initial code and judge.The byte value of R-1 or R+2 has one, and to be less than or equal to 1 probability be 2/256+2/256, just 1/64; Equally, the byte value of R-2 or R+1 has one, and to be less than or equal to 1 probability also be 1/64, thereby the probability that enters concrete start code prefix deterministic process is (1/128) * (1/64) * (1/64), and is very low, so just further improved the efficient of identification initial code.
When utilizing algorithm of the present invention to seek initial code, main purpose is to find start code prefix.At first in buffering area, determine two pointers: read pointer R and write pointer W, R points to current reading location, and W points to writing position.Described start code prefix is a N byte, and N is a natural number; The set of forming each all value of byte of start code prefix is Q; Definition buf is the audio-video code stream buffering area, buf[R] the interior read pointer R byte value pointed of expression buffering area; Definition startcode is a start code prefix, startcode[i] expression N byte start code prefix in i byte value.The main program flow chart of seeking fast initial code in the video/audio decoding method proposed by the invention as shown in Figure 3, concrete steps are as follows:
Step S301: program begins.
Step S302: the stand by tone video stream data is transferred in the buffering area.
Step S303: whether judge read pointer R less than W-N, judge that promptly whether byte number is greater than N in the buffering area.If byte number is not more than N in the buffering area, goes to step S 302 and continue to wait for transfer of data; Otherwise continuing to carry out, program judges.Because initial code is made up of the start code prefix of N byte and the initial code value of several bytes,, can not constitute initial code if having only the N byte in the buffering area.
Step S304: the value buf[R that judges the current byte that read pointer R is pointed] whether belong to set Q, if belong to, continue execution in step S305; Otherwise go to step S312.
Step S305: define an internal blas amount k, and tax k value is 1.
Step S 306: the value buf[R-k that judges k the byte in current byte front] with the value buf[R+N-k of N-k the byte in current byte back] in whether have at least one to belong to and gather Q, if, execution in step S307; Otherwise go to step S312.
Step S307: internal blas amount k value adds 1.
Step S308: whether judge the k value less than N, if go to step S306; Otherwise, execution in step S309.
Step S309: byte-by-byte searching start code prefix.
Step S310: judge whether to search out start code prefix, if find start code prefix, execution in step S311; Otherwise, go to step S312.
Step S311: handle initial code, go to step S313 then.
Step S312: read pointer R adds N, is back to step S303.
Step S313: main program finishes.
Said process is for seeking a cyclic process of initial code, and in the actual application, the data of depositing in the buffering area may comprise multistage information, thereby have a plurality of initial codes.After searching out an initial code, can continue in buffering area, to carry out above-mentioned steps, to search out the initial code that all exist.
The process of the byte-by-byte searching start code prefix of above-mentioned steps S309 comprises that byte-by-byte judgement comprises the process whether continuously arranged N of a current byte byte value equals N byte value of start code prefix respectively.Concrete execution in step is shown in the subroutine flow chart of the byte-by-byte searching start code prefix of Fig. 4:
Step S401: the subprogram flow process begins.
Step S402: define an internal blas amount j, and initialize is N.
Step S403: define a cyclic variable i, the i initial value is 1.
Step S404: the value buf[R-j+i that judges (R-j+i) individual byte] whether with the start code prefix of N byte in i byte value startcode[i] equate, if, execution in step S405 then; Otherwise go to step S408.
Step S405: cyclic variable i value adds 1.
Step S406: whether judge i smaller or equal to N, if, go to step S404, proceed the judgement of byte value; Otherwise, go to step S407.
Step S407: search out start code prefix, go to step S411.
Step S408: internal blas amount j value subtracts 1.
Step S409: whether judge the j value more than or equal to 1,, go to step S403 if more than or equal to 1; Otherwise, execution in step S410.
Step S410: judge not search out start code prefix, go to step S411.
Step S411: the subprogram flow process finishes.
Described respectively above under the situation that start code prefix is made of N byte, how to have realized seeking fast in the video/audio decoding method of the present invention the flow process of initial code.Common initial code all is to adopt the start code prefix 0x000001 of one three byte to add that the initial code value of a byte constitutes in the present Audio Video coding Standard, for this reason, in conjunction with Fig. 5 and Fig. 6, introduce in detail when start code prefix is made of three byte 0x000001, realize that the present invention seeks the flow process of initial code fast.
Figure 5 shows that the main program flow chart of seeking initial code when start code prefix is three bytes fast, concrete steps are as follows:
Step S501: program begins.
Step S502: the stand by tone video stream data is transferred in the buffering area.
Step S503: whether judge read pointer R less than W-3, judge that promptly whether byte number is greater than 3 in the buffering area.If byte number is not more than 3 in the buffering area, goes to step S502 and continue to wait for transfer of data; Otherwise continuing to carry out, program judges.Because initial code is made up of the start code prefix of 3 bytes and the initial code value of a byte,, can not constitute initial code if having only 3 bytes in the buffering area.
Step S504: the value buf[R that judges the current byte that read pointer R is pointed] whether smaller or equal to 1,, continue execution in step S505 if smaller or equal to 1; Otherwise go to step S510.Because start code prefix is 0x000001, the set Q of each all value of byte is 0 and 1, whether can determine whether to belong to set Q smaller or equal to 1 so judge byte value.
Step S505: the value buf[R-1 that judges first byte of current byte front] with the value buf[R+2 of second byte in current byte back] in whether have one at least smaller or equal to 1, if, execution in step S506; Otherwise go to step S510.
Step S506: the value buf[R-2 that judges second byte in current byte front] with the value buf[R+1 of first byte of current byte back] in whether have one at least smaller or equal to 1, if, execution in step S507; Otherwise go to step S510.
Step S507: three byte-by-byte searching start code prefix 0x000001.
Step S508: judge whether to search out start code prefix 0x000001, if find start code prefix, execution in step S509; Otherwise, go to step S510.
Step S509: handle initial code, and go to step S511.
Step S510: read pointer R adds 3, is back to step S503.
Step S511: main program finishes.
Can have three kinds of situations during above-mentioned byte-by-byte searching start code prefix: start code prefix is three bytes that begin from current byte; Start code prefix is three bytes that first byte of front from current byte begins; Start code prefix is three bytes that second byte in front from current byte begins.Need carry out the judgement of three kinds of situations one by one.The concrete subprogram flow process of judging start code prefix as shown in Figure 6, its step is as follows:
Step S601: subprogram begins.
Step S602: judge current byte value buf[R] whether be 0, if be 0, illustrate that initial code may be from current byte, perhaps from byte in front of current byte, go to step S603 and continue to judge; If be not 0, illustrate that current byte value is 1, then initial code can only be second byte in front from current byte, goes to step S609 then and further judges.
Step S603: back first byte value buf[R+1 that judges whether current byte] whether be 0, if be 0, illustrate that start code prefix can only be from current byte, goes to step S604 then and further judges; If be not 0, illustrate that start code prefix can only be first byte of front from current byte, and then go to step S606 and further judge.
Step S604: second the byte value buf[R+2 in back that judges current byte] whether be 1, if 1, then the decidable start code prefix is made up of continuous three bytes that current byte R begins; If be not 1, judge that then comprising current byte does not constitute start code prefix in three interior bytes, goes to step S612.
Step S605: judge that start code prefix from current byte R, goes to the step S509 of main program shown in Figure 5.
Step S606: back first byte value buf[R+1 that judges current byte] whether be 1, if be 1, go to step S607 and further judge; If be not 1, judge that then comprising current byte does not constitute start code prefix in three interior bytes, goes to step S612.
Step S607: front first byte value buf[R-1 that judges current byte] whether be 0, if 0, then the decidable start code prefix is made up of continuous three bytes that current byte front first byte R-1 begins; If be not 1, judge that then comprising current byte does not constitute start code prefix in three interior bytes, goes to step S612.
Step S608: judge that start code prefix from current byte front first byte R-1, goes to the step S509 of main program shown in Figure 5.
Step S609: front first byte value buf[R-1 that judges current byte] whether be 0, if 0, go to step S610 and proceed to judge; Otherwise go to step S612.
Step S610: second the byte value buf[R-2 in front that judges current byte] whether be 0, if 0, go to step S611; Otherwise go to step S612.
Step S611: judge that start code prefix from second the byte R-2 in current byte front, goes to the step S509 of main program shown in Figure 5.
Step S612: do not find start code prefix 0x000001, go to the step S510 of main program shown in Figure 5, continue the judgement of back byte and seek.
Certainly, it is the situation that unit constitutes initial code that the method for above-mentioned quick searching start code prefix is not limited to the byte, also goes for constituting with other units such as position or words the situation of initial code.
Should be understood that; above-mentioned explanation is not to be limitation of the present invention; the present invention also is not limited in above-mentioned giving an example, and modification, distortion, interpolation or replacement that those skilled in the art are made in essential scope of the present invention also should belong to protection scope of the present invention.

Claims (8)

1.一种音视频解码方法,包括寻找起始码的过程,所述起始码由N个字节的起始码前缀上起始码值构成,所述起始码前缀各字节所有取值的集合为Q,所述N为自然数,其特征在于,所述寻找起始码的过程是以N个字节为周期对音视频流进行搜索判断,以寻找起始码前缀的过程;所述寻找起始码的过程具体包括以下步骤:1. a kind of audio-video decoding method, comprise the process of looking for start code, described start code is made of start code value on the start code prefix of N bytes, and each byte of described start code prefix all takes The set of values is Q, and the N is a natural number, and it is characterized in that, the process of searching for the start code is to search and judge the audio and video stream with N bytes as a period, so as to find the process of the start code prefix; The process of finding the start code specifically includes the following steps: a、以N个字节为周期,判断当前字节值的大小;a. Take N bytes as the cycle to determine the size of the current byte value; b、如果当前字节值属于集合Q,则进入具体的起始码前缀的判断过程;否则转入下一周期N个字节的判断过程;b. If the current byte value belongs to the set Q, then enter the judgment process of the specific start code prefix; otherwise, transfer to the judgment process of N bytes in the next cycle; 在所述具体的起始码前缀判断过程中包括下述覆盖性判断过程:The following coverage judgment process is included in the specific start code prefix judgment process: b1、定义一个内部偏移量k,k的初值为1;b1, define an internal offset k, the initial value of k is 1; b2、判断当前字节前面第k个字节值与当前字节后面第N-k个字节值中是否至少有一个属于集合Q,若是,则执行步骤b3;否则,转入下一周期N个字节的判断过程;b2. Determine whether at least one of the kth byte value in front of the current byte and the N-kth byte value after the current byte belongs to the set Q, if so, execute step b3; otherwise, go to the next cycle of N characters Section judgment process; b3、内部偏移量k值加1;b3. Add 1 to the value of internal offset k; b4、判断k值是否小于N,若是,转至步骤b2;否则,执行逐字节判断起始码前缀的过程。b4. Determine whether the value of k is less than N, if so, go to step b2; otherwise, execute the process of determining the prefix of the start code byte by byte. 2.根据权利要求1所述的音视频解码方法,其特征在于,所述逐字节判断起始码前缀的过程包括N次逐字节判断包含当前字节在内的连续排列的N个字节值是否分别等于起始码前缀相应的N个字节的值,若有一次逐字节判断成立,则判定包含当前字节在内的N个字节构成起始码前缀;若所有N次逐字节判断都不成立,则判定包含当前字节在内连续排列的N个字节不构成起始码前缀。2. The audio and video decoding method according to claim 1, wherein the process of judging the start code prefix byte by byte includes N times of judging the consecutively arranged N words including the current byte byte by byte. Whether the section value is equal to the value of the N bytes corresponding to the start code prefix, if there is a byte-by-byte judgment, it is determined that N bytes including the current byte constitute the start code prefix; if all N times If the byte-by-byte judgment is not valid, then it is judged that the N bytes consecutively arranged including the current byte do not constitute the prefix of the start code. 3.根据权利要求2所述的音视频解码方法,其特征在于,所述起始码前缀包括三个字节,具体为0x000001;在以三个字节为周期对起始码前缀进行判断的过程中,若当前字节值小于等于1,则进入具体的起始码前缀判断过程;否则,转入下一周期的三个字节进行判断。3. audio-video decoding method according to claim 2, is characterized in that, described start code prefix comprises three bytes, is specifically 0x000001; When taking three bytes as period, start code prefix is judged In the process, if the current byte value is less than or equal to 1, then enter the specific start code prefix judgment process; otherwise, transfer to the next cycle of three bytes for judgment. 4.根据权利要求3所述的音视频解码方法,其特征在于,在所述具体的起始码前缀判断过程中包括下述步骤:4. audio-video decoding method according to claim 3, is characterized in that, comprises the following steps in described concrete start code prefix judgment process: c1、判断当前字节的前面第一个字节及当前字节的后面第二个字节中是否至少有一个字节值小于等于1,若是,执行步骤c2;否则,转入下一周期的三个字节进行判断;c1. Determine whether at least one byte value in the first byte before the current byte and the second byte after the current byte is less than or equal to 1, if so, execute step c2; otherwise, transfer to the next cycle Three bytes for judgment; c2:判断当前字节的前面第二个字节及当前字节的后面第一个字节中是否至少有一个字节值小于等于1,若是,执行逐字节判断起始码前缀的过程;否则,转入下一周期的三个字节进行判断。c2: Determine whether there is at least one byte value less than or equal to 1 in the second byte before the current byte and the first byte after the current byte, and if so, execute the process of judging the start code prefix byte by byte; Otherwise, turn to the three bytes of the next cycle for judgment. 5.根据权利要求4所述的音视频解码方法,其特征在于,在所述步骤c1逐字节判断起始码前缀的过程中,包括三种条件的判断:判断起始码前缀是否从当前字节开始;判断起始码前缀是否从当前字节的前面第一个字节开始;判断起始码前缀是否从当前字节的前面第二个字节开始。5. audio-video decoding method according to claim 4, is characterized in that, in the process of judging start code prefix byte by byte in described step c1, comprises the judgment of three kinds of conditions: judge whether start code prefix is from current byte start; judge whether the start code prefix starts from the first byte before the current byte; judge whether the start code prefix starts from the second byte before the current byte. 6.根据权利要求5所述的音视频解码方法,其特征在于,所述起始码前缀从当前字节开始应满足的条件为:当前字节值为0,当前字节的后面第一个字节值为0,当前字节的后面第二个字节值为1;所述起始码前缀从当前字节的前面第一个字节开始应满足的条件为:当前字节值为0,当前字节的前面第一个字节值为0,当前字节的后面第一个字节值为1;所述起始码前缀从当前字节的前面第二个字节开始应满足的条件为:当前字节值为1,当前字节的前面第一个字节值为0,当前字节的前面第二个字节值为0。6. The audio-video decoding method according to claim 5, wherein the conditions that the start code prefix should satisfy from the current byte are: the current byte value is 0, and the first byte after the current byte is 0. The value of the byte is 0, and the value of the second byte after the current byte is 1; the condition that the start code prefix should meet from the first byte in front of the current byte is: the value of the current byte is 0 , the value of the first byte in front of the current byte is 0, and the value of the first byte in the back of the current byte is 1; The condition is: the value of the current byte is 1, the value of the first byte before the current byte is 0, and the value of the second byte before the current byte is 0. 7.根据权利要求1至6中任一项所述的音视频解码方法,其特征在于,在所述步骤a之前还包括以下步骤:7. The audio-video decoding method according to any one of claims 1 to 6, wherein, before said step a, the following steps are also included: a1、在缓冲区内确定两个指针:读指针R和写指针W,R指向当前读位置,W指向写位置;a1. Determine two pointers in the buffer: the read pointer R and the write pointer W, R points to the current read position, and W points to the write position; a2、判断读指针R是否小于W-N,若是,则执行步骤a;否则,等待数据传输至缓冲区。a2. Determine whether the read pointer R is smaller than W-N, if yes, execute step a; otherwise, wait for the data to be transferred to the buffer. 8.根据权利要求7所述的音视频解码方法,其特征在于,在所述逐字节判断起始码前缀的过程中,若包含当前字节在内连续排列的N个字节不构成起始码前缀,则读指针R加N,并返回至步骤a2。8. The audio-video decoding method according to claim 7, wherein, in the process of judging the start code prefix byte by byte, if the N bytes continuously arranged in the current byte do not constitute a start code prefix, then add N to the read pointer R, and return to step a2.
CN 200710116509 2007-12-27 2007-12-27 A kind of audio and video decoding method Expired - Fee Related CN101217660B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200710116509 CN101217660B (en) 2007-12-27 2007-12-27 A kind of audio and video decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200710116509 CN101217660B (en) 2007-12-27 2007-12-27 A kind of audio and video decoding method

Publications (2)

Publication Number Publication Date
CN101217660A CN101217660A (en) 2008-07-09
CN101217660B true CN101217660B (en) 2010-06-02

Family

ID=39624014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200710116509 Expired - Fee Related CN101217660B (en) 2007-12-27 2007-12-27 A kind of audio and video decoding method

Country Status (1)

Country Link
CN (1) CN101217660B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095674A (en) * 2012-10-25 2013-05-08 北京君正集成电路股份有限公司 Programmable code stream pretreatment method and system
CN109743581B (en) * 2019-01-24 2021-08-27 上海国茂数字技术有限公司 Processing method at encoding end, processing method at decoding end and method for preventing pseudo initial code
CN110308321B (en) * 2019-07-05 2021-10-01 珠海格力智能装备有限公司 Dynamic current detection method and device
CN112839232B (en) * 2019-11-22 2023-01-17 合肥杰发科技有限公司 Data stream start code searching method and device and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5727036A (en) * 1995-11-22 1998-03-10 Mitsubishi Semiconductor America, Inc. High bit rate start code searching and detecting circuit and method
US5726989A (en) * 1995-11-06 1998-03-10 Stellar One Corporation Method for ensuring synchronization of MPEG-1 data carried in an MPEG-2 transport stream
JP2002056349A (en) * 2000-08-11 2002-02-20 Shinko Seisakusho Co Ltd Analytical method for magnetic information
US6470034B1 (en) * 1997-10-30 2002-10-22 Matsushita Electric Industrial Co., Ltd. Method and apparatus for reduced complexity start code detection in compressed bitstream

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5726989A (en) * 1995-11-06 1998-03-10 Stellar One Corporation Method for ensuring synchronization of MPEG-1 data carried in an MPEG-2 transport stream
US5727036A (en) * 1995-11-22 1998-03-10 Mitsubishi Semiconductor America, Inc. High bit rate start code searching and detecting circuit and method
US6470034B1 (en) * 1997-10-30 2002-10-22 Matsushita Electric Industrial Co., Ltd. Method and apparatus for reduced complexity start code detection in compressed bitstream
JP2002056349A (en) * 2000-08-11 2002-02-20 Shinko Seisakusho Co Ltd Analytical method for magnetic information

Also Published As

Publication number Publication date
CN101217660A (en) 2008-07-09

Similar Documents

Publication Publication Date Title
EP1150496A2 (en) Segmented processing method for a transport stream for digital television and recording media for the same
KR0152916B1 (en) Data Synchronizer and Method
EP0917371B1 (en) Moving image composing system
JP4664406B2 (en) Moving picture decoding apparatus, semiconductor device, video equipment, and moving picture decoding method
CN110830838A (en) Security protection high-definition video reverse broadcasting method and device
CN104780329B (en) High standard definition based on FPGA can mixed seeding multi-image divider and dividing method
CN101217660B (en) A kind of audio and video decoding method
US7689047B2 (en) Reduced buffer size for JPEG encoding
US6278838B1 (en) Peak-ahead FIFO for DVD system stream parsing
JPH11136225A (en) Method and system for detecting start code in bit stream
US8351722B2 (en) Encoder, decoder, encoding method and decoding method, and recording medium
US7515761B2 (en) Encoding device and method
CN109348309A (en) A distributed video transcoding method suitable for frame rate up-conversion
CN112653904B (en) Rapid video clipping method based on PTS and DTS modification
US7817721B2 (en) Posting status data in digital transport stream processing
KR100390841B1 (en) Apparatus for storing and comparing PID to speed up detection of PID and its method
US7936814B2 (en) Cascaded output for an encoder system using multiple encoders
US6546184B2 (en) Still picture player
CN113055680B (en) Distributed transcoding method
CN101466037A (en) Method for implementing video decoder combining software and hardware
US7349428B2 (en) Data alignment of the packetized elementary streams in the coded data buffer for dual decode
CN110213650B (en) A method and device for software to quickly search for synchronization words in video code stream
US7953159B2 (en) Receiving apparatus and receiving method
US7284072B2 (en) DMA engine for fetching words in reverse order
CN116883691B (en) High-frame-rate multipath target detection method for edge equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100602