KR20090030778A - Apparatus and method for multi-pass encoding - Google Patents

Apparatus and method for multi-pass encoding Download PDF

Info

Publication number
KR20090030778A
KR20090030778A KR1020070096317A KR20070096317A KR20090030778A KR 20090030778 A KR20090030778 A KR 20090030778A KR 1020070096317 A KR1020070096317 A KR 1020070096317A KR 20070096317 A KR20070096317 A KR 20070096317A KR 20090030778 A KR20090030778 A KR 20090030778A
Authority
KR
South Korea
Prior art keywords
frame
encoding
quantization coefficient
bit amount
image data
Prior art date
Application number
KR1020070096317A
Other languages
Korean (ko)
Other versions
KR100918499B1 (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 KR1020070096317A priority Critical patent/KR100918499B1/en
Publication of KR20090030778A publication Critical patent/KR20090030778A/en
Application granted granted Critical
Publication of KR100918499B1 publication Critical patent/KR100918499B1/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/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/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/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/172Methods 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 picture, frame or field

Abstract

A multi-path encoding apparatus and a method thereof are provided to shorten the time required for the multi-path encoding. The first encoder and an input delay unit receive the original image data at the same time(S300). The first encoder encodes the inputted image data and then sequentially stores the encoded result in a buffer(S310). A bit rate control unit sets up and stores the quantization coefficient to be applied to the second encoder(S320). The input delay unit outputs image data after a certain time elapses from the time when the firs frame of the original image data is inputted(S330). The second encoder applies the quantization coefficient stored in a memory to the quantization step to encode the inputted image data(S340).

Description

멀티 패스 인코딩 장치 및 그 방법{Apparatus and method for multi-pass encoding}Apparatus and method for multi-pass encoding

본 발명은 멀티패스 인코딩을 수행하는 장치 및 그 방법에 관한 것으로, 더욱 상세하게는 비트레이트(bitrate) 제어가 가능한 멀티 패스 인코딩 장치 및 그 방법에 관한 것이다.The present invention relates to an apparatus and a method for performing multipath encoding, and more particularly, to a multipath encoding apparatus and a method capable of bitrate control.

멀티미디어 데이터는 내부적으로 음성 데이터와 영상 데이터 두 가지로 이루어진다. 일반적으로, 멀티미디어 서비스 시 이와 같은 음성 데이터와 영상 데이터는 비트스트림 형태로 처리되어 정해진 비트레이트에 따라 네트워크상에서 송수신 된다. 비트레이트는 1초에 해당하는 멀티미디어 데이터가 얼마나 많은 비트(bit)를 포함하는 지를 의미한다. 따라서 비트레이트가 클수록 동영상은 더 많은 비트를 가지게 되어 고화질을 얻을 수 있으나, 그러기 위해서는 그만큼의 고용량이 필요하다.Multimedia data is internally composed of audio data and video data. In general, in a multimedia service, such audio data and video data are processed in a bitstream form and transmitted and received on a network according to a predetermined bitrate. Bitrate means how many bits (bits) the multimedia data corresponding to one second. Thus, the larger the bitrate, the more bits the video has and the higher the quality, but that requires a higher amount of capacity.

일반적으로 멀티미디어 데이터의 영상데이터를 비트스트림 형태로 인코딩하는 방식은 I 프레임(Infra Frame)과 P 프레임(Predictive Frame)이 있다. In general, a method of encoding image data of multimedia data in the form of a bit stream includes an I frame (Infra Frame) and a P frame (Predictive Frame).

I 프레임은 독립적인 프레임으로 다른 이미지들의 참조 없이 스스로 압축과 복원할 수 있는 프레임으로서, 제작 중 데이터스트림의 어느 위치에든 올 수 있으며, 데이터의 임의 접근이 가능하다. 이러한 I 프레임은 원본 소스로부터 직접 압축되어 온 전체화면으로 화질이 좋은 특징이 있지만, 그에 따른 용량도 큰 단점이 있다. I-frames are independent frames that can be compressed and reconstructed on their own without reference to other images. They can come anywhere in the datastream during production and allow arbitrary access to the data. The I frame is a full screen image compressed directly from the original source, but has a good quality, but also has a large disadvantage.

P 프레임은 전후 프레임간의 변화량을 토대로 인코딩 또는 디코딩을 수행한다. 즉, 연속되는 이미지들 사이에서 전체 이미지가 바뀌는 것이 아니라 이미지의 블록들이 옆으로 이동한 점에 착안하여, 이전의 I 프레임 정보와 이전의 P 프레임의 정보를 이용하여 인코딩과 디코딩을 수행한다. 따라서, I 프레임에 비해 상대적으로 용량이 작다. The P frame performs encoding or decoding based on the amount of change between front and rear frames. That is, focusing on the fact that the blocks of the image are moved sideways instead of changing the entire image among successive images, encoding and decoding are performed using the information of the previous I frame information and the previous P frame. Therefore, the capacity is relatively small compared to the I frame.

이때, 네트워크상에서 멀티미디어 서비스를 제공하기 위해 영상 데이터의 비트레이트를 제어하는 방법으로는 CBR(Constant Bit Rate)와 VBR(Variable Bit Rate)가 있다.At this time, as a method of controlling the bit rate of the video data to provide a multimedia service on the network, there are a constant bit rate (CBR) and a variable bit rate (VBR).

CBR는 고정된 비트만을 사용하기 때문에 네트워크 전송 효율이 높다. 그러나 움직임이 많은 영상의 경우 I 프레임이 손상되어 화질저하가 발생한다. 따라서, 움직임이 많은 스포츠, 액션 영화 등과 같은 동영상에는 사용상 부적절하다.Since CBR uses only fixed bits, network transmission efficiency is high. However, in case of moving images, I frame is damaged and image quality deteriorates. Therefore, it is inappropriate for use in a moving video such as sports, action movies, and the like.

VBR는 화면의 움직임에 따라 비트레이트가 가변적으로 변화하므로 CBR 방식에 비해 더 좋은 화질을 만들어 낼 수 있어 더 효율적이다. 그러나 화면이 바뀌는 장면이거나 화면에 정보가 많을 경우, 순간 비트레이트가 피크(Peak)되어 패킷이 유실되거나 다른 데이터 통신에 영향을 줄 수 있다. VBR is more efficient because it can produce better image quality than CBR method because the bitrate changes variably according to screen movement. However, when the scene changes or there is a lot of information on the screen, the bitrate may peak at a moment, causing a packet loss or other data communication.

즉, 네트워크상의 한정된 대역폭 내에서 멀티미디어 데이터 전송 시 순간 비 트레이트가 피크가 되면 패킷 전송 에러가 발생하게 되어 멀티미디어 데이터의 패킷 손실이 발생하여 화질 저하가 발생하게 된다. In other words, if the instantaneous non-peak peaks during multimedia data transmission within a limited bandwidth on the network, a packet transmission error occurs, resulting in packet loss of multimedia data and deterioration in image quality.

이러한 문제를 해결하기 위해 종래에는 멀티 패스 인코딩 기술이 개발되어 왔다. 멀티 패스 인코딩은 먼저 제1 인코더를 통해 영상 데이터의 제1 인코딩을 수행한 후, 제1 인코딩 수행 결과를 이용하여 제2 인코더를 통해 영상 데이터의 2 인코딩을 수행하는 방법이다. In order to solve this problem, a multi-pass encoding technique has been developed. Multi-pass encoding is a method of first encoding image data through a first encoder and then performing two encodings of image data through a second encoder using a first encoding result.

이와 같은 멀티 패스 인코딩은 비트레이트의 고른 분포와 고른 화질의 인코딩이 가능하지만, 제1 인코딩이 모두 완료된 이후에 제2 인코딩을 하게됨으로써 인코딩 처리 시간이 증가되는 문제가 있다.Such multi-pass encoding enables even distribution of bitrates and encoding of even image quality, but there is a problem in that encoding processing time is increased by performing a second encoding after all of the first encoding is completed.

따라서, 본 발명이 이루고자 하는 기술적 과제는 멀티 패스 인코딩 시 인코딩 소요 시간을 단축할 수 있는 멀티 패스 인코딩 장치 및 그 방법을 제공하는 것이다. Accordingly, an object of the present invention is to provide a multi-pass encoding apparatus and method for reducing encoding time required for multi-pass encoding.

위에서 기술한 바와 같은 과제를 이루기 위하여, 본 발명의 특징에 따른 복수의 프레임으로 구성되는 원본 영상 데이터를 멀티 패스 인코딩하는 장치는, 상기 원본 영상 데이터를 입력받아 제1 인코딩을 수행하는 제1 인코더, 상기 제1 인코딩 결과로부터 검출된 프레임별 비트량에 따라 프레임별 양자화계수를 설정하는 비트레이트 제어부, 상기 원본 영상 데이터를 상기 제1 인코딩이 시작된 시점으로부터 제1 시간 지연하여 출력하는 입력 지연부 및 상기 입력 지연부로부터 출력되는 영상 데이터를 상기 설정된 양자화계수를 적용하여 제2 인코딩을 수행하는 제2 인코더를 포함한다.In order to achieve the above-described problem, the apparatus for multi-pass encoding the original image data consisting of a plurality of frames according to an aspect of the present invention, the first encoder receiving the original image data to perform a first encoding, A bit rate controller configured to set a quantization coefficient for each frame according to the amount of bits for each frame detected from the first encoding result, an input delay unit for outputting the original image data by delaying a first time from a time point at which the first encoding starts; And a second encoder configured to perform second encoding on the image data output from the input delay unit by applying the set quantization coefficient.

또한, 본 발명의 다른 특징에 따른 복수의 프레임으로 구성되는 원본 영상 데이터를 멀티 패스 인코딩하는 방법은, 상기 원본 영상 데이터를 첫 번째 프레임부터 순차적으로 제1 인코딩한 결과 생성된 비트스트림을 이용하여 프레임별 비트량을 검출하는 단계, 상기 프레임별 비트량과 기준 비트량을 비교하여, 그 비교 결과에 따라 각 프레임의 양자화계수를 설정하여 저장하는 단계 및 상기 첫 번째 프레임이 상기 제1 인코딩되기 시작한 시점으로부터 제1 시간이 경과한 후, 상기 설 정된 양자화계수를 적용하여 상기 원본 영상 데이터를 첫 번째 프레임부터 순차적으로 제2 인코딩하는 단계를 포함한다.In addition, according to another aspect of the present invention, a method for multi-pass encoding original video data consisting of a plurality of frames includes a frame using a bitstream generated as a result of first encoding the original video data sequentially from the first frame. Detecting a bit amount for each frame, comparing the bit amount for each frame with a reference bit amount, setting and storing a quantization coefficient of each frame according to a result of the comparison, and a time point at which the first frame starts to be encoded And after the first time elapses from the second frame, sequentially encoding the original image data from the first frame by applying the set quantization coefficient.

이와 같은 본 발명의 실시예에 의하면 안정적인 멀티미디어 데이터 전송이 가능하며, 이와 같은 멀티미디어 데이터를 인코딩함에 있어서 인코딩 소요 시간을 단축할 수 있는 효과가 있다.According to the exemplary embodiment of the present invention, stable multimedia data transmission is possible, and encoding time can be shortened in encoding such multimedia data.

아래에서는 첨부한 도면을 참고로 하여 본 발명의 실시예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.DETAILED DESCRIPTION Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art may easily implement the present invention. As those skilled in the art would realize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. In the drawings, parts irrelevant to the description are omitted in order to clearly describe the present invention, and like reference numerals designate like parts throughout the specification.

명세서 전체에서, 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다. 또한, 명세서에 기재된 "…부", "…기", "모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다.Throughout the specification, when a part is said to "include" a certain component, it means that it can further include other components, without excluding other components unless specifically stated otherwise. In addition, the terms “… unit”, “… unit”, “module”, etc. described in the specification mean a unit that processes at least one function or operation, which may be implemented by hardware or software or a combination of hardware and software. have.

이하, 첨부된 도면을 참조하여 본 발명에 대해서 상세히 설명하도록 한다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 실시예에 따른 멀티 패스 인코딩 장치의 블록도 이다.1 is a block diagram of a multi-pass encoding apparatus according to an embodiment of the present invention.

도 1에서 나타낸 바와 같이, 본 발명의 실시예에 따른 멀티 패스 인코딩 장치는 제1 인코더(100), 버퍼(110), 비트레이트 제어부(120), 입력 지연부(130) 및 제2 인코더(140)를 포함한다. As shown in FIG. 1, a multi-pass encoding apparatus according to an embodiment of the present invention may include a first encoder 100, a buffer 110, a bit rate controller 120, an input delay unit 130, and a second encoder 140. ).

