KR100223043B1 - Pattern matching method and method having fixed length shifting - Google Patents

Pattern matching method and method having fixed length shifting Download PDF

Info

Publication number
KR100223043B1
KR100223043B1 KR1019960039259A KR19960039259A KR100223043B1 KR 100223043 B1 KR100223043 B1 KR 100223043B1 KR 1019960039259 A KR1019960039259 A KR 1019960039259A KR 19960039259 A KR19960039259 A KR 19960039259A KR 100223043 B1 KR100223043 B1 KR 100223043B1
Authority
KR
South Korea
Prior art keywords
storage means
pattern
bit string
pattern matching
storing
Prior art date
Application number
KR1019960039259A
Other languages
Korean (ko)
Other versions
KR19980020686A (en
Inventor
이상훈
장순화
권순홍
Original Assignee
이계철
한국전기통신공사
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 이계철, 한국전기통신공사 filed Critical 이계철
Priority to KR1019960039259A priority Critical patent/KR100223043B1/en
Publication of KR19980020686A publication Critical patent/KR19980020686A/en
Application granted granted Critical
Publication of KR100223043B1 publication Critical patent/KR100223043B1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

Abstract

본 발명은 주어진 입력 데이타열에서 원하는 패턴을 고속으로 찾기 위한 고정길이의 이동량을 갖는 패턴매칭 판별 방법 및 그 장치에 관한 것으로, 패턴매칭을 행함에 있어서 이전상태의 데이타값 중 현재상태에 필요한 최소한의 정보를 저장한 후 패턴매칭을 행하므로써, 동일한 패턴을 찾는데 소요되는 시간을 감소시키고, 하드웨어의 구현을 최적화하여 고속처리를 요구하는 비디오 코덱, 광대역 단말, 고선명 TV, 멀티미디어 등에 이용할 수 있는 장점을 제공한다.The present invention relates to a pattern matching discrimination method and apparatus having a fixed-length moving amount for quickly searching for a desired pattern in a given input data sequence. By storing the information and performing pattern matching, it reduces the time required to find the same pattern, optimizes the hardware implementation, and provides the advantage that it can be used for video codecs, broadband terminals, high-definition TV, multimedia, etc. that require high-speed processing. do.

Description

고정된 길이의 이동량을 갖는 패턴매칭 판별 방법 및 그 장치Pattern matching determination method and apparatus thereof having fixed length of movement

본 발명은 고정된 길이의 이동량을 갖는 패턴매칭 판별 방법 및 그 장치에 관한 것으로, 더욱 상세하게는 주어진 입력 데이타열에서 원하는 패턴을 고속으로 찾기 위한 고정길이의 이동량을 갖는 패턴매칭 판별 방법 및 그 장치에 관한 것이다.The present invention relates to a method and apparatus for determining pattern matching with a fixed amount of movement, and more particularly, to a method and apparatus for determining pattern matching with a fixed length of movement for quickly finding a desired pattern in a given input data sequence. It is about.

현재 통계적으로 중복성을 가지는 모든 데이타는 전송효율을 극대화 하기 위해서 가변길이부호(Variable Length Code : 이하 VLC라 칭함)를 사용하여 데이타를 압축한 후 전송한다. VLC는 심볼의 발생 빈도수를 조사하여 발생률이 높은 심볼에 적은 비트를 할당하는 방식을 이용하는 부호이다.At present, all data with statistical redundancy are transmitted after compressing the data using Variable Length Code (VLC) to maximize transmission efficiency. The VLC is a code that uses a method of allocating fewer bits to a symbol having a high occurrence rate by examining a frequency of occurrence of the symbol.

VLC는 고정길이를 갖는 부호에 비하여 효율적으로 비트율을 감소시킬 수 있다. 또한 VLC는 데이타의 통계적인 중복을 감소시킬 수 있으며 비디오나 오디오의 데이타를 높은 비율로 압축할 수 있고 저장매체나 전송매체의 데이타를 효과적으로 줄일 수 있다.VLC can reduce the bit rate efficiently compared to a code having a fixed length. In addition, VLC can reduce statistical redundancy of data, compress video and audio data at high rates, and effectively reduce data on storage and transmission media.

그러나 VLC는 다음과 같은 문제점을 가지고 있다.However, VLC has the following problems.

첫째는 VLC를 가지고 임의의 비트열을 디코딩할 때, 통계적 분포에 따라서 서로 다른 길이로 인코딩 하므로써 복호시에 다른 길이를 갖는 심볼의 형태로 디코딩을 하여야 한다. 이와 같은 VLC를 디코딩하기 위해서는 고정 길이 부호에 비하여 하드웨어의 복잡도가 증가한다.First, when decoding an arbitrary bit string with VLC, it should be decoded in the form of symbols having different lengths during decoding by encoding with different lengths according to the statistical distribution. In order to decode such a VLC, hardware complexity is increased compared to fixed length codes.

둘째는 전송오류가 부호열이 전송되어진 원래의 부호 이외에 다른 부호로 디코딩될 수 있다는 것이다. 그러므로, 디코더가 이와 같은 사실을 알 때까지 잘못된 부호로 복호가 되므로 전송오류는 계속적으로 다음 부호에 영향을 미친다.The second is that the transmission error can be decoded with a code other than the original code to which the code string was transmitted. Therefore, the transmission error continues to affect the next code since the decoder decodes with the wrong code until the decoder knows this.

이를 방지하기 위한 방법으로 현재 가변길이 부호기는 부호화된 비트열에 전송오류나 임의 접근을 가능하도록 하기 위해서 비트열에 고정된 길이를 갖는 동기코드를 삽입한다.In order to prevent this, the current variable length encoder inserts a synchronization code having a fixed length into the bit string to enable transmission error or random access to the coded bit string.

그 이유는 가변길이부호, 구체적으로 허프만부호(Huffman code)를 사용할 경우, 가변길이부호로만 연속되어 있으면 동기 포인트 즉 어떤 가변길이부호의 시작위치를 알지 못하기 때문이다(이를 알수 있게하기 위해 변형된 가변길이부호를 사용하기도 하지만 그 효율이 떨어져 잘 사용하지 않음).The reason is that when using variable length code, specifically Huffman code, if the variable length code is continuous, the synchronization point, that is, the starting position of any variable length code, is not known. Variable length code is used, but its efficiency is not good.)

