KR100480698B1 - MPEG encoding method - Google Patents

MPEG encoding method Download PDF

Info

Publication number
KR100480698B1
KR100480698B1 KR10-2002-0019500A KR20020019500A KR100480698B1 KR 100480698 B1 KR100480698 B1 KR 100480698B1 KR 20020019500 A KR20020019500 A KR 20020019500A KR 100480698 B1 KR100480698 B1 KR 100480698B1
Authority
KR
South Korea
Prior art keywords
edge
macroblock
parameter
quantization
macro block
Prior art date
Application number
KR10-2002-0019500A
Other languages
Korean (ko)
Other versions
KR20030080716A (en
Inventor
서병찬
Original Assignee
엘지전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 엘지전자 주식회사 filed Critical 엘지전자 주식회사
Priority to KR10-2002-0019500A priority Critical patent/KR100480698B1/en
Publication of KR20030080716A publication Critical patent/KR20030080716A/en
Application granted granted Critical
Publication of KR100480698B1 publication Critical patent/KR100480698B1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]

Landscapes

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

Abstract

MPEG 인코딩 방법에 관한 것으로서, 특히 입력 영상에 대해 소정 크기의 마스크를 사용하여 에지를 검출하고 검출 결과로서 에지 파라미터를 출력하는 단계와, 상기 에지 파라미터를 적용하여 현재 인코딩할 매크로 블록의 타입을 결정하는 단계와, 현재 인코딩할 매크로 블록의 에지 파라미터로 구한 공간 액티비티와 기준 양자화 파라미터를 곱하여 실제 양자화에 사용할 최종 양자화 스텝을 결정하는 단계를 포함하여 이루어져, 부호화후의 발생 비트양을 정확하게 추정함으로써 인코더의 성능을 향상시킬 수 있다. 또한, 에지 검출은 덧셈기로만 구현이 가능하며 특히, 매크로 블록 타입 및 비트율 제어에 동일한 에지 파라미터를 적용함으로써, 하드웨어의 복잡도를 줄일 수 있다.In particular, the present invention relates to a method of encoding an MPEG. The method includes: detecting an edge using a mask having a predetermined size for an input image, outputting an edge parameter as a detection result, and applying the edge parameter to determine a type of a macroblock to be currently encoded. And determining the final quantization step to be used for actual quantization by multiplying the spatial activity obtained by the edge parameter of the macroblock to be encoded currently with the reference quantization parameter, thereby accurately calculating the performance of the encoder by accurately estimating the amount of bits generated after encoding. Can be improved. In addition, edge detection can be implemented only with an adder, and in particular, by applying the same edge parameter to macro block type and bit rate control, hardware complexity can be reduced.

Description

엠펙 인코딩 방법{MPEG encoding method}MPEG encoding method

본 발명은 엠펙(MPEG) 인코더에 관한 것으로서, 특히 에지 검출에 의한 파라미터를 이용하여 MPEG 인코더의 매크로 블록 타입 결정 및 비트율을 제어하는 MPEG 인코딩 방법에 관한 것이다.The present invention relates to an MPEG (MPEG) encoder, and more particularly, to an MPEG encoding method for controlling the macroblock type and bit rate of an MPEG encoder using a parameter by edge detection.

세계적으로 화상회의/전화, 디지털 VCR(Video Cassette Recorder), DVD(Digital Versatile Disc), 디지털 카메라 감시 및 보안 시스템 등의 디지털 영상의 사용이 확대되고 있다.The use of digital video, including video conferencing / telephone, digital video cassette recorder (VCR), digital versatile disc (DVD), and digital camera surveillance and security systems, is expanding worldwide.

특히, 동영상의 저장 및 전송에는 많은 자원이 요구되기 때문에 이를 압축 부호화하여 저장 및 전송하게 된다.In particular, since a lot of resources are required for storing and transmitting a video, compression and encoding are performed to store and transmit the video.

이러한 용도로 널리 사용되는 규격으로 MPEG(Moving Picture Experts Group)이 있다. 상기 MPEG은 크게 이산 여현 변환기(DCT) 후 양자화, 움직임 추정 및 보상 기법 및 부호의 발생 확률에 의한 가변장 부호화를 근간으로 이루어져 있고, 여기에 고정 비트율 전송을 위한 비트율 제어가 포함된다.A widely used standard for this purpose is the Moving Picture Experts Group (MPEG). The MPEG is largely based on a discrete cosine transform (DCT) quantization, a motion estimation and compensation technique, and variable length coding based on a code generation probability, and includes bit rate control for fixed bit rate transmission.

이때, 상기 MPEG 인코더에 주로 사용되는 알고리즘은 ISO(International Organization for Standardization)의 산하 기구인 IS/IEC JTC1/SC29/WG11에서 국제 표준화 진행중인 MPEG-2의 자료(문서번호 AVC-491인 TEST MODEL 5)에서 제안한 방법이다.At this time, the algorithm mainly used in the MPEG encoder is the material of MPEG-2 under international standardization in IS / IEC JTC1 / SC29 / WG11, which is an organization of ISO (International Organization for Standardization) (document number AVC-491, TEST MODEL 5) This is the suggested method.

