KR20060024609A - Apparatus and method for encoding of real-time moving image - Google Patents

Apparatus and method for encoding of real-time moving image Download PDF

Info

Publication number
KR20060024609A
KR20060024609A KR1020040073414A KR20040073414A KR20060024609A KR 20060024609 A KR20060024609 A KR 20060024609A KR 1020040073414 A KR1020040073414 A KR 1020040073414A KR 20040073414 A KR20040073414 A KR 20040073414A KR 20060024609 A KR20060024609 A KR 20060024609A
Authority
KR
South Korea
Prior art keywords
quantization parameter
slice
dct coefficients
quantization
target bit
Prior art date
Application number
KR1020040073414A
Other languages
Korean (ko)
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 KR1020040073414A priority Critical patent/KR20060024609A/en
Publication of KR20060024609A publication Critical patent/KR20060024609A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • 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
    • 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/174Methods 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 slice, e.g. a line of blocks or a group of blocks
    • 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/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/177Methods 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 a group of pictures [GOP]
    • 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]

Landscapes

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

Abstract

본 발명은 방송 수신 장치에 저장 매체를 장착하여 수신되는 방송 신호를 상기 저장 매체에 녹화/재생할 수 있는 PVR 장치에서 아날로그 방송의 녹화를 위해 아날로그 방송 신호를 실시간으로 부호화하기 위한 장치 및 방법에 관한 것이다. 특히 본 발명은 비디오의 각 GOP 구간에 대하여 실시간으로 non-zero DCT 계수의 개수를 분석하여 해당 구간에 적합한 비트량을 할당함으로써, 화질 및 비트 효율의 양쪽 측면에서 최적의 MPEG-2 비디오 비트 스트림을 제공한다. 또한 슬라이스 단위로 양자화 계수를 적응적으로 변화시킴으로써, 픽쳐 내에서의 변화에 대응할 수 있는 동시에 잦은 양자화 파라미터의 변화에 의한 불필요한 비트 소모를 최소화할 수 있다.The present invention relates to an apparatus and method for encoding an analog broadcast signal in real time for recording an analog broadcast in a PVR device capable of recording / reproducing a broadcast signal received by mounting a storage medium in a broadcast reception device on the storage medium. . In particular, the present invention analyzes the number of non-zero DCT coefficients in real time for each GOP section of the video and allocates an appropriate bit amount to the corresponding section, thereby providing an optimal MPEG-2 video bit stream in terms of both image quality and bit efficiency. to provide. In addition, by adaptively changing the quantization coefficients in slice units, it is possible to cope with changes in the picture and to minimize unnecessary bit consumption due to frequent changes in the quantization parameters.

양자화 파라미터, 실시간 부호화, non-zero DCT 계수Quantization parameters, real-time coding, non-zero DCT coefficients

Description

실시간 동영상 부호화 장치 및 방법{Apparatus and method for encoding of real-time moving image}Apparatus and method for encoding of real-time moving image}

도 1은 일반적인 PVR 장치를 이용한 아날로그 및 디지털 방송 녹화의 일 실시예를 보인 구성 블록도1 is a block diagram showing an embodiment of analog and digital broadcast recording using a conventional PVR device

도 2는 일반적인 MPEG-2 부호화 장치의 일 실시예를 보인 구성 블록도2 is a block diagram showing an embodiment of a general MPEG-2 encoding apparatus

도 3은 본 발명에 따른 단일 패스 가변 비트율 MPEG-2 부호화 장치 중 비트율 제어부의 일 실시예를 보인 상세 블록도3 is a detailed block diagram illustrating an embodiment of a bit rate control unit of a single pass variable bit rate MPEG-2 encoding apparatus according to the present invention;

도 4는 본 발명에 따른 MPEG-2 부호화 장치에서 non-zero DCT 계수의 개수에 의한 구간별 비트율을 산출하는 함수의 일 실시예를 보인 도면4 is a diagram illustrating an embodiment of a function for calculating a bit rate for each section based on the number of non-zero DCT coefficients in an MPEG-2 encoding apparatus according to the present invention.

도 5는 가변 양자화 파라미터와 고정 양자화 파라미터를 사용했을 때의 발생 비트량의 비교 그래프5 is a graph comparing the amount of bits generated when a variable quantization parameter and a fixed quantization parameter are used.

도 6은 본 발명에 따른 MPEG-2 부호화 장치에서 구간별 비트율 제어 과정의 일 실시예를 보인 흐름도6 is a flowchart illustrating an embodiment of a step-by-step bit rate control process in an MPEG-2 encoding apparatus according to the present invention.

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

301 : 선 양자화기 302 : 카운터301: line quantizer 302: counter

303 : 양자화 파라미터 결정부303: Quantization Parameter Determination Unit

본 발명은 디지털 방송 수신 장치에 관한 것으로서, 더욱 상세하게는 상기 방송 수신 장치에 저장 매체를 장착하여 수신되는 방송 신호를 상기 저장 매체에 녹화/재생할 수 있는 개인용 비디오 녹화 장치에서 아날로그 방송의 녹화를 위해 아날로그 방송 신호를 실시간으로 부호화하는 장치 및 방법에 관한 것이다. The present invention relates to a digital broadcast receiver, and more particularly, to recording analog broadcasts in a personal video recording apparatus capable of recording / reproducing a broadcast signal received by mounting a storage medium in the broadcast receiving device. An apparatus and method for encoding an analog broadcast signal in real time.

개인용 비디오 녹화 장치(Personal Video Recorder ; 이하 PVR 장치라 함)는 디지털 TV 또는 셋톱 박스 등에 하드디스크(HDD)를 장착함으로써, 디지털 방송을 HDD에 저장할 수 있는 기능을 제공한다. 이는 기존의 VCR(Video Cassette Recorder)이 녹화를 위해 비디오 테이프를 수시로 교체해 주어야 하는 불편을 해소함과 동시에 대용량의 방송 녹화가 가능케 한다. 아울러 상기 PVR 장치는 주 기능인 녹화 기능은 물론 타임 시프트(time-shift), 생방송 시청 중 순간 재생(instant replay), 기타 각종 트릭 플레이 기능을 제공하면서 사용자로 하여금 TV를 보다 다양하게 즐길 수 있는 향상된 기능을 제공한다.A personal video recorder (hereinafter referred to as a PVR device) provides a function of storing a digital broadcast on an HDD by attaching a hard disk (HDD) to a digital TV or a set-top box. This eliminates the inconvenience that the existing VCR (Video Cassette Recorder) has to replace the video tape at any time for recording, and at the same time enables a large amount of broadcast recording. In addition, the PVR device provides not only a recording function, which is a main function, but also a time-shift, instant replay, and other trick play functions. To provide.

이러한 PVR 장치에서 NTSC 또는 PAL 규격에 의한 아날로그 방송 신호를 MPEG(Moving Picture Experts Group)-2 비디오 스트림으로 변환하여 HDD에 녹화하기 위해서는 실시간 MPEG-2 비디오 부호화 장치가 필요하다. In such a PVR device, a real time MPEG-2 video encoding device is required to convert an NTSC or PAL analog broadcast signal into a moving picture expert group (MPEG) -2 video stream and record it on an HDD.

도 1은 PVR 장치에서 아날로그 및 디지털 방송을 HDD에 저장하는 경로를 나타낸다. NTSC나 PAL과 같은 아날로그 방송 신호는 아날로그 튜너(101)에서 튜닝된 후 A/D 컨버터(Analog/Digital Converter)(102)로 출력되어 디지털화된다. 1 illustrates a path for storing analog and digital broadcasts in an HDD in a PVR device. An analog broadcast signal such as NTSC or PAL is tuned in the analog tuner 101 and then output to the A / D converter 102 to be digitized.                         

도 1에서는 NTSC 전송 방식의 아날로그 방송 신호를 실시예로 설명하고 있다. In FIG. 1, an analog broadcast signal of the NTSC transmission method is described as an embodiment.

그러므로 상기 A/D 컨버터(102)에서 디지털화된 아날로그 방송 신호는 NTSC 디코더(103)로 출력된다. 상기 NTSC 디코더(103)에서는 아날로그 방송 신호를 MPEG-2로 부호화하기 위한 4:2:0 포맷으로 변환하여 MPEG-2 엔코더(104)로 출력한다. 상기 MPEG-2 엔코더(104)는 도 2와 같은 MPEG-2 압축 알고리즘에 의해 포맷 변환된 방송 신호를 압축 부호화하여 PVR 모듈(108)로 출력한다. Therefore, the analog broadcast signal digitized by the A / D converter 102 is output to the NTSC decoder 103. The NTSC decoder 103 converts an analog broadcast signal into a 4: 2: 0 format for encoding into MPEG-2 and outputs it to the MPEG-2 encoder 104. The MPEG-2 encoder 104 compresses and encodes a broadcast signal formatted by the MPEG-2 compression algorithm as shown in FIG. 2 and outputs the compressed signal to the PVR module 108.

한편 디지털 방송 신호는 디지털 튜너(105)에서 튜닝된 후 복조기(106)로 출력된다. 상기 복조기(106)는 튜닝된 방송 신호에 대해 변조 방식의 역으로 복조한다. 예를 들어, 수신된 디지털 방송이 지상파 방송이면 VSB(Vestigial Side Band) 복조를 수행하고, 위성 방송이면 QPSK(Quadrature Phase Shift Keying) 복조를 수행하여 트랜스포트 스트림(Transport Stream ; TS) 형태로 TS 디코더(107)로 출력한다. 상기 TS 디코더(107)는 입력되는 트랜스포트 스트림에 복수개 이상의 프로그램이 다중화되어 있는 경우 저장을 원하는 프로그램만을 역다중화하여 PVR 모듈(108)로 출력한다. Meanwhile, the digital broadcast signal is tuned by the digital tuner 105 and then output to the demodulator 106. The demodulator 106 demodulates the inverse of the modulation scheme for the tuned broadcast signal. For example, if the received digital broadcast is a terrestrial broadcast, a VSB (Vestigial Side Band) demodulation is performed, and if the satellite broadcast is a Quadrature Phase Shift Keying (QPSK) demodulation, a TS decoder in the form of a transport stream (TS) is performed. Output to (107). The TS decoder 107 demultiplexes only a desired program and outputs it to the PVR module 108 when a plurality of programs are multiplexed in an input transport stream.