따라서 특정 패턴을 갖는 동기부호를 주기적으로 삽입하는 것이다.Therefore, the synchronization code having a specific pattern is periodically inserted.

MPEG등에서는 이를 시작코드(start code)라 칭하며, MPEG비디오에서는 슬라이스, 픽쳐, 픽쳐의 그룹(Group of Picture), 픽쳐의 시퀀스(sequence of Picture) 등의 시작부분에 16진수로 000001xx(xx는 식별자로 사용함)라는 시작부호를 삽입한다.In MPEG, etc., this is called start code. In MPEG video, 000001xx (xx is an identifier at the beginning of a slice, a picture, a group of pictures, a sequence of pictures, etc.) at the beginning. Insert a start symbol).

그리고 동기부호의 고유성을 위하여 어떤 가변길이부호도 000001이라는 패턴을 부여하지 않는다.And for the uniqueness of the synchronization code, no variable length code is assigned the pattern 000001.

따라서 MPEG 등을 사용하는 디지털 TV를 켰을 경우 그 내부에 있는 비디오 디코더는 우선 시작코드(구체적으로는 sequence start code)부터 찾는다.Therefore, when a digital TV using MPEG or the like is turned on, the video decoder inside it first searches for a start code (specifically, a sequence start code).

그리고 정해진 시퀀스에 관한 파라미터를 디코딩한 후 픽쳐시작코드(Picture start code)를 찾는다. 마찬가지로 한 픽쳐에 대한 파라미터를 복호하고, 다시 슬라이스시작코드를 찾아 동일한 과정을 반복한 후 비로소 가변길이 디코딩을 수행한다.Then, the picture start code is found after decoding the parameters related to the determined sequence. Likewise, after decoding the parameter for one picture, finding the slice start code again, repeating the same process, variable length decoding is performed.

다른 한편으로 가변길이 디코더에서는 임의의 오류가 디콩딩된 비트열에 있음이 확인되면 현재 디코딩중인 데이터가 오류 상태에 있으므로, 이 데이터를 버리고 새로운 시작점을 찾아 재동기를 한다.On the other hand, in the variable-length decoder, if any error is found in the de-decoded bit stream, the data currently being decoded is in an error state, so the data is discarded and a new starting point is found and resynchronized.

재동기 부호를 찾게되면 그 이후에 입력되는 VLC 데이타는 올바르게 부호화된다. MPEG 표준화에서는 시작 부호들을 부호화된 비트열에 삽입한다. 이와같은 시작 부호는 각 계층의 시작을 나타낼 뿐만 아니라 부호화된 비트열에서 임의의 계층에 접근할 수 있도록 할 수 있다. 광대역 단말이나 고선명 TV혹은 멀티미디어와 같은 고속의 처리속도를 요구하는 곳에서 이와 같은 재동기 알고리즘은 디코더로 하여금 고속으로 전송오류를 처리할 수 있게 할 뿐 아니라 임의 접근을 가능하게 한다.When the resynchronization code is found, the VLC data input thereafter is correctly encoded. In MPEG standardization, start codes are inserted into a coded bit string. This start code not only indicates the start of each layer but can also access any layer in the coded bitstream. Where fast processing speeds such as broadband terminals, high-definition TVs or multimedia are required, this resynchronization algorithm not only allows the decoder to handle transmission errors at high speeds but also allows random access.

이와 같은 장점을 제공하는 고정된 이동량을 갖는 패턴을 판별하기 위한 기본적인 이론은 다음과 같다.The basic theory for determining a pattern with a fixed amount of movement that provides this advantage is as follows.

임의의 비트열이 아래와 같이 주어졌다고 하자.Assume that an arbitrary bit string is given below.

