KR20010059598A - Method of buffer control in video encoder - Google Patents

Method of buffer control in video encoder Download PDF

Info

Publication number
KR20010059598A
KR20010059598A KR1019990067119A KR19990067119A KR20010059598A KR 20010059598 A KR20010059598 A KR 20010059598A KR 1019990067119 A KR1019990067119 A KR 1019990067119A KR 19990067119 A KR19990067119 A KR 19990067119A KR 20010059598 A KR20010059598 A KR 20010059598A
Authority
KR
South Korea
Prior art keywords
buffer
overflow
encoding
macroblock
video encoder
Prior art date
Application number
KR1019990067119A
Other languages
Korean (ko)
Other versions
KR100528791B1 (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 KR10-1999-0067119A priority Critical patent/KR100528791B1/en
Publication of KR20010059598A publication Critical patent/KR20010059598A/en
Application granted granted Critical
Publication of KR100528791B1 publication Critical patent/KR100528791B1/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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/152Data rate or code amount at the encoder output by measuring the fullness of the transmission buffer
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PURPOSE: A method for controlling buffer of moving picture video encoder is provided to prevent a buffer overflow and a buffer exhaustion by creating a buffer overflow flag and a buffer exhaustion flag, by controlling a bit rate control operation, a code mode determination, and a DCT quantizer operation, and by inserting stuffing data according to the buffer exhaustion flag. CONSTITUTION: A process controls a bit generation of a buffer with a bit rate control mode, in case of a buffer overflow, and generates a buffer overflow signal according to a degree of the buffer overflow. The process prevents the buffer overflow by controlling a bit rate control operation, a macro block(MB) code mode determination, and a discrete cosine transform(DCT) quantizer operation.

Description

동영상 비디오 인코더의 버퍼 제어 방법{Method of buffer control in video encoder}Method of buffer control in video encoder

본 발명은 엠펙1(MPEG-1 : Moving Picture Expert Group-1), 엠펙2(MPEG-2) 등과 같은 동영상의 비디오 인코더에서 채널 버퍼의 넘침이나 고갈을 방지할 수 있는 버퍼 제어 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 관한 것이다.The present invention provides a buffer control method and a method for controlling the overflow or depletion of a channel buffer in a video encoder of a video such as MPEG-1 (MPEG-1) and MPEG-2 (MPEG-2). A computer readable recording medium having recorded thereon a program for realization.

MPEG 비디오 인코더는 가변율의 부호화 비트를 채널 버퍼를 통해 고정율로 출력한다. 이때, 비디오 인코더는 비트율 제어를 통해 부호화 비트 발생을 제어한다.The MPEG video encoder outputs a variable rate of encoded bits at a fixed rate through a channel buffer. In this case, the video encoder controls encoding bit generation through bit rate control.

고정율 동작에서 비트율 제어는 채널 버퍼가 넘칠려고 하면 비트 발생을 억제하며, 채널 버퍼가 고갈될려고 하면 비트를 많이 발생하도록 양자화 파라미터값을 생성한다. 그러나, 비트율 제어가 완전히 채널 버퍼의 넘침이나 고갈의 방지를 보장해 주는 것은 아니다.In fixed rate operation, bit rate control suppresses bit generation when the channel buffer is about to overflow and generates quantization parameter values to generate more bits when the channel buffer is about to be exhausted. However, bit rate control does not completely guarantee protection of channel buffer overflow or exhaustion.

버퍼넘침이 발생할려고 할 때, 비트율 제어가 할 수 있는 것은 양자화 파라미터값을 최대로 하는 것이며, 버퍼고갈이 발생할 때 양자화 파라미터값을 최소로 해 주는 것이다. 이때, 양자화 파라미터를 최대로 해도 여전히 채널 버퍼에서 빠져나가는 율보다 더 많이 부호화 비트가 발생하여 버퍼 넘침이 발생할 수 있으며, 최소로 해도 비트 발생이 채널 버퍼에서 빠져나가는 양보다 적어 버퍼 고갈이 될 수 있다. 따라서, 비디오 인코더는 비트율 제어를 통해 보장되지 않는 버퍼넘침이나 고갈문제를 해결하기 위한 별도로 버퍼 제어를 해 주어야 한다.When buffer overflow is about to occur, bit rate control is to maximize the quantization parameter value and to minimize the quantization parameter value when buffer exhaustion occurs. In this case, even if the quantization parameter is maximized, the encoding bit may be generated more than the rate of exiting from the channel buffer, and the buffer overflow may occur even if the minimum is less than the amount of exiting from the channel buffer. . Therefore, the video encoder must separately control the buffer to solve the buffer overflow or exhaustion problem, which is not guaranteed through the bit rate control.

이러한 버퍼제어 방법은 여러 가지가 있으나, 최소의 하드웨어로 최소의 화질 열화를 그 목표로 한다.There are many such buffer control methods, but the goal is to minimize image quality degradation with minimal hardware.

그럼에도 불구하고, 종래의 버퍼제어 기술은 버퍼의 넘침이나 고갈 방지를 완전하게 보장하지 못하였으며, 하드웨어 및 성능이 최적화되어 있지 않았다. 따라서, MPEG 비디오 인코더에서 채널버퍼의 넘침과 고갈 방지를 최소의 하드웨어와 최소의 화질 열화로 구현할 수 있는 방안이 필수적으로 요구된다.Nevertheless, conventional buffer control techniques do not fully guarantee buffer overflow or exhaustion, and hardware and performance are not optimized. Accordingly, there is a need for a method capable of preventing overflow and depletion of channel buffers in the MPEG video encoder with minimum hardware and minimum image quality degradation.

상기한 바와 같은 요구에 부응하기 위하여 안출된 본 발명은, 엠펙1(MPEG-1), 엠펙2(MPEG-2) 등과 같은 동영상의 비디오 인코더에서 채널 버퍼의 넘침을 방지하기 위한 버퍼 제어 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있다.The present invention devised to meet the requirements as described above, the buffer control method for preventing the overflow of the channel buffer in the video encoder of the video such as MPEG-1 (MPEG-1), MPEG-2 (MPEG-2) and the like It is an object of the present invention to provide a computer-readable recording medium having recorded thereon a program for realizing the method.

또한, 본 발명은 엠펙1(MPEG-1), 엠펙2(MPEG-2) 등과 같은 동영상의 비디오 인코더에서 채널 버퍼의 고갈을 방지하기 위한 버퍼 제어 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 다른 목적이 있다.In addition, the present invention provides a buffer control method for preventing the exhaustion of channel buffers in a video encoder of a video such as MPEG-1, MPEG-2, etc., and a computer for recording the program for realizing the method. Another purpose is to provide a readable recording medium.

도 1 은 본 발명이 적용되는 엠펙(MPEG) 비디오 인코더의 구성 예시도.1 is an exemplary configuration diagram of an MPEG video encoder to which the present invention is applied.

도 2 는 본 발명에 이용되는 엠펙(MPEG) 비디오 인코더의 하드웨어 동작 타이밍 예시도.2 is an exemplary hardware operation timing diagram of an MPEG video encoder used in the present invention.

도 3 은 본 발명에 따른 버퍼 제어 방법에 대한 일실시예 설명도.3 is a diagram illustrating an embodiment of a buffer control method according to the present invention;

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

11 : 프레임 메모리부 12 : 입력처리부11: frame memory unit 12: input processing unit

13 : 모드 제어부 14 : 버퍼 제어부13: mode control unit 14: buffer control unit

15 : 이산여현변환(DCT) 부호화부 16 : 가변길이 부호화부15 Discrete Cosine Transform (DCT) Coding Unit 16 Variable Length Coding Unit

17 : 움직임 예측/보상부 111 : 원영상 필드 버퍼17: motion prediction / compensator 111: original image field buffer

112 : 부호화 프레임 버퍼 113 : 채널 버퍼112: encoded frame buffer 113: channel buffer

상기 목적을 달성하기 위한 본 발명은, 동영상 비디오 인코더에서 버퍼를 제어하는 방법에 있어서, 정상동작시에 상기 버퍼를 비트율제어모드로 비트 발생을 제어하다가, 버퍼넘침의 우려가 있는 경우에 버퍼의 넘침 우려 정도에 따라 버퍼넘침 우려 신호를 발생하는 제 1 단계; 및 상기 버퍼넘침 우려 신호에 따라, 비트율제어 동작, 매크로블록(MB) 부호화모드 결정, 그리고 이산여현변환(DCT) 양자화 동작을 제어하여 버퍼넘침을 방지하는 제 2 단계를 포함하여 이루어진 것을 특징으로 한다.In order to achieve the above object, the present invention provides a method of controlling a buffer in a video and video encoder, wherein the buffer is overflowed when there is a risk of buffer overflow while controlling the bit in the bit rate control mode during normal operation. Generating a buffer overflow concern signal according to a degree of concern; And a second step of controlling a bit rate control operation, a macroblock (MB) coding mode, and a discrete cosine transform (DCT) quantization operation according to the buffer overflow concern signal to prevent buffer overflow. .

또한, 본 발명은 정상상태에서 상기 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 제 3 단계; 및 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 제 4 단계를 더 포함하여 이루어진 것을 특징으로 한다.In addition, the present invention is a third step of encoding the buffer in a predetermined slice structure in a steady state, and generates a buffer depletion warning signal when the buffer is likely to be exhausted; And after the macroblock (MB) encoding, stuffing according to the buffer depletion warning signal, and starting the following macroblock (MB) from a slice header to prevent buffer depletion. .

상기 목적을 달성하기 위한 본 발명은, 동영상 비디오 인코더에서 버퍼를 제어하는 방법에 있어서, 정상상태에서 상기 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 제 1 단계; 및 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 제 2 단계를 포함하여 이루어진 것을 특징으로 한다.According to an aspect of the present invention, there is provided a method of controlling a buffer in a video and video encoder, wherein the buffer is decoded in a predetermined slice structure in a steady state, and a buffer depletion warning signal is generated when the buffer is depleted. A first step occurring; And after macroblock (MB) encoding, stuffing according to the buffer depletion warning signal, and starting the following macroblock (MB) from a slice header to prevent buffer depletion.

상기 목적을 달성하기 위한 본 발명은, 프로세서를 구비한 동영상 비디오 인코더에, 정상동작시에 버퍼를 비트율제어모드로 비트 발생을 제어하다가, 버퍼넘침의 우려가 있는 경우에 버퍼의 넘침 우려 정도에 따라 버퍼넘침 우려 신호를 발생하는 제1 기능; 및 상기 버퍼넘침 우려 신호에 따라, 비트율제어 동작, 매크로블록(MB) 부호화모드 결정, 그리고 이산여현변환(DCT) 양자화 동작을 제어하여 버퍼넘침을 방지하는 제2 기능을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.In order to achieve the above object, the present invention provides a video video encoder having a processor to control bit generation in a bit rate control mode during normal operation. A first function of generating a buffer overflow concern signal; And a program for controlling a bit rate control operation, macroblock (MB) coding mode determination, and discrete cosine transform (DCT) quantization operation according to the buffer overflow concern signal to realize a second function for preventing buffer overflow. It provides a recording medium that can be read by.

또한, 본 발명은 정상상태에서 상기 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 제3 기능; 및 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 제4 기능을 더 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.In addition, the present invention provides a third function of encoding the buffer in a predetermined slice structure in a steady state and generating a buffer depletion warning signal when the buffer is depleted; And a program for further realizing a fourth function of preventing buffer depletion by causing macroblock (MB) to be stuffed according to the buffer depletion warning signal and starting a macroblock (MB) from a slice header after encoding the macroblock (MB). It provides a recording medium that can be read by.

상기 목적을 달성하기 위한 본 발명은, 프로세서를 구비한 동영상 비디오 인코더에, 정상상태에서 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 기능; 및 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 기능을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.According to an aspect of the present invention, there is provided a moving picture video encoder including a processor, which encodes a buffer in a predetermined slice structure in a normal state and generates a buffer depletion warning signal when the buffer is depleted; And after the macroblock (MB) encoding, the program for stuffing according to the buffer depletion warning signal and starting the following macroblock (MB) from the slice header to prevent the buffer depletion can be read by a computer. Provide a recording medium.

본 발명은 버퍼의 넘침이나 고갈 문제를 해결하기 위해, 채널 버퍼 상태에 따라 버퍼넘침우려 플래그와 버퍼고갈우려 플래그를 생성하여, 버퍼넘침우려 플래그에 따라 비트율 제어 동작, 부호화모드 결정, DCT 양자화 동작을 제어하여 버퍼넘침을 방지하며, 버퍼고갈우려 플래그에 따라 스터핑 데이터를 삽입하여 버퍼고갈을 방지한다.In order to solve the buffer overflow or exhaustion problem, the present invention generates a buffer overflow concern flag and a buffer exhaustion flag according to the channel buffer state, and performs bit rate control operation, encoding mode determination, and DCT quantization operation according to the buffer overflow concern flag. Controlling prevents buffer overflow and inserts stuffing data according to flags to prevent buffer exhaustion.

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

도 1 은 본 발명이 적용되는 엠펙(MPEG) 비디오 인코더의 구성 예시도이다.1 is an exemplary configuration diagram of an MPEG video encoder to which the present invention is applied.

도 1에 도시된 바와 같이, 엠펙(MPEG) 비디오 인코더는 필드(720×240) 혹은 프레임(720×480) 구조로 입력되는 영상을 16×16 크기의 매크로블럭(MB : MacroBlock) 단위로 부호화하여 비트스트림을 발생하고, 채널 버퍼(113)를 통해 고정율로 출력한다. 부호화의 데이터 발생은 가변율이며, 버퍼 제어를 통해 비트 발생이 제어된다.As shown in FIG. 1, an MPEG video encoder encodes an image input in a field 720 × 240 or frame 720 × 480 in a 16 × 16 macroblock (MB) unit. A bitstream is generated and output at a fixed rate through the channel buffer 113. The data generation of encoding is variable rate, and bit generation is controlled through buffer control.

비월주사로 입력되는 비디오(Interlaced Video)를 프레임픽쳐 구조(Frame-picture Structure)로 부호화하는 비디오 인코더의 동작을 예로들어 간단히 살펴보면, 먼저 필드단위로 입력되는 비디오 데이터는 부호화되기 전에 프레임 메모리부(11)내의 원영상 필드 버퍼(111)에 저장된다. 이는 프레임구조의 MB를 형성하여 부호화하기 위해서 적어도 프레임의 첫째 필드가 모두 입력되고 둘째 필드의 8라인이 입력되어야 하기 때문이다.As an example, an operation of a video encoder for encoding interlaced video into a frame-picture structure will be described. First, video data inputted in units of fields is first converted into a frame memory unit 11 before being encoded. ) Is stored in the original image field buffer 111. This is because at least all of the first field of the frame and eight lines of the second field must be input to form and encode the MB of the frame structure.