상기 PVR 모듈(108)은 MPEG-2 엔코더(104)에서 압축 부호화된 아날로그 방송 스트림 또는, TS 디코더(107)에서 역다중화된 디지털 방송 스트림에 오디오 스트림 및 캡션 정보 등을 포함한 데이터 스트림을 함께 다중화(multiplexing)한 후 HDD(110)에 저장한다. 여기서 상기 오디오 스트림 및 데이터 스트림 또한 상응하는 부호화 장치를 이용하여 부호화를 수행하도록 한다. The PVR module 108 multiplexes the data stream including the audio stream and caption information to the analog broadcast stream compressed and encoded by the MPEG-2 encoder 104 or the digital broadcast stream demultiplexed by the TS decoder 107 together. After multiplexing) to store in the HDD (110). In this case, the audio stream and the data stream may also be encoded using a corresponding encoding device.                         

도 2는 일반적인 MPEG-2 엔코더의 구성 블록도로서, 매크로 블록 단위로 부호화가 이루어진다. 즉 매크로 블록 단위로 입력되는 영상이 인트라(intra) 타입 즉, I 픽쳐이면 감산기(201)를 거치지 않고 그대로 스위칭부(202)를 통해 DCT부(203)로 출력된다. 반대로 입력 영상이 인터(inter) 타입 즉, P나 B 픽쳐이면 감산기(201)에서 구해진 차분 영상 즉, 입력 영상과 움직임 보상(motion compensation ; MC)부(212)에서 움직임 보상된 영상과의 차분 영상이 스위칭부(202)를 통해 DCT부(203)로 출력한다. FIG. 2 is a block diagram illustrating a typical MPEG-2 encoder, in which encoding is performed on a macroblock basis. That is, if the image input in macroblock units is an intra type, that is, an I picture, it is output to the DCT unit 203 through the switching unit 202 without passing through the subtractor 201. On the contrary, if the input image is an inter type, that is, a P or B picture, the difference image obtained by the subtractor 201, that is, the difference image between the input image and the motion compensated image by the motion compensation MC 212. It outputs to the DCT unit 203 through this switching unit 202.

즉 상기 DCT부(203)로 입력되는 신호는 I 픽쳐의 경우에는 DC값을 기준으로 한 차영상(residual) 신호를 의미하고, P나 B 픽쳐의 경우에는 움직임 추정시 발생하는 차 영상(residual) 신호를 의미한다. That is, the signal input to the DCT unit 203 means a residual image signal based on a DC value in the case of an I picture, and a residual image generated during motion estimation in the case of a P or B picture. Means signal.

상기 스위칭부(202)의 출력 단자(c)는 입력 영상의 타입이 인트라인지, 인터인지에 따라 입력 영상 단자(a)로 절환되거나 감산기(201)의 출력 단자(b)로 절환된다. The output terminal c of the switching unit 202 is switched to the input image terminal a or the output terminal b of the subtractor 201 according to whether the type of the input image is intra or inter.

상기 DCT부(203)는 입력되는 데이터를 블록 단위로 DCT한 후 양자화부(204)로 출력하고, 양자화부(204)는 DCT 계수를 양자화 파라미터에 의해 결정되는 양자화 스텝 크기에 따라 양자화한다. 이때 전체적인 비트율과 화질에 영향을 끼치는 양자화 파라미터는 비트율 제어부(220)에서 결정된다. The DCT unit 203 DCTs the input data in block units and outputs the result to the quantization unit 204. The quantization unit 204 quantizes the DCT coefficient according to the quantization step size determined by the quantization parameter. In this case, the quantization parameter affecting the overall bit rate and the image quality is determined by the bit rate controller 220.

즉 상기 DCT부(203)는 2차원 축변환을 통해서 데이터의 상관성을 제거하는데, 이를 위해 픽쳐를 매크로 블록 단위로 분할하고, 각 16*16 크기의 매크로 블록을 다시 8*8 크기의 블록 단위로 나눈 후 나누어진 각각의 블록을 DCT식에 따라 축 변환시킨다. 이렇게 축변환된 데이터들은 양자화부(204)에서 소정의 양자화 스텝 크기로 양자화되면서 미리 정해진 스캔 방식에 따라 1차원으로 재배치된 후 가변 길이 코딩(Variable Length Coding ; VLC)부(205)로 출력된다. 상기 VLC부(205)는 재배치된 양자화된 DCT 계수에 대해 자주 나오는 값은 적은 수의 비트로, 드물게 나오는 값은 많은 수의 비트로 표시하여 전체 비트 수를 줄이는 엔트로피 부호화(Entropy Coding)를 수행한다. 이때 상기 DCT 계수 뿐만 아니라 픽처 헤더 정보 및 움직임 정보도 함께 부호화된다. That is, the DCT unit 203 removes the correlation of data through 2D axis transformation. To this end, the picture is divided into macroblock units, and each 16 * 16 macroblock is divided into 8 * 8 block units. After dividing, each divided block is transformed according to DCT equation. The axis-converted data are quantized to a predetermined quantization step size by the quantization unit 204 and rearranged in one dimension according to a predetermined scan method, and then output to the variable length coding (VLC) unit 205. The VLC unit 205 performs entropy coding to reduce the total number of bits by displaying a number of bits that appear frequently and a number of bits that rarely appear for the rearranged quantized DCT coefficients. In this case, not only the DCT coefficient but also picture header information and motion information are encoded.

이때, 상기 VLC부(205)에서 VLC된 데이터는 버퍼(206)로 출력되고, 상기 버퍼(206)는 VLC된 데이터를 일시적으로 저장한 후 PVR 모듈(108)를 거쳐 일정한 속도로 HDD(110)로 출력하고, 버퍼의 충만도(buffer fullness)를 계산하여 비트율 제어부(220)로 출력한다.At this time, the VLC data from the VLC unit 205 is output to the buffer 206, and the buffer 206 temporarily stores the VLC data and then passes through the PVR module 108 to the HDD 110 at a constant speed. The buffer fullness of the buffer is calculated and output to the bit rate controller 220.

그리고 상기 양자화부(204)에서 양자화된 DCT 계수는 다시 역양자화(IQ)부(207)로 입력되어 역양자화된 후 IDCT부(208)로 출력된다. 상기 IDCT부(208)는 역 양자화된 DCT 계수를 IDCT하여 가산기(209)로 출력한다. 상기 가산기(209)는 IDCT된 데이터가 인트라 타입이면 그대로, 인터 타입이면 움직임 보상부(212)에서 움직임 보상된 값을 더하여 최종 픽셀값인 완전한 영상으로 복원한 후 움직임 보상을 위해 프레임 메모리(210)에 저장한다.The DCT coefficients quantized by the quantization unit 204 are again input to the inverse quantization unit (IQ) unit 207, dequantized, and then output to the IDCT unit 208. The IDCT unit 208 IDCTs the inverse quantized DCT coefficients and outputs them to the adder 209. When the IDCT data is an intra type, the adder 209 is added to the motion compensated value by the motion compensator 212 if it is an inter type, and reconstructed to a complete image which is the final pixel value. Store in

상기 움직임 보상부(212)는 움직임 추정(Motion Estimation ; ME)부(211)의 추정 결과에 따라 프레임 메모리(210)로부터 읽어온 이전 프레임을 이용하여 움직임 보상을 수행한 후 감산기(201)와 스위칭부(213)로 출력한다. 상기 스위칭부 (213)는 IDCT된 데이터가 인트라 타입이면 오프되고, 움직임 보상부(212)에서 움직임 보상된 데이터는 가산기(209)로 출력되지 않는다. 만일 IDCT된 데이터가 인터 타입이면 상기 스위칭부(213)는 온되고, 움직임 보상부(212)에서 움직임 보상된 데이터는 스위칭부(213)를 통해 가산기(209)로 출력된다.The motion compensator 212 performs motion compensation using a previous frame read from the frame memory 210 according to the estimation result of the motion estimator ME 211 and then switches with the subtractor 201. Output to the unit 213. If the IDCT data is an intra type, the switching unit 213 is turned off, and the motion compensated data from the motion compensator 212 is not output to the adder 209. If the IDCT data is an inter type, the switching unit 213 is turned on, and the motion compensated data in the motion compensator 212 is output to the adder 209 through the switching unit 213.

상기 움직임 추정부(211)는 입력 영상과 프레임 메모리(210)에 저장된 참조 영상을 이용하여 움직임 벡터를 추정한 후 움직임 보상부(212)로 출력한다.The motion estimator 211 estimates a motion vector using the input image and the reference image stored in the frame memory 210 and outputs the motion vector to the motion compensator 212.

한편 실시간 MPEG-2 비디오 부호화 과정에서 가장 중요한 것은 비트량과 화질이다. 이 두 가지 특성은 서로 트레이드-오프(trade-off) 관계이며, 이 두 특성을 적절히 조화시켜 최적의 결과를 얻기 위한 과정이 바로 비트율 제어(rate control)이다. On the other hand, the most important thing in the real-time MPEG-2 video encoding process is the bit rate and image quality. These two characteristics are trade-off relations with each other, and the rate control is a process for achieving the best result by combining the two characteristics properly.

상기 비트율 제어는 주어진 비트율을 기준으로 버퍼 모델을 설정하여 비디오 데이터의 GOP(Group Of Picture) 및 각 프레임 단위로 부호화 과정에 필요한 비트량을 할당하는 과정이다.The bit rate control is a process of setting a buffer model based on a given bit rate and assigning a GOP (Group Of Picture) of video data and a bit amount required for the encoding process in each frame unit.

즉 상기 비트율 제어부(220)는 버퍼(206)의 충만도에 따라 양자화 파라미터(Qp)를 계산하여 양자화부(204)로 출력한다.That is, the bit rate controller 220 calculates the quantization parameter Qp according to the fullness of the buffer 206 and outputs the quantization parameter Qp to the quantization unit 204.