s1, s2, s3, …, si, si+1, …, sL그리고 이 비트열의 길이를 L이라고 하자. 임의의 매치패턴(이하 PAT라 한다.)을 주어진 비트열에서부터 찾는다고 하고, PAT는 다음과 같이 구성되어져 있다고 한다. PAT=p1, p2, …, pn(nL). 비교연산수를 구하기 위하여 한단계에서 주어진 비트열과 비교하는 비트열을 STR이라고 정의하자. PAT의 길이를 n이라고 하고 STR의 길이를 ℓ이라고 하자. ℓ의 값과 n의 값이 같은 경우를 고려하자. STR과 PAT를 비교하기 위해 사용되는 현재의 상태를 S(t)로 나타내고 다음 상태를 S(t+1)로 나타내기로 하자. 만약 PAT와 STR이 S(t)에서 PAT의 p1에서 pk(kn)까지 STR의 뒷부분인 sn-k+1에서 sn까지와 일치되었다고 가정하자. 즉 p1, p2, …, pk와 sn-k+1, …, sn-1, sn가 일치되었다고 하자. k의 값을 '순방향 매치수(NF)라고 표기하기로 하자. S(t+1)에서 PAT의 pk+1, …, pn는 STR의 s1, …, sn-k와 비교된다. 이 때 n-k의 값을 역방향 매치수(NB)라고 표기하기로 하자.s 1 , s 2 , s 3 ,. , s i , s i + 1 ,. Let, s L and L the length of the bit string. An arbitrary match pattern (hereinafter referred to as PAT) is found from a given bit string, and a PAT is constructed as follows. PAT = p 1 , p 2 ,... , p n (n L). To find the comparison operation, define STR as a bit string that is compared with a given bit string in one step. Let n be the length of the PAT and l be the length of the STR. Consider the case where the value of l is equal to the value of n. Let us represent the current state used to compare STR and PAT as S (t) and the next state as S (t + 1). If PAT and STR are S (t), then P 1 at p k (k Assume that s n-k + 1 to sn, later in STR, matches n). P 1 , p 2 ,... , p k and s n-k + 1 ,. Let s n-1 and s n match. Let k be the number of forward matches (N F ). P k + 1 of PAT at S (t + 1),... , p n is s 1 of STR... , s nk In this case, let nk be the number of reverse matches (NB).

만약 원하는 패턴을 찾는다면, NF와 NB의 합은 n이 되고 PAT라 부르는 원하는 패턴은 S(t)와 S(t+1)사이에서 발견할 수가 있다. NF와 NB값의 범위는 0에서 n-1까지이다.If we find the pattern we want, the sum of N F and N B is n and the desired pattern, called PAT, can be found between S (t) and S (t + 1). The values of N F and N B range from 0 to n-1.

상기와 이론을 통해 종래 고정된 이동량을 갖는 패턴매칭 판별을 위한 알고리즘을 설명하면 도 1에 도시된 바와 같이, 임의의 PAT가 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,라고 하고 이 PAT와 비교하는 패턴을 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0,라고 하자. 이때 PAT의 길이인 n과 STR의 길이인 ℓ은 모두 10이라고 하였다.Referring to the algorithm for pattern matching determination with a fixed amount of conventional movement through the above and the theory, as shown in Figure 1, any PAT is 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, A pattern that is called 0, and compares to this PAT is 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 Let 0, 0, 0, 0, 0, 0, 1, 1, 1, 0. At this time, n, the length of the PAT, and ℓ, the length of the STR, were both 10.

10개의 비트로 구성된 STR은 각 클럭에서 PAT와 비교하게 된다. 각 STR는 PAT의 첫 번째 비트부터 순방향으로 비교한다.The 10-bit STR is compared to the PAT at each clock. Each STR compares forward from the first bit of the PAT.

S(t)에서 STR의 …, 0, 0과 PAT의 0, 0, …과 일치하므로 NF값은 2가 된다. S(t+1)에서 STR의 0, 0 …과 PAT의 …, 0, 0과 일치하므로 NB의 값은 2이다. NF과 NB의 합이 10(n=10)이 되지 않으므로 S(t)과 S(t+1)사이에서 PAT는 존재하지 않는다. S(t+1)에서 STR의 …, 0, 0, 0, 0과 PAT의 0, 0, 0, 0, …과 일치하므로 NF의 값은 4이다. S(t+2)에서 STR의 0, 0, 0, 0, 0, 0, …과 PAT의 …, 0, 0, 0, 0, 0, 0과 일치하므로 NB의 값은 6이다. 이와 같은 경우에서는 NF와 NB의 합이 10(n=10)이 된다. 따라서 S(t+1)과 S(t+2)사이에서 원하는 패턴이 있음을 알 수 있다.Of STR in S (t)... , 0, 0 and PAT 0, 0,... The value of N F is 2 since 0, 0... Of STR in S (t + 1). And PAT… , 0, 0, so N B is 2. Since the sum of N F and N B does not equal 10 (n = 10), there is no PAT between S (t) and S (t + 1). Of STR at S (t + 1). , 0, 0, 0, 0 and 0, 0, 0, 0,. The value of NF is 4 because 0, 0, 0, 0, 0, 0,... Of STR in S (t + 2). And PAT… The value of N B is 6 since 0, 0, 0, 0, 0, 0 matches. In such a case, the sum of N F and N B is 10 (n = 10). Therefore, it can be seen that there is a desired pattern between S (t + 1) and S (t + 2).

