KR101369161B1 - Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus - Google Patents

Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus Download PDF

Info

Publication number
KR101369161B1
KR101369161B1 KR1020080087651A KR20080087651A KR101369161B1 KR 101369161 B1 KR101369161 B1 KR 101369161B1 KR 1020080087651 A KR1020080087651 A KR 1020080087651A KR 20080087651 A KR20080087651 A KR 20080087651A KR 101369161 B1 KR101369161 B1 KR 101369161B1
Authority
KR
South Korea
Prior art keywords
prediction direction
rectangular
current block
block
prediction
Prior art date
Application number
KR1020080087651A
Other languages
Korean (ko)
Other versions
KR20100028769A (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 KR1020080087651A priority Critical patent/KR101369161B1/en
Priority to US13/002,259 priority patent/US9100646B2/en
Priority to PCT/KR2009/004865 priority patent/WO2010027170A2/en
Publication of KR20100028769A publication Critical patent/KR20100028769A/en
Application granted granted Critical
Publication of KR101369161B1 publication Critical patent/KR101369161B1/en
Priority to US14/692,298 priority patent/US9654798B2/en
Priority to US14/833,914 priority patent/US10298954B2/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/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • 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

Abstract

본 발명은 예측 방향 전환 장치 및 방법과 그를 이용한 영상 부호화/복호화 장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for predicting direction switching and an image encoding / decoding apparatus and method using the same.

본 발명은 영상 부호화를 위해 영상의 현재 블록을 예측할 때, 예측 방향을 전환하는 장치에 있어서, 현재 블록 이전에 부호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 현재 블록이 입력되면 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 현재 블록의 예측 방향으로서 결정하고, 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 복수 개의 예측 방향 후보의 부호화 비용을 계산하여 부호화 비용이 최소인 예측 방향을 현재 블록의 예측 방향으로 결정하는 것을 특징으로 하는 예측 방향 전환 장치를 제공한다.The present invention is a device for switching the prediction direction when predicting the current block of the image for image coding, the quantization frequency coefficient of the previous block coded before the current block is stored if input, and if the current block is input of the previous block If the quantization frequency coefficients are all '0', the reference prediction direction is determined as the prediction direction of the current block, and when one or more coefficients of the quantization frequency coefficients of the previous block are not '0', the coding cost of the plurality of prediction direction candidates The present invention provides a prediction direction switching device, wherein the prediction direction having the minimum encoding cost is determined as the prediction direction of the current block.

본 발명에 의하면, 영상을 부호화하거나 복호화할 때 예측의 정확도를 높일 수 있어 영상의 부호화 효율을 향상시킬 수 있다.According to the present invention, when encoding or decoding an image, the accuracy of prediction can be increased, and the encoding efficiency of the image can be improved.

영상, 부호화, 복호화, 인트라, 예측, 직사각, 방향, 전환 Image, encoding, decoding, intra, prediction, rectangular, direction, transition

Description

예측 방향 전환 장치 및 방법과 그를 이용한 영상 부호화/복호화 장치 및 방법{Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus}Prediction Direction Change Method and Apparatus and Video Encoding / Decoding Method and Apparatus}

본 발명은 예측 방향 전환 장치 및 방법과 그를 이용한 영상 부호화/복호화 장치 및 방법에 관한 것이다. 더욱 상세하게는, 영상을 부호화하거나 복호화하는 데 있어서, 부호화하고자 하는 블록마다 예측 방향을 결정하는 방법을 달리하여 예측함으로써 예측의 정확도를 높여 영상의 부호화 효율을 향상시키는 장치와 방법에 관한 것이다.The present invention relates to an apparatus and method for predicting direction switching and an image encoding / decoding apparatus and method using the same. More specifically, the present invention relates to an apparatus and method for improving the encoding efficiency of an image by increasing the accuracy of prediction by predicting by differently predicting a prediction direction for each block to be encoded in encoding or decoding an image.

MPEG(Moving Picture Experts Group)과 VCEG(Video Coding Experts Group)은 기존의 MPEG-4 Part 2와 H.263 표준안보다 우수하고 뛰어난 비디오 압축 기술을 개발하였다. 이 새로운 표준안은 H.264/AVC(Advanced video Coding)이라 하며, MPEG-4 Part 10 AVC와 ITU-T Recommendation H.264로 공동으로 발표되었다. 이러한 H.264/AVC(이하 'H.264'라 약칭함)에서는 MPEG-1, MPEG-2, MPEG-4 Part2 Visual 등 기존의 동영상 부호화와 관련된 국제 표준과는 다른 방법인 공간 예측 부호화(Spatial Predictive Coding) 방법을 사용한다.Moving Picture Experts Group (MPEG) and Video Coding Experts Group (VCEG) have developed superior video compression techniques superior to the existing MPEG-4 Part 2 and H.263 standards. This new standard is called H.264 / AVC (Advanced Video Coding) and is jointly announced as MPEG-4 Part 10 AVC and ITU-T Recommendation H.264. In this H.264 / AVC (abbreviated as 'H.264'), a spatial prediction coding method which is different from the international standard related to the conventional video coding such as MPEG-1, MPEG-2 and MPEG- Predictive Coding) method.

기존의 동영상 부호화 방법에서는 이산 코사인 변환 영역(DCT Domain: Discrete Cosine Transform Domain)에서 변환된 계수(Coefficient)값에 대한 "인트라 예측(Intra Prediction)"을 사용함으로써 부호화 효율 증대를 추구하며, 그로 인해 저역 전송 비트율 대의 주관적 화질을 열화시키는 결과를 초래하였다. 하지만, H.264에서는 변환 영역(Transform Domain)이 아닌 공간 영역(Spatial Domain)에서의 공간적 인트라 예측(Spatial Intra Prediction)을 기반으로 하는 부호화 방법을 채택하고 있다.In the conventional moving image encoding method, "intra prediction" is used for the coefficient value transformed in the discrete cosine transform domain (DCT domain), thereby seeking to increase the coding efficiency. As a result, Resulting in deterioration in the subjective image quality of the transmission bit rate band. However, H.264 adopts a coding method based on Spatial Intra Prediction in a Spatial Domain instead of a Transform Domain.

기존의 공간적 인트라 예측을 기반으로 하는 부호화 방법을 사용하는 부호화기(Encoder)는 이미 부호화가 완료되어 재생된 이전 블록의 정보로부터 현재 부호화하고자 하는 블록 정보를 예측하고 부호화하고자 하는 실제 블록 정보의 차이(Difference) 정보만을 부호화해서 복호화기(Decoder)로 전송한다. 이때, 블록 정보를 예측하는 데 필요한 파라미터를 복호화기로 전송하거나, 부호화기와 복호화기를 동기화시켜 예측에 필요한 파라미터를 공유하도록 함으로써 복호화기가 블록 정보를 예측하도록 할 수도 있다. 복호화기는 이미 복호화가 완료되어 재생된 주변 블록의 정보를 예측하고, 부호화기로부터 전송된 오차 정보와 예측된 주변 블록의 정보의 합을 구하여 원하는 현재 복호화하고자 하는 블록의 정보를 생성하여 재생한다. 이때도 역시 부호화기로부터 예측에 필요한 파라미터가 전송되었다면, 복호화기는 해당 파라미터를 이용하여 주변 블록의 정보를 예측하는데 이용한다.An encoder using a coding method based on the existing spatial intraprediction predicts block information to be currently encoded from the information of a previous block that has been already encoded and reproduced and calculates a difference ) Information and transmits it to a decoder. At this time, parameters necessary for predicting the block information may be transmitted to the decoder, or the encoder and the decoder may be synchronized to share parameters required for prediction, so that the decoder may predict the block information. The decoder predicts the information of the neighboring block that has already been decoded and reproduced, obtains the sum of the error information transmitted from the encoder and the information of the predicted neighboring block, and generates and reproduces information of a desired current block to be decoded. In this case, if parameters necessary for prediction are also transmitted from the encoder, the decoder uses the parameter to predict information of neighboring blocks.

한편, 기존의 공간적 인트라 예측 기반의 부호화 방법은 정사각형의 블록 모드만을 사용한다. 변환 효율을 높이기 위해, 4x4 변환, 8x8 변환 등 2차원 정사각 형 변환을 사용하기 때문이다. 하지만, 정사각형의 블록 모드만을 사용하게 되면 블록의 오른쪽과 아래쪽 부분에 존재하는 화소들은 공간적으로 멀리 떨어진 화소로부터 예측되기 대문에 블록의 예측의 정확도가 떨어지는 문제점이 있다.Meanwhile, the conventional spatial intra prediction based coding method uses only a square block mode. This is because two-dimensional square transformations such as 4x4 and 8x8 transforms are used to increase the conversion efficiency. However, when only the square block mode is used, the pixels in the right and lower parts of the block are predicted from pixels far away from space, so the accuracy of the block prediction is inferior.

전술한 문제점을 해결하기 위해 본 발명은, 영상을 부호화하거나 복호화하는 데 있어서, 부호화하고자 하는 블록마다 예측 방향을 결정하는 방법을 달리하여 예측함으로써 예측의 정확도를 높여 영상의 부호화 효율을 향상시키는 데 주된 목적이 있다.In order to solve the above-described problems, the present invention, in encoding or decoding an image, is mainly used to improve the encoding efficiency of an image by increasing the accuracy of prediction by predicting by differently determining a method of determining a prediction direction for each block to be encoded. There is a purpose.

전술한 목적을 달성하기 위해 본 발명은, 영상의 현재 블록을 부호화하는 장치에 있어서, 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 생성되는 복수 개의 직사각 현재 블록을 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 출력하는 직사각 부호화부; 단계적으로 부호화되는 각 직사각 현재 블록 이전에 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값에 따라 각 직사각 현재 블록의 예측 방향을 변경하는 예측 방향 전환부; 현재 블록이 입력되면 정사각형 블록 단위로 부호화함으로써 정사각 부호화 비트스트림을 출력하는 정사각 부호화부; 및 직사각 부호화 비트스트림의 부호화 비용과 정사각 부호화 비트스트림의 부호화 비용을 계산하여 최소 부호화 비용을 갖는 비트스트림을 출력하는 부호화 선택부를 포함하는 것을 특징으로 하는 영상 부호화 장치를 제공한다.In order to achieve the above object, the present invention provides a device for encoding a current block of an image, wherein a rectangular encoded bitstream is encoded by stepwise encoding a plurality of rectangular current blocks generated by dividing a rectangular block by a unit when the current block is input. A rectangular encoder for outputting; A prediction direction switching unit for changing a prediction direction of each rectangular current block according to a coefficient value of a quantization frequency coefficient of a rectangular previous block coded before each rectangular current block coded stepwise; A square encoder for outputting a square encoded bitstream by encoding the current block in units of square blocks; And an encoding selector configured to calculate the encoding cost of the rectangular encoded bitstream and the encoding cost of the square encoded bitstream, and output a bitstream having a minimum encoding cost.

또한, 본 발명의 다른 목적에 의하면, 영상의 현재 블록을 부호화하는 방법에 있어서, 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 생성되는 복수 개의 직사각 현재 블록을 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 출력하는 직사각 부호화 단계; 단계적으로 부호화되는 각 직사각 현재 블록 이전에 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값에 따라 각 직사각 현재 블록의 예측 방향을 변경하는 예측 방향 전환 단계; 현재 블록이 입력되면 정사각형 블록 단위로 부호화함으로써 정사각 부호화 비트스트림을 출력하는 정사각 부호화 단계; 및 직사각 부호화 비트스트림의 부호화 비용과 정사각 부호화 비트스트림의 부호화 비용을 계산하여 최소 부호화 비용을 갖는 비트스트림을 출력하는 부호화 선택 단계를 포함하는 것을 특징으로 하는 영상 부호화 방법을 제공한다.According to another object of the present invention, in the method of encoding a current block of an image, when the current block is input, a rectangular encoded bitstream is output by stepwise encoding a plurality of rectangular current blocks generated by dividing the rectangular block into units. A rectangular encoding step; A prediction direction switching step of changing a prediction direction of each rectangular current block according to a coefficient value of a quantization frequency coefficient of a rectangular previous block coded before each rectangular current block coded stepwise; A square encoding step of outputting a square encoded bitstream by encoding the current block in units of square blocks; And an encoding selection step of calculating the encoding cost of the rectangular encoded bitstream and the encoding cost of the square encoded bitstream to output a bitstream having the minimum encoding cost.

또한, 본 발명의 또 다른 목적에 의하면, 영상을 복호화하는 장치에 있어서, 비트스트림으로부터 예측 모드에 대한 정보를 추출하는 예측 모드 추출부; 비트스트림을 복호화하여 양자화된 주파수 계수열을 추출하는 복호화부; 양자화된 주파수 계수열로부터 예측 방향 식별자를 추출하여 예측 모드에 따른 예측 방향을 변경하는 예측 방향 전환부; 양자화된 주파수 계수열을 이용하여 직사각형 블록 단위로 변경된 예측 방향에 따라 단계적으로 현재 블록을 복원하여 출력하는 직사각 복원부; 양자화된 주파수 계수열을 이용하여 정사각형 블록 단위로 예측 모드에 따른 예측 방향에 따라 현재 블록을 복원하여 출력하는 정사각 복원부; 및 비트스트림으로부터 비트스트림 식별자를 추출하고 비트스트림 식별자에 따라 복호화부로 하여금 양자화된 주파수 계수열을 직사각 복원부 및 정사각 복원부 중 하나로 출력하도 록 제어하는 비트스트림 식별자 추출부를 포함하는 것을 특징으로 하는 영상 복호화 장치를 제공한다.According to still another object of the present invention, there is provided an apparatus for decoding an image, comprising: a prediction mode extraction unit for extracting information about a prediction mode from a bitstream; A decoder which extracts a quantized frequency coefficient sequence by decoding the bitstream; A prediction direction switching unit which extracts a prediction direction identifier from the quantized frequency coefficient sequence and changes the prediction direction according to the prediction mode; A rectangular reconstruction unit for reconstructing and outputting the current block step by step according to the prediction direction changed in units of rectangular blocks using the quantized frequency coefficient sequence; A square restoring unit for restoring and outputting a current block according to a prediction direction according to a prediction mode in units of square blocks using a quantized frequency coefficient sequence; And a bitstream identifier extractor for extracting the bitstream identifier from the bitstream and controlling the decoder to output the quantized frequency coefficient sequence to one of a rectangular reconstructor and a square reconstructor according to the bitstream identifier. Provided is a decoding device.

또한, 본 발명의 또 다른 목적에 의하면, 영상을 복호화하는 방법에 있어서, 비트스트림으로부터 예측 모드에 대한 정보를 추출하는 예측 모드 추출 단계; 비트스트림을 복호화하여 양자화 주파수 계수열을 추출하는 복호화 단계; 양자화 주파수 계수열로부터 예측 방향 식별자를 추출하여 예측 모드에 따른 예측 방향을 변경하는 예측 방향 전환 단계; 비트스트림으로부터 비트스트림 식별자를 추출하는 비트스트림 식별자 추출 단계; 비트스트림 식별자에 따라 양자화 주파수 계수열을 이용하여 직사각형 블록 단위로 현재 블록을 복원하되, 변경된 예측 방향에 따라 단계적으로 현재 블록을 복원하여 출력하는 직사각 복원 단계; 및 비트스트림 식별자에 따라 양자화 주파수 계수열을 이용하여 정사각형 블록 단위로 현재 블록을 복원하되, 예측 모드에 따른 예측 방향에 따라 현재 블록을 복원하여 출력하는 정사각 복원 단계를 포함하는 것을 특징으로 하는 영상 복호화 방법을 제공한다.According to still another object of the present invention, there is provided a method of decoding an image, comprising: a prediction mode extraction step of extracting information on a prediction mode from a bitstream; Decoding a bitstream to extract a quantized frequency coefficient sequence; A prediction direction switching step of extracting a prediction direction identifier from the quantized frequency coefficient sequence and changing the prediction direction according to the prediction mode; Extracting a bitstream identifier from the bitstream; A rectangular reconstruction step of reconstructing the current block in units of rectangular blocks by using the quantized frequency coefficient sequence according to the bitstream identifier, and reconstructing and outputting the current block step by step according to the changed prediction direction; And a square reconstruction step of reconstructing the current block in units of square blocks by using the quantized frequency coefficient sequence according to the bitstream identifier, and reconstructing and outputting the current block according to the prediction direction according to the prediction mode. Provide a method.

또한, 본 발명의 또 다른 목적에 의하면, 영상 부호화를 위해 영상의 현재 블록을 예측할 때, 예측 방향을 전환하는 장치에 있어서, 현재 블록 이전에 부호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 현재 블록이 입력되면 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 현재 블록의 예측 방향으로서 결정하고, 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 복수 개의 예측 방향 후보의 부호화 비용을 계산하여 부호화 비용이 최소인 예측 방향을 현재 블록의 예측 방향으로 결정하는 것을 특징 으로 하는 예측 방향 전환 장치를 제공한다.Further, according to another object of the present invention, when predicting the current block of the image for image encoding, in the apparatus for switching the prediction direction, if the quantization frequency coefficient of the previous block coded before the current block is input and stored, When the current block is input, when the quantization frequency coefficients of the previous block are all '0', the reference prediction direction is determined as the prediction direction of the current block, and when one or more coefficients of the quantization frequency coefficients of the previous block are not '0', Provided is a prediction direction switching device, characterized in that the prediction direction of the minimum block is determined as the prediction direction of the current block by calculating the encoding cost of the plurality of prediction direction candidates.

또한, 본 발명의 또 다른 목적에 의하면, 영상 복호화를 위해 영상의 현재 블록을 예측할 때, 예측 방향을 전환하는 장치에 있어서, 현재 블록 이전에 복호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 현재 블록의 양자화 주파수 계수가 입력되면 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 현재 블록의 예측 방향으로서 결정하고, 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 현재 블록의 양자화 주파수 계수로부터 예측 방향 식별자를 추출하여 예측 방향 식별자에 의해 지시되는 예측 방향을 현재 블록의 예측 방향으로서 결정하는 것을 특징으로 하는 예측 방향 전환 장치를 제공한다.Further, according to another object of the present invention, when predicting the current block of the image for image decoding, in the apparatus for switching the prediction direction, if the quantization frequency coefficient of the previous block decoded before the current block is stored, When the quantization frequency coefficients of the current block are input, when the quantization frequency coefficients of the previous block are all '0', the reference prediction direction is determined as the prediction direction of the current block, and at least one coefficient of the quantization frequency coefficients of the previous block is '0'. Otherwise, the prediction direction switching apparatus is provided, wherein the prediction direction identifier is extracted from the quantization frequency coefficient of the current block to determine the prediction direction indicated by the prediction direction identifier as the prediction direction of the current block.

이상에서 설명한 바와 같이 본 발명에 의하면, 부호화하고자 하는 블록마다 예측 방향을 결정하는 방법을 달리하여 예측함으로써 예측의 정확도를 높여 영상의 부호화 효율을 향상시킬 수 있다.As described above, according to the present invention, by predicting by differently determining a prediction direction for each block to be encoded, it is possible to increase the accuracy of prediction and to improve the encoding efficiency of an image.

이하, 본 발명의 일부 실시예들을 예시적인 도면을 통해 상세하게 설명한다. 각 도면의 구성요소들에 참조부호를 부가함에 있어서, 동일한 구성요소들에 대해서는 비록 다른 도면상에 표시되더라도 가능한 한 동일한 부호를 가지도록 하고 있음에 유의해야 한다. 또한, 본 발명을 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상 세한 설명은 생략한다.Hereinafter, some embodiments of the present invention will be described in detail with reference to exemplary drawings. It should be noted that, in adding reference numerals to the constituent elements of the drawings, the same constituent elements are denoted by the same reference symbols as possible even if they are shown in different drawings. In addition, in describing the present invention, when it is determined that a detailed description of a related known configuration or function may obscure the gist of the present invention, the detailed description thereof will be omitted.

또한, 본 발명의 구성 요소를 설명하는 데 있어서, 제 1, 제 2, A, B, (a), (b) 등의 용어를 사용할 수 있다. 이러한 용어는 그 구성 요소를 다른 구성 요소와 구별하기 위한 것일 뿐, 그 용어에 의해 해당 구성 요소의 본질이나 차례 또는 순서 등이 한정되지 않는다. 어떤 구성 요소가 다른 구성요소에 "연결" 또는 "접속"된다고 기재된 경우, 그 구성 요소는 그 다른 구성요소에 직접적으로 연결되거나 또는 접속될 수 있지만, 각 구성 요소 사이에 또 다른 구성 요소가 "연결" 또는 "접속"될 수도 있다고 이해되어야 할 것이다.In describing the components of the present invention, terms such as first, second, A, B, (a), and (b) may be used. These terms are intended to distinguish the constituent elements from other constituent elements, and the terms do not limit the nature, order or order of the constituent elements. When a component is described as being "connected" or "connected" to another component, the component may be directly connected to or connected to that other component, but another component is "connected" between each component. It will be understood that "or" may be connected.

도 1은 통상적인 9 가지의 4x4 인트라 예측 모드를 나타내는 예시도이다.1 is an exemplary diagram showing nine conventional 4x4 intra prediction modes.

인트라 예측에는 인트라 4x4 예측, 인트라 16x16 예측 및 인트라 8x8 예측 등이 있는데, 각 인트라 예측에는 복수 개의 예측 모드를 포함하고 있다. 도 1에서는 인트라 4x4 예측에서의 9 가지 예측 모드를 도시하였다.Intra prediction includes intra 4x4 prediction, intra 16x16 prediction, and intra 8x8 prediction, and each intra prediction includes a plurality of prediction modes. 1 illustrates nine prediction modes in intra 4x4 prediction.

도 1을 참조하면, 인트라 4x4 예측에는, 수직(Vertical) 모드, 수평(Horizontal) 모드, DC(Direct Current) 모드, 대각선 왼쪽(Diagonal down-left) 모드, 대각선 오른쪽(Diagonal down-right), 수직 오른쪽(Vertical-right) 모드, 수평 아래쪽(Horizontal-down) 모드, 수직 왼쪽(Vertical-left) 및 수평 위쪽(Horizontal-up) 모드를 포함하는 9 가지의 예측 모드가 있다.Referring to FIG. 1, intra 4x4 prediction includes vertical mode, horizontal mode, direct current mode, diagonal down-left mode, diagonal down-right, and vertical. There are nine prediction modes, including the right-right mode, horizontal-down mode, vertical-left and horizontal-up modes.

