KR100617097B1 - Method for encoding of real-time moving image - Google Patents

Method for encoding of real-time moving image Download PDF

Info

Publication number
KR100617097B1
KR100617097B1 KR1020050003767A KR20050003767A KR100617097B1 KR 100617097 B1 KR100617097 B1 KR 100617097B1 KR 1020050003767 A KR1020050003767 A KR 1020050003767A KR 20050003767 A KR20050003767 A KR 20050003767A KR 100617097 B1 KR100617097 B1 KR 100617097B1
Authority
KR
South Korea
Prior art keywords
bit amount
quantization parameter
target bit
picture
real
Prior art date
Application number
KR1020050003767A
Other languages
Korean (ko)
Other versions
KR20060083298A (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 KR1020050003767A priority Critical patent/KR100617097B1/en
Publication of KR20060083298A publication Critical patent/KR20060083298A/en
Application granted granted Critical
Publication of KR100617097B1 publication Critical patent/KR100617097B1/en

Links

Images

Classifications

    • CCHEMISTRY; METALLURGY
    • C02TREATMENT OF WATER, WASTE WATER, SEWAGE, OR SLUDGE
    • C02FTREATMENT OF WATER, WASTE WATER, SEWAGE, OR SLUDGE
    • C02F3/00Biological treatment of water, waste water, or sewage
    • C02F3/02Aerobic processes
    • C02F3/12Activated sludge processes
    • C02F3/1205Particular type of activated sludge processes
    • C02F3/121Multistep treatment
    • CCHEMISTRY; METALLURGY
    • C02TREATMENT OF WATER, WASTE WATER, SEWAGE, OR SLUDGE
    • C02FTREATMENT OF WATER, WASTE WATER, SEWAGE, OR SLUDGE
    • C02F3/00Biological treatment of water, waste water, or sewage
    • C02F3/02Aerobic processes
    • C02F3/12Activated sludge processes
    • C02F3/14Activated sludge processes using surface aeration
    • EFIXED CONSTRUCTIONS
    • E03WATER SUPPLY; SEWERAGE
    • E03FSEWERS; CESSPOOLS
    • E03F11/00Cesspools

Landscapes

  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Hydrology & Water Resources (AREA)
  • Water Supply & Treatment (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Microbiology (AREA)
  • Environmental & Geological Engineering (AREA)
  • Chemical & Material Sciences (AREA)
  • Organic Chemistry (AREA)
  • Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

본 발명은 방송 수신 장치에 저장 매체를 장착하여 수신되는 방송 신호를 상기 저장 매체에 녹화/재생할 수 있는 PVR 장치에서 아날로그 방송의 녹화를 위해 아날로그 방송 신호를 실시간으로 부호화하기 위한 방법에 관한 것이다. 특히 본 발명은 매크로 블록의 목표 비트량을 비트량과 양자화 파라미터의 관계를 모델링한 R-Q 모델식에 적용하여 상기 매크로 블록의 목표 비트량에 대한 양자화 파라미터를 결정하도록 함으로써, PVR 장치에서 아날로그 방송을 실시간으로 녹화하기 위한 응용 분야에서 저장 공간 운용의 효율성을 극대화하기 위한 비트율 제어를 보다 정확하고 효과적으로 수행할 수 있다. The present invention relates to a method for encoding an analog broadcast signal in real time for recording an analog broadcast in a PVR apparatus capable of recording / reproducing a broadcast signal received by mounting a storage medium in a broadcast receiving device. In particular, the present invention is to apply the target bit amount of the macro block to the RQ model equation modeling the relationship between the bit amount and the quantization parameter to determine the quantization parameter for the target bit amount of the macro block, thereby real-time analog broadcast in the PVR device In the application field for recording with digital recording, the bit rate control to maximize the efficiency of storage space operation can be performed more accurately and effectively.

실시간 동영상 부호화, R-Q 모델식, 양자화 파라미터Real-time video coding, R-Q model, quantization parameter

Description

실시간 동영상 부호화 방법{Method for encoding of real-time moving image}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 flowchart illustrating an embodiment of a quantization parameter determination process in an MPEG-2 encoding apparatus according to the present invention.

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

201 : 감산기 202,213 : 스위칭부201: subtractor 202,213: switching unit

203 : DCT부 204 : 양자화부203: DCT unit 204: quantization unit

205 : VLC부 206 : 버퍼205: VLC section 206: buffer

207 : 역양자화부 208 : IDCT부207: Inverse quantization unit 208: IDCT unit

209 : 가산기 210 : 프레임 메모리209: Adder 210: Frame Memory

211 : 움직임 보상부 212 : 움직임 추정부211: motion compensation unit 212: motion estimation unit

250 : 비트율 제어부 251 : 기준 양자화 파라미터 계산부250: bit rate control unit 251: reference quantization parameter calculation unit

252 : 복잡도 계산부 253 : 적응 양자화 파라미터 발생부252: complexity calculator 253: adaptive quantization parameter generator

본 발명은 디지털 방송 수신 장치에 관한 것으로서, 더욱 상세하게는 상기 방송 수신 장치에 저장 매체를 장착하여 수신되는 방송 신호를 상기 저장 매체에 녹화/재생할 수 있는 개인용 비디오 녹화 장치에서 아날로그 방송의 녹화를 위해 아날로그 방송 신호를 실시간으로 부호화하는 방법에 관한 것이다. 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. A method of 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 the format-converted broadcast signal by the MPEG-2 compression algorithm as shown in FIG. 2 and outputs the encoded 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 계수를 양자화 파라미터에 의해 결정되는 양자화 스텝 크기에 따라 양자화한다. 이때 전체적인 비트율과 화질에 영향을 끼치는 양자화 파라미터는 비트율 제어부(250)에서 결정된다. 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 250.

즉 상기 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)를 계산하여 비트율 제어부(250)로 출력한다.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 250.

그리고 상기 양자화부(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 on the basis of a given bit rate, assigning a GOP (Group Of Picture) of video data and a bit amount required for encoding in units of frames, and determining a corresponding quantization parameter.

상기 MPEG-2 엔코더에서 가장 중요한 것은 부호화를 수행하는 과정에서 현재 사용하고 있는 부호화 파라미터 조합들에 의해 부호화되는 비디오 스트림이 미리 설정한 비트율 제약 조건을 만족시키는지 여부이다. 이러한 문제를 확실히 해결하는 방법이 이중 패스(two-pass) 부호화 방식이다. 즉, 부호화를 수행하여 발생한 MPEG-2 스트림을 분석한 다음 부호화 파라미터를 재조정하여 조건을 만족시키는 최종적인 MPEG-2 스트림을 출력하는 것이다. The most important factor in the MPEG-2 encoder is whether or not the video stream encoded by the encoding parameter combinations currently used in the encoding process satisfies a preset bit rate constraint. The method to surely solve this problem is a two-pass coding scheme. In other words, the MPEG-2 stream generated by encoding is analyzed and then the encoding parameter is readjusted to output the final MPEG-2 stream satisfying the condition.

그러나 이러한 방법은 PVR과 같은 응용 분야에서 필수적으로 요구되는 실시 간 부호화라는 조건을 만족시키지 못하는 단점이 있다. However, this method has a disadvantage in that it does not satisfy the condition of real-time coding, which is required in an application field such as a PVR.

따라서 PVR 등에서 방송 녹화를 위한 실시간 MPEG-2 비디오 부호화 과정의 구조적인 특성상 부호화 장치는 반드시 단일 패스(one-pass) 방식으로 구현되어야 한다.Therefore, due to the structural characteristics of the real-time MPEG-2 video encoding process for broadcast recording in a PVR, the encoding apparatus must be implemented in a single pass method.

상기 비트율 제어부(250)는 일반적인 단일 패스 가변 비트율 구조의 예를 보이고 있다. The bit rate controller 250 shows an example of a general single pass variable bit rate structure.

즉 상기 비트율 제어부(250)는 상기 버퍼(206)로부터 버퍼 충만도를 입력받아 기준 양자화 파라미터를 계산하는 기준 양자화 파라미터 계산부(251), 입력 영상의 복잡도를 산출하는 복잡도 계산부(252), 상기 기준 양자화 파라미터와 복잡도에 따라 실제 양자화에 사용될 양자화 파라미터를 결정하여 상기 양자화부(204)로 출력하는 양자화 파라미터 발생부(253)로 구성된다.That is, the bit rate control unit 250 receives a buffer fullness from the buffer 206, a reference quantization parameter calculator 251 for calculating a reference quantization parameter, a complexity calculator 252 for calculating a complexity of an input image, and the The quantization parameter generator 253 is configured to determine the quantization parameter to be used for actual quantization according to the reference quantization parameter and the complexity and output the quantization parameter to the quantization unit 204.

상기 양자화 파라미터 발생부(253)에서 결정된 양자화 파라미터(Qp)는 양자화부(204)로 출력된다. The quantization parameter Qp determined by the quantization parameter generator 253 is output to the quantization unit 204.

상기 양자화부(204)는 입력되는 양자화 파라미터(Qp)로부터 양자화 스텝 크기를 구하여 DCT 계수를 양자화한다. 즉 비트율 제어부(250)는 버퍼의 충만도에 따라 양자화부(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 250 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 adjust the state of the buffer 206 to maintain a constant value.

이때, ISO(International Organization for Standardization)의 산하 기구인 IS/IEC JTC1/SC29/WG11에서 국제 표준화 진행중인 MPEG-2의 자료(문서번호 AVC-491인 TEST MODEL 5)를 참조하면 비트율 제어부(250)는 다음의 3단계의 동작을 수행한다.At this time, if the IS / IEC JTC1 / SC29 / WG11, an organization under the ISO (International Organization for Standardization), refers to the material of MPEG-2 (TEST MODEL 5, document number AVC-491) under international standardization, the bit rate controller 250 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 the macroblock to be encoded currently, the normalized complexity is multiplied by the reference quantization parameter obtained in the second step to obtain a quantization parameter to be actually used for quantization. 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.

즉, 상기 비트 할당 및 버퍼의 충만도를 계산하는 상기 제 1, 제 2 단계는 버퍼(206)와 기준 양자화 파라미터 계산부(251)를 통해 이루어지며, 상기 적응 양자화를 수행하는 제 3 단계는 복잡도 계산부(252)와 양자화 파라미터 발생부(253)를 통해 이루어진다. That is, the first and second steps of calculating the bit allocation and the fullness of the buffer are performed through the buffer 206 and the reference quantization parameter calculator 251, and the third step of performing the adaptive quantization is complicated. Through the calculation unit 252 and the quantization parameter generator 253.

그러나 상기된 도 2와 같은 기존의 단일 패스 부호화 장치들은 영상 데이터의 공간적 복잡도 및 가상 버퍼 모델 등에 근거하여 양자화 파라미터를 결정할 뿐 실제로 발생하는 비트량에 대한 정확한 예측을 할 수 있는 효과적인 방법이 미흡하다는 문제점이 존재한다.However, the conventional single pass coding apparatus as shown in FIG. 2 has a problem that an effective method for accurately predicting the amount of bits actually generated is insufficient, only by determining the quantization parameter based on the spatial complexity and the virtual buffer model of the image data. This exists.

본 발명은 상기와 같은 문제점을 해결하기 위한 것으로서, 본 발명의 목적은 실시간 단일 패스 부호화 과정에서 아날로그 방송의 정확한 비트율 제어를 수행하기 위하여 주어진 비디오 데이터를 부호화할 때 실제 발생할 비트량을 정확하게 예측할 수 있는 단일 패스 가변 비트율 MPEG-2 부호화 방법(one-pass variable bit-rate MPEG-2 encoding method)을 제공하는 것이다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and an object of the present invention is to accurately predict the actual amount of bits to be generated when encoding given video data in order to perform accurate bit rate control of analog broadcasting in a real time single pass encoding process. It is to provide a one-pass variable bit-rate MPEG-2 encoding method.

상기 목적을 달성하기 위하여, 본 발명에 따른 가변 비트율 MPEG-2 부호화 방법은, In order to achieve the above object, the variable bit rate MPEG-2 encoding method according to the present invention,

매크로 블록 단위로 입력되는 영상을 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) 전송 비트율에 따라 현재 GOP에 대한 목표 비트량을 할당하고, 결정된 목표 비트량으로부터 각 픽쳐 타입(I,P,B)별 목표 비트량을 할당하는 단계;(a) allocating a target bit amount for the current GOP according to the transmission bit rate and allocating a target bit amount for each picture type (I, P, B) from the determined target bit amount;

(b) 하나의 픽쳐 내 목표 비트량으로부터 현재 부호화하고자 하는 매크로 블록의 목표 비트량을 할당하는 단계; 및(b) allocating a target bit amount of a macro block to be currently encoded from a target bit amount in one picture; And

(c) 상기 (b) 단계에서 할당된 매크로 블록의 목표 비트량을 비트량과 양자화 파라미터의 관계를 모델링한 R-Q 모델식에 적용하여 상기 매크로 블록의 목표 비트량에 대한 양자화 파라미터를 결정하는 단계를 포함하여 이루어지는 것을 특징으로 한다. (c) determining the quantization parameter for the target bit amount of the macro block by applying the target bit amount of the macro block allocated in step (b) to an RQ model equation modeling the relationship between the bit amount and the quantization parameter. It is characterized by comprising.

상기 (b) 단계는 상기 비트량 R과 양자화 파라미터 Q의 관계를 모델링한 R-Q 모델식을 하기의 식으로 정의하며, In the step (b), the R-Q model equation for modeling the relationship between the bit rate R and the quantization parameter Q is defined by the following equation,

Figure 112005002229330-pat00001
Figure 112005002229330-pat00001

이전에 미리 부호화된 데이터에 대한 비트량과 양자화 파라미터의 통계를 이용하여 모델 계수 α,β를 구하고, 상기 매크로 블록의 목표 비트량 R을 대입하여 상기 매크로 블록의 목표 비트량 R에 가장 근접한 비트량을 발생시키는 양자화 파라미터를 최종 양자화 파라미터로 결정하는 것을 특징으로 한다. Model coefficients α and β are obtained by using the bit amounts of the previously encoded data and the statistics of the quantization parameter, and the bit amount closest to the target bit amount R of the macro block by substituting the target bit amount R of the macro block. It is characterized in that the quantization parameter for generating a to determine the final quantization parameter.

상기 (b) 단계는 목표 비트량과 실제 부호화하면서 발생하는 비트량의 이격도가 일정 값이상 차이가 나는 경우에 실제 부호화 과정에서 얻어진 비트량과 양자화 파라미터를 이용하여 상기 R-Q 모델식을 갱신하는 것을 특징으로 한다.In the step (b), the RQ model equation is updated by using the bit amount and the quantization parameter obtained in the actual encoding process when the distance between the target bit amount and the bit amount generated during actual encoding differs by a predetermined value or more. It is done.

본 발명의 다른 목적, 특징 및 잇점들은 첨부한 도면을 참조한 실시예들의 상세한 설명을 통해 명백해질 것이다.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. At this time, the configuration and operation of the present invention shown in the drawings and described by it will be described as at least one embodiment, by which the technical spirit of the present invention and its core configuration and operation is not limited.

그리고 종래와 동일한 구성 요소는 설명의 편의상 동일 명칭 및 동일 부호를 부여하며 이에 대한 상세한 설명은 생략한다.The same components as in the related art are denoted by the same names and the same reference numerals for convenience of description, and detailed description thereof will be omitted.

본 발명은 고정식 또는 이동식 저장 매체 등에 방송 신호를 녹화할 수 있는 디지털 비디오 녹화 장치(PVR)에서 아날로그 방송 신호(예를 들면, NTSC 전송 방식)를 주어진 비트율에서 최적의 화질을 갖는 MPEG-2 비디오 스트림으로 실시간 부호화하기 위한 것이다. 이를 위해 아날로그 비디오 데이터를 주어진 비트 레이트의 제약을 준수하면서 MPEG-2 비디오 스트림으로 실시간 부호화 하는 과정에서 비트량과 양자화 파라미터 사이의 연관성을 정확하게 모델링함으로써, 해당 비디오 데이터의 발생 비트량을 정확하게 예측하여 단일 패스 부호화 과정의 효율성을 증가시킴과 동시에 저장 공간을 효과적으로 운용할 수 있게 한다. The present invention provides an MPEG-2 video stream having an optimal picture quality at a given bit rate using an analog broadcast signal (for example, NTSC transmission method) in a digital video recording apparatus (PVR) capable of recording broadcast signals in fixed or removable storage media. Is for real-time encoding. For this purpose, by accurately modeling the association between the bit rate and the quantization parameter in the real-time encoding of analog video data into an MPEG-2 video stream while complying with the constraints of a given bit rate, it is possible to accurately predict the generated bit amount of the corresponding video data. In addition to increasing the efficiency of the pass coding process, the storage space can be effectively operated.

이와 같이 본 발명은 PVR 장치에서 요구되는 실시간 방송 녹화에 적용 가능하도록 MPEG-2 부호화 장치를 단일 패스(one-pass) 알고리즘으로 구현함과 동시에 현재 부호화를 수행하는 비디오 데이터에 대해 비트 발생량을 효과적으로 예측함으로써, 보다 정확한 비트율 제어를 수행할 수 있다. As described above, the present invention implements the MPEG-2 encoder as a one-pass algorithm so that it can be applied to the real time broadcast recording required by the PVR, and at the same time, effectively predicts the bit generation amount for video data that is currently encoded. Thus, more accurate bit rate control can be performed.

이때 비트율 제어를 보다 효과적으로 수행하기 위해서는 전술한 양자화 파라미터를 결정하는 단계에서 실제 발생할 비트량에 대한 직접적인 예측이 가능해야 한다. 따라서, 양자화 파라미터와 비트량에 대한 직접적인 관계를 정확하게 모델링한다면 이러한 예측이 가능할 수 있다.In this case, in order to perform the bit rate control more effectively, it is necessary to directly predict the actual amount of bits to be generated in the step of determining the above-described quantization parameter. Therefore, this prediction may be possible if you model the direct relationship between the quantization parameter and the bit rate correctly.

본 발명에서는 실제 방송용 비디오 데이터에 대한 실험 결과 다음의 수학식 1과 같이 양자화 파라미터와 비트량에 대한 관계를 도출할 수 있었다.In the present invention, as a result of the experiment on the actual broadcast video data, the relationship between the quantization parameter and the bit amount can be derived as shown in Equation 1 below.

Figure 112005002229330-pat00002
Figure 112005002229330-pat00002

즉, 비트량 R의 변화량은 양자화 파라미터 Q의 역수의 변화량에 비례한다는 관계가 성립한다.That is, the relationship that the change amount of the bit amount R is proportional to the change amount of the inverse of the quantization parameter Q is established.

상기의 수학식 1을 근거로 실제 발생하는 비트량과 양자화 파라미터의 관계는 다음의 수학식 2와 같이 표현할 수 있다.Based on the above Equation 1, the relationship between the actual amount of bits and the quantization parameter can be expressed as Equation 2 below.

Figure 112005002229330-pat00003
Figure 112005002229330-pat00003

상기의 수학식 2를 본 발명에서는 R-Q 모델식이라고 정의한다. Equation 2 is defined as an R-Q model in the present invention.

상기 R은 비트량을 의미하며 단위는 bit이고, Q는 양자화 파라미터로서 선형 양자화를 수행할 경우에 2에서 62 사이의 짝수 값을 갖는다.R denotes a bit amount, a unit is bit, and Q has an even value between 2 and 62 when performing linear quantization as a quantization parameter.

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

도 3의 단계 301에서는 비트율 R과 양자화 파라미터 Q의 관계를 모델링한 상기의 수학식 2를 완성하기 위하여 모델 계수 (α,β)를 다음과 같은 일련의 과정을 통해 결정한다.In step 301 of FIG. 3, model coefficients (α, β) are determined through a series of processes to complete Equation 2, which models the relationship between the bit rate R and the quantization parameter Q.

상기 R-Q 모델식의 모델 계수 (α,β)의 계산 과정에서 비트량 R과 양자화 파라미터 Q는 매크로블록 또는 슬라이스 등의 단위를 기준으로 측정하도록 한다. In the process of calculating the model coefficients α and β of the R-Q model equation, the bit amount R and the quantization parameter Q are measured based on a unit such as a macroblock or a slice.

예를 들어, 슬라이스 단위로 비트량을 측정한다면 Q 값은 해당 슬라이스 내의 모든 매크로블록의 Q 값의 평균을 사용하도록 한다.For example, if the bit amount is measured in slice units, the Q value uses the average of the Q values of all macroblocks in the slice.

하나의 실시 예에서 수학식 2의 R-Q 모델식을 완성하기 위해 매크로블록 단위로 비트량과 양자화 계수를 측정한다고 할 때, 이미 부호화된 이전 프레임에 포함된 N개의 매크로블록에 대한 측정값들은 다음의 수학식 3과 같이 전개가 될 수 있다.In an embodiment, when the bit quantity and the quantization coefficient are measured in units of macroblocks to complete the RQ model of Equation 2, the measurement values for the N macroblocks included in the previously encoded previous frame are as follows. It can be expanded as shown in Equation 3.

Figure 112005002229330-pat00004
Figure 112005002229330-pat00004

이때, RMBj와 QMBj는 각각 j번째 매크로 블록에 대하여 부호화 과정에서 소요된 비트량과 양자화 파라미터이다. In this case, R MBj and Q MBj are bit amounts and quantization parameters required in the encoding process for the j-th macroblock, respectively.

상기 수학식 3은 다음의 수학식 4와 같이 행렬 형태로 다시 표현될 수 있다.Equation 3 may be represented again in matrix form as shown in Equation 4 below.

Figure 112005002229330-pat00005
Figure 112005002229330-pat00005

상기 수학식 2의 R-Q 모델식을 완성하기 위해 모델 계수 (α,β)를 선형 회귀법에 의하여 계산하면 다음의 수학식 5와 같다.In order to complete the R-Q model of Equation 2, the model coefficients α and β are calculated by the linear regression method.

Figure 112005002229330-pat00006
Figure 112005002229330-pat00006

결과적으로 모델 계수 (α,β)는 다음의 수학식 6과 같은 값을 갖는다.As a result, the model coefficients α and β have the same values as in Equation 6 below.

Figure 112005002229330-pat00008
Figure 112005002229330-pat00008

상기 수학식 6과 같이 모델 계수 (α,β)를 계산하면 R-Q 모델식이 완성되며, 이를 이용하여 MPEG-2 부호화 장치의 비트율 제어 과정에서 현재 설정된 양자화 파라미터에 의하여 발생되는 비트량을 정확하게 예측할 수 있다.By calculating the model coefficients (α, β) as shown in Equation 6, the RQ model equation is completed, and it is possible to accurately predict the amount of bits generated by the currently set quantization parameter in the bit rate control process of the MPEG-2 encoding apparatus. .

상기 R-Q 모델식은 비디오의 특성에 변화가 발생하여 기존의 모델이 더 이상 유효하지 않을 때만 갱신을 수행한다. 기존 모델의 유효성은 예측 비트량과 실제 비트량 사이의 이격도를 이용하여 판단할 수 있다.The R-Q model is updated only when the characteristic of the video is changed and the existing model is no longer valid. The validity of the existing model can be determined using the separation between the predicted bit amount and the actual bit amount.

상기 R-Q 모델식은 목표 비트량과 실제 발생하는 비트량의 이격도가 15% 이상 차이가 나는 경우에 갱신을 수행하도록 한다. 예를 들어 j번째 프레임을 부호화하였을 때, 목표 비트량과 실제로 j 번째 프레임을 부호화하는데 소비한 비트량의 차이가 15% 이상 차이가 날 경우에 j번째 프레임을 부호화하는 과정에서 얻어진 비트량과 양자화 파라미터를 이용하여 R-Q 모델식을 갱신한다. 또한 비디오를 처음 부호화 할 때에는 이전의 데이터가 존재하지 않으므로 모델 계수 (α,β)의 초기값은 (0.789x104, 7.56x104)으로 설정하며, 해당 값들은 실험 결과에 의하여 얻어진 값들이다.The RQ model formula may perform an update when the separation between the target bit amount and the actual bit amount is 15% or more. For example, when the j-th frame is encoded, when the difference between the target bit amount and the bit amount actually used to encode the j-th frame is 15% or more, the bit amount and quantization obtained in the process of encoding the j-th frame are different. Update the RQ model expression using the parameters. In addition, since the previous data does not exist when the video is first encoded, the initial values of the model coefficients (α, β) are set to (0.789x10 4 , 7.56x10 4 ), and the values are obtained from the experimental results.

상기 R-Q 모델식은 보다 효과적이고 정확한 결과를 위해서 픽쳐 타입에 따라 별도의 모델 계수 값을 적용할 수 있다. 그 이유는 픽쳐 타입에 따라서 부호화를 수행하는 residual 신호와 부가 정보의 비율이 다르기 때문이며 결과적으로 다른 R-Q 모델링이 적용될 수 있기 때문이다.The R-Q model equation may apply a separate model coefficient value according to the picture type for more effective and accurate results. This is because the ratio of the residual signal to perform encoding and the side information is different according to the picture type, and as a result, different R-Q modeling may be applied.

상기 R-Q 모델식이 완성되면 비디오의 부호화를 위한 목표 비트량을 할당한다.When the R-Q model equation is completed, a target bit amount for encoding video is allocated.

상기 목표 비트량은 먼저 현재 구간 즉, 현재 GOP에 대한 목표 비트량 RGOP을 결정하고(단계 302), 그 다음에는 각 픽쳐 타입(I,P,B 프레임)에 따라 할당할 목표 비트량을 결정하도록 한다(단계 303). 일 예로 복잡도를 예측하여 목표 비트량을 결정한다. 즉, 전송 비트율에 따라 GOP 단위로 일정한 비트율을 할당하고 GOP 내부에서 각 픽쳐에 할당할 비트들을 각 픽쳐(I,P,B 프레임)의 복잡도에 따라 할당한다. 다시 말해, GOP 내부에서 픽쳐 타입과 복잡도에 의해 픽쳐 단위로 비트가 할당된다. The target bit amount first determines a target bit amount R GOP for the current interval, that is, the current GOP (step 302), and then determines a target bit amount to be allocated according to each picture type (I, P, B frame). (Step 303). As an example, the target bit amount is determined by predicting the complexity. That is, a constant bit rate is allocated in GOP units 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). In other words, bits are allocated on a picture-by-picture basis by picture type and complexity in the GOP.

결과적으로 수학식 7과 같은 관계가 성립한다. As a result, a relationship as in Equation 7 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 픽처도 마찬가지이다. 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.

각 프레임에 대한 목표 비트량 Rframe이 결정되면 각 프레임 내의 매크로 블록 단위로 적응적인 비트 할당 작업이 수행된다(단계 304). 상기 매크로 블록 단위의 비트 할당은 다음의 수학식 8과 같다.When the target bit amount R frame for each frame is determined, an adaptive bit allocation operation is performed in units of macro blocks within each frame (step 304). Bit allocation in units of macro blocks is expressed by Equation 8 below.

Figure 112005002229330-pat00009
Figure 112005002229330-pat00009

상기 수학식 9에서 MB_CNT는 현재 부호화를 수행하고 있는 프레임에서 현재 매크로 블록을 포함하여 남아 있는 매크로블록의 개수를 의미하고, Rframe은 현재 프레임에 할당된 비트량, Rused는 현재 프레임을 부호화하는 과정에서 지금까지 사용된 비트량을 의미한다. 상기 Nnorm은 정규화된 매개 변수이며 하기의 수학식 10과 같이 정의한다.In Equation 9, MB_CNT denotes the number of remaining macroblocks including the current macroblock in the frame currently being encoded, R frame is the amount of bits allocated to the current frame, and R used is the current frame encoding. The bit amount used so far in the process. N norm is a normalized parameter and is defined as in Equation 10 below.

Figure 112005002229330-pat00010
Figure 112005002229330-pat00010

상기 수학식 9에서 actj는 현재 부호화를 수행할 j번째 매크로블록의 공간적인 복잡도를 의미하며 매크로블록 내 픽셀 값의 평균을 기준으로 계산한 분산 값의 크기에 비례한다. 상기 avg_act는 이전 픽쳐에서 모든 매크로블록의 복잡도의 평균을 의미한다. 즉, 모든 매크로블록에 대하여 동일한 비트가 아닌 공간적 복잡도에 근거하여 차별화 된 비트량을 할당하도록 한다.In Equation 9, act j denotes a spatial complexity of the j-th macroblock to be currently encoded and is proportional to the magnitude of the variance value calculated based on the average of pixel values in the macroblock. The avg_act means an average of the complexity of all macroblocks in the previous picture. That is, all the macroblocks are allocated different amounts of bits based on spatial complexity and not identical bits.

상기 매크로 블록에 대한 목표 비트량이 할당되면 이 목표 비트량을 수학식 2의 R-Q 모델식에 대입하여 양자화 파라미터를 결정한다(단계 305).When the target bit amount for the macroblock is allocated, the target bit amount is substituted into the R-Q model equation (2) to determine the quantization parameter (step 305).

상기 기술한 바와 같이 GOP 단위로 목표 비트량 RGOP을 할당한 다음 각 프레임에 대하여 목표 비트량 Rframe이 결정되면 매크로블록 단위로 픽셀 값을 근거로 계산한 복잡도를 이용한 적응적인 방법에 의해 비트량 RMB을 결정한다. 그리고 이 값을 R-Q 모델식에 대입하여 상기 매크로 블록의 목표 비트량 RMB에 가장 근접한 비트량을 발생시키는 양자화 파라미터를 최종 양자화 파라미터 QMB로 결정한다.Assigning the target bit rate R GOP by GOP basis as described above, then when the target bit rate R frame is determined for each frame bit amount by the adaptive method using a complexity calculated on the basis of the pixel values in the macro block unit Determine R MB . Substituting this value into the RQ model equation, a quantization parameter for generating the bit amount closest to the target bit amount R MB of the macroblock is determined as the final quantization parameter Q MB .

이와 같이 본 발명은 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 video data. The amount of bits can be allocated by effectively analyzing the complexity.

따라서 본 발명은 아날로그 방송 신호(예를 들면, 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)들은 본 발명에서의 기능을 고려하여 정의 내려진 용어들로써 이는 당분야에 종사하는 기술자의 의도 또는 관례 등에 따라 달라질 수 있으므로 그 정의는 본 발명의 전반에 걸친 내용을 토대로 내려져야 할 것이다.The terminologies used in the present invention are terms defined in consideration of functions in the present invention and may vary according to the intention or customs of those skilled in the art, and the definitions refer to the overall contents of the present invention. It must be laid down.

본 발명을 상술한 실시예에 한정되지 않으며, 첨부된 청구범위에서 알 수 있는 바와 같이 본 발명이 속한 분야의 통상의 지식을 가지 자에 의해 변형이 가능하고 이러한 변형은 본 발명의 범위에 속한다. The present invention is not limited to the above-described embodiments, 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 method according to the present invention described above are as follows.

첫째, PVR 장치에서 아날로그 방송을 실시간으로 녹화하기 위한 응용 분야에서 저장 공간 운용의 효율성을 극대화하기 위한 비트율 제어를 보다 정확하고 효과 적으로 수행할 수 있다. First, in the application field for recording analog broadcasts in real time in the PVR device, it is possible to more accurately and effectively perform bit rate control to maximize the efficiency of storage space operation.

둘째, 실제 발생할 비트량과 양자화 파라미터의 관계를 모델링하는 R-Q 모델식을 제안하고 이 모델식을 이용하여 보다 정확한 비트율 제어를 수행함으로써, 아날로그 방송의 디지털 녹화를 위한 실시간 비디오 부호화 장치를 보다 효과적으로 구현할 수 있다. Second, we propose an RQ model equation that models the relationship between the actual amount of bits and the quantization parameter and perform more accurate bit rate control using this model equation, making it possible to implement a real-time video encoding device for digital recording of analog broadcasting more effectively. have.

이상 설명한 내용을 통해 당업자라면 본 발명의 기술 사상을 일탈하지 아니하는 범위에서 다양한 변경 및 수정이 가능함을 알 수 있을 것이다.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 (6)

매크로 블록 단위로 입력되는 영상을 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) 전송 비트율에 따라 현재 GOP에 대한 목표 비트량을 할당하고, 결정된 목표 비트량으로부터 각 픽쳐 타입(I,P,B)별 목표 비트량을 할당하는 단계;(a) allocating a target bit amount for the current GOP according to the transmission bit rate and allocating a target bit amount for each picture type (I, P, B) from the determined target bit amount; (b) 하나의 픽쳐 내 목표 비트량으로부터 현재 부호화하고자 하는 매크로 블록의 목표 비트량을 할당하는 단계; 및(b) allocating a target bit amount of a macro block to be currently encoded from a target bit amount in one picture; And (c) 상기 (b) 단계에서 할당된 매크로 블록의 목표 비트량을 비트량과 양자화 파라미터의 관계를 모델링한 R-Q 모델식에 적용하여 상기 매크로 블록의 목표 비트량에 대한 양자화 파라미터를 결정하는 단계를 포함하여 이루어지는 것을 특징으로 하는 실시간 동영상 부호화 방법.(c) determining the quantization parameter for the target bit amount of the macro block by applying the target bit amount of the macro block allocated in step (b) to an RQ model equation modeling the relationship between the bit amount and the quantization parameter. Real-time video encoding method comprising a. 제 1 항에 있어서, 상기 (b) 단계는The method of claim 1, wherein step (b) 현재 부호화할 픽쳐 내 매크로 블록의 목표 비트량 RMB을 하기의 식을 적용하여 할당하는 것을 특징으로 하는 실시간 동영상 부호화 방법.And a target bit amount R MB of a macroblock in a picture to be currently encoded is allocated by applying the following equation.
Figure 112005002229330-pat00011
Figure 112005002229330-pat00011
상기 MB_CNT는 현재 부호화를 수행하고 있는 픽쳐에서 현재 매크로 블록을 포함하여 남아 있는 매크로블록의 개수, Rframe은 현재 픽쳐에 할당된 비트량, Rused는 현재 픽쳐를 부호화하는 과정에서 지금까지 사용된 비트량, 상기 Nnorm은 정규화 매개변수를 의미함.The MB_CNT is the number of macroblocks remaining including the current macroblock in the picture currently being encoded, R frame is the bit amount allocated to the current picture, and R used is the bit used so far in encoding the current picture. N norm means a normalization parameter.
제 2 항에 있어서, 상기 (b) 단계는 The method of claim 2, wherein step (b) 하기의 식을 적용하여 상기 정규화 매개변수 Nnorm를 구하는 것을 특징으로 하는 실시간 동영상 부호화 방법.The normalization parameter N norm is obtained by applying the following equation.
Figure 112005002229330-pat00012
Figure 112005002229330-pat00012
상기 actj는 현재 부호화를 수행할 j번째 매크로블록의 공간적인 복잡도, 상기 avg_act는 이전 픽쳐에서 모든 매크로블록의 복잡도의 평균을 의미함. Act j is the spatial complexity of the j-th macroblock to be encoded, and avg_act is the average of the complexity of all the macroblocks in the previous picture.
제 2 항에 있어서, 상기 (b) 단계는 The method of claim 2, wherein step (b) 상기 비트량 R과 양자화 파라미터 Q의 관계를 모델링한 R-Q 모델식을 하기의 식으로 정의하며, An R-Q model equation modeling the relationship between the bit amount R and the quantization parameter Q is defined by the following equation,
Figure 112005002229330-pat00013
Figure 112005002229330-pat00013
이전에 미리 부호화된 데이터에 대한 비트량과 양자화 파라미터의 통계를 이용하여 모델 계수 α,β를 구하고, 상기 매크로 블록의 목표 비트량 R을 대입하여 상기 매크로 블록의 목표 비트량 R에 가장 근접한 비트량을 발생시키는 양자화 파라미터를 최종 양자화 파라미터로 결정하는 것을 특징으로 하는 실시간 동영상 부호화 방법.Model coefficients α and β are obtained by using the bit amounts of the previously encoded data and the statistics of the quantization parameter, and the bit amount closest to the target bit amount R of the macro block by substituting the target bit amount R of the macro block. And determining the quantization parameter for generating the final quantization parameter as the final quantization parameter.
제 4 항에 있어서, 상기 (b) 단계는The method of claim 4, wherein step (b) 하기의 식을 적용하여 모델 계수 α,β를 구하는 것을 특징으로 하는 실시간 동영상 부호화 방법.Real-time video encoding method characterized by obtaining the model coefficients α, β by applying the following equation.
Figure 112005002229330-pat00014
Figure 112005002229330-pat00014
Figure 112005002229330-pat00015
Figure 112005002229330-pat00015
상기 RMBj와 QMBj는 이미 부호화된 N개의 매크로 블록(0~N-1) 중 j번째 매크로 블록에 대하여 부호화 과정에서 소요된 비트량과 양자화 파라미터임.The R MBj and the Q MBj are bit amounts and quantization parameters required in the encoding process for the j-th macroblock among the N macroblocks (0 to N-1) that are already encoded.
제 4 항에 있어서, 상기 (b) 단계는The method of claim 4, wherein step (b) 목표 비트량과 실제 부호화하면서 발생하는 비트량의 이격도가 일정 값이상 차이가 나는 경우에 실제 부호화 과정에서 얻어진 비트량과 양자화 파라미터를 이용하여 상기 R-Q 모델식을 갱신하는 것을 특징으로 하는 실시간 동영상 부호화 방법.A real-time video encoding method, wherein the RQ model equation is updated by using a bit amount and a quantization parameter obtained in an actual encoding process when a distance between a target bit amount and a bit amount generated during actual encoding differs by a predetermined value or more .
KR1020050003767A 2005-01-14 2005-01-14 Method for encoding of real-time moving image KR100617097B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020050003767A KR100617097B1 (en) 2005-01-14 2005-01-14 Method for encoding of real-time moving image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020050003767A KR100617097B1 (en) 2005-01-14 2005-01-14 Method for encoding of real-time moving image