제1 인코더(100)는 입력되는 원본 영상 데이터를 압축하여 비트스트림 형식으로 인코딩한다. 이때, 원본 영상 데이터는 복수의 프레임으로 구성되며, 제1 인코더(100)는 이전 프레임 영상의 움직임 예측 및 보정을 이용하여 현재 프레임 영상 데이터를 인코딩한다. 또한, 제1 인코더(100)는 인코딩된 비트스트림을 버퍼(110)로 출력한다.The first encoder 100 compresses the input original image data and encodes the original image data into a bitstream format. In this case, the original image data includes a plurality of frames, and the first encoder 100 encodes the current frame image data by using motion prediction and correction of the previous frame image. In addition, the first encoder 100 outputs the encoded bitstream to the buffer 110.

제1 인코더(100)의 상세한 구성 및 그 동작에 대해서는 이후 도 3을 참조하여 설명하도록 한다.A detailed configuration and operation of the first encoder 100 will be described with reference to FIG. 3 later.

버퍼(110)는 제1 인코더(100)를 통해 인코딩된 비트스트림을 저장하고 있다. 이때, 버퍼(110)는 제1 인코더(100)에서 출력되는 비트스트림을 '퍼스트 인-퍼스트 아웃'(FIFO: First In-First Out, 이하 'FIFO'라고 함) 방식으로 저장한다.The buffer 110 stores the bitstream encoded by the first encoder 100. In this case, the buffer 110 stores the bitstream output from the first encoder 100 in a 'first in-first out' (FIFO) manner.

비트레이트 제어부(120)는 입력되는 원본 영상 데이터가 통신 채널 또는 저장 매체로 안정적으로 전송될 수 있도록 인코딩하기 위해 원본 영상 데이터의 인코딩 시 비트레이트를 제어한다. The bit rate controller 120 controls the bit rate when encoding the original image data to encode the input image data so that the input image data can be stably transmitted to a communication channel or a storage medium.

구체적으로, 비트레이트 제어부(120)는 제1 인코더(100)에 영상 데이터가 입력되어 인코딩이 수행된지 일정 시간이 경과한 후 제2 인코더(140)에 영상 데이터가 입력되도록 제어한다.In detail, the bit rate controller 120 controls the image data to be input to the second encoder 140 after a predetermined time has passed since the image data is input to the first encoder 100 and the encoding is performed.

그리고 비트레이트 제어부(120)는 제2 인코더(140)의 양자화 계수를 설정하고, 제1 인코더(100)에 비해 일정 시간이 지연되어 제2 인코더(140)에 입력되는 영상 데이터를 설정된 양자화계수를 이용하여 인코딩하도록 제어하는 역할을 한다. The bit rate controller 120 sets the quantization coefficient of the second encoder 140 and delays a predetermined time compared to the first encoder 100 so as to set the quantization coefficient of the image data input to the second encoder 140. It controls to encode using.

이때, 비트레이트 제어부(120)는 버퍼(110)에 저장된 비트스트림의 비트량과 제1 인코더(100)에서 설정된 양자화계수를 이용하여 이용하여 제2 인코더(140)의 양자화에 적용될 각 프레임별 양자화 계수를 계산한다.In this case, the bit rate controller 120 uses the bit amount of the bit stream stored in the buffer 110 and the quantization coefficient set in the first encoder 100 to quantize each frame to be applied to the quantization of the second encoder 140. Calculate the coefficients.