도 1은 이러한 일반적인 MPEG 인코더의 구성 블록도로서, 인코딩부(100)와 비트율 제어부(200), 및 상기 인코딩부(100)의 움직임 보상을 제어하는 MC 제어부(300)로 구성된다.FIG. 1 is a block diagram illustrating a general MPEG encoder, and includes an encoder 100, a bit rate controller 200, and an MC controller 300 that controls motion compensation of the encoder 100.

즉, 감산기(101)는 입력되는 데이터가 I 픽쳐이면 그대로, P나 B 픽쳐이면 움직임 보상부(109)에서 움직임 보상된 데이터와의 차분 데이터를 DCT부(102)로 출력한다. 상기 DCT부(102)는 입력되는 데이터를 DCT한 후 양자화부(103)로 출력하여 양자화한다. That is, the subtractor 101 outputs the difference data with the motion-compensated data from the motion compensation unit 109 to the DCT unit 102 if the input data is an I picture or the P or B picture. The DCT unit 102 DCTs the input data and outputs the quantized unit to the quantization unit 103.

여기서, 상기 DCT부(102)는 2차원 축변환을 통해서 데이터의 상관성을 제거하는데, 이를 위해 픽쳐를 블록 단위로 나눈 후 나누어진 각각의 블록을 DCT식에 따라 축변환시킨다. 이렇게 축변환된 데이터들은 한쪽 방향(저역 쪽)으로 몰리는 경향이 있는데 이렇게 몰려진 데이터들만을 양자화부(103)에서 양자화한 후 가변 길이 코딩(Variable Length Coding ; VLC)부(104)로 출력한다. 상기 VLC부(104)는 자주 나오는 값은 적은 수의 비트로, 드물게 나오는 값은 많은 수의 비트로 표시하여 전체 비트 수를 줄인 후 버퍼(110)로 출력한다. 상기 버퍼(110)는 VLC된 데이터를 일시적으로 저장한 후 전송 또는 저장을 위해 출력함과 동시에, 버퍼의 충만도를 계산하여 비트율 제어부(200)로 출력한다.In this case, the DCT unit 102 removes the correlation of data through two-dimensional axis transformation. To this end, after dividing the picture into block units, the DCT unit 102 transforms each divided block according to the DCT equation. The axially transformed data tends to converge in one direction (lower frequency side). Only the collected data are quantized by the quantization unit 103 and then output to the variable length coding (VLC) unit 104. The VLC unit 104 outputs the frequently-valued values to the buffer 110 after reducing the total number of bits by displaying a small number of bits and a rare value to a large number of bits. The buffer 110 temporarily stores the VLC data and outputs the data for transmission or storage. The buffer 110 calculates the fullness of the buffer and outputs the buffer to the bit rate controller 200.

또한, 상기 양자화부(103)에서 양자화된 DCT 계수는 다시 IQ부(105)로 입력되어 역양자화된 후 IDCT부(106)로 출력된다. 상기 IDCT부(106)는 역 양자화된 DCT 계수를 IDCT하여 가산기(107)로 출력한다. 상기 가산기(107)는 IDCT된 값과 움직임 보상된 값을 더하여 최종 픽셀값인 완전한 영상으로 복원한 후 움직임 보상을 위해 메모리(108)에 저장한다. 상기 움직임 보상부(109)는 MC 제어부(300)에 따라 메모리(108)로부터 읽어온 이전 프레임을 이용하여 움직임 보상을 수행한 후 감산기(101)와 가산기(107)로 출력한다.In addition, the DCT coefficients quantized by the quantization unit 103 are input to the IQ unit 105 again, dequantized, and then output to the IDCT unit 106. The IDCT unit 106 IDCTs the inverse quantized DCT coefficients and outputs them to the adder 107. The adder 107 adds the IDCT value and the motion compensated value to restore the complete image, which is the final pixel value, and then stores the result in the memory 108 for motion compensation. The motion compensator 109 performs motion compensation using the previous frame read from the memory 108 according to the MC controller 300 and then outputs the motion compensation to the subtractor 101 and the adder 107.

이때, 상기 MC 제어부(300)는 입력되는 데이터가 P-픽쳐인 경우는 MC/No-MC 결정, 인트라/비-인트라(Intra/non-intra) 결정, B-픽쳐인 경우는 포워드 MC, 백워드 MC, 보간된(interpolated) MC 결정, 인트라/비인트라 결정에 있어서 분산과 MSE(Mean Squared Error)를 이용한다. 여기서, 비-인트라로 결정된 매크로 블록에 대해 움직임 보상을 할지, 안할지가 결정된다. 이때, No-MC로 결정되면 움직임 벡터는 출력하지 않고 단지 현재와 이전 매크로 블록과의 차 값만 출력된다.In this case, the MC control unit 300 determines whether the input data is a P-picture, MC / No-MC determination, intra / non-intra determination, or B-picture, forward MC, back. Variance and Mean Squared Error (MSE) are used in word MC, interpolated MC decision, intra / non-intra decision. Here, it is determined whether motion compensation is performed or not for the macro block determined as non-intra. At this time, if it is determined as No-MC, only the difference value between the current and previous macro blocks is output without outputting the motion vector.