상기 양자화부(204)는 입력되는 양자화 파라미터(Qp)로부터 양자화 스텝 크기를 구하여 DCT 계수를 양자화한다. 즉 비트율 제어부(220)는 버퍼의 충만도에 따라 양자화부(204)의 스텝 크기를 가변시켜 데이터의 발생량을 조절하게 된다. The quantization unit 204 quantizes the DCT coefficient by obtaining the quantization step size from the input quantization parameter Qp. That is, the bit rate controller 220 adjusts the generation amount of data by varying the step size of the quantization unit 204 according to the fullness of the buffer.

예를 들어, 발생한 비트 수가 기준치 이상이면 버퍼(206)에 채워지는 데이터량이 증가하므로 양자화 스텝 크기를 증가시켜 다음에 발생할 비트수를 감소시키 고, 기준치 이하로 데이터가 발생하면 그 반대로 양자화 스텝 크기를 감소시켜 발생 비트수를 증가시켜 전체적으로 버퍼(206)의 상태가 일정치를 유지할 수 있도록 조절한다. For example, if the number of bits generated is greater than or equal to the reference value, the amount of data filled in the buffer 206 is increased. Therefore, the quantization step size is increased to reduce the number of bits to be generated later. The number of bits generated is increased to decrease the number of bits, so that the state of the buffer 206 can be maintained as a whole.

이때, ISO(International Organization for Standardization)의 산하 기구인 IS/IEC JTC1/SC29/WG11에서 국제 표준화 진행중인 MPEG-2의 자료(문서번호 AVC-491인 TEST MODEL 5)를 참조하면 비트율 제어부(220)는 다음의 3단계의 동작을 수행한다.In this case, referring to the international standardization MPEG-2 data (document number AVC-491, TEST MODEL 5), IS / IEC JTC1 / SC29 / WG11, an organization under ISO (International Organization for Standardization), the bit rate controller 220 Perform the following three steps.

먼저, 제 1 단계는 복잡도를 예측하고 목표 비트를 할당하는 단계이다. 즉, 전송 비트율에 따라 GOP(Group Of Picture) 단위로 일정한 비트율을 할당하고 GOP 내부에서 각 픽쳐에 할당할 비트들을 각 픽쳐(I,P,B 프레임)의 복잡도에 따라 할당한다.First, the first step is to predict complexity and to allocate target bits. That is, a constant bit rate is allocated in units of GOP (Group Of Picture) according to the transmission bit rate, and bits to be allocated to each picture in the GOP are allocated according to the complexity of each picture (I, P, B frame).

제 2 단계는 전송율(즉, 비트율)을 조절하는 단계로서, 가상적인 버퍼(virtual buffer)(206)의 충만도에 따라 각 매크로 블록에 대한 기준 양자화 파라미터를 계산한다. 그리고, 각 픽쳐를 상기 제 1 단계에서 할당받은 비트에 맞게 현재 픽쳐를 부호화할 수 있도록 비트율을 제어한다.The second step is to adjust the transmission rate (i.e., bit rate), and calculate a reference quantization parameter for each macro block according to the fullness of the virtual buffer 206. The bit rate is controlled so that each picture can be encoded according to the bit allocated in the first step.

여기에서는, 각 픽쳐마다 임의의 가상적인 버퍼를 가지고 있다고 가정하고, 상기 버퍼의 상태에 따라 양자화 파라미터를 조절하는 방법을 사용한다.Here, it is assumed that each picture has an arbitrary virtual buffer, and a method of adjusting the quantization parameter according to the state of the buffer is used.

제 3 단계는 적응 양자화 단계로서, 현재 부호화할 매크로 블록의 활성도(activity)를 구하여 정규화한 후 이 정규화된 활성도와 상기 제 2 단계에서 구한 기준 양자화 파라미터를 곱하여 실제로 양자화에 사용할 양자화 파라미터를 구한 다. 즉, 적응 양자화는 주관적 화질을 높일 수 있는 방법으로 상기 기준 양자화 파라미터를 현재의 매크로 블록의 복잡도에 따라 변화시키는 방법이다.The third step is an adaptive quantization step. After obtaining and normalizing the activity of a macroblock to be encoded currently, the normalized quantization parameter to be actually used for quantization is obtained by multiplying the normalized activity by the reference quantization parameter obtained in the second step. In other words, adaptive quantization is a method of increasing the subjective picture quality and changing the reference quantization parameter according to the complexity of the current macroblock.

그러나 이러한 종래의 비트율 제어 방법은 주어진 비트량의 효과적인 할당에 주력하여 상대적으로 화질의 최적화가 만족스럽게 이루어지지 않는 단점이 존재하였다. 특히 MPEG-2 비디오 부호화 과정에서 움직임이 많거나 시각적으로 복잡한 구조를 가진 영상으로 이루어진 구간에 대해서는 화질의 저하가 심화되는 경향이 있다. 그리고 이러한 화질 불균형에 의하여 주관적으로 느껴지는 화질 저하의 정도는 수치상의 차이에 비하여 그 정도가 더욱 두드러지게 나타난다. However, this conventional bit rate control method has a disadvantage in that the optimization of image quality is not satisfactorily achieved by focusing on an effective allocation of a given bit amount. In particular, in the MPEG-2 video encoding process, the deterioration of image quality tends to be intensified for a section composed of an image having a lot of motion or a visually complicated structure. In addition, the degree of deterioration of image quality felt by the image quality imbalance is more pronounced than the difference in numerical value.

따라서, MPEG-2 비디오 부호화에서 균일한 화질의 실현은 매우 중요한 문제이다. 특히 복잡한 영역, 즉 부호화가 까다로운 부분에서의 만족스러운 화질의 확보는 매우 중요하다. 이러한 균일한 화질의 실현을 위하여 종래의 수 많은 가변 비트율 방식이 제안되었으나 이러한 방식들은 영상의 복잡도에 대한 정량적이고 체계적인 측정 방법이 미흡하다는 문제점이 존재한다.Therefore, the realization of uniform picture quality in MPEG-2 video encoding is a very important problem. In particular, it is very important to ensure satisfactory image quality in a complicated area, that is, a difficult part of encoding. Many variable bit rate schemes have been proposed for realizing such a uniform picture quality, but these methods have a problem in that quantitative and systematic measurement methods for image complexity are insufficient.

또한 종래의 가변 비트율 제어 방법의 가장 큰 문제점은 발생하는 비트량에 대한 실시간 예측 방법이 거의 전무하다는 것이다. In addition, the biggest problem of the conventional variable bit rate control method is that there is almost no real-time prediction method for the amount of bits occurring.

따라서, 종래의 방법에서는 이중 패스(two-pass) 방법에 의한 비트량 제어를 수행한다. 즉, 한번 부호화를 수행한 다음 그 결과를 이용하여 다시 부호화를 수행하여 비트량을 제어하는 방법을 사용한다. 그러나 이러한 방법은 실시간 부호화를 필요로 하는 응용 분야에 적용할 수 없다는 문제점이 존재한다.Therefore, in the conventional method, bit amount control by the two-pass method is performed. That is, a method of controlling the amount of bits by performing encoding once and then performing encoding again using the result is used. However, there is a problem that such a method cannot be applied to an application field requiring real time encoding.

그리고 종래의 방법에서는 매크로 블록 단위로 각각의 복잡도에 근거하여 양 자화 파라미터 값을 변화시킨다. 그러나 인접한 매크로 블록의 양자화 파라미터 값의 잦은 변화는 비트 효율 측면에서 성능이 저하되는 단점이 존재한다. In the conventional method, the quantization parameter value is changed based on each complexity in units of macro blocks. However, frequent changes of quantization parameter values of adjacent macroblocks have a disadvantage in that performance is degraded in terms of bit efficiency.

본 발명은 상기와 같은 문제점을 해결하기 위한 것으로서, 본 발명의 목적은 PVR 장치에서 요구되는 실시간 방송 녹화에 적용 가능하도록 실시간으로 각 비디오 구간의 복잡도를 정량적으로 측정하여 해당 구간에 적합한 비트량을 실시간으로 할당하는 단일 패스 가변 비트율 MPEG-2 부호화 장치(one-pass variable bit-rate MPEG-2 encoder) 및 방법을 제공하는 것이다.The present invention is to solve the above problems, an object of the present invention is to quantitatively measure the complexity of each video section in real time to be applied to the real-time broadcast recording required by the PVR device in real time to determine the appropriate bit amount for the corresponding section A one-pass variable bit-rate MPEG-2 encoder and a method for allocating the same are provided.

본 발명의 다른 목적은 비트 효율을 극대화하여 화질과 비트 소모 측면에서 모두 효과적인 가변 비트율 MPEG-2 부호화 장치 및 방법을 제공하는 것이다. Another object of the present invention is to provide a variable bit rate MPEG-2 encoding apparatus and method which are effective in terms of image quality and bit consumption by maximizing bit efficiency.

상기 목적을 달성하기 위하여, 매크로 블록 단위로 입력되는 영상을 DCT 변환하고 이어 양자화 파라미터에 따라 DCT 계수를 양자화한 후 가변 길이 코딩(VLC)하여 입력 영상을 압축 부호화하는 본 발명에 따른 실시간 동영상 부호화 장치는, 기 설정된 기준 양자화 파라미터 값을 이용하여 현재 매크로 블록의 DCT 계수에 대해 선형 양자화하는 선 양자화(pre-quantization)기; 상기 현재 매크로 블록의 선 양자화된 DCT 계수 중 0이 아닌(non-zero) DCT 계수의 개수를 카운트하여 출력하는 카운터; 및 상기 카운터에서 카운트된 non-zero DCT 계수의 개수를 기반으로 현재 부호화하고자 하는 구간에 대한 목표 비트량을 결정하고, 상기 목표 비트량으로부터 슬라이스 단위로 양자화 파라미터를 결정하는 양자화 파라미터 결정부를 포함하 여 구성되는 것을 특징으로 한다. In order to achieve the above object, a real-time video encoding apparatus according to the present invention, which performs DCT conversion of an image input in macroblock units, quantizes DCT coefficients according to quantization parameters, and then compresses and encodes the input image by variable length coding (VLC). A pre-quantization device for linearly quantizing a DCT coefficient of a current macro block using a preset reference quantization parameter value; A counter for counting and outputting a number of non-zero DCT coefficients among the pre-quantized DCT coefficients of the current macro block; And a quantization parameter determiner that determines a target bit amount for a section to be currently encoded based on the number of non-zero DCT coefficients counted by the counter, and determines a quantization parameter in slice units from the target bit amount. It is characterized in that the configuration.