구체적으로, 비트레이트 제어부(120)는 제2 인코더(140)의 양자화계수를 설정함에 있어서, 현재 제2 인코더(140)에 입력되는 프레임의 양자화 단계 직전까지의 비트스트림의 비트량과 버퍼(110)에 저장된 현재 프레임에 대응되는 프레임의 비트스트림의 비트량을 이용하여 현재 제2 인코더(140)에 입력되는 프레임의 양자화계수를 계산한다. 즉, 버퍼(110)에 저장된 대응되는 프레임의 비트스트림의 비트량을 얻기위해 제1 인코더(100)에서 설정되었던 양자화계수 값을 이용하여 제2 인코더(140)에서 적용될 현재 프레임의 양자화계수를 계산한다.Specifically, in setting the quantization coefficient of the second encoder 140, the bit rate control unit 120 includes the bit amount and the buffer 110 of the bitstream until immediately before the quantization step of the frame currently input to the second encoder 140. The quantization coefficient of the frame currently input to the second encoder 140 is calculated by using the bit amount of the bitstream of the frame corresponding to the current frame stored in the " That is, the quantization coefficient of the current frame to be applied by the second encoder 140 is calculated using the quantization coefficient value set in the first encoder 100 to obtain the bit amount of the bitstream of the corresponding frame stored in the buffer 110. do.

입력 지연부(130)는 제1 인코더(100)로 원본 영상 데이터가 입력되는 시점으로부터 일정 시간이 경과한 후 제2 인코더(140)로 원본 영상 데이터가 입력되도록 처리한다. 여기서, 일정 시간은 복수의 프레임으로 구성되는 원본 영상 데이터에서 적어도 하나의 프레임이 제1 인코더(100)를 통해 인코딩되는데 걸리는 시간보다 긴 시간인 것이 바람직하다. The input delay unit 130 processes the original image data to be input to the second encoder 140 after a predetermined time elapses from the time when the original image data is input to the first encoder 100. Here, the predetermined time is preferably longer than the time taken for the at least one frame to be encoded through the first encoder 100 in the original image data consisting of a plurality of frames.

본 발명의 실시예에 따른 입력 지연부(130)는 입력되는 원본 영상 데이터를 FIFO 방식으로 임시 저장하였다가 일정 시간이 경과하면 임시 저장되어 있던 영상 데이터를 첫 번째 프레임부터 순차적으로 제2 인코더(140)로 출력한다.  The input delay unit 130 according to an embodiment of the present invention temporarily stores the input original image data by the FIFO method, and when a predetermined time elapses, the second encoder 140 sequentially stores the temporarily stored image data from the first frame. )

예를 들어, 원본 영상 데이터가 n개의 프레임으로 구성되는 경우, 입력 지연부(130)에는 원본 영상 데이터의 첫 번째 프레임이 입력되는 시점부터 일정 시간이 경과하는 동안 i번째 프레임까지의 영상 데이터가 임시 저장된다. 이때, 입력 지연부(130)는 적어도 i개의 프레임의 영상 데이터가 저장될 수 있는 용량 이상의 용량을 가진다.For example, when the original image data is composed of n frames, the input delay unit 130 temporarily stores the image data up to the i-th frame for a predetermined time from the time when the first frame of the original image data is input. Stored. In this case, the input delay unit 130 has a capacity of at least i capacity for storing image data of at least i frames.

그리고 입력 지연부(130)는 일정 시간이 되면 임시 저장된 영상 데이터를 첫 번째 프레임부터 순차적으로 제2 인코더(140)로 출력한다. 이때, 입력 지연부(130)는 임시 저장되었던 영상 데이터를 첫 번째 프레임부터 순차적으로 제2 인코더(140)로 출력함과 동시에 원본 영상 데이터의 i+1번째 프레임부터 n 번째 프레임까지 순차적으로 입력받아 임시 저장한다. 그리고 입력 지연부(130)는 i번째 프레임이 출력된 후 이어서 i+1번째 프레임부터 n 번째 프레임까지 순차적으로 제2 인코더(140)로 출력한다. 결과적으로, 원본 영상 데이터의 각 프레임이 제2 인코더(140)에 입력되는 시점은 제1 인코더(100)에 비해 i개의 프레임이 입력되는 시간만큼 지연된다. The input delay unit 130 outputs the temporarily stored image data to the second encoder 140 sequentially from the first frame when a predetermined time comes. At this time, the input delay unit 130 sequentially outputs the temporarily stored image data from the first frame to the second encoder 140 and sequentially receives from the i + 1 th frame to the n th frame of the original image data. Temporarily save. The input delay unit 130 outputs the i-th frame to the second encoder 140 sequentially from the i + 1 th frame to the n th frame. As a result, the time point at which each frame of the original image data is input to the second encoder 140 is delayed by the time that i frames are input as compared to the first encoder 100.

또한, 입력 지연부(130)는 원본 영상 데이터가 입력된 시점부터 일정 시간이 경과한 후 원본 영상 데이터를 제2 인코더(140)로 출력하기 위한 타이머(미도시)를 자체적으로 포함할 수 있다. In addition, the input delay unit 130 may include a timer (not shown) for outputting the original image data to the second encoder 140 after a predetermined time has elapsed since the input of the original image data.

제2 인코더(140)는 입력되는 영상 데이터를 압축하여 비트스트림 형식으로 인코딩한다. 이때, 제2 인코더(140)는 비트레이트 제어부(120)에서 계산되어 설정 된 각 프레임별 양자화계수를 적용하여 입력되는 영상 데이터를 양자화한다. 이와 같이, 제2 인코더(140)를 통해 인코딩된 영상 데이터의 비트스트림은 네트워크 상의 통신 채널을 통해 송신되거나 저장매체로 전송된다.The second encoder 140 compresses the input image data and encodes the image data into a bitstream format. In this case, the second encoder 140 quantizes the input image data by applying the quantization coefficient for each frame calculated and set by the bit rate controller 120. As such, the bitstream of the image data encoded by the second encoder 140 is transmitted through a communication channel on a network or transmitted to a storage medium.

도 2는 본 발명의 실시예에 따른 비트레이트 제어부를 나타내는 블록도이다.2 is a block diagram illustrating a bit rate controller according to an exemplary embodiment of the present invention.

도 2에서 나타낸 바와 같이, 비트레이트 제어부(120)는 비트량 검출모듈(121), 양자화계수 생성모듈(122), 메모리(123)를 포함한다.As shown in FIG. 2, the bit rate controller 120 includes a bit amount detection module 121, a quantization coefficient generation module 122, and a memory 123.

비트량 검출모듈(121)은 버퍼(110)에 저장되어 있는 영상 데이터의 비트스트림을 검출하여 각 프레임별 비트량을 추출하고, 추출된 프레임별 비트량을 양자화계수 생성모듈(122)로 전달한다. 이때, 비트량 검출모듈(121)은 버퍼(110)에 FIFO 방식으로 저장되어 있는 영상 데이터의 비트스트림을 프레임 단위로 실시간으로 검출하여 비트량을 계산한다. 또한, 비트량 검출모듈(121)은 계산된 프레임별 비트량을 메모리(미도시)에 순차적으로 저장해둘 수 있다. The bit amount detection module 121 detects a bit stream of image data stored in the buffer 110, extracts a bit amount of each frame, and transfers the extracted bit amount of each frame to the quantization coefficient generation module 122. . At this time, the bit amount detection module 121 calculates the bit amount by detecting the bit stream of the image data stored in the buffer 110 in the FIFO method on a frame basis in real time. In addition, the bit amount detection module 121 may sequentially store the calculated bit amount for each frame in a memory (not shown).

한편, 비트량 검출모듈(121)은 버퍼(110)에 저장된 비트스트림이 일정량 이상이 되면 비트스트림을 검출하여 비트량을 계산하는 것도 가능하다. 즉, 비트량 검출모듈(121)은 일정 시간 동안 버퍼(110)에 비트스트림이 저장된 이후 프레이별비트스트림을 순차적으로 검출할 수 있다.Meanwhile, the bit amount detection module 121 may calculate the bit amount by detecting the bit stream when the bit stream stored in the buffer 110 becomes more than a predetermined amount. That is, the bit amount detection module 121 may sequentially detect the bit-by-frame bitstream after the bitstream is stored in the buffer 110 for a predetermined time.

이후, 설명의 편의상 비트량 검출모듈(121)에서 계산된 각 프레임별 비트량을 '제1 인코딩 결과 값'이라 지칭하도록 한다.Hereinafter, for convenience of description, the bit amount of each frame calculated by the bit amount detection module 121 is referred to as a 'first encoding result value'.