도시하지는 않았지만, 인트라 8x8 예측에는 인트라 4x4 예측과 동일한 예측 모드가 있으며, 인트라 16x16 예측에는 수직(Vertical) 모드, 수평(Horizontal) 모드, DC(Direct Current) 모드 및 플래인(Plane) 모드를 포함하는 4 가지의 예측 모 드가 있다.Although not shown, intra 8x8 prediction has the same prediction mode as intra 4x4 prediction, and intra 16x16 prediction includes vertical mode, horizontal mode, direct current mode, and plane mode. There are four prediction modes.

도 2는 본 발명의 일 실시예에 따른 영상 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.2 is a block diagram schematically illustrating an electronic configuration of a video encoding apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 영상 부호화 장치(200)는 영상을 부호화하는 장치로서, 정사각 부호화부(210), 직사각 부호화부(220) 및 부호화 선택부(230)를 포함하여 구성될 수 있다. The image encoding apparatus 200 according to an embodiment of the present invention is an apparatus for encoding an image, and may include a square encoder 210, a rectangular encoder 220, and an encoding selector 230.

이러한 영상 부호화 장치(200)는 개인용 컴퓨터(PC: Personal Computer), 노트북 컴퓨터, 개인 휴대 단말기(PDA: Personal Digital Assistant), 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 이동통신 단말기(Mobile Communication Terminal) 등일 수 있으며, 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, 영상을 부호화하기 위한 각종 프로그램과 데이터를 저장하기 위한 메모리, 프로그램을 실행하여 연산 및 제어하기 위한 마이크로프로세서 등을 구비하는 다양한 장치를 의미한다.The image encoding apparatus 200 may be a personal computer (PC), a notebook computer, a personal digital assistant (PDA), a portable multimedia player (PMP), a PlayStation Portable ), A mobile communication terminal, and the like, and may be a communication device such as a communication modem for performing communication with various devices or wired / wireless communication networks, a memory for storing various programs for encoding an image and data, a program And a microprocessor for calculating and controlling the microprocessor.

정사각 부호화부(210)는 입력 영상의 현재 블록이 입력되면 정사각형 블록 단위로 부호화함으로써 정사각 부호화 비트스트림을 출력한다. 즉, 통상적인 동영상 부호화와 같이, 정해진 블록 모드에 따라 정사각형 블록 단위로 현재 블록을 예측하고 현재 블록에 대한 잔차 블록을 생성하여 잔차 블록을 변환, 양자화, 부호화함으로써 비트스트림을 출력하는데, 이와 같이 정사각형 블록 단위로 부호화되어 출력되는 비트스트림을 본 발명에서는 '정사각 부호화 비트스트림'이라 칭한다.When the current block of the input image is input, the square encoder 210 outputs a square encoded bitstream by encoding the data in a square block unit. That is, as in normal video encoding, a bitstream is output by predicting a current block in units of square blocks according to a predetermined block mode, generating a residual block for the current block, and transforming, quantizing, and encoding the residual block. A bitstream encoded and output in block units is called a 'square encoded bitstream' in the present invention.

직사각 부호화부(220)는 입력 영상의 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 출력한다. 즉, 통상적인 부호화와는 달리, 정해진 블록 모드에 따른 현재 블록을 현재 블록의 예측 방향에 따라 직사각형 블록 단위로 분할하고 각 직사각형 블록을 단계적으로 예측하고 그 잔차 블록을 변환, 양자화한 후 정사각형 블록으로 결합하고 스캔하여 부호화함으로써 비트스트림을 출력하는데, 이와 같이 직사각형 블록 단위로 단계적으로 부호화되어 출력되는 비트스트림을 본 발명에서는 '직사각 부호화 비트스트림'이라 칭한다.When the current block of the input image is input, the rectangular encoder 220 outputs a rectangular encoded bitstream by dividing the data into rectangular blocks in steps and encoding them in stages. That is, unlike conventional encoding, the current block according to the predetermined block mode is divided into rectangular block units according to the prediction direction of the current block, each rectangular block is predicted step by step, the residual block is transformed, quantized, and then squared into a square block. The bitstream is output by combining, scanning, and encoding the bitstream. The bitstream, which is encoded and output step by step in rectangular block units, is referred to as a rectangular encoded bitstream in the present invention.

부호화 선택부(230)는 직사각 부호화 비트스트림의 부호화 비용과 정사각 부호화 비트스트림의 부호화 비용을 계산하여 최소의 부호화 비용을 갖는 비트스트림을 출력한다. 즉, 부호화 선택부(230)는 정사각 부호화부(210)로부터 출력되는 정사각 부호화 비트스트림을 부호화하는 데에 따른 비용을 계산하고 직사각 부호화부(220)로부터 출력되는 직사각 부호화 비트스트림을 부호화하는 데에 따른 비용을 계산하여 각 비용을 비교함으로써 최소의 부호화 비용을 갖는 비트스트림을 출력한다.The encoding selector 230 calculates an encoding cost of the rectangular encoded bitstream and an encoding cost of the square encoded bitstream and outputs a bitstream having a minimum encoding cost. That is, the encoding selector 230 calculates the cost of encoding the square encoded bitstream output from the square encoder 210 and encodes the rectangular encoded bitstream output from the rectangular encoder 220. The bitstreams having the minimum encoding cost are output by calculating the cost accordingly and comparing the respective costs.

도 3은 본 발명의 일 실시예에 따른 정사각 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.3 is a block diagram schematically illustrating an electronic configuration of a square encoding apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 정사각 부호화 장치는 도 2에서는 정사각 부호화부(210)로 구현될 수 있으므로, 이하에서는 정사각 부호화부(210)라 칭한다. 본 발명의 일 실시예에 따른 정사각 부호화부(210)는 정사각 감산부(310), 정사각 변 환부(320), 정사각 양자화부(330), 정사각 스캔부(340), 정사각 부호화부(350), 정사각 역 양자화부(360), 정사각 역 변환부(370), 정사각 가산부(380) 및 정사각 예측부(390)를 포함하여 구성된다.Since the square encoding apparatus according to an embodiment of the present invention may be implemented by the square encoder 210 in FIG. 2, hereinafter, the square encoder 210 is referred to as a square encoder 210. The square encoder 210 according to an embodiment of the present invention includes a square subtractor 310, a square converter 320, a square quantizer 330, a square scan unit 340, a square encoder 350, A square inverse quantizer 360, a square inverse transformer 370, a square adder 380, and a square predictor 390 are included.

정사각 감산부(310)는 입력 영상의 현재 블록에서 정사각 예측부(380)에 의해 예측된 예측 블록을 감산하여 잔차 블록을 생성하고 출력한다. 즉, 감산부(310)는 현재 블록의 각 화소의 원 화소값(Original Pixel Value)과 정사각 예측부(380)에 의해 예측된 예측 블록의 각 화소의 예측 화소값(Predicted Pixel Value)을 감산하여 화소값의 차이의 잔차 신호(Residual Signal)를 잔차 블록으로 생성한다.The square subtractor 310 generates a residual block by subtracting the prediction block predicted by the square predictor 380 from the current block of the input image. That is, the subtractor 310 subtracts the original pixel value of each pixel of the current block and the predicted pixel value of each pixel of the prediction block predicted by the square predictor 380. A residual signal of the difference between pixel values is generated as a residual block.

정사각 변환부(320)는 잔차 블록을 주파수 영역으로 변환하여 주파수 계수를 갖는 잔차 블록을 생성한다. 여기서, 정사각 변환부(320)는 이산 코사인 변환(DCT: Discrete Cosine Transform) 기반 변환 또는 하다마다 변환(Hadamard Transform) 등을 이용할 수도 있지만, 반드시 이에 한정되지 않고 DCT 변환을 개량 및 변형한 다양한 변환 기법을 이용하여 잔차 신호를 주파수 영역으로 변환할 수 있다.The square converter 320 converts the residual block into a frequency domain to generate a residual block having a frequency coefficient. Here, the square transform unit 320 may use a Discrete Cosine Transform (DCT) -based transform or a Hadamard Transform (DCT). However, the square transform unit 320 is not necessarily limited thereto. The residual signal can be converted into the frequency domain by using.

정사각 양자화부(330)는 정사각 변환부(320)에서 변환된 잔차 블록을 양자화(Quantization)하여 양자화 주파수 계수를 갖는 잔차 블록을 생성한다. 이러한 양자화 방법에는 데드존 균일 경계 양자화(DZUTQ: Dead Zone Uniform Threshold Quantization) 또는 양자화 가중치 매트릭스(Quantization Weighted Matrix) 등을 이용할 수 있지만 이를 개량한 양자화 등 다양한 양자화 방법을 이용할 수 있다.The square quantizer 330 quantizes the residual block transformed by the square transformer 320 to generate a residual block having a quantization frequency coefficient. Dead zone uniform threshold quantization (DZUTQ) or quantization weighted matrix (DZUTQ) may be used as the quantization method, but various quantization methods such as quantization improved therefrom may be used.

정사각 스캔부(340)는 정사각 양자화부(330)에서 양자화된 잔차 블록의 양자화 주파수 계수를 지그재그 스캔과 같은 다양한 스캔 방식을 이용하여 스캔함으로 써 양자화 주파수 계수열을 생성한다.The square scan unit 340 generates a quantized frequency coefficient sequence by scanning the quantized frequency coefficients of the residual block quantized by the square quantizer 330 using various scan methods such as zigzag scan.

정사각 부호화부(350)는 양자화된 잔차 블록을 비트스트림으로 부호화한다. 즉, 정사각 부호화부(350)는 정사각 스캔부(340)에 의해 스캔되어 생성된 양자화 주파수 계수열을 부호화하여 비트스트림을 생성한다. 또한, 정사각 부호화부(350)는 양자화된 잔차 블록뿐만 아니라 정사각 예측부(390)에서 결정한 예측 모드 또는 예측 방향에 대한 정보를 잔차 블록과 함께 비트스트림으로 부호화할 수 있다. 이러한 부호화 기술로서는 엔트로피 부호화(Entropy Encoding) 기술이 사용될 수 있으나, 반드시 이에 한정하지 않고 다른 다양한 부호화 기술이 사용될 수도 있을 것이다. 정사각 부호화부(350)에서 출력되는 비트스트림을 본 발명에서는 정사각 부호화 비트스트림이라 한다.The square encoder 350 encodes the quantized residual block into a bitstream. That is, the square encoder 350 encodes the quantized frequency coefficient string generated by the square scan unit 340 to generate a bitstream. In addition, the square encoder 350 may encode not only the quantized residual block but also information on the prediction mode or the prediction direction determined by the square predictor 390 together with the residual block in a bitstream. As such an encoding technique, entropy encoding technology may be used, but various other encoding techniques may be used without being limited thereto. The bit stream output from the square encoder 350 is called a square encoded bit stream in the present invention.

정사각 역 양자화부(360)는 양자화된 잔차 블록을 역 양자화(Inverse Quantization)하여 역 양자화된 잔차 블록을 생성한다. 즉, 정사각 역 양자화부(360)는 양자화된 잔차 블록의 양자화 주파수 계수를 역 양자화하여 역 양자화된 주파수 계수를 갖는 잔차 블록을 생성한다.The square inverse quantizer 360 inverse quantizes the quantized residual block to generate an inverse quantized residual block. That is, the square inverse quantizer 360 inverse quantizes the quantized frequency coefficients of the quantized residual block to generate a residual block having inverse quantized frequency coefficients.

정사각 역 변환부(370)는 역 양자화된 잔차 블록을 역 변환(Inverse Transform)하여 역 변환된 잔차 블록을 생성한다. 즉, 정사각 역 변환부(370)는 역 양자화된 잔차 블록의 역 양자화 주파수 계수를 시간 영역으로 역 변환하여 화소값을 갖는 역 변환된 잔차 블록을 생성한다.The square inverse transform unit 370 generates an inverse transformed residual block by performing an inverse transform on the inverse quantized residual block. That is, the square inverse transform unit 370 inversely transforms the inverse quantization frequency coefficients of the inverse quantized residual block into the time domain to generate an inverse transformed residual block having pixel values.

정사각 가산부(380)는 정사각 예측부(390)에 의해 예측된 예측 블록과 정사각 역 변환부(370)에 의해 역 변환된 잔차 블록을 가산하여 현재 블록을 복원하고 복원된 현재 블록을 정사각 예측부(390)로 출력한다.The square adder 380 reconstructs the current block by adding the prediction block predicted by the square predictor 390 and the residual block inversely transformed by the square inverse transform unit 370, and restores the restored current block to the square predictor. Output to (390).

정사각 예측부(390)는 현재 블록을 예측하여 예측 블록을 생성한다. 즉, 정사각 예측부(390)는 정해진 블록 모드와 예측 모드에 따라서 영상에서 부호화하고자 하는 현재 블록의 각 화소의 화소값(Pixel Value)을 예측함으로써 예측 화소값(Predicted Pixel Value)을 각 화소의 화소값으로 갖는 예측 블록을 생성한다. 이때, 현재 블록의 각 화소값을 예측하는 데에는 이전에 이미 부호화되고 복호화되어 복원된 이전 블록의 각 화소값을 이용하는데, 현재 블록 이전에 정사각 가산부(380)로부터 수신한 복원된 블록을 이용한다.The square predictor 390 generates a prediction block by predicting the current block. That is, the square predictor 390 predicts a pixel value of each pixel of a current block to be encoded in an image according to a predetermined block mode and a prediction mode, thereby predicting a pixel value of each pixel. Generate a predictive block with a value. In this case, each pixel value of a previous block that has been previously encoded, decoded, and reconstructed is used to predict each pixel value of the current block, and a reconstructed block received from the square adder 380 before the current block is used.

도 4는 본 발명의 일 실시예에 따른 직사각 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.4 is a block diagram schematically illustrating an electronic configuration of a rectangular encoding apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 직사각 부호화 장치는 도 2에서는 직사각 부호화부(220)로 구현될 수 있으므로, 이하에서는 직사각 부호화부(220)라 칭한다. 본 발명의 일 실시예에 따른 직사각 부호화부(220)는 블록 분할부(410), 직사각 감산부(420), 직사각 변환부(430), 직사각 양자화부(440), 직사각 스캔부(450), 직사각 부호화부(460), 직사각 역 양자화부(470), 직사각 역 변환부(480), 직사각 가산부(490) 및 직사각 예측부(492)를 포함하여 구성된다.Since the rectangular encoding apparatus according to an embodiment of the present invention may be implemented by the rectangular encoder 220 in FIG. 2, the rectangular encoder 220 will be referred to below. The rectangular encoder 220 according to an embodiment of the present invention includes a block divider 410, a rectangular subtractor 420, a rectangular transform unit 430, a rectangular quantizer 440, a rectangular scan unit 450, The rectangular encoder 460 includes a rectangular inverse quantizer 470, a rectangular inverse transform unit 480, a rectangular adder 490, and a rectangular predictor 492.

블록 분할부(410)는 입력 영상의 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 복수 개의 직사각 현재 블록을 출력한다. 여기서, 현재 블록은 블록 모드와 부호화 모드에 따라 정사각형의 블록으로 결정되는데, 블록 분할부(410)는 인트라 예측에서 현재 블록의 화소를 더욱 가까운 인접 화소로부터 예측하여 예측 의 효율을 높이기 위해, 현재 블록을 직사각형 블록으로 분할하고 분할된 각 직사각 현재 블록을 단계적으로 예측할 수 있도록 한다.The block dividing unit 410 outputs a plurality of rectangular current blocks by dividing the current block of the input image by rectangular blocks. Here, the current block is determined to be a square block according to a block mode and an encoding mode. The block dividing unit 410 predicts a pixel of the current block from a neighboring pixel closer in intra prediction to increase the efficiency of prediction. Is divided into rectangular blocks, and each divided rectangular current block can be predicted step by step.

또한, 블록 분할부(410)는 정사각형의 현재 블록을 복수 개의 직사각형의 블록으로 분할하는데 있어서, 현재 블록의 예측 모드에 따른 예측 방향에 따라 직사각형의 블록 크기를 결정할 수 있다. 즉, 블록 분할부(410)에 의해 분할되는 직사각형 현재 블록은 Nx1 블록 N개, Nx2 블록 N/2개, 1xN 블록 N개, 2xN 블록 N/2개 등이 될 수 있다. 예를 들어, 현재 블록의 블록 모드가 NxN 블록이라고 가정하면, 예측 모드에 따른 예측 방향이 수직 방향인 경우 현재 블록은 Nx1 블록 N개 등으로 분할되고, 예측 방향이 수평 방향인 경우 1xN 블록 N개 등으로 분할될 수 있으며, 예측 모드가 DC 모드인 경우 1x1 블록, 4x4 블록과 같이 MxM 블록 N/M개 등으로 분할될 수 있다.Also, in dividing a square current block into a plurality of rectangular blocks, the block dividing unit 410 may determine a rectangular block size according to a prediction direction according to a prediction mode of the current block. That is, the rectangular current blocks divided by the block divider 410 may be Nx1 blocks, Nx2 blocks N / 2, 1xN blocks N, 2xN blocks N / 2, and the like. For example, assuming that the block mode of the current block is an NxN block, if the prediction direction according to the prediction mode is vertical, the current block is divided into Nx1 blocks, N, etc., and when the prediction direction is horizontal, N 1xN blocks The prediction mode may be divided into N / M blocks, such as 1x1 blocks and 4x4 blocks, when the prediction mode is a DC mode.

직사각 감산부(420)는 블록 분할부(410)에 의해 분할된 복수 개의 직사각 현재 블록에서 직사각 예측부(492)에 의해 예측된 복수 개의 직사각 예측 블록을 감산하여 복수 개의 직사각 잔차 블록을 생성한다.The rectangular subtractor 420 subtracts a plurality of rectangular prediction blocks predicted by the rectangular predictor 492 from the plurality of rectangular current blocks divided by the block divider 410 to generate a plurality of rectangular residual blocks.

직사각 변환부(430)는 감산부(420)에 의해 생성된 복수 개의 직사각 잔차 블록을 주파수 영역으로 변환한다. 즉, 직사각 변환부(430)는 DCT 기반 변환 등을 이용하여 직사각 잔차 블록의 각 화소값을 주파수 영역으로 변환하여 주파수 계수를 갖는 잔차 블록을 생성한다. 이때, 직사각형의 형태의 잔차 블록의 각 화소값을 주파수 변환하는 것은 행렬 변환 등을 통해 변환을 수행할 수 있다.The rectangular transform unit 430 converts the plurality of rectangular residual blocks generated by the subtractor 420 into the frequency domain. That is, the rectangular transform unit 430 generates a residual block having a frequency coefficient by converting each pixel value of the rectangular residual block into a frequency domain by using a DCT-based transform or the like. In this case, the frequency conversion of each pixel value of the rectangular residual block may be performed by matrix transformation or the like.

직사각 양자화부(440)는 직사각 변환부(430)에 의해 변환된 복수 개의 직사 각 잔차 블록을 양자화한다. 즉, 직사각 양자화부(440)는 복수 개의 직사각 잔차 블록의 주파수 계수를 양자화하여 양자화 주파수 계수를 갖는 잔차 블록을 생성한다.The rectangular quantization unit 440 quantizes the plurality of rectangular residual blocks transformed by the rectangular transform unit 430. That is, the rectangular quantization unit 440 quantizes frequency coefficients of the plurality of rectangular residual blocks to generate a residual block having quantized frequency coefficients.

직사각 스캔부(450)는 직사각 양자화부(440)에서 양자화된 복수 개의 잔차 블록을 결합하여 양자화된 정사각 잔차 블록을 생성하고 양자화 주파수 계수를 스캔하여 양자화 주파수 계수열을 생성한다. 즉, 직사각 스캔부(450)는 각각 양자화된 복수 개의 잔차 블록을 현재 블록의 블록 모드와 예측 모드의 예측 방향에 따라 결합하여 정사각형 형태의 잔차 블록을 생성하고, 정사각형 형태의 잔차 블록의 각 양자화 주파수 계수들을 스캐닝 방법에 따라 스캐닝하여 양자화 주파수 계수열을 생성한다.The rectangular scan unit 450 generates a quantized square residual block by combining the plurality of residual blocks quantized by the rectangular quantization unit 440, and generates a quantized frequency coefficient sequence by scanning a quantized frequency coefficient. That is, the rectangular scan unit 450 combines the plurality of quantized residual blocks according to the prediction direction of the block mode and the prediction mode of the current block to generate a square residual block, and each quantization frequency of the square residual block. The coefficients are scanned according to a scanning method to generate a quantized frequency coefficient sequence.

직사각 부호화부(460)는 직사각 스캔부(450)에 의해 생성된 양자화 주파수 계수열을 부호화하여 비트스트림을 생성한다. 즉, 직사각 부호화부(460)는 양자화 주파수 계수열들을 엔트로피 부호화(Entropy Encoding) 등의 다양한 부호화 방법을 이용하여 부호화함으로써 비트스트림을 생성한다. 이때, 직사각 부호화부(460)는 현재 블록의 예측 모드를 추가로 부호화할 수도 있다.The rectangular encoder 460 generates a bitstream by encoding the quantized frequency coefficient sequence generated by the rectangular scan unit 450. That is, the rectangular encoder 460 generates a bitstream by encoding the quantized frequency coefficient sequences by using various encoding methods such as entropy encoding. In this case, the rectangular encoder 460 may further encode a prediction mode of the current block.

이와 같이 도 5를 통해 전술한 직사각 부호화 장치가 입력 영상의 현재 블록을 부호화 방법을 설명하면, 직사각 부호화 장치는 입력 영상의 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 복수 개의 직사각 현재 블록을 출력하고, 복수 개의 직사각 현재 블록을 단계적으로 예측하여 복수 개의 직사각 예측 블록을 출력하며, 복수 개의 직사각 현재 블록에서 복수 개의 직사각 예측 블록을 감산하 여 복수 개의 직사각 잔차 블록을 생성하며, 복수 개의 직사각 잔차 블록을 주파수 영역으로 변환하고 변환된 복수 개의 직사각 잔차 블록을 양자화하며, 양자화된 복수 개의 직사각 잔차 블록을 결합하여 양자화된 정사각 잔차 블록을 생성하고 정사각 잔차 블록의 양자화 주파수 계수를 스캔하여 양자화 주파수 계수열을 생성한 후, 양자화 주파수 계수열을 부호화하여 비트스트림을 생성한다.As described above, when the rectangular encoding apparatus described above encodes the current block of the input image, the rectangular encoding apparatus outputs a plurality of rectangular current blocks by dividing the current block of the input image into rectangular block units. Predicting a plurality of rectangular current blocks stepwise to output a plurality of rectangular prediction blocks, subtracting a plurality of rectangular prediction blocks from the plurality of rectangular current blocks to generate a plurality of rectangular residual blocks, and generating a plurality of rectangular residual blocks Convert to the frequency domain and quantize the transformed rectangular residual blocks, combine the quantized rectangular residual blocks to generate a quantized square residual block, and generate quantized frequency coefficient sequences by scanning the quantized frequency coefficients of the square residual block Quantization frequency meter Encoding the heat to generate a bitstream.