결론적으로 하나의 클럭에서 고정된 이동량을 갖기 위해서 현재의 입력된 STR 다음 상태에서 입력된 STR 사이에 존재하게 되는 비트를 고려해야 한다. 다음 상태에서 매치 패턴이 포함될 최대 비트수는 n-1개이고 최소 비트수는 1이다. 그러므로 NF와 NB의 값의 범위는 1부터 n-1의 값을 가질수 있다.In conclusion, in order to have a fixed amount of movement in one clock, it is necessary to consider the bits existing between the input STRs after the current input STR. In the following states, the maximum number of bits to include a match pattern is n-1 and the minimum number of bits is one. Therefore, the range of values of N F and N B can range from 1 to n-1.

이상과 같은 종래의 기술은 순방향 매치수와 역방향 매치수를 이용해서 고정된 이동량을 갖는 하드웨어 설계를 하였다.The prior art as described above has a hardware design having a fixed amount of movement using the number of forward matches and the number of backward matches.

따라서 1비트씩 이동하면서 동일 패턴을 찾는데 걸리는 시간이 너무 길어지고, 하드웨어의 동작회수도 많아지는 단점이 있으며, 전송오류 발생시 복원 시간이 길어지는 문제가 있다.Therefore, the time it takes to find the same pattern while moving by one bit is too long, the operation frequency of the hardware is also increased, and there is a problem that the recovery time is long when a transmission error occurs.

또한, 덧셈기등 추가적인 하드웨어가 필요하므로 최적의 하드웨어가 되지 못하는 단점이 있다.In addition, since additional hardware such as an adder is required, there is a disadvantage in that it is not optimal hardware.

본 발명은 상기에 기술한 바와 같은 종래 문제점 및 단점을 감안하여, 주어진 입력 데이타열에 고속의 재동기를 위하여 재동기 부호와 같은 원하는 패턴을 고속으로 찾는 방법 및 그 장치를 제공하는 것을 목적으로 하며, 특히 이전 상태의 데이타 값 중 현재상태에 필요한 최소한의 정보를 저장한 후 패턴매칭을 하므로써 하드웨어의 구현을 최적화 하는 것을 목적으로 한다.SUMMARY OF THE INVENTION The present invention has been made in view of the conventional problems and disadvantages described above, and an object thereof is to provide a method and apparatus for finding a desired pattern such as a resynchronization code at high speed for a high speed resynchronization to a given input data sequence. In particular, it aims to optimize the hardware implementation by storing the minimum information necessary for the current state among the data values of the previous state and then performing pattern matching.

제1도는 종래의 고정된 이동량을 갖는 패턴 매칭 판별 방법의 알고리즘을 나타낸 도면.1 is a diagram showing an algorithm of a conventional pattern matching determination method with a fixed amount of movement.

제2(a)도는 nℓ일 때 본 발명에 따른 고정된 이동량을 갖는 데이타 흐름도 및 패턴 매칭의 설명도.2 (a) is n Explanatory diagram of data flow diagram and pattern matching with fixed amount of movement according to the present invention when l.

제2(b)도는 nℓ일 때 본 발명에 따른 고정된 이동량을 갖는 데이타 흐름도 및 패턴 매칭의 설명도.2 (b) is n Explanatory diagram of data flow diagram and pattern matching with fixed amount of movement according to the present invention when l.

제3도는 본 발명에 의한 고정된 길이의 이동량을 갖는 패턴매칭 판별 장치의 구성도.3 is a block diagram of a pattern matching discrimination apparatus having a fixed length of movement according to the present invention.

제4도는 본 발명의 MPEG2 비디오 디코더의 가변부호화기에 응용한 예를 나타낸 예시도.4 is an exemplary diagram showing an example of application to a variable encoder of an MPEG2 video decoder of the present invention.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

31 : 입력버퍼 32 : 래치 131: Input buffer 32: Latch 1

33 : 래치 233: latch 2

34 : 프로그래머블 로직 어레이(Programmable Logic Array : PLA)34: Programmable Logic Array (PLA)

35 : 버퍼제어기 41 : 입력버퍼35: buffer controller 41: input buffer

42 : 래치 1 43 : 래치 242: latch 1 43: latch 2

44 : 배럴 시프터(Barrel Shifter) 45 : PLA44: barrel shifter 45: PLA

46 : 누산기(Accumulator)46: Accumulator

상기와 같은 목적을 달성하기 위해, 입력비트열을 저장하는 입력버퍼와,In order to achieve the above object, an input buffer for storing an input bit string,

