KR100210384B1 - A quantizer - Google Patents

A quantizer Download PDF

Info

Publication number
KR100210384B1
KR100210384B1 KR1019960016004A KR19960016004A KR100210384B1 KR 100210384 B1 KR100210384 B1 KR 100210384B1 KR 1019960016004 A KR1019960016004 A KR 1019960016004A KR 19960016004 A KR19960016004 A KR 19960016004A KR 100210384 B1 KR100210384 B1 KR 100210384B1
Authority
KR
South Korea
Prior art keywords
data
ram
matrix
quantization
address
Prior art date
Application number
KR1019960016004A
Other languages
Korean (ko)
Other versions
KR970078642A (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 KR1019960016004A priority Critical patent/KR100210384B1/en
Priority to EP19970303247 priority patent/EP0808069B1/en
Priority to DE1997621373 priority patent/DE69721373T2/en
Priority to CN97104264A priority patent/CN1126375C/en
Priority to JP12415197A priority patent/JP4117044B2/en
Priority to US08/854,945 priority patent/US5881177A/en
Publication of KR970078642A publication Critical patent/KR970078642A/en
Application granted granted Critical
Publication of KR100210384B1 publication Critical patent/KR100210384B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/007Transform coding, e.g. discrete cosine transform
    • 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
    • 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/124Quantisation

Abstract

본 발명은 램, 램컨트롤러, 연산제어부, 연산부로 구성된 양자화기에 관한 것으로, 상기 램 컨트롤러(30)가 스캔방식에 관계없이 한쌍의 매트릭스 데이터가 동일한 메모리에 저장되지 않도록 상기 양자화 매트릭스를 저장하기 위한 라이트 어드레스를 발생하는 라이트 어드레스 발생수단; 상기 라이트 어드레스에 따라 저장되는 상기 양자화 매트릭스 데이터를 램(26)에 분배하는 데이터 분배수단(16); 양자화를 위한 매크로블록이 시작되면 상기 램(26)에 저장된 양자화 매트릭스를 읽어 오기 위해 스캔방식에 따라 해당 리드 어드레스를 발생하는 리드 어드레스 발생수단; 및 상기 리드 어드레스 발생수단에 의해 억세스된 램이 출력하는 데이터를 코딩방식 및 스캔방식에 따라 결합하여 상기 연산제어부(32)로 출력하는 데이터결합수단으로 구성되고, 상기 램이 복수개의 서브램을 갖는 제1 및 제2 메모리뱅크(RAM0, RAM1)로 구성되어 스캔방식에 따른 데이터 충돌을 방지함과 아울러 적은 용량의 메모리를 사용하여 양자화 매트릭스를 저장할 수 있으므로 전용칩(ASIC)화가 용이한 효과가 있다.The present invention relates to a quantizer including a RAM, a RAM controller, an operation control unit, and an operation unit. The RAM controller 30 writes the quantization matrix so that a pair of matrix data is not stored in the same memory regardless of a scanning method. Write address generating means for generating an address; Data distributing means (16) for distributing the quantization matrix data stored according to the write address to the RAM (26); Read address generating means for generating a corresponding read address according to a scan method to read a quantization matrix stored in the RAM 26 when a macroblock for quantization is started; And data combining means for combining the data output by the RAM accessed by the read address generating means according to a coding method and a scanning method and outputting the data to the operation controller 32, wherein the RAM has a plurality of sub-RAMs. It is composed of the first and second memory banks RAM0 and RAM1 to prevent data collision according to the scanning method and to store the quantization matrix using a small amount of memory, thereby making it easier to convert a dedicated chip (ASIC). .

Description

양자화기Quantizer

제1도는 일반적인 영상부호기를 나타낸 블록도.1 is a block diagram showing a general video encoder.

제2(a)도는 제1도에 나타낸 프레임 메모리부에 저장된 자연영상을 나타낸 도면.2 (a) is a view showing a natural image stored in the frame memory unit shown in FIG.

제2(b)도는 제2(a)도에 나타낸 자연영상을 8×8화소블록으로 분할한 영상을 나타낸 도면.FIG. 2 (b) shows an image obtained by dividing the natural video shown in FIG. 2 (a) into 8 × 8 pixel blocks.

제2(c)도는 제2(b)도에 나타낸 8×8화소블록이 이산여현변환기(DCT)에 의해 변환된 영상을 나타낸 도면.FIG. 2 (c) shows an image in which 8x8 pixel blocks shown in FIG. 2 (b) are converted by a discrete cosine transformer (DCT).

제2(d)도는 제2(c)도에 나타낸 이산여현 변환된 영상이 양자화기에 의해 양자화된 영상을 나타낸 도면.FIG. 2 (d) shows an image in which the discrete cosine transformed image shown in FIG. 2 (c) is quantized by a quantizer.

제3도는 본 발명에 따른 양자화기를 나타낸 블록도.3 is a block diagram illustrating a quantizer according to the present invention.

제4도는 제3도에 나타낸 램(RAM)과 램컨트롤러(RAMCON)를 나타낸 블록도이다.FIG. 4 is a block diagram illustrating a RAM and a RAMCON shown in FIG. 3.

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

10,12 : 제1 및 제2카운터 14,18 : 제1 및 제2PLA10,12: first and second counter 14,18: first and second PLA

16 : DIV 20 : CAT16: DIV 20: CAT

22,24 : 제1 및 제2멀티플렉서 26 : 램(RAM)22,24: first and second multiplexer 26: RAM

30 : 램컨트롤러(RAMCON) 32 : 연산제어부30: RAMCON 32: operation control unit

34 : 연산부(core)34: core

본 발명은 영상부호기에 있어서 양자화기에 관한 것으로, 특히 지그재그방식으로 다운로딩되어 메모리에 저장된 양자화 매트릭스를 지그재그(zigzag) 스캔방식이나 얼터네이트(alternate) 스캔방식으로 입력되는 영상 데이터의 스캔방식에 따라 적절하게 어드레싱하여 양자화가 수행되도록 된 양자화기에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a quantizer in an image encoder, and is particularly suitable according to a zigzag scan method or an alternate scan method of image data downloaded in a zigzag method and stored in a memory. The present invention relates to a quantizer that is addressed to perform quantization.

일반적으로 영상부호기에 있어서, 양자화기로 입력되는 영상 데이터는 이산여현 변환기(DCT)에 의해 이산여현 변환된 후 직접 양자화기로 입력되게 된다.In general, in an image encoder, image data input to a quantizer is discrete cosine transformed by a discrete cosine converter (DCT) and then directly input to a quantizer.

제1도는 일반적인 영상부호기를 나타낸 블록도인데, 이 영상부호기는 프레임 메모리부(100), 감산기(120), 이산여현 변환기(DCT:120), 양자화기(Q:140), 가변길이부호기(VLC:150), 역양자화기(IQ:160), 역이산여현변환기(IDCT:170), 가산기(180), 및 움직임보상부(MC:190)로 구성되어 있다.1 is a block diagram showing a general image encoder, which includes a frame memory unit 100, a subtractor 120, a discrete cosine transformer (DCT: 120), a quantizer (Q: 140), and a variable length encoder (VLC). 150), an inverse quantizer (IQ: 160), an inverse discrete cosine transformer (IDCT: 170), an adder 180, and a motion compensator (MC: 190).

이와 같은 영상부호기는 이미 잘 알려진 바와 같이, 프레임 메모리부(100)를 매개로 입력되는 현재 영상신호와 움직임 보상부(190;MC)로부터 입력되는 이전 영상신호가 감산기(102)로 입력되고, 이후 상기 감산기(102)로부터의 영상 데이터가 이산여현변환기(130)로 입력되어 이산여현 변환되게 된다. 다음에, 상기 이산여현 변환기(130)에 의해 이산여현 변화된 영상 데이터가 양자화기(140)로 입력되어 양자화가 수행되고, 양자화된 데이터가 지그재그 스캔 후 런랭쓰 부호화와 가변길이 부호화됨으로써 압축 부호화가 수행되게 된다.As the image encoder is well known, the current image signal input through the frame memory unit 100 and the previous image signal input from the motion compensator 190 (MC) are input to the subtractor 102, and then. The image data from the subtractor 102 is input to the discrete cosine converter 130 to perform discrete cosine conversion. Next, the discrete cosine-transformed image data by the discrete cosine converter 130 is input to the quantizer 140 to perform quantization, and the compression coding is performed by performing zigzag scan with run length coding and variable length coding. Will be.

제2(a) 내지(d)도는 비디오 카메라를 통해 촬상된 자연영상을 디지털로 변환하여 이산여현 변환 및 양자화하는 개념을 설명하기 위하여 도시한 도면이다.2 (a) to (d) are diagrams for explaining a concept of converting and quantizing discrete cosine by converting a natural image photographed through a video camera into digital.