우선 움직임 예측 방법의 결정은 현재 매크로 블록과 움직임 예측에 의해 얻어진 과거 또는, 미래 매크로 블록 또는 과거와 미래 매크로 블록의 평균과의 MSE가 가장 작은 것을 선택하게 된다.First, the determination of the motion prediction method selects the smallest MSE of the current macroblock and the past or future macroblock obtained by the motion prediction or the average of the past and future macroblock.

이때, P-픽쳐의 경우는 움직임 예측된 결과에 대해 하기의 수학식 1,2를 적용하여 도 2와 같이 MC/no MC 결정을 하게 된다.In this case, in the case of the P-picture, MC / no MC is determined as shown in FIG. 2 by applying Equations 1 and 2 to the motion predicted result.

상기 수학식 1,2에서 blk(n)은 현재 부호화되는 매크로 블록의 n번째 계수를 나타낸다. blkmc(n)은 움직임 예측에 의해 얻어진 과거 영상의 참조 매크로 블록의 n번째 계수이고, blkno-mc(n)는 과거 영상에서 현재 영상의 현재 매크로 블록과 같은 위치의 매크로 블록의 n번째 계수를 나타낸다.In Equation 1 and 2, blk (n) represents the nth coefficient of the macroblock currently encoded. blk mc (n) is the n th coefficient of the reference macro block of the past image obtained by motion prediction, and blk no-mc (n) is the n th coefficient of the macro block at the same position as the current macro block of the current image in the past image. Indicates.

도 2에서 MC/No-MC를 결정할 때에 No-MC에 더 많은 비중을 두는 것은 P-픽쳐의 경우 No-MC이면 움직임 벡터를 전송하지 않으므로 실제 부호화 효율은 높아지기 때문이다.In the case of determining MC / No-MC in FIG. 2, more emphasis is placed on No-MC because, in the case of P-picture, if No-MC does not transmit a motion vector, the actual coding efficiency increases.

상기된 방법으로 움직임 예측 방법이 결정되면 하기의 수학식3,4를 적용하여 도 3과 같이 인트라/비인트라 결정을 하게 된다. When the motion prediction method is determined by the above-described method, intra / non-intra determination is performed by applying Equations 3 and 4 below.

상기된 수학식 3은 현재 부호화되는 매크로 블록의 분산을 나타내고, 수학식 4는 움직임 예측 방법 결정에 사용되었던 현재 매크로 블록과 참조 매크로 블록의 MSE를 나타낸다. Equation 3 represents the variance of the macroblock currently encoded, and Equation 4 represents the MSE of the current macroblock and the reference macroblock used to determine the motion prediction method.

즉, 움직임 보상의 사용 여부가 결정되면 그 결과에 대해 재구성된 블록의 분산과 인코딩하는 매크로블록의 분산을 비교하여 인트라 매크로 블록으로 인코딩 할 것인지 비인트라 매크로블록으로 인코딩 할 것인지를 결정한다. 이때, 인트라로 결정되면 입력되는 매크로 블록은 DCT, 양자화 및 가변 길이 부호화를 통해 인코딩되며, 비인트라로 결정되면 입력되는 매크로 블록과 이전 프레임의 참조 매크로블록과의 차분치가 DCT, 양자화 및 VLC를 통해 인코딩된다.That is, when it is determined whether motion compensation is used, the result is compared with the variance of the reconstructed block and the variance of the encoding macroblock to determine whether to encode the intra macroblock or the non-intra macroblock. In this case, if it is determined to be intra, the input macro block is encoded through DCT, quantization and variable length coding. If it is determined as non-intra, the difference between the input macro block and the reference macro block of the previous frame is determined through DCT, quantization, and VLC. Is encoded.

한편, MPEG 규격은 전술된 바와 같이 가변장 부호화(VLC)를 사용한다. 이로 인해, 부호화기에 발생되는 비트도 가변적이다. 따라서, 고정 비트율 전송이나 부호화된 영상의 크기를 필요로 하는 응용에 사용하기 위해 비트율 제어부(200)에서 비트율 제어를 한다.On the other hand, the MPEG standard uses variable length coding (VLC) as described above. For this reason, the bits generated by the encoder are also variable. Therefore, the bit rate control unit 200 controls bit rate for use in applications requiring fixed bit rate transmission or the size of an encoded image.

상기 비트율 제어부(200)는 주로 버퍼(110)의 충만도(buffer fullness)에 따라 양자화부(103)의 스텝 사이즈를 가변시켜 데이터의 발생량을 조절한다. 즉, 발생한 비트 수가 기준치 이상이면 버퍼(110)에 채워지는 데이터량이 증가하므로 양자화 스텝 사이즈를 증가시켜 다음에 발생할 비트수를 감소시키고, 기준치 이하로 데이터가 발생하면 그 반대로 양자화 스텝 사이즈를 감소시켜 발생 비트수를 증가시켜 전체적으로 버퍼(110)의 상태가 일정치를 유지할 수 있도록 조절한다. 양자화 스텝에 의해 발생 비트를 제어한다. 이러한 비트율 제어에 따라 영상 화질이 크게 좌우된다.The bit rate controller 200 adjusts the generation amount of data by varying the step size of the quantization unit 103 mainly according to the buffer fullness of the buffer 110. That is, if the number of bits generated is greater than or equal to the reference value, the amount of data to be filled in the buffer 110 is increased. Therefore, the quantization step size is increased to reduce the number of bits to be generated later. The number of bits is increased to adjust the state of the buffer 110 as a whole. The generation bit is controlled by the quantization step. The image quality is greatly influenced by the bit rate control.