상기 입력버퍼에서 하나의 비트열을 저장하기 위한 제 1저장수단과, 원하는 패턴과 상기 제 1저장수단에 저장된 비트열이 패턴 매칭되지 않은 경우 제 1저장수단에 저장된 비트열을 저장하기 위한 제 2저장수단과,First storage means for storing one bit string in the input buffer, and second bit for storing the bit string stored in the first storage means when the desired pattern and the bit string stored in the first storage means do not have a pattern match. Storage means,

상기 제 1 및 제 2저장수단에 있는 비트열을 일렬로 배열하여 패턴 매칭여부를 판단하기 위한 비교수단, 및Comparison means for judging pattern matching by arranging the bit strings in the first and second storage means in a row; and

상기 비교결과 패턴매칭이 된 경우에는 비교수단에서 패턴매칭을 나타내는 신호와 이동할 양에 관한 정보를 수신하기 위한 버퍼제어기를 구비하는 것을 특징으로 한다.When the result of the comparison is a pattern matching, the comparison means comprises a buffer controller for receiving a signal indicating the pattern matching and information on the amount of movement.

또한, 상기와 같은 목적을 달성하기 위해, 입력버퍼로부터 하나의 비트열을 제 1저장수단에 저장하는 단계;Further, in order to achieve the above object, storing one bit string from the input buffer in the first storage means;

원하는 패턴과 상기 제 1저장수단에 저장된 비트열이 패턴매칭되지 않은 경우 제 1저장수단에 저장된 비트열을 제 2저장수단에 저장하고 입력버퍼로부터 다시 하나의 비트열을 수신하여 제 1저장수단에 저장하는 단계; 및If the desired pattern and the bit strings stored in the first storage means are not pattern matched, the bit strings stored in the first storage means are stored in the second storage means, and one bit string is received from the input buffer again to the first storage means. Storing; And

제 1 및 제 2저장수단에 있는 비트열을 비교수단에 일렬로 배열하여 패턴매칭 여부를 판별하는 단계로 이루어짐을 특징으로 한다.And determining the pattern matching by arranging the bit strings in the first and second storage means in a row in the comparison means.

상술한 목적, 특징 및 장점은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 보다 분명해 질 것이다. 이하 첨부된 도면을 참조하여 본 발명의 실시예를 상세히 설명하면 다음과 같다.The above objects, features and advantages will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

본 발명은 종래 기술에 더하여 패턴매치가 실패하였을 경우 NF에 해당하는 현재의 비트를 래치에 저장하고, 다음 상태에서 입력되는 STR과 함께 비교하는 방식을 사용한다.In addition to the prior art, the present invention uses a method of storing a current bit corresponding to N F in a latch and comparing it with the STR input in the next state when the pattern matching fails.

도 2(a)는 n의 값이 4이고 ℓ의 값이 6일 경우 현재 상태에 입력되는 STR과 이전 상태 STR 중 3개의 비트를 현재상태의 PAT와 비교하는 것을 보여준다. 그러므로 nℓ일 경우 고정된 이동량을 갖기 위해서 한클럭에 비교해야 하는 비트수는 ℓ+n-1(=ℓ+NF)의 값을 갖는다. 비교연산수 N의 범위는 ℓ×n에서 ℓ+n-1의 범위를 갖는다.2 (a) shows that when the value of n is 4 and the value of ℓ is 6, three bits of the STR input to the current state and the previous state STR are compared with the PAT of the current state. Therefore n In the case of L, the number of bits to be compared with one clock in order to have a fixed amount of movement has a value of l + n-1 (= l + N F ). The comparative operation number N ranges from l × n to l + n−1.

ℓ이 n보다 작을 경우는 다음과 같다. 한 클럭에 입력되는 비트수는 n보다 적으므로 매치 패턴의 길이보다 클때까지 입력되는 STR을 저장해야 한다.When l is smaller than n, it is as follows. Since the number of bits input to one clock is less than n, the input STR must be stored until it is larger than the length of the match pattern.

만약 ℓ의 값이 4이고 n의 값이 6이라고 가정하면 초기 상태에서 두개의 STR이 입력된 후부터 PAT와 비교하기 시작한다. n의 값이 6이므로 NF의 값은 최대가 된다. 이에 해당하는 비트는 저장 후 다음 들어오는 입력 비트열과 같이 비교를 해야 한다. 한 클럭에 비교해야 하는 비트수의 값은 9(=NF+ℓ)가 된다.If we assume that the value of l is 4 and the value of n is 6, we start comparing the PAT after two STRs have been entered in the initial state. Since the value of n is 6, the value of N F is maximum. The corresponding bits must be compared with the next incoming input bit stream after storage. The number of bits to be compared to one clock is 9 (= N F + ℓ).

도 2(b)는 위와 같은 경우 래치에 저장되는 데이타의 흐름도를 보여준다. 그러므로 입력 비트수가 적으면 적을수록 레이턴시(latency)는 크다. nℓ일 경우, 고정된 이동량을 갖기 위해서 한 클럭에 비교해야 하는 비트수는 ℓ+n-1의 값을 갖는다. 비교연산수 N의 범위는 L×n에서 L+n-1의 범위를 갖는다.2 (b) shows a flowchart of data stored in a latch in the above case. Therefore, the fewer input bits, the greater the latency. n In the case of L, the number of bits to be compared with one clock in order to have a fixed amount of movement has a value of l + n-1. The range of the comparison operation number N is Lxn to L + n-1.