제2(a)도는 제1도에 나타낸 프레임 메모리부에 저장된 자연영상을 나타낸 도면이고, 제2(b)도는 제2(a)도에 나타낸 자연영상을 8×8화소블록으로 분할한 영상을 나타낸 도면이며, 제2(c)도는 제2(b)도에 나타낸 8×8화소블록이 이산여현 변환기(DCT)에 의해 변환된 영상을 나타낸 도면이고, 제2(d)도는 제2(c)도에 나타낸 이상여현 변환된 영상이 양자화기에 의해 양자화된 영상을 나타낸 도면이다.FIG. 2 (a) shows a natural image stored in the frame memory unit shown in FIG. 1, and FIG. 2 (b) shows an image obtained by dividing the natural image shown in FIG. 2 (a) into 8 × 8 pixel blocks. FIG. 2 (c) shows an image in which the 8x8 pixel block shown in FIG. 2 (b) is converted by the discrete cosine converter (DCT), and FIG. 2 (d) is the second (c). FIG. 11 shows an image of an abnormal cosine transformed image quantized by a quantizer.

여기서, 제2(a)도에 나타낸 도면은 한장의 자연영상, 예컨대 352×288 화소를 8×8화소의 정방형 화소블록으로 분할한 후 각각의 화소블록이 순차적으로 이산여현 변환기로 입력되는 영상을 나타낸다.Here, the diagram shown in FIG. 2 (a) shows one natural image, for example, 352 × 288 pixels divided into 8 × 8 pixel square pixel blocks, and then each pixel block is sequentially input to a discrete cosine converter. Indicates.

그리고, 제2(b)도에 나타낸 도면은 제2(a)도에 도시된 자연영상의 8×8화소블록으로서 2차원 공간상에 a1내지 a64로 할당된 것을 나타내고, 제2(c)도는 제2(b)도에 나타낸 8×8화소블록이 이산여현 변환되어 저주파항(1)부터 고주파항(2)으로 분리되어 순차적으로 분포된 것(b1∼b64)을 나타낸다.2 (b) shows that 8 × 8 pixel blocks of the natural image shown in FIG. 2 (a) are allocated from a 1 to a 64 in a two-dimensional space, ) shows the turning of claim 2 (b) is Ido 8 × 8 pixel block illustrated in the discrete cosine transform from the low-frequency section (1) separated by a high frequency, wherein (2) the distribution in sequence (b 1 ~b 64).

또한, 제2(d)도는 제2(c)도와 같이 이산여현 변환된 후의 각 계수를 소정 제수(除數), 즉 양자화스텝 및 양자화 매트릭스로 나누어 양자화된 블록을 나타낸 것이다. 제2(a) 내지(d)도에서 순차적으로 보여지는 바와 같이 DCT 및 양자화를 통해 데이터가 압축되는 것을 알 수 있다.FIG. 2 (d) shows a quantized block by dividing each coefficient after the discrete cosine transform into a predetermined divisor, that is, a quantization step and a quantization matrix as shown in FIG. 2 (c). It can be seen that data is compressed through DCT and quantization, as shown sequentially in FIGS. 2 (a) to (d).

이와 같은 일반적인 영상부호화기에 있어서 종래에는 영상 데이터가 양자화된 후 스캔과정이 수행되었으나 영상부호기를 설계하는 실제적인 면에 있어서 시간지연(latency)의 문제 때문에 스캔과정이 이산여현 변환후 즉, 양자화 이전에 처리되는 것이 요구되었다.In the conventional video encoder, the scanning process is conventionally performed after the quantization of the image data. However, in the practical aspect of designing the image encoder, the scanning process is performed after the discrete cosine transform, that is, before the quantization. It was required to be processed.

그런데, 이와 같이 양자화 이전에 스캔동작이 이루어질 경우에 MPEG-2에서 지원하는 스캔동작이 지그재그 방식과 얼터네이트 방식이 있으므로, 양자화기는 적어도 이 두가지 방식을 지원할 수 있어야 한다.However, when a scan operation is performed before quantization as described above, since the scan operation supported by MPEG-2 includes a zigzag method and an alternate method, the quantizer must support at least these two methods.

즉, MPEG에 있어서 양자화는 공간주파수에 따라 가중치를 달리 하는 적응 양자화방식이고, 이를 위해 인트라 블록이 양자화를 위한 가중치 매트릭스(이하, intra quantizer matrix라 함)와 인터블록의 양자화를 위한 가중치 매트릭스[이하, intra(또는 nonintra) quantizer matrix라 함]를 필요로 하는데, 이들 매트릭스의 입력(또는 전송)순서는 지그재그 방식 하나로 권고되어 있으나 영상 데이터의 입력 순서는 스캔방식에 따라 달라진다. 따라서, 양자화 이전에 스캔이 이루어지기 위해서는 스캔방식에 따라 매트릭스의 순서와 데이터의 순서를 일치시켜줘야 한다.In other words, in MPEG, quantization is an adaptive quantization scheme in which weights are varied according to spatial frequencies. For this purpose, an intra block is a weight matrix for quantization (hereinafter, referred to as an intra quantizer matrix) and a weight matrix for quantization of an interblock. In this case, the input (or transmission) order of these matrices is recommended as one of the zigzag methods, but the input order of the image data varies depending on the scanning method. Therefore, in order to scan before quantization, the order of the matrix and the order of data must be matched according to the scanning method.

특히, 영상부호화를 신속하게 처리하기 위하여 양자화기에서 2픽셀씩 동시에 처리할 경우에 입력 데이터쌍과 매트릭스쌍을 정확하게 매칭시킬 필요가 있다.In particular, in order to process image encoding quickly, it is necessary to accurately match the input data pair and the matrix pair when the quantizer simultaneously processes two pixels.

이에 본 발명은 상기한 필요성을 충족시키기 위한 것으로, 지그재그(zigzeg)스캔방식이나 얼터네이트(alternate) 스캔방식으로 입력되는 영상 데이터를 해당 양자화 매트릭스와 양자화 스케일에 따라 양자화함에 있어서 메모리의 용량을 간소화하여 전용칩(ASIC)화를 용이하게 한 양자화기를 제공하는데 그 목적이 있다.Accordingly, the present invention is to meet the above-mentioned needs, and by simplifying the capacity of the memory in quantizing the image data input by the zigzeg scan method or alternate scan method according to the corresponding quantization matrix and quantization scale It is an object of the present invention to provide a quantizer for facilitating an ASIC.

상기한 바와 같은 목적을 달성하기 위하여 본 발명은, 소정의 양자화 매트릭스가 지그재그방식으로 다운 로딩되어 램에 저장된 것을 소정의 스캔방식으로 입력되는 영상 데이터의 스캔방식에 따라 램컨트롤러가 적절하게 어드레싱하여 양자화 매트릭스를 읽어 오고, 이 양자화 매트릭스의 역수 및 시스템제어부로부터 입력되는 양자화스케일값의 역수를 연산제어부에서 구한 후, 이 역수들과 입력된 상기 영상 데이터를 연산부에서 연산하여 양자화하도록 된 양자화기에 있어서, 상기 램 컨틀롤러가, 스캔방식에 따라 한쌍의 매트릭스 데이터가 동일한 메모리에 저장되지 않도록 상기 양자화 매트릭스를 저장하기 위한 라이트 어드레스를 발생하는 라이트 어드레스 발생수단; 상기 라이트 어드레스에 따라 저장되는 상기 양자화 매트릭스 데이터를 램에 분배하는 데이터 분배수단; 양자화를 위한 매크로블록이 시작되면 상기 램에 저장된 양자화 매트릭스를 읽어 오기 위해 스캔방식에 따라 해당 리드 어드레스를 발생하는 리드 어드레스 발생수단: 및 상기 리드 어드레스 발생수단에 의해 억세스된 램이 출력하는 데이터를 코딩방식 및 스캔방식에 따라 결합하여 상기 연산제어부로 출력하는 데이터결합수단으로 구성되고, 상기 램이, 인트라 및 인터 양자화 매트릭스를 저장하기 위한 제1 및 제2메모리뱅크로 구성되고, 상기 각 메모리뱅크가 복수개의 서브램으로 구성된 것을 특징으로 한다.In order to achieve the above object, according to the present invention, a RAM controller appropriately addresses and quantizes a predetermined quantization matrix, which is downloaded in a zigzag manner and stored in a RAM according to a scanning method of input image data. In the quantizer configured to read the matrix, obtain the inverse of the quantization matrix and the inverse of the quantization scale value input from the system control unit, and then calculate the reciprocals and the input image data in the operation unit. A write address generating means for generating a write address for storing the quantization matrix so that a RAM controller does not store a pair of matrix data in the same memory according to a scan method; Data distribution means for distributing the quantization matrix data stored according to the write address to a RAM; Read address generating means for generating a corresponding read address according to a scan method to read a quantization matrix stored in the RAM when a macroblock for quantization is started; and coding data output by a RAM accessed by the read address generating means A data combining means for combining and outputting to the operation control unit according to a scanning method and a scanning method, wherein the RAM comprises first and second memory banks for storing intra and inter quantization matrices, and each of the memory banks It is characterized by consisting of a plurality of sub-ram.