이때, TM5를 참조하면 비트율 제어부(200)는 다음의 3단계의 동작을 수행한다. At this time, referring to TM5, the bit rate controller 200 performs the following three steps.

먼저, 제 1 단계는 비트할당(bit allocation) 단계로서, 복잡도를 예측하고 목표 비트를 할당하는 단계이다. 즉, 전송 비트율에 따라 GOP(Group Of Picture) 단위로 일정한 비트율을 할당하고 GOP 내부에서 각 픽쳐에 할당할 비트들을 각 픽쳐(I,P,B 프레임)의 복잡도에 따라 할당한다. 픽쳐의 복잡도는 한 픽쳐의 발생 비트 양과 스텝의 평균 값의 곱으로 구해진다.First, a first step is bit allocation, in which complexity is predicted and target bits are allocated. 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). The complexity of a picture is obtained by multiplying the generated bit amount of one picture by the average value of the steps.

제 2 단계는 전송율(즉, 비트율)을 조절(rate control)하는 단계로서, 비트율 제어는 매크로 블록 단위로 수행된다. 즉, 가상 버퍼(virtual buffer)(110)의 충만도에 따라 기준 양자화 파라미터 계산부(201)에서 각 매크로 블록에 대한 기준 양자화 파라미터를 계산한다. 그리고, 각 픽쳐를 상기 제 1 단계에서 할당받은 비트에 맞게 현재 픽쳐를 엔코딩할 수 있도록 비트율을 제어한다. 이때, 현재 매크로 블록에 대한 기준 양자화 파라미터는 이전 매크로 블록까지의 발생 비트에 의한 가상 버퍼 충만도에 의해 결정된다.The second step is to adjust the rate (i.e., bit rate), and the bit rate control is performed in units of macro blocks. That is, the reference quantization parameter calculator 201 calculates a reference quantization parameter for each macro block according to the fullness of the virtual buffer 110. The bit rate is controlled so that each picture can be encoded according to the bit allocated in the first step. In this case, the reference quantization parameter for the current macroblock is determined by the virtual buffer fullness by the generation bits up to the previous macroblock.

여기에서는, 각 픽쳐마다 임의의 가상적인 버퍼를 가지고 있다고 가정하고, 상기 버퍼의 상태에 따라 양자화 파라미터를 조절하는 방법을 사용한다.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 단계는 적응 양자화(adaptive quantization) 단계로서, 비트율 제어부(200)의 공간 액티비티 계산부(202)에서 현재 인코딩할 매크로 블록의 공간 액티비티(activity)를 하기의 수학식 5와 같이 구한다.The third step is adaptive quantization, and the spatial activity calculating unit 202 of the bit rate control unit 200 calculates the spatial activity of the macroblock to be encoded as shown in Equation 5 below.

sub-blocks(n=1...4) : the frame-organized sub-blokssub-blocks (n = 1 ... 4): the frame-organized sub-bloks

sub-blocks(n=5...6) : the frame-organized sub-blokssub-blocks (n = 5 ... 6): the frame-organized sub-bloks

상기 수학식 5에서 vblkn은 분산으로 구한 서브 블록값이다. 이렇게 구한 공간 액티비티를 다시 정규화한 후 양자화 파라미터 발생부(203)에서 상기 정규화된 공간 액티비티와 상기 제 2 단계에서 구한 기준 양자화 파라미터를 곱하여 실제로 양자화에 사용할 양자화 파라미터를 결정한다. 즉 상기 양자화부(103)는 양자화 파라미터 발생부(203)에서 출력되는 양자화 파라미터에 상수 예를 들면, 2를 곱하여 최종 양자화 스텝을 결정하고, 결정된 양자화 스텝 사이즈로 DCT 계수를 양자화하게 된다. 즉, 적응 양자화는 주관적 화질을 높일 수 있는 방법으로 상기 기준 양자화 파라미터를 현재의 매크로 블록의 복잡도에 따라 변화시키는 방법이다.In Equation 5, vblk n is a subblock value obtained by variance. After normalizing the spatial activity thus obtained, the quantization parameter generator 203 multiplies the normalized spatial activity by the reference quantization parameter obtained in the second step to determine the quantization parameter to be actually used for quantization. That is, the quantization unit 103 determines the final quantization step by multiplying a quantization parameter output from the quantization parameter generator 203 by a constant, for example, 2, and quantizes the DCT coefficients using the determined quantization step size. That is, adaptive quantization is a method of increasing the subjective picture quality, and is a method of changing the reference quantization parameter according to the complexity of the current macroblock.

이와 같이 매크로 블록의 타입 결정과 비트율 제어는 인코더의 성능을 좌우하는 중요한 요소로서, TM5에서 제안된 알고리즘이 주로 사용된다.As such, macroblock type determination and bit rate control are important factors that determine the performance of the encoder, and the algorithm proposed in TM5 is mainly used.