입력 처리부(12)는 원영상 필드 버퍼(111)로부터 데이터를 읽어 MB를 형성하여 모드 제어부(13)와 움직임 예측/보상부(17)로 전달한다. 이때, 움직임 예측/보상부(17)는 부호화 프레임 버퍼(112)에 저장되어 있는 이전 프레임(Previous Frame)으로부터 현재 MB와 가장 유사한 MB를 찾아 모드 제어부(13)로 전달한다.The input processor 12 reads data from the original image field buffer 111 to form an MB, and transmits the MB to the mode controller 13 and the motion predictor / compensator 17. At this time, the motion predictor / compensator 17 finds the MB most similar to the current MB from the previous frame stored in the encoding frame buffer 112 and transfers the MB to the mode controller 13.

모드 제어부(13)는 현재 MB를 인트라(Intra) 모드로 부호화할지 인터(Inter)모드로 부호화할지를 결정하여, 인트라(Intra) 모드의 경우 현재 MB를 그대로 이산여현변환(DCT : Discrete Cosine Transform) 부호화부(15)에 전달하고, 인터(Inter) 모드의 경우는 현재 MB 데이터를 움직임 보상 MB 데이터로 뺀 움직임예측오차 MB를 DCT 부호화부(15)로 전달한다.The mode controller 13 determines whether to encode the current MB in the intra mode or the inter mode, and in the intra mode, discrete cosine transform (DCT) encoding the current MB as it is. In the inter mode, the motion prediction error MB obtained by subtracting the current MB data by the motion compensation MB data is transmitted to the DCT encoder 15.