이와 같이 본 발명에 따른 양자화기는 2개의 메모리뱅크를 사용하고, 각 메모리뱅크가 3개의 서브램으로 구분되므로써 지그재그방식으로 저장된 한쌍의 매트릭스 데이터를 얼터네이트방식으로 읽어올 때 한쌍의 매트릭스 데이터가 동일 서브램에 저장되어 충돌되는 것을 방지할 수 있다. 따라서 양자화 매트릭스를 저장하기 위한 램의 용량을 줄일 수 있으며 이에 따라 전용칩(ASIC)화가 용이하게 된다.As described above, since the quantizer according to the present invention uses two memory banks and each memory bank is divided into three sub-RAMs, when a pair of matrix data stored in a zigzag method is read in alternate manner, the pair of matrix data is the same sub-band. It can be stored in RAM to prevent collision. Therefore, the capacity of the RAM for storing the quantization matrix can be reduced, thereby facilitating the dedicated chip (ASIC).

이하, 첨부한 예시도면을 참고하여 본 발명에 따른 실시예를 상세히 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

먼저, MPEG-2에 있어서 양자화(quantization)는 이산여현 변환(DCT)과 같이 8×8블록단위로 처리되는데, 이산여현 변환된 계수를 코딩방식에 따라(인트라 코딩인지 또는 인터코딩인지) 해당 양자화 매트릭스로 나눈 후, 다시 레이트 컨트롤(rate control)방법에 의해 정해진 양자화 스케일로 나누어 발생되는 데이터량을 줄이는 것이다.First, in MPEG-2, quantization is processed in 8 × 8 block units, such as a discrete cosine transform (DCT). The quantization of the discrete cosine transformed coefficients according to a coding scheme (either intra coding or inter coding) is performed. After dividing by the matrix, the amount of data generated by dividing by the quantization scale determined by the rate control method is reduced.

여기서, 양자화 매트릭스는 앞서 설명한 바와 같이 적응 양자화 방식에서 인간의 시각특성등을 고려하여 공간 주파수에 따라 가중치를 달리 부여하기 위한 것으로서, 영상 데이터와 대응되게 8x8매트릭스의 크기를 가지며, 인트라 블록(intra coded block)의 양자화를 위한 매트릭스(intra quantizer matrix)와 인터블록(inter coded block)의 양자화를 위한 매트릭스(non_intra quantizer matrix)로 구분된다. 이때, MPEG2에서는 인트라 및 인터 양자화 매트릭스로서 사용자가 임으로 정의한 매트릭스(user defined matrix)를 사용하거나 미리 정의된 디폴트 매트릭스(default matrix)를 사용하도록 권고하고 있다. 따라서, 사용자가 매트릭스를 임으로 정의하여 사용할 경우에는 부호화단(송신)에서 복호화단(수신)으로 그 양자화 매트릭스를 MPEG 비트스트림상의 헤더로 전송해 주어야 하고, 디폴트 테이블을 사용할 경우 양자화 매트릭스는 다음 표 1 및 표 2와 같이 정해져 있다. 이때, 양자화 매트릭스는 지그재그방식으로 다운로드 되도록 권고되어 있다.As described above, the quantization matrix is designed to assign weights differently according to spatial frequencies in consideration of human visual characteristics in the adaptive quantization scheme. The quantization matrix has an 8x8 matrix and corresponds to image data. An intra quantizer matrix for quantization of blocks and a non_intra quantizer matrix for quantization of inter coded blocks are divided. In this case, MPEG2 recommends that a user defined matrix or a default matrix is used as an intra and inter quantization matrix. Therefore, when the user randomly defines and uses a matrix, the quantization matrix should be transmitted from the encoding end (transmitter) to the decoding end (reception) as a header on the MPEG bitstream. And as shown in Table 2. At this time, it is recommended that the quantization matrix is downloaded in a zigzag manner.

상기 표 1에서와 같이, 인트라 양자화 매트릭스는 저주파대에서는 양자화간격을 좁게(세밀하게) 하고, 고주파대에서는 양자화를 거칠게(coarse)수행한다. 이는 저주파부분의 화질에 다란 영향을 주나 고주파부분에는 커다란 영향을 주지 않게 된다. 또한, 인터블록은 움직임 보상에 의해 차분영상을 부호화한 것이기 때문에, 대부분의 데이터가 저주파부분에만 있고 고주파부분은 적어서 상기 표 2와 같이 균등하게 가중치를 부여한다.As shown in Table 1, the intra quantization matrix narrows (quantizes) the quantization interval in the low frequency band and performs quantization coarse in the high frequency band. This affects the picture quality of the low frequency part but does not affect the high frequency part. In addition, since the interblock is obtained by encoding a differential image by motion compensation, most of the data is only in the low frequency part and the high frequency part is small, so that the weight is evenly distributed as shown in Table 2 above.

또한, 양자화 스케일은 레이트 컨트롤(또는, 버퍼 컨트롤이라고도 한다)방법에 따라 부호화시에 발생되는 데이터량을 적절히 제어하기 위하여 부호화되는 원영상의 복잡도(activity)와 버퍼의 충만도(fullness)등에 의해 결정되는데, MPEG2에서 부호화시에 정해진 양자화 스케일 값은 비트스트림의 헤더(예컨대, q_scale_type, quantizer_scale_code)를 통해 복호화단으로 전달되게 된다.In addition, the quantization scale is determined by the complexity of the original image and the fullness of the buffer in order to properly control the amount of data generated at the time of encoding according to the rate control (or also called buffer control) method. In MPEG2, the quantization scale value determined at the time of encoding is transmitted to the decoder through a header (eg, q_scale_type, quantizer_scale_code) of the bitstream.

이어서, 상기와 같은 MPEG 양자화에 대한 이해를 바탕으로 본 발명에 따른 양자화기를 설명한다.Next, the quantizer according to the present invention will be described based on the above understanding of MPEG quantization.

제3도는 본 발명에 따른 양자화기를 나타낸 블록도이고, 제4도는 제3도에 나타낸 램(RAM)과 램컨트롤러(RAMCON)를 도시한 세부 블록도이다.FIG. 3 is a block diagram showing a quantizer according to the present invention, and FIG. 4 is a detailed block diagram showing a RAM and a RAMCON shown in FIG.

본 발명의 양자화기는 제3도에 도시된 바와 같이, 램 컨트롤러(30), 램(26), 연산제어부(32), 연산부(34)로 구성되어 도시되지 않은 시스템제어부로부터 양자화 매트릭스와 양자화 스케일(quant_scale_type, quant_scale_code)을 다운로딩 받고, 이산여현 변환기로부터 영상 데이터를 입력받아 양자화를 수행한다.As shown in FIG. 3, the quantizer of the present invention is composed of a RAM controller 30, a RAM 26, an operation controller 32, and an operation unit 34. quant_scale_type, quant_scale_code) are downloaded, and image data is input from a discrete cosine converter to perform quantization.

먼저, 제3도 및 제4도를 설명함에 있어서 이해를 쉽게 하기 위하여 각 블록으로 입출력되는 신호들에 대해 개괄적으로 정의한 후, 각 구성블록별로 설명한다.First, in order to facilitate understanding in FIG. 3 and FIG. 4, the signals inputted to and outputted from each block are generally defined, and then described for each component block.

제3도에 있어서, CLK는 시스템 클록이고, RST는 액티브 로우로 동작하는 리셋신호이다.In FIG. 3, CLK is a system clock and RST is a reset signal operating in active low.

그리고, ID_CD는 도시되지 않은 시스템 제어부로부터 입력되는 양자화 매트릭스의 식별자(ID)와 식별자에 이어 입력되는 양자화 매트릭스 데이터(CD)이고, flag_ID는 현재 입력되는 ID_CD가 식별자(ID)인지를 나타내는 신호로서 예컨대, flag_ID가 '하이'이면 ID_CD로 ID가 입력되는 것을 나타낸다. 여기서, ID는 부호화기에서 양자화 매트릭스를 구분하기 위하여 정의된 매트릭스 식별자로서, 이것에 의해 입력되는 양자화 매트릭스가 인트라 또는 인터인지를 구분할 수 있다.ID_CD is an identifier (ID) of a quantization matrix input from a system controller (not shown) and quantization matrix data (CD) input following the identifier, and flag_ID is a signal indicating whether the ID_CD currently input is an identifier (ID). If flag_ID is 'high', ID is inputted to ID_CD. Here, ID is a matrix identifier defined in order to distinguish the quantization matrix from the encoder, and it can distinguish whether the input quantization matrix is intra or inter.