즉, 매크로 블록의 타입은 현재 매크로 블록의 분산과 움직임 예측에 의해 얻어진 참조 매크로 블록과의 MSE에 의해서 결정된다. 또한, 비트율 제어의 경우 적응 양자화 단계에서 공간 액티비티를 구할 때 분산을 이용한다.That is, the type of the macroblock is determined by the MSE with the reference macroblock obtained by variance and motion prediction of the current macroblock. In addition, in case of bit rate control, variance is used to obtain spatial activities in the adaptive quantization step.

이것은 분산값과 MSE를 이용하여 DCT를 수행하고 그 결과를 양자화한 후 VLC된 후에 발생되는 비트 양을 예측하기 위한 것이다.This is to estimate the amount of bits generated after performing VLC using variance and MSE, quantizing the result, and then VLC.

이때, 같은 값을 분산 또는 MSE하는 경우, 에러 값이 블록 전체에 넓게 퍼져있는 경우와 계수 일부에 편중되어 있는 경우를 보면, 계수 일부에 편중되어 있는 것이 DCT후 고주파 성분이 발생하며 이때는 DCT 계수의 값이 대체로 크기 때문에 양자화를 하더라도 더 많은 비트를 발생시킨다. 이때, 같은 분산값에서도 발생 비트 양에 오차가 크다. 그러므로, 분산이나 MSE는 고주파 성분을 잘 반영하지 못하는 문제점이 있다. 즉, 부호화에 있어서 발생되는 비트 양을 좀 더 정확하게 예측할 수 있는 파라미터가 요구된다.In this case, when the same value is distributed or MSE, when the error value is widely spread over the block and when the partial value is biased, the high frequency component occurs after DCT because the partial value is biased. Because the value is large, even quantization generates more bits. At this time, an error in the amount of bits generated is large even at the same dispersion value. Therefore, dispersion or MSE does not reflect high frequency components well. In other words, a parameter that can more accurately predict the amount of bits generated in encoding is required.

또한, 분산 및 MSE를 구하기 위해서는 곱셈기와 덧셈기가 요구되므로 하드웨어가 복잡해지는 문제점이 있다.In addition, since a multiplier and an adder are required to obtain variance and MSE, hardware is complicated.

본 발명은 상기와 같은 문제점을 해결하기 위한 것으로서, 본 발명의 목적은 고주파 성분을 보다 잘 반영하여 해당 비트에 대한 영상의 화질을 향상시킬 수 있는 MPEG 인코딩 방법을 제공함에 있다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and an object of the present invention is to provide an MPEG encoding method capable of better reflecting a high frequency component to improve an image quality of a corresponding bit.

본 발명의 다른 목적은 구현시 하드웨어의 복잡도를 줄일 수 있는 MPEG 인코딩 방법을 제공함에 있다.Another object of the present invention is to provide an MPEG encoding method which can reduce the complexity of hardware in implementation.

상기와 같은 목적을 달성하기 위한 본 발명에 따른 MPEG 인코딩 방법은, 고주파 성분을 잘 반영하는 에지 검출 알고리즘을 적용하여 매크로 블록 타입 결정과 비트율 제어를 수행하는 한편, 매크로 블록 타입 결정 및 비트율 제어에 동일한 에지 검출 알고리즘에 의해 얻어진 파라미터를 사용하는 것을 특징으로 한다.In order to achieve the above object, the MPEG encoding method according to the present invention applies an edge detection algorithm that reflects a high frequency component to perform macro block type determination and bit rate control, while simultaneously performing macro block type determination and bit rate control. It is characterized by using a parameter obtained by the edge detection algorithm.

본 발명에 따른 MPEG 인코딩 방법은, 입력 영상에 대해 소정 크기의 마스크를 사용하여 에지를 검출하고 검출 결과로서 에지 파라미터를 출력하는 단계와, 상기 에지 파라미터를 적용하여 현재 인코딩할 매크로 블록의 타입을 결정하는 단계와, 현재 인코딩할 매크로 블록의 에지 파라미터로부터 공간 액티비티를 구한 후 기준 양자화 파라미터를 곱하여 실제 양자화에 사용할 최종 양자화 스텝을 결정하는 단계를 포함하여 이루어지는 것을 특징으로 한다.The MPEG encoding method according to the present invention includes detecting an edge using a mask having a predetermined size with respect to an input image, outputting an edge parameter as a detection result, and applying the edge parameter to determine a type of a macroblock to be currently encoded. And determining a final quantization step to use for actual quantization by multiplying a reference quantization parameter by obtaining a spatial activity from an edge parameter of a macroblock to be currently encoded.

상기 매크로 블록의 타입을 결정하는 단계는 현재 매크로 블록의 에지와 움직임 예측에 의해 얻어진 참조 매크로 블록과의 에지에 의해 매크로 블록의 타입을 결정하는 것을 특징으로 한다.The determining of the type of the macro block may include determining the type of the macro block by the edge of the current macro block and the edge of the reference macro block obtained by the motion prediction.

상기 매크로 블록의 타입을 결정하는 단계는 에지 파라미터를 설정된 임계값과 비교하여 입력되는 매크로 블록을 인트라 코딩할 것인지, 비인트라 코딩할 것인지를 결정하고, 현재 매크로 블록의 에지 파라미터와 이전 매크로 블록의 에지 파라미터를 비교하여 움직임 보상 여부를 결정하는 것을 특징으로 한다.The determining of the type of the macroblock may include comparing an edge parameter with a set threshold to determine whether to input the intrablock or non-intracoded macroblock, and determine the edge parameter of the current macroblock and the edge of the previous macroblock. It is characterized by determining whether to compensate for motion by comparing the parameters.