도 3은 고정된 길이의 이동량을 갖는 패턴매칭 판별 장치를 보이고 있다. 입력 비트열은 입력 버퍼(31)에 저장되어 있고 외부 모듈에서 요구할 때마다 비트열을 출력한다. 외부 모듈에 의해서 출력된 비트열에 오류가 있음이 확인되면 이 비트열은 재동기를 해야 한다.3 shows a pattern matching determination device having a fixed amount of movement. The input bit string is stored in the input buffer 31 and outputs a bit string whenever required by an external module. If it is confirmed that there is an error in the bit string output by the external module, the bit string must be resynchronized.

PAT가 ℓ만큼의 길이를 이동하기 위해서 매 클럭마다 래치 1(32)에 ℓ비트씩 입력되어야 한다. 처음 상태에서의 동작은 다음과 같다. 하나의 STR은 래치 1(32)에 저장된 후 PLA(34)는 STR과 래치 2(33)에 저장되어 있는 비트를 일렬로 한 후 PAT와 비교한다. 만약 패턴 매칭이 실패한다면 래치 1(32)에서 NF의 범위안에 있는 비트를 래치 2(32)에 저장한다. ℓn-1경우에는 저장해야 하는 수는 n-1이다. 그 반대의 경우는 저장할 비트수는 ℓ이다. 만약 원하는 PAT가 발견된다면, PLA(34)는 패턴_발견 신호와 이동할 량의 정보를 버퍼제어기(35)에 전달한다. 다음 상태에서 버퍼제어기(35)는 비트열의 시작점을 발견하게 되고 이 비트열을 외부 모듈로 전송하게 된다.In order for the PAT to shift the length by one, one bit must be input into the latch 1 (32) every clock. The operation in the initial state is as follows. One STR is stored in latch 1 (32) and then PLA (34) lines up the bits stored in STR and latch 2 (33) and compares it to the PAT. If pattern matching fails, a bit in the range of latch 1 (32) to N F is stored in latch 2 (32). ℓ In case of n-1, the number to be stored is n-1. In the opposite case, the number of bits to be stored is ℓ. If the desired PAT is found, the PLA 34 transmits the pattern_discovery signal and information of the amount to move to the buffer controller 35. In the next state, the buffer controller 35 finds the starting point of the bit string and transmits the bit string to an external module.

도 4 본 발명에 의한 방법을 MPEG2 비디오 디코더에 적용한 실시예를 나타내고 있다. 비디오 디코더에서는 주로 제4도와 같은 구조가 사용된다. MPEG2에서 이산여현변환(Discrete Cosine Transform : DCT)계수들을 부호화 하는데 사용하는 정보로는 런(run)과 사인드 레벨(signed level)이 있다. 이 부호의 최대 길이는 에스케이프(escape)와 그 다음에 오는 고정된 길이를 갖는 런과 레벨의 부호의 길이를 합한 것이다.4 shows an embodiment in which the method according to the present invention is applied to an MPEG2 video decoder. In the video decoder, a structure such as that of FIG. 4 is mainly used. Information used to encode Discrete Cosine Transform (DCT) coefficients in MPEG2 includes a run and a signed level. The maximum length of this sign is the sum of the length of the sign of the run and level with an escape followed by a fixed length.

에스케이프 부호는 6비트, 런의 고정 길이 코드는 6비트, 레벨을 나타내는데 사용하는 부호의 길이는 12비트이므로, 총 길이는 24비트이다.The escape code is 6 bits, the run fixed length code is 6 bits, and the length of the code used to indicate the level is 12 bits, so the total length is 24 bits.

따라서 가변길이부호기의 최대 입력 비트수는 병렬로 24비트가 매 클럭마다 입력되는 구조로 하였다. 가변길이부호기에서는 이를 한 클럭에 처리하기 위해서 24비트의 래치 2개(41,42)를 사용하여 48비트를 입력으로 하고, 24비트를 출력으로 하는 배럴 쉬프트(44)가 필요하다. 그러므로 매클럭마다 24비트의 입력으로 동기 부호 24비트를 찾기 위해서 매치되어야 하는 필요한 비트수는 47=24+24-1이 된다.Therefore, the maximum number of input bits of the variable-length coder has a structure in which 24 bits are input in every clock in parallel. In the variable length encoder, the barrel shift 44 which requires 48 bits as inputs and 24 bits as outputs using two 24-bit latches 41 and 42 to process them in one clock is required. Therefore, the required number of bits that must be matched to find 24 bits of sync sign with 24 bits of input per clock is 47 = 24 + 24-1.

그러므로 데이타의 오류가 발생하거나 랜덤엑세스가 필요하여 가변길이부호기 구조를 이용하여 재동기를 수행할 경우 래치 1(42)의 24비트와 래치 2(43)에 저장되어 있는 비트중 상위 23비트 패턴과 32비트의 동기코드를 PLA(45)를 이용하여 비교한다.Therefore, when data error occurs or random access is required and resynchronization is performed using the variable length encoder structure, the upper 23-bit pattern of the 24 bits of latch 1 (42) and the bits stored in latch 2 (43) and 32-bit sync code is compared using the PLA (45).