DCT 부호화부(15)는 매크로블럭(MB)을 8×8크기의 블록(Block) 단위로 나누어서 DCT, 양자화, 스캔(SCAN), 역양자화, 역 DCT를 수행하여 SCAN 데이터는 가변길이부호화(VLC : Variable Length Code)부(16)로, 역 DCT 결과 데이터는 모드 제어부(13)로 전달한다. 이때, 모드 제어부(13)로 전달된 DCT 부호화 데이터는 인트라(Intra) 모드의 경우 그대로, 인터(Inter) 모드의 경우 움직임 예측오차 MB 생성에 사용된 움직임보상 MB 데이터와 더해져서 부호화 프레임 버퍼(112)로 저장된다.The DCT encoder 15 divides the macroblock MB into 8 × 8 block units to perform DCT, quantization, scan, inverse quantization, and inverse DCT, so that SCAN data is variable length coded (VLC). Variable length code), and the inverse DCT result data is transmitted to the mode control unit 13. In this case, the DCT coded data transmitted to the mode control unit 13 is added as it is in the intra mode, and is added to the motion compensation MB data used to generate the motion prediction error MB in the inter mode. Stored as).

가변길이 부호화(VLC)부(16)는 SCAN 데이터와 기타 데이터를 VLC 부호화하여 MPEG 비트스트림으로 생성하여 채널 버퍼(113)로 전달한다. 이때, 채널 버퍼(113)는 이 부호화 비트스트림을 고정율로 출력시킨다.The variable length coding (VLC) unit 16 performs VLC encoding on SCAN data and other data to generate an MPEG bitstream and transmits the SCAN data to the channel buffer 113. At this time, the channel buffer 113 outputs this encoded bitstream at a fixed rate.

부호화 과정에서 버퍼 제어부(14)는 부호화비트 발생을 제어하여 채널 버퍼(113)의 넘침이나 고갈없이 정해진 비트율 출력을 보장하는 역할을 수행한다.In the encoding process, the buffer controller 14 controls the generation of encoding bits to ensure a predetermined bit rate output without overflow or depletion of the channel buffer 113.

도 1에서 세종류의 버퍼(111 내지 113)를 프레임 메모리부(11)로 묶어둔 것은 비디오 인코더가 실제 구현될 때 이들 버퍼는 하나의 디램(DRAM)상에서 구현되기 때문이다.In FIG. 1, the three types of buffers 111 to 113 are bundled into the frame memory unit 11 because these buffers are implemented on one DRAM when the video encoder is actually implemented.

도 2 는 본 발명에 이용되는 엠펙(MPEG) 비디오 인코더의 하드웨어 동작 타이밍 예시도이다.2 is an exemplary hardware operation timing diagram of an MPEG video encoder used in the present invention.

도 2에서, "frm_ref"는 비월주사 비디오 입력의 프레임 시작을 나타내는 신호이다, 그리고 부호화는 리셋(reset) 신호에 의해 개시된다. 또한, "piclk"는 프레임의 부호화 개시를 나타내는 신호로서, 전술한 바와 같이 첫째 필드가 입력되고 둘째 필드의 8라인이 입력될 때 신호가 발생된다.In Fig. 2, "frm_ref" is a signal indicating the start of a frame of interlaced video input, and the encoding is started by a reset signal. In addition, "piclk" is a signal indicating the start of encoding of a frame. As described above, a signal is generated when the first field is input and eight lines of the second field are input.

한편, 부호화는 MB 단위로 이루어지며, "NTSC" 비디오의 경우 한 프레임은 1,350개의 MB를 포함한다. 하드웨어 동작시, 1,350개의 MB는 "piclk" 구간내에 균일하게 나누어진 "mbclk" 신호에 따라 동작한다. 그러나, MB 데이터가 부호화하기 시작하여 부호화데이터를 출력하기까지는 여러 "mbclk" 구간이 소요되며, 1,350개의 MB는 파이프라인 처리된다. 도 2의 예에서는 MB 부호화의 처리시간은 움직임추정을 위한 "sydata(탐색영역데이터)"를 받아들이는 시점부터 "vstrm(부호화 비트스트림)"을 출력하는 시점까지인 6 mbclk 기간이 된다.Meanwhile, encoding is performed in MB units, and in the case of "NTSC" video, one frame includes 1,350 MB. In hardware operation, 1,350 MB operate according to a " mbclk " signal evenly divided within a " piclk " interval. However, it takes several "mbclk" sections until MB data starts to be encoded and outputs encoded data, and 1,350 MBs are pipelined. In the example of FIG. 2, the processing time of MB encoding is a 6 mbclk period from the time point at which "sydata (search area data)" for motion estimation is received to the time point at which "vstrm (coding bitstream)" is output.

지금까지 비디오 인코더의 구성 및 타이밍을 살펴보았다.So far we have looked at the configuration and timing of the video encoder.

이제, 비디오 인코더에서 부호화 비트 발생을 제어하는 버퍼 제어에 대해 좀 더 상세히 설명한다.Now, the buffer control for controlling the encoding bit generation in the video encoder will be described in more detail.

도 3 은 본 발명에 따른 버퍼 제어 방법에 대한 일실시예 설명도이다.3 is a diagram illustrating an embodiment of a buffer control method according to the present invention.

도 3에 도시된 바와 같이, 버퍼 제어는 비트율 제어(31), 버퍼넘침방지 제어(32), 버퍼고갈방지 제어(33)로 나누어진다.As shown in Fig. 3, the buffer control is divided into a bit rate control 31, a buffer overflow control 32, and a buffer depletion control 33.

비트율 제어(31)는 부호화비트 발생이 평균적으로 출력 비트율이 되도록 제어하는 기능으로서, DCT 부호화부의 양자화 파라미터(QP : Quantizer Parameter)값 출력을 통해 비트 발생을 제어한다.The bit rate control 31 is a function of controlling the generation of encoded bits to be an output bit rate on average, and controls bit generation through output of a quantization parameter (QP) value of the DCT encoder.

버퍼넘침방지 제어(32)와 버퍼고갈방지 제어(33)는 비트율 제어(31)로 방지되지 않는 버퍼넘침과 고갈을 방지하는 역할을 수행한다.The buffer overflow control 32 and the buffer depletion control 33 serve to prevent buffer overflow and exhaustion that are not prevented by the bit rate control 31.