또한, mbs는 매크로 블록의 시작(macroblock start)을 나타내는 신호이고, quant_scale_code와 quant_scale_type은 양자화 스케일의 값을 표시하기 위해 MPEG2에서 정의된 신호로서 MPEG권고안(MPEG IS: Table7-6)에서와 같이 quant_scale_type이 0이냐 1이냐와 5비트의 quant_scale_code값에 따라 양자화 스케일의 값이 정해진다.Also, mbs is a signal indicating a macroblock start, and quant_scale_code and quant_scale_type are signals defined in MPEG2 to indicate the value of the quantization scale, and quant_scale_type is defined as in the MPEG recommendation (MPEG IS: Table 7-6). The value of the quantization scale is determined by 0 or 1 and a 5-bit quant_scale_code value.

이러한 값들은 도시되지 않은 레이트 컨트로부와 시스템제어부에 의해 정해져서 본 발명에 따른 양자화기로 입력됨과 아울러 복호화단으로도 전송되어야 한다.These values are determined by a rate controller and a system controller (not shown), input to the quantizer according to the present invention, and transmitted to the decoding end.

그리고, dc_pre는 MPEG2에서 픽쳐_코딩_익스텐션에 있는 2비트의 신호로서, 인트라 블록에서 DC계수의 크기(정밀도)를 나타낸 것으로 예컨대, 0이면 DC계수가 8비트로 표현된 것을 나타내고 3이면 11비트로 표현된 것을 나타낸다.In addition, dc_pre is a 2-bit signal in the picture_coding_extension in MPEG2, which indicates the magnitude (precision) of the DC coefficient in the intra block. For example, 0 indicates that the DC coefficient is expressed in 8 bits and 3 indicates 11 bits. Indicates that

또한, data_even 및 data_odd는 이산여현 변화기로부터 입력되는 2픽셀 단위의 데이터이고, Quant_even 및 Quant_odd는 입력된 2픽셀의 데이터가 양자화되어 출력되는 데이터를 나타낸다.In addition, data_even and data_odd are data of a unit of 2 pixels input from the discrete cosine transformer, and Quant_even and Quant_odd represent data that is output by quantizing the input 2 pixel data.

제3도에 있어서, 램(26)은 도시되지 않은 시스템 제어부로부터 입력되는, 사용자 정의에 의한 매트릭스나 디폴트 매트릭스를 저장하기 위한 메모리로서, 앞서 설명한 바와 같이 인트라 양자화 매트릭스와 인터 양자화 매트릭스로 구분되므로 이들을 각각 저장하기 위하여 적어도 2개의 8비트 64워드 메모리뱅크가 필요하게 된다.In FIG. 3, the RAM 26 is a memory for storing a user-defined matrix or a default matrix, which is input from a system controller (not shown), and is divided into an intra quantization matrix and an inter quantization matrix as described above. At least two 8-bit 64-word memory banks are required to store each.

그런데, 양자화 매트릭스는 지그재그방식으로 다운로딩되나 영상데이터는 지그재그방식이나 얼터네이트방식으로 입력되므로, 지그재그방식으로 저장된 매트릭스를 얼터네이트방식으로 읽어가기 위하여 어드레스변환이 요구된다. 더욱이, 양자화처리를 2픽셀단위로 동시에 처리하기 위해서는 한쌍의 매트릭스를 읽어낼 필요가 있는데, 8비트 64워드를 하나의 램으로 구현할 경우 동일 메모리의 다른 어드레스에 저장된 한쌍의 매트릭스 데이터를 동시에 억세스할 수 없으므로, 본 발명에 따른 램(26)에서는 64워드의 메모리를, 동시에 억세스할 수 있는 3개의 서브램으로 구분한 후, 지그재그방식으로 저장된 데이터를 얼터네이트방식으로 읽을 경우에 한쌍의 매트릭스 데이터가 동일한 서브램에 저장되지 않도록 한 것이다.However, since the quantization matrix is downloaded in a zigzag manner but the image data is input in a zigzag manner or an alternate manner, an address conversion is required in order to read the matrix stored in the zigzag manner in the alternate manner. Furthermore, in order to simultaneously process the quantization process in units of 2 pixels, it is necessary to read a pair of matrices. When an 8-bit 64 word is implemented as one RAM, a pair of matrix data stored at different addresses of the same memory can be simultaneously accessed. Therefore, in the RAM 26 according to the present invention, when a 64 word memory is divided into three sub-RAMs which can be accessed at the same time, a pair of matrix data is the same when the data stored in the zigzag method is read in the alternate method. It is not stored in the sub ram.

이를 위하여 본 발명의 램(26)은 제4도에 도시된 바와 같이, 인트라 양자화 매트릭스를 저장하기 위한 제1메모리뱅크(RAM0)와 인터양자화 매트릭스를 저장하기 위한 제2메모리뱅크(RAM1)로 구분되어 있다. 여기서, 제1메모리뱅크(RAM0)는 8비트×22워드로 이루어진 2개의 서브램(OP_RAM0-1, OP_RAM0-2)과 8비트×20워드로 이루어진 1개의 서브램(OP_RAM1)으로 구성되고, 제2메모리뱅크(RAM0)는 8비트×22워드로 이루어진 2개의 서브램(OP_RAM0-1', OP_RAM0-2')과 8비트×20워드로 이루어진 1개의 서브램(OP_RAM1')으로 구성된다.To this end, the RAM 26 of the present invention is divided into a first memory bank RAM0 for storing an intra quantization matrix and a second memory bank RAM1 for storing an inter quantization matrix, as shown in FIG. It is. The first memory bank RAM0 includes two sub-RAMs OP_RAM0-1 and OP_RAM0-2 composed of 8 bits × 22 words and one sub-RAM OP_RAM1 composed of 8 bits × 20 words. The two memory banks RAM0 are composed of two sub-RAMs OP_RAM0-1 'and OP_RAM0-2' composed of 8 bits x 22 words and one sub-RAM (OP_RAM1 ') composed of 8 bits x 20 words.