상기 양자화 파라미터 결정부는 선 양자화된 non-zero DCT 계수의 개수를 기준으로 현재 GOP에 대한 목표 비트량을 구하고, 결정된 목표 비트량으로부터 각 픽쳐 타입(I,P,B)별 목표 비트량을 구하며, 각 픽쳐 내 목표 비트량으로부터 각 슬라이스의 목표 비트량을 구한 후, 현재 슬라이스에 포함된 모든 매크로 블록에 적용할 양자화 파라미터를 결정하는 것을 특징으로 한다.The quantization parameter determiner obtains a target bit amount for the current GOP based on the number of pre-quantized non-zero DCT coefficients, and obtains a target bit amount for each picture type (I, P, B) from the determined target bit amount, After the target bit amount of each slice is obtained from the target bit amount in each picture, the quantization parameter to be applied to all macroblocks included in the current slice is determined.

상기 양자화 파라미터 결정부는 동일한 슬라이스 내 모든 매크로 블록에 대해서는 같은 양자화 파라미터를 이용하여 양자화를 수행하도록 양자화 파라미터를 결정하는 것을 특징으로 한다. The quantization parameter determiner may determine the quantization parameter to perform quantization for all macroblocks in the same slice using the same quantization parameter.

상기 양자화 파라미터 결정부는 이전 슬라이스까지 부호화하는 과정에서 얻어진 평균 비트율과 평균 non-zero DCT 계수의 개수 값의 비로 현재 슬라이스의 상수 C를 계산한 후, 상기 상수 C 값과 현재 슬라이스에 할당된 목표 비트량을 이용하여 현재 슬라이스 내에서 실제 부호화할 non-zero DCT 계수의 개수를 결정하는 것을 특징으로 한다. The quantization parameter determiner calculates a constant C of the current slice by a ratio of the average bit rate obtained in the process of encoding to the previous slice and the number of average non-zero DCT coefficients, and then allocates the constant C value and the target bit amount to the current slice. It is characterized by determining the number of non-zero DCT coefficients to be actually coded in the current slice.

상기 양자화 파라미터 결정부는 미리 후보로 지정된 다수개의 양자화 파라미터를 각각 적용하여 부호화할 슬라이스 내의 DCT 계수에 대해 양자화를 수행하고 non-zero DCT 계수의 개수에 대한 히스토그램 데이터를 추출한 후, 후보 양자화 파라미터 중 기 결정된 non-zero DCT 계수의 개수와 가장 가까운 값을 발생시키는 양자화 파라미터를 현재 부호화 하고자 하는 슬라이스에 대한 양자화 파라미터로 결정하는 것을 특징으로 한다. The quantization parameter determiner performs quantization on the DCT coefficients in the slice to be encoded by applying a plurality of quantization parameters previously designated as candidates, extracts histogram data about the number of non-zero DCT coefficients, and then determines among the candidate quantization parameters. A quantization parameter that generates a value closest to the number of non-zero DCT coefficients is determined as a quantization parameter for a slice to be currently encoded.                     

본 발명에 따른 실시간 동영상 부호화 방법은, The real-time video encoding method according to the present invention,

(a) 기 설정된 기준 양자화 파라미터 값을 이용하여 현재 매크로 블록의 DCT 계수에 대해 선 양자화(pre-quantization)하는 단계;(a) pre-quantizing a DCT coefficient of the current macro block using a preset reference quantization parameter value;

(b) 상기 현재 매크로 블록의 선 양자화된 DCT 계수 중 0이 아닌(non-zero) DCT 계수의 개수를 카운트하여 출력하는 단계;(b) counting and outputting the number of non-zero DCT coefficients among the pre-quantized DCT coefficients of the current macroblock;

(c) 상기 (b) 단계에서 카운트된 0이 아닌 DCT 계수의 개수를 기반으로 현재 부호화하고자 하는 GOP 구간에 대한 목표 비트량 및 각 픽쳐 타입(I,P,B)별 목표 비트량을 구하고, 각 픽쳐 내 목표 비트량으로부터 각 슬라이스의 목표 비트량을 구하여 할당하는 단계;(c) obtaining a target bit amount for a GOP interval to be currently encoded and a target bit amount for each picture type (I, P, B) based on the number of non-zero DCT coefficients counted in step (b); Obtaining and allocating a target bit amount of each slice from a target bit amount in each picture;

(d) 상기 (c) 단계에서 슬라이스 단위로 할당된 목표 비트량을 기반으로 현재 슬라이스 내에서 실제 부호화할 non-zero DCT 계수를 결정하는 단계; 및(d) determining a non-zero DCT coefficient to be actually encoded in the current slice based on the target bit amount allocated in the unit of slice in step (c); And

(e) 상기 (d) 단계에서 결정된 non-zero DCT 계수의 개수를 기반으로 현재 슬라이스에 포함된 모든 매크로 블록에 동일하게 적용할 양자화 파라미터를 결정하는 단계를 포함하여 이루어지는 것을 특징으로 한다.(e) determining a quantization parameter to be equally applied to all macroblocks included in the current slice based on the number of non-zero DCT coefficients determined in step (d).

본 발명의 다른 목적, 특징 및 잇점들은 첨부한 도면을 참조한 실시예들의 상세한 설명을 통해 명백해질 것이다.Other objects, features and advantages of the present invention will become apparent from the following detailed description of embodiments taken in conjunction with the accompanying drawings.

이하 상기의 목적을 구체적으로 실현할 수 있는 본 발명의 바람직한 실시예를 첨부한 도면을 참조하여 설명한다. 특히 도면에 도시되고 또 이것에 의해서 설명되는 본 발명의 구성과 작용은 적어도 하나의 실시예로서 설명되는 것이며, 이것에 의해서 상기한 본 발명의 기술적 사상과 그 핵심 구성 및 작용이 제한되지는 않 는다.Hereinafter, with reference to the accompanying drawings, preferred embodiments of the present invention that can specifically realize the above object will be described. In particular, the configuration and operation of the present invention shown in the drawings and described by it are described as at least one embodiment, by which the technical spirit of the present invention and its core configuration and operation are not limited. .

본 발명은 아날로그 방송 신호(예를 들면, NTSC 전송 방식)를 주어진 비트율에서 최적의 화질을 갖는 MPEG-2 비디오 스트림으로 실시간 부호화하기 위한 것이다. 이를 위해 각 장면의 복잡도를 분석하여 비트 발생량을 예측한 다음 효과적인 비트 할당 방법을 통해 사용자에게 고화질의 비디오 출력을 제공함과 동시에 비디오 데이터의 평균적인 비트율을 제어함으로써 저장 공간을 효과적으로 운용할 수 있게 한다. The present invention is to real-time encode an analog broadcast signal (e.g., NTSC transmission scheme) into an MPEG-2 video stream with optimal picture quality at a given bit rate. To do this, the complexity of each scene is analyzed to predict the amount of bits generated, and then an effective bit allocation method provides a user with a high-quality video output and controls the average bit rate of the video data so that the storage space can be effectively operated.

이와 같이 본 발명은 PVR 장치에서 요구되는 실시간 방송 녹화에 적용 가능하도록 MPEG-2 부호화 장치를 단일 패스(one-pass) 알고리즘으로 구현함으로써, 균일한 화질을 유지할 수 있고, 동시에 부호화 하고자 하는 비디오 데이터에 대한 복잡도를 효과적으로 분석하여 비트량을 할당할 수 있다. As described above, the present invention implements the MPEG-2 encoder by using a one-pass algorithm so that it can be applied to real-time broadcast recording required by the PVR device, thereby maintaining uniform picture quality and simultaneously encoding video data. The amount of bits can be allocated by effectively analyzing the complexity of the