비트율 제어(31)의 성능은 복원된 영상의 화질과 채널버퍼 넘침이나 고갈이 발생되지 않는 정도로 결정된다.The performance of the bit rate control 31 is determined to the extent that the quality of the reconstructed image and the channel buffer overflow or depletion do not occur.

일반적으로는, 영상내 및 영상간의 화질이 균일한 것이 좋은 화질로 평가되며, 또한 채널 버퍼의 넘침이 가까워짐에 따라 양자화 파라미터값이 최대값으로 증가하다가 버퍼넘침 직전에는 QP가 최대값이 되고, 버퍼고갈 발생시는 QP가 점차 감소하다가 버퍼고갈 직전에는 최소값의 QP가 되도록 하는 것이 최대의 화질을 나타내며, 버퍼넘침방지 및 고갈방지 제어도 용이하게 해준다.In general, a uniform image quality between images and images is evaluated for good image quality. Also, as the channel buffer overflows, the quantization parameter value increases to a maximum value, and the QP becomes a maximum value just before the buffer overflows. When the depletion occurs, the QP decreases gradually, and the minimum QP is shown immediately before the buffer is depleted, indicating the maximum image quality, and the buffer overflow prevention and depletion prevention control is also facilitated.

본 실시예에서는 비디오 인코더의 버퍼 제어에서 버퍼넘침방지 제어(32)와 버퍼고갈방지 제어(33)만을 다루며, 이때 본 실시예의 버퍼넘침방지 제어(32) 및 버퍼고갈방지 제어(33) 방법은 비트율 제어(31) 방법에 대한 어떠한 제한도 가하지 않는다.In the present embodiment, only the buffer overflow control 32 and the buffer depletion control 33 are handled in the buffer control of the video encoder. In this case, the buffer overflow control 32 and the buffer depletion control 33 of the present embodiment have a bit rate. No limitation is imposed on the control 31 method.

우선, 버퍼넘침방지 제어(32) 방법에 대해 보다 상세히 설명한다.First, the buffer overflow prevention control 32 method will be described in more detail.

이는 정상동작에서는 비트율 제어모드로 비트 발생을 제어하다가, 버퍼넘침의 우려가 있으면 버퍼넘침 플래그를 발생시켜 버퍼넘침방지제어 모드로 동작을 전환한다.In normal operation, it controls the bit generation in the bit rate control mode. If there is a risk of overflowing the buffer, the buffer overflow flag is generated to switch the operation to the buffer overflow control mode.

본 발명에서는 버퍼넘침 주의 플래그, 버퍼넘침 경고 플래그, 버퍼넘침 위험 플래그를 생성하고, 이들 플래그에 따라 비트율제어 동작, 부호화모드(인트라(Intra) 혹은 인터(Inter) 모드) 결정, 그리고 DCT 양자화 동작을 제어하는 방식으로 버퍼넘침을 방지한다.In the present invention, a buffer overflow warning flag, a buffer overflow warning flag, and a buffer overflow danger flag are generated, and bit rate control operation, encoding mode (Intra or Inter mode) determination, and DCT quantization operation are performed according to these flags. Controlling prevents buffer overflow.

이로써, 본 발명의 버퍼넘침방지 방법은 채널 버퍼에서 빠져나가는 출력 비트율이 1Mbps 이하까지도 버퍼넘침방지를 보장한다. 즉, 1Mbps이상의 모든 비트율에 적용될 수 있다.Thus, the buffer overflow prevention method of the present invention guarantees buffer overflow prevention even when the output bit rate exiting the channel buffer is 1 Mbps or less. That is, it can be applied to all bit rates of 1Mbps or more.

그러면, 첫 번째로 본 발명에 이용되는 버퍼넘침 플래그를 생성하는 과정에 대해 보다 상세히 설명한다.First, a process of generating a buffer overflow flag used in the present invention will be described in detail.

본 발명은 버퍼넘침 방지를 위해, 버퍼넘침 우려 정도에 따른 세 개의 플래그를 두고 있으며, 매크로블럭마다 채널 버퍼 상태에 따라 다음과 같이 값이 설정된다.In order to prevent the buffer overflow, the present invention has three flags according to the degree of buffer overflow concern, and values are set as follows according to the channel buffer state for each macroblock.

if(buf_empty < Th_overnote) overflow_note <= 1;if (buf_empty <Th_overnote) overflow_note <= 1;

else overflow_note <= 0;else overflow_note <= 0;

if(buf_empty < Th_overwarn) overflow_warn <= 1;if (buf_empty <Th_overwarn) overflow_warn <= 1;

else overflow_warn <= 0;else overflow_warn <= 0;

if(buf_empty < Th_overdanger) overflow_danger <= 1;if (buf_empty <Th_overdanger) overflow_danger <= 1;

else overflow_danger <= 0;else overflow_danger <= 0;

여기서, "buf_empty"는 MB에 대한 플래그값 설정 순간의 채널 버퍼의 빈상태값으로서, "[vbv_buffer_size - (bit_rate/picture_rate) - buf_state]"로 얻어진다. 윗 식에서, "vbv_buffer_size", "bit_rate", "picture_rate"는 부호화 시작전에 결정되는 시퀀스헤더 정보이며, "buf_state"는 채널 버퍼에서 "bit_rate"율로 일정하게 데이터가 빠져나가는 채널 버퍼에서 플래그값 설정 순간의 버퍼 찬 상태값이다. 여기서, 버퍼넘침의 기준을 MPEG 표준에서 제시한 "vbv_buffer_size"로 하지 않고 하드웨어에서 픽쳐기간동안 채널 버퍼에서 빠져나가는 비트수인 "bit_rate/picture_rate"을 뺀 값으로 한 것은, 픽쳐부호화가 표준에서와 같이 "piclk"가 뜨는 시점에서 순간적으로 이루어지지 않고 픽쳐기간동안 일정하게 이루어지기 때문이다.Here, "buf_empty" is an empty state value of the channel buffer at the moment of setting the flag value for MB, and is obtained as "[vbv_buffer_size-(bit_rate / picture_rate)-buf_state]". In the above equation, "vbv_buffer_size", "bit_rate", and "picture_rate" are sequence header information determined before encoding starts, and "buf_state" is the value of the moment when the flag value is set in the channel buffer where the data is constantly drawn out at the "bit_rate" rate from the channel buffer. Buffer full status. Here, the buffer overflow is not defined as the "vbv_buffer_size" suggested by the MPEG standard, but the value of the picture encoding is the same as the standard, except that "bit_rate / picture_rate", which is the number of bits that escape from the channel buffer during the picture period, is set in hardware. This is because "piclk" is not instantaneously at the time of rise, but is constant during the picture period.

"Th_overnote"은 "[overflow_note 플래그 값을 설정한 시점에서 이 플래그에 의한 MB의 부호화 비트 발생이 종료되는 시점까지 버퍼넘침 우려가 없는 정상적인 상태에서 부호화할 때 발생될 수 있는 최대 비트수]"에다 "[overflow_note 플래그 MB에 의해 발생될 수 있는 최대 비트수]", 그리고 "[overflow_warn 플래그 MB에 의해 발생될 수 있는 최대 비트수]"를 더한 값이다."Th_overnote" is "[the maximum number of bits that can be generated when encoding in a normal state without a buffer overflow from the time when the overflow_note flag value is set to the end of generation of the encoding bit of MB by this flag]." The maximum number of bits that can be generated by the overflow_note flag MB is added to the maximum number of bits that can be generated by the overflow_warn flag MB.