그리고, 제1서브램(OP_RAM0-1, OP_RAM-1')은 어드레스(add1)에 의해 각각 억세스되어 8비트 데이터(dat1a, data2a)를 각각 입출력하는데, 이때 어드레스(add1)는 앞서와 같이 22워드이므로 00∼15이고, 제1PLA(14)나 제1멀티플랙서(22)로부터 입력된다. 제2서브램(OP_RAM0-2, OP_RAM-2')은 어드레스(add2)에 의해 각각 억세스되어 8비트 데이터(dat1b, data2b)를 각각 입출력하는데, 이때 어드레스(add2)는 앞서와 같이 22워드이므로 00∼15이고, 제1PLA(14)나 제1멀티플랙서(22)로부터 입력된다. 그리고, 제3서브램(OP_RAM0-3, OP_RAM-3')은 어드레스(add3)에 의해 각각 억세스되어 8비트 데이터(dat1c, data2c)를 각각 입출력하는데, 이때 어드레스(add3)는 앞서와 같이 20워드이므로 00∼13이고, 제1PLA(14)나 제1멀티플랙서(22)로부터 입력된다.The first sub-rams OP_RAM0-1 and OP_RAM-1 'are respectively accessed by the address add1 to input and output 8-bit data dat1a and data2a, respectively, where the address add1 is 22 words as described above. Since it is 00-15, it is input from the 1st PLA 14 and the 1st multiplexer 22. As shown to FIG. The second sub-rams OP_RAM0-2 and OP_RAM-2 'are each accessed by the address add2 to input and output 8-bit data dat1b and data2b, respectively. In this case, since the address add2 is 22 words as described above, 00 It is -15 and is input from the 1st PLA 14 and the 1st multiplexer 22. In FIG. The third sub-rams OP_RAM0-3 and OP_RAM-3 'are respectively accessed by the address add3 to input and output 8-bit data dat1c and data2c, respectively. In this case, the address add3 has 20 words as described above. Since it is 00-13, it is input from the 1st PLA 14 and the 1st multiplexer 22. As shown to FIG.

또한, 램컨트롤러(30)는 시스템 클럭(CLK)과 리셋(RST)신호에 따라 동작하여 ID_CD를 통해 입력되는 양자화 매트릭스를 램(26)에 저장하고, 램(26)에 저장된 양자화 매트릭스를 읽어 연산제어부(32)로 출력하기 위한 것이다.In addition, the RAM controller 30 operates according to the system clock CLK and the reset RST signal to store the quantization matrix input through ID_CD in the RAM 26, and reads the quantization matrix stored in the RAM 26. This is for outputting to the control unit 32.

이러한 램컨트롤러(30)는 제4도에 도시된 바와 같이, 제1카운터(10), 제1PLA(14), DIV(16), 제2카운터(12), 제2PLA(18), 제1멀티플랙서(22), 제2멀티플랙서(24), CAT(20)로 구성되어 플래그_아이디(flag_ID)가 하이(high)인 동안 아이디_시디(ID_CD)를 통해 입력되 ID를 해석하여 어느 양자화 매트릭스인지를 식별한 후, 이어서 입력되는 양자화 매트릭스 데이터(CD:Cuatomer Data)를 상기 램(26)의 해당 메모리뱅크에 저장함과 아울러 매크로블록의 시작신호(mbs)에 동기되어 메모리뱅크에 저장된 매트릭스 데이터를 읽어 연산제어부(32)로 출력한다.As shown in FIG. 4, the RAM controller 30 includes a first counter 10, a first PLA 14, a DIV 16, a second counter 12, a second PLA 18, and a first multi. It consists of a flexor 22, a second multiplexer 24, and a CAT 20, and interprets the ID inputted through ID_CD while the flag_ID is high. After identifying whether it is a quantization matrix, the quantization matrix data (CD) which is subsequently input is stored in the corresponding memory bank of the RAM 26 and the matrix stored in the memory bank in synchronization with the start signal (mbs) of the macroblock. The data is read and output to the operation control unit 32.

제4도에 있어서, 램 컨트롤러(30)의 제1카운터(10)와 제1PLA(14)는 도시되지 않은 시스템제어부로부터 입력되는 매트릭스 데이터를 메모리뱅크(RAM0, RAM1)에 저장하기 위한 라이트 어드레스 발생부이고, DIV(16)는 ID_CD로 입력되는 매트릭스 데이터를 메모리뱅크의 해당 서브램으로 분배하기 위한 분배부이며, 제2카운터(12)와 제1 및 제2 PLA(14,18), 및 제1멀티플랙서(22)는 램(26)에 저장된 양자화 매트릭스를 읽어가기 위한 리드 어드레스 발생부이고, 제2카운터(12)와 CAT(20) 및 제2멀티플랙서(24)는 리드 어드레스에 의해 읽힌 데이터를 결합하여 스캔방식에 따라 적절하게 출력하기 위한 데이터결합부이다.In FIG. 4, the first counter 10 and the first PLA 14 of the RAM controller 30 generate a write address for storing matrix data input from a system controller not shown in the memory banks RAM0 and RAM1. DIV 16 is a distribution unit for distributing the matrix data input by ID_CD to the corresponding sub-RAM of the memory bank, the second counter 12 and the first and second PLAs 14 and 18, and The first multiplexer 22 is a read address generator for reading the quantization matrix stored in the RAM 26, and the second counter 12, the CAT 20, and the second multiplexer 24 are connected to the read address. Is a data combiner for combining the data read by the data and outputting the data properly according to the scanning method.

즉, 제1카운터(10)는 리세트신호(RST)에 의해 카운트값을 클리어시킨 후 클럭(CLK)에 따라 카운트하여 카운트값을 발생한다. 이때, 플래그_아이디(flag_ID)가 하이(high)인 동안 아이디_시디(ID_CD)로 입력되는 ID데이터를 해석하여 인트라 또는 인터 양자화 매트릭스인지를 확인한 후, ID가 맞으면 카운트값을 제 1PLA(14)와 DIV(16)로 출력한다.That is, the first counter 10 clears the count value by the reset signal RST and counts according to the clock CLK to generate a count value. At this time, while the flag_ID is high, the ID data inputted to the ID_CD is analyzed to determine whether it is an intra or inter quantization matrix, and if the ID is correct, the count value is set to the first PLA 14. And to DIV (16).

이어서 제1 PLA(14)는 제1카운터(10)의 출력에 따라, 지그재그방식으로 저장된 매트릭스 데이터를 얼터네이트방식으로 읽을 경우에 한쌍의 매트릭스 데이터가 동일한 서브램에 저장되지 않도록 다음 표 3과 같이 어드레스(add1∼add3)를 발생한다.Subsequently, when the first PLA 14 reads the zigzag matrix data stored in the zigzag method alternately according to the output of the first counter 10, the first PLA 14 does not store the pair of matrix data in the same sub-RAM as shown in Table 3 below. Addresses add1 to add3 are generated.

상기 표 3에서와 같이, 제 1 PLA(14)는 제1카운터의 카운트값이 0이면 제1서브램(OP_RAM0-1, OP_RAM0-1')으로 00(add1), 제2서브램(OP_RAM0_2, OP_RAM0-2')으로 00(add2) 어드레스를 출력한다. 따라서, 매트릭스 데이터는 카운트값이 0일 경우에는 제1 서브램(OP_RAM0-1, OP_RAM0-1')의 0번지와 제2서브램(OP_RAM0-2, OP_RAM0-2')의 0번지에 저장된다. 이어서, 카운트값이 1이면 제1 PLA(14)는 제2서브램(OP_RAM0-2. OP_RAM0-2')으로 1 어드레스(add2)를 출력하고, 제3서브램(OP_RAM2, OP_RAM2')으로 0어드레스를 출력한다. 따라서, 매트릭스 데이터는 카운트값이 1일 경우에는 제2서브램의 1번지와 제3서브램의 0번지에 저장된다. 동일한 방식으로 카운트값이 00부터 1F까지(0∼31)변함에 따라 제1 및 제2서브램으로 00∼15(0∼21)까지의 어드레스(add1, add2)를 출력하고, 제3서브램으로 00∼13(0∼19)까지의 어드레스(add3)를 출력한다. 다시 말하면, 제 1PLA(14)는 제1카운터의 출력에 따라 제1 및 제2서브램을 위한 어드레스와 제3서브램을 억세스하기 위한 어드레스를 발생한다.As shown in Table 3, when the count value of the first counter is 0, the first PLA 14 is 00 (add1) as the first subram (OP_RAM0-1, OP_RAM0-1 '), and the second subram (OP_RAM0_2, OP_RAM0-2 ') outputs an address 00 (add2). Therefore, when the count value is 0, the matrix data is stored at address 0 of the first sub-ram (OP_RAM0-1 and OP_RAM0-1 ') and address 0 of the second subram (OP_RAM0-2 and OP_RAM0-2'). . Subsequently, when the count value is 1, the first PLA 14 outputs one address add2 to the second sub-ram (OP_RAM0-2. OP_RAM0-2 ') and 0 to the third sub-ram (OP_RAM2 and OP_RAM2'). Output the address. Therefore, when the count value is 1, the matrix data is stored in address 1 of the second subram and address 0 of the third sublam. In the same manner, as the count value changes from 00 to 1F (0 to 31), the first and second subrams output addresses (add1 and add2) from 00 to 15 (0 to 21), and the third subram To add addresses 3 to 00 to 13 (0 to 19). In other words, the first PLA 14 generates an address for accessing the first and second subrams and an address for accessing the third subram according to the output of the first counter.

이때, 입력되는 양자화 매트릭스가 인트라이면 제1메모리뱅크(RAM0)의 서브램들에 저장되고, 인터이면 제2메모리뱅크(RAM1)의 서브램들에 저장된다.In this case, when the input quantization matrix is intra, the quantization matrix is stored in the sub-rams of the first memory bank RAM0. If the input quantization matrix is intra, it is stored in the sub-rams of the second memory bank RAM1.

또한, DIV(16)는 ID-CD를 통해 16비트로 입력되는 매트릭스 데이터를 제1카운터의 출력에 따라 적절히 분배하여 3개의 서브램(각각 8비트램)에 출력하는데, 이때 제1카운터값에 따라 데이터가 서브램에 할당되는 것은 다음 표 4와 같다. 여기서, ID_CD를 통해 입력되는 양자화 매트릭스는 지그재그방식으로 로딩되어 메모리에 순차적으로 저장된다.In addition, the DIV 16 properly distributes the matrix data input in 16 bits through the ID-CD according to the output of the first counter and outputs the data to three sub-rams (each 8-bit RAM). Data assigned to the sub-RAM is shown in Table 4 below. Here, the quantization matrix input through ID_CD is loaded in a zigzag manner and sequentially stored in the memory.

상기 표 4에 있어서, DIV(16)는 제1카운터로부터 입력되는 카운트값이 0이면 ID-CD를 통해 입력되는 16비트 매트릭스 데이터를 제 1서브램(OP_RAM0-1, OP_RAM0-1')과 제 2서브램(OP_RAM0-2, OP_RAM0-2')으로 분배하여 저장시키고, 카운터값이 1이면 ID-CD를 통해 입력되는 16비트 매트릭스 데이터를 제 3서브램과 제 2서브램으로 분배하여 저장시킨다. 동일한 방식으로 카운트값이 00부터 1F가 될 때까지 3개의 서브램들에 데이터버스(data1a/data2a, data1b/data2b, data1c/data2c)를 통해 16비트의 데이터를 적절히 배분한다. 이때, 동일한 카운트값에 대해서 상기 표 3에 의해 어드레스가 할당된 서브램과 상기 표 4에 의해 데이터가 분배되는 서브램이 일치해야 한다. 그리고, 시스템제어부로부터 입력되는 양자화 매트릭스의 순서는 지그재그방식에 따른 순서이므로, 제 1PLA(14)는 결국 지그재그방식으로 입력되는 데이터를 각 서브램에 순차적으로 저장하기 위한 것이며, 따라서 입력영상 데이터가 지그재그방식일 경우 제 1PLA는 리드 어드레스 발생을 위해서도 이용될 수 있다.In Table 4, when the count value input from the first counter is 0, the 16-bit matrix data input through the ID-CD and the first subram (OP_RAM0-1 and OP_RAM0-1 ') and the first sub-RAM are input. It divides and stores 2 sub-rams (OP_RAM0-2 and OP_RAM0-2 '). If the counter value is 1, 16-bit matrix data input through ID-CD is distributed to 3 sub ram and 2 sub ram. . In the same manner, 16 bits of data are appropriately distributed through the data buses data1a / data2a, data1b / data2b, and data1c / data2c to the three subrams until the count value is 00 to 1F. At this time, the sub-RAM to which the address is allocated according to Table 3 and the sub-RAM to which data is distributed according to Table 4 must match for the same count value. Since the order of the quantization matrix input from the system control unit is in the order of the zigzag method, the first PLA 14 eventually stores the data input in the zigzag method sequentially in each sub-ram, and thus the input image data is zigzag. In the case of the scheme, the first PLA may also be used for generating a read address.

한편, 제2카운터(12)는 리셋트신호(RST)에 의해 카운트값을 클리어시킨 후 클록신호에 따라 카운트하는데, 매크로블록 시작신호(mbs)의 상승신호가 검출된 후 카운트 출력(카운터 시퀀스 스트림:counter sequence stream)을 시작하여 변환 어드레스 발생부(19)와 데이터결합부(CAT:20)로 보낸다.On the other hand, the second counter 12 counts according to the clock signal after clearing the count value by the reset signal RST. After the rising signal of the macroblock start signal mbs is detected, the second counter 12 outputs the count (counter sequence stream). It starts with the: counter sequence stream and sends it to the translation address generator 19 and the data combiner (CAT: 20).

그리고, 변환 어드레스발생부(19)는 지그재그방식으로 저장된 매트릭스 데이터를 지그재그방식으로 읽어가기 위한 어드레스를 발생하는 제 1PLA(14)와 지그재그방식으로 저장된 양자화 매트릭스를 얼터네이트방식으로 읽어 가기 위한 어드레스를 발생하는 제2 PLA(18)로 구성된다. 여기서, 제 1PLA(14)는 라이트 어드레스 발생부의 제 1PLA(14)와 동일하게 구성되어 제2카운터 출력(카운트값)에 따라, 상기 표 3과 같이 지그재그방식의 리드 어드레스를 발생한다.The conversion address generating unit 19 generates an address for reading the first PLA 14 to generate an address for reading the zigzag matrix data stored in the zigzag manner and the quantization matrix stored in the zigzag manner alternately. It is composed of a second PLA (18). Here, the first PLA 14 is configured in the same manner as the first PLA 14 of the write address generator, and generates a zigzag read address according to the second counter output (count value) as shown in Table 3 above.

또한, 제 2PLA(18)는 제2카운터(12)의 출력에 따라, 지그재그방식으로 저장된 매트릭스 데이터를 얼터네이트 방식으로 읽어가기 위한 어드레스를 다음 표 5와 같이 발생한다.In addition, according to the output of the second counter 12, the second PLA 18 generates an address for reading matrix data stored in a zigzag manner in the alternate manner as shown in Table 5 below.

상기 표 5에 있어서, --는 돈캐어(don't care)이다, 상기 표 5에서와 같이 제 2PLA(18)는 제 2카운터의 출력(카운트값)에 따라 제1내지 제3서브램으로부터 매트릭스 데이터를 읽어 오기 위한 어드레스(add1∼add3)를 발생한다. 즉, 카운트값이 0일 때 제1서브램과 제3서브램의 00번지로부터 데이터를 읽어 오게 어드레스를 발생하고, 1일 때 제2서브램의 01번지와 제3서브램의 02번지에 저장된 데이터를 읽어 오도록 어드레스를 발생한다. 동일한 방식으로 카운트값이 2일 때 제1서브램의 01번지와 제2서브램의 00번지를 억세스하여 데이터를 읽어 오게 하고, 3일 때 제2서브램의 02번지와 제3서브램의 01번지를 억세스하여 데이터를 읽어 오게 한다. 여기서, 서브램에 지그재그방식으로 저장된 매트릭스 데이터를 얼터네이트방식으로 읽어오기 위하여 제 2PLA(18)가 발생하는 어드레스가 비순차적으로 발생되는 것을 알 수 있다. 이는 스캔방식에 따라 데이터의 순서가 틀리기 때문이며, 한쌍의 매트릭스 데이터를 제 2PLA(18)에 의해 읽어옴에 있어서 데이터 충돌이 일어나지 않도록 매트릭스 데이터를 저장할 때 제 1PLA(14)에 의해 3개의 서브램에 적당히 분산시켜 놓았다.In Table 5,-is don't care, and as shown in Table 5, the second PLA 18 is moved from the first to third subrams according to the output (count value) of the second counter. Addresses (add1 to add3) for reading the matrix data are generated. That is, when the count value is 0, an address is generated to read data from 00 of the first and third subrams, and when 1, the address is stored at 01 of the second sublamb and 02 of the third sublamb. Generates an address to read data. In the same way, when the count value is 2, it reads the data by accessing address 01 of the first subram and address 00 of the second sublam, and when 3 counts 01 of the second subram and 01 of the third sublam. Access the address to read the data. Here, it can be seen that an address generated by the second PLA 18 is generated out of order in order to read matrix data stored in a zigzag manner in an alternate manner. This is because the order of the data is different according to the scanning method. When storing the matrix data so that no data collision occurs when reading a pair of matrix data by the second PLA 18, the first PLA 14 properly stores the data in three sub-RAMs. Dispersed.

그리고, 제1멀티플랙서(22)는 도시되지 않은 시스템제어부로부터 스캔방식신호(zz_alter)를 입력받아 상기 제1PLA(14)의 출력이나 제2PLA(18)의 출력 중 하나를 선택하여 어드레스버스(add1∼add3)를 통해 메모리로 출력한다.In addition, the first multiplexer 22 receives a scan method signal zz_alter from a system controller (not shown) and selects one of an output of the first PLA 14 and an output of the second PLA 18, thereby selecting an address bus ( Output to memory via add1 to add3).

예컨대, 스캔방식신호가 0으로서 이상여현 변환기로부터 양자화기의 연산부(34)로 입력되는 데이터가 지그재그방식이면, 램(26)에 저장된 양자화 매트릭스도 라이트 어드레스발생부의 제 1PLA(14)에 따라 지그재그스캔방식으로 저장되어 있으므로, 제1멀티플랙서(22)는 제1PLA(14)의 출력을 선택하여 상기 표 3과 같이 양자화 매트릭스를 읽어가게 한다. 반대로 스캔방식신호(zz_alter)가 1로서 이상여현 변환기로부터 양자화기의 연산부(34)로 입력되는 데이터가 얼터네이트방식이면, 제1멀티플랙서(22)는 제2PLA(19)를 선택하여 서브램들에 저장된 매트릭스를 상기 표 5에 따라 얼터네이트스캔방식으로 읽어 가게 한다.For example, if the scan signal is 0 and the data inputted from the ideal cosine converter to the computing unit 34 of the quantizer is zigzag, the quantization matrix stored in the RAM 26 is also zigzag scanned according to the first PLA 14 of the write address generator. In this way, the first multiplexer 22 selects the output of the first PLA 14 to read the quantization matrix as shown in Table 3 above. On the contrary, when the scan method signal zz_alter is 1 and the data inputted from the ideal cosine converter to the operation unit 34 of the quantizer is the alternate method, the first multiplexer 22 selects the second PLA 19 to subram. The matrix stored in the field is read by the alternate scan method according to Table 5 above.

한편, 제2멀티플랙서(24)는 시스템 제어부로부터 입력되는 코딩식별신호(inter_intra)에 따라 인트라 코딩방식이면 인트라 양자화 매트릭스가 저장된 제1메모리뱅크의 데이터출력(data1a, 1b, 1c)을 선택하고, 인터코딩방식이면 인터 양자화 매트릭스가 저장된 제2메모리뱅크의 출력(data2a, 2b, 2c)을 선택한다. 예컨대, 인트라블록을 양자화할 경우에 시스템제어부로부터 입력되는 코딩식별신호(inter_intra)가 1이면(본 발명의 실시예에서 inter_intra가 1이면 인트라 코딩방식으로 정의한다) 이에 따라 제2멀티플랙서(24)는 제1메모리뱅크의 출력(data1a, 1b, 1c)을 선택한다.On the other hand, the second multiplexer 24 selects the data outputs (data1a, 1b, 1c) of the first memory bank in which the intra quantization matrix is stored in the intra coding scheme according to the coding identification signal inter_intra input from the system controller. In the case of the intercoding method, the outputs data2a, 2b, and 2c of the second memory bank in which the inter quantization matrix is stored are selected. For example, when the intrablock is quantized, if the coding identification signal inter_intra input from the system controller is 1 (in the embodiment of the present invention, inter_intra is 1, the intra coding scheme is defined). Accordingly, the second multiplexer 24 ) Selects the outputs (data1a, 1b, 1c) of the first memory bank.

또한, 데이터결합부(CAT:20)는 상기 제2멀티플랙서(24)가 출력하는 메모리뱅크의 8비트×3의 데이터 중에서 제2카운터(12)의 출력에 따라 해당 서브램의 8비트를 선택한 후, 이를 합해 16비트 매트릭스 데이터를 만들어 연산제어부(32)로 출력한다. 예컨대, 입력되는 영상 데이터가 얼터네이트방식일 경우에 CAT(20)는 다음 표 6과 같이 제2카운터의 출력에 따라 3개의 서브램의 출력중 둘을 선택 및 결합하여 출력한다.In addition, the data combiner CAT 20 selects 8 bits of the corresponding sub-RAM according to the output of the second counter 12 from 8 bits x 3 data of the memory bank output by the second multiplexer 24. After the selection, the 16 bit matrix data is combined and output to the operation control unit 32. For example, when the input image data is an alternate method, the CAT 20 selects and combines two of the outputs of the three sub-ramms according to the output of the second counter as shown in Table 6 below.

상기 표 6에서와 같이 제2카운터의 출력이 0이면 CAT(20)는 제1서브램과 제3서브램의 출력을 선택하여 결합하고, 1이면 제2서브램과 제1서브램의 출력을 결합하며, 2이면 제2서브램과 제1서브램의 출력을 결합한다.As shown in Table 6, when the output of the second counter is 0, the CAT 20 selects and combines outputs of the first and third subrams, and if 1, outputs the outputs of the second and first subrams. 2, the output of the second subram and the first subram.

한편 제3도에 있어서, 연산부(34)는 양자화기에서 수행되는 연산을 실제적으로 처리하는 부분으로서, 입력 영상 데이터를 양자화 매트릭스와 양자화 스케일값으로 나누어 양자화를 수행한다. 그런데, 일반적으로 나눗셈 연산을 수행하기 위해서는 하드웨어가 복잡해지고 처리속도가 늦어지므로, 본 발명이 적용되는 양자화기에서는 나눗셈할 데이터들의 역수를 연산제어부(32)에서 미리 구한 후 연산부(34)에서는 이를 곱셈에 의해 처리하도록 되어 있다.In FIG. 3, the operation unit 34 actually processes an operation performed by the quantizer, and divides the input image data into a quantization matrix and a quantization scale value to perform quantization. However, in general, in order to perform a division operation, hardware becomes complicated and a processing speed becomes slow. Therefore, in the quantizer to which the present invention is applied, the inverse of the data to be divided is calculated in advance in the operation control unit 32, and then the operation unit 34 multiplies them. It is supposed to process by.

즉, 연산제어부(32)는 리셋 및 시스템 클록에 따라 작동되어 램 컨트롤러(32)로부터 입력되는 짝수/홀수 매트릭스의 역수를 계산하여 각각 출력하고, 시스템제어부로부터 입력되는 양자화 타입과 양자화 코드로부터 양자화 스케일값을 계산한 후 그 역수를 구하여 짝수/홀수로 나누어 출력하고, 시스템제어부로부터 dc_prec을 입력받아 소정의 DC값을 계산한 후 그 역수를 구한다.That is, the operation control unit 32 operates according to the reset and the system clock to calculate and output the inverse of the even / odd matrix input from the RAM controller 32, respectively, and the quantization scale from the quantization type and the quantization code input from the system controller. After calculating the value, the reciprocal is obtained and the output is divided into even / odd. After receiving the dc_prec from the system controller, the predetermined DC value is calculated and the reciprocal is obtained.

그리고, 연산부(34)는 이산여현 변환기로부터 소정 방식으로 스캔되어 입력되는 한쌍의 데이터에 연산제어부로부터 입력되는 양자화 스케일의 역을 곱하고, 이어서 이 결과에 양자화 매트릭스의 역을 곱한 후 라운딩 처리하여 양자화된 짝수/홀수 데이터를 출력한다. 이때 연산부(34)에서는 입력되는 한쌍의 데이터(data_even, data_odd)를 연산제어부(32)로부터 입력되는 한쌍의 데이터들과 파이프라인방식으로 곱산하여 처리속도를 향상시킬 수 있게 함과 아울러 본 발명에 의해서 데이터의 스캔방식에 따라 매트릭스 순서도 매칭되어 양자화가 수행되게 된다.The operation unit 34 multiplies the inverse of the quantization scale input from the operation control unit by a pair of data scanned and input from the discrete cosine converter in a predetermined manner, and then multiplies the result of the quantization matrix by the inverse of the quantization matrix and then rounds the result. Output even / odd data. In this case, the operation unit 34 multiplies the pair of data (data_even, data_odd) input from the operation control unit 32 with the pair of data in a pipelined manner to improve the processing speed and according to the present invention. According to the scanning method of the data, the matrix order is also matched to perform quantization.

한편, 본원 청구범위의 각 구성요건에 병기된 도면 참조부호는 본원 발명의 이해를 용이하게 하기 위한 것으로, 본원 발명의 기술적 범위를 도면에 도시한 실시예로 한정할 의도에서 병기한 것은 아니다.On the other hand, the reference numerals written in the configuration requirements of the claims of the present application to facilitate the understanding of the present invention, not intended to limit the technical scope of the present invention to the embodiments shown in the drawings.

이상 설명한 바와 같이 본 발명에 의하면, 지그재그 스캔방식과 얼터네이트 스캔방식으로 입력되는 매트릭스 데이터에 대해 양자화가 수행되고, 64워드의 매트릭스 데이터를 3개의 서브램으로 적당히 분할하여 저장하므로써 리드시에 데이터 충돌을 방지할 수 있다. 따라서 스캔방식에 따른 데이터 충돌을 방지함과 아울러 적은 용량의 메모리를 사용하여 양자화 매트릭스를 저장할 수 있으므로 전용칩(ASIC)화가 용이한 효과가 있다.As described above, according to the present invention, quantization is performed on the matrix data input by the zigzag scan method and the alternate scan method, and data collision at the time of reading is performed by appropriately dividing the 64 word matrix data into three sub-rams and storing them. Can be prevented. Therefore, it is possible to prevent the data collision according to the scan method and to store the quantization matrix using a small memory, so that the ASIC can be easily formed.

Claims (6)

소정의 양자화 매트릭스가 지그재그방식으로 다운 로딩되어 램(26)에 저장된 것을 소정의 스캔방식으로 입력되는 영상 데이터의 스캔방식에 따라 램컨트롤러(30)가 적절하게 어드레싱하여 양자화 매트릭스를 읽어 오고, 이 양자화 매트릭스의 역수, 및 시스템제어부로부터 입력되는 양자화 매트릭스의 역수, 및 시스템제어부로부터 입력되는 양자화 스케일값의 역수를 연산제어부(32)에서 구한 후, 이 역수들과 입력된 상기 영상 데이터를 연산부(34)에서 연산하여 양자화하도록 된 양자화기에 있어서, 상기 램 컨트롤러(30)가 스캔방식에 관계없이 한쌍의 매트릭스 데이터가 동일한 메모리에 저장되지 않도록 상기 양자화 매트릭스를 저장하기 위한 라이트 어드레스를 발생하는 라이트 어드레스 발생수단: 상기 라이트 어드레스에 따라 저장되는 상기 양자화 매트릭스 데이터를 램(26)에 분배하는 데이터 분배수단(16); 양자화를 위한 매크로블록이 시작되면 상기 램(26)에 저장된 양자화 매트릭스를 읽어 오기 위해 스캔방식에 따라 해당 리드 어드레스를 발생하는 리드 어드레스 발생수단; 및 상기 리드 어드레스 발생수단에 의해 억세스된 램이 출력하는 데이터를 코딩방식 및 스캔방식에 따라 결합하여 상기 연산제어부(32)로 출력하는 데이터결합수단으로 구성되고, 상기 램(26)이 인트라 및 인터 양자화 매트릭스를 저장하기 위한 제1 및 제2메모리뱅크(RAM0, RAM1)로 구성되고, 상기 각 메모리뱅크가 복수개의 서브램으로 구성된 것을 특징으로 하는 양자화기.The RAM controller 30 reads the quantization matrix appropriately according to the scanning method of the image data inputted by the predetermined scan method that the predetermined quantization matrix is downloaded in a zigzag manner and stored in the RAM 26, and the quantization matrix is read. After calculating the inverse of the matrix, the inverse of the quantization matrix input from the system controller, and the inverse of the quantization scale value input from the system controller, the operation controller 32 calculates the inverses and the input image data. A write address generating means for generating a write address for storing the quantization matrix so that the RAM controller 30 does not store a pair of matrix data in the same memory regardless of the scanning method. The quantum stored according to the write address Data distributing means (16) for distributing speech matrix data to the RAM (26); Read address generating means for generating a corresponding read address according to a scan method to read a quantization matrix stored in the RAM 26 when a macroblock for quantization is started; And data combining means for combining the data output by the RAM accessed by the read address generating means according to a coding method and a scanning method, and outputting the combined data to the operation control unit 32, wherein the RAM 26 is intra and inter. A quantizer, comprising: first and second memory banks (RAM0, RAM1) for storing a quantization matrix, wherein each of the memory banks comprises a plurality of sub-RAMs. 제1항에 있어서, 상기 라이트 어드레스 발생수단이 리셋(RST)신호에 따라 카운트값을 클릭어하고 플래그 아이디(flag_ID)가 하이일 경우 매트릭스 식별자(ID)를 해석하여 양자화 매트릭스를 판별한 후 클럭(CLK)에 따라 카운트하여 라이트 어드레스를 발생하는 제1카운터(10)와; 상기 제1카운터(10)의 출력에 따라 라이트 어드레스를 발생하는 제1PLA(14)로 구성된 것을 특징으로 하는 양자화기.The method according to claim 1, wherein the write address generating means clicks on a count value according to a reset (RST) signal, and if a flag ID flag_ID is high, a matrix identifier ID is interpreted to determine a quantization matrix, and then a clock ( A first counter 10 that counts according to CLK and generates a write address; And a first PLA (14) for generating a write address according to the output of the first counter (10). 제1항에 있어서, 상기 리드 어드레스발생수단이 매크로블록시작신호(mbs)에 따라 클록(CLK)에 의해 카운드되는 제2카운터(12)와; 상기 제2카운터의 출력에 따라 지그재그방식으로 램(26)에 저장된 양자화 매트릭스를 지그재그 또는 얼터네이트 방식으로 읽어가기 위한 어드레스를 발생하는 어드레스변환부(19); 및 스캔방식에 따라 상기 어드레스변환부(19)의 출력을 선택하는 제1멀티플랙서(22)로 구성된 것을 특징으로 하는 양자화기.2. The apparatus of claim 1, wherein the read address generating means comprises: a second counter 12 counted by a clock CLK in accordance with a macro block start signal mbs; An address conversion unit (19) for generating an address for reading the quantization matrix stored in the RAM (26) in a zigzag manner in a zigzag or alternate manner according to the output of the second counter; And a first multiplexer (22) for selecting the output of said address conversion section (19) in accordance with a scanning method. 제1항 또는 제3항에 있어서, 상기 어드레스변환부(19)는 지그재그방식으로 램(26)을 억세스하기 위한 어드레스를 발생하는 제1PLA(14)와; 지그재그방식으로 저장된 매트릭스 데이터를 얼터네이트방식으로 읽어 내기 위한 리드 어드레스를 발생하는 제2PLA(18)로 구성된 것을 특징으로 하는 양자화기.4. The apparatus of claim 1 or 3, wherein the address conversion unit (19) comprises: a first PLA (14) for generating an address for accessing the RAM (26) in a zigzag manner; And a second PLA (18) for generating a read address for reading the matrix data stored in a zigzag manner in an alternate manner. 제1항에 있어서, 상기 데이터결합수단이 코딩방식(inter_intra)에 따라 상기 램(26)에 저장된 양자화 매트릭스나 인터 양자화 매트릭스중 하나를 선택하는 제2멀티플랙서(24)와; 상기 제2카운터(12)의 출력에 따라 상기 제2멀티플랙서(24)의 출력을 선택 및 결합하여 매트릭스 데이터를 출력하는 결합기(CAT:20)로 구성된 것을 특징으로 하는 양자화기.2. The apparatus of claim 1, wherein the data combining means comprises: a second multiplexer (24) for selecting one of a quantization matrix and an inter quantization matrix stored in the RAM (26) according to a coding scheme (inter_intra); And a combiner (CAT) for selecting and combining the output of the second multiplexer (24) according to the output of the second counter (12) to output matrix data. 제1항에 있어서, 상기 제1내지 제2메모리뱅크는 8비트 22워드의 제1서브램(OP_RAM0-1, OP_RAM0-1')과, 8비트 22워드의 제2서브램(OP_RAM0-2, OP_RAM0-2'), 및 8비트 20워드의 제3서브램(OP_RAM1, OP_RAM1')으로 각각 구성된 것을 특징으로 하는 양자화기.The first and second memory banks of claim 1, wherein the first to second memory banks each include an 8-bit 22-word first subram (OP_RAM0-1 and OP_RAM0-1 ') and an 8-bit 22-word second subram (OP_RAM0-2, OP_RAM0-2 '), and 8-bit 20-word third subrams (OP_RAM1, OP_RAM1'), respectively.
KR1019960016004A 1996-05-14 1996-05-14 A quantizer KR100210384B1 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
KR1019960016004A KR100210384B1 (en) 1996-05-14 1996-05-14 A quantizer
EP19970303247 EP0808069B1 (en) 1996-05-14 1997-05-13 A Quantizer for video signal encoding system
DE1997621373 DE69721373T2 (en) 1996-05-14 1997-05-13 Quantizer for a video coding system
CN97104264A CN1126375C (en) 1996-05-14 1997-05-14 Quantizer for video signal encoding system
JP12415197A JP4117044B2 (en) 1996-05-14 1997-05-14 Quantizer in video signal coding system
US08/854,945 US5881177A (en) 1996-05-14 1997-05-14 Quantizer for video signal encoding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019960016004A KR100210384B1 (en) 1996-05-14 1996-05-14 A quantizer

Publications (2)

Publication Number Publication Date
KR970078642A KR970078642A (en) 1997-12-12
KR100210384B1 true KR100210384B1 (en) 1999-07-15

Family

ID=19458645

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019960016004A KR100210384B1 (en) 1996-05-14 1996-05-14 A quantizer

Country Status (1)

Country Link
KR (1) KR100210384B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PL3346706T3 (en) 2012-04-16 2021-04-06 Electronics And Telecommunications Research Institute Method for encoding/decoding image

Also Published As

Publication number Publication date
KR970078642A (en) 1997-12-12

Similar Documents

Publication Publication Date Title
KR100253931B1 (en) Approximate mpeg decoder with compressed reference frames
US5262854A (en) Lower resolution HDTV receivers
JP3888597B2 (en) Motion compensation coding apparatus and motion compensation coding / decoding method
JP4216341B2 (en) Pixel block compression apparatus in an image processing system
EP0580454A2 (en) Coding and decoding of digital data
US6125146A (en) Method and device for decoding coded digital video signals
KR20000057295A (en) Image element processor for a memory management system using recompression
WO2004104930A2 (en) Hybrid video compression method
JPH104550A (en) Mpeg-2 decoding method and mpeg-2 video decoder
JPH0686262A (en) Apparatus for encoding of image
KR20000023174A (en) Encoding apparatus and method
KR100298397B1 (en) Video decoding system
EP0736843B1 (en) A motion video compression system with adaptive quantisation
KR100541623B1 (en) Prediction method and device with motion compensation
US6298087B1 (en) System and method for decoding a variable length code digital signal
KR20040095742A (en) A picture decoding unit and a picture encoding device used it, and a picture decoding device and decoding method
KR100267125B1 (en) Decoding and displaying method of compressing digital video sequence and decoding device of compressing digital video information
KR100313217B1 (en) Pipeline DCT device
EP0920204A1 (en) MPEG2 decoder with reduced RAM requisite by recompression using adaptive tree search vector quantization
JP4117044B2 (en) Quantizer in video signal coding system
KR100304901B1 (en) Apparatus for receiving moving picture
KR100549208B1 (en) Overhead data processor in a memory efficient image processing system
KR20020026189A (en) Efficient video data access using fixed ratio compression
KR100210384B1 (en) A quantizer
EP1083752A1 (en) Video decoder with reduced memory

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment
FPAY Annual fee payment
LAPS Lapse due to unpaid annual fee