Publications (2)

Publication Number Publication Date
KR20060083298A KR20060083298A (en) 2006-07-20
KR100617097B1 true KR100617097B1 (en) 2006-08-31

Family

ID=37173686

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020050003767A KR100617097B1 (en) 2005-01-14 2005-01-14 Method for encoding of real-time moving image

Country Status (1)

Country Link
KR (1) KR100617097B1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100800838B1 (en) * 2006-07-27 2008-02-04 삼성전자주식회사 Rate control of video encoder
KR100950275B1 (en) * 2008-09-18 2010-03-31 연세대학교 산학협력단 System and Methods for rate control based model parameter, Storage medium storing the same
KR102338986B1 (en) * 2019-11-15 2021-12-14 한국과학기술원 Method And System for Live Video Ingest
WO2021096159A1 (en) * 2019-11-15 2021-05-20 한국과학기술원 System and method for ingesting live video

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001078193A (en) 1999-06-30 2001-03-23 Media Glue Corp Moving picture compression coded signal conversion method and device
JP2003116133A (en) 2001-10-09 2003-04-18 Kddi Corp System and method for controlling transmission quality for moving picture compression coding
KR20040036343A (en) * 2002-10-24 2004-04-30 엘지전자 주식회사 Apparatus and method for adaptive rate in video transcoder

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001078193A (en) 1999-06-30 2001-03-23 Media Glue Corp Moving picture compression coded signal conversion method and device
JP2003116133A (en) 2001-10-09 2003-04-18 Kddi Corp System and method for controlling transmission quality for moving picture compression coding
KR20040036343A (en) * 2002-10-24 2004-04-30 엘지전자 주식회사 Apparatus and method for adaptive rate in video transcoder

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
논문

Also Published As

Publication number Publication date
KR20060083298A (en) 2006-07-20

Similar Documents

Publication Publication Date Title
KR100329892B1 (en) Control strategy for dynamically encoding multiple streams of video data in parallel for multiplexing onto a constant bit rate channel
US6480539B1 (en) Video encoding method and apparatus
US7453938B2 (en) Target bitrate estimator, picture activity and buffer management in rate control for video coder
US7492820B2 (en) Rate control for video coder employing adaptive linear regression bits modeling
US7869503B2 (en) Rate and quality controller for H.264/AVC video coder and scene analyzer therefor
US6522693B1 (en) System and method for reencoding segments of buffer constrained video streams
CA2421066C (en) Transcoder-based adaptive quantization for digital video recording
US7406124B1 (en) Systems and methods for allocating bits to macroblocks within a picture depending on the motion activity of macroblocks as calculated by an L1 norm of the residual signals of the macroblocks
US7925108B2 (en) Encoding device and dynamic image recording system having the encoding device
US20100166060A1 (en) Video transcoder rate control
EP1430727A1 (en) Method for generating a scalable encoded video bitstream with a constant quality
JP2001218213A (en) Image signal conversion coder
US7986731B2 (en) H.264/AVC coder incorporating rate and quality controller
US6963609B2 (en) Image data compression
KR100617097B1 (en) Method for encoding of real-time moving image
EP2328351B1 (en) Rate and quality controller for H.264/AVC video coder and scene analyzer therefor
JPH0998427A (en) Dynamic image encoding device
US20080253447A1 (en) Video Transcoding with Selection of Data Portions to be Processed
KR100793781B1 (en) Apparatus and method for encoding of real-time moving image
KR100394014B1 (en) Apparatus for transcoding video
EP0888009B1 (en) Device and method for encoding image data, and image data transmission method
KR101087109B1 (en) Video encoder and its method
KR20060024609A (en) Apparatus and method for encoding of real-time moving image
US20010000675A1 (en) Video data encoding apparatus, video data encoding method, and video data transmission method
KR20030083109A (en) apparatus for transcoding bit rate

Legal Events

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

Payment date: 20120727

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20130724

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20140724

Year of fee payment: 9

FPAY Annual fee payment

Payment date: 20150724

Year of fee payment: 10

LAPS Lapse due to unpaid annual fee