도 5는 본 발명의 일 실시예에 따른 부호화 선택 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.5 is a block diagram schematically illustrating an electronic configuration of an encoding selection apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 부호화 선택 장치는 도 2에서는 부호화 선택부(230)로 구현될 수 있으므로, 이하에서는 부호화 선택부(230)라 칭한다. 본 발명의 일 실시예에 따른 부호화 선택부(230)는 비트스트림 선택부(510) 및 비트스트림 식별자 삽입부(520)를 포함하여 구성된다.Since the encoding selecting apparatus according to the embodiment of the present invention may be implemented by the encoding selecting unit 230 in FIG. 2, the encoding selecting unit 230 will be referred to below. The encoding selector 230 according to an embodiment of the present invention includes a bitstream selector 510 and a bitstream identifier inserter 520.

비트스트림 선택부(510)는 직사각 부호화부(460)로부터 직사각 부호화 비트스트림을 수신하고 정사각 부호화부(350)로부터 정사각 부호화 비트스트림을 수신하면, 직사각 부호화 효율과 정사각 부호화 효율을 계산하여 더 큰 부호화 효율을 갖는 부호화에 따른 비트스트림을 출력한다. 여기서, 부호화 효율은 부호화 비용으로서 계산될 수 있으며, 부호화 비용이 최소인 부호화가 부호화 효율이 더 큰 부호화로 결정될 수 있다.When the bitstream selector 510 receives the rectangular encoded bitstream from the rectangular encoder 460 and receives the square encoded bitstream from the square encoder 350, the bitstream selector 510 calculates the rectangular encoding efficiency and the square encoding efficiency to obtain a larger encoding. Output a bitstream according to encoding with efficiency. In this case, the encoding efficiency may be calculated as an encoding cost, and an encoding having a minimum encoding cost may be determined as an encoding having a higher encoding efficiency.

비트스트림 식별자 삽입부(520)는 비트스트림 선택부(510)에 의해 출력되는 비트스트림을 식별하기 위한 식별자를 생성하여 비트스트림 선택부(510)에서 출력되는 비트스트림에 삽입한다.The bitstream identifier inserter 520 generates an identifier for identifying the bitstream output by the bitstream selector 510 and inserts the identifier into the bitstream output from the bitstream selector 510.

도 6은 본 발명의 일 실시예에 따른 영상 부호화 방법을 설명하기 위한 순서도이다.6 is a flowchart illustrating an image encoding method according to an embodiment of the present invention.

영상 부호화 장치(200)는 부호화하고자 하는 입력 영상의 현재 블록을 그대로 정사각형 블록 단위로 부호화함으로써 정사각 부호화 비트스트림을 생성하고(S610), 현재 블록을 직사각형 블록 단위로 분할하여 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 생성한다(S620).The image encoding apparatus 200 generates a square encoded bitstream by encoding the current block of the input image to be encoded in a square block unit as it is (S610), and divides the current block into rectangular block units to encode the rectangular encoded bit stepwise. A stream is generated (S620).

정사각 비트스트림과 직사각 비트스트림이 생성되면, 영상 부호화 장치(200)는 정사각 부호화 비트스트림의 부호화 효율을 계산하고 직사각 부호화 비트스트림의 부호화 효율을 계산하여 부호화 효율이 큰 부호화 비트스트림을 출력한다(S630). 여기서, 부호화 효율은 각 부호화 비트스트림을 부호화하는 데 소요되는 부호화 비용이 될 수 있으며, 부호화 비용이 작으면 부호화 효율을 큰 것으로 결정할 수 있다. 또한, 영상 부호화 장치(200)는 부호화 효율이 큰 비트스트림을 출력하면서 영상 복호화 장치에서 해당 비트스트림이 정사각 부호화를 이용하여 부호화된 비트스트림인지 또는 직사각 부호화를 이용하여 부호화된 비트스트림인지 여부를 식별할 수 있도록 비트스트림 식별자를 비트스트림에 삽입하여 출력할 수 있다.When the square bitstream and the rectangular bitstream are generated, the image encoding apparatus 200 calculates the encoding efficiency of the square encoded bitstream and calculates the encoding efficiency of the rectangular encoded bitstream to output an encoded bitstream having high encoding efficiency (S630). ). Here, the encoding efficiency may be an encoding cost for encoding each encoded bitstream, and when the encoding cost is small, the encoding efficiency may be determined to be large. In addition, the image encoding apparatus 200 identifies whether the corresponding bitstream is a bitstream encoded using square encoding or a bitstream encoded using rectangular encoding while outputting a bitstream having high encoding efficiency. The bitstream identifier may be inserted into the bitstream and output.

도 7은 본 발명의 일 실시예에 따른 비트스트림 선택 과정을 설명하기 위한 순서도이다.7 is a flowchart illustrating a bitstream selection process according to an embodiment of the present invention.

도 6을 통해 전술한 본 발명의 일 실시예에 따른 영상 부호화 방법에서, 단계 S630과 같이 부호화 효율이 큰 비트스트림을 출력하는 단계는 도 7에 나타낸 바와 같은 과정을 통해 수행될 수 있다.In the image encoding method according to the embodiment of the present invention described above with reference to FIG. 6, the step of outputting a bitstream having high encoding efficiency as in step S630 may be performed through the process as illustrated in FIG. 7.

영상 부호화 장치(200)의 부호화 선택부(230)는 정사각 부호화 비트스트림과 직사각 부호화 비트스트림의 부호화 효율을 계산하기 위해, 정사각 부호화 비트스트림의 부호화 비용과 직사각 부호화 비트스트림의 부호화 비용을 계산한다(S710). 여기서, 부호화 비용은 율-왜곡 비용(RDcost: Rate-Distortion Cost)이 될 수 있지만, 다른 부호화 비용이 사용될 수 있다.The encoding selector 230 of the image encoding apparatus 200 calculates the encoding cost of the square encoded bitstream and the encoding cost of the rectangular encoded bitstream in order to calculate the encoding efficiency of the square encoded bitstream and the rectangular encoded bitstream ( S710). Here, the coding cost may be a rate-distortion cost (RDcost), but other coding costs may be used.

부호화 비용을 계산한 영상 부호화 장치(200)는 직사각 부호화 비용의 부호화 비용과 정사각 부호화 비트스트림의 부호화 비용을 비교하여(S720), 직사각 부호화 비트스트림의 부호화 비용이 정사각 부호화 비트스트림의 부호화 비용 보다 작은 경우에는 직사각 부호화 비트스트림을 출력한다(S730).The video encoding apparatus 200 having calculated the encoding cost compares the encoding cost of the rectangular encoding cost and the encoding cost of the square encoding bitstream (S720), so that the encoding cost of the rectangular encoding bitstream is smaller than that of the square encoding bitstream. In the case where the rectangular encoded bitstream is output (S730).

또한, 영상 부호화 장치(200)는 직사각 부호화 비트스트림으로 부호화된 양자화 주파수 계수열의 양자화 주파수 계수가 모두 '0'인지 여부를 확인하여(S740), 양자화 주파수 계수 중 적어도 하나 이상이 '0'이 아닌 경우에는 비트스트림 식별자를 '1'로서 생성하고 직사각 부호화 비트스트림과 함께 비트스트림 식별자를 출력하고(S750), 양자화 주파수 계수가 모두 '0'인 경우에는 비트스트림 식별자를 생성하고 출력하지 않을 수 있다. 즉, 해당 비트스트림의 양자화 주파수 계수가 모두 '0'인 경우에는 영상 복호화 장치에서 직사각 부호화 비트스트림과 정사각 부호화 비트스트림을 모두 정사각형 블록 단위로 복호화하는 통상적인 복호화를 통해 복호화할 수 있으므로 비트스트림 식별자를 출력하지 않으며, 그를 통해, 비트스트림 식별자를 위한 비트를 절약할 수 있다.In addition, the image encoding apparatus 200 determines whether all of the quantization frequency coefficients of the quantized frequency coefficient sequence encoded by the rectangular encoded bitstream are all '0' (S740), so that at least one or more of the quantization frequency coefficients is not '0'. In this case, the bitstream identifier may be generated as '1' and the bitstream identifier is output together with the rectangular encoded bitstream (S750). If the quantization frequency coefficients are all '0', the bitstream identifier may not be generated and output. . That is, when the quantization frequency coefficients of the corresponding bitstream are all '0', since the video decoding apparatus can decode the rectangular coded bitstream and the square coded bitstream by square block units through normal decoding, the bitstream identifier can be decoded. Does not output, thereby saving bits for the bitstream identifier.

또한, 영상 부호화 장치(200)는 단계 S720의 비교 결과, 직사각 부호화 비트 스트림의 부호화 비용이 정사각 부호화 비트스트림의 부호화 비용 보다 크거나 같은 경우에는 정사각 부호화 비트스트림을 출력한다(S760). 또한, 정사각 부호화 비트스트림으로 부호화된 양자화 주파수 계수열의 양자화 주파수 계수가 모두 '0'인지 여부를 확인하여(S770), 양자화 주파수 계수 중 적어도 하나 이상이 '0'이 아닌 경우에는 비트스트림 식별자를 '0'로서 생성하고 정사각 부호화 비트스트림과 함께 비트스트림 식별자를 출력하고(S780), 양자화 주파수 계수가 모두 '0'인 경우에는 비트스트림 식별자를 생성하고 출력하지 않을 수 있다. 즉, 해당 비트스트림의 양자화 주파수 계수가 모두 '0'인 경우에는 영상 복호화 장치에서 직사각 부호화 비트스트림과 정사각 부호화 비트스트림을 모두 정사각형 블록 단위로 복호화하는 통상적인 복호화를 통해 복호화할 수 있으므로 비트스트림 식별자를 출력하지 않으며, 그를 통해, 비트스트림 식별자를 위한 비트를 절약할 수 있다.In addition, when the encoding cost of the rectangular encoded bit stream is greater than or equal to the encoding cost of the square encoded bit stream, the image encoding apparatus 200 outputs the square encoded bit stream (S760). In addition, it is checked whether the quantization frequency coefficients of the quantized frequency coefficient strings encoded with the square encoded bitstream are all '0' (S770). When at least one or more of the quantization frequency coefficients is not '0', the bitstream identifier is' It generates as 0 'and outputs the bitstream identifier together with the square encoded bitstream (S780). If the quantization frequency coefficients are all' 0 ', the bitstream identifier may not be generated and output. That is, when the quantization frequency coefficients of the corresponding bitstream are all '0', since the video decoding apparatus can decode the rectangular coded bitstream and the square coded bitstream by square block units through normal decoding, the bitstream identifier can be decoded. Does not output, thereby saving bits for the bitstream identifier.

도 8은 본 발명의 일 실시예에 따른 직사각 현재 블록을 나타낸 예시도이다.8 is an exemplary view showing a rectangular current block according to an embodiment of the present invention.

도 8에서는 현재 블록의 블록 모드가 4x4 블록 모드라고 가정하고, 현재 블록을 그 예측 모드에 따라 직사각형 블록 단위로 분할하여 생성되는 직사각 현재 블록을 예시적으로 나타내었다.In FIG. 8, it is assumed that the block mode of the current block is a 4x4 block mode, and the rectangular current block generated by dividing the current block into rectangular block units according to the prediction mode is exemplarily illustrated.

현재 블록의 예측 모드가 수평 모드인 경우 직사각 현재 블록은 도시한 바와 같이, 1x4 크기의 직사각 현재 블록으로 분할되고, 현재 블록의 예측 모드가 수직 모드인 경우 4x1 크기의 직사각 현재 블록으로 분할되며, 현재 블록의 예측 모드가 대각선 오른쪽 모드인 경우 수직 모드와 유사하게 4x1 크기의 직사각 현재 블록으로 분할된다.When the prediction mode of the current block is the horizontal mode, the rectangular current block is divided into a rectangular current block of size 1x4 as shown, and when the prediction mode of the current block is the vertical mode, the rectangular current block is divided into a rectangular current block of size 4x1. When the prediction mode of the block is the diagonal right mode, the block is divided into rectangular current blocks having a size of 4x1 similar to the vertical mode.

도 8에서 각 직사각 현재 블록 내에 있는 P0 *(m) (m = 0, 1, 2, 3)은 직사각 예측부(492)에 의해 예측되는 예측 화소를 나타내고, Pn(m) (m = 0, 1, 2, 3, n = 0, 1, …, N)은 예측 방향에 따라 직사각 현재 블록 이전에 부호화된 화소들을 나타낸다.In FIG. 8, P 0 * (m) (m = 0, 1, 2, 3) in each rectangular current block represents a prediction pixel predicted by the rectangular prediction unit 492, and P n (m) (m = 0, 1, 2, 3, n = 0, 1, ..., N) represent pixels encoded before the rectangular current block according to the prediction direction.

직사각 예측부(492)는 직사각 현재 블록을 예측하여 직사각 예측 블록을 생성할 때, 수학식 1과 같이 직사각 예측 블록의 각 화소를 예측 화소값을 계산할 수 있다.When the rectangular prediction unit 492 generates a rectangular prediction block by predicting the rectangular current block, the rectangular prediction unit 492 may calculate a predicted pixel value of each pixel of the rectangular prediction block as shown in Equation (1).

Figure 112008063258039-pat00001
Figure 112008063258039-pat00001

여기서, αn은 사용자에 의해서 조정될 수 있는 화소 가중치이다.Where n is the pixel weight that can be adjusted by the user.

도 9는 본 발명의 일 실시예에 따라 직사각 예측부가 단계적 인트라 예측을 수행하는 과정을 설명하기 위한 예시도이다.9 is an exemplary diagram for describing a process of performing a stepped intra prediction by the rectangular prediction unit according to an embodiment of the present invention.

도 9에서는 수학식 1에서 N=1이고, α1=1이며, 예측 모드가 수평 모드인 경우, 4x4 크기의 현재 블록을 복수 개의 직사각 현재 블록으로 분할하여 단계적으로 예측하는 과정을 나타내었다.In FIG. 9, when N = 1, α 1 = 1, and the prediction mode is a horizontal mode, a process of predicting stepwise by dividing a 4 × 4 current block into a plurality of rectangular current blocks is shown.

도 9에 나타낸 바와 같이, 첫 번째 단계에서는 이전에 부호화되고 복원된 직사각 이전 블록의 화소 A', B', C', D'를 이용하여 현재 블록의 첫번째 직사각 현재 블록의 화소 P11, P21, P31, P41을 예측하고, 그 잔차 신호를 가지는 직사각 잔 차 블록에 대해 부호화하고 복원하여 직사각 복원 블록을 생성한다. 직사각 복원 블록은 P11', P21', P31', P41'의 화소를 갖는다.As shown in FIG. 9, in the first step, pixels P11, P21, and P31 of the first rectangular current block of the current block using pixels A ', B', C ', and D' of the previously encoded rectangular reconstructed block. , P41 is predicted, and a rectangular reconstruction block is generated by encoding and reconstructing a rectangular residual block having the residual signal. The rectangular recovery block has pixels of P11 ', P21', P31 ', and P41'.

두 번째 단계에서는 이전에 부호화되고 복원된 직사각 이전 블록의 화소 P11', P21', P31', P41'를 이용하여 현재 블록의 두 번째 직사각 현재 블록인 화소 P12, P22, P32, P42를 예측하고, 그 잔차 신호를 가지는 직사각 잔차 블록에 대해 부호화하고 복원하여 직사각 복원 블록을 생성한다. 직사각 복원 블록은 P12', P22', P32', P42'의 화소를 갖는다.In the second step, pixels P12, P22, P32, and P42, which are the second rectangular current blocks of the current block, are predicted using the pixels P11 ', P21', P31 ', and P41' of the previously encoded rectangular block. A rectangular reconstruction block is generated by encoding and reconstructing a rectangular residual block having the residual signal. The rectangular recovery block has pixels of P12 ', P22', P32 ', and P42'.

세 번째 단계에서는 이전에 부호화되고 복원된 직사각 이전 블록의 화소 P12', P22', P32', P42'를 이용하여 현재 블록의 세 번째 직사각 현재 블록인 화소 P13, P23, P33, P43를 예측하고, 그 잔차 신호를 가지는 직사각 잔차 블록에 대해 부호화하고 복원하여 직사각 복원 블록을 생성한다. 직사각 복원 블록은 P13', P23', P33', P43'의 화소를 갖는다.In the third step, pixels P13, P23, P33, and P43, which are the third rectangular current block of the current block, are predicted using the pixels P12 ', P22', P32 ', and P42 of the previously encoded rectangular block. A rectangular reconstruction block is generated by encoding and reconstructing a rectangular residual block having the residual signal. The rectangular recovery block has pixels of P13 ', P23', P33 ', and P43'.

네 번째 단계에서는 이전에 부호화되고 복원된 직사각 이전 블록의 화소 P13', P23', P33', P43'를 이용하여 현재 블록의 네 번째 직사각 현재 블록인 화소 P14, P24, P34, P44를 예측하고, 그 잔차 신호를 가지는 직사각 잔차 블록에 대해 부호화하고 복원하여 직사각 복원 블록을 생성한다. 직사각 복원 블록은 P14', P24', P34', P44'의 화소를 갖는다.In the fourth step, pixels P14, P24, P34, and P44, which are the fourth rectangular current block of the current block, are predicted using the pixels P13 ', P23', P33 ', and P43' of the previously encoded rectangular block. A rectangular reconstruction block is generated by encoding and reconstructing a rectangular residual block having the residual signal. The rectangular recovery block has pixels of P14 ', P24', P34 ', and P44'.

이와 같이, 직사각 예측부(492)는 현재 블록의 복수 개의 직사각 현재 블록을 단계적으로 예측하는데, 단계적으로 예측한다고 함은 모든 직사각 현재 블록을 동시에 예측하는 것이 아니라 각 직사각 현재 블록을 예측할 때 이전에 부호화되고 복원된 직사각 이전 블록의 화소를 이용하여 예측한다는 것이다.As described above, the rectangular prediction unit 492 predicts a plurality of rectangular current blocks of the current block in stages, wherein stepwise prediction does not predict all rectangular current blocks at the same time but instead encodes them when predicting each rectangular current block. Is predicted using the pixels of the previous rectangular block.

도 10은 본 발명의 일 실시예에 따른 직사각 스캔 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.10 is a block diagram schematically illustrating an electronic configuration of a rectangular scan apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 직사각 스캔 장치는 도 4에서는 직사각 스캔부(450)로 구현될 수 있다. 이하에서는 본 발명의 일 실시예에 따른 직사각 스캔 장치를 직사각 스캔부(450)라 칭한다.The rectangular scan device according to an embodiment of the present invention may be implemented as a rectangular scan unit 450 in FIG. 4. Hereinafter, the rectangular scan device according to an embodiment of the present invention is called a rectangular scan unit 450.

본 발명의 일 실시예에 따른 직사각 스캔부(450)는 블록 결합부(1010), 초기 스캐닝 패턴 결정부(1020), 스캐닝부(1030) 및 스캐닝 패턴 갱신부(1040)를 포함하여 구성될 수 있다.The rectangular scan unit 450 according to an embodiment of the present invention may include a block combiner 1010, an initial scanning pattern determiner 1020, a scanning unit 1030, and a scanning pattern updater 1040. have.

블록 결합부(1010)는 직사각 양자화부(440)로부터 전달된 양자화된 복수 개의 직사각 잔차 블록을 현재 블록의 예측 모드에 따른 예측 방향에 따라 결합하여 정사각형 형태의 양자화된 정사각 잔차 블록을 생성한다. 예를 들어, 블록 결합부(1010)는 양자화된 복수 개의 잔차 블록을 해당 블록 모드에 따른 블록 크기에 맞도록 그리고 예측 모드의 예측 방향에 따라 결합하여 정사각형 형태의 잔차 블록을 생성할 수 있다. 즉, 양자화된 복수 개의 잔차 블록이 4x1 블록 4개라면, 4 개의 4x1 블록을 차례로 결합하되 예측 방향인 수직 방향으로 결합하여 4x4 블록 크기의 양자화된 잔차 블록을 생성할 수 있다.The block combiner 1010 combines the plurality of quantized rectangular residual blocks transmitted from the rectangular quantization unit 440 according to a prediction direction according to the prediction mode of the current block to generate a square quantized square residual block. For example, the block combiner 1010 may combine the plurality of quantized residual blocks to match a block size according to a corresponding block mode and according to a prediction direction of a prediction mode, to generate a residual block having a square shape. That is, if the plurality of quantized residual blocks are four 4x1 blocks, the four 4x1 blocks may be sequentially combined, but may be combined in a vertical direction, which is a prediction direction, to generate a 4x4 block sized quantized residual block.

초기 스캐닝 패턴 결정부(1020)는 블록 결합부(1010)에 의해 결합된 양자화된 정사각 잔차 블록의 양자화 주파수 계수를 스캐닝할 초기 스캐닝 패턴을 결정한다. 이때, 초기 스캐닝 패턴 결정부(1020)는 영상의 크기에 따라 초기 스캐닝 패턴 을 결정한다. 예를 들어, 초기 스캐닝 패턴 결정부(1020)는 영상의 크기가 기 설정된 크기 보다 크거나 같은 경우에는 정사각 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 우선 순위를 두되, DC 성분의 계수에 더 큰 우선 순위를 두어 초기 스캔닝 패턴을 결정할 수 있다. 또한, 초기 스캐닝 패턴 결정부(1020)는 영상의 크기가 기 설정된 크기 보다 작은 경우에는 정사각 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 동일한 우선 순위를 두어 초기 스캐닝 패턴을 결정할 수 있다.The initial scanning pattern determiner 1020 determines an initial scanning pattern for scanning the quantized frequency coefficients of the quantized square residual blocks combined by the block combiner 1010. In this case, the initial scanning pattern determiner 1020 determines the initial scanning pattern according to the size of the image. For example, when the size of the image is greater than or equal to the preset size, the initial scanning pattern determiner 1020 gives priority to the coefficient of the DC component among the quantization frequency coefficients of the square residual block and the lowest coefficient of the square residual block. In other words, the initial scanning pattern may be determined by giving a higher priority to the coefficient of the DC component. In addition, when the size of the image is smaller than the preset size, the initial scanning pattern determiner 1020 gives the same priority to the DC component coefficient and the lowest coefficient of the square residual block among the quantization frequency coefficients of the square residual block. Can be determined.

스캐닝부(1030)는 결정된 스캐닝 패턴(초기 스캐닝 패턴 결정부(1020)에 의해 결정되는 초기 스캐닝 패턴 또는 스캐닝 패턴 갱신부(104)에 의해 결정되는 갱신 스캐닝 패턴)에 따라 양자화된 잔차 블록의 양자화 주파수 계수들을 스캐닝하여 양자화 주파수 계수열을 생성한다.The scanning unit 1030 is a quantization frequency of the residual block quantized according to the determined scanning pattern (initial scanning pattern determined by the initial scanning pattern determiner 1020 or updated scanning pattern determined by the scanning pattern updater 104). The coefficients are scanned to produce a quantized frequency coefficient sequence.

스캐닝 패턴 갱신부(1040)는 정사각 잔차 블록의 각 위치마다 '0'이 아닌 양자화 주파수 계수가 발생할 확률에 따라 스캐닝 패턴을 적응적으로 갱신할 수 있다. 예를 들어, 스캐닝 패턴 갱신부(1040)는 영상 부호화 장치(200)가 현재 블록을 부호화할 때마다 정사각 잔차 블록의 각 위치에서 '0'이 아닌 양자화 주파수 계수가 발생할 확률을 계산하고 확률이 큰 순서대로 스캐닝 순서를 결정함으로써, 스캐닝 패턴을 적응적으로 갱신할 수 있다.The scanning pattern updater 1040 may adaptively update the scanning pattern according to a probability that a quantization frequency coefficient other than '0' occurs at each position of the square residual block. For example, each time the image encoding apparatus 200 encodes a current block, the scanning pattern updater 1040 calculates a probability that a quantization frequency coefficient other than '0' occurs at each position of the square residual block and has a high probability. By determining the scanning order in order, it is possible to adaptively update the scanning pattern.

도 11은 본 발명의 일 실시예에 따라 초기 스캐닝 패턴을 결정하는 방법을 설명하기 위한 순서도이다.11 is a flowchart illustrating a method of determining an initial scanning pattern according to an embodiment of the present invention.

직사각 스캔부(450)는 양자화된 복수 개의 직사각 잔차 블록을 블록 모드 단 위로 결합하여 정사각 잔차 블록을 생성하고(S1110), 현재 블록이 속한 영상의 크기가 기 설정된 크기 보다 큰지 여부를 확인하여(S1120), 영상의 크기가 기 설정된 크기 보다 큰 경우에는 정사각 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 우선 순위를 두되, DC 성분의 계수에 더 큰 우선 순위를 두어 초기 스캔닝 패턴을 결정하고(S1130), 영상의 크기가 기 설정된 크기 보다 작은 경우에는 정사각 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 동일한 우선 순위를 두어 초기 스캐닝 패턴을 결정한다(S1140).The rectangular scan unit 450 generates a square residual block by combining a plurality of quantized rectangular residual blocks in a block mode unit (S1110) and checks whether the size of the image to which the current block belongs is larger than a preset size (S1120). ), If the size of the image is larger than the preset size, the DC component and the lowest coefficient of the square residual block are given priority among the quantization frequency coefficients of the square residual block, but the higher priority is given to the coefficient of the DC component. When the scanning pattern is determined (S1130), and the image size is smaller than the preset size, the initial scanning pattern is applied by giving the same priority to the DC component coefficient and the lowest coefficient of the square residual block among the quantization frequency coefficients of the square residual block. Determine (S1140).

도 12는 본 발명의 바람직한 실시예에 따라 복수 개의 직사각 잔차 블록이 정사각 잔차 블록으로 결합된 것을 나타낸 예시도이다.12 is an exemplary view illustrating a plurality of rectangular residual blocks combined into square residual blocks according to a preferred embodiment of the present invention.

도 12에는 현재 블록의 예측 모드가 수직 모드인 경우, 복수 개의 직사각 잔차 블록이 4x4 블록 모드 또는 8x8 블록 모드 단위로 결합하여 생성된 정사각 잔차 블록의 양자화 주파수 계수들을 예시적으로 나타내었다.12 illustrates quantization frequency coefficients of a square residual block generated by combining a plurality of rectangular residual blocks in units of a 4x4 block mode or an 8x8 block mode when the prediction mode of the current block is the vertical mode.

4x4 블록 모드로 결합된 정사각 잔차 블록은 4x1 크기의 직사각 잔차 블록이 수직 방향으로 결합된 것이고, 8x8 블록 모드로 결합된 정사각 잔차 블록은 8x1 크기의 직사각 잔차 블록이 수직 방향으로 결합된 것이다.A square residual block combined in 4x4 block mode is a rectangular residual block of 4x1 size combined in a vertical direction, and a square residual block combined in 8x8 block mode is an 8x1 rectangular residual block combined in a vertical direction.

현재 블록을 복수 개의 직사각 현재 블록을 분할하여 각 직사각 현재 블록의 잔차 블록을 변환하고 양자화하기 때문에, 양자화된 각 직사각 잔차 블록의 좌측에 DC 성분의 양자화 주파수 계수가 위치하게 된다. 따라서, 정사각형 블록 단위로 결합한 양자화된 정사각 잔차 블록의 좌측에 DC 성분의 계수가 몰리게 된다.Since the current block is divided into a plurality of rectangular current blocks to transform and quantize the residual blocks of each rectangular current block, the quantized frequency coefficient of the DC component is positioned to the left of each quantized rectangular residual block. Therefore, the coefficient of the DC component is driven to the left of the quantized square residual block combined in the square block unit.

도 13은 본 발명의 일 실시예에 따라 초기 스캐닝 패턴을 결정하는 과정을 설명하기 위한 예시도이다.13 is an exemplary view for explaining a process of determining an initial scanning pattern according to an embodiment of the present invention.

통상적으로 정사각형 형태의 정사각 잔차 블록에서는 DC 성분의 계수들과 잔차 블록의 최하단 부분의 계수들에 '0'이 아닌 값이 빈번하게 발생한다. 따라서, 스캐닝할 때 '0'이 아닌 값이 발생할 확률이 높은 DC 성분의 계수들과 최하단 부분의 계수들을 우선적으로 스캐닝하면 부호화 효율을 높일 수 있다.In a square residual block, a non-zero value frequently occurs in the coefficients of the DC component and the coefficients of the lowest part of the residual block. Accordingly, if scanning is performed first, the coefficients of the DC component and the coefficients of the lowermost portion having a high probability of occurrence of a value other than '0' may be improved.

한편, 영상의 크기에 따라 정사각 잔차 블록의 양자화 주파수 계수들에서 '0'이 아닌 값이 발생할 확률이 달라지는데, 영상의 크기가 커지면 DC 성분의 계수에 '0'이 아닌 값이 발생할 확률이 최하단 부분의 계수들보다 더 높아지는 특성이 있다. 따라서, 본 발명에서는 영상의 크기에 따라 초기 스캐닝 패턴을 결정한다.Meanwhile, the probability that a non-zero value occurs in the quantization frequency coefficients of a square residual block varies according to the size of the image. When the size of the image increases, the probability that a non-zero value occurs in the coefficient of the DC component is lowest. Is higher than the coefficients of. Therefore, in the present invention, the initial scanning pattern is determined according to the size of the image.

예를 들어, 영상의 크기를 비교할 임계 크기를 기 설정해 놓고, 영상의 크기가 기 설정된 크기 보다 크거나 같은 경우에는 정사각 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 우선 순위를 두되, DC 성분의 계수에 더 큰 우선 순위를 두어 초기 스캔닝 패턴을 결정할 수 있다. 또한, 영상의 크기가 기 설정된 크기 보다 작은 경우에는 정사각 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 동일한 우선 순위를 두어 초기 스캐닝 패턴을 결정할 수 있다.For example, if a threshold size for comparing the image size is set in advance, and the image size is larger than or equal to the preset size, the DC component coefficient and the lowest coefficient of the square residual block have priority over the quantization frequency coefficients of the square residual block. An initial scanning pattern can be determined by ranking, but giving a higher priority to the coefficients of the DC component. In addition, when the size of the image is smaller than the preset size, the initial scanning pattern may be determined by giving the same priority to the DC component coefficient and the lowest coefficient of the square residual block among the quantization frequency coefficients of the square residual block.

도 13에서는 영상의 크기를 비교하기 위한 기 설정된 크기가 720p인 것으로 설정될 때 결정되는 초기 스캐닝 패턴을 예시적으로 나타낸 것이다. 영상의 크기가 QCIF 또는 CIF인 경우에는 영상의 크기가 기 설정된 크기 보다 작다고 판단하여 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 동일한 우선 순위를 두어 초기 스캐닝 패턴을 결정할 수 있다. 이 경우, 도시한 화살표의 순서와 같이, DC(3)에서 시작해서 AC1(3), DC(2), DC(1), AC1(2), AC1(3), …, AC3(0)의 순서로 초기 스캐닝 패턴이 결정된다.FIG. 13 exemplarily illustrates an initial scanning pattern determined when the preset size for comparing the sizes of images is set to 720p. When the size of the image is QCIF or CIF, it may be determined that the size of the image is smaller than the preset size, and the initial scanning pattern may be determined by giving the same priority to the coefficient of the DC component and the lowest coefficient of the square residual block. In this case, starting from DC 3, AC 1 (3), DC (2), DC (1), AC 1 (2), AC 1 (3),... , The initial scanning pattern is determined in the order of AC 3 (0).

또한, 영상의 크기가 720p 또는 1080p인 경우에는 영상의 크기가 기 설정된 크기 보다 크거나 같다고 판단하여 DC 성분의 계수에 더 큰 우선 순위를 두어 초기 스캔닝 패턴을 결정할 수 있다. 이 경우, 도시한 화살표 순서와 같이, DC(3), DC(2), DC(1), DC(0), AC1(3), AC1(2), …, AC3(0)의 순서로 초기 스캐닝 패턴이 결정된다.In addition, when the size of the image is 720p or 1080p, it may be determined that the size of the image is greater than or equal to the preset size, and the initial scanning pattern may be determined by giving a higher priority to the coefficient of the DC component. In this case, as illustrated arrow order, DC (3), DC ( 2), DC (1), DC (0), AC 1 (3), AC 1 (2), ... , The initial scanning pattern is determined in the order of AC 3 (0).

도 14는 본 발명의 일 실시예에 따라 스캐닝 패턴을 갱신하는 과정을 설명하기 위한 예시도이다.14 is an exemplary view for explaining a process of updating a scanning pattern according to an embodiment of the present invention.

도 13에서 예를 들어 전술한 바와 같이, 초기 스캐닝 패턴이 결정되면, 직사각 스캔부(450)는 초기 스캐닝 패턴에 따라서 양자화된 정사각형 잔차 블록의 양자화 주파수 계수들을 스캐닝하여 양자화 주파수 계수열을 생성하고 직사각 부호화부(460)에서 양자화 주파수 계수열을 부호화하여 직사각 부호화 비트스트림을 생성한다. 이후, 현재 블록 이후의 다음 블록이 입력되면 다시 복수 개의 직사각 다음 블록을 분할하여 그 잔차 블록을 변환하고 양자화하여 정사각 잔차 블록을 정사각형 잔차 블록으로 결합한 후 스캐닝하는데, 이와 같은 과정을 반복할 때마다 처음에 결정된 초기 스캐닝 패턴을 사용하여 스캐닝하는 것이 아니라, 적응적으로 스캐 닝 패턴을 갱신하여 스캐닝한다.For example, as described above with reference to FIG. 13, when the initial scanning pattern is determined, the rectangular scan unit 450 scans the quantized frequency coefficients of the quantized square residual block according to the initial scanning pattern to generate a quantized frequency coefficient sequence and is rectangular. The encoder 460 encodes the quantized frequency coefficient sequence to generate a rectangular encoded bitstream. Then, when the next block after the current block is input, a plurality of rectangular next blocks are divided again, the residual blocks are transformed and quantized, the square residual blocks are combined into a square residual block, and then scanned. Instead of scanning by using the initial scanning pattern determined in Fig. 2, the scanning pattern is updated and scanned adaptively.

이때, 스캐닝 패턴을 갱신하는 기준은 정사각 잔차 블록의 각 위치마다 '0'이 아닌 양자화 주파수 계수가 발생할 확률이 될 수 있다. 예를 들어, 영상의 복수 개의 블록을 부호화할 때마다, 정사각 잔차 블록의 각 위치에서 '0'이 아닌 양자화 주파수 계수가 발생할 확률을 계산하고 그 확률이 큰 순서대로 스캐닝 순서를 결정함으로써, 스캐닝 패턴을 적응적으로 갱신할 수 있다.In this case, a criterion for updating the scanning pattern may be a probability that a quantization frequency coefficient other than '0' occurs for each position of the square residual block. For example, each time a plurality of blocks of an image are encoded, a scanning pattern is calculated by calculating a probability that a non-zero quantization frequency coefficient occurs at each position of a square residual block and determining the scanning order in the order of the greatest probability. Can be adaptively updated.

도 14에 도시한 바와 같이, 초기 스캐닝 패턴이 결정되어 해당 정사각 잔차 블록에 대해 스캐닝하여 부호화가 완료되면, 다음 블록을 부호화하는 과정을 반복하면서, 적어도 1회 이상 부호화될 때마다 각 양자화 주파수 계수의 위치마다 '0'이 아닌 양자화 주파수 계수가 발생할 확률을 계산한다. 예를 들어, 도시한 바와 같이, 각 위치마다 '0'이 아닌 양자화 주파수 계수가 발생할 확률 분포가 계산될 수 있으며, 이때에는 그 확률 분포에 따라 확률이 높은 순서대로 차례로 스캐닝 패턴을 결정하여 갱신된 스캐닝 패턴을 결정할 수 있다.As shown in FIG. 14, when the initial scanning pattern is determined and the encoding is completed by scanning the corresponding square residual block, the process of encoding the next block is repeated, and each quantization frequency coefficient of each quantization frequency coefficient is repeated at least once. Calculate the probability of generating a non-zero quantized frequency coefficient for each position. For example, as illustrated, a probability distribution in which quantization frequency coefficients other than '0' may be generated at each position may be calculated. In this case, the scanning patterns may be sequentially determined and updated in order of high probability according to the probability distribution. The scanning pattern can be determined.

이상에서 설명한 바와 같이, 영상 부호화 장치(200)에 의해 비트스트림으로 부호화된 영상은 실시간 또는 비실시간으로 인터넷, 근거리 무선 통신망, 무선랜망, 와이브로망, 이동통신망 등의 유무선 통신망 등을 통하거나 케이블, 범용 직렬 버스(USB: Universal Serial Bus) 등의 통신 인터페이스를 통해 후술할 영상 복호화 장치로 전송되어 영상 복호화 장치에서 복호화되어 영상으로 복원되고 재생될 수 있다.As described above, the image encoded in the bitstream by the video encoding apparatus 200 is real-time or non-real-time through the wired or wireless communication network such as the Internet, local area wireless communication network, wireless LAN network, WiBro network, mobile communication network or the like, The image decoding apparatus may be transmitted to a video decoding apparatus to be described later through a communication interface such as a universal serial bus (USB), decoded by the video decoding apparatus, and restored and reproduced.

도 15는 본 발명의 일 실시예에 따른 영상 복호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.15 is a block diagram schematically illustrating an electronic configuration of an image decoding apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 영상 복호화 장치(1500)는 예측 모드 추출부(1510), 복호화부(1520), 비트스트림 식별자 추출부(1530), 직사각 복원부(1540) 및 정사각 복원부(1550)를 포함하여 구성될 수 있다.The image decoding apparatus 1500 according to an embodiment of the present invention may include a prediction mode extractor 1510, a decoder 1520, a bitstream identifier extractor 1530, a rectangular decompressor 1540, and a square decompressor 1550. It may be configured to include).

이러한 영상 복호화 장치(1500)는 개인용 컴퓨터(PC: Personal Computer), 노트북 컴퓨터, 개인 휴대 단말기(PDA: Personal Digital Assistant), 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 이동통신 단말기(Mobile Communication Terminal) 등일 수 있으며, 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, 영상을 복호화하기 위한 각종 프로그램과 데이터를 저장하기 위한 메모리, 프로그램을 실행하여 연산 및 제어하기 위한 마이크로프로세서 등을 구비하는 다양한 장치를 의미한다.The video decoding apparatus 1500 may be a personal computer (PC), a notebook computer, a personal digital assistant (PDA), a portable multimedia player (PMP), or a PlayStation Portable (PSP). ), A communication device such as a communication modem for communicating with various devices or a wired / wireless communication network, a memory for storing various programs and data for decoding an image, and executing a program. Means a variety of devices including a microprocessor for operation and control.

예측 모드 추출부(1510)는 비트스트림으로부터 예측 모드에 대한 정보를 추출한다. 여기서, 예측 모드에 대한 정보는 영상 부호화 장치(200)에서 결정한 현재 블록의 예측 모드를 식별하기 위한 정보로서, 현재 블록의 예측 모드가 수평 모드인지, 수직 모드인지, DC 모드 인지 등에 대한 정보를 포함한다.The prediction mode extractor 1510 extracts information about the prediction mode from the bitstream. Here, the information about the prediction mode is information for identifying the prediction mode of the current block determined by the image encoding apparatus 200 and includes information on whether the prediction mode of the current block is a horizontal mode, a vertical mode, a DC mode, or the like. do.

복호화부(1520)는 비트스트림을 복호화하여 양자화 주파수 계수열을 추출한다. 복호화부(1520)는 양자화 주파수 계수열을 추출하여 출력할 때, 비트스트림 식별자 추출부(1530)의 제어에 따라 양자화 주파수 계수열을 직사각 복원부(1540)와 정사각 복원부(1550) 중 하나로 출력한다.The decoder 1520 extracts a quantized frequency coefficient string by decoding the bitstream. When the decoder 1520 extracts and outputs the quantized frequency coefficient sequence, the quantized frequency coefficient sequence is output to one of the rectangular reconstructor 1540 and the square reconstructor 1550 under the control of the bitstream identifier extractor 1530. do.

비트스트림 식별자 추출부(1530)는 양자화 주파수 계수열을 이용하여 비트스트림으로부터 비트스트림 식별자를 추출하고, 비트스트림 식별자에 따라 복호화부(1520)로 하여금 양자화 주파수 계수열을 직사각 복원부(1540) 및 정사각 복원부(1550) 중 하나로 출력하도록 제어한다.The bitstream identifier extractor 1530 extracts the bitstream identifier from the bitstream using the quantized frequency coefficient sequence, and causes the decoder 1520 to decompose the quantized frequency coefficient sequence from the rectangular recovery unit 1540 according to the bitstream identifier. Control to output to one of the square recovery unit 1550.

예를 들어, 비트스트림 식별자 추출부(1530)는 복호화부(1520)로부터 전달된 양자화 주파수 계수열의 양자화 주파수 계수 중 하나 이상이 '0'이 아닌 경우에는 비트스트림 식별자를 비트스트림으로부터 추출한다. 비트스트림 식별자 추출부(1530)는 추출한 비트스트림 식별자가 '1'인 경우에는 비트스트림이 직사각 부호화 비트스트림이므로 복호화부(1520)로 하여금 비트스트림을 복호화한 양자화 주파수 계수열을 직사각 복원부(1540)로 출력하도록 제어하고, 비트스트림 식별자가 '0'인 경우에는 비트스트림이 정사각 부호화 비트스트림이므로 복호화부(1520)로 하여금 비트스트림을 복호화한 양자화 주파수 계수열을 정사각 복원부(1550)로 출력하도록 제어한다. 또한, 비트스트림 식별자 추출부(1530)는 복호화부(1520)로부터 출력되는 양자화 주파수 계수열의 양자화 주파수 계수가 모두 '0'인 경우에는 비트스트림 식별자를 비트스트림으로부터 추출하지 않고, 복호화부(1520)로 하여금 양자화 주파수 계수열을 정사각 복원부(1550)로 출력하도록 제어한다.For example, the bitstream identifier extractor 1530 extracts the bitstream identifier from the bitstream when at least one of the quantization frequency coefficients of the quantization frequency coefficient sequence transmitted from the decoder 1520 is not '0'. If the extracted bitstream identifier is '1', the bitstream identifier extractor 1530 restores the rectangular quantization frequency coefficient sequence from which the decoder 1520 decodes the bitstream since the bitstream is a rectangular encoded bitstream. If the bitstream identifier is '0' and the bitstream is a square encoded bitstream, the decoder 1520 outputs the quantized frequency coefficient sequence from which the bitstream is decoded to the square reconstructor 1550. To control. In addition, the bitstream identifier extractor 1530 does not extract the bitstream identifier from the bitstream when the quantization frequency coefficients of the quantization frequency coefficient sequence output from the decoder 1520 are all '0'. Control to output the quantized frequency coefficient sequence to the square recovery unit 1550.

직사각 복원부(1540)는 복호화부(1520)로부터 출력되는 양자화 주파수 계수열을 직사각형 블록 단위로 예측 모드에 따라 단계적으로 영상의 현재 블록을 복원하여 출력한다. 즉, 직사각 복원부(1540)는 비트스트림이 복호화되어 추출된 양자화 주파수 계수가 입력되면 역 스캐닝하여 양자화된 잔차 블록을 생성하고 직사각 형 블록 단위로 분할하여 복수 개의 양자화된 직사각 잔차 블록을 역 양자화하고 역 변환하며, 복수 개의 역 변환된 직사각 잔차 블록에 대응하는 복수 개의 직사각 현재 블록을 단계적으로 예측하여 복수 개의 직사각 예측 블록을 생성하며, 복수 개의 직사각 예측 블록에 복수 개의 역 변환된 직사각 잔차 블록을 가산하여 복수 개의 직사각 현재 블록을 복원하고 각 직사각 현재 블록을 결합하여 영상의 현재 블록을 복원한다.The rectangular reconstructor 1540 reconstructs and outputs the current block of the image in steps of a quantized frequency coefficient sequence output from the decoder 1520 in the rectangular block unit according to the prediction mode. That is, the rectangular reconstruction unit 1540 generates a quantized residual block by inverse scanning when the extracted quantized frequency coefficient is input by decoding the bitstream, and inversely quantizes the plurality of quantized rectangular residual blocks by dividing into rectangular block units. Inverse transforming generates a plurality of rectangular prediction blocks by estimating a plurality of rectangular current blocks corresponding to a plurality of inversely transformed rectangular residual blocks, and adds a plurality of inversely transformed rectangular residual blocks to the plurality of rectangular prediction blocks. Then, a plurality of rectangular current blocks are restored, and each rectangular current block is combined to restore the current block of the image.

정사각 복원부(1550)는 복호화부(1520)로부터 출력되는 양자화 주파수 계수열을 이용하여 정사각형 블록 단위로 예측 모드에 따라 현재 블록을 복원하여 출력한다.The square reconstructor 1550 reconstructs and outputs the current block according to the prediction mode in units of square blocks by using the quantized frequency coefficient sequence output from the decoder 1520.

도 16은 본 발명의 일 실시예에 따른 직사각 복호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.16 is a block diagram schematically illustrating an electronic configuration of a rectangular decoding apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 직사각 복호화 장치는 도 15에서는 직사각 복원부(1540)로 구현될 수 있다. 이하에서는 본 발명의 일 실시예에 따른 직사각 복호화 장치를 직사각 복원부(1540)라 칭한다.The rectangular decoding apparatus according to an embodiment of the present invention may be implemented by the rectangular reconstruction unit 1540 in FIG. 15. Hereinafter, the rectangular decoding apparatus according to an embodiment of the present invention is called a rectangular reconstruction unit 1540.

본 발명의 일 실시예에 따른 직사각 복원부(1540)는 직사각 역 스캔부(1610), 직사각 역 양자화부(1620), 직사각 역 변환부(1630), 직사각 예측부(1640) 및 직사각 가산부(1650)를 포함하여 구성될 수 있다.According to an exemplary embodiment, the rectangular reconstructor 1540 includes a rectangular inverse scan unit 1610, a rectangular inverse quantizer 1620, a rectangular inverse transform unit 1630, a rectangular predictor 1640, and a rectangular adder ( 1650).

직사각 역 스캔부(1610)는 비트스트림이 복호화되어 추출된 양자화 주파수 계수가 입력되면 역 스캐닝하여 양자화된 잔차 블록을 생성하고 직사각형 블록 단위로 분할하여 복수 개의 양자화된 직사각 잔차 블록을 출력한다.When the quantized frequency coefficient extracted by decoding the bitstream is input, the rectangular inverse scan unit 1610 generates quantized residual blocks by inverse scanning, divides them into rectangular block units, and outputs a plurality of quantized rectangular residual blocks.

여기서, 직사각 역 스캔부(1610)는 영상의 크기에 따라 초기 역 스캐닝 패턴을 결정하여 양자화 주파수 계수를 스캔할 수 있다. 예를 들어, 영상의 크기가 기 설정된 크기 보다 크거나 같은 경우에는 양자화된 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 우선 순위를 두되, DC 성분의 계수에 더 큰 우선 순위를 두어 초기 역 스캔닝 패턴을 결정할 수 있으며, 영상의 크기가 기 설정된 크기 보다 작은 경우에는 양자화된 잔차 블록의 양자화 주파수 계수 중 DC 성분의 계수와 정사각 잔차 블록의 최하단 계수에 동일한 우선 순위를 두어 초기 역 스캐닝 패턴을 결정할 수 있다.Here, the rectangular inverse scan unit 1610 may scan an quantization frequency coefficient by determining an initial inverse scanning pattern according to the size of an image. For example, if the size of the image is greater than or equal to the preset size, the DC component and the lowest coefficient of the square residual block are given priority among the quantized frequency coefficients of the quantized residual block, but are larger than the coefficient of the DC component. The initial inverse scanning pattern can be determined by giving priority to the image. If the image size is smaller than the preset size, the same priority is applied to the DC component coefficient and the lowest coefficient of the square residual block among the quantized frequency coefficients of the quantized residual block. The initial reverse scanning pattern can be determined.

또한, 직사각 역 스캔부(1610)는 양자화된 잔차 블록의 각 위치마다 '0'이 아닌 양자화 주파수 계수가 발생할 확률에 따라 역 스캐닝 패턴을 적응적으로 갱신할 수 있는데, 예를 들면, 비트스트림을 복호화할 때마다, 양자화된 잔차 블록의 각 위치에서 '0'이 아닌 양자화 주파수 계수가 발생할 확률을 계산하고 확률이 큰 순서대로 역 스캐닝 순서를 결정함으로써, 역 스캐닝 패턴을 적응적으로 갱신할 수 있다.Also, the rectangular inverse scan unit 1610 may adaptively update the inverse scanning pattern according to a probability that a quantization frequency coefficient other than '0' occurs at each position of the quantized residual block. Each time decoding, the inverse scanning pattern can be adaptively updated by calculating the probability of occurrence of a non-zero quantization frequency coefficient at each position of the quantized residual block and determining the inverse scanning order in the order of the highest probability. .

직사각 역 양자화부(1620)는 복수 개의 양자화된 직사각 잔차 블록을 역 양자화한다. 직사각 역 변환부(1630)는 복수 개의 역 양자화된 직사각 잔차 블록을 시간 영역으로 역 변환한다.The rectangular inverse quantizer 1620 inverse quantizes the plurality of quantized rectangular residual blocks. The rectangular inverse transform unit 1630 inversely converts the plurality of inverse quantized rectangular residual blocks into the time domain.

직사각 예측부(1640)는 복수 개의 역 변환된 직사각 잔차 블록에 대응하는 복수 개의 직사각 현재 블록을 단계적으로 예측하여 복수 개의 직사각 예측 블록을 생성한다. 여기서, 직사각 예측부(1640)는 복수 개의 직사각 현재 블록을 비트스트 림으로부터 추출된 예측 모드에 의한 예측 방향에 따라 단계적으로 예측한다.The rectangular prediction unit 1640 generates a plurality of rectangular prediction blocks by estimating a plurality of rectangular current blocks corresponding to the plurality of inversely transformed rectangular residual blocks in steps. Here, the rectangular prediction unit 1640 predicts the plurality of rectangular current blocks step by step according to the prediction direction by the prediction mode extracted from the bitstream.

직사각 가산부(1650)는 복수 개의 직사각 예측 블록에 복수 개의 역 변환된 직사각 잔차 블록을 가산하여 복수 개의 직사각 현재 블록을 복원하고 각 직사각 현재 블록을 결합하여 영상을 복원하고 복원 영상을 출력한다.The rectangular adder 1650 reconstructs a plurality of rectangular current blocks by adding a plurality of inversely transformed rectangular residual blocks to the plurality of rectangular prediction blocks, combines each rectangular current block, and reconstructs an image and outputs a reconstructed image.

이와 같은 직사각 복원부(1540)는 비트스트림이 복호화되어 추출된 양자화 주파수 계수가 입력되면 역 스캐닝하여 양자화된 잔차 블록을 생성하고 직사각형 블록 단위로 분할하여 복수 개의 양자화된 직사각 잔차 블록을 출력하며, 복수 개의 양자화된 직사각 잔차 블록을 역 양자화하고 복수 개의 역 양자화된 직사각 잔차 블록을 시간 영역으로 역 변환하며, 복수 개의 역 변환된 직사각 잔차 블록에 대응하는 복수 개의 직사각 현재 블록을 단계적으로 예측하여 복수 개의 직사각 예측 블록을 생성하며, 복수 개의 직사각 예측 블록에 복수 개의 역 변환된 직사각 잔차 블록을 가산하여 복수 개의 직사각 현재 블록을 복원하고 각 직사각 현재 블록을 결합하여 영상을 복원한다.When the quantized frequency coefficient extracted by decoding the bitstream is input, the rectangular reconstructor 1540 generates quantized residual blocks by inverse scanning, divides them into rectangular block units, and outputs a plurality of quantized rectangular residual blocks. Inversely quantizes two quantized rectangular residual blocks, inversely transforms a plurality of inverse quantized rectangular residual blocks into a time domain, and predicts a plurality of rectangular current blocks corresponding to the plurality of inversely transformed rectangular residual blocks stepwise A prediction block is generated, and a plurality of inverse transformed rectangular residual blocks are added to the plurality of rectangular prediction blocks to restore the plurality of rectangular current blocks, and the respective rectangular current blocks are combined to reconstruct an image.

도 17은 본 발명의 일 실시예에 따른 정사각 복호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.17 is a block diagram schematically illustrating an electronic configuration of a square decoding apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 정사각 복호화 장치는 도 15에서는 정사각 복원부(1550)로 구현될 수 있다. 이하에는 본 발명의 일 실시예에 따른 정사각 복호화 장치를 정사각 복원부(1550)라 칭한다.The square decoding apparatus according to the embodiment of the present invention may be implemented by the square reconstruction unit 1550 in FIG. 15. Hereinafter, the square decoding apparatus according to an embodiment of the present invention is called a square reconstruction unit 1550.

정사각 복원부(1550)는 정사각 역 스캔부(1710), 정사각 역 양자화부(1720), 정사각 역 변환부(1730), 정사각 예측부(1740) 및 정사각 가산부(1750)를 포함하여 구성될 수 있다.The square reconstructor 1550 may include a square inverse scan unit 1710, a square inverse quantizer 1720, a square inverse transform unit 1730, a square predictor 1740, and a square adder 1750. have.

정사각 역 스캔부(1710)는 복호화부(1520)로부터 출력되는 양자화 주파수 계수열을 역 스캔닝하여 양자화된 정사각 잔차 블록을 생성한다. 이때, 정사각 역 스캔부(1710)는 부호화하는 과정에서 스캐닝 패턴을 적응적으로 갱신할 수 있다.The square inverse scan unit 1710 inversely scans the quantized frequency coefficient sequence output from the decoder 1520 to generate a quantized square residual block. In this case, the square inverse scan unit 1710 may adaptively update the scanning pattern in the encoding process.

정사각 역 양자화부(1720)는 양자화된 정사각 잔차 블록을 역 양자화한다. 정사각 역 변환부(1730)는 역 양자화된 정사각 잔차 블록을 시간 영역으로 역 변환한다.The square inverse quantizer 1720 inverse quantizes the quantized square residual block. The square inverse transformer 1730 inversely transforms an inverse quantized square residual block into a time domain.

정사각 예측부(1740)는 역 변환된 정사각 잔차 블록에 대응하는 정사각 현재 블록을 예측하여 정사각 예측 블록을 생성한다. 여기서, 정사각 예측부(1740)는 비트스트림으로부터 추출된 예측 모드에 의한 예측 방향에 따라 정사각 현재 블록을 예측한다.The square predictor 1740 generates a square prediction block by predicting a square current block corresponding to the inversely transformed square residual block. Here, the square predictor 1740 predicts the square current block according to the prediction direction by the prediction mode extracted from the bitstream.

정사각 가산부(1750)는 정사각 예측 블록에 역 변환된 정사각 잔차 블록을 가산하여 정사각 현재 블록을 복원함으로써 영상을 복원하고 복원 영상을 출력한다.The square adder 1750 reconstructs an image by adding an inverse transformed square residual block to the square prediction block to reconstruct the square current block, and outputs a reconstructed image.

도 18은 본 발명의 일 실시예에 따른 영상 복호화 방법을 설명하기 위한 순서도이다.18 is a flowchart illustrating an image decoding method according to an embodiment of the present invention.

유무선 통신망 또는 케이블 등을 통해 영상에 대한 비트스트림을 수신하여 저장한 영상 복호화 장치(1500)는 사용자의 선택 또는 실행 중인 다른 프로그램의 알고리즘에 따라 영상을 재생하기 위해, 영상을 복호화하여 복원한다.The image decoding apparatus 1500 that receives and stores a bitstream of an image through a wired / wireless communication network or a cable, decodes and restores the image to reproduce the image according to a user's selection or an algorithm of another program being executed.

이를 위해, 영상 복호화 장치(1500)는 비트스트림으로부터 예측 모드에 대한 정보를 추출하고(S1810), 비트스트림을 복호화하여 양자화 주파수 계수열을 추출한다(S1820). 양자화 주파수 계수열을 추출한 영상 복호화 장치(1500)는 양자화 주파수 계수열의 양자화 주파수 계수가 모두 '0'인지 여부를 확인한다(S1830). 영상 복호화 장치(1500)는, 단계 S1830의 확인 결과 양자화 주파수 계수가 모두 '0'인 경우에는 양자화 주파수 계수열을 이용하여 정사각형 블록 단위로 예측 모드에 따라 현재 블록을 복원하고 출력하고(S1840), 단계 S1830의 확인 결과 양자화 주파수 계수가 모두 '0'인 경우에는 비트스트림으로부터 비트스트림 식별자를 추출한다(S1850). 비트스트림 식별자를 추출한 영상 복호화 장치(1500)는 비트스트림 식별자가 '1'인지 여부를 확인하여(S1860), 비트스트림 식별자가 '1'인 경우에는 해당 비트스트림이 직사각 비트스트림인 것으로 식별하고 양자화 주파수 계수열을 이용하여 직사각형 블록 단위로 예측 모드에 따라 단계적으로 영상의 현재 블록을 복원하여 출력한다(S1870). 또한, 영상 복호화 장치(1500)는 비트스트림 식별자가 '1'이 아닌 경우에는 해당 비트스트림이 정사각 비트스트림인 것으로 식별하고 단계 S1840으로 진행하여, 양자화 주파수 계수열을 이용하여 정사각 블록 단위로 예측 모드에 따라 영상의 현재 블록을 복원하고 출력한다.To this end, the image decoding apparatus 1500 extracts information about a prediction mode from the bitstream (S1810), and extracts a quantized frequency coefficient sequence by decoding the bitstream (S1820). The image decoding apparatus 1500 extracting the quantized frequency coefficient string checks whether all of the quantized frequency coefficients of the quantized frequency coefficient string are '0' (S1830). When the quantization frequency coefficients are all '0' as a result of checking in operation S1830, the image decoding apparatus 1500 restores and outputs the current block in the prediction mode in units of square blocks by using the quantization frequency coefficient sequence (S1840). If the quantization frequency coefficients are all '0' as a result of checking in step S1830, a bitstream identifier is extracted from the bitstream (S1850). The image decoding apparatus 1500 extracting the bitstream identifier checks whether the bitstream identifier is '1' (S1860), and if the bitstream identifier is '1', identifies the corresponding bitstream as a rectangular bitstream and quantizes it. The current block of the image is reconstructed and output step by step in the prediction mode in units of rectangular blocks using the frequency coefficient sequence (S1870). Also, if the bitstream identifier is not '1', the image decoding apparatus 1500 identifies that the bitstream is a square bitstream and proceeds to step S1840, and uses the quantization frequency coefficient sequence to predict the prediction mode in square block units. Restore and output the current block of the image.

도 19는 본 발명의 일 실시예에 따라 초기 역 스캐닝 패턴에 따라 역 스캐닝하는 과정을 설명하기 위한 예시도이다.19 is an exemplary diagram for describing a process of reverse scanning according to an initial reverse scanning pattern according to an embodiment of the present invention.

영상 복호화 장치(1500)는 영상의 크기에 따라 초기 역 스캐닝 패턴을 결정하고, 초기 역 스캐닝 패턴에 따라 양자화 주파수 계수열을 역 스캐닝하여 양자화된 잔차 블록을 구성한다. 도 19에서는 양자화 주파수 계수열이 "0, -1, 2, 0, 4, 0, 0, 0, …"이고, 영상의 크기가 CIF이며, 블록 모드가 4x4 크기이고 예측 모드가 수직 모드인 경우, 결정된 초기 스캐닝 패턴에 따라 역 스캔하여 양자화된 잔차 블록을 구성하는 과정을 나타내었다.The image decoding apparatus 1500 determines an initial inverse scanning pattern according to the size of an image, and inversely scans a quantized frequency coefficient sequence according to the initial inverse scanning pattern to configure a quantized residual block. In FIG. 19, the quantization frequency coefficient sequence is "0, -1, 2, 0, 4, 0, 0, 0, ...", the image size is CIF, the block mode is 4x4 size, and the prediction mode is the vertical mode. The process of constructing the quantized residual block by reverse scanning according to the determined initial scanning pattern is shown.

영상의 크기에 따라 초기 역 스캐닝 패턴을 결정하는 것은 도 13을 통해 전술한, 초기 스캐닝 패턴을 결정하는 것과 유사하다. 즉, 영상의 크기에 따라 정사각 잔차 블록의 양자화 주파수 계수들에서 '0'이 아닌 값이 발생할 확률이 달라지고, 영상의 크기가 커지면 DC 성분의 계수에 '0'이 아닌 값이 발생할 확률이 최하단 부분의 계수들보다 더 높아지는 특성을 이용하여, 영상의 크기에 따라 초기 스캐닝 패턴을 결정하는 것이다.Determining the initial reverse scanning pattern according to the size of the image is similar to determining the initial scanning pattern described above with reference to FIG. 13. That is, the probability that a non-zero value occurs in the quantization frequency coefficients of a square residual block depends on the size of the image, and when the image size increases, the probability that a non-zero value occurs in the coefficient of the DC component is the lowest. By using a characteristic that is higher than the coefficients of the part, the initial scanning pattern is determined according to the size of the image.

예를 들어, 영상의 크기를 비교할 임계 크기를 기 설정해 놓고, 영상의 크기가 기 설정된 크기 보다 크거나 같은 경우에는 양자화 주파수 계수열에서 차례대로 읽어들인 양자화 주파수 계수를 양자화된 잔차 블록의 양자화 주파수 계수의 각 위치 중 DC 성분의 계수에 해당하는 위치와 양자화된 잔차 블록의 최하단 계수에 해당하는 위치에 우선 순위를 두되, DC 성분의 계수의 위치에 더 큰 우선 순위를 두어 읽어들인 양자화 주파수 계수를 배열하는 식으로 초기 역 스캔닝 패턴을 결정할 수 있다. 또한, 영상의 크기가 기 설정된 크기 보다 작은 경우에는 양자화된 잔차 블록의 양자화 주파수 계수의 각 위치 중 DC 성분의 계수에 해당하는 위치와 정사각 잔차 블록의 최하단 계수에 해당하는 위치에 동일한 우선 순위를 두어 초기 역 스캐닝 패턴을 결정할 수 있다.For example, if a threshold size for comparing the size of the image is set in advance, and the size of the image is larger than or equal to the preset size, the quantization frequency coefficients sequentially read from the quantization frequency coefficient sequence are converted into quantization frequency coefficients of the quantized residual block. Arrange the quantized frequency coefficients of the positions of the coefficients of the DC component and the positions of the coefficients of the lowest coefficient of the quantized residual block, and give the higher priority to the positions of the coefficients of the DC component. The initial inverse scanning pattern can be determined. In addition, when the size of the image is smaller than the preset size, the same priority is given to the position corresponding to the coefficient of the DC component among the positions of the quantization frequency coefficients of the quantized residual block and the position corresponding to the lowest coefficient of the square residual block. An initial reverse scanning pattern can be determined.

도 19의 예에서, 기 설정된 크기가 720p이고 영상의 크기가 CIF인 경우, 영 상의 크기가 기 설정된 크기 보다 작으므로 DC 성분의 계수에 해당하는 위치와 최하단 계수에 해당하는 위치에 동일한 우선 순위를 두어 역 스캐닝함으로써 도시한 바와 같은 양자화된 잔차 블록을 얻을 수 있다.In the example of FIG. 19, when the preset size is 720p and the image size is CIF, since the size of the image is smaller than the preset size, the same priority is given to the position corresponding to the coefficient of the DC component and the position corresponding to the lowest coefficient. By inverse scanning, a quantized residual block as shown can be obtained.

또한, 역 스캐닝되어 양자화된 잔차 블록이 구성되면 현재 블록의 예측 모드의 예측 방향인 수직 방향에 따라 양자화된 잔차 블록이 복수 개로 분할되어 복수 개의 직사각 잔차 블록이 생성된다.In addition, when the quantized residual block is inversely scanned, a plurality of rectangular residual blocks are generated by dividing the quantized residual blocks into a plurality of vertical blocks according to the vertical direction, which is a prediction direction of the prediction mode of the current block.

도 20은 본 발명의 일 실시예에 따라 역 스캐닝 패턴을 갱신하는 과정을 설명하기 위한 예시도이다.20 is an exemplary diagram for explaining a process of updating a reverse scanning pattern according to an embodiment of the present invention.

영상 복호화 장치(200)에서 스캐닝 패턴을 갱신한 것과 같이, 영상 복호화 장치(1500)도 역 스캐닝 패턴을 갱신할 수 있다. 즉, 블록을 복호화할 때마다 처음에 결정된 초기 역 스캐닝 패턴을 사용하여 역 스캐닝하는 것이 아니라, 적응적으로 역 스캐닝 패턴을 갱신하여 스캐닝한다.As the image decoding apparatus 200 updates the scanning pattern, the image decoding apparatus 1500 may update the reverse scanning pattern. In other words, each time the block is decoded, the reverse scanning pattern is adaptively updated and scanned instead of using the initially determined initial reverse scanning pattern.

이때, 역 스캐닝 패턴을 갱신하는 기준은 스캐닝 패턴을 갱신하는 기준과 유사하다. 즉, 양자화된 잔차 블록의 각 위치마다 '0'이 아닌 양자화 주파수 계수가 발생할 확률이 될 수 있다. 예를 들어, 영상의 복수 개의 블록을 복호화할 때마다, 양자화된 잔차 블록의 각 위치에서 '0'이 아닌 양자화 주파수 계수가 발생할 확률을 계산하고 그 확률이 큰 순서대로 역 스캐닝 순서를 결정함으로써, 역 스캐닝 패턴을 적응적으로 갱신할 수 있다.At this time, the criteria for updating the reverse scanning pattern is similar to the criteria for updating the scanning pattern. That is, it may be a probability that a quantization frequency coefficient other than '0' occurs for each position of the quantized residual block. For example, each time a plurality of blocks of an image are decoded, the probability of occurrence of a non-zero quantization frequency coefficient at each position of the quantized residual block is calculated and the reverse scanning order is determined in the order of the greatest probability. The inverse scanning pattern can be updated adaptively.

도 21은 본 발명의 다른 실시예에 따른 영상 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.21 is a block diagram schematically illustrating an electronic configuration of a video encoding apparatus according to another embodiment of the present invention.

본 발명의 다른 실시예에 따른 영상 부호화 장치(2100)는 정사각 부호화부(210), 부호화 선택부(230), 예측 방향 전환부(2110) 및 직사각 부호화부(2120)를 포함하여 구성될 수 있다.The image encoding apparatus 2100 according to another embodiment of the present invention may include a square encoder 210, an encoding selector 230, a prediction direction changer 2110, and a rectangular encoder 2120. .

이러한 영상 부호화 장치(2100)는 개인용 컴퓨터(PC: Personal Computer), 노트북 컴퓨터, 개인 휴대 단말기(PDA: Personal Digital Assistant), 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 이동통신 단말기(Mobile Communication Terminal) 등일 수 있으며, 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, 영상을 부호화하기 위한 각종 프로그램과 데이터를 저장하기 위한 메모리, 프로그램을 실행하여 연산 및 제어하기 위한 마이크로프로세서 등을 구비하는 다양한 장치를 의미한다.The video encoding apparatus 2100 may be a personal computer (PC), a notebook computer, a personal digital assistant (PDA), a portable multimedia player (PMP), or a PlayStation Portable (PSP). ), A communication device such as a communication modem for communicating with various devices or a wired / wireless communication network, a memory for storing various programs and data for encoding an image, and executing a program. Means a variety of devices including a microprocessor for operation and control.

정사각 부호화부(210)와 부호화 선택부(230)는 도 2를 통해 전술한 바와 동일 또는 유사한 역할을 수행하므로, 그에 대한 상세한 설명은 생략한다.Since the square encoder 210 and the encoding selector 230 perform the same or similar roles as described above with reference to FIG. 2, a detailed description thereof will be omitted.

예측 방향 전환부(2110)는 직사각 부호화부(2120)에서 단계적으로 부호화되는 각 직사각 현재 블록 이전에 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값에 따라 각 직사각 현재 블록의 예측 방향을 변경한다.The prediction direction switching unit 2110 changes the prediction direction of each rectangular current block according to the coefficient value of the quantization frequency coefficient of the rectangular previous block coded before the rectangular current block coded stepwise by the rectangular encoder 2120.

이를 위해, 예측 방향 전환부(2110)는 직사각 부호화부(2120)와 연결되어 직사각 부호화부(2120)로부터 각 직사각 현재 블록 이전에 부호화된 직사각 이전 블록의 양자화 주파수 계수를 수신하여 저장한다.To this end, the prediction direction switcher 2110 is connected to the rectangular encoder 2120 to receive and store the quantized frequency coefficients of the previous rectangular block encoded before each rectangular current block from the rectangular encoder 2120.

직사각 부호화부(2120)는 현재 블록이 입력되면 직사각형 블록 단위로 분할 하여 생성되는 복수 개의 직사각 현재 블록을 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 출력한다. 이때, 직사각 부호화부(2120)는 예측 방향 전환부(2110)에 의해 변경된 예측 방향에 따라 복수 개의 직사각 현재 블록을 예측할 수 있다.When the current block is input, the rectangular encoder 2120 sequentially outputs a rectangular encoded bitstream by sequentially encoding a plurality of rectangular current blocks generated by dividing the rectangular blocks into units. In this case, the rectangular encoder 2120 may predict the plurality of rectangular current blocks according to the prediction direction changed by the prediction direction switcher 2110.

직사각 부호화부(2120)는 도 4를 통해 전술한 직사각 부호화부(220)와 동일한 구조를 가진다. 다만, 직사각 부호화부(460)와 직사각 예측부(492)가 예측 방향 전환부(2110)에 연결되며, 직사각 부호화부(460)는 직사각 스캔부(450)로부터 전달되는 각 직사각 현재 블록의 양자화 주파수 계수를 예측 방향 전환부(2110)에 전달하고, 직사각 예측부(492)는 예측 방향 전환부(2110)로부터 전달되는 예측 방향에 따라 각 직사각 현재 블록을 예측한다. 여기서, 직사각 예측부(492)가 예측 방향 전환부(2110)로부터 수신하는 예측 방향은 현재 블록의 예측 모드의 예측 방향일 수 있지만, 직사각 이전 블록의 양자화 주파수 계수에 따라 변경된 예측 방향일 수도 있다.The rectangular encoder 2120 has the same structure as the rectangular encoder 220 described above with reference to FIG. 4. However, the rectangular encoder 460 and the rectangular predictor 492 are connected to the prediction direction switching unit 2110, and the rectangular encoder 460 is a quantization frequency of each rectangular current block transmitted from the rectangular scan unit 450. The coefficient is transmitted to the prediction direction switching unit 2110, and the rectangular prediction unit 492 predicts each rectangular current block according to the prediction direction transmitted from the prediction direction switching unit 2110. Here, the prediction direction received by the rectangular prediction unit 492 from the prediction direction switching unit 2110 may be a prediction direction of the prediction mode of the current block, but may also be a prediction direction changed according to the quantization frequency coefficient of the previous rectangular block.

도 22는 본 발명의 다른 실시예에 따른 예측 방향 전환 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.FIG. 22 is a block diagram schematically illustrating an electronic configuration of an apparatus for predicting direction change according to another embodiment of the present invention.

본 발명의 다른 실시예에 따른 예측 방향 전환 장치는 도 21에서는 예측 방향 전환부(2110)로 구현될 수 있다. 이하에서는 본 발명의 다른 실시예에 따른 예측 방향 전환 장치를 예측 방향 전환부(2110)라 칭한다.The prediction direction switching device according to another embodiment of the present invention may be implemented by the prediction direction switching unit 2110 in FIG. 21. Hereinafter, the prediction direction switching device according to another embodiment of the present invention is called a prediction direction switching unit 2110.

본 발명의 다른 실시예에 따른 예측 방향 전환부(2110)는 이전 블록 계수 저장부(2210), 예측 방향 결정부(2220), 부호화 비용 계산부(2230) 및 예측 방향 식 별자 출력부(2240)를 포함하여 구성된다.According to another exemplary embodiment of the present invention, the prediction direction switching unit 2110 may include a previous block coefficient storage unit 2210, a prediction direction determination unit 2220, an encoding cost calculator 2230, and a prediction direction identifier output unit 2240. It is configured to include.

이전 블록 계수 저장부(2210)는 직사각 이전 블록의 양자화 주파수 계수를 저장한다. 즉, 이전 블록 계수 저장부(2210)는 직사각 부호화부(2120)에서 각 직사각 현재 블록을 부호화할 때마다. 각 직사각 현재 블록의 양자화 주파수 계수를 수신하여 저장하는데, 이 양자화 주파수 계수가 다음번의 직사각 현재 블록을 예측하기 위한 예측 방향을 결정하는 데에 기준이 되는 직사각 이전 블록의 양자화 주파수 계수가 된다.The previous block coefficient storage unit 2210 stores the quantized frequency coefficients of the rectangular previous block. That is, each time the previous block coefficient storage unit 2210 encodes each rectangular current block by the rectangular encoder 2120. A quantization frequency coefficient of each rectangular current block is received and stored, and the quantization frequency coefficient becomes a quantization frequency coefficient of a previous rectangular block that is a reference for determining a prediction direction for predicting a next rectangular current block.

예측 방향 결정부(2220)는 현재 블록을 직사각형 블록 단위로 분할하여 생성된 복수 개의 직사각 현재 블록을 단계적으로 부호화할 때, 각 직사각 현재 블록에 대한 예측 방향을 변경한다. 예측 방향 결정부(2220)는 이전 블록 계수 저장부(2210)에 저장된 직사각 이전 블록의 양자화 주파수 계수의 계수값을 확인하여, 직사각 이전 블록의 양자화 주파수 계수의 계수값이 모두 '0'인 경우에는 기준 예측 방향을 각 직사각 현재 블록의 예측 방향으로 결정한다. 또한, 예측 방향 결정부(2220)는 직사각 이전 블록의 양자화 주파수 계수의 계수값 중 하나 이상이 '0'이 아닌 경우에는 복수 개의 예측 방향 후보 중 부호화 비용이 최소(또는 부호화 효율이 최대)인 예측 방향을 각 직사각 현재 블록의 예측 방향으로 결정한다. The prediction direction determiner 2220 changes the prediction direction for each rectangular current block when stepwise encoding a plurality of rectangular current blocks generated by dividing the current block into rectangular block units. The prediction direction determiner 2220 checks the coefficient values of the quantization frequency coefficients of the rectangular rectangular block stored in the previous block coefficient storage unit 2210, and when the coefficient values of the quantized frequency coefficients of the rectangular rectangular block are all '0'. The reference prediction direction is determined as the prediction direction of each rectangular current block. In addition, when one or more coefficient values of the quantization frequency coefficients of the rectangular previous block are not '0', the prediction direction determiner 2220 may predict that the encoding cost is the minimum (or the maximum coding efficiency) among the plurality of prediction direction candidates. The direction is determined as the prediction direction of each rectangular current block.

즉, 현재 예측하고자 하는 직사각 현재 블록을 부호화하기 이전에 이미 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값이 모두 '0'이었다면, 예측이 거의 완벽하게 이루어져 부호화 효율이 매우 뛰어나다는 것을 의미하므로, 직사각 이전 블록의 기준 예측 방향을 각 직사각 현재 블록의 예측 방향으로 결정하는 것이다. 여기서, 기준 예측 방향이란 직사각 현재 블록이 분할된 현재 블록의 예측 방향이거나 직사각 이전 블록의 예측 방향을 말한다.That is, if the coefficient values of the quantization frequency coefficients of the rectangular block previously encoded before encoding the rectangular current block to be currently predicted are all '0', this means that the prediction is almost complete and the encoding efficiency is very excellent. The reference prediction direction of the previous rectangular block is determined as the prediction direction of each rectangular current block. Here, the reference prediction direction refers to the prediction direction of the current block in which the rectangular current block is divided or the prediction direction of the previous rectangular block.

또한, 현재 예측하고자 하는 직사각 현재 블록을 부호화하기 이전에 이미 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값 중 적어도 하나 이상이 '0'이 아니었다면, 예측의 정확도가 떨어져서 부호화 효율이 매우 높은 것은 아니라는 것을 의미하므로, 기준 예측 방향을 그대로 사용하지 않고 예측 방향을 변경하기 위해, 복수 개의 예측 방향 후보 중 부호화 비용이 최소인 예측 방향을 각 직사각 현재 블록의 예측 방향으로 결정한다. 여기서, 예측 방향 후보군이란 직사각 현재 블록의 예측 방향으로 결정될 복수 개의 예측 방향으로서, 기준 예측 방향을 제외한 예측 방향을 말한다. 예측 방향 후보군은 인트라 4x4 예측의 경우 총 9가지의 예측 방향 중 기준 예측 방향을 제외한 8가지의 예측 방향이 될 수도 있다. 다만, 이와 같이 예측 방향의 개수가 많아지면 계산량이 복잡해 져서 부호화 효율이 떨어질 수 있으므로 예측 방향의 개수를 더 작은 수로 제한할 수 있다. 예를 들면, 기준 예측 방향을 중심으로 양 옆의 예측 방향을 예측 방향 후보군으로 선택할 수 있을 것이다.In addition, if at least one or more of the coefficient values of the quantization frequency coefficients of the previous rectangular block previously encoded before encoding the rectangular current block to be predicted are not '0', the prediction accuracy is low and the encoding efficiency is very high. In order to change the prediction direction without using the reference prediction direction as it is, the prediction direction having the smallest encoding cost among the plurality of prediction direction candidates is determined as the prediction direction of each rectangular current block. Here, the prediction direction candidate group is a plurality of prediction directions to be determined as the prediction directions of the rectangular current block, and refers to prediction directions other than the reference prediction direction. The prediction direction candidate group may be eight prediction directions except for the reference prediction direction among a total of nine prediction directions in the case of intra 4x4 prediction. However, as the number of prediction directions increases, the computational complexity increases and the coding efficiency may decrease, so that the number of prediction directions may be limited to a smaller number. For example, the prediction directions on both sides of the reference prediction direction may be selected as the prediction direction candidate group.

부호화 비용 계산부(2230)는 복수 개의 예측 방향 후보의 각 예측 방향에 따른 부호화 비용을 계산한다. 여기서, 부호화 비용은 율-왜곡 비용이 될 수 있지만 반드시 이에 한정되지는 않을 뿐만 아니라, 부호화 비용에 한정하지 않고 부호화 효율을 측정할 수 있는 비용이 될 수 있다. 또한, 예측 방향에 따른 부호화 비용이란 해당 예측 방향으로 부호화했을 때 소요되는 비용을 의미한다.The encoding cost calculator 2230 calculates an encoding cost according to each prediction direction of the plurality of prediction direction candidates. Here, the encoding cost may be a rate-distortion cost, but is not necessarily limited thereto, and may be a cost for measuring encoding efficiency without being limited to the encoding cost. In addition, the encoding cost according to the prediction direction means a cost required when encoding in the prediction direction.

예측 방향 식별자 출력부(2240)는 각 직사각 현재 블록의 예측 방향을 식별하기 위한 예측 방향 식별자를 출력한다.The prediction direction identifier output unit 2240 outputs a prediction direction identifier for identifying a prediction direction of each rectangular current block.

도 23은 본 발명의 일 실시예에 따른 예측 방향 전환 방법을 설명하기 위한 순서도이다.23 is a flowchart illustrating a prediction direction switching method according to an embodiment of the present invention.

예측 방향 전환부(2110)는 직사각 부호화부(2120)로부터 전달되는 직사각 이전 블록의 양자화 주파수 계수를 저장한 상태에서(S2310), 직사각 현재 블록의 예측 방향을 결정할 때에는 직사각 이전 블록의 양자화 주파수 계수를 확인하여 양자화 주파수 계수 모두가 '0'인 경우에는 현재 블록의 예측 방향을 기준 예측 방향으로 결정하고(S2330), 양자화 주파수 계수 중 적어도 하나 이상이 '0'이 아닌 경우에는 기준 예측 방향을 제외한 나머지 예측 방향 즉, 예측 방향 후보군의 각 예측 방향에 따른 부호화 비용을 계산하고(S2340), 각 부호화 비용을 비교하여 최소의 부호화 비용을 갖는 예측 방향을 현재 블록의 예측 방향으로서 결정한다(S2350). 즉, 예측 방향이 기준 예측 방향에서 변경된다.The prediction direction switching unit 2110 stores the quantization frequency coefficients of the rectangular previous block transmitted from the rectangular encoder 2120 (S2310), and when determining the prediction direction of the rectangular current block, determines the quantization frequency coefficients of the previous rectangular block. When all of the quantization frequency coefficients are '0', the prediction direction of the current block is determined as the reference prediction direction (S2330). When at least one or more of the quantization frequency coefficients is not '0', the remaining prediction except for the reference prediction direction is determined. The prediction cost, that is, the encoding cost according to each prediction direction of the prediction direction candidate group is calculated (S2340), and the prediction direction having the minimum encoding cost is determined as the prediction direction of the current block by comparing each encoding cost (S2350). That is, the prediction direction is changed in the reference prediction direction.

도 24 및 도 25는 본 발명의 다른 실시예에 따른 예측 방향 후보군을 설명하기 위한 예시도이다.24 and 25 are exemplary diagrams for describing a prediction direction candidate group according to another embodiment of the present invention.

도 24를 참조하면, 현재 블록의 예측 모드가 수평 모드인 경우, 현재 블록의 예측 방향은 수평 방향이며, 예측 방향 후보는 현재 블록의 예측 방향인 수평 방향을 중심으로 양 옆의 방향인 대각선 오른쪽 위 방향과 대각선 오른쪽 아래 방향이 될 수 있다.Referring to FIG. 24, when the prediction mode of the current block is the horizontal mode, the prediction direction of the current block is a horizontal direction, and the prediction direction candidates are diagonally upper rightwards on both sides with respect to the horizontal direction that is the prediction direction of the current block. It can be in the direction of the bottom right and diagonally.

이때, 기준 예측 방향이 점선으로 표시된 수평 방향이었다고 가정하면, 직사 각 이전 블록(a, b, c, d)의 양자화 주파수 계수가 모두 '0'일 경우, 기준 예측 방향인 수평 방향이 그대로 직사각 현재 블록의 예측 방향이 된다. 하지만, 직사각 이전 블록(a, b, c, d)의 양자화 주파수 계수 중 적어도 하나 이상이 '0'이 아닌 경우, 예측 방향 후보 중에서 기준 예측 방향인 수평 방향을 제외한 옆의 방향인 대각선 오른쪽 위 방향과 대각선 오른쪽 아래 방향 중 부호화 비용이 최소가 되는 방향이 직사각 현재 블록의 예측 방향이 된다.In this case, assuming that the reference prediction direction is a horizontal direction indicated by a dotted line, when the quantization frequency coefficients of the rectangular previous blocks (a, b, c, d) are all '0', the horizontal direction, which is the reference prediction direction, is the rectangular current as it is. It is the prediction direction of the block. However, when at least one or more of the quantization frequency coefficients of the previous rectangular block (a, b, c, d) is not '0', the diagonal upper right direction is a side direction except for the horizontal direction that is the reference prediction direction among the prediction direction candidates. The direction in which the encoding cost becomes the minimum among the right and bottom diagonal directions is the prediction direction of the rectangular current block.

도 25를 참조하면, 현재 블록의 예측 모드가 대각선 오른쪽 아래 모드인 경우, 현재 블록의 예측 방향은 대각선 오른쪽 아래 방향이며, 예측 방향 후보는 현재 블록의 예측 방향인 대각선 오른쪽 아래 방향을 중심으로 양 옆의 방향인 수평 방향과 수직 방향이 될 수 있다.Referring to FIG. 25, when the prediction mode of the current block is a diagonal lower right mode, the prediction direction of the current block is a diagonal right lower direction, and the prediction direction candidates are located on both sides of the diagonal right lower direction, which is the prediction direction of the current block. It may be a vertical direction and a horizontal direction of.

이때, 기준 예측 방향이 점선으로 표시된 대각선 오른쪽 아래 방향이었다고 가정하면, 직사각 이전 블록(a, b, c, d)의 양자화 주파수 계수가 모두 '0'일 경우, 기준 예측 방향인 대각선 오른쪽 아래 방향이 그대로 직사각 현재 블록의 예측 방향이 된다. 하지만, 직사각 이전 블록(a, b, c, d)의 양자화 주파수 계수 중 적어도 하나 이상이 '0'이 아닌 경우, 예측 방향 후보 중에서 기준 예측 방향인 대각선 오른쪽 아래 방향을 제외한 옆의 방향인 수평 방향과 수직 방향 중 부호화 비용이 최소가 되는 방향이 직사각 현재 블록의 예측 방향이 된다.In this case, assuming that the reference prediction direction is a diagonal right lower direction indicated by a dotted line, when the quantization frequency coefficients of the previous rectangular blocks (a, b, c, d) are all '0', the diagonal right lower direction, which is the reference prediction direction, This is the prediction direction of the rectangular current block. However, when at least one or more of the quantization frequency coefficients of the previous rectangular block (a, b, c, d) is not '0', the horizontal direction is a side direction except for the lower right diagonal direction that is the reference prediction direction among the prediction direction candidates. The direction in which the encoding cost is the minimum among the and vertical directions is the prediction direction of the rectangular current block.

도 26은 본 발명의 다른 실시예에 따른 영상 복호화 장치(2600)의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.FIG. 26 is a block diagram schematically illustrating an electronic configuration of an image decoding apparatus 2600 according to another exemplary embodiment.

본 발명의 다른 실시예에 따른 영상 복호화 장치(2600)는 예측 모드 추출 부(1510), 복호화부(1520), 비트스트림 식별자 추출부(1530), 예측 방향 식별자 추출부(2610), 직사각 복원부(2620) 및 정사각 복원부(1550)를 포함하여 구성될 수 있다.The image decoding apparatus 2600 according to another embodiment of the present invention may include a prediction mode extractor 1510, a decoder 1520, a bitstream identifier extractor 1530, a prediction direction identifier extractor 2610, and a rectangular reconstructor. 2620 and the square recovery unit 1550 may be configured.

이러한 영상 복호화 장치(1500)는 개인용 컴퓨터(PC: Personal Computer), 노트북 컴퓨터, 개인 휴대 단말기(PDA: Personal Digital Assistant), 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 이동통신 단말기(Mobile Communication Terminal) 등일 수 있으며, 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, 영상을 복호화하기 위한 각종 프로그램과 데이터를 저장하기 위한 메모리, 프로그램을 실행하여 연산 및 제어하기 위한 마이크로프로세서 등을 구비하는 다양한 장치를 의미한다.The video decoding apparatus 1500 may be a personal computer (PC), a notebook computer, a personal digital assistant (PDA), a portable multimedia player (PMP), or a PlayStation Portable (PSP). ), A communication device such as a communication modem for communicating with various devices or a wired / wireless communication network, a memory for storing various programs and data for decoding an image, and executing a program. Means a variety of devices including a microprocessor for operation and control.

예측 모드 추출부(1510), 복호화부(1520), 비트스트림 식별자 추출부(1530) 및 정사각 복원부(1550)는 도 15를 통해 전술한 바와 동일 또는 유사한 기능을 수행하므로 상세한 설명은 생략한다.Since the prediction mode extractor 1510, the decoder 1520, the bitstream identifier extractor 1530, and the square reconstructor 1550 perform the same or similar functions as described above with reference to FIG. 15, a detailed description thereof will be omitted.

예측 방향 전환부(2610)는 복호화부(1520)로부터 전달되는 양자화된 주파수 계수열로부터 예측 방향 식별자를 추출하여 예측 방향 식별자에 의해 지시되는 예측 방향으로 각 직사각 현재 블록에 대한 예측 방향을 변경한다.The prediction direction switching unit 2610 extracts the prediction direction identifier from the quantized frequency coefficient sequence delivered from the decoder 1520 and changes the prediction direction for each rectangular current block in the prediction direction indicated by the prediction direction identifier.

직사각 복원부(2620)는 양자화된 주파수 계수열을 이용하여 직사각형 블록 단위로 예측 방향 전환부(2610)에 의해 변경된 예측 방향에 따라 단계적으로 현재 블록을 복원하여 출력한다. 여기서, 직사각 복원부(2620)는 도 16을 통해 전술한 직사각 복원부(1540)와 동일한 구조를 갖는다. 다만, 직사각 복원부(2620)에서는 직사각 예측부(1640)가 예측 방향 전환부(2610)와 연결되고, 직사각 예측부(1640)는 현재 블록의 예측 모드의 예측 방향이 아닌 예측 방향 전환부(2610)로부터 전달되는 예측 방향에 따라 직사각 현재 블록을 예측한다.The rectangular reconstruction unit 2620 reconstructs and outputs the current block step by step according to the prediction direction changed by the prediction direction switching unit 2610 in units of rectangular blocks using the quantized frequency coefficient sequence. Here, the rectangular restoration unit 2620 has the same structure as the rectangular restoration unit 1540 described above with reference to FIG. 16. However, in the rectangular reconstruction unit 2620, the rectangular prediction unit 1640 is connected to the prediction direction switching unit 2610, and the rectangular prediction unit 1640 is not the prediction direction of the prediction mode of the current block but the prediction direction switching unit 2610. Predicts a rectangular current block according to the prediction direction delivered from

이러한 본 발명의 다른 실시예에 따른 영상 복호화 장치(2600)는 영상을 복호화하는 방법으로서, 비트스트림으로부터 예측 모드에 대한 정보를 추출하고, 비트스트림을 복호화하여 양자화 주파수 계수열을 추출하며, 양자화 주파수 계수열로부터 예측 방향 식별자를 추출하여 예측 모드에 따른 예측 방향을 변경하며, 비트스트림으로부터 비트스트림 식별자를 추출하며, 비트스트림 식별자에 따라 양자화 주파수 계수열을 이용하여 직사각형 블록 단위로 현재 블록을 복원하되, 변경된 예측 방향에 따라 단계적으로 현재 블록을 복원하여 출력하며, 비트스트림 식별자에 따라 양자화 주파수 계수열을 이용하여 정사각형 블록 단위로 현재 블록을 복원하되, 예측 모드에 따른 예측 방향에 따라 현재 블록을 복원하여 출력한다.The image decoding apparatus 2600 according to another embodiment of the present invention is a method of decoding an image, extracts information about a prediction mode from a bitstream, decodes the bitstream to extract a quantization frequency coefficient sequence, and Extract the prediction direction identifier from the coefficient sequence to change the prediction direction according to the prediction mode, extract the bitstream identifier from the bitstream, and restore the current block in rectangular block units using the quantized frequency coefficient sequence according to the bitstream identifier. Restoring and outputting the current block step by step according to the changed prediction direction, and restoring the current block in square block units using the quantization frequency coefficient sequence according to the bitstream identifier, but restoring the current block according to the prediction direction according to the prediction mode. To print.

도 27은 본 발명의 다른 실시예에 따른 예측 방향 전환 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도이다.27 is a block diagram schematically illustrating an electronic configuration of an apparatus for predicting direction change according to another embodiment of the present invention.

본 발명의 다른 실시예에 따른 예측 방향 전환 장치는 도 26에서는 예측 방향 전환부(2610)로 구현될 수 있다. 이하에서는 본 발명의 다른 실시예에 따른 예측 방향 전환 장치를 예측 방향 전환부(2610)라 칭한다.The prediction direction switching device according to another embodiment of the present invention may be implemented as the prediction direction switching unit 2610 in FIG. 26. Hereinafter, the prediction direction switching device according to another embodiment of the present invention is called a prediction direction switching unit 2610.

본 발명의 다른 실시예에 따른 예측 방향 전환부(2610)는 이전 블록 계수 저장부(2710), 예측 방향 결정부(2720) 및 예측 방향 식별자 추출부(2730)를 포함하 여 구성될 수 있다.The prediction direction switching unit 2610 according to another embodiment of the present invention may include a previous block coefficient storage unit 2710, a prediction direction determination unit 2720, and a prediction direction identifier extractor 2730.

이전 블록 계수 저장부(2710)는 각 직사각 현재 블록 이전에 복호화된 직사각 이전 블록의 양자화 주파수 계수를 저장한다. 즉, 이전 블록 계수 저장부(2710)는 복호화부(1520)로부터 전달되는 양자화 주파수 계수열에서 직사각 현재 블록의 양자화 주파수 계수를 수신하여 저장하는데, 저장된 양자화 주파수 계수가 다음 직사각 현재 블록을 부호화할 때 사용되는 직사각 이전 블록의 양자화 주파수 계수가 된다.The previous block coefficient storage unit 2710 stores the quantized frequency coefficients of the rectangular previous block decoded before each rectangular current block. That is, the previous block coefficient storage unit 2710 receives and stores the quantization frequency coefficients of the rectangular current block in the quantization frequency coefficient sequence transmitted from the decoder 1520, when the stored quantization frequency coefficients encode the next rectangular current block. It becomes the quantization frequency coefficient of the rectangular block before use.

예측 방향 결정부(2720)는 이전 블록 계수 저장부(2710)에 저장된 직사각 이전 블록의 양자화 주파수 계수의 계수값이 모두 '0'인 경우에는 기준 예측 방향을 각 직사각 현재 블록의 예측 방향으로 결정하고, 직사각 이전 블록의 양자화 주파수 계수의 양자화 주파수 계수의 계수값 중 하나 이상이 '0'이 아닌 경우에는 양자화 주파수 계수열로부터 추출되는 예측 방향 식별자가 지시하는 예측 방향을 각 직사각 현재 블록의 예측 방향으로 결정한다.The prediction direction determiner 2720 determines the reference prediction direction as the prediction direction of each rectangular current block when the coefficient values of the quantization frequency coefficients of the rectangular previous block stored in the previous block coefficient storage unit 2710 are all '0'. If one or more coefficient values of the quantization frequency coefficients of the quantization frequency coefficients of the previous rectangular block are not '0', the prediction direction indicated by the prediction direction identifier extracted from the quantization frequency coefficient sequence is used as the prediction direction of each rectangular current block. Decide

예측 방향 식별자 추출부(2730)는 예측 방향 결정부(2720)의 제어에 따라 복호화부(1520)로부터 전달되는 양자화 주파수 계수열로부터 예측 방향 식별자를 추출한다.The prediction direction identifier extractor 2730 extracts the prediction direction identifier from the quantized frequency coefficient string transmitted from the decoder 1520 under the control of the prediction direction determiner 2720.

여기서, 기준 예측 방향은 현재 블록의 예측 방향 및 직사각 이전 블록의 예측 방향 중 하나일 수 있으며, 예측 방향 후보는 기준 예측 방향을 기준으로 결정될 수 있다.Here, the reference prediction direction may be one of the prediction direction of the current block and the prediction direction of the previous rectangular block, and the prediction direction candidate may be determined based on the reference prediction direction.

도 28은 본 발명의 다른 실시예에 따른 예측 방향 전환 방법을 설명하기 위 한 순서도이다.28 is a flowchart illustrating a prediction direction switching method according to another embodiment of the present invention.

본 발명의 다른 실시예에 따른 예측 방향 전환 장치 즉, 예측 방향 전환부(2610)는 직사각 이전 블록의 양자화 주파수 계수를 저장하고(S2810), 직사각 이전 블록의 양자화 주파수 계수가 모두 '0'인지 여부를 확인하여(S2820), 직사각 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 직사각 현재 블록의 예측 방향으로서 결정하고(S2830), 직사각 이전 블록의 양자화 주파수 계수 중 하나 이상이 '0'이 아닌 경우에는 양자화 주파수 계수열로부터 예측 방향 식별자를 추출하고(S2840), 예측 방향 식별자에 의해 지시되는 예측 방향을 직사각 현재 블록의 예측 방향으로서 결정한다(S2850).According to another exemplary embodiment of the present invention, the prediction direction switching device, that is, the prediction direction switching unit 2610 stores the quantization frequency coefficients of the previous rectangular block (S2810) and determines whether all of the quantization frequency coefficients of the previous rectangular block are '0'. In operation S2820, when the quantization frequency coefficients of the rectangular previous block are all '0', the reference prediction direction is determined as the prediction direction of the rectangular current block (S2830), and at least one of the quantization frequency coefficients of the rectangular rectangular block is If it is not '0', the prediction direction identifier is extracted from the quantized frequency coefficient sequence (S2840), and the prediction direction indicated by the prediction direction identifier is determined as the prediction direction of the rectangular current block (S2850).

도 29 및 도 30은 본 발명의 다른 실시예에 따른 예측 방향 후보군을 설명하기 위한 예시도이다.29 and 30 are exemplary diagrams for describing a prediction direction candidate group according to another embodiment of the present invention.

직사각 이전 블록의 양자화 주파수 계수의 계수값에 따라 기준 예측 방향을 직사각 현재 블록의 예측 방향으로 결정하거나, 예측 방향 식별자에 의해 지시되는 현재 블록의 예측 모드의 예측 방향을 기준으로 양 옆의 예측 방향 중 한 방향을 직사각 현재 블록의 예측 방향으로 결정한다.The reference prediction direction is determined as the prediction direction of the rectangular current block according to the coefficient value of the quantization frequency coefficient of the previous rectangular block, or among the prediction directions on both sides based on the prediction direction of the prediction mode of the current block indicated by the prediction direction identifier. One direction is determined as the prediction direction of the rectangular current block.

이와 같은 실시예를 통해 다음과 같은 실시예를 응용할 수도 있다. 즉, 정사각형 블록 단위로 예측하고 변환하고 양자화할 때, 각 정사각형 블록을 예측할 때마다 해당 블록의 예측 모드의 예측 방향에 따라 예측하는 것이 아니라, 이전 정사각형 블록의 양자화 주파수 계수를 확인하여 양자화 주파수 계수의 계수값에 따라 예측 방향을 변경하여 예측함으로써, 예측의 정확도를 높여 부호화 효율을 높일 수 있다.Through such embodiments, the following embodiments may be applied. In other words, when predicting, transforming, and quantizing a square block unit, each square block is predicted according to the prediction direction of the prediction mode of the corresponding block, and the quantization frequency coefficient of the previous square block is checked to determine the quantization frequency coefficient. By predicting by changing the prediction direction according to the coefficient value, the coding efficiency can be increased by increasing the accuracy of the prediction.

따라서, 본 발명의 또 다른 실시예에 따른 예측 방향 전환 장치는 영상 부호화를 위해 영상의 현재 블록을 예측할 때, 현재 블록 이전에 부호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 현재 블록의 양자화 주파수 계수가 입력되면 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 현재 블록의 예측 방향으로서 결정하고, 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 복수 개의 예측 방향 후보의 부호화 비용을 계산하여 부호화 비용이 최소인 예측 방향을 현재 블록의 예측 방향으로 결정할 수 있다. 또한, 예측 방향 전환 장치는 현재 블록의 예측 방향을 식별하기 위한 예측 방향 식별자를 출력할 수 있다.Therefore, when the prediction direction switching device according to another embodiment of the present invention predicts a current block of an image for image encoding, the prediction direction shifting device stores the quantized frequency coefficient of the previous block encoded before the current block and stores the quantized frequency coefficient of the current block. When the frequency coefficient is input, if the quantization frequency coefficients of the previous block are all '0', the reference prediction direction is determined as the prediction direction of the current block, and if one or more coefficients of the quantization frequency coefficients of the previous block are not '0', The encoding cost of the plurality of prediction direction candidates may be calculated to determine the prediction direction having the smallest encoding cost as the prediction direction of the current block. In addition, the prediction direction switching device may output a prediction direction identifier for identifying the prediction direction of the current block.

또한, 본 발명의 또 다른 실시예에 따른 예측 방향 전환 장치는 영상 복호화를 위해 영상의 현재 블록을 예측할 때, 현재 블록 이전에 복호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 현재 블록의 양자화 주파수 계수가 입력되면 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 현재 블록의 예측 방향으로서 결정하고, 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 현재 블록의 양자화 주파수 계수로부터 예측 방향 식별자를 추출하여 예측 방향 식별자에 의해 지시되는 예측 방향을 현재 블록의 예측 방향으로서 결정할 수 있다.Also, when the prediction direction change device according to another embodiment of the present invention predicts a current block of an image for image decoding, the quantization frequency coefficient of the previous block decoded before the current block is stored, and the quantization of the current block is performed. When the frequency coefficient is input, if the quantization frequency coefficients of the previous block are all '0', the reference prediction direction is determined as the prediction direction of the current block, and if one or more coefficients of the quantization frequency coefficients of the previous block are not '0', A prediction direction identifier may be extracted from the quantization frequency coefficient of the current block to determine the prediction direction indicated by the prediction direction identifier as the prediction direction of the current block.

여기서, 기준 예측 방향은 현재 블록의 예측 방향 및 이전 블록의 예측 방향 중 하나일 수 있으며, 예측 방향 후보는 기준 예측 방향을 기준으로 결정될 수 있 다.Here, the reference prediction direction may be one of the prediction direction of the current block and the prediction direction of the previous block, and the prediction direction candidate may be determined based on the reference prediction direction.

이상에서, 본 발명의 실시예를 구성하는 모든 구성 요소들이 하나로 결합하여 동작하는 것으로 설명되었다고 해서, 본 발명이 반드시 이러한 실시예에 한정되는 것은 아니다. 즉, 본 발명의 목적 범위 안에서라면, 그 모든 구성 요소들이 하나 이상으로 선택적으로 결합하여 동작할 수도 있다. 또한, 그 모든 구성 요소들이 각각 하나의 독립적인 하드웨어로 구현될 수 있지만, 각 구성 요소들의 그 일부 또는 전부가 선택적으로 조합되어 하나 또는 복수 개의 하드웨어에서 조합된 일부 또는 전부의 기능을 수행하는 프로그램 모듈을 갖는 컴퓨터 프로그램으로서 구현될 수도 있다. 그 컴퓨터 프로그램을 구성하는 코드들 및 코드 세그먼트들은 본 발명의 기술 분야의 당업자에 의해 용이하게 추론될 수 있을 것이다. 이러한 컴퓨터 프로그램은 컴퓨터가 읽을 수 있는 저장매체(Computer Readable Media)에 저장되어 컴퓨터에 의하여 읽혀지고 실행됨으로써, 본 발명의 실시예를 구현할 수 있다. 컴퓨터 프로그램의 저장매체로서는 자기 기록매체, 광 기록매체, 캐리어 웨이브 매체 등이 포함될 수 있다.In the above description, it is described that all the components constituting the embodiments of the present invention operate in combination, but the present invention is not necessarily limited to these embodiments. That is, within the scope of the present invention, all of the components may be selectively coupled to one or more of them. In addition, although all of the components may be implemented as one independent hardware, some or all of the components may be selectively combined to perform a part or all of the functions in one or a plurality of hardware. As shown in FIG. The codes and code segments constituting the computer program may be easily deduced by those skilled in the art. Such a computer program can be stored in a computer-readable storage medium, readable and executed by a computer, thereby realizing an embodiment of the present invention. As the storage medium of the computer program, a magnetic recording medium, an optical recording medium, a carrier wave medium, or the like may be included.

또한, 이상에서 기재된 "포함하다", "구성하다" 또는 "가지다" 등의 용어는, 특별히 반대되는 기재가 없는 한, 해당 구성 요소가 내재할 수 있음을 의미하는 것이므로, 다른 구성 요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것으로 해석되어야 한다. 기술적이거나 과학적인 용어를 포함한 모든 용어들은, 다르게 정의되지 않는 한, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미가 있다. 사전에 정의된 용어 와 같이 일반적으로 사용되는 용어들은 관련 기술의 문맥상의 의미와 일치하는 것으로 해석되어야 하며, 본 발명에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Furthermore, the terms "comprises", "comprising", or "having" described above mean that a component can be implanted unless otherwise specifically stated, But should be construed as including other elements. All terms, including technical and scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. Commonly used terms, such as predefined terms, should be interpreted to be consistent with the contextual meanings of the related art, and are not to be construed as ideal or overly formal, unless expressly defined to the contrary.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The foregoing description is merely illustrative of the technical idea of the present invention, and various changes and modifications may be made by those skilled in the art without departing from the essential characteristics of the present invention. Therefore, the embodiments disclosed in the present invention are intended to illustrate rather than limit the scope of the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The protection scope of the present invention should be interpreted by the following claims, and all technical ideas within the equivalent scope should be interpreted as being included in the scope of the present invention.

이상에서 설명한 바와 같이 본 발명은 영상을 부호화하거나 복호화하는 장치와 방법과 관련된 분야에 적용되어, 영상을 부호화하거나 복호화할 때 예측의 정확도를 높일 수 있어 영상의 부호화 효율을 향상시킬 수 있는 효과를 발생하는 매우 유용한 발명이다.As described above, the present invention is applied to a field related to an apparatus and a method for encoding or decoding an image, so that the accuracy of prediction can be improved when coding or decoding an image, Is a very useful invention.

도 1은 통상적인 9 가지의 4x4 인트라 예측 모드를 나타내는 예시도,1 is an exemplary diagram showing nine conventional 4x4 intra prediction modes,

도 2는 본 발명의 일 실시예에 따른 영상 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,2 is a block diagram schematically illustrating an electronic configuration of an image encoding apparatus according to an embodiment of the present invention;

도 3은 본 발명의 일 실시예에 따른 정사각 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,3 is a block diagram schematically illustrating an electronic configuration of a square-angle encoding apparatus according to an embodiment of the present invention.

도 4는 본 발명의 일 실시예에 따른 직사각 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,FIG. 4 is a block diagram schematically illustrating an electronic configuration of a rectangular encoder according to an embodiment of the present invention. FIG.

도 5는 본 발명의 일 실시예에 따른 부호화 선택 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,5 is a block diagram schematically illustrating an electronic configuration of an encoding selection apparatus according to an embodiment of the present invention.

도 6은 본 발명의 일 실시예에 따른 영상 부호화 방법을 설명하기 위한 순서도,6 is a flowchart illustrating an image encoding method according to an embodiment of the present invention.

도 7은 본 발명의 일 실시예에 따른 비트스트림 선택 과정을 설명하기 위한 순서도,FIG. 7 is a flowchart illustrating a bitstream selection process according to an embodiment of the present invention. FIG.

도 8은 본 발명의 일 실시예에 따른 직사각 현재 블록을 나타낸 예시도,8 is a diagram illustrating a rectangular current block according to an embodiment of the present invention.

도 9는 본 발명의 일 실시예에 따라 직사각 예측부가 단계적 인트라 예측을 수행하는 과정을 설명하기 위한 예시도,9 is a diagram illustrating a process of performing a stepwise intra prediction by a rectangular prediction unit according to an embodiment of the present invention.

도 10은 본 발명의 일 실시예에 따른 직사각 스캔 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,10 is a block diagram schematically showing an electronic configuration of a rectangular scanning device according to an embodiment of the present invention.

도 11은 본 발명의 일 실시예에 따라 초기 스캐닝 패턴을 결정하는 방법을 설명하기 위한 순서도,11 is a flowchart illustrating a method for determining an initial scanning pattern according to an exemplary embodiment of the present invention.

도 12는 본 발명의 바람직한 실시예에 따라 복수 개의 직사각 잔차 블록이 정사각 잔차 블록으로 결합된 것을 나타낸 예시도,FIG. 12 is a diagram illustrating an example in which a plurality of rectangular residual blocks are combined into a square residual block according to a preferred embodiment of the present invention;

도 13은 본 발명의 일 실시예에 따라 초기 스캐닝 패턴을 결정하는 과정을 설명하기 위한 예시도,13 is an exemplary diagram for explaining a process of determining an initial scanning pattern according to an embodiment of the present invention;

도 14는 본 발명의 일 실시예에 따라 스캐닝 패턴을 갱신하는 과정을 설명하기 위한 예시도,FIG. 14 is an exemplary diagram for explaining a process of updating a scanning pattern according to an embodiment of the present invention;

도 15는 본 발명의 일 실시예에 따른 영상 복호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,15 is a block diagram schematically illustrating an electronic configuration of an image decoding apparatus according to an embodiment of the present invention.

도 16은 본 발명의 일 실시예에 따른 직사각 복호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,16 is a block diagram schematically illustrating an electronic configuration of a rectangular decoding apparatus according to an embodiment of the present invention;

도 17은 본 발명의 일 실시예에 따른 정사각 복호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,17 is a block diagram schematically illustrating an electronic configuration of a square decoding apparatus according to an embodiment of the present invention;

도 18은 본 발명의 일 실시예에 따른 영상 복호화 방법을 설명하기 위한 순서도,18 is a flowchart for explaining a video decoding method according to an embodiment of the present invention.

도 19는 본 발명의 일 실시예에 따라 초기 역 스캐닝 패턴에 따라 역 스캐닝하는 과정을 설명하기 위한 예시도,19 is an exemplary view for explaining a process of inverse scanning according to an initial reverse scanning pattern according to an embodiment of the present invention;

도 20은 본 발명의 일 실시예에 따라 역 스캐닝 패턴을 갱신하는 과정을 설명하기 위한 예시도,20 is an exemplary diagram for explaining a process of updating an inverse scanning pattern according to an embodiment of the present invention.

도 21은 본 발명의 다른 실시예에 따른 영상 부호화 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,FIG. 21 is a block diagram schematically showing an electronic configuration of an image encoding apparatus according to another embodiment of the present invention; FIG.

도 22는 본 발명의 다른 실시예에 따른 예측 방향 전환 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,22 is a block diagram schematically showing an electronic configuration of a prediction direction switching apparatus according to another embodiment of the present invention;

도 23은 본 발명의 일 실시예에 따른 예측 방향 전환 방법을 설명하기 위한 순서도,23 is a flowchart for explaining a prediction direction switching method according to an embodiment of the present invention;

도 24 및 도 25는 본 발명의 다른 실시예에 따른 예측 방향 후보군을 설명하기 위한 예시도,24 and 25 are diagrams for explaining a prediction direction candidate group according to another embodiment of the present invention,

도 26은 본 발명의 다른 실시예에 다른 영상 복호화 장치(2600)의 전자적인 구성을 간략하게 나타낸 블록 구성도,FIG. 26 is a block diagram schematically illustrating an electronic configuration of an image decoding apparatus 2600 according to another embodiment of the present invention.

도 27은 본 발명의 다른 실시예에 따른 예측 방향 전환 장치의 전자적인 구성을 간략하게 나타낸 블록 구성도,27 is a block diagram schematically showing an electronic configuration of a prediction direction switching apparatus according to another embodiment of the present invention;

도 28은 본 발명의 다른 실시예에 따른 예측 방향 전환 방법을 설명하기 위한 순서도,28 is a flowchart for explaining a prediction direction switching method according to another embodiment of the present invention;

도 29 및 도 30은 본 발명의 다른 실시예에 따른 예측 방향 후보군을 설명하기 위한 예시도이다.29 and 30 are exemplary diagrams for describing a prediction direction candidate group according to another embodiment of the present invention.

Claims (18)

영상의 현재 블록을 부호화하는 장치에 있어서,In the device for encoding the current block of the video, 상기 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 생성되는 복수 개의 직사각 현재 블록을 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 출력하는 직사각 부호화부;A rectangular encoder for outputting a rectangular encoded bitstream by stepwise encoding a plurality of rectangular current blocks generated by dividing the rectangular blocks in rectangular units when the current block is input; 상기 단계적으로 부호화되는 각 직사각 현재 블록 이전에 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값에 따라 상기 각 직사각 현재 블록의 예측 방향을 변경하는 예측 방향 전환부;A prediction direction switching unit for changing a prediction direction of each rectangular current block according to a coefficient value of a quantization frequency coefficient of a rectangular previous block coded before each rectangular current block coded stepwise; 상기 현재 블록이 입력되면 정사각형 블록 단위로 부호화함으로써 정사각 부호화 비트스트림을 출력하는 정사각 부호화부; 및A square encoder configured to output a square encoded bitstream by encoding the current block in units of square blocks; And 상기 직사각 부호화 비트스트림의 부호화 비용과 상기 정사각 부호화 비트스트림의 부호화 비용을 계산하여 최소 부호화 비용을 갖는 비트스트림을 출력하는 부호화 선택부An encoding selector configured to calculate a coding cost of the rectangular encoded bitstream and an encoding cost of the square encoded bitstream and output a bitstream having a minimum encoding cost 를 포함하는 것을 특징으로 하는 영상 부호화 장치.An image encoding apparatus comprising a. 제 1 항에 있어서, 상기 예측 방향 전환부는,The method of claim 1, wherein the prediction direction switching unit, 상기 직사각 이전 블록의 양자화 주파수 계수를 저장하는 이전 블록 계수 저장부;A previous block coefficient storage unit for storing quantized frequency coefficients of the rectangular previous block; 상기 양자화 주파수 계수의 계수값이 모두 '0'인 경우에는 기준 예측 방향을 상기 각 직사각 현재 블록의 예측 방향으로 결정하고, 상기 양자화 주파수 계수의 계수값 중 하나 이상이 '0'이 아닌 경우에는 복수 개의 예측 방향 후보 중 부호화 비용이 최소인 예측 방향을 상기 각 직사각 현재 블록의 예측 방향으로 결정하는 예측 방향 결정부;When the coefficient values of the quantization frequency coefficients are all '0', the reference prediction direction is determined as the prediction direction of each rectangular current block, and when one or more of the coefficient values of the quantization frequency coefficients are not '0', A prediction direction determiner which determines a prediction direction having the least encoding cost among the prediction direction candidates as prediction directions of the rectangular current blocks; 상기 복수 개의 예측 방향 후보의 각 예측 방향에 따른 부호화 비용을 계산하는 부호화 비용 계산부; 및An encoding cost calculator configured to calculate an encoding cost according to each prediction direction of the plurality of prediction direction candidates; And 상기 각 직사각 현재 블록의 예측 방향을 식별하기 위한 예측 방향 식별자를 출력하는 예측 방향 식별자 출력부Prediction direction identifier output unit for outputting a prediction direction identifier for identifying the prediction direction of each rectangular current block 를 포함하는 것을 특징으로 하는 영상 부호화 장치.An image encoding apparatus comprising a. 제 2 항에 있어서, 상기 기준 예측 방향은,The method of claim 2, wherein the reference prediction direction is 상기 현재 블록의 예측 방향 및 상기 직사각 이전 블록의 예측 방향 중 하나인 것으로 특징으로 하는 영상 부호화 장치.And one of a prediction direction of the current block and a prediction direction of the rectangular previous block. 제 2 항에 있어서, 상기 예측 방향 후보는,The method of claim 2, wherein the prediction direction candidate is: 상기 기준 예측 방향을 기준으로 결정되는 것을 특징으로 하는 영상 부호화 장치.And the image encoding apparatus is determined based on the reference prediction direction. 영상의 현재 블록을 부호화하는 방법에 있어서,In the method of encoding the current block of the video, 상기 현재 블록이 입력되면 직사각형 블록 단위로 분할하여 생성되는 복수 개의 직사각 현재 블록을 단계적으로 부호화함으로써 직사각 부호화 비트스트림을 출력하는 직사각 부호화 단계;A rectangular encoding step of outputting a rectangular encoded bitstream by gradually encoding a plurality of rectangular current blocks generated by dividing the rectangular blocks in units of rectangular blocks when the current block is input; 상기 단계적으로 부호화되는 각 직사각 현재 블록 이전에 부호화된 직사각 이전 블록의 양자화 주파수 계수의 계수값에 따라 상기 각 직사각 현재 블록의 예측 방향을 변경하는 예측 방향 전환 단계;A prediction direction changing step of changing a prediction direction of each rectangular current block according to a coefficient value of a quantization frequency coefficient of a rectangular previous block coded before each rectangular current block coded stepwise; 상기 현재 블록이 입력되면 정사각형 블록 단위로 부호화함으로써 정사각 부호화 비트스트림을 출력하는 정사각 부호화 단계; 및A square encoding step of outputting a square encoded bitstream by encoding the square block unit when the current block is input; And 상기 직사각 부호화 비트스트림의 부호화 비용과 상기 정사각 부호화 비트스트림의 부호화 비용을 계산하여 최소 부호화 비용을 갖는 비트스트림을 출력하는 부호화 선택 단계;An encoding selection step of calculating a coding cost of the rectangular encoded bitstream and an encoding cost of the square encoded bitstream and outputting a bitstream having a minimum encoding cost; 를 포함하는 것을 특징으로 하는 영상 부호화 방법.Image encoding method comprising a. 제 5 항에 있어서, 상기 예측 방향 전환 단계는,The method of claim 5, wherein the prediction direction switching step, 상기 직사각 이전 블록의 양자화 주파수 계수를 저장하는 이전 블록 계수 저장 단계;A previous block coefficient storage step of storing the quantized frequency coefficients of the rectangular previous block; 상기 양자화 주파수 계수의 계수값이 모두 '0'인 경우에는 기준 예측 방향을 상기 각 직사각 현재 블록의 예측 방향으로 결정하는 예측 방향 유지 단계;A prediction direction maintaining step of determining a reference prediction direction as a prediction direction of each rectangular current block when all coefficient values of the quantized frequency coefficients are '0'; 상기 양자화 주파수 계수의 계수값 중 하나 이상이 '0'이 아닌 경우에는 복수 개의 예측 방향 후보의 각 예측 방향에 따른 부호화 비용을 계산하는 부호화 비용 계산 단계;A coding cost calculating step of calculating a coding cost according to each prediction direction of a plurality of prediction direction candidates when at least one of coefficient values of the quantization frequency coefficients is not '0'; 상기 각 예측 방향에 따른 부호화 비용이 최소인 예측 방향을 상기 각 직사각 현재 블록의 예측 방향으로 결정하는 예측 방향 변경 단계; 및A prediction direction changing step of determining a prediction direction having a minimum encoding cost according to each prediction direction as a prediction direction of each rectangular current block; And 상기 각 직사각 현재 블록의 예측 방향을 식별하기 위한 예측 방향 식별자를 출력하는 예측 방향 식별자 출력 단계A prediction direction identifier output step of outputting a prediction direction identifier for identifying a prediction direction of each rectangular current block; 를 포함하는 것을 특징으로 하는 영상 부호화 방법.Image encoding method comprising a. 제 6 항에 있어서, 상기 기준 예측 방향은,The method of claim 6, wherein the reference prediction direction, 상기 현재 블록의 예측 방향 및 상기 직사각 이전 블록의 예측 방향 중 하나인 것으로 특징으로 하는 영상 부호화 방법.And one of a prediction direction of the current block and a prediction direction of the rectangular previous block. 제 7 항에 있어서, 상기 예측 방향 후보는,The method of claim 7, wherein the prediction direction candidate is: 상기 기준 예측 방향을 기준으로 결정되는 것을 특징으로 하는 영상 부호화 방법.And the image encoding method is determined based on the reference prediction direction. 영상을 복호화하는 장치에 있어서,In the apparatus for decoding an image, 비트스트림으로부터 예측 모드에 대한 정보를 추출하는 예측 모드 추출부;A prediction mode extraction unit for extracting information about the prediction mode from the bitstream; 상기 비트스트림을 복호화하여 양자화된 주파수 계수열을 추출하는 복호화부;A decoder which extracts a quantized frequency coefficient sequence by decoding the bitstream; 상기 양자화된 주파수 계수열로부터 예측 방향 식별자를 추출하여 상기 예측 모드에 따른 예측 방향을 변경하는 예측 방향 전환부;A prediction direction switching unit which extracts a prediction direction identifier from the quantized frequency coefficient sequence and changes the prediction direction according to the prediction mode; 상기 양자화된 주파수 계수열을 이용하여 직사각형 블록 단위로 상기 변경된 예측 방향에 따라 단계적으로 현재 블록을 복원하여 출력하는 직사각 복원부;A rectangular reconstruction unit for reconstructing and outputting the current block step by step according to the changed prediction direction in units of rectangular blocks using the quantized frequency coefficient sequence; 상기 양자화된 주파수 계수열을 이용하여 정사각형 블록 단위로 상기 예측 모드에 따른 예측 방향에 따라 현재 블록을 복원하여 출력하는 정사각 복원부; 및A square restoring unit for restoring and outputting the current block according to a prediction direction according to the prediction mode in units of square blocks using the quantized frequency coefficient sequence; And 상기 비트스트림으로부터 비트스트림 식별자를 추출하고 상기 비트스트림 식별자에 따라 상기 복호화부로 하여금 상기 양자화된 주파수 계수열을 상기 직사각 복원부 및 상기 정사각 복원부 중 하나로 출력하도록 제어하는 비트스트림 식별자 추출부A bitstream identifier extractor which extracts a bitstream identifier from the bitstream and outputs the quantized frequency coefficient sequence to one of the rectangular decompressor and the square decompressor according to the bitstream identifier 를 포함하는 것을 특징으로 하는 영상 복호화 장치.Video decoding apparatus comprising a. 제 9 항에 있어서, 상기 예측 방향 전환부는,The method of claim 9, wherein the prediction direction switching unit, 상기 직사각 복원부에서 상기 직사각형 블록 단위로 단계적으로 복원되는 각 직사각 현재 블록 이전에 복호화된 직사각 이전 블록의 양자화 주파수 계수를 저장하는 이전 블록 계수 저장부;A previous block coefficient storage unit for storing the quantized frequency coefficients of the rectangular previous block decoded before each rectangular current block reconstructed step by step in the rectangular decompression unit; 상기 양자화 주파수 계수의 계수값이 모두 '0'인 경우에는 기준 예측 방향을 상기 각 직사각 현재 블록의 예측 방향으로 결정하고, 상기 양자화 주파수 계수의 계수값 중 하나 이상이 '0'이 아닌 경우에는 상기 양자화 주파수 계수열로부터 추출된 예측 방향 식별자가 지시하는 예측 방향을 상기 각 직사각 현재 블록의 예측 방향으로 결정하는 예측 방향 결정부; 및When the coefficient values of the quantization frequency coefficients are all '0', the reference prediction direction is determined as the prediction direction of each rectangular current block, and when at least one of the coefficient values of the quantization frequency coefficients is not '0', A prediction direction determiner for determining a prediction direction indicated by a prediction direction identifier extracted from a quantized frequency coefficient sequence as a prediction direction of each rectangular current block; And 상기 양자화 주파수 계수열로부터 상기 예측 방향 식별자를 추출하는 예측 방향 식별자 추출부A prediction direction identifier extractor for extracting the prediction direction identifier from the quantized frequency coefficient sequence 를 포함하는 것을 특징으로 하는 영상 복호화 장치.Video decoding apparatus comprising a. 제 10 항에 있어서, 상기 기준 예측 방향은,The method of claim 10, wherein the reference prediction direction, 상기 현재 블록의 예측 방향 및 상기 직사각 이전 블록의 예측 방향 중 하나인 것으로 특징으로 하는 영상 복호화 장치.And a prediction direction of the current block and a prediction direction of the rectangular previous block. 제 10 항에 있어서, 상기 예측 방향 결정부는,The method of claim 10, wherein the prediction direction determiner, 상기 기준 예측 방향을 기준으로 결정되는 예측 방향 후보 중에서 상기 예측 방향 식별자에 따라 예측 방향을 결정하는 것을 특징으로 하는 영상 복호화 장치.And a prediction direction is determined according to the prediction direction identifier among prediction direction candidates determined based on the reference prediction direction. 영상을 복호화하는 방법에 있어서,In the method of decoding an image, 비트스트림으로부터 예측 모드에 대한 정보를 추출하는 예측 모드 추출 단계;A prediction mode extraction step of extracting information on the prediction mode from the bitstream; 상기 비트스트림을 복호화하여 양자화 주파수 계수열을 추출하는 복호화 단계;Decoding the bitstream to extract a quantized frequency coefficient sequence; 상기 양자화 주파수 계수열로부터 예측 방향 식별자를 추출하여 상기 예측 모드에 따른 예측 방향을 변경하는 예측 방향 전환 단계;A prediction direction switching step of extracting a prediction direction identifier from the quantized frequency coefficient sequence and changing a prediction direction according to the prediction mode; 상기 비트스트림으로부터 비트스트림 식별자를 추출하는 비트스트림 식별자 추출 단계;Extracting a bitstream identifier from the bitstream; 상기 비트스트림 식별자에 따라 상기 양자화 주파수 계수열을 이용하여 직사각형 블록 단위로 현재 블록을 복원하되, 상기 변경된 예측 방향에 따라 단계적으로 현재 블록을 복원하여 출력하는 직사각 복원 단계; 및A rectangular reconstruction step of reconstructing a current block in units of rectangular blocks using the quantized frequency coefficient sequence according to the bitstream identifier, and reconstructing and outputting the current block in accordance with the changed prediction direction; And 상기 비트스트림 식별자에 따라 상기 양자화 주파수 계수열을 이용하여 정사각형 블록 단위로 현재 블록을 복원하되, 상기 예측 모드에 따른 예측 방향에 따라 현재 블록을 복원하여 출력하는 정사각 복원 단계A square reconstruction step of reconstructing a current block in units of square blocks using the quantized frequency coefficient sequence according to the bitstream identifier, and reconstructing and outputting the current block according to a prediction direction according to the prediction mode. 를 포함하는 것을 특징으로 하는 영상 복호화 방법.Image decoding method comprising a. 영상 부호화를 위해 영상의 현재 블록을 예측할 때, 예측 방향을 전환하는 장치에 있어서,An apparatus for switching a prediction direction when predicting a current block of an image for image encoding, 현재 블록 이전에 부호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 상기 현재 블록이 입력되면 상기 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 상기 현재 블록의 예측 방향으로서 결정하고, 상기 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 복수 개의 예측 방향 후보의 부호화 비용을 계산하여 부호화 비용이 최소인 예측 방향을 상기 현재 블록의 예측 방향으로 결정하는 것을 특징으로 하는 예측 방향 전환 장치.If the quantization frequency coefficients of the previous block encoded before the current block are input, the quantization frequency coefficients are stored. If the quantization frequency coefficients of the previous block are all zero, the reference prediction direction is used as the prediction direction of the current block. If the one or more coefficients of the quantization frequency coefficients of the previous block is not '0', the encoding cost of the plurality of prediction direction candidates is calculated to determine the prediction direction having the minimum encoding cost as the prediction direction of the current block. Predictive direction switching device, characterized in that. 제 14 항에 있어서, 예측 방향 전환 장치는,The apparatus of claim 14, wherein the prediction direction switching device is 상기 현재 블록의 예측 방향을 식별하기 위한 예측 방향 식별자를 출력하는 것을 특징으로 하는 예측 방향 전환 장치.And a prediction direction identifier for identifying the prediction direction of the current block. 영상 복호화를 위해 영상의 현재 블록을 예측할 때, 예측 방향을 전환하는 장치에 있어서,An apparatus for switching a prediction direction when predicting a current block of an image for image decoding, 현재 블록 이전에 복호화된 이전 블록의 양자화 주파수 계수가 입력되면 저장하며, 상기 현재 블록의 양자화 주파수 계수가 입력되면 상기 이전 블록의 양자화 주파수 계수가 모두 '0'인 경우에는 기준 예측 방향을 상기 현재 블록의 예측 방향으로서 결정하고, 상기 이전 블록의 양자화 주파수 계수 중 하나 이상의 계수가 '0'이 아닌 경우에는 상기 현재 블록의 양자화 주파수 계수로부터 예측 방향 식별자를 추출하여 상기 예측 방향 식별자에 의해 지시되는 예측 방향을 상기 현재 블록의 예측 방향으로서 결정하는 것을 특징으로 하는 예측 방향 전환 장치.If the quantization frequency coefficients of the previous block decoded before the current block are input, the quantization frequency coefficients of the current block are input. And a prediction direction indicated by the prediction direction identifier by extracting a prediction direction identifier from the quantization frequency coefficients of the current block when one or more coefficients of the quantization frequency coefficients of the previous block are not '0'. Predicting direction as the prediction direction of the current block. 제 14 항 또는 제 16 항에 있어서, 상기 기준 예측 방향은,The method of claim 14 or 16, wherein the reference prediction direction, 상기 현재 블록의 예측 방향 및 상기 이전 블록의 예측 방향 중 하나인 것으로 특징으로 하는 예측 방향 전환 장치.And a prediction direction of the current block and a prediction direction of the previous block. 제 14 항에 있어서, 상기 예측 방향 후보는,The method of claim 14, wherein the prediction direction candidate is: 상기 기준 예측 방향을 기준으로 결정되는 것을 특징으로 하는 예측 방향 전환 장치.Prediction direction switching device characterized in that determined based on the reference prediction direction.
KR1020080087651A 2008-09-03 2008-09-05 Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus KR101369161B1 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
KR1020080087651A KR101369161B1 (en) 2008-09-05 2008-09-05 Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus
US13/002,259 US9100646B2 (en) 2008-09-03 2009-08-31 Device and method for image encoding/decoding using prediction direction conversion and selective encoding
PCT/KR2009/004865 WO2010027170A2 (en) 2008-09-03 2009-08-31 Device and method for image encoding/decoding using prediction direction conversion and selective encoding
US14/692,298 US9654798B2 (en) 2008-09-03 2015-04-21 Device and method for image encoding/decoding using prediction direction conversion and selective encoding
US14/833,914 US10298954B2 (en) 2008-09-03 2015-08-24 Device and method for image encoding/decoding using prediction direction conversion and selective encoding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020080087651A KR101369161B1 (en) 2008-09-05 2008-09-05 Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus

Publications (2)

Publication Number Publication Date
KR20100028769A KR20100028769A (en) 2010-03-15
KR101369161B1 true KR101369161B1 (en) 2014-03-05

Family

ID=42179263

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020080087651A KR101369161B1 (en) 2008-09-03 2008-09-05 Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus

Country Status (1)

Country Link
KR (1) KR101369161B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130028329A1 (en) * 2011-07-22 2013-01-31 General Instrument Corporation Device and methods for scanning rectangular-shaped transforms in video coding
US9210438B2 (en) * 2012-01-20 2015-12-08 Sony Corporation Logical intra mode naming in HEVC video coding

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050053299A1 (en) 2002-11-05 2005-03-10 Canon Kabushiki Kaisha Encoding of digital data combining a plurality of encoding modes
US20050276493A1 (en) 2004-06-01 2005-12-15 Jun Xin Selecting macroblock coding modes for video encoding
US20060203907A1 (en) 2005-03-09 2006-09-14 Yang Kyeong H Model based rate control for predictive video encoder

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050053299A1 (en) 2002-11-05 2005-03-10 Canon Kabushiki Kaisha Encoding of digital data combining a plurality of encoding modes
US20050276493A1 (en) 2004-06-01 2005-12-15 Jun Xin Selecting macroblock coding modes for video encoding
US20060203907A1 (en) 2005-03-09 2006-09-14 Yang Kyeong H Model based rate control for predictive video encoder

Also Published As

Publication number Publication date
KR20100028769A (en) 2010-03-15

Similar Documents

Publication Publication Date Title
KR101379185B1 (en) Prediction Mode Selection Method and Apparatus and Video Enoding/Decoding Method and Apparatus Using Same
KR101379187B1 (en) Image Encoding/Decoding Method and Apparatus Using Block Transformation
KR101432775B1 (en) Video Encoding/Decoding Method and Apparatus Using Arbitrary Pixel in Subblock
KR101772046B1 (en) Video Encoding/Decoding Method and Apparatus for Intra-Predicting Using Filtered Value of Pixel According to Prediction Mode
US10298954B2 (en) Device and method for image encoding/decoding using prediction direction conversion and selective encoding
KR101444667B1 (en) Video Coding Method and Apparatus Using Bi-Direction Intra Prediction
KR101712351B1 (en) Video Encoding/Decoding Method and Apparatus by Using Multiple Dimensional Integer Transform
KR101483179B1 (en) Frequency Transform Block Coding Method and Apparatus and Image Encoding/Decoding Method and Apparatus Using Same
KR101677480B1 (en) Method and Apparatus for Encoding/Decoding of Video Data Using Efficient Selection of Intra Prediction Mode Set
KR20120074534A (en) Video encoding/decoding method and apparatus using feature vector of adjacent block
KR20100035104A (en) Video encoding/decoding apparatus and method of considering impulse signal
KR101531186B1 (en) Video Encoding/Decoding Method and Apparatus by Using Selective Encoding
KR101369161B1 (en) Prediction Direction Change Method and Apparatus and Video Encoding/Decoding Method and Apparatus
KR101997599B1 (en) Method and Apparatus for Image Encoding/Decoding using Efficient Non-fixed Quantization
KR101487436B1 (en) Video Encoding/Decoding Method and Apparatus by Using Selective Encoding
KR101943425B1 (en) Method and Apparatus for Image Encoding/Decoding using Efficient Non-fixed Quantization
KR20150035873A (en) Video Encoding/Decoding Method and Apparatus Using Sequential Intra-prediction
KR101537767B1 (en) Video Encoding/Decoding Method and Apparatus Using Arbitrary Pixel in Subblock
KR101483495B1 (en) Video Encoding/Decoding Method and Apparatus Using Arbitrary Pixel in Subblock
KR20150039594A (en) Video Encoding/Decoding Method and Apparatus Using Sequential Intra-prediction
KR20150035872A (en) Video Encoding/Decoding Method and Apparatus Using Sequential Intra-prediction
KR20150035871A (en) Video Encoding/Decoding Method and Apparatus Using Sequential Intra-prediction
KR101534014B1 (en) Video Encoding/Decoding Method and Apparatus Using Arbitrary Pixel in Subblock
KR101464949B1 (en) Video Encoding/Decoding Method and Apparatus Using Arbitrary Pixel in Subblock
KR101464944B1 (en) Video Encoding/Decoding Method and Apparatus Using Arbitrary Pixel in Subblock

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

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20180201

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20190131

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20191216

Year of fee payment: 7