"Th_overwarn"은 "[overflow_warn 플래그값을 설정한 시점에서 이 플래그에 의한 MB의 부호화비트 발생이 종료되는 시점까지 overflow_note 상태에서 부호화할 때 발생될 수 있는 최대 비트수]"에다 "[overflow_warn 플래그 MB에 의해 발생될 수 있는 최대 비트수]"를 더한 값이다."Th_overwarn" is "[the maximum number of bits that can be generated when encoding in overflow_note state from the time when the overflow_warn flag value is set to the end of generation of the encoding bit of MB by this flag]." Plus the maximum number of bits that can be generated by " "

"Th_overdanger"는 "[overflow_danger 플래그값을 설정한 시점에서 이 플래그에 의한 MB의 부호화 비트 발생이 종료되는 시점까지 overflow_warn 상태에서 부호화할 때 발생될 수 있는 최대 비트수]"이다."Th_overdanger" is "[the maximum number of bits that can be generated when encoding in overflow_warn state from the time at which the overflow_danger flag value is set to the time when generation of the MB encoded bit by this flag is terminated".

이상의 설명에서 버퍼넘침우려 플래그값을 설정한 시점에서 이 플래그에 의한 MB의 부호화비트 발생이 종료되는 시점까지란 MB는 버퍼넘침 플래그가 설정된 이후 그 플래그에 따라 DCT 부호화, VLC 부호화하여 부호화비트를 발생하는데 그 MB의 버퍼넘침 플래그 설정 시점에서 그 MB의 VLC 부호화가 종료되는 시점까지의 시간간격을 나타내며, 이는 하드웨어 구현에 따라 달라진다.In the above description, MB is generated from the time point at which the buffer value is set due to buffer overflow until the end of generation of the MB encoded bit by this flag after DCT encoding or VLC encoding according to the flag after the buffer overflow flag is set. This time interval represents the time interval from when the MB buffer overflow flag is set to when the VLC encoding of the MB ends. This is dependent on the hardware implementation.

상기 도 2의 예에서는 "mbclk" 인덱스 6 직전에 오버플로우(overflow) 플래그들이 발생되어 이 플래그에 따른 VLC 출력, 즉 "vstrm" 데이터는 "mbclk" 인덱스 8 직전에 끝나므로 약 2 mbclk 기간이 된다. 여기서, 플래그 설정 시점은 MB의 VLC출력이 종료된 이후, 그리고 다음 MB의 VLC 출력이 되기전에 이루어져야 한다.In the example of FIG. 2, overflow flags are generated immediately before the "mbclk" index 6, and the VLC output according to this flag, that is, the "vstrm" data ends just before the "mbclk" index 8, and thus has a duration of about 2 mbclk. . Here, the flag setting time should be made after the VLC output of the MB is finished and before the VLC output of the next MB is made.

이상에서, 버퍼넘침우려 플래그값 설정을 위한 기준값을 제시했는데, 이 기준값은 채널 버퍼의 넘침 위험 단계가 반드시 버퍼넘침 주의 단계와 경고 단계를 거쳐 진행되도록 했으며, 그리고 그 조건하에서 버퍼 넘침이 발생하지 않는 최소값으로 하여 결정했다. 그리나, 여기서는 채널 버퍼에서 MB 부호화로 비트가 발생될 때 채널 버퍼에서 빠져나가는 양은 고려하지 않았다. 이 값을 고려하면, 사실 상기에서 제시한 값보다 낮출 수 있다. 그러나, 이 값은 비트율 "bit_rate"에 따라 달라지며, 만약 1Mbps의 경우 겨우 25비트 정도 빠져나가기 때문에 여기에서는 무시하기로 한다.In the above, the reference value for setting the flag value for the buffer overflow is presented. This reference value ensures that the channel buffer overflow risk step goes through the buffer overflow warning step and the warning step, and that the buffer overflow does not occur under the condition. The minimum value was determined. However, we do not consider the amount of escape from the channel buffer when bits are generated by MB encoding in the channel buffer. Considering this value, in fact, it can be lower than the value given above. However, this value depends on the bit rate "bit_rate", and since it is only 25 bits out of 1Mbps, it will be ignored here.

두 번째로, 버퍼넘침 플래그에 따른 비트율제어 동작 과정을 살펴보기로 한다.Second, the operation of bit rate control according to the buffer overflow flag will be described.

비트율 제어(31)의 동작은 단지 양자화 파라미터(QP) 값을 생성하는 것으로 나타난다.The operation of the bit rate control 31 only appears to produce a quantization parameter (QP) value.

본 실시예에서는 비트율 제어(31) 방법에는 관여하지 않지만, 버퍼넘침 주의 플래그가 1로 되면 비트율 제어(31)는 QP를 무조건 최대값 "31"으로 설정하도록 한다. 이는 비트율 제어(31) 방법에 따라 그 순간에 자연히 QP가 "31"로 설정되어 있을 수도 있으나, 모든 비트율 제어(31) 방법이 그런 것은 아니다. 그리고, 본 실시예에서에서 버퍼넘침 경고와 위험 플래그에 따른 동작에서 QP 전송에 따른 비트 발생수를 줄이기 위해서 버퍼넘침 주의 단계부터 위험 단계까지 QP를 "31"로 유지시켜 QP값 변화가 없도록 하기 위함이다.Although not involved in the method of the bit rate control 31 in this embodiment, when the buffer overflow warning flag becomes 1, the bit rate control 31 causes QP to be set to the maximum value "31" unconditionally. This may naturally be set to " 31 " at that moment in accordance with the bit rate control 31 method, but not all bit rate control 31 methods are. In the present embodiment, in order to reduce the number of bits generated by the QP transmission in the operation according to the buffer overflow warning and the danger flag, the QP is maintained at "31" from the buffer overflow warning step to the dangerous step so that there is no change in the QP value. to be.

세 번째로, 버퍼넘침 플래그에 따른 모드제어부 동작(MB 부호화 모드 결정) 과정에 대해 살펴보기로 한다.Third, the operation of the mode controller (MB encoding mode determination) according to the buffer overflow flag will be described.

본 실시예에서는 버퍼넘침 주의 플래그가 1인 경우 모드제어부는 그 MB의 부호화모드를 인트라(Intra) 모드로 설정한다.In the present embodiment, when the buffer overflow warning flag is 1, the mode control unit sets the encoding mode of the MB to the intra mode.

버퍼넘침의 발생은 일반적으로 움직임 예측 부호화의 효과가 별로 나타나지 않는 영상의 복잡한 부분을 부호화할 때 일어나며, 이러한 경우 대부분 모드 제어부에 의해 인트라(Intra) 모드로 정해지나 인터(Inter) 모드로 결정될 때도 있다. 이러한 복잡한 영상의 경우 인터(Inter)보다 인트라(Intra)로 부호화하는 것이 비트 발생이 적어진다. 따라서, 본 실시예에서는 버퍼넘침 주의 플래그가 뜨면 MB부호화모드를 인트라(Intra) 모드로 설정한다. 버퍼넘침 경고 플래그나 버퍼넘침 위험 플래그가 뜰때도 당연히 버퍼넘침 주의 플래그가 뜨기 때문에 인트라(Intra) 모드로 설정된다.The occurrence of buffer overflow generally occurs when encoding a complex part of an image in which the effect of motion prediction coding is insignificant. In this case, the mode control unit determines the intra mode or the inter mode. . In the case of such a complex image, encoding in intra rather than inter causes less bit generation. Therefore, in the present embodiment, when the buffer overflow warning flag appears, the MB encoding mode is set to the intra mode. When the buffer overflow warning flag or the buffer overflow danger flag is displayed, the buffer overflow warning flag is displayed. Therefore, it is set to the intra mode.

네 번째로, 버퍼넘침 플래그에 따른 DCT 부호화부 동작(DCT계수의 양자화)과정에 대해 보다 상세히 설명한다.Fourth, the operation of the DCT encoder (quantization of the DCT coefficients) according to the buffer overflow flag will be described in more detail.

본 실시예에서 버퍼넘침 플래그들중 DCT 계수의 양자화에 영향을 미치는 플래그는 버퍼넘침 경고 플래그(overflow_warn)와 버퍼넘침 위험 플래그(overflow_danger)다.Among the buffer overflow flags in this embodiment, the flags that affect the quantization of the DCT coefficients are the buffer overflow warning flag (overflow_warn) and the buffer overflow risk flag (overflow_danger).

"overflow_warn"가 뜨면 블록의 DCT 계수의 정상적 양자화값중 디씨(DC : Direct Current) 성분만 남기고, 나머지 에이씨(AC : Alternative Current) 성분은 0으로 만들어 버린다. 그리고, 그 DC 값은 "overflow_danger" 동작을 위해 저장해 놓는다. 이때, "overflow_danger"가 1이면 DCT 계수의 모든 계수를 0으로 만들고, DC 성분은 "overflow_warn" 동작에서 저장되어 있는 이전 블록의 DC값으로 설정한다. 이것은 DCT DC의 VLC 부호화는 이전 DCT DC값과의 차에 대해 부호화를 하기 때문이다.When "overflow_warn" appears, only the DC (Direct Current) component of the normal quantization value of the DCT coefficient of the block is left, and the remaining AC (AC: Alternative Current) component is made 0. The DC value is then saved for the "overflow_danger" operation. At this time, if "overflow_danger" is 1, all coefficients of the DCT coefficients are set to 0, and the DC component is set to the DC value of the previous block stored in the "overflow_warn" operation. This is because VLC encoding of DCT DC encodes a difference from a previous DCT DC value.

버퍼넘침 위험 단계에서 이와 같이 함으로써 부호화의 비트 발생을 최대로 억제하게 되어 MPEG-2의 권장 비트율인 4Mbps보다 훨씬 낮은 1Mbps에서도 버퍼넘침 방지를 보장할 수 있게 된다.By doing this at the buffer overflow risk level, the bit generation of the encoding is suppressed to the maximum, thus ensuring buffer overflow protection even at 1 Mbps, much lower than the recommended bit rate of 4 Mbps of MPEG-2.

다섯 번째로, MB 최대 비트 발생량에 대해 보다 상세히 설명한다.Fifth, the MB maximum bit generation amount will be described in more detail.

버퍼넘침 방지 플래그값 생성에 사용되는 MB 부호화 최대 비트 발생수는 "chroma_format", "intra_dc_prec", "q_scale_type", "alternate_scan", "intra_vlc_format", QP, MB 부호화모드, 양자화 매트릭스 등에 따라 달라진다. 여기서는 사용자 정의 가능한 양자화 매트릭스가 표준에서 제시한 기준 매트릭스이고, "chroma_format"이 4:2:0로 MB당 블록이 6개일 때 정상상태, "overflow_note","overflow_warn", "overflow_danger" 상태에 따라 최대로 발생될 수 있는 값을 참고로 제시한다.The maximum number of MB coded bits used to generate the buffer overflow prevention flag value depends on "chroma_format", "intra_dc_prec", "q_scale_type", "alternate_scan", "intra_vlc_format", QP, MB encoding mode, quantization matrix, and the like. Here the user definable quantization matrix is the reference matrix suggested by the standard, and the maximum according to the steady state, "overflow_note", "overflow_warn", and "overflow_danger" states when "chroma_format" is 4: 2: 0 and there are 6 blocks per MB. The values that can be generated are given for reference.

정상상태(QP=1, q_scale_type=1, inter MB)에서는 "154(MB헤더) + 1,538(블록데이터)×6 = 9,382비트"이다.In the steady state (QP = 1, q_scale_type = 1, inter MB), "154 (MB header) + 1,538 (block data) x 6 = 9,382 bits".

버퍼넘침주의 상태(QP=31, q_scale_type=0, intra MB, intra_dc_prec=3)에서는 "27 + 171×6 = 1,053비트"이다.In the buffer overflow state (QP = 31, q_scale_type = 0, intra MB, intra_dc_prec = 3), "27 + 171 x 6 = 1,053 bits".

버퍼넘침경고 상태(QP=31, intra MB, intra_dc_prec = 3, only DCT DC)에서는 "3(MB헤더) + 20(휘도블럭) × 4 + 21(색도블럭) × 2 = 125비트"이다.In the buffer overflow warning state (QP = 31, intra MB, intra_dc_prec = 3, only DCT DC), "3 (MB header) + 20 (luminance block) x 4 + 21 (chromatic block) x 2 = 125 bits".

넘침위험상태(QP=31, intra MB, intra_dc_prec=3, DCT_DC=previous_DC)에서는 "3(MB헤어) + 3(휘도블럭) × 4 + 2(색도블럭) × 2 = 19비트"이다.In the overflow risk state (QP = 31, intra MB, intra_dc_prec = 3, DCT_DC = previous_DC), "3 (MB hair) + 3 (luminance block) x 4 + 2 (chromatic block) x 2 = 19 bits".

이때, 상기 도 2의 타이밍에 대한 플래그값 설정의 기준값은 다음과 같다.At this time, the reference value of the flag value setting for the timing of FIG. 2 is as follows.

Th_overnote : 9,382×2 + 1,053 + 125 = 19,942Th_overnote: 9,382 × 2 + 1,053 + 125 = 19,942

Th_overwarn : 1,053×2 + 125 = 2,231Th_overwarn: 1,053 × 2 + 125 = 2,231

Th_overdanger : 125×2 = 250Th_overdanger: 125 × 2 = 250

한편, 버퍼고갈방지(33) 방법에 대해 보다 상세히 설명한다.On the other hand, the buffer exhaustion prevention method 33 will be described in more detail.

MPEG 부호화는 고정비트율(CBR) 및 가변비트율(VBR) 출력을 모두 지원한다.MPEG encoding supports both fixed bit rate (CBR) and variable bit rate (VBR) output.

가변비트율 모드에서는 채널 버퍼에 데이터가 있으면 "bit_rate"의 율로, 없으면 출력하지 않는다. 따라서, VBR 동작에서는 채널 버퍼의 고갈이 문제가 되지않는다. 그러나, CBR 동작의 경우 항상 "bit_rate"율로 데이터를 출력해줘야 하는데, 만약 채널 버퍼에 데이터가 없으면 비디오 인코더에서 버퍼고갈의 문제가 발생한다. 이 문제는 아무런 정보를 담고있지 않는 스터핑 데이터(Stuffing Data)를 채워줌으로써 해결될 수 있다.In the variable bit rate mode, if there is data in the channel buffer, the rate is "bit_rate". Therefore, depletion of the channel buffer is not a problem in VBR operation. However, in case of CBR operation, data should always be output at the "bit_rate" rate. If there is no data in the channel buffer, a problem of buffer depletion occurs in the video encoder. This problem can be solved by filling stuffing data that contains no information.

스터핑 데이터의 삽입은 한정된 비트에서 그 만큼 정보의 낭비를 의미한다. 따라서, 스터핑은 가능한 한 적게 발생시켜 주어야 한다. 여기서, 스터핑을 가능한 가장 적게 발생하는 방법은, 버퍼고갈 문제가 발생할때마다 스터핑시켜 주는 것이다. 그러나, MPEG에서는 부호화중 아무 위치에서나 스터핑할 수 있는 것이 아니다.Insertion of stuffing data means waste of information in that limited bit. Therefore, stuffing should be generated as little as possible. Here, the least possible stuffing is to stuff whenever a buffer exhaustion problem occurs. However, MPEG does not allow stuffing at any position during encoding.