본 발명의 다른 목적, 특징 및 잇점들은 첨부한 도면을 참조한 실시예들의 상세한 설명을 통해 명백해질 것이다.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 illustrating the configuration and operation of the embodiment of the present invention, 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 the technical spirit of the present invention described above and its core configuration and operation is not limited.

통상, VLC후 최종 발생되는 비트 양은 DCT후 주파수 영역에서의 데이터에 큰 영향을 받는다. 즉, 저주파 쪽으로 데이터가 편중될수록 발생 비트가 작다.In general, the amount of bits generated after VLC is greatly influenced by data in the frequency domain after DCT. In other words, as data is biased toward the lower frequency, the generation bit is smaller.

즉, 부호화후 발생되는 비트 양의 대부분은 블록 계수에 대한 것이다. That is, most of the bits generated after encoding are for block coefficients.

따라서, 본 발명에서는 부호화후 발생되는 비트양을 더욱 정확하게 추정하기 위해서, 분산과 MSE를 대신하여 고주파 성분을 잘 반영하는 인접 픽셀과의 차 즉, 에지 검출 알고리즘을 매크로 블록 타입 결정과 비트율 제어에 적용하는데 있다.Therefore, in the present invention, in order to more accurately estimate the amount of bits generated after encoding, the difference between adjacent pixels that reflect high frequency components well, instead of variance and MSE, that is, edge detection algorithm is applied to macroblock type determination and bit rate control. It is.

도 4는 3x3 에지 검출 알고리즘에 의한 매크로 블록의 특성 값을 검출하는 방법을 도식적으로 나타낸 것이다. 4 is a diagram illustrating a method of detecting characteristic values of a macroblock by a 3x3 edge detection algorithm.

이후, 에지 검출에 의해 얻어진 특성 파라미터를 에지 파라미터라 한다.Then, the characteristic parameter obtained by edge detection is called edge parameter.

하기의 수학식 6을 적용하여 에지 파라미터(E)를 구한다.The edge parameter E is obtained by applying Equation 6 below.

상기 수학식 6에서 Hr과 Hc는 에지 검출에 사용되는 오퍼레이터이며, W[i,j]는 현재 매크로 블록 또는 현재 매크로 블록과 움직임 예측에 의해서 얻어진 참조 매크로 블록을 나타낸다. In Equation 6, Hr and Hc are operators used for edge detection, and W [i, j] represents a current macroblock or a reference macroblock obtained by motion prediction with the current macroblock.

여기서, 상기 에지 파라미터(E) 값이 클수록 해당 매크로 블록에 고주파 성분이 많음을 나타낸다.Here, the larger the value of the edge parameter E, the more high frequency components are included in the macro block.

이렇게 구한 에지 파라미터를 매크로 블록의 타입 결정 및 비트율 제어의 적응 양자화의 공간 액티비티에 동일하게 적용될 수 있다. 즉, 상기 에지 파라미터는 매크로 블록 타입 결정에 사용되는 분산과 MSE 대신 적용될 수 있으며, 적응 양자화의 공간 액티비티를 구할 때 적용될 수 있다.The edge parameters thus obtained can be equally applied to the spatial activity of the type determination of the macroblock and the adaptive quantization of the bit rate control. That is, the edge parameter may be applied instead of the variance and MSE used for determining the macroblock type, and may be applied when obtaining the spatial activity of the adaptive quantization.

예를 들면, 에지 파라미터를 기 설정된 임계값과 비교하여 입력되는 매크로 블록을 인트라 코딩할지 비인트라 코딩할지를 결정하고, 현재 매크로 블록의 에지 파라미터와 이전 매크로 블록의 에지 파라미터를 비교하여 움직임 보상을 할지 안할지를 결정한다. 즉, 현재 매크로 블록의 에지와 움직임 예측에 의해 얻어진 참조 매크로 블록과의 에지에 의해서 매크로 블록의 타입이 결정된다. For example, the edge parameter is compared with a preset threshold to determine whether to input the intra or non-intra coded macro block, and whether the motion compensation is performed by comparing the edge parameter of the current macro block with the edge parameter of the previous macro block. Determine. That is, the type of the macroblock is determined by the edge of the current macroblock and the reference macroblock obtained by the motion prediction.

또한, 상기 에지 파라미터는 공간 액티비티를 계산할 때 분산 대신 적용하여 양자화 스텝 사이즈를 결정할 수 있다. 즉, 분산 대신 현재 인코딩할 매크로 블록의 에지 파라미터를 적용하여 공간 액티비티를 구한 후 가상 버퍼(110)의 충만도에 따라 제 2 단계에서 구한 기준 양자화 파라미터를 곱하여 실제 양자화에 사용할 최종 양자화 스텝을 결정한다.In addition, the edge parameter may be applied instead of variance when calculating the spatial activity to determine the quantization step size. That is, the spatial activity is obtained by applying the edge parameter of the macroblock to be encoded instead of variance, and then the final quantization step to be used for actual quantization is determined by multiplying the reference quantization parameter obtained in the second step according to the fullness of the virtual buffer 110. .