양자화계수 생성모듈(122)은 프레임별 제1 인코딩 결과 값을 각각 기준 비트량과 비교하여, 기준 비트량을 초과하는 비트량을 가진 프레임의 양자화계수를 재 설정한다. 그리고 양자화계수 생성모듈(122)은 재설정된 양자화계수를 포함한 프레임별 양자화계수의 테이블을 생성하여 메모리(123)에 저장한다.The quantization coefficient generation module 122 compares the first encoding result value for each frame with the reference bit amount, respectively, and resets the quantization coefficient of the frame having a bit amount exceeding the reference bit amount. The quantization coefficient generation module 122 generates a table of frame-specific quantization coefficients including the reset quantization coefficients and stores them in the memory 123.

구체적으로, 양자화계수 생성모듈(122)은 비트량 검출모듈(121)에서 전달된 각 프레임별 제1 인코딩 결과 값이 기준 비트량을 초과하는 프레임의 경우 제2 인코더(140)에서 적용될 양자화계수를 계산하게 된다.Specifically, the quantization coefficient generation module 122 may determine the quantization coefficient to be applied by the second encoder 140 in the case of a frame in which the first encoding result value for each frame transmitted from the bit amount detection module 121 exceeds the reference bit amount. Calculate.

즉, 양자화계수 생성모듈(122)은 비트량 검출모듈(121)로부터 전달되는 프레임별 제1 인코딩 결과 값을 확인하여, 현재 제2 인코더(140)에 입력되는 프레임과 대응되는 프레임의 제1 인코딩 결과 값을 기준 비트량과 비교한다. 그리고 양자화계수 생성모듈(122)은 기준 비트량과 비교한 결과 제1 인코딩 결과 값이 기준 비트량을 초과하는 경우, 제2 인코더(140)에서 현재 프레임의 양자화단계 직전까지의 비트스트림의 비트량과 제1 인코더(100)에서 제1 인코딩 결과를 얻기 위해 적용한 양자화계수를 이용하여 현재 제2 인코더(140)에 입력되는 프레임의 양자화계수를 계산한다.That is, the quantization coefficient generation module 122 checks the first encoding result value for each frame transmitted from the bit amount detection module 121, and then encodes a first encoding of a frame corresponding to the frame currently input to the second encoder 140. The resulting value is compared with the reference bit amount. When the first encoding result exceeds the reference bit amount as a result of comparing with the reference bit amount, the quantization coefficient generation module 122 determines the bit amount of the bit stream from the second encoder 140 until immediately before the quantization step of the current frame. And a quantization coefficient of a frame currently input to the second encoder 140 using the quantization coefficient applied by the first encoder 100 to obtain a first encoding result.

한편, 양자화계수 생성모듈(122)은 현재 제2 인코더(140)에 입력되는 프레임의 제1 인코딩 결과 값이 기준 비트량 이하인 경우 제1 인코더(100)에서 해당 프레임에 적용되었던 양자화계수를 제2 인코더(140)에서도 적용할 수 있다.Meanwhile, if the first encoding result of the frame currently input to the second encoder 140 is less than or equal to the reference bit amount, the quantization coefficient generating module 122 may convert the quantization coefficient applied to the corresponding frame from the first encoder 100 to the second. The same may be applied to the encoder 140.

즉, 양자화계수 생성모듈(122)은 제1 인코더(100)에서 양자화에 적용된 프레임별 양자화계수를 참조하여 제2 인코더(140)의 양자화계수를 계산 및 설정하여 양자화계수 테이블을 생성한다. That is, the quantization coefficient generation module 122 generates a quantization coefficient table by calculating and setting the quantization coefficient of the second encoder 140 with reference to the frame-specific quantization coefficient applied to the quantization in the first encoder 100.

이때, 양자화계수 생성모듈(122)에서 계산되는 제1 인코딩 결과 값이 기준 비트량을 초과하는 프레임의 양자화계수는, 제1 인코더(100)에서 해당 프레임에 적용되었던 양자화계수보다 큰 값으로 설정된다. 즉, 해당 프레임의 최종 비트량이 목표 비트량(기준 비트량 이하)을 만족할 수 있도록 계산된다. In this case, the quantization coefficient of the frame in which the first encoding result calculated by the quantization coefficient generation module 122 exceeds the reference bit amount is set to a value larger than the quantization coefficient applied to the frame in the first encoder 100. . That is, the final bit amount of the frame is calculated to satisfy the target bit amount (or less than the reference bit amount).

여기서, 기준 비트량은 영상 데이터가 통신 채널을 통해 전송되거나 전송 매체에 전달되는데 필요한 대역폭에 적대될 수 있는 비트량 범위를 초과하지 않는 최대 비트량을 의미한다. 일반적으로, 전송될 영상 데이터의 비트량이 최대 비트량을 초과할 경우, 전송될 데이터가 유실되거나 전송 에러가 발생하게되어 멀티미디어 서비스의 품질이 떨어지게 된다. Here, the reference bit amount means a maximum bit amount that does not exceed a range of bit amounts that may be hostile to the bandwidth required for image data to be transmitted through a communication channel or transmitted to a transmission medium. In general, when the bit amount of the image data to be transmitted exceeds the maximum bit amount, the data to be transmitted is lost or a transmission error occurs, thereby degrading the quality of the multimedia service.

따라서, 본 발명의 실시예에 따른 양자화계수 생성모듈(122)은 기준 비트량을 초과하는 비트량을 가진 특정 프레임의 비트량이 기준 비트량 이하가 되도록 계산한다.Accordingly, the quantization coefficient generation module 122 according to the embodiment of the present invention calculates the bit amount of a specific frame having a bit amount exceeding the reference bit amount to be equal to or less than the reference bit amount.

메모리(123)에는 양자화계수 생성모듈(122)에서 설정된 프레임별 양자화계수가 저장되어 있다. 이때, 양자화계수 생성모듈(122)에서 설정된 양자화계수는 제2 인코더(140)의 양자화에 적용되며, 각 프레임에 따라 설정된 양자화계수가 매칭된 테이블 형태로 저장될 수 있다.The memory 123 stores the quantization coefficient for each frame set by the quantization coefficient generation module 122. In this case, the quantization coefficient set in the quantization coefficient generation module 122 is applied to the quantization of the second encoder 140, and may be stored in a table form in which the quantization coefficient set according to each frame is matched.

한편, 본 발명의 실시예에서는 입력 지연부(130)가 제1 인코더(100)에 원본 영상 데이터의 첫 번째 프레임이 입력된 후 일정 시간이 경과하면 제2 인코더(140)로 영상 데이터를 출력하는 것을 나타내었다. 그런데, 또 다른 실시예로는 비트레이트 제어부(120)가 타이밍 제어모듈(미도시)을 포함하여, 일정 시간이 경과한 후 입력 지연부(130)로 영상 데이터 출력 지시를 하는 것도 가능하다.Meanwhile, in the embodiment of the present invention, the input delay unit 130 outputs the image data to the second encoder 140 when a predetermined time elapses after the first frame of the original image data is input to the first encoder 100. It was shown. However, in another embodiment, the bit rate controller 120 may include a timing control module (not shown), and may instruct the input delay unit 130 to output image data after a predetermined time elapses.

즉, 타이밍 제어모듈(미도시)은 버퍼(110)에 적어도 하나의 프레임의 비트스트림이 저장되는 시점에 입력 지연부(130)로 영상 데이터 출력을 지시할 수 있다.That is, the timing control module (not shown) may instruct the output delay unit 130 to output the image data when the bitstream of at least one frame is stored in the buffer 110.

도 3은 도 1에서 나타낸 제1 인코더의 구성을 나타내는 블록도이다.3 is a block diagram illustrating a configuration of a first encoder illustrated in FIG. 1.

도 3에서 나타낸 바와 같이, 제1 인코더(100)는 변환기(101), 양자화기(102), 코더(103), 역양자화기(104), 역변환기(105), 움직임 추정기(106) 및 움직임 보상기(107)를 포함한다.As shown in FIG. 3, the first encoder 100 includes a transformer 101, a quantizer 102, a coder 103, an inverse quantizer 104, an inverse transformer 105, a motion estimator 106, and a motion. Compensator 107 is included.

본 발명의 실시예에서, 제1 인코더(100)로 입력되는 원본 영상 데이터는 매 프레임마다 매크로블록(macroblock) 단위로 분할되어 변환기(101)로 입력된다.In the exemplary embodiment of the present invention, the original image data input to the first encoder 100 is divided into macroblock units every frame and input to the converter 101.

변환기(101)는 움직임 보상된 영상 데이터와 입력되는 현재 원본 영상 데이터의 연산(108) 결과를 입력받아 이산 코사인 변환(Discrete cosine transform, 이하 'DCT'라고 지칭함)을 수행한다. 이때, 움직임 보상처리된 영상데이터는 이전 프레임의 영상 데이터를 참조하여 얻어진다.The transformer 101 receives a result of the operation 108 of the motion compensated image data and the input current original image data, and performs a discrete cosine transform (hereinafter, referred to as 'DCT'). At this time, the motion compensated image data is obtained by referring to the image data of the previous frame.

양자화기(102)는 DCT를 거친 영상 데이터를 양자화 처리한다. 이때, 양자화기(102)는 매프레임마다 설정된 양자화계수를 적용하여 양자화를 수행한다. 즉, 도 3에서 나타내지 않았지만 양자화기(102)는 각 프레임별 양자화계수의 테이블을 저장하고 있는 메모리(미도시)를 따로 포함할 수 있다. 이때, 양자화계수는 일정 값으로 고정되거나 최적화된 값으로 갱신되어 저장될 수 있다.The quantizer 102 quantizes the image data passed through the DCT. In this case, the quantizer 102 performs quantization by applying a quantization coefficient set every frame. That is, although not shown in FIG. 3, the quantizer 102 may separately include a memory (not shown) that stores a table of quantization coefficients for each frame. In this case, the quantization coefficient may be fixed to a predetermined value or updated and stored as an optimized value.

코더(103)는 양자화된 영상 데이터의 압축 효율을 향상시키기위해 엔트로피 코딩을 수행하여 영상 데이터를 비트스트림으로 변환한다. 이때, 코더(103)의 엔트로피 코딩의 결과인 각 프레임별 비트스트림은 버퍼(110)에 FIFO 방식으로 저장된 다.The coder 103 converts the image data into a bitstream by performing entropy coding to improve compression efficiency of the quantized image data. At this time, the bitstream for each frame that is a result of entropy coding of the coder 103 is stored in the buffer 110 in the FIFO method.

역양자화기(104)는 양자화된 영상 데이터를 역양자화한다.Inverse quantizer 104 dequantizes quantized image data.

또한, 역변환기(105)는 역양자화된 영상데이터를 역DCT변환을 수행하여 영상 데이터를 복원한다.Also, the inverse transformer 105 restores the image data by performing inverse DCT transformation on the inversely quantized image data.

이때, 역변환기(105)를 통해 복원된 현재 프레임의 영상 데이터와 이전 프레임의 움직임 보상된 영상 데이터는 결합(109)되어 그 결과 영상 데이터가 움직임 추정기(106)와 움직임 보상기(107)로 출력된다.In this case, the image data of the current frame reconstructed by the inverse transformer 105 and the motion compensated image data of the previous frame are combined 109 so that the image data is output to the motion estimator 106 and the motion compensator 107. .

움직임 추정기(106)는 현재 입력되는 원본 영상 데이터와 결합(109) 결과 영상 데이터를 입력받아 움직임 예측을 위한 움직임 벡터와 디퍼렌셜 이미지를 출력한다.The motion estimator 106 receives the resultant image data combined with the original input image data 109 and outputs a motion vector and a differential image for motion prediction.

움직임 보상기(107)는 결합(109) 결과 영상 데이터와 움직임 추정기(106)를 통해 출력된 디퍼렌셜 이미지를 입력받아 움직임을 보상한다.The motion compensator 107 receives the differential image output through the combination image 109 and the motion estimator 106 to compensate for the motion.

도 4는 도 1에서 나타낸 제2 인코더의 구성을 나타내는 블록도이다.4 is a block diagram illustrating a configuration of a second encoder illustrated in FIG. 1.

본 발명의 실시예에 따른 제2 인코더(140)는 변환기(141), 양자화기(142), 코더(143), 역양자화기(144), 역변환기(145), 움직임 추정기(146) 및 움직임 보상기(147)를 포함한다.The second encoder 140 according to an embodiment of the present invention includes a transformer 141, a quantizer 142, a coder 143, an inverse quantizer 144, an inverse transformer 145, a motion estimator 146, and a motion. Compensator 147.

이때, 도 4에서 나타낸 양자화기(142)에서 양자화에 적용하기 위해 참조하는 각 프레임별 양자화계수가 다른 것을 제외하고 제2 인코더(140)의 각 구성 및 그 동작은 제1 인코더(100)과 동일하므로 중복되는 설명은 생략하기로 한다.In this case, each configuration and operation of the second encoder 140 are identical to those of the first encoder 100 except that the quantization coefficient for each frame referred to for application to quantization in the quantizer 142 illustrated in FIG. 4 is different. Therefore, duplicate descriptions will be omitted.

변환기(141)는 입력 지연부(130)로부터 출력되는 현재 원본 영상 데이터와 움직임 보상된 영상 데이터의 연산(148) 결과를 입력받아 DCT를 수행한다. 이때, 입력되는 원본 영상 데이터는 동일한 프레임의 원본 영상 데이터가 제1 인코더(100)로 입력된 시점에서 일정 시간이 지연된 후 입력된다.The converter 141 receives a result of the operation 148 of the current original image data and the motion compensated image data output from the input delay unit 130 and performs DCT. In this case, the input original image data is input after a predetermined time delay from the time when the original image data of the same frame is input to the first encoder 100.

양자화기(142)는 DCT를 거친 영상 데이터를 양자화 처리한다. 이때, 양자화기(142)는 입력되는 각 프레임의 영상 데이터를 양자화함에 있어서 메모리(123)에 저장되어 있는 양자화계수 테이블을 참조한다. The quantizer 142 quantizes the image data passed through the DCT. In this case, the quantizer 142 refers to a quantization coefficient table stored in the memory 123 in quantizing image data of each input frame.

즉, 양자화기(142)는 프레임별 비트량이 기준 비트량을 초과하는 특정 프레임의 경우 제1 인코더(100)의 양자화기(102)에서 특정 프레임에 적용한 양자화계수보다 상대적으로 크게 재설정된 양자화계수를 적용하여 양자화를 수행한다. 결과적으로, 제2 인코더(140)에서는 현재 인코딩할 프레임의 영상 데이터의 비트레이트를 예측하여 인코딩을 수행할 수 있다.That is, the quantizer 142 may be configured to reset the quantization coefficient that is relatively larger than the quantization coefficient applied to the specific frame by the quantizer 102 of the first encoder 100 in the case of a specific frame in which the amount of bits per frame exceeds the reference bit amount. Apply to perform quantization. As a result, the second encoder 140 may perform encoding by predicting a bit rate of image data of a frame to be currently encoded.

제2 인코더(140)의 나머지 구성들은 제1 인코더(100)에서 상응하는 구성들과 동일한 동작을 수행한다.The remaining components of the second encoder 140 perform the same operations as the corresponding components in the first encoder 100.

이하, 도 5 및 도 6을 참조하여 본 발명의 실시예에 따른 멀티패스 인코딩 방법을 설명하도록 한다. 아래에서는, 제1 인코더(100)를 통한 인코딩 과정을 제1 인코딩이라 지칭하고, 제2 인코더(140)를 통한 인코딩 과정을 제2 인코딩이라 지칭하도록 한다. Hereinafter, a multipath encoding method according to an embodiment of the present invention will be described with reference to FIGS. 5 and 6. Hereinafter, an encoding process through the first encoder 100 is referred to as a first encoding, and an encoding process through the second encoder 140 is referred to as a second encoding.

도 5는 본 발명의 실시예에 따른 양자화계수 생성 방법을 나타내는 순서도이다.5 is a flowchart illustrating a method of generating a quantization coefficient according to an embodiment of the present invention.

먼저, 비트레이트 제어부(120)의 비트량 검출모듈(121)은 버퍼(110)로부터 프레임별 비트량을 검출한다(S200). 이때, 버퍼(110)에 저장된 비트스트림은 제1 인코딩을 통해 얻어진 적어도 하나의 프레임의 비트스트림이며, 복수의 프레임인 경우 FIFO 방식으로 저장되어 있다. 따라서, 비트량 검출모듈(121)은 제1 인코딩을 통해 얻어지는 각 프레임별 비트량을 먼저 인코딩된 프레임부터 순차적으로 검출할 수 있다. First, the bit amount detection module 121 of the bit rate controller 120 detects the bit amount for each frame from the buffer 110 (S200). In this case, the bitstream stored in the buffer 110 is a bitstream of at least one frame obtained through the first encoding, and is stored in the FIFO method in the case of a plurality of frames. Therefore, the bit amount detection module 121 may sequentially detect the bit amount for each frame obtained through the first encoding from the first encoded frame.

그런 다음, 비트레이트 제어부(120)의 양자화계수 생성모듈(122)은 검출된 각 프레임별 비트량을 기설정된 기준 비트량과 비교한다(S210). 이때, 검출되는 프레임별 비트량은 순차적으로 기준 비트량과 비교된다. 여기서, 기준 비트량은 통신 채널의 대역폭 내에서 안정적으로 멀티미디어 서비스가 가능한 최대 비트량이다.Next, the quantization coefficient generation module 122 of the bit rate controller 120 compares the detected bit amount of each frame with a preset reference bit amount (S210). At this time, the detected bit amount for each frame is sequentially compared with the reference bit amount. Here, the reference bit amount is the maximum bit amount that can be stably provided to the multimedia service within the bandwidth of the communication channel.

그러면, 양자화계수 생성모듈(122)은 검출된 비트량이 기준 비트량 이하인 프레임의 경우 해당 프레임의 양자화계수를 기설정된 양자화계수로 설정한다(S220). 이때, 기설정된 양자화계수는 제1 인코딩 과정에서 적용된 양자화계수와 동일하거나, 제2 인코딩시 기설정된 기준 양자화계수 또는 양자화계수의 평균 값 등으로 설정될 수 있다. In operation S220, the quantization coefficient generation module 122 sets the quantization coefficient of the corresponding frame to a preset quantization coefficient in the case of a frame in which the detected bit amount is less than or equal to the reference bit amount. In this case, the preset quantization coefficient may be the same as the quantization coefficient applied in the first encoding process, or may be set to a reference quantization coefficient or an average value of the quantization coefficient.

또한, 양자화계수 생성모듈(122)은 검출된 프레임 비트량이 기준 비트량을 초과하는 경우 목표 비트량을 달성하기 위한 양자화계수를 재설정한다(S230). 이때, 목표 비트량은 기준 비트량 이하의 비트량으로서, 통신 채널의 대역폭에 안정적으로 영상 데이터를 적재할 수 있는 크기의 비트량이다. 또한, 재설정되는 양자화계수는 앞서 제1 인코딩 과정에서 적용된 양자화계수에 비해 상대적으로 큰 값으로 설정된다.In addition, when the detected frame bit amount exceeds the reference bit amount, the quantization coefficient generation module 122 resets the quantization coefficient for achieving the target bit amount (S230). In this case, the target bit amount is a bit amount less than or equal to the reference bit amount, and is a bit amount that can stably load video data in the bandwidth of the communication channel. In addition, the quantization coefficient to be reset is set to a relatively larger value than the quantization coefficient applied in the first encoding process.

그런 다음, 양자화계수 생성모듈(122)은 앞선 두 단계 S220 또는 S230에서 설정된 각각의 양자화계수 값을 이용하여 제2 인코딩에 적용될 양자화계수 테이블을 생성하여 메모리(123)에 저장한다(S240). 이때, 양자화계수 테이블에는 각 프레임별 양자화계수가 저장되며, 이는 실시간으로 업데이트가 가능하다.Next, the quantization coefficient generation module 122 generates a quantization coefficient table to be applied to the second encoding by using the respective quantization coefficient values set in the two previous steps S220 or S230 and stores the quantization coefficient table in the memory 123 (S240). In this case, a quantization coefficient for each frame is stored in the quantization coefficient table, which can be updated in real time.

이후, 이와 같이 생성된 양자화계수 테이블을 참조하여 제2 인코더(140)의 양자화가 수행된다.Thereafter, the quantization of the second encoder 140 is performed with reference to the quantization coefficient table generated as described above.

도 6은 본 발명의 실시예에 따른 멀티 패스 인코딩 방법을 나타내는 순서도 이다.6 is a flowchart illustrating a multi-pass encoding method according to an embodiment of the present invention.

먼저, 제1 인코더(100) 및 입력 지연부(130)로 원본 영상 데이터가 동시에 입력된다(S300). 이때, 입력 지연부(130)는 입력되는 영상 데이터를 프레임별로 순차적으로 임시 저장한다.First, original image data is simultaneously input to the first encoder 100 and the input delay unit 130 (S300). In this case, the input delay unit 130 temporarily stores the input image data sequentially for each frame.

그런 다음, 제1 인코더(100)는 입력되는 영상 데이터를 인코딩하여 버퍼(110)에 순차적으로 저장한다(S310). 이때, 제1 인코더(100)는 인코딩된 비트스트림을 FIFO 방식으로 첫 번째 프레임부터 마지막 프레임까지 저장한다.Next, the first encoder 100 encodes the input image data and sequentially stores the input image data in the buffer 110 (S310). At this time, the first encoder 100 stores the encoded bitstream from the first frame to the last frame in the FIFO method.

그런 후, 비트레이트 제어부(120)는 제2 인코더(140)에 적용될 양자화계수를 설정하여 저장한다(S320). 이때, 비트레이트 제어부(120)는 버퍼(110)에 저장된 인코딩된 비트스트림의 각 프레임별 비트량을 검출하여 제2 인코더(140)에 적용될 양자화계수를 계산한다. 또한, 비트레이트 제어부(120)는 버퍼(110)에 저장되는 프레임별 비트량을 먼저 인코딩된 프레임부터 순차적으로 검출하여 실시간으로 양자화계수를 설정한다.Thereafter, the bit rate controller 120 sets and stores a quantization coefficient to be applied to the second encoder 140 (S320). In this case, the bit rate controller 120 detects the bit amount of each frame of the encoded bitstream stored in the buffer 110 and calculates a quantization coefficient to be applied to the second encoder 140. In addition, the bit rate controller 120 sequentially detects the bit amount of each frame stored in the buffer 110 from the first encoded frame and sets the quantization coefficient in real time.

그런 다음, 입력 지연부(130)는 원본 영상 데이터의 첫 번째 프레임의 입력 시점으로부터 일정 시간이 경과한 후 입력 지연부(130)로 영상 데이터 출력한다(S330). 이때, 일정 시간은 비트레이트 제어부(120)에서 버퍼(110)로부터 적어도 한 프레임의 비트스트림이 검출할 수 있는 시간이다. Then, the input delay unit 130 outputs the image data to the input delay unit 130 after a predetermined time elapses from the input time of the first frame of the original image data (S330). In this case, the predetermined time is a time that the bitrate controller 120 can detect the bitstream of at least one frame from the buffer 110.

이때, 입력 지연부(130)는 일정 시간동안 저장되어 있던 영상 데이터를 제2 인코더(140)로 출력함과 동시에 원본 영상 데이터를 순차적으로 입력받아 저장을 수행한다. In this case, the input delay unit 130 outputs the image data stored for a predetermined time to the second encoder 140 and receives the original image data sequentially and stores the image data.

예를 들어, 입력 지연부(130)는 일정 시간동안 입력되는 원본 영상 데이터의 첫 번째 프레임부터 i번째 프레임까지 저장한 상태에서 비트레이트 제어부(120)의 영상 출력 지시를 받으면, 첫 번째 프레임부터 순차적으로 제2 인코더(140)로 출력한다. 이와 동시에 입력 지연부(130)는 지속적으로 i+1번째 프레임의 영상 데이터를 입력받아 저장한다. 즉, 입력 지연부(130)가 저장된 영상 데이터의 첫 번째 프레임을 제2 인코더(140)로 출력하는 시점에 제1 인코더(100) 및 입력 지연부(130)는 원본 영상 데이터의 i+1번째 프레임을 입력받는다.For example, when the input delay unit 130 receives an image output instruction from the bitrate controller 120 while storing the first frame to the i th frame of the original image data input for a predetermined time, the input delay unit 130 sequentially starts from the first frame. And output to the second encoder 140. At the same time, the input delay unit 130 continuously receives and stores image data of the i + 1 th frame. That is, when the input delay unit 130 outputs the first frame of the stored image data to the second encoder 140, the first encoder 100 and the input delay unit 130 are i + 1 th of the original image data. Take a frame.