MPEG-1에서는 매크로블럭마다 스터핑할 수 있어 현재 매크로블럭에서 비트가 최소로 발생되어도 버퍼고갈이 발생되지 않을 정도의 데이터를 MB부호화전에 스터핑하여 버퍼고갈을 방지할 수 있다. 그러나. MPEG-2에서는 "start_code" 이전에서만 스터핑할 수 있도록 되어 있어 MB와 MB 사이에는 스터핑을 할 수 없다. 그래서, MPEG-2에서는 MB 단위로 스터핑할려면 "start_code"로 시작하는 슬라이스 헤더를 MB마다 발생시켜야 한다. 만약, 픽쳐의 전체를 이와 같은 슬라이스 구조(slice가 하나의 MB만 포함)를 갖도록 하면, 슬라이스헤더 발생에 따른 오버헤더가 커진다.In MPEG-1, each macroblock can be stuffed so that buffer exhaustion can be prevented by stuffing data such that buffer depletion does not occur even if a minimum bit is generated in the current macroblock before MB encoding. But. In MPEG-2, you can only stuff before "start_code", so you can't stuff between MB and MB. Therefore, in MPEG-2, slice headers starting with "start_code" must be generated for each MB in order to stuff in MB. If the entire picture has such a slice structure (slice includes only one MB), the overhead of the slice header generation increases.

이의 해결책은 정상상태에는 인코더시스템의 응용에 따라 결정되는 정해진 슬라이스 구조로 부호화하다가 버퍼고갈의 염려가 있을때만 MB 부호화한 후 스터핑해 주고 뒤따르는 MB는 슬라이스헤더로부터 시작하도록 하는 것이다. 본 실시예에서는 이와 같이 버퍼고갈을 방지하도록 하는 방법으로서 구체적인 내용은 다음과 같다.The solution is to encode a fixed slice structure determined by the application of the encoder system in the steady state, and then code the MB only when there is a concern of depletion of the buffer, and start the subsequent MB from the slice header. In the present embodiment, as a method of preventing the buffer exhaustion as described above, specific contents are as follows.

먼저, 시스템 클럭(sysclk)마다 채널 버퍼의 상태에 따라 버퍼고갈 경고 신호를 발생시킨다. 본 실시예에서 버퍼고갈 경고 신호값은 하드웨어에서 MB 처리기간에 빠져나가는 비트수를 기준으로 버퍼 상태값이 작으면 경고 플래그를 1로 하고, 그렇지 않으면 0로 설정한다.First, a buffer depletion warning signal is generated according to the state of the channel buffer for each system clock sysclk. In this embodiment, the buffer depletion warning signal value is set to 1 if the buffer status value is small based on the number of bits exiting from the MB processing period in hardware, and to 0 otherwise.

"mbclk"에 따라 MB 데이터를 부호화하는 VLC부는 MB의 부호화를 마친 시점에서 다음 "mbclk"까지 "underflow" 플래그에 따라 1이면 스터핑을 한다. 이때, "mbclk"를 만나면 이전 MB이후에 스터핑이 전혀 이루어지지 않았으면 정상적인 동작을, 스터핑이 이루어졌으면 슬라이스 헤더를 심은 후 MB를 부호화한다. MB 부호화 구간에서는 이와 같이 수행하며 시퀀스, GOP(Group Of Picture), 픽쳐 헤더를 부호화할시는 각 헤더를 부호화한 후 "underflow flag"에 따라 스터핑한다.The VLC that encodes MB data according to "mbclk" performs stuffing when the value is 1 according to the "underflow" flag until the next "mbclk" when the MB is encoded. At this time, when "mbclk" is met, if stuffing has not been performed since the previous MB, normal operation is performed, and if stuffing is performed, a slice header is planted and MB is encoded. In the MB encoding section, the process is performed as described above. When encoding a sequence, a group of picture (GOP), and a picture header, each header is encoded and stuffed according to an "underflow flag".

본 실시예에서 "underflow" 신호 발생을 위한 기준값은 도 3에서 버퍼상태를 얻기 위해 입력되는 "cstrm_en(채널버퍼에서 빠져나가는 상태를 나타냄)"의 "mbclk"간 발생횟수로부터 얻을 수 있다. 그리고, 본 발명이 VLC부에게 요구하는 것은 "mbclk"내에서 MB부호화 후 스터핑할 수 있는 여분의 클럭을 확보하고 그 양은 MB부호화에 의해 최소의 비트가 발생했을 때도 채널 버퍼에서 빠져나가는 데이터보다 많이 발생되도록 하는 스터핑량이다.In the present embodiment, the reference value for generating the "underflow" signal may be obtained from the occurrence count between "mbclk" of "cstrm_en (which indicates the state exiting from the channel buffer)" input to obtain the buffer state in FIG. In addition, the present invention requires the VLC unit to secure an extra clock that can be stuffed after MB encoding in " mbclk " The amount of stuffing to be generated.

이상에서 설명한 본 발명은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 있어 본 발명의 기술적 사상을 벗어나지 않는 범위내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 한정되는 것이 아니다.The present invention described above is capable of various substitutions, modifications, and changes without departing from the spirit of the present invention for those skilled in the art to which the present invention pertains, and the above-described embodiments and accompanying It is not limited to the drawing.

상기한 바와 같은 본 발명은, MPEG 비디오 인코더에서 하드웨어 복잡도를 증대시키지 않으면서도 부호화 화질 열화의 최소화로 채널버퍼고갈 방지와 버퍼넘침방지(1Mbps 이하까지)를 보장해 주는 효과가 있다.As described above, the present invention has an effect of ensuring channel buffer exhaustion prevention and buffer overflow prevention (up to 1Mbps or less) by minimizing deterioration in encoding quality without increasing hardware complexity in an MPEG video encoder.

Claims (8)

동영상 비디오 인코더에서 버퍼를 제어하는 방법에 있어서,In the video video encoder to control the buffer, 정상동작시에 상기 버퍼를 비트율제어모드로 비트 발생을 제어하다가, 버퍼넘침의 우려가 있는 경우에 버퍼의 넘침 우려 정도에 따라 버퍼넘침 우려 신호를 발생하는 제 1 단계; 및A first step of controlling bit generation in the bit rate control mode during normal operation, and generating a buffer overflow concern signal according to a buffer overflow concern when there is a fear of buffer overflow; And 상기 버퍼넘침 우려 신호에 따라, 비트율제어 동작, 매크로블록(MB) 부호화모드 결정, 그리고 이산여현변환(DCT) 양자화 동작을 제어하여 버퍼넘침을 방지하는 제 2 단계A second step of controlling a bit rate control operation, a macroblock (MB) coding mode, and a discrete cosine transform (DCT) quantization operation according to the buffer overflow concern signal to prevent buffer overflow 를 포함하는 동영상 비디오 인코더의 버퍼 제어 방법.Buffer control method of the video video encoder comprising a. 제 1 항에 있어서,The method of claim 1, 정상상태에서 상기 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 제 3 단계; 및A third step of encoding the buffer in a predetermined slice structure in a steady state and generating a buffer depletion warning signal when the buffer is depleted; And 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 제 4 단계After macroblock (MB) encoding, a fourth step of preventing buffer depletion by stuffing according to the buffer depletion warning signal and starting the following macroblock (MB) from a slice header 를 더 포함하는 동영상 비디오 인코더의 버퍼 제어 방법.The buffer control method of the video video encoder further comprising. 제 1 항 또는 제 2 항에 있어서,The method according to claim 1 or 2, 상기 버퍼넘침 우려 신호는,The buffer overflow concern signal, 실질적으로, 버퍼넘침 주의 신호, 버퍼넘침 경고 신호, 그리고 버퍼넘침 위험 신호를 포함하는 것을 특징으로 하는 동영상 비디오 인코더의 버퍼 제어 방법.Substantially, the buffer control method of a video video encoder, characterized in that it comprises a buffer overflow warning signal, a buffer overflow warning signal, and a buffer overflow danger signal. 동영상 비디오 인코더에서 버퍼를 제어하는 방법에 있어서,In the video video encoder to control the buffer, 정상상태에서 상기 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 제 1 단계; 및A first step of encoding the buffer in a predetermined slice structure in a steady state and generating a buffer depletion warning signal when the buffer is depleted; And 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 제 2 단계After macroblock (MB) encoding, a second step of preventing buffer depletion by stuffing according to the buffer depletion warning signal and starting the following macroblock (MB) from a slice header 를 포함하는 동영상 비디오 인코더의 버퍼 제어 방법.Buffer control method of the video video encoder comprising a. 제 4 항에 있어서,The method of claim 4, wherein 상기 버퍼고갈 경고 신호는,The buffer depletion warning signal is, 매크로블록(MB) 처리 기간에 채널 버퍼의 상태에 따라 빠져나가는 비트수를 기준으로 정해지는 것을 특징으로 하는 동영상 비디오 인코더의 버퍼 제어 방법.A method for controlling a buffer of a video video encoder, characterized in that it is determined based on the number of bits exiting according to a state of a channel buffer in a macroblock (MB) processing period. 프로세서를 구비한 동영상 비디오 인코더에,A video video encoder with a processor, 정상동작시에 버퍼를 비트율제어모드로 비트 발생을 제어하다가, 버퍼넘침의 우려가 있는 경우에 버퍼의 넘침 우려 정도에 따라 버퍼넘침 우려 신호를 발생하는 제1 기능; 및A first function of controlling bit generation in the bit rate control mode during normal operation, and generating a buffer overflow concern signal according to a buffer overflow concern in the case where there is a fear of buffer overflow; And 상기 버퍼넘침 우려 신호에 따라, 비트율제어 동작, 매크로블록(MB) 부호화모드 결정, 그리고 이산여현변환(DCT) 양자화 동작을 제어하여 버퍼넘침을 방지하는 제2 기능A second function of controlling a bit rate control operation, a macroblock (MB) coding mode, and a discrete cosine transform (DCT) quantization operation according to the buffer overflow concern signal to prevent buffer overflow 을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium having recorded thereon a program for realizing this. 제 6 항에 있어서,The method of claim 6, 정상상태에서 상기 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 제3 기능; 및A third function of encoding the buffer in a predetermined slice structure in a steady state and generating a buffer depletion warning signal when the buffer is depleted; And 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 제4 기능After macroblock (MB) encoding, a fourth function of stuffing according to the buffer depletion warning signal and starting the following macroblock (MB) from a slice header to prevent buffer exhaustion 을 더 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium that records a program for further realization. 프로세서를 구비한 동영상 비디오 인코더에,A video video encoder with a processor, 정상상태에서 버퍼를 정해진 슬라이스 구조로 부호화하다가, 상기 버퍼가 고갈의 우려가 있는 경우에 버퍼고갈 경고 신호를 발생하는 기능; 및Encoding a buffer in a predetermined slice structure in a steady state and generating a buffer depletion warning signal when the buffer is depleted; And 매크로블록(MB) 부호화 후, 상기 버퍼고갈 경고 신호에 따라 스터핑해 주고 뒤따르는 매크로블록(MB)을 슬라이스 헤더로부터 시작하도록 하여 버퍼 고갈을 방지하는 기능After macroblock (MB) encoding, stuffing is performed according to the buffer depletion warning signal and a subsequent macroblock (MB) starts from a slice header to prevent buffer depletion. 을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium having recorded thereon a program for realizing this.
KR10-1999-0067119A 1999-12-30 1999-12-30 Method of buffer control in video encoder KR100528791B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-1999-0067119A KR100528791B1 (en) 1999-12-30 1999-12-30 Method of buffer control in video encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-1999-0067119A KR100528791B1 (en) 1999-12-30 1999-12-30 Method of buffer control in video encoder

Publications (2)

Publication Number Publication Date
KR20010059598A true KR20010059598A (en) 2001-07-06
KR100528791B1 KR100528791B1 (en) 2005-11-15

Family

ID=19634237

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-1999-0067119A KR100528791B1 (en) 1999-12-30 1999-12-30 Method of buffer control in video encoder

Country Status (1)

Country Link
KR (1) KR100528791B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100486524B1 (en) * 2002-07-04 2005-05-03 엘지전자 주식회사 Shortening apparatus for delay time in video codec
KR100848457B1 (en) * 2002-05-06 2008-07-28 주식회사 케이티 Method of restricting bit generation and preventing buffer overflow in video encoder
KR100952239B1 (en) * 2005-07-14 2010-04-09 인텔 코오퍼레이션 A rate control method and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100848457B1 (en) * 2002-05-06 2008-07-28 주식회사 케이티 Method of restricting bit generation and preventing buffer overflow in video encoder
KR100486524B1 (en) * 2002-07-04 2005-05-03 엘지전자 주식회사 Shortening apparatus for delay time in video codec
KR100952239B1 (en) * 2005-07-14 2010-04-09 인텔 코오퍼레이션 A rate control method and apparatus

Also Published As

Publication number Publication date
KR100528791B1 (en) 2005-11-15

Similar Documents

Publication Publication Date Title
US5631644A (en) Image encoding apparatus
JP3688730B2 (en) Quantizer
KR970003789B1 (en) Bit allocation method for controlling bit-rate of video encoder
JP3818679B2 (en) Method and apparatus for encoding a digital signal representing a series of images
JP4373609B2 (en) Method and apparatus for adaptive encoding of video data stream
US6823008B2 (en) Video bitrate control method and device for digital video recording
KR100280592B1 (en) Method and apparatus for processing variable length encoded data
US6167088A (en) Method and apparatus for performing adaptive encoding rate control of a video information stream including 3:2 pull-down video information
US7095784B2 (en) Method and apparatus for moving picture compression rate control using bit allocation with initial quantization step size estimation at picture level
JPH0851626A (en) Method and device for quantizing transformation coefficient of moving picture signal and moving picture signal compression device
JP2001285861A (en) Device for encoding picture signal
US20040234142A1 (en) Apparatus for constant quality rate control in video compression and target bit allocator thereof
JPH09187007A (en) Resynchronizing method for data stream including error, encoder and decoder
EP1077000B1 (en) Conditional masking for video encoder
JP2007507128A (en) Video picture encoding and decoding with delayed reference picture refresh
JP4260894B2 (en) Memory efficient compression device in an image processing system
FI97591B (en) The picture coding
JPH09233474A (en) Method and device for decoding and displaying compression digital video sequence
KR100646385B1 (en) Method of image compression and device for implementing this method
KR19980026713A (en) Rate Control Method of DPCM / DCT Video Encoder
KR100528791B1 (en) Method of buffer control in video encoder
JPH08130746A (en) Coefficient quantization processing method
JPH11243548A (en) Method and device for encoding and decoding image sequence
US6205250B1 (en) System and method for minimizing clock cycles lost to overhead data in a video decoder
KR100413868B1 (en) Apparatus and method for generating on-screen-display messages using stored bitstreams

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: 20121101

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20131101

Year of fee payment: 9

LAPS Lapse due to unpaid annual fee