도 3은 본 발명에 따른 단일 패스 가변 비트율 MPEG-2 비디오 부호화 장치 중 양자화 파라미터를 결정하는 비트율 제어부의 상세 블록도이다. 도 3을 보면, DCT 계수를 입력받아 선 양자화(Pre-quantization)를 수행하는 선 양자화기(301), 상기 선 양자화기(301)에서 양자화된 DCT 계수 중 0이 아닌 DCT 계수를 카운트하는 카운터(302), 및 상기 카운터(302)의 카운트 결과에 따라 양자화 파라미터를 구하는 양자화 파라미터 결정부(303)로 구성된다. 3 is a detailed block diagram of a bit rate controller for determining a quantization parameter in a single pass variable bit rate MPEG-2 video encoding apparatus according to the present invention. Referring to FIG. 3, a line quantizer 301 that receives DCT coefficients and performs pre-quantization and a counter that counts non-zero DCT coefficients among DCT coefficients quantized by the line quantizer 301 ( 302 and a quantization parameter determiner 303 for obtaining a quantization parameter according to the count result of the counter 302.

상기 선 양자화기(301)에서 DCT 계수를 선 양자화하는 것은 현재 부호화하고자 하는 비디오 데이터의 비트 발생량을 예측함으로써, 해당 구간의 복잡도를 정량적으로 측정할 수 있으며, 현재 비디오 구간에 대한 적절한 비트의 할당을 수행하 기 위함이다. 즉 상기 선 양자화기(301)는 선형(linear) 양자화 과정에서 양자화 파라미터 Q값의 범위가 2에서 62사이라고 할 때(Q는 짝수의 값을 갖는다), 기준 양자화 파라미터 Qref의 값으로 현재 매크로 블록의 DCT 계수에 대하여 양자화를 수행한다(2 ≤Qref ≤62). The linear quantization of the DCT coefficients in the line quantizer 301 predicts the amount of bit generation of video data to be currently encoded, thereby quantitatively measuring the complexity of the corresponding section, and assigning appropriate bits to the current video section. To do this. That is, the linear quantizer 301 is a macro of the current quantization parameter Q ref when the quantization parameter Q value ranges from 2 to 62 (Q has an even value) in the linear quantization process. Quantization is performed on the DCT coefficients of the block (2 ≦ Q ref ≦ 62).

상기 카운터(302)는 현재 매크로 블록의 양자화된 DCT 계수 중 0이 아닌 DCT 계수의 개수를 카운트하여 양자화 파라미터 결정부(303)로 출력한다. 상기 0이 아닌 DCT 계수의 개수는 해당 매크로 블록의 복잡도 및 비트 발생량에 비례하는 특성을 갖는다. The counter 302 counts the number of non-zero DCT coefficients among the quantized DCT coefficients of the current macro block and outputs the number to the quantization parameter determiner 303. The number of non-zero DCT coefficients has a property that is proportional to the complexity and bit generation amount of the macroblock.

본 발명에서는 설명의 편의를 위해 0이 아닌 DCT 계수를 non-zero DCT 계수라고 부르기로 한다. 이때 non-zero DCT 계수가 많다는 것은 매크로 블록의 차 영상 신호가 크다는 것을 의미한다. 이는 I 픽쳐의 경우 화면의 공간적 구조가 매우 복잡함을 의미하며, P나 B 픽쳐의 경우 움직임 추정 오차가 크다는 것을 의미한다. 즉, 움직임 추정 오차가 크다는 것은 해당 비디오 데이터에 복잡한 움직임 또는 매우 큰 움직임이 존재한다는 것으로 이러한 구간은 상대적으로 부호화하기가 매우 까다로운 비디오 데이터가 존재한다는 것을 의미한다. 아울러 0의 값을 갖는 양자화된 DCT 계수는 엔트로피 코딩 과정에서 0이 아닌 DCT 계수들에 비해 비트 발생량이 큰 의미를 갖지 않으므로 실제 비트 발생량에 있어서 0이 아닌 DCT 계수의 개수의 제어가 비트율 제어 측면에서 큰 의미를 갖는다. In the present invention, for convenience of description, a non-zero DCT coefficient will be referred to as a non-zero DCT coefficient. At this time, a large number of non-zero DCT coefficients means that the difference video signal of the macro block is large. This means that the spatial structure of the picture is very complicated for the I picture, and the motion estimation error is large for the P or B picture. That is, a large motion estimation error means that there is a complex motion or a very large motion in the video data. This means that there is video data that is very difficult to encode relatively. In addition, since the quantized DCT coefficient having a value of zero does not have a significant amount of bit generation compared to non-zero DCT coefficients in the entropy coding process, the control of the number of non-zero DCT coefficients in terms of the actual bit generation is in terms of bit rate control. Has a great meaning.

이러한 이유에 의하여 본 발명에서는 하기의 수학식 1과 같이 비트량은 non- zero DCT 계수의 개수에 비례한다는 가정을 한다.For this reason, it is assumed in the present invention that the bit amount is proportional to the number of non-zero DCT coefficients as shown in Equation 1 below.

R=C.Nc R = CN c

이때, R은 비트량을, Nc는 해당 매크로 블록의 non-zero DCT 계수의 개수를 나타내며, C는 상수를 의미한다. 즉, 비트량 R과 non-zero DCT 계수의 개수 Nc 사이에는 선형적인 관계가 존재한다고 가정한다.In this case, R represents a bit amount, N c represents the number of non-zero DCT coefficients of the corresponding macroblock, and C represents a constant. That is, it is assumed that a linear relationship exists between the bit amount R and the number N c of non-zero DCT coefficients.

또한 현재 구간에 대한 목표 비트량(Rlocal)은 하기의 수학식 2와 같이 non-zero DCT 계수의 개수에 따라서 가변적으로 할당하도록 한다.In addition, the target bit amount R local for the current interval may be variably allocated according to the number of non-zero DCT coefficients as shown in Equation 2 below.

Rlocal ∝ Nc R local ∝ N c

이때, 상기 Rlocal은 현재 구간에 대한 목표 비트량을 의미한다. 상기 Rlocal은 Nc에 비례하도록 할당하나 또는, 불연속적인 함수를 사용하여 해당 구간의 목표 비트량을 결정하도록 한다. 이때, 상기 구간은 일반적으로 GOP를 의미한다.In this case, R local means a target bit amount for the current section. The R local is allocated to be proportional to N c or used to determine a target bit amount of a corresponding interval by using a discontinuous function. In this case, the interval generally means a GOP.

이와 같이 본 발명은 선 양자화 과정을 통해 발생하는 DCT 계수의 개수를 이용함으로써, 해당 GOP 구간의 복잡도에 대한 정량적인 측정을 수행할 수 있다. As described above, the present invention can perform quantitative measurement on the complexity of the corresponding GOP interval by using the number of DCT coefficients generated through the line quantization process.

도 4는 본 발명에 의한 단일 패스 가변 비트율 MPEG-2 부호화 장치에서 사용하는 Rlocal과 Nc의 관계를 모델링한 함수를 나타낸다. 도 4에서 Rglobal은 전체적인 목표 비트율을 의미한다. 즉, 본 발명에서는 복잡도가 높은 구간에 대하여 보다 많은 비트량을 할당하며 이때 발생하는 비트율의 증가는 복잡하지 않은 구간의 비트율을 감소시킴으로써 해결한다. 4 illustrates a function modeling a relationship between R local and N c used in the single pass variable bit rate MPEG-2 encoding apparatus according to the present invention. In FIG. 4, R global means overall target bit rate. That is, in the present invention, a larger bit rate is allocated to a section having a high complexity, and an increase in the bit rate generated at this time is solved by reducing the bit rate of a section having a low complexity.

결과적으로 non-zero DCT 계수의 개수 Nc를 측정한 후, 도 4에 의하여 정의된 함수를 이용하여 해당 구간에 할당할 비트량을 결정한다. As a result, after measuring the number N c of non-zero DCT coefficients, the bit amount to be allocated to the corresponding interval is determined using the function defined by FIG. 4.

일반적으로 복잡하지 않은 영역에서 발생하는 화질 저하는 복잡한 영역에서 발생하는 화질 저하에 비하여 시각적으로 크게 느껴지지 않는다. 따라서, 복잡하지 않은 영역에서 비트 소모량을 줄여 이것을 복잡한 영역의 부호화에 사용함으로써 전체적인 시각적 화질을 높이는 효과를 볼 수 있다.In general, image quality deterioration occurring in an uncomplicated region is not visually significant compared to image quality deterioration occurring in a complex region. Therefore, it is possible to reduce the bit consumption in the uncomplicated region and use it for encoding the complex region, thereby improving the overall visual quality.

본 발명에 의한 단일 패스 가변 비트율 MPEG-2 부호화 장치에서는 부호화 효율을 보다 극대화하기 위하여 보다 효과적인 양자화 계수의 적응적 제어를 수행한다. In the single pass variable bit rate MPEG-2 encoding apparatus according to the present invention, more efficient adaptive control of quantization coefficients is performed to maximize encoding efficiency.

종래의 MPEG-2 부호화 장치에서는 매크로 블록 단위로 각각의 복잡도에 근거하여 양자화 파라미터 Q값을 변화시킨다. 그러나 인접한 매크로 블록의 양자화 파라미터 Q값의 잦은 변화는 비트 효율 측면에서 성능이 저하되는 단점이 존재한다. In the conventional MPEG-2 encoding apparatus, the quantization parameter Q value is changed based on each complexity in units of macroblocks. However, frequent changes in the quantization parameter Q values of adjacent macro blocks have a disadvantage in that performance is degraded in terms of bit efficiency.

도 5는 양자화 파라미터 Q값을 변화시켰을 때와, 고정시켰을 때의 비트 효율을 비교한 그래프를 나타낸다. 즉, 양자화 파라미터 Q를 Q1과 Q2 사이의 범위에서 변화시켰을 때의 평균 비트량을 R0라고 정의하고, 양자화 파라미터 Q를 Q1과 Q2의 중간 값으로 고정시켰을 때의 평균 비트량을 R1이라고 할 때, 도 5에서 보는 바와 같이 R1은 R0보다 작다는 것을 알 수 있다. 5 shows a graph comparing bit efficiency when the quantization parameter Q value is changed and when it is fixed. In other words, when the average bit amount when the quantization parameter Q is changed in the range between Q1 and Q2 is defined as R0, and the average bit amount when the quantization parameter Q is fixed to the intermediate value between Q1 and Q2 is R1, As shown in FIG. 5, it can be seen that R1 is smaller than R0.                     

그러므로 양자화 파라미터 Q값을 고정시키는 방법이 수시로 변화시키는 것보다 비트 효율의 측면에서 우수하다는 것을 알 수 있다. 그러나 실제로 같은 픽쳐 내에서도 배경과 물체의 특성이 다른 경우와 같이 비디오 신호의 특성이 크게 달라질 수 있으므로 이에 대한 적응적인 양자화 파라미터 Q값의 변화를 위해서 일정 단위로 Q 값을 다시 계산할 필요가 존재한다. Therefore, it can be seen that the method of fixing the quantization parameter Q value is superior in terms of bit efficiency than changing from time to time. However, since the characteristics of the video signal may be significantly different in the same picture as if the characteristics of the background and the object are different, there is a need to recalculate the Q value in a predetermined unit to change the adaptive quantization parameter Q value.

따라서, 본 발명에서는 상기된 두 경우에 대한 조건을 동시에 만족하기 위하여 매크로 블록이 아닌 슬라이스 단위로 양자화 파라미터 Q값을 할당한다. Therefore, in the present invention, the quantization parameter Q value is allocated in units of slices rather than macro blocks in order to simultaneously satisfy the conditions of the two cases described above.

다시 말해 같은 슬라이스에 포함된 매크로 블록들은 모두 같은 양자화 파라미터를 사용하여 양자화를 수행하도록 한다.In other words, all macro blocks included in the same slice are quantized using the same quantization parameter.

이렇게 함으로써, 적응적 양자화 과정에서 발생할 수 있는 비트 효율 저하를 최소한 방지하고, 프레임 내에서의 복잡도의 변화에 대응할 수 있다. By doing so, it is possible to at least prevent the bit efficiency degradation that may occur in the adaptive quantization process and to cope with the change in complexity in the frame.

통상 MPEG과 같은 동영상 표준화 규격에서는 영상을 매크로 블록이라 불리는 16×16 크기의 블록들로 나누어 처리하고 있으며, 여러 개의 매크로 블록은 슬라이스 단위로 묶이게 된다. 그리고, 영상 크기에 따라서 한 프레임은 여러 개의 슬라이스를 포함한다.In general, a video standardization standard such as MPEG divides and processes an image into 16 × 16 blocks called macro blocks, and several macro blocks are grouped into slice units. And, one frame includes several slices according to the image size.

도 6은 본 발명에 의한 단일 패스 가변 비트율 MPEG-2 부호화 장치에서 각 비디오 구간 단위로 비트율 제어를 위한 양자화 파라미터 계산 과정의 흐름도를 나타낸다.6 is a flowchart illustrating a process of calculating a quantization parameter for bit rate control in units of video sections in a single pass variable bit rate MPEG-2 encoding apparatus according to the present invention.

즉 단계 601에서는 현재 구간에 대한 목표 비트량을 할당한다. 상기 목표 비 트량은 먼저 현재 구간 즉, 현재 GOP에 대한 비트량 RGOP을 결정하는 것이다. 이때 전술한 바와 같이 선 양자화된 non-zero DCT 계수의 개수를 기준으로 도 4에 의하여 정의된 함수를 이용하여 현재 GOP에 대한 목표 비트량을 결정한다. 상기 non-zero DCT 계수의 개수는 선양자화 과정에서 양자화 파라미터 Q 값을 기준 양자화 파라미터 Qref로 하였을 때 발생하는 non-zero DCT 계수의 개수 Nc를 사용한다. That is, in step 601, a target bit amount for the current section is allocated. The target bit amount is to first determine the bit amount R GOP for the current interval, that is, the current GOP. At this time, the target bit amount for the current GOP is determined using the function defined by FIG. 4 based on the number of pre-quantized non-zero DCT coefficients as described above. The number of non-zero DCT coefficients uses the number N c of non-zero DCT coefficients generated when the quantization parameter Q value is referred to as the reference quantization parameter Q ref in the dequantization process.

그리고 나서, 각 픽쳐 타입(I, P, B)에 따라 할당할 비트량을 결정하도록 한다. 결과적으로 하기의 수학식 3과 같은 관계가 성립한다.Then, the bit amount to be allocated is determined according to each picture type (I, P, B). As a result, the following relationship is established.

RGOP = RI + RP + RB R GOP = R I + R P + R B

이때, RI, RP, RB는 각각 현재 GOP에서 I, P, B 픽쳐가 소모하는 비트량이다. 다시 말해, RP의 경우 현재 GOP에 포함된 모든 P 픽쳐에 할당되는 비트량의 합을 의미한다. 결과적으로 하나의 P 픽쳐에 할당되는 비트량은 RP를 NP로 나눈 값이 되며 NP는 현재 GOP에서 P 픽쳐의 개수를 나타낸다. I나 B 픽처도 마찬가지이다. 최종적으로 각 슬라이스에 대하여 목표 비트량 Rslice가 결정된다. 동일한 픽쳐 내에서 모든 슬라이스는 같은 크기의 비트량을 할당한다.In this case, R I , R P , and R B are bits used by I, P, and B pictures in the current GOP, respectively. In other words, R P means a sum of bits allocated to all P pictures included in the current GOP. As a result, the bit amount allocated to one P picture is obtained by dividing R P by N P , where N P represents the number of P pictures in the current GOP. The same applies to I and B pictures. Finally, the target bit amount R slice is determined for each slice. All slices within the same picture allocate bits of the same size.

즉 단계 602에서는 상기된 수학식 1의 모델링에 근거하여 하기의 수학식 4와 같이 현재 슬라이스의 상수 C를 계산한다. 이때, 현재 부호화 하고자 하는 슬라이스의 경우에 R 값이 존재하지 않으므로 R과 N의 값은 이전 슬라이스까지 부호화하 는 과정에서 얻어진 값을 기준으로 사용한다.That is, in step 602, the constant C of the current slice is calculated as shown in Equation 4 below based on the modeling of Equation 1 described above. In this case, since there is no R value in the slice to be currently encoded, the values of R and N are used based on the values obtained in the process of encoding the previous slice.

Cslice = Ravg / Navg C slice = R avg / N avg

이때, Ravg와 Navg는 부호화 과정에서 현재 슬라이스의 부호화 직전까지 얻어진 평균 비트율과 평균 non-zero DCT 계수의 개수 값을 나타내며, 각 GOP의 첫번째 슬라이스의 경우에는 Ravg와 Navg가 초기화된 상태이므로 이 경우에는 Q = Qfix 로 양자화 파라미터를 고정시키도록 한다. 상기 Qfix 값은 현재 GOP의 목표 비트량에 따라 다른 값으로 결정되며 4Mbps의 비트율로 부호화를 수행할 경우에 Qfix는 22의 값을 가진다. 또한 8Mbps의 비트율인 경우에 Qfix는 12의 값을 갖도록 한다. 그리고 슬라이스를 부호화 하는 과정에서 Ravg와 Navg는 계속하여 누적 갱신하도록 하며 C 값은 슬라이스 단위로 갱신된 값을 사용하도록 한다.In this case, R avg and N avg represent the average bit rate and the number of average non-zero DCT coefficients obtained up to immediately before encoding of the current slice in the encoding process, and R avg and N avg are initialized in the case of the first slice of each GOP. In this case, Q = Q fix to fix the quantization parameter. The Q fix value is determined to be different according to the target bit amount of the current GOP, and Q fix has a value of 22 when encoding is performed at a bit rate of 4 Mbps. Also, for 8 Mbps bit rate, Q fix has a value of 12. In the process of encoding a slice, R avg and N avg are continuously updated and C values are updated using a slice unit.

단계 603에서는 설정된 목표 비트량에 의한 비트율 제어를 위하여 부호화 할 non-zero DCT의 개수 N을 결정한다. 즉, 상수 C값에 의하여 R과 N의 모델링이 완성되며, 이때 N을 조절함으로써 R에 대한 제어를 정확하게 할 수 있다. 따라서 현재 슬라이스의 목표 비트량이 주어지면 부호화할 non-zero DCT 계수의 개수 N이 결정되며 이를 제어하기 위하여 상응하는 양자화 파라미터 Q 값을 결정하도록 한다.In step 603, the number N of non-zero DCTs to be encoded is determined for bit rate control by the set target bit amount. That is, the modeling of R and N is completed by the constant C value, and control of R can be precisely adjusted by adjusting N. Therefore, given the target bit amount of the current slice, the number N of non-zero DCT coefficients to be coded is determined, and the corresponding quantization parameter Q value is determined to control this.

단계 604에서는 현재 슬라이스에 포함된 모든 매크로 블록에 대하여 동일한 양자화 파라미터 Q값을 사용하여 선 양자화를 수행할 때 발생하는 non-zero DCT 계 수의 개수를 구한다. 즉, 양자화 파라미터 Q값의 후보들에 대하여 DCT 계수의 개수에 대한 히스토그램 데이터를 추출한다. 원칙적으로는 2에서 62 사이의 31개의 Q 값 후보들 각각에 대하여 선양자화 수행시 발생하는 슬라이스 내의 non-zero DCT 계수의 개수를 추출한다.In step 604, the number of non-zero DCT coefficients generated when performing line quantization using the same quantization parameter Q value for all macro blocks included in the current slice is obtained. That is, histogram data about the number of DCT coefficients is extracted for candidates of the quantization parameter Q value. In principle, we extract the number of non-zero DCT coefficients in a slice generated when performing dequantization for each of 31 Q value candidates between 2 and 62.

그리고 나서 단계 605에서는 단계 604에서 추출한 히스토그램 데이터를 이용하여 단계 603에서 계산한 N과 가장 가까운 값을 발생시키는 양자화 파라미터 Q값을 하기의 수학식 5와 같이 최종적인 양자화 파라미터로 결정한다.Then, in step 605, the quantization parameter Q value for generating the value closest to N calculated in step 603 is determined as the final quantization parameter using Equation 5 extracted in step 604.

Figure 112004041674280-PAT00001
Figure 112004041674280-PAT00001

상기 수학식 5에서 Qslice는 현재 부호화 하고자 하는 슬라이스에 대한 최종적인 양자화 파라미터를 나타내며, H(Qi)는 후보 양자화 파라미터 Qi에 대한 히스토그램, 다시 말해 Qi로 선양자화를 수행하였을 때 발생하는 슬라이스 내의 non-zero DCT 계수의 개수의 합을 의미한다. 그리고 Ntarget은 상기의 단계 603에서 계산된 현재 슬라이스에 대한 non-zero DCT 계수의 목표 개수를 의미한다.In Equation 5, Q slice represents a final quantization parameter for the slice to be currently encoded, and H (Qi) represents a histogram of the candidate quantization parameter Qi, that is, non-slice in the slice generated when performing prequantization with Qi. -zero The sum of the number of DCT coefficients. N target means the target number of non-zero DCT coefficients for the current slice calculated in step 603.

그리고 상기 단계 605에서 결정된 최종 양자화 파라미터는 양자화부(204)로 입력된다. 상기 양자화부(204)는 입력되는 최종 양자화 파라미터로부터 양자화 스텝 크기를 구하여 DCT 계수를 양자화함에 의해 데이터의 발생량을 조절하게 된다. The final quantization parameter determined in step 605 is input to the quantization unit 204. The quantization unit 204 obtains a quantization step size from an input final quantization parameter and quantizes a DCT coefficient to adjust the amount of data generation.

이와 같이 본 발명은 PVR 장치에서 요구되는 실시간 방송 녹화에 적용 가능 하도록 MPEG-2 부호화 장치를 단일 패스(one-pass) 알고리즘으로 구현함으로써, 균일한 화질을 유지할 수 있고, 동시에 부호화 하고자 하는 비디오 데이터에 대한 복잡도를 효과적으로 분석하여 비트량을 할당할 수 있다. As described above, the present invention implements the MPEG-2 encoder by using a one-pass algorithm so that it can be applied to real-time broadcast recording required by the PVR device, thereby maintaining uniform image quality and simultaneously encoding the video data to be encoded. The amount of bits can be allocated by effectively analyzing the complexity of the

따라서 본 발명은 아날로그 방송 신호(예를 들면, NTSC 전송 방식)를 주어진 비트율에서 최적의 화질을 갖는 MPEG-2 비디오 스트림으로 실시간 부호화할 수 있게 된다. Accordingly, the present invention enables real-time encoding of an analog broadcast signal (e.g., NTSC transmission scheme) into an MPEG-2 video stream with optimal picture quality at a given bit rate.

그러므로 본 발명은 디지털 TV에 하드 디스크를 장착한 PVR 장치에서 NTSC 및 PAL과 같은 아날로그 방송을 디지털 스트림으로 부호화하여 저장하는 분야에 적용할 수 있으며, 그 외에도 실시간 가변 비트율 MPEG-2 부호화 장치가 필요한 응용 분야에 적용할 수 있다.Therefore, the present invention can be applied to the field of encoding and storing analog broadcasts such as NTSC and PAL as a digital stream in a PVR device equipped with a hard disk in a digital TV, and besides, an application requiring a real-time variable bit rate MPEG-2 encoding device. Applicable to the field.

한편, 본 발명에서 사용되는 용어(terminology)들은 본 발명에서의 기능을 고려하여 정의 내려진 용어들로써 이는 당분야에 종사하는 기술자의 의도 또는 관례 등에 따라 달라질 수 있으므로 그 정의는 본 발명의 전반에 걸친 내용을 토대로 내려져야 할 것이다. On the other hand, the terms used in the present invention (terminology) are terms defined in consideration of the functions in the present invention may vary according to the intention or practice of those skilled in the art, the definitions are the overall contents of the present invention It should be based on.

그리고 본 발명은 상술한 실시예에 한정되지 않으며, 첨부된 청구범위에서 알 수 있는 바와 같이 본 발명이 속한 분야의 통상의 지식을 가지 자에 의해 변형이 가능하고 이러한 변형은 본 발명의 범위에 속한다. And the present invention is not limited to the above-described embodiment, and can be modified by those skilled in the art as can be seen from the appended claims and such modifications are within the scope of the present invention. .

상기에서 설명한 본 발명에 따른 실시간 동영상 부호화 장치 및 방법의 효과를 설명하면 다음과 같다. The effects of the real-time video encoding apparatus and method according to the present invention described above are as follows.                     

첫째, PVR 장치에서 아날로그 방송을 실시간으로 녹화하기 위한 응용 분야에서 비디오의 각 구간에 대하여 실시간으로 non-zero DCT 계수의 개수를 분석하여 해당 구간에 적합한 비트량을 할당함으로써, 화질 및 비트 효율의 양쪽 측면에서 최적의 MPEG-2 비디오 비트 스트림을 제공한다.First, in an application field for recording analog broadcasting in real time in a PVR device, by analyzing the number of non-zero DCT coefficients in real time for each section of video and allocating an appropriate bit amount for the corresponding section, In terms of aspect, it provides an optimal MPEG-2 video bit stream.

둘째, 슬라이스 단위로 양자화 계수를 적응적으로 변화시킴으로써, 픽쳐 내에서의 변화에 대응할 수 있는 동시에 잦은 양자화 파라미터의 변화에 의한 불필요한 비트 소모를 최소화할 수 있다. 이로 인해 매크로 블록 단위의 적응적 양자화 파라미터 산출 방법에 비하여 비트 효율 측면에서 우수한 성능을 보인다.Second, by adaptively changing the quantization coefficients in units of slices, it is possible to cope with changes in the picture and to minimize unnecessary bit consumption due to frequent changes of quantization parameters. As a result, it shows superior performance in terms of bit efficiency compared to the method for calculating adaptive quantization parameters in macroblock units.

셋째, 비트량과 non-zero DCT 계수의 개수를 지속적으로 갱신하여 다음 부호화 단위에 적용함으로써, 화면의 급격한 변화 또는 그 밖에 비트량 조율 과정에서 발생할 수 있는 돌발 상황에 대비할 수 있는 효과가 있다.Third, by continuously updating the number of bits and non-zero DCT coefficients and applying them to the next coding unit, it is possible to prepare for sudden changes in the screen or other unexpected situations that may occur during bit rate tuning.

이상 설명한 내용을 통해 당업자라면 본 발명의 기술 사상을 일탈하지 아니하는 범위에서 다양한 변경 및 수정이 가능함을 알 수 있을 것이다.Those skilled in the art will appreciate that various changes and modifications can be made without departing from the spirit of the present invention.

따라서 본 발명의 기술적 범위는 실시예에 기재된 내용으로 한정되는 것이 아니라 특허 청구의 범위에 의하여 정해져야 한다. Therefore, the technical scope of the present invention should not be limited to the contents described in the embodiments, but should be defined by the claims.

Claims (11)

매크로 블록 단위로 입력되는 영상을 DCT 변환하고 이어 양자화 파라미터에 따라 DCT 계수를 양자화한 후 가변 길이 코딩(VLC)하여 입력 영상을 압축 부호화하는 실시간 동영상 부호화 장치에 있어서, A real-time video encoding apparatus for DCT transforming an image input in macroblock units, and then quantizing a DCT coefficient according to a quantization parameter and then compressing and encoding an input image by variable length coding (VLC). 기 설정된 기준 양자화 파라미터 값을 이용하여 현재 매크로 블록의 DCT 계수에 대해 선형 양자화하는 선 양자화(pre-quantization)기;A pre-quantization device for linearly quantizing a DCT coefficient of the current macro block using a preset reference quantization parameter value; 상기 현재 매크로 블록의 선 양자화된 DCT 계수 중 0이 아닌(non-zero) DCT 계수의 개수를 카운트하여 출력하는 카운터; 및 A counter for counting and outputting a number of non-zero DCT coefficients among the pre-quantized DCT coefficients of the current macro block; And 상기 카운터에서 카운트된 non-zero DCT 계수의 개수를 기반으로 현재 부호화하고자 하는 구간에 대한 목표 비트량을 결정하고, 상기 목표 비트량으로부터 슬라이스 단위로 양자화 파라미터를 결정하는 양자화 파라미터 결정부를 포함하여 구성되는 것을 특징으로 하는 실시간 동영상 부호화 장치.And a quantization parameter determiner for determining a target bit amount for a section to be currently encoded based on the number of non-zero DCT coefficients counted by the counter, and determining a quantization parameter in units of slices from the target bit amount. Real-time video encoding apparatus, characterized in that. 제 1 항에 있어서, 상기 양자화 파라미터 결정부는 The method of claim 1, wherein the quantization parameter determiner 선 양자화된 non-zero DCT 계수의 개수를 기준으로 현재 GOP에 대한 목표 비트량을 구하고, 결정된 목표 비트량으로부터 각 픽쳐 타입(I,P,B)별 목표 비트량을 구하며, 각 픽쳐 내 목표 비트량으로부터 각 슬라이스의 목표 비트량을 구한 후, 현재 슬라이스에 포함된 모든 매크로 블록에 적용할 양자화 파라미터를 결정하는 것을 특징으로 하는 실시간 동영상 부호화 장치.Obtain a target bit amount for the current GOP based on the number of pre-quantized non-zero DCT coefficients, obtain a target bit amount for each picture type (I, P, B) from the determined target bit amount, and set a target bit in each picture. And determining a quantization parameter to be applied to all macroblocks included in the current slice after obtaining a target bit amount of each slice from the amount. 제 2 항에 있어서, 상기 양자화 파라미터 결정부는 The method of claim 2, wherein the quantization parameter determiner 동일한 픽쳐 내 모든 슬라이스에 대해서는 같은 크기의 목표 비트량을 할당하는 것을 특징으로 하는 실시간 동영상 부호화 장치.And all the slices in the same picture are allocated target bit amounts of the same size. 제 2 항에 있어서, 상기 양자화 파라미터 결정부는 The method of claim 2, wherein the quantization parameter determiner 동일한 슬라이스 내 모든 매크로 블록에 대해서는 같은 양자화 파라미터를 이용하여 양자화를 수행하도록 양자화 파라미터를 결정하는 것을 특징으로 하는 실시간 동영상 부호화 장치.And determining the quantization parameter to perform quantization using the same quantization parameter for all macroblocks in the same slice. 제 2 항에 있어서, 상기 양자화 파라미터 결정부는 The method of claim 2, wherein the quantization parameter determiner 이전 슬라이스까지 부호화하는 과정에서 얻어진 평균 비트율과 평균 non-zero DCT 계수의 개수 값의 비로 현재 슬라이스의 상수 C를 계산한 후, 상기 상수 C 값과 현재 슬라이스에 할당된 목표 비트량을 이용하여 현재 슬라이스 내에서 실제 부호화할 non-zero DCT 계수의 개수를 결정하는 것을 특징으로 하는 실시간 동영상 부호화 장치.After calculating the constant C of the current slice by the ratio of the average bit rate obtained in the process of encoding to the previous slice and the number of average non-zero DCT coefficients, the current slice using the constant C value and the target bit amount allocated to the current slice And a number of non-zero DCT coefficients to be actually encoded within the real-time video encoding apparatus. 제 5 항에 있어서, 상기 양자화 파라미터 결정부는 The method of claim 5, wherein the quantization parameter determiner 미리 후보로 지정된 다수개의 양자화 파라미터를 각각 적용하여 부호화할 슬라이스 내의 DCT 계수에 대해 양자화를 수행하고 non-zero DCT 계수의 개수에 대한 히스토그램 데이터를 추출한 후, 후보 양자화 파라미터 중 기 결정된 non-zero DCT 계수의 개수와 가장 가까운 값을 발생시키는 양자화 파라미터를 현재 부호화 하고자 하는 슬라이스에 대한 양자화 파라미터로 결정하는 것을 특징으로 하는 실시간 동영상 부호화 장치.Quantization is performed on the DCT coefficients in the slice to be encoded by applying a plurality of previously designated quantization parameters, and histogram data about the number of non-zero DCT coefficients is extracted, and then non-zero DCT coefficients are determined among the candidate quantization parameters. And determining a quantization parameter that generates a value closest to the number of s as a quantization parameter for a slice to be currently encoded. 매크로 블록 단위로 입력되는 영상을 DCT 변환하고 이어 양자화 파라미터에 따라 DCT 계수를 양자화한 후 가변 길이 코딩(VLC)하여 입력 영상을 압축 부호화하는 실시간 동영상 부호화 방법에 있어서, In the real-time video encoding method of DCT transform the input image in macroblock unit, and then quantize the DCT coefficient according to the quantization parameter and then compression-coding the input image by variable length coding (VLC), (a) 기 설정된 기준 양자화 파라미터 값을 이용하여 현재 매크로 블록의 DCT 계수에 대해 선 양자화(pre-quantization)하는 단계;(a) pre-quantizing a DCT coefficient of the current macro block using a preset reference quantization parameter value; (b) 상기 현재 매크로 블록의 선 양자화된 DCT 계수 중 0이 아닌(non-zero) DCT 계수의 개수를 카운트하여 출력하는 단계;(b) counting and outputting the number of non-zero DCT coefficients among the pre-quantized DCT coefficients of the current macroblock; (c) 상기 (b) 단계에서 카운트된 0이 아닌 DCT 계수의 개수를 기반으로 현재 부호화하고자 하는 GOP 구간에 대한 목표 비트량 및 각 픽쳐 타입(I,P,B)별 목표 비트량을 구하고, 각 픽쳐 내 목표 비트량으로부터 각 슬라이스의 목표 비트량을 구하여 할당하는 단계;(c) obtaining a target bit amount for a GOP interval to be currently encoded and a target bit amount for each picture type (I, P, B) based on the number of non-zero DCT coefficients counted in step (b); Obtaining and allocating a target bit amount of each slice from a target bit amount in each picture; (d) 상기 (c) 단계에서 슬라이스 단위로 할당된 목표 비트량을 기반으로 현재 슬라이스 내에서 실제 부호화할 non-zero DCT 계수를 결정하는 단계; 및(d) determining a non-zero DCT coefficient to be actually encoded in the current slice based on the target bit amount allocated in the unit of slice in step (c); And (e) 상기 (d) 단계에서 결정된 non-zero DCT 계수의 개수를 기반으로 현재 슬라이스에 포함된 모든 매크로 블록에 동일하게 적용할 양자화 파라미터를 결정하 는 단계를 포함하여 이루어지는 것을 특징으로 하는 실시간 동영상 부호화 방법.(e) determining a quantization parameter to be equally applied to all macroblocks included in the current slice based on the number of non-zero DCT coefficients determined in step (d). Coding method. 제 7 항에 있어서, 상기 (c) 단계는 8. The method of claim 7, wherein step (c) 동일한 픽쳐 내 모든 슬라이스에 대해서는 같은 크기의 목표 비트량을 할당하는 것을 특징으로 하는 실시간 동영상 부호화 방법.The real-time video encoding method, characterized in that the target bit amount of the same size is allocated to all slices in the same picture. 제 7 항에 있어서, 상기 (d) 단계는 8. The method of claim 7, wherein step (d) 이전 슬라이스까지 부호화하는 과정에서 얻어진 평균 비트율 Ravg과 평균 non-zero DCT 계수의 개수 Navg값을 이용하여 현재 슬라이스의 상수 C(=Ravg / Navg )를 계산하는 단계와,Calculating a constant C (= R avg / N avg ) of the current slice using the average bit rate R avg and the number of average non-zero DCT coefficients N avg obtained in the previous slice encoding; 상기 상수 C값과 상기 (c) 단계의 현재 슬라이스의 목표 비트량을 이용하여 현재 슬라이스 내에서 부호화할 non-zero DCT 계수의 개수를 결정하는 단계로 이루어지는 것을 특징으로 하는 실시간 동영상 부호화 방법.And determining the number of non-zero DCT coefficients to be encoded in the current slice by using the constant C value and the target bit amount of the current slice in the step (c). 제 9 항에 있어서, 상기 (d) 단계는 The method of claim 9, wherein step (d) 슬라이스를 부호화하는 과정에서 Ravg와 Navg는 계속하여 누적 갱신하도록 하며, 상기 상수 C 값은 슬라이스 단위로 갱신되는 단계를 더 포함하는 것을 특징으로 하는 실시간 동영상 부호화 방법.R avg and N avg are continuously updated in a slice encoding process, and the constant C value is further updated in slice units. 제 7 항에 있어서, 상기 (e) 단계는The method of claim 7, wherein step (e) 미리 후보로 지정된 다수개의 양자화 파라미터로 부호화할 슬라이스 내의 DCT 계수에 대해 각각 양자화를 수행하여 후보 양자화 파라미터별로 non-zero DCT 계수의 개수에 대한 히스토그램 데이터를 추출하는 단계와,Extracting histogram data for the number of non-zero DCT coefficients for each candidate quantization parameter by performing quantization on DCT coefficients in a slice to be encoded with a plurality of quantization parameters previously designated as candidates; 후보 양자화 파라미터 중 상기 (d) 단계에서 결정된 non-zero DCT 계수의 개수와 가장 가까운 값을 발생시키는 양자화 파라미터를 현재 부호화 하고자 하는 슬라이스에 대한 양자화 파라미터로 결정하는 단계로 이루어지는 것을 특징으로 하는 실시간 동영상 부호화 방법.Real-time video encoding comprising the step of determining a quantization parameter that generates a value closest to the number of non-zero DCT coefficients determined in step (d) among the candidate quantization parameters as a quantization parameter for a slice to be currently encoded. Way.
KR1020040073414A 2004-09-14 2004-09-14 Apparatus and method for encoding of real-time moving image KR20060024609A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020040073414A KR20060024609A (en) 2004-09-14 2004-09-14 Apparatus and method for encoding of real-time moving image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020040073414A KR20060024609A (en) 2004-09-14 2004-09-14 Apparatus and method for encoding of real-time moving image

Publications (1)

Publication Number Publication Date
KR20060024609A true KR20060024609A (en) 2006-03-17

Family

ID=37130403

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020040073414A KR20060024609A (en) 2004-09-14 2004-09-14 Apparatus and method for encoding of real-time moving image

Country Status (1)

Country Link
KR (1) KR20060024609A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101282193B1 (en) * 2009-11-10 2013-07-04 한국전자통신연구원 Method for Rate Control of Video Encoder using Kalman Filter and FIR Filter
EP3259848A4 (en) * 2015-04-10 2018-10-24 Red.Com, Llc Video camera with rate control video compression
US11019336B2 (en) 2017-07-05 2021-05-25 Red.Com, Llc Video image data processing in electronic devices

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101282193B1 (en) * 2009-11-10 2013-07-04 한국전자통신연구원 Method for Rate Control of Video Encoder using Kalman Filter and FIR Filter
EP3259848A4 (en) * 2015-04-10 2018-10-24 Red.Com, Llc Video camera with rate control video compression
US10531098B2 (en) 2015-04-10 2020-01-07 Red.Com, Llc Video camera with rate control video compression
US11076164B2 (en) 2015-04-10 2021-07-27 Red.Com, Llc Video camera with rate control video compression
US11019336B2 (en) 2017-07-05 2021-05-25 Red.Com, Llc Video image data processing in electronic devices
US11503294B2 (en) 2017-07-05 2022-11-15 Red.Com, Llc Video image data processing in electronic devices
US11818351B2 (en) 2017-07-05 2023-11-14 Red.Com, Llc Video image data processing in electronic devices

Similar Documents

Publication Publication Date Title
US9942570B2 (en) Resource efficient video processing via prediction error computational adjustments
US7492820B2 (en) Rate control for video coder employing adaptive linear regression bits modeling
US7453938B2 (en) Target bitrate estimator, picture activity and buffer management in rate control for video coder
US8300688B2 (en) Method for video transcoding with adaptive frame rate control
US7869503B2 (en) Rate and quality controller for H.264/AVC video coder and scene analyzer therefor
US7301999B2 (en) Quantization method and system for video MPEG applications and computer program product therefor
US7653129B2 (en) Method and apparatus for providing intra coding frame bit budget
US20100166060A1 (en) Video transcoder rate control
US8406297B2 (en) System and method for bit-allocation in video coding
US20060227868A1 (en) System and method of reduced-temporal-resolution update for video coding and quality control
US20130301710A1 (en) Image decoding device, image encoding device, and method thereof
US9071844B2 (en) Motion estimation with motion vector penalty
KR100790149B1 (en) Rate control of scene-changed video encoder
JP2001145113A (en) Device and method for image information conversion
US7986731B2 (en) H.264/AVC coder incorporating rate and quality controller
JP2003520513A (en) Image data compression
EP2328351B1 (en) Rate and quality controller for H.264/AVC video coder and scene analyzer therefor
KR100617097B1 (en) Method for encoding of real-time moving image
JPH0998427A (en) Dynamic image encoding device
KR100793781B1 (en) Apparatus and method for encoding of real-time moving image
KR20060024609A (en) Apparatus and method for encoding of real-time moving image
KR101087109B1 (en) Video encoder and its method
KR20030083109A (en) apparatus for transcoding bit rate
Lu et al. Efficient and low-cost video transcoding
Beuschel Video compression systems for low-latency applications

Legal Events

Date Code Title Description
WITN Withdrawal due to no request for examination