도 5a 내지 도 5c는 분산과 에지 검출에 의한 발생 비트 양의 실험 결과를 나타낸 것이다. 실험 결과로 볼 때 에지 파라미터가 발생 비트양에 대해 보다 정확한 값을 추정 가능하게 함을 알 수 있다.5A to 5C show experimental results of the amount of bits generated by variance and edge detection. Experimental results show that the edge parameter enables more accurate estimation of the amount of bits generated.

도 6a 내지 도 6c는 제안된 방법과 TM5에 대한 PSNR 비교 그래프로서, 본 발명이 약 1.2dB의 성능 향상을 보이고 있다.6A to 6C are PSNR comparison graphs for the proposed method and TM5, and the present invention shows an improvement of about 1.2 dB.

이상에서와 같이 본 발명에 따른 MPEG 인코딩 방법에 따르면, 에지 검출에 의해 얻어진 에지 파라미터를 적용하여 매크로 블록 타입 결정 및 비트율 제어를 수행함에 의해 부호화후의 발생 비트양을 추정함으로써, 발생 비트 양을 정확하게 추정하여 인코더의 성능을 향상시키는 효과가 있다. 또한, 에지 검출은 덧셈기로만 구현이 가능하며 특히, 매크로 블록 타입 및 비트율 제어에 동일한 에지 파라미터를 적용함으로써, 하드웨어의 복잡도를 줄이는 효과가 있다.As described above, according to the MPEG encoding method according to the present invention, the amount of generated bits is accurately estimated by estimating the amount of generated bits after encoding by performing macroblock type determination and bit rate control by applying edge parameters obtained by edge detection. This improves the performance of the encoder. In addition, edge detection can be implemented only with an adder, and in particular, by applying the same edge parameter to macro block type and bit rate control, there is an effect of reducing hardware complexity.

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

도 1은 일반적인 MPEG 인코더의 구성 블록도1 is a block diagram of a typical MPEG encoder

도 2는 일반적인 MC/No-MC 결정 그래프2 is a typical MC / No-MC determination graph

도 3은 일반적인 인트라/비인트라 결정 그래프3 is a typical intra / non intra determination graph

도 4는 본 발명에 따른 MPEG 인코더에서 에지 검출하는 예를 보인 도면4 illustrates an example of edge detection in an MPEG encoder according to the present invention.

도 5a 내지 도 5c는 본 발명의 에지 파라미터와 분산을 적용하여 추정된 발생 비트량의 실험 결과를 보인 도면5A to 5C show experimental results of the estimated amount of generated bits by applying the edge parameter and the variance of the present invention.

도 6a 내지 도 6c는 본 발명과 TM5에 대한 PSNR 비교 그래프6A-6C are PSNR comparison graphs for the present invention and TM5

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

100 : 인코딩부 101 : 감산기100: encoding unit 101: subtractor

102 : DCT부 103 : 양자화부102: DCT unit 103: quantization unit

104 : VLC부 105 : 역양자화부104: VLC unit 105: inverse quantization unit

106 : IDCT부 107 : 가산기106: IDCT unit 107: adder

108 : 프레임 메모리 109 : 움직임 보상부108: frame memory 109: motion compensation unit

110 : 가상 버퍼 200 : 비트율 제어부110: virtual buffer 200: bit rate control unit

300 : MC 제어부300: MC control unit

Claims (4)

매크로 블록의 타입에 따라 이산 코사인 변환(DCT), 양자화, 가변 길이 코딩, 움직임 보상을 수행하는 MPEG 인코딩 방법에 있어서, In the MPEG encoding method for performing discrete cosine transform (DCT), quantization, variable length coding, motion compensation according to the type of macro block, 입력 영상에 대해 소정 크기의 마스크를 사용하여 에지를 검출하고 검출 결과로서 에지 파라미터를 출력하는 단계;Detecting an edge using a mask of a predetermined size on the input image and outputting an edge parameter as a detection result; 상기 에지 파라미터를 적용하여 현재 인코딩할 매크로 블록의 타입을 결정하는 단계; 그리고 Determining the type of macroblock to currently encode by applying the edge parameter; And 현재 인코딩할 매크로 블록의 에지 파라미터를 적용하여 공간 액티비티를 구한 후 기준 양자화 파라미터를 곱하여 실제 양자화에 사용할 최종 양자화 스텝을 결정하는 단계를 포함하여 이루어지는 것을 특징으로 하는 MPEG 인코딩 방법.And determining a final quantization step to use for actual quantization by multiplying a reference quantization parameter by obtaining a spatial activity by applying an edge parameter of a macroblock to be currently encoded. 제 1 항에 있어서, The method of claim 1, 상기 에지 검출 단계는 하기의 식을 적용하여 에지 파라미터(E)를 구하는 것을 특징으로 하는 MPEG 인코딩 방법.In the edge detection step, the edge parameter (E) is obtained by applying the following equation. 여기서, Hr과 Hc는 에지 검출에 사용되는 오퍼레이터이며, W[i,j]는 현재 매크로 블록 또는 현재 매크로 블록과 움직임 예측에 의해서 얻어진 참조 매크로 블록을 나타냄.Here, Hr and Hc are operators used for edge detection, and W [i, j] represents a current macroblock or a reference macroblock obtained by motion prediction with the current macroblock. 제 1 항에 있어서, 상기 매크로 블록의 타입을 결정하는 단계는The method of claim 1, wherein the determining of the type of macro block comprises: 현재 매크로 블록의 에지와 움직임 예측에 의해 얻어진 참조 매크로 블록과의 에지에 의해 매크로 블록의 타입을 결정하는 것을 특징으로 하는 MPEG 인코딩 방법.And the type of the macroblock is determined by the edge of the current macroblock and the reference macroblock obtained by motion prediction. 제 3 항에 있어서, 상기 매크로 블록의 타입을 결정하는 단계는The method of claim 3, wherein the determining of the type of macro block comprises: 에지 파라미터를 설정된 임계값과 비교하여 입력되는 매크로 블록을 인트라 코딩할 것인지, 비인트라 코딩할 것인지를 결정하고, 현재 매크로 블록의 에지 파라미터와 이전 매크로 블록의 에지 파라미터를 비교하여 움직임 보상 여부를 결정하는 것을 특징으로 하는 MPEG 인코딩 방법.Compares the edge parameter with a set threshold to determine whether to input the intra or non-intra coded macro block, and compares the edge parameter of the current macro block with the edge parameter of the previous macro block to determine whether to compensate for motion. MPEG encoding method, characterized in that.
KR10-2002-0019500A 2002-04-10 2002-04-10 MPEG encoding method KR100480698B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2002-0019500A KR100480698B1 (en) 2002-04-10 2002-04-10 MPEG encoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2002-0019500A KR100480698B1 (en) 2002-04-10 2002-04-10 MPEG encoding method