그러므로 도 4와 같이 가변길이부호를 부호화하기 위해 사용되는 배럴 쉬프트(44)에 입력되는 이동량의 양을 0으로 하고 입력 제어신호를 입력 버퍼(41)에 주어 매 클럭마다 다음 24비트가 래치 1(42)에 입력되도록 한다.Therefore, as shown in FIG. 4, the amount of movement input to the barrel shift 44 used for encoding the variable length code is set to 0, and an input control signal is inputted to the input buffer 41 so that the next 24 bits are latched 1 (for every clock). 42).

만약 시작부호가 발견되었다면 PLA(45)는 누산기(accumulator)(46)에 동기부호의 종류를 나타내는 시작부호 이후의 8비트 정보를 복호화 하여 원하는 동기부호인가를 확인한다. 만약 원하는 부호일 경우 입력 제어 신호를 통하여 다음 클럭에서 래치 1(42)에 새로운 데이타가 저장되지 않게 하고, 누산기(46)를 이용하여 동기 부호의 다음 위치만큼 시프트 하게 한다. 재동기가 이루어진 후에, 가변길이부호기는 정상적으로 동작한다.If the start code is found, the PLA 45 verifies the desired sync code by decoding the 8-bit information after the start code indicating the type of the sync code in the accumulator 46. If the desired code is used, new data is not stored in the latch 1 42 at the next clock through the input control signal, and the accumulator 46 is used to shift the next position of the sync code. After resynchronization, the variable length encoder operates normally.

상기에서 설명한 바와 같이 본 발명은 패턴매칭을 행함에 있어서 이전상태의 데이타값 중 현재상태에 필요한 최소한의 정보를 저장한 후 패턴매칭을 행하므로써, 동일한 패턴을 찾는데 소요되는 시간을 감소시키고, 하드웨어의 구현을 최적화하여 고속처리를 요구하는 비디오 코덱, 광대역 단말, 고선명 TV, 멀티미디어 등에 이용할 수 있는 장점을 제공한다.As described above, the present invention reduces the time required to find the same pattern by performing pattern matching after storing the minimum information necessary for the current state among the data values of the previous state in performing pattern matching. Optimized implementation provides advantages that can be used for video codecs, broadband terminals, high-definition TVs, and multimedia that require high-speed processing.

특히 비디오 디코더의 가변길이 부호기에 사용하는 아키텍쳐에 응용하므로써 그 적용성이 매우 크다고 할 수 있겠다.In particular, it is very applicable to the architecture used for the variable length encoder of the video decoder.

아울러 본 발명의 바람직한 실시예들은 예시의 목적을 위해 개시된 것이며, 당업자라면 본 발명의 사상과 범위안에서 다양한 수정, 변경, 부가등이 가능할 것이며, 이러한 수정 변경 등은 이하의 특허 청구의 범위에 속하는 것으로 보아야 할 것이다.In addition, preferred embodiments of the present invention are disclosed for the purpose of illustration, those skilled in the art will be able to various modifications, changes, additions, etc. within the spirit and scope of the present invention, such modifications and modifications belong to the following claims You will have to look.

Claims (8)

입력비트열을 저장하는 입력버퍼와,An input buffer for storing an input bit string, 상기 입력버퍼에서 하나의 비트열을 저장하기 위한 제 1저장수단과, 원하는 패턴과 상기 제 1저장수단에 비트열이 패턴 매칭되지 않은 경우 제 1저장수단에 저장된 비트열을 저장하기 위한 제 2저장수단과,First storage means for storing one bit string in the input buffer, and second storage for storing the bit string stored in the first storage means when the bit pattern does not match the desired pattern and the first storage means. Sudan, 상기 제 1 및 제 2저장수단에 있는 비트열을 일렬로 배열하여 패턴 매칭여부를 판단하기 위한 비교수단, 및Comparison means for judging pattern matching by arranging the bit strings in the first and second storage means in a row; and 상기 비교결과 패턴 매칭이 된 경우에는 비교수단에서 패턴매칭을 나타내는 신호와 동일할 양에 관한 정보를 수신하기 위한 버퍼제어기를 구비하는 것을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매칭 판별 장치.And a buffer controller for receiving information about an amount equal to a signal representing pattern matching in the comparison means, when the result of the comparison is pattern matching. 제1항에 있어서,The method of claim 1, 상기 제 2저장수단에 패턴매칭되지 않은 제 1저장수단의 비트열을 저장함에 있어서, 순방향 매치수를 구성하는 비트를 제 2저장수단에 저장하는 것을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매칭 판별 장치.In storing the bit string of the first storage means that is not pattern-matched in the second storage means, the pattern matching having a fixed length moving amount, storing the bits constituting the number of forward matches in the second storage means. Discrimination device. 제1항 또는 제2항에 있어서,The method according to claim 1 or 2, 상기 제 1 및 제 2저장수단은 래치임을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매칭 판별 장치.And the first and second storage means are latches. 제1항에 있어서,The method of claim 1, 상기 비교수단은 PLA임을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매칭 판별 장치.The comparison means is a pattern matching determination device having a fixed length of movement, characterized in that the PLA. 입력버퍼로부터 하나의 비트열을 제 1저장수단에 저장하는 단계;Storing one bit string from the input buffer in the first storage means; 원하는 패턴과 상기 제 1저장수단에 저장된 비트열이 패턴매칭되지 않은 경우 제 1저장수단에 저장된 비트열을 제 2저장수단에 저장하고 입력버퍼로부터 다시 하나의 비트열을 수신하여 제 1저장수단에 저장하는 단계; 및If the desired pattern and the bit strings stored in the first storage means are not pattern matched, the bit strings stored in the first storage means are stored in the second storage means, and one bit string is received from the input buffer again to the first storage means. Storing; And 제 1 및 제 2저장수단에 있는 비트열을 비교수단에 일렬로 배열하여 패턴매칭 여부를 판별하는 여부를 판별하는 단계로 이루어짐을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매칭 판별 방법.And determining whether or not to match the pattern by arranging the bit strings in the first and second storage means in a row in the comparison means. 제5항에 있어서,The method of claim 5, 원하는 패턴과 상기 제 1저장수단에 저장된 비트열이 패턴매칭되지 않은 경우 제 1저장수단에 저장된 비트열을 제 2저장수단에 저장함에 있어서, 순방향 매치수를 구성하는 비트를 제 2저장수단에 저장하는 것을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매칭 판별 방법.When the desired pattern and the bit string stored in the first storage means are not pattern-matched, in storing the bit string stored in the first storage means in the second storage means, the bits constituting the forward match number are stored in the second storage means. Pattern matching determination method having a fixed length of movement, characterized in that. 제5항에 또는 제6항에 있어서,The method according to claim 5 or 6, 상기 제 1 및 제 2저장수단은 래치임을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매치 판별 방법.And the first and second storage means are latches. 제5항에 있어서,The method of claim 5, 상기 비교수단은 PLA임을 특징으로 하는 고정된 길이의 이동량을 갖는 패턴매치 판별 방법.The comparison means is a pattern match determination method having a fixed length of movement, characterized in that the PLA.
KR1019960039259A 1996-09-11 1996-09-11 Pattern matching method and method having fixed length shifting KR100223043B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019960039259A KR100223043B1 (en) 1996-09-11 1996-09-11 Pattern matching method and method having fixed length shifting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019960039259A KR100223043B1 (en) 1996-09-11 1996-09-11 Pattern matching method and method having fixed length shifting

Publications (2)

Publication Number Publication Date
KR19980020686A KR19980020686A (en) 1998-06-25
KR100223043B1 true KR100223043B1 (en) 1999-10-15

Family

ID=19473321

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019960039259A KR100223043B1 (en) 1996-09-11 1996-09-11 Pattern matching method and method having fixed length shifting

Country Status (1)

Country Link
KR (1) KR100223043B1 (en)

Also Published As

Publication number Publication date
KR19980020686A (en) 1998-06-25

Similar Documents

Publication Publication Date Title
KR100648258B1 (en) Context-based adaptive binary arithmetic decoder of pipeline structure for high speed decoding operation
JP3007496B2 (en) Variable length decoder
JP3224164B2 (en) decoder
US5696507A (en) Method and apparatus for decoding variable length code
CN1059995C (en) Method and device for synchronized recovery in length changable decoding device
US5055841A (en) High-speed feedforward variable word length decoder
US5208593A (en) Method and structure for decoding Huffman codes using leading ones detection
EP0589682B1 (en) Variable length code decoder
US6043765A (en) Method and apparatus for performing a parallel speculative Huffman decoding using both partial and full decoders
US5892791A (en) High-speed variable length decoding apparatus
US7487423B2 (en) Decoding method, medium, and apparatus
US5550542A (en) Variable length code look-up table having separate code length determination
JP2831888B2 (en) HDTV decoder
EP0798931B1 (en) Variable length decoder and method for decoding two codes per clock cycle
EP0925555B1 (en) Dual-speed variable length decoder and decoding architecture for mpeg-2 video data
JP2000503512A (en) Variable length decoding
EP0708565B1 (en) Variable-length decoding apparatus using relative addressing
US5432512A (en) Apparatus for decoding variable length codes
KR100223043B1 (en) Pattern matching method and method having fixed length shifting
US5701126A (en) High speed variable length decoder
US6049633A (en) Adaptive arithmetic codec method and apparatus
JPH05199122A (en) Decoding circuit
Park et al. Area efficient fast Huffman decoder for multimedia applications
JP2934603B2 (en) Method and apparatus for decoding variable length code
KR100487411B1 (en) Variable Length Decoder

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20120702

Year of fee payment: 14

FPAY Annual fee payment

Payment date: 20130701

Year of fee payment: 15

LAPS Lapse due to unpaid annual fee