그런 다음, 제2 인코더(140)는 메모리(123)에 저장되어 있는 양자화계수를 양자화단계에 적용하여 입력되는 영상 데이터를 인코딩한다(S340). Then, the second encoder 140 encodes the input image data by applying the quantization coefficient stored in the memory 123 to the quantization step (S340).

이때, 제2 인코더(100)를 통해 인코딩되는 영상데이터의 각 프레임은 제1 인코더(100)를 통해 인코딩되는 시점보다 일정 시간 지연되어 인코딩된다. 즉, 제1 인코더(100)에서 일정 시간 앞서 인코딩된 프레임 비트량을 통해 제2 인코더(140)의 인코딩 시 필요한 정보를 예측할 수 있다. 따라서, 본 발명의 실시예에 따르면 입력되는 영상 데이터의 각 프레임별 비트량을 제어함과 동시에 제2 인코딩 결과를 제1 인코딩 시간으로부터 약 일정 시간 후 얻을 수 있어 멀티 패스 인코딩의 소요시간을 단축할 수 있다.In this case, each frame of the image data encoded by the second encoder 100 is encoded with a predetermined time delay from the time of encoding through the first encoder 100. That is, the first encoder 100 may predict the information necessary for encoding the second encoder 140 through the frame bit amount encoded before the predetermined time. Therefore, according to an embodiment of the present invention, while controlling the bit amount for each frame of the input image data, the second encoding result can be obtained after a predetermined time from the first encoding time, thereby reducing the time required for multi-pass encoding. Can be.

이상에서 본 발명의 실시예에 대하여 상세하게 설명하였지만 본 발명의 권리범위는 이에 한정되는 것은 아니고 다음의 청구범위에서 정의하고 있는 본 발명의 기본 개념을 이용한 당업자의 여러 변형 및 개량 형태 또한 본 발명의 권리범위에 속하는 것이다.Although the embodiments of the present invention have been described in detail above, the scope of the present invention is not limited thereto, and various modifications and improvements of those skilled in the art using the basic concepts of the present invention defined in the following claims are also provided. It belongs to the scope of rights.

도 1은 본 발명의 실시예에 따른 멀티 패스 인코딩 장치의 블록도 이다.1 is a block diagram of a multi-pass encoding apparatus according to an embodiment of the present invention.

도 2는 본 발명의 실시예에 따른 비트레이트 제어부를 나타내는 블록도 이다.2 is a block diagram illustrating a bit rate controller according to an exemplary embodiment of the present invention.

도 3은 도 1에서 나타낸 제1 인코더의 구성을 나타내는 블록도 이다.3 is a block diagram illustrating a configuration of a first encoder illustrated in FIG. 1.

도 4는 도 1에서 나타낸 제2 인코더의 구성을 나타내는 블록도 이다.4 is a block diagram illustrating a configuration of a second encoder illustrated in FIG. 1.

도 5는 본 발명의 실시예에 따른 양자화계수 생성방법을 나타내는 순서도 이다.5 is a flowchart illustrating a method of generating a quantization coefficient according to an embodiment of the present invention.

도 6은 본 발명의 실시예에 따른 멀티 패스 인코딩 방법을 나타내는 순서도 이다.6 is a flowchart illustrating a multi-pass encoding method according to an embodiment of the present invention.

Claims (15)

복수의 프레임으로 구성되는 원본 영상 데이터를 멀티 패스 인코딩하는 장치에 있어서,In the device for multi-pass encoding the original image data consisting of a plurality of frames, 상기 원본 영상 데이터를 입력받아 제1 인코딩을 수행하는 제1 인코더;A first encoder receiving the original image data and performing a first encoding; 상기 제1 인코딩 결과로부터 검출된 프레임별 비트량에 따라 프레임별 양자화계수를 설정하는 비트레이트 제어부;A bit rate controller configured to set a quantization coefficient for each frame according to the amount of bits for each frame detected from the first encoding result; 상기 원본 영상 데이터를 상기 제1 인코딩이 시작된 시점으로부터 제1 시간 지연하여 출력하는 입력 지연부; 및An input delay unit configured to output the original image data by delaying a first time from a time point at which the first encoding starts; And 상기 입력 지연부로부터 출력되는 영상 데이터를 상기 설정된 양자화계수를적용하여 제2 인코딩을 수행하는 제2 인코더 A second encoder that performs second encoding on the image data output from the input delay unit by applying the set quantization coefficient 를 포함하는 멀티패스 인코딩 장치.Multipath encoding apparatus comprising a. 제1항에 있어서,The method of claim 1, 상기 제1 인코딩을 통해 생성되는 비트스트림을 저장하는 버퍼A buffer for storing the bitstream generated through the first encoding 를 더 포함하는 멀티패스 인코딩 장치. Multipath encoding apparatus further comprising. 제2항에 있어서,The method of claim 2, 상기 버퍼에는,In the buffer, 상기 프레임별 비트스트림이 FIFO(First In-First Out) 방식으로 저장되는The bitstream for each frame is stored in a first in-first out (FIFO) manner. 것을 특징으로 하는 멀티 패스 인코딩 장치.Multi-pass encoding device, characterized in that. 제2항에 있어서,The method of claim 2, 상기 제1 시간은 상기 복수의 프레임 전체의 제1 인코딩이 수행되는 기간보다 짧은 기간인The first time is a period shorter than a period during which the first encoding of the entire plurality of frames is performed. 멀티 패스 인코딩 장치.Multipass Encoding Device. 제2항 내지 제4항 중 어느 한 항에 있어서,The method according to any one of claims 2 to 4, 상기 비트레이트 제어부는,The bitrate control unit, 상기 비트스트림을 이용하여 프레임별 비트량을 검출하는 비트량 검출모듈;A bit amount detection module for detecting a bit amount of each frame by using the bit stream; 상기 검출된 비트량과 기준 비트량을 각각 비교하여 그 결과에 따라 상기 프레임별 양자화계수를 설정하는 양자화계수 생성모듈; 및A quantization coefficient generation module for comparing the detected bit quantity with a reference bit quantity and setting the quantization coefficient for each frame according to the result; And 상기 프레임별 양자화계수가 저장되는 메모리Memory for storing the quantization coefficient for each frame 를 포함하는 멀티 패스 인코딩 장치.Multi-pass encoding device comprising a. 제5항에 있어서,The method of claim 5, 상기 비트레이트 제어부는,The bitrate control unit, 상기 제1 인코딩이 시작된지 상기 제1 시간이 경과한 후 상기 입력 지연부로 상기 영상 데이터의 출력을 지시하는 타이밍 제어모듈A timing control module for instructing the input delay unit to output the image data after the first time has elapsed since the first encoding has started; 을 더 포함하는 멀티 패스 인코딩 장치.Multi-pass encoding device further comprising. 제5항에 있어서,The method of claim 5, 상기 양자화계수 생성모듈은,The quantization coefficient generation module, 상기 검출된 비트량이 상기 기준 비트량을 초과하는 프레임의 경우 상기 양자화계수를 목표 비트량을 만족하기 위한 양자화계수로 설정하고,In the case of the frame in which the detected bit amount exceeds the reference bit amount, the quantization coefficient is set as a quantization coefficient to satisfy a target bit amount, 상기 검출된 비트량이 상기 기준 비트량 이하인 프레임의 경우 상기 양자화계수를 기설정된 양자화계수로 설정하는 In the case of the frame in which the detected bit amount is less than or equal to the reference bit amount, the quantization coefficient is set to a preset quantization coefficient. 멀티 패스 인코딩 장치.Multipass Encoding Device. 제7항에 있어서,The method of claim 7, wherein 상기 양자화계수 생성 모듈은,The quantization coefficient generation module, 상기 검출된 비트량이 상기 기준 비트량을 초과하는 프레임의 경우 상기 제1 인코딩시 적용한 양자화계수와 상기 검출된 비트량을 이용하여 상기 양자화계수를 계산하는 In the case of the frame in which the detected bit amount exceeds the reference bit amount, the quantization coefficient is calculated by using the quantization coefficient applied during the first encoding and the detected bit amount. 멀티 패스 인코딩 장치.Multipass Encoding Device. 복수의 프레임으로 구성되는 원본 영상 데이터를 멀티 패스 인코딩하는 방법에 있어서,In the method of multi-pass encoding the original image data consisting of a plurality of frames, 상기 원본 영상 데이터를 첫 번째 프레임부터 순차적으로 제1 인코딩한 결과 생성된 비트스트림을 이용하여 프레임별 비트량을 검출하는 단계;Detecting a bit amount of each frame by using a bitstream generated as a result of first encoding the original image data sequentially from a first frame; 상기 프레임별 비트량과 기준 비트량을 비교하여, 그 비교 결과에 따라 각 프레임의 양자화계수를 설정하여 저장하는 단계; 및Comparing the bit amount for each frame and the reference bit amount, and setting and storing a quantization coefficient of each frame according to the comparison result; And 상기 첫 번째 프레임이 상기 제1 인코딩되기 시작한 시점으로부터 제1 시간이 경과한 후, 상기 설정된 양자화계수를 적용하여 상기 원본 영상 데이터를 첫 번째 프레임부터 순차적으로 제2 인코딩하는 단계After the first time elapses from the time when the first frame starts to be encoded, applying the set quantization coefficient to second encoding the original image data sequentially from the first frame 를 포함하는 멀티 패스 인코딩 방법.Multi-pass encoding method comprising a. 제9항에 있어서,The method of claim 9, 상기 제1 시간은,The first time is, 상기 원본 영상 데이터의 전체 프레임의 제1 인코딩 기간보다 짧은 기간인A period shorter than a first encoding period of the entire frame of the original image data 멀티 패스 인코딩 방법.Multipass Encoding Method. 제10항에 있어서,The method of claim 10, 상기 프레임별 비트량을 검출하는 단계 이전에,Before the step of detecting the bit amount per frame, 상기 제1 인코딩 결과 생성된 비트스트림을 FIFO(First In-First Out) 방식으로 저장하는 단계Storing the bitstream generated as a result of the first encoding in a first in-first out (FIFO) manner 를 더 포함하는 멀티 패스 인코딩 방법.Multi-pass encoding method further comprising. 제11항에 있어서,The method of claim 11, 상기 제1 시간은,The first time is, 상기 제1 인코딩 결과 상기 복수의 프레임 중 적어도 하나의 프레임의 비트스트림이 저장되는 시점까지의 기간인A period of time until a bitstream of at least one frame of the plurality of frames is stored as a result of the first encoding; 것을 특징으로 하는 멀티 패스 인코딩 방법. Multi-pass encoding method. 제10항에 있어서,The method of claim 10, 상기 양자화계수를 설정하여 저장하는 단계는,Setting and storing the quantization coefficient, 상기 복수의 프레임 중 제i 번째 프레임의 비트량이 상기 기준 비트량을 초과하는 경우 상기 제i 번째 프레임의 비트량이 목표 비트량을 만족하도록 하는 양자화계수 값을 계산하여 양자화계수를 설정하는 단계; Setting a quantization coefficient by calculating a quantization coefficient value such that the bit amount of the i-th frame satisfies a target bit amount when the bit amount of the i-th frame of the plurality of frames exceeds the reference bit amount; 상기 제i 번째 프레임의 비트량이 상기 기준 비트량 이하인 경우 기설정된 값으로 양자화계수를 설정하는 단계; 및Setting a quantization coefficient to a preset value when the bit amount of the i-th frame is less than or equal to the reference bit amount; And 상기 설정된 양자화계수를 프레임별로 저장하는 단계Storing the set quantization coefficient for each frame 를 포함하는 멀티 패스 인코딩 방법.Multi-pass encoding method comprising a. 제13항에 있어서,The method of claim 13, 상기 제i 번째 프레임의 비트량이 상기 기준 비트량을 초과하는 경우,If the bit amount of the i-th frame exceeds the reference bit amount, 상기 양자화계수는 상기 제1 인코딩 시 적용한 제i 번째 프레임의 양자화계수보다 큰 값이 되도록 설정되는 The quantization coefficient is set to be greater than the quantization coefficient of the i-th frame applied during the first encoding. 멀티 패스 인코딩 방법.Multipass Encoding Method. 제13항에 있어서,The method of claim 13, 상기 제i 번째 프레임의 비트량이 상기 기준 비트량 이하인 경우,When the bit amount of the i-th frame is equal to or less than the reference bit amount, 상기 양자화계수는 상기 제1 인코딩 시 제i 번째 프레임에 적용한 양자화계수와 동일한 값으로 설정되는The quantization coefficient is set to the same value as the quantization coefficient applied to the i th frame in the first encoding 것을 특징으로 하는 멀티 패스 인코딩 방법.Multi-pass encoding method.
KR1020070096317A 2007-09-21 2007-09-21 Apparatus and method for multi-pass encoding KR100918499B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020070096317A KR100918499B1 (en) 2007-09-21 2007-09-21 Apparatus and method for multi-pass encoding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020070096317A KR100918499B1 (en) 2007-09-21 2007-09-21 Apparatus and method for multi-pass encoding

Publications (2)

Publication Number Publication Date
KR20090030778A true KR20090030778A (en) 2009-03-25
KR100918499B1 KR100918499B1 (en) 2009-09-24

Family

ID=40697028

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020070096317A KR100918499B1 (en) 2007-09-21 2007-09-21 Apparatus and method for multi-pass encoding

Country Status (1)

Country Link
KR (1) KR100918499B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101145399B1 (en) * 2010-02-26 2012-05-15 한국전자통신연구원 Apparatus and Method for High-speed Multi-pass Encoding

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005011255A2 (en) * 2003-06-26 2005-02-03 Thomson Licensing S.A. Multipass video rate control to match sliding window channel constraints
KR100909541B1 (en) * 2004-06-27 2009-07-27 애플 인크. Multi-pass video encoding method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101145399B1 (en) * 2010-02-26 2012-05-15 한국전자통신연구원 Apparatus and Method for High-speed Multi-pass Encoding

Also Published As

Publication number Publication date
KR100918499B1 (en) 2009-09-24

Similar Documents

Publication Publication Date Title
US7072393B2 (en) Multiple parallel encoders and statistical analysis thereof for encoding a video sequence
JP5180294B2 (en) Buffer-based rate control that utilizes frame complexity, buffer level, and intra-frame location in video encoding
KR101644208B1 (en) Video encoding using previously calculated motion information
US7170938B1 (en) Rate control method for video transcoding
JP5384694B2 (en) Rate control for multi-layer video design
JP5350404B2 (en) Early macroblock delta QP decision
US5870146A (en) Device and method for digital video transcoding
US20190342551A1 (en) Rate control
US20060018378A1 (en) Method and system for delivery of coded information streams, related network and computer program product therefor
KR20030073254A (en) Method for adaptive encoding motion image based on the temperal and spatial complexity and apparatus thereof
US8948242B2 (en) Encoding device and method and multimedia apparatus including the encoding device
US20130322516A1 (en) Systems and methods for generating multiple bitrate streams using a single encoding engine
KR100601615B1 (en) Apparatus for compressing video according to network bandwidth
US20090310672A1 (en) Method and System for Rate Control in a Video Encoder
US20180184089A1 (en) Target bit allocation for video coding
JPWO2003084243A1 (en) Image compression encoding apparatus and method, and program
KR100594056B1 (en) H.263/MPEG Video Encoder for Effective Bits Rate Control and Its Control Method
JP4042597B2 (en) Image encoding apparatus and method, program, and recording medium
US7428339B2 (en) Pseudo-frames for MPEG-2 encoding
KR100918499B1 (en) Apparatus and method for multi-pass encoding
KR20110024574A (en) Integrated video encoding method and apparatus
US20090290636A1 (en) Video encoding apparatuses and methods with decoupled data dependency
CA2737913C (en) Video streaming apparatus with quantization and method thereof
JP4089753B2 (en) Image compression encoding apparatus and method, program, and recording medium
KR20030083109A (en) apparatus for transcoding bit rate

Legal Events

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

Payment date: 20120904

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20130904

Year of fee payment: 5

LAPS Lapse due to unpaid annual fee