Publications (2)

Publication Number Publication Date
KR20030080716A KR20030080716A (en) 2003-10-17
KR100480698B1 true KR100480698B1 (en) 2005-04-06

Family

ID=32378443

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2002-0019500A KR100480698B1 (en) 2002-04-10 2002-04-10 MPEG encoding method

Country Status (1)

Country Link
KR (1) KR100480698B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100657277B1 (en) * 2004-09-02 2006-12-14 삼성전자주식회사 Method for selecting macro block type
KR100730770B1 (en) * 2005-08-19 2007-06-20 엠텍비젼 주식회사 Apparatus and method for compressing image data by mediating quantization coefficient using edge ingredient and record media recored program for realizing the same

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5576766A (en) * 1993-11-12 1996-11-19 Kokusai Denshin Denwa Kabushiki Kaisha Moving picture encoder
JPH11177983A (en) * 1997-12-10 1999-07-02 Nec Corp Image compression processor
JPH11316843A (en) * 1998-01-26 1999-11-16 Xerox Corp Image block type determining method for adaptive quantization of digital image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5576766A (en) * 1993-11-12 1996-11-19 Kokusai Denshin Denwa Kabushiki Kaisha Moving picture encoder
JPH11177983A (en) * 1997-12-10 1999-07-02 Nec Corp Image compression processor
JPH11316843A (en) * 1998-01-26 1999-11-16 Xerox Corp Image block type determining method for adaptive quantization of digital image

Also Published As

Publication number Publication date
KR20030080716A (en) 2003-10-17

Similar Documents

Publication Publication Date Title
KR100723507B1 (en) Adaptive quantization controller of moving picture encoder using I-frame motion prediction and method thereof
US6654417B1 (en) One-pass variable bit rate moving pictures encoding
US7023914B2 (en) Video encoding apparatus and method
KR100873586B1 (en) Dynamic complexity prediction and regulation of mpeg2 decoding in a media processor
US6823008B2 (en) Video bitrate control method and device for digital video recording
EP1063851B1 (en) Apparatus and method of encoding moving picture signal
KR100960249B1 (en) Two pass rate control techniques for video coding using a min-max approach
US7885341B2 (en) Spatial filtering for improving compression efficiency of motion compensated interframe coding
KR100790149B1 (en) Rate control of scene-changed video encoder
US8774272B1 (en) Video quality by controlling inter frame encoding according to frame position in GOP
KR20050119422A (en) Method and apparatus for estimating noise of input image based on motion compenstion and, method for eliminating noise of input image and for encoding video using noise estimation method, and recording medium for storing a program to implement the method
WO2006073579A2 (en) Methods and apparatus for providing a rate control
JPH08102938A (en) Image coder
KR20040076034A (en) Method and apparatus for encoding video signal with variable bit rate
CA2646538C (en) Two-pass video coding using a measure of predictive power of reference regions
JP2004215275A (en) Motion compensation based improved noise prediction method and apparatus, and moving image encoding method and apparatus using the same
US5905812A (en) Perceptual error processing method and image coding device using the same
US8442113B2 (en) Effective rate control for video encoding and transcoding
KR100834625B1 (en) Real-time scene-change detection for rate control of video encoder
KR100708182B1 (en) Rate control apparatus and method in video encoder
KR101336445B1 (en) Method for rate control in video encoding
KR100480698B1 (en) MPEG encoding method
JP2007124580A (en) Moving picture encoding program, program storage medium and encoder
JP3858520B2 (en) Video encoding apparatus and method
KR101490521B1 (en) Method for real-time scene-change detection for rate control of video encoder, method for enhancing qulity of video telecommunication using the same, and system for the video telecommunication

Legal Events

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

Payment date: 20091230

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee