KR101519653B1 - Image compressing apparatus of lossless and lossy type - Google Patents

Image compressing apparatus of lossless and lossy type Download PDF

Info

Publication number
KR101519653B1
KR101519653B1 KR1020080086601A KR20080086601A KR101519653B1 KR 101519653 B1 KR101519653 B1 KR 101519653B1 KR 1020080086601 A KR1020080086601 A KR 1020080086601A KR 20080086601 A KR20080086601 A KR 20080086601A KR 101519653 B1 KR101519653 B1 KR 101519653B1
Authority
KR
South Korea
Prior art keywords
data
pixel
predicted
input
specific pixel
Prior art date
Application number
KR1020080086601A
Other languages
Korean (ko)
Other versions
KR20100027612A (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 KR1020080086601A priority Critical patent/KR101519653B1/en
Publication of KR20100027612A publication Critical patent/KR20100027612A/en
Application granted granted Critical
Publication of KR101519653B1 publication Critical patent/KR101519653B1/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/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

본 발명은 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치에 관한 것으로, 이를 위하여 무손실 압축 장치는 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기와, 소정의 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기, 및 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기를 포함한다.

Figure R1020080086601

JPEG, 압축, 무손실, 손실, 공간예측, 손실팩터

The present invention relates to an image lossless and lossless compression apparatus for reducing a memory bandwidth that can efficiently reduce a high memory bandwidth caused by a large amount of image data through a simple compression scheme, A spatial predictor for receiving gray level data for at least one or more peripheral pixels related to a specific pixel from a block buffer and for predicting gray level data for a specific pixel using at least one directional correlation between neighboring pixels; A subtracter for subtracting the gradation data of the specific pixel from the predictive data for the specific pixel input from the spatial predictor and outputting the subtracted error data, and a subtractor for subtracting the lossless error data input from the subtracter from the input parameter After adjusting the number of bits depending it includes an encoder for transmitting the adjusted bit stream toward the memory.

Figure R1020080086601

JPEG, compression, lossless, loss, spatial prediction, loss factor

Description

이미지 무손실 및 손실 압축 장치{IMAGE COMPRESSING APPARATUS OF LOSSLESS AND LOSSY TYPE}[0001] IMAGE COMPRESSING APPARATUS OF LOSSLESS AND LOSSY TYPE [0002]

본 발명은 이미지 압축 장치에 관한 것으로, 특히 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치에 관한 것이다.The present invention relates to an image compression apparatus, and more particularly, to an image lossless and lossy compression apparatus for reducing memory bandwidth, which can effectively reduce a high memory bandwidth caused by a large amount of image data through a simple compression scheme.

HD(High Definition)급 이상의 크기를 가지는 영상에 대해 실시간 영상처리를 하는 칩은 단지 원영상 데이터를 라이트(write)/리드(read)하는 것만으로도 높은 메모리 대역폭이 요구된다. 1990년대 중반 이후 HD급 MPEG 디코더 칩의 메모리(SDRAM) 사이즈를 줄이기 위해 프레임 압축 기술이 연구 개발되어 왔다. 주로 간단한 하드웨어 기반의 압축 방식들로 ADPCM(adaptive differential pulse coded modulation) 방식이나 다운 컨버전(down conversion) 방식들이 제안되었다. A chip that performs real-time image processing on an image having a size of HD (High Definition) or more requires a high memory bandwidth by simply writing / reading original image data. Since the mid 1990s, frame compression techniques have been researched and developed to reduce the memory (SDRAM) size of HD class MPEG decoder chips. ADPCM (adaptive differential pulse coded modulation) or down conversion schemes have been proposed mainly in simple hardware-based compression schemes.

최근에는 비디오 프로세서 칩들이 HD, Full HD급 이상의 영상들을 다룰 뿐만 아니라 MPEG, 3D 그래픽스 랜더링(rendering), 및 프레임 변환(frame-rate conversion) 등 다양한 비디오 프로세싱 기능들이 탑재됨에 따라 더 높은 메모리 대역폭이 요구된다. In recent years, video processor chips not only handle HD or Full HD class images, but also have various video processing functions such as MPEG, 3D graphics rendering, and frame-rate conversion, do.

이를 해결하기 위해 기존 방식들은 다중 메모리 제어기(multiple memory controllers)를 사용하거나 비싼 칩 패키지나 많은 데이터 인터페이스들을 사용한다. 그러나 이러한 방식들은 압축 시스템의 비용을 증가시키게 되므로 영상의 무손실/손실 압축을 통한 메모리 대역폭(memory bandwidth) 감축 기법이 영상 및 제품 차별화의 중요한 핵심기술로 대두되고 있다.To solve this, existing schemes use multiple memory controllers or use expensive chip packages or many data interfaces. However, since these methods increase the cost of the compression system, the memory bandwidth reduction technique through lossless / lossy compression of the image is becoming an important technology of image and product differentiation.

디지털 영상 압축기법은 무손실(lossless) 압축기법과 손실(lossy) 압축기술로 나누어지며, 이러한 압축기술은 공간적, 시간적, 확률적 중복성들을 제거함으로써 영상 데이터를 압축한다. 영상 압축 표준화는 크게 정지영상 압축관련 JPEG(Joint Photographic Experts Group) 표준화 그룹과 동영상 압축관련 MPEG(Moving Picture Experts Group) 표준화 그룹으로 나뉜다. Digital image compression techniques are divided into lossless and lossy compression techniques, which compress image data by eliminating spatial, temporal, and stochastic redundancies. The standardization of image compression standardization is divided into the standardization group of JPEG (Joint Photographic Experts Group) and the standardization group of MPEG (Moving Picture Experts Group) related to video compression.

정지영상 압축기법의 연구개발은 주로 JPEG 표준화 그룹에 의해서 진행되어 왔으며, 최근에는 JPEG-2000, JPEG-LS 등의 표준화를 통해서 무손실 압축기법뿐만 아니라 손실 압축기법들이 제안되고 있다. R & D of still image compression technique has been mainly performed by JPEG standardization group. Recently, lossless compression techniques as well as lossless compression techniques have been proposed through standardization of JPEG-2000, JPEG-LS and the like.

정지영상 압축 방식들은 블록단위 DCT변환이나 웨이브릿 변환 등을 이용하고, 예측 부호화(predictive coding)와 양자화 그리고 엔트로피 부호화 등을 함께 사용함으로써 높은 압축률을 얻는 반면에 하드웨어 복잡도는 매우 높은 편이다.The still image compression methods use a block-based DCT transform or a wavelet transform, and use a combination of predictive coding, quantization and entropy coding to obtain a high compression ratio, but the hardware complexity is very high.

예컨대, JPEG-LS 방식의 경우 비교적 간단한 예측 부호화와 엔트로피 부호화 를 이용한 무손실 압축기법으로 기존 JPEG과 JPEG-2000에 비해 하드웨어 복잡도가 비교적 낮은 편이나 그래도 높은 복잡성을 갖는다. JPEG-LS는 DPCM과 run-length 코더(coder), 콘텍스트(context) 모델링 기반 GR(Golomb Rice) 코더들로 구성되어 있다. For example, the JPEG-LS method has a relatively low hardware complexity compared to the conventional JPEG and JPEG-2000, but has high complexity even though it is a lossless compression technique using relatively simple predictive coding and entropy coding. JPEG-LS consists of DPCM, run-length coder, and context modeling based GR (Golomb Rice) coders.

이와 같은 JPEG-LS는 영상의 변화가 적은 영역인지 아닌지를 구분하여 두 가지 모드(일반모드와 런모드)로 동작한다. 일반모드에서는 보다 정확한 예측데이터를 구하기 위해 고정된 예측기와 적응적 교정지로 예측데이터를 구한 후 변형된 GR(Golomb Rice) 코드를 사용한다. 런(run)모드에서는 인터럽트(Interrupt) 방식(run 길이와 인터럽트 샘플값을 코딩)과 소모(Exhaustion) 방식(run length만 코딩)을 사용한다.The JPEG-LS operates in two modes (normal mode and run mode) by distinguishing whether or not the image has a small change in the image. In the normal mode, to obtain more accurate prediction data, predicted data is obtained from a fixed predictor and an adaptive proof sheet, and then a modified GR (Golomb Rice) code is used. In the run mode, the interrupt method (coding run length and interrupt sample value) and the exhaustion method (only run length coding) are used.

다른 무손실 압축 방법 중 압축률이 좋은 방식으로 PNG(Potable Network Graphics) 방식이 있다.Among other lossless compression methods, there is a PNG (Potable Network Graphics) method in a compressible manner.

PNG는 GIF를 대체하기 위한 파일로, 파일 구조는 GIF와 동일하여 투명 효과 등 GIF의 장점을 그대로 사용할 수 있으며, GIF보다 압축률이 우수하다. 이 방식은 원 영상을 PNG 영상으로 만들고 인코더를 통해 데이터 스트림을 만든다. 이 과정에서 알파샘플이 분리되고 인덱싱을 통해 각각의 샘플들은 팔레트의 인덱스에 의해 맞는 값으로 바꾸는 작업, 첫 번째 압축(reduced)된 이미지부터 일곱 번째 압축된 이미지를 생성하는 작업, 그리고 필터 타입에 따라 압축하며 이를 순서대로 청크(chunk)를 만들어 비트스트림을 만드는 작업 등이 필요하다.PNG is a file to replace GIF. The file structure is the same as GIF, so you can use the advantages of GIF, such as transparency effect, and it is better than GIF. In this method, the original image is converted into a PNG image and the data stream is generated by an encoder. In this process, the alpha sample is separated and indexed to convert each sample to a value that is based on the index of the palette, to create a seventh compressed image from the first compressed image, It is necessary to compress and create chunks in order to create a bit stream.

이와 같은 PNG 압축 방식도 상기 JPEG-LS 방식처럼 구조적으로 높은 복잡성 을 갖게 되므로 상당히 비효율적이다.The PNG compression method is also inefficient because it has a high complexity like the JPEG-LS method.

본 발명의 목적은 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치를 제공하는 데 있다. An object of the present invention is to provide an image lossless and lossy compression apparatus for reducing memory bandwidth which can efficiently reduce a high memory bandwidth caused by a large amount of image data through a simple compression structure.

본 발명의 다른 목적은 간단한 압축 구조로 대용량의 이미지데이터를 화질 손실없이 압축 저장함으로써, 메모리 대역폭을 효율적으로 감축할 수 있음과 아울러 압축 속도를 향상시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치를 제공하는 데 있다.Another object of the present invention is to provide an image lossless and lossless compression method capable of efficiently reducing the memory bandwidth and compressing the memory bandwidth, which can improve the compression speed, by compressively storing the large- Device.

상기 목적을 달성하기 위한 본 발명의 이미지 무손실 압축 장치는, 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하 는 감산기; 및 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided an image lossless compression apparatus including a block buffer in which gradation data of pixels are stored in units of macroblocks in which an image is divided into predetermined rows and columns; A spatial predictor for receiving gray level data for at least one or more peripheral pixels related to a specific pixel to be predicted from the block buffer and for predicting gray level data for a specific pixel by using at least one directional correlation between neighboring pixels; A subtracter for subtracting the gray level data of the specific pixel input from the block buffer and the prediction data for the specific pixel input from the spatial predictor and outputting the subtracted error data; And an encoder which adjusts the number of bits of the lossless error data input from the subtractor according to a coding parameter input from a predetermined parameter calculator, and then delivers the adjusted bitstream to the memory.

구체적으로, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하고, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 및 좌측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 한다.Specifically, the parameter calculator compares correlation values for at least one direction among neighboring pixels input from the spatial predictor, and determines a coding parameter by calculating a data bit number of a minimum correlation value as a result of comparison. And the spatial predictor predicts the gray level data using the correlation between at least one of the pixels located in the horizontal direction, the vertical direction, and the left diagonal direction based on the specific pixel to be predicted.

아울러, 상기 공간예측기는, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 계조데 이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 계조데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 계조데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 한다.In addition, the spatial predictor receives the gray level data of the surrounding pixels based on the specific pixel to be predicted from the block buffer, and subtracts the gray level data between neighboring pixels in the horizontal and vertical directions to obtain horizontal and vertical correlation data, respectively A subtractor; A first comparator for comparing the horizontal and vertical correlation data input from the subtractor and outputting a selection control signal according to a comparison result; A pixel arithmetic unit for receiving the gray level data of the surrounding pixels based on the specific pixel to be predicted from the block buffer and adding the pixels located at the left side and the upper side to each other and subtracting the pixels located in the diagonal direction; A second comparator for comparing an absolute value of the operation result value input from the pixel operation unit with a preset reference value and outputting a selection control signal according to the comparison result; A first multiplexer for selectively outputting the gradation data of a left pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; A second multiplexer for selectively outputting gradation data of a top pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; And a third multiplexer for selectively outputting gradation data or operation result values of the left and upper pixels input from the first and second multiplexers according to a selection control signal of the first comparator.

상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 한다.The spatial predictor may further include a clipping unit for clipping and outputting a maximum value or a minimum value within a predetermined range when the predicted value output from the third multiplexer is out of a preset reference value.

상기 목적을 달성하기 위한 본 발명의 이미지 손실 압축 장치는, 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼; 상기 각 픽셀의 데이터 손실 처리에 따른 오차데이터를 일정 범위에서 손실 보상되고, 손실 보상된 보상데이터가 저장된 라인버퍼; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 보상데이터를 라인버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기; 상기 감산기로부터 입력된 특정 픽셀의 오차데이터를 소정의 손실팩터선택기로부터 입력된 손실팩터(Lossy Factor)에 따라 손실 처리한 후 손실된 오차데이터를 출력하는 손실처리기; 및 상 기 손실처리기로부터 입력된 손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided an image loss compression apparatus including: a block buffer in which gradation data of pixels are stored in macroblock units in which an image is divided into predetermined rows and columns; A line buffer in which the error data according to the data loss process of each pixel is compensated for in a certain range and the loss compensated compensation data is stored; A spatial predictor for receiving compensation data for at least one or more peripheral pixels related to a specific pixel to be predicted from the line buffer and predicting gray level data for a specific pixel by using at least one directional correlation between neighboring pixels; A subtractor for subtracting the gray level data of the specific pixel input from the block buffer and the prediction data for the specific pixel input from the spatial predictor and outputting the subtracted error data; A loss processor for performing lossy processing of error data of a specific pixel input from the subtractor according to a loss factor input from a predetermined loss factor selector and outputting lossy error data; And an encoder that adjusts the number of bits according to the encoding parameter input from the predetermined parameter calculator and transfers the adjusted bitstream to the memory side.

구체적으로, 상기 손실팩터선택기는 부호화기를 통해 출력되는 각 픽셀의 비트수를 카운트하여 누적하고 누적된 이전 블록의 비트수와 블록별 목표 비트수를 이용하여 현재 매크로블록에 적용할 손실팩터를 계산하여 결정하는 것을 특징으로 하고, 상기 손실팩터선택기는, 부호화기에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하여 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 누적하는 비트수카운터; 및 미리 저장된 매크로블록의 목표 비트량을 기준으로 현재 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 계산한 후 계산된 현재 슬라이스(slice) 또는 LMB의 잉여비트수와 설정된 기준값을 상호 비교하여 손실팩터를 결정하는 손실팩터계산부;를 포함하여 구성된 것을 특징으로 한다.Specifically, the loss factor selector counts and accumulates the number of bits of each pixel output through the encoder, calculates a loss factor to be applied to the current macroblock by using the number of bits of the previous block and the number of target bits per block Wherein the loss factor selector comprises: a loss factor selector which counts the number of bits of error data of all pixels output from the encoder and outputs a slice unit including each macroblock and a bit number counter ; And calculating surplus bits for a current slice or LMB based on a target bit amount of a previously stored macroblock and comparing the calculated current slice or the number of redundant bits of the LMB with a set reference value to obtain a loss And a loss factor calculator for determining a factor.

아울러, 상기 손실팩터계산기는 입력된 블록 변화도(activity)에 대한 데이터를 미리 설정된 기준값과 비교하여 블록 변화도가 낮을 경우 손실팩터를 감소시키는 것을 특징으로 한다.The loss factor calculator compares data on an input block activity with a preset reference value to reduce the loss factor when the degree of block variation is low.

상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 한다.The parameter calculator compares the correlation values of at least one direction between neighboring pixels input from the spatial predictor and calculates the number of data bits of the minimum correlation value as a comparison result to determine the encoding parameter.

상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 좌측 대각선 방향 및 우측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 한다.The spatial predictor is characterized by predicting gray level data using a correlation between at least one of surrounding pixels in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction with reference to a specific pixel to be predicted .

상기 공간예측기는, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 오차 보상데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 한다.The spatial predictor includes a subtractor for subtracting the error compensation data for neighboring pixels from neighboring pixels in the horizontal and vertical directions and obtaining the horizontal and vertical correlation data, ; A first comparator for comparing the horizontal and vertical correlation data input from the subtractor and outputting a selection control signal according to a comparison result; A pixel arithmetic unit for receiving error compensation data for neighboring pixels based on a specific pixel to be predicted from the line buffer and adding pixels located on the left and upper sides to each other and subtracting pixels located in the diagonal direction; A second comparator for comparing an absolute value of the operation result value input from the pixel operation unit with a preset reference value and outputting a selection control signal according to the comparison result; A first multiplexer for selectively outputting error correction data of a left pixel for a specific pixel to be predicted and an operation result value input from a pixel operation unit according to the selection control signal of the second comparator; A second multiplexer for selectively outputting error correction data of an upper pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; And a third multiplexer for selectively outputting error compensation data or operation result values of the left and upper pixels input from the first and second multiplexers according to a selection control signal of the first comparator.

상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 한다.The spatial predictor may further include a clipping unit for clipping and outputting a maximum value or a minimum value within a predetermined range when the predicted value output from the third multiplexer is out of a preset reference value.

상기 압축장치는, 손실처리기로부터 입력된 손실 오차데이터를 레프트 시프트하여 손실된 데이터를 복구하고, 복구된 데이터와 공간예측기로부터 입력된 예측데이터를 상호 가산하여 오차 보상된 데이터를 라인버퍼로 출력하는 픽셀복원기를 더 포함하는 것을 특징으로 하며, 상기 손실처리기는 손실팩터에 따라 오차데이터를 오른쪽(light)으로 시프트하여 손실 처리하는 시프터인 것을 특징으로 한다.The compression device includes a pixel for outputting the error-compensated data to the line buffer by adding the recovered data and the predictive data input from the spatial predictor to each other to restore the lost data by left shifting the loss error data input from the loss processor, Wherein the loss processor is a shifter that shifts the error data to the right according to the loss factor to perform loss processing.

이상에서 설명한 바와 같이 본 발명은 압축장치를 간단한 공간예측기와 GR부호화기로 구성되어 블록 단위로 동작되도록 함으로써, 대용량 영상데이터의 처리와 메모리 대역폭의 감축에 적당하고, 압축장치의 낮은 복잡도로 인해 칩 구현이 용이함과 아울러 데이터 처리 속도와 가격적인 측면에서 유리한 이점이 있다.As described above, according to the present invention, since the compression device is composed of a simple spatial predictor and a GR encoder and is operated on a block basis, it is suitable for processing large-capacity image data and reducing memory bandwidth, Which is advantageous in terms of data processing speed and cost.

이하, 첨부된 도면을 참조하여 본 발명의 실시예에 대하여 보다 상세하게 설명하고자 한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일실시예에 의한 이미지 무손실 압축 시스템을 나타낸 기능 블록도로서, 압축 시스템은 이미지를 무손실 압축하는 압축장치(100)와, 상기 압축장치(100)를 통해 압축된 데이터가 저장되는 메모리(300)와, 상기 메모리(300)와 외부 장치와의 상호 데이터 인터페이스를 위한 메모리 컨트롤러(350), 및 상기 제반 장치들의 작동을 제어하는 메인컨트롤러(400)를 포함하여 이루어져 있다.FIG. 1 is a functional block diagram of an image lossless compression system according to an embodiment of the present invention. The compression system includes a compression apparatus 100 for losslessly compressing an image, A memory controller 350 for a mutual data interface between the memory 300 and an external device and a main controller 400 for controlling operations of the devices.

상기 무손실 압축장치(100)는 이미지의 압축시 매크로블록 단위로 압축하게 되며, 이때 메인컨트롤러(400)로부터 로컬 버스를 통해 이미지의 사이즈나 타깃 압축률 등에 대한 정보를 선택적으로 제공받아 처리하게 된다.The lossless compression apparatus 100 compresses an image in units of macroblocks. At this time, the main controller 400 selectively receives information on an image size, a target compression ratio, and the like through a local bus.

그리고, 상기 압축장치(100)는 블록버퍼(110)와 공간예측기(130), 감산기(150), 파라미터계산기(170) 및 부호화기(190)를 포함하여 이루어져 있다. The compression apparatus 100 includes a block buffer 110, a spatial predictor 130, a subtractor 150, a parameter calculator 170, and an encoder 190.

상기 블록버퍼(110)는 원래의 이미지 전체가 소정의 행과 열(M×N)로 나누어진 매크로블록 단위의 이미지를 일시 저장한다. 상기 매크로블록(macroblock; MB)은 일반적으로 16×16 픽셀(pixel) 등으로 구성될 수 있고 각 픽셀은 8비트(bit)의 계조데이터(gradation data)로 이루어질 수 있으나, 실시예에 따라 매크로블록은 32×32, 8×8, 32×16 또는 16×8 픽셀 등으로 구성될 수 있고, 각 픽셀의 데이터 비트수도 다양하게 가감될 수 있다.The block buffer 110 temporarily stores an image of a macro block unit in which the entire original image is divided into a predetermined row and column (M x N). The macroblock MB may be generally composed of 16 x 16 pixels and each pixel may be composed of 8 bits of gradation data. However, according to the embodiment, 32 × 32, 8 × 8, 32 × 16, or 16 × 8 pixels, and the data bits of each pixel may be variously added or subtracted.

공간예측기(130)는 예측하고자 하는 특정 픽셀(i)과 관계된 적어도 하나 이상의 주변 픽셀(a, b, c)에 대한 계조데이터를 블록버퍼(110)로부터 입력받아 주변 픽셀간의 수평 및 수직 등의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 데이터를 감산기(150)로 출력한다. 여기서, 공간예측기(130)에 의한 예측이 완벽할 경우 예측된 계조데이터와 원래의 계조데이터가 동일하게 되며, 이 경우 감산기의 출력값이 '0'이 되어 압축률을 향상시킬 수 있다. 하지만, 예측 하고자 하는 특정 픽셀의 주변 픽셀들의 상관성을 이용하여 특정 픽셀의 계조데이터를 예측하게 되므로 계조의 변화가 심한 모든 픽셀에 대해서 감산기의 출력값이 '0'이 되는 완벽한 예측을 하기가 쉽지 않다.The spatial predictor 130 receives the gray level data for at least one or more surrounding pixels (a, b, c) related to the specific pixel (i) to be predicted from the block buffer 110, And outputs the predicted data to the subtractor 150. The subtractor 150 subtracts the predicted data from the predicted data. Here, when the prediction by the spatial predictor 130 is perfect, the predicted gradation data and the original gradation data become the same. In this case, the output value of the subtractor becomes '0', so that the compression ratio can be improved. However, since the grayscale data of a specific pixel is predicted using the correlation of surrounding pixels of a specific pixel to be predicted, it is not easy to perform a perfect prediction in which the output value of the subtractor becomes '0' for all pixels with a large change in grayscale.

감산기(150)는 블록버퍼(110)로부터 입력된 특정 픽셀(i)의 계조데이터(gradation data)와 공간예측기(130)로부터 입력된 상기 특정 픽셀에 대한 예측데이터(prediction data; P)를 감산하고 감산된 오차데이터(error data; e)를 출력한다. 상기 주변 픽셀은 특정 픽셀을 기준으로 좌측과 상단 및 좌대각선 방향에 각각 위치한 픽셀들로 이전 픽셀에 해당된다.The subtractor 150 subtracts the gradation data of the specific pixel i input from the block buffer 110 and the prediction data P for the specific pixel input from the spatial predictor 130 And outputs the subtracted error data (error data e). The neighboring pixels correspond to the previous pixels as pixels located respectively in the left and upper and left diagonal directions with respect to a specific pixel.

파라미터계산기(170)는 공간예측기(130)로부터 입력된 주변 픽셀들 간의 수직 및 수평 방향의 상관값을 각각 입력받아 상호 비교하고 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정한다. The parameter calculator 170 receives and correlates vertical and horizontal correlation values between neighboring pixels input from the spatial predicter 130, and calculates the number of data bits of the minimum correlation value as a coding parameter .

부호화기(190)는 감산기(150)로부터 입력된 무손실 오차데이터를 파라미터계산기(170)로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림(bitstream)을 메모리(300) 측으로 전달한다. 아울러, 본 발명에 적용된 부호화기(190)는 GR(Golomb Rice) 파라미터인 k값에 따라 비트수를 조정하는 GR부호화기(Golomb Rice Coder) 등이 될 수 있다.The encoder 190 adjusts the number of bits of the lossless error data input from the subtracter 150 according to the encoding parameter input from the parameter calculator 170 and then transfers the adjusted bitstream to the memory 300 side. In addition, the encoder 190 applied to the present invention may be a GR encoder (Golomb Rice Coder) that adjusts the number of bits according to k value, which is a Golomb Rice (GR) parameter.

이와 같이 특성 픽셀에 대한 계조데이터를 메모리(300)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다.In this manner, instead of storing the grayscale data for the characteristic pixel in the memory 300 as it is, the grayscale data for the specific pixel is predicted using the correlation between the surrounding pixels of the specific pixel to be predicted according to the direction prediction algorithm, The error data is obtained by subtracting the data from the original gradation data of the specific pixel, and the obtained error data is stored in the memory by adjusting the number of bits according to the encoding parameter.

아울러, 상기 공간예측기(130)의 경우 도 2와 같이 구성되어 있다.In addition, the space predictor 130 is configured as shown in FIG.

즉, 공간예측기(130)는 제1 감산기(131)와 제2 감산기(132), 제1 비교기(133), 픽셀연산부(134), 제2 비교기(135), 복수의 멀티플렉서(136a~136c) 및 클리핑부(137)를 포함하여 이루어져 있다.That is, the spatial predictor 130 includes a first subtractor 131, a second subtractor 132, a first comparator 133, a pixel calculator 134, a second comparator 135, a plurality of multiplexers 136a through 136c, And a clipping unit 137 as shown in FIG.

상기 제1 및 제2 감산기(131, 132)는 예측하고자 하는 특정 픽셀(i)을 기준으로 주변 픽셀들(a, b, c)에 대한 계조데이터를 블록버퍼(110)로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하도록 구성되어 있는 데, 구체적으로 제1 감산기(131)는 예측하고자 하는 특정 픽셀(i)에 대한 좌측 픽셀(a)과 좌대각선 픽셀(c)의 계조데이터를 블록버퍼(110)로부터 각각 입력받아 감산하고 감산된 수직 상관데이터(dy)를 출력하고, 제2 감산기(132)는 예측하고자 하는 특정 픽셀(i)에 대한 상단 픽셀(b)과 좌대각선 픽셀(c)의 계조데이터를 블록버퍼(110)로부터 각각 입력받아 감산하고 감산된 수평 상관데이터(dx)를 출력한다.The first and second subtractors 131 and 132 receive the gray level data of the surrounding pixels a, b, and c from the block buffer 110 on the basis of the specific pixel i to be predicted, The first subtracter 131 subtracts the left pixel (a) and the left pixel (i) of the specific pixel (i) to be predicted from each other, The second subtractor 132 subtracts the grayscale data of the diagonal pixel c from the block buffer 110 and outputs the subtracted vertical correlation data dy, And outputs the grayscale data of the pixel b and the left diagonal pixel c from the block buffer 110 and outputs the subtracted horizontal correlation data dx.

제1 비교기(133)는 상기 제1 및 제2 감산기(131, 132)로부터 각각 입력된 수평 및 수직 상관데이터(dx, dy)의 절대값을 상호 비교한 후 비교 결과에 따른 선택제어신호(select)를 출력한다.The first comparator 133 compares the absolute values of the horizontal and vertical correlation data dx and dy input from the first and second subtractors 131 and 132 with each other and then outputs the selection control signals select ).

픽셀연산부(134)는 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼(110)로부터 입력받아 좌측과 상단에 위치한 픽셀들(a, b)은 상호 가산하고 대각선 방향에 위치한 픽셀(c)은 감산한다.The pixel arithmetic unit 134 receives the grayscale data of the surrounding pixels based on the specific pixel to be predicted from the block buffer 110 and adds the pixels a and b located at the left and the top of the block buffer 110 to each other, Pixel c is subtracted.

제2 비교기(135)는 상기 픽셀연산부(134)로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력한다. 상기 제2 비교기에 설정된 기준값의 경우 255인 것이 바람직하다.The second comparator 135 compares the absolute value of the operation result value input from the pixel operation unit 134 with a preset reference value, and outputs a selection control signal according to the comparison result. And 255 for the reference value set in the second comparator.

제1 멀티플렉서(136a)는 상기 제2 비교기(135)의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀(a)의 계조데이터와 픽셀연산부(134)로부터 입력된 연산 결과값을 선택적으로 출력한다.The first multiplexer 136a selectively outputs the gray level data of the left pixel a for a specific pixel to be predicted and the calculation result value input from the pixel calculator 134 according to the selection control signal of the second comparator 135 Output.

제2 멀티플렉서(136b)는 상기 제2 비교기(135)의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 계조데이터와 픽셀연산부(134)로부터 입력된 연산 결과값을 선택적으로 출력한다.The second multiplexer 136b selectively outputs the gradation data of the upper pixel for the specific pixel to be predicted and the operation result value input from the pixel operation unit 134 according to the selection control signal of the second comparator 135. [

제3 멀티플렉서(136c)는 상기 제1 및 제2 멀티플렉서(136a, 136b)로부터 입력된 좌측 및 상단 픽셀(a, b)의 계조데이터 또는 연산 결과값을 상기 제1 비교기(133)의 선택 제어신호에 따라 선택적으로 출력한다.The third multiplexer 136c outputs the gradation data or the operation result value of the left and upper pixels a and b inputted from the first and second multiplexers 136a and 136b to the selection control signal of the first comparator 133 As shown in FIG.

클리핑부(137)는 상기 제3 멀티플렉서(136c)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 출력한다.When the value of the data input from the third multiplexer 136c is out of a preset reference range, the clipping unit 137 clips the data to the maximum value or the minimum value of the set range and outputs the clipped data.

즉, 공간예측기(130)는 도시된 바와 같이 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식 1을 이용하여 예측한다.That is, the spatial predictor 130 predicts the prediction data of a specific pixel to be predicted using Equation (1) below.

|dy|<|dx|이고 (|b+dy|)>255 이면, Prediction Data = b| dy | <| dx | and (| b + dy |)> 255, then Prediction Data = b

(|b+dy|)≤255 이면, Prediction Data = b+dy               (| b + dy |)? 255, Prediction Data = b + dy

|dy|>|dx|이고 (|a+dx|)>255 이면, Prediction Data = a| dy |> | dx | and (| a + dx |)> 255, Prediction Data = a

(|a+dx|)≤255 이면, Prediction Data = a+dx               (| a + dx |) &lt; 255, Prediction Data = a + dx

여기서, dx는 b-c, dy는 a-c, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 예측하고자 하는 특정 픽셀의 좌측 대각선에 위치한 픽셀의 데이터이다.Here, dx is data of a pixel located at the left side of a specific pixel to be predicted, b is data of a pixel located at a top of a specific pixel to be predicted, c is data of a pixel to be predicted, The data of the pixel located on the left diagonal of the pixel.

이와 같은 무손실 압축 알고리즘의 경우, 블록내 상관성이 떨어지는 경우 압축의 한계로 인하여 주어진 메모리 대역폭을 초과할 수 있으므로, 목표 압축률에 따라 도 2와 같은 무손실 압축 방식과 아래 도 3과 같은 손실 압축 방식을 선택적으로 적용해야 한다.In the case of such a lossless compression algorithm, since a given memory bandwidth can be exceeded due to compression limitations when the intra-block correlation is low, a lossless compression scheme as shown in FIG. 2 and a lossy compression scheme as shown in FIG. .

도 3은 본 발명의 다른 실시예에 의한 이미지 손실 압축 시스템을 나타낸 기능 블록도로서, 압축 시스템은 이미지를 미리 설정된 비트량으로 손실 압축하는 압축장치(200)와, 상기 압축장치를 통해 압축된 데이터가 저장되는 메모리(300)와, 상기 메모리(300)와 외부 장치와의 상호 데이터 인터페이스를 위한 메모리 컨트롤러(350), 및 상기 제반 장치들의 작동을 제어하는 메인컨트롤러(400)를 포함하여 이루어져 있다.FIG. 3 is a functional block diagram illustrating an image loss compression system according to another embodiment of the present invention. The compression system includes a compression device 200 for loss-compressing an image with a preset bit amount, A memory controller 350 for a mutual data interface between the memory 300 and an external device and a main controller 400 for controlling operations of the devices.

상기 압축장치(200)는 이미지의 압축시 매크로블록 단위로 압축하게 되며, 이때 메인컨트롤러(400)로부터 로컬 버스를 통해 이미지의 사이즈나 타깃 압축률 등에 대한 정보를 제공받아 처리하게 된다.The compression device 200 compresses an image in units of macroblocks. At this time, the main controller 400 receives information on an image size, a target compression ratio, and the like through a local bus.

그리고, 상기 손실 압축장치(200)는 블록버퍼(210)와 라인버퍼(220), 공간예 측기(230), 감산기(240), 손실처리기(250), 손실팩터선택기(260), 파라미터계산기(270), 부호화기(280) 및 픽셀복원기(290) 등을 포함하여 이루어져 있다.The lossy compression apparatus 200 includes a block buffer 210, a line buffer 220, a space estimator 230, a subtracter 240, a loss processor 250, a loss factor selector 260, a parameter calculator 270, an encoder 280, a pixel restorer 290, and the like.

상기 블록버퍼(210)에는 원래의 이미지 전체가 소정의 행과 열(M×N)로 나누어진 매크로블록 단위의 이미지가 일시 저장되어 있다. 상기 매크로블록(macro block)은 일반적으로 16×16 픽셀(pixel) 등으로 구성될 수 있고 각 픽셀은 8비트(bit)의 계조데이터(gradation data)로 이루어질 수 있으나, 실시예에 따라 매크로블록은 32×32, 8×8, 32×16 또는 16×8 픽셀 등으로 구성될 수 있고, 각 픽셀의 데이터 비트수도 다양하게 가감될 수 있다.In the block buffer 210, an image of a macro block unit in which the entire original image is divided into a predetermined row and column (M x N) is temporarily stored. The macro block may be generally composed of 16 x 16 pixels and each pixel may be composed of 8 bits of gradation data. However, according to an embodiment, 32 x 32, 8 x 8, 32 x 16, or 16 x 8 pixels, and the data bits of each pixel may be variously added or subtracted.

라인버퍼(220)에는 손실처리기(250)로부터 출력된 각 픽셀의 손실 오차데이터가 일정 범위에서 손실 보상된 보상데이터가 픽셀별로 임시 저장되어 있다. 즉, 블록버퍼(210)에서는 도 4a와 같이 각 픽셀들(c, b, a, i)의 원래의 계조데이터(c_d1, b_d1, a_d1, i_d1)가 저장되어 있지만, 라인버퍼(220)에는 도 4b와 같이 각 픽셀들(c, b, a, i)에 대한 손실 보상된 보상데이터(c_d2, b_d2, a_d2, i_d2)가 저장되어 있다. 그리고, 상기 각 픽셀들의 계조데이터(c_d1, b_d1, a_d1, i_d1)와 각 픽셀들의 손실 보상데이터(c_d2, b_d2, a_d2, i_d2)는 비트수는 서로 동일하지만, 손실에 의해 데이터는 상이할 수 있다.In the line buffer 220, compensation data in which the loss error data of each pixel output from the loss processor 250 is loss compensated in a certain range is temporarily stored for each pixel. 4A, the original tone data c_d1, b_d1, a_d1, and i_d1 of the pixels c, b, a and i are stored in the block buffer 210, Compensated compensation data c_d2, b_d2, a_d2, and i_d2 for each of the pixels c, b, a, i are stored as shown in FIG. The gray level data c_d1, b_d1, a_d1 and i_d1 of the respective pixels and the loss compensation data c_d2, b_d2, a_d2 and i_d2 of the respective pixels have the same number of bits, .

공간예측기(230)는 감산기(240)로 입력되는 특정 픽셀(i)과 관계된 적어도 하나 이상의 주변 픽셀(a, b, c)에 대한 오차 보상데이터를 라인버퍼(220)로부터 입력받아 주변 픽셀간의 수평 및 수직 등의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 감산기(240)로 출력한다. 여기서, 공 간예측기(230)에 의한 예측이 완벽할 경우 예측된 계조데이터와 원래의 계조데이터가 동일하게 되며, 이 경우 감산기의 출력값이 '0'이 되어 압축률을 향상시킬 수 있다. 하지만, 예측하고자 하는 특정 픽셀의 주변 픽셀들의 상관성을 이용하여 특정 픽셀의 계조데이터를 예측하게 되므로 계조의 변화가 심한 모든 픽셀에 대해서 감산기의 출력값이 '0'이 되는 완벽한 예측을 하기가 쉽지 않다.The spatial predictor 230 receives error compensation data for at least one or more surrounding pixels a, b, and c related to a specific pixel i input to the subtractor 240 from the line buffer 220, And vertical correlation, and outputs the predicted gradation data to the subtractor 240. The subtractor 240 subtracts the predicted gradation data from the predicted gradation data. Here, if the prediction by the space predictor 230 is perfect, the predicted gradation data and the original gradation data become the same. In this case, the output value of the subtractor becomes '0', so that the compression ratio can be improved. However, since the grayscale data of a specific pixel is predicted using the correlation of surrounding pixels of a specific pixel to be predicted, it is not easy to perform a perfect prediction in which the output value of the subtractor becomes '0' for all pixels with a large change in grayscale.

감산기(240)는 블록버퍼(210)로부터 입력된 특정 픽셀(i)의 계조데이터(gradation data)와 공간예측기(230)로부터 입력된 상기 특정 픽셀(i)과 관계된 예측데이터(prediction data; p)를 감산하고 감산된 오차데이터(error data; e)를 출력한다. 상기 주변 픽셀은 특정 픽셀을 기준으로 좌측과 상단 및 대각선 방향에 각각 위치한 픽셀들로 이전(previous) 픽셀에 해당된다.The subtractor 240 subtracts the gradation data of the specific pixel i input from the block buffer 210 and the prediction data p related to the specific pixel i input from the spatial predictor 230, And outputs the subtracted error data (error data e). The neighboring pixels correspond to the previous pixels in the left and upper and diagonal directions, respectively, with respect to the specific pixel.

손실처리기(250)는 감산기(240)로부터 입력된 특정 픽셀의 오차데이터를 손실팩터선택기(260)로부터 입력된 손실팩터(lossy factor)에 따라 손실 처리한 후 손실된 오차데이터를 출력한다. 상기 손실처리기(250)는 시프터(Shifter)로서 손실팩터에 따라 오차데이터를 오른쪽(right)으로 시프트하여 최하위비트(LSB)를 제거하여 오차값을 감소시키게 된다. 예컨대, 손실처리기(250)는 입력된 오차데이터가 '1001'이고 손실팩터가 1일 경우에 오차데이터를 오른쪽으로 1비트 시프트하여 '100'을 출력하게 된다. 즉, 손실팩터가 1이면 오차데이터를 오른쪽으로 1비트 시프트하여 오차값을 2배로 줄이게 되고, 손실팩터가 2이면 오차데이터를 오른쪽으로 2비트 시프트하여 오차값을 4배로 줄이게 되며, 손실팩터가 3이면 오차데이터를 오른쪽으로 3비트 시프트하여 오차값을 8배로 줄이게 된다. 즉, 손실팩터에 따라 오 차값을 2n(n은 손실팩터값)만큼 줄이게 된다. The loss processor 250 performs error processing on the error data of a specific pixel input from the subtractor 240 according to a lossy factor input from the loss factor selector 260 and outputs the error data. The loss processor 250 shifts the error data to the right according to the loss factor as a shifter and removes the least significant bit (LSB) to reduce the error value. For example, when the input error data is '1001' and the loss factor is 1, the lossy processor 250 shifts the error data by one bit to the right and outputs '100'. In other words, if the loss factor is 1, the error data is shifted to the right by 1 bit to reduce the error value to twice. If the loss factor is 2, the error data is shifted to the right by 2 bits, The error data is shifted to the right by 3 bits to reduce the error value to 8 times. That is, the error value is reduced by 2 n (n is the loss factor value) according to the loss factor.

손실팩터선택기(260)는 부호화기(280)를 통해 출력되는 각 픽셀의 비트수를 카운트하여 누적하고 누적된 이전 블록의 비트수와 블록별 목표비트수(target bits)를 이용하여 현재 매크로블록에 적용할 손실팩터(lossy factor)를 계산하여 결정한다.The loss factor selector 260 counts the number of bits of each pixel output through the encoder 280 and accumulates the number of bits to be applied to the current macroblock using the number of bits of the previous block and target bits per block And the lossy factor to be determined.

파라미터계산기(270)는 공간예측기(230)로부터 예측하고자 하는 특정 픽셀의 주변 픽셀들 간의 수직 및 수평 방향의 상관값을 각각 입력받아 상호 비교하고 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정한다.The parameter calculator 270 receives the vertical and horizontal correlation values between adjacent pixels of a specific pixel to be predicted from the spatial predictor 230, compares the received correlation values, calculates the number of data bits of the minimum correlation value, Parameter.

부호화기(280)는 손실처리기(250)로부터 입력된 손실 오차데이터를 파라미터계산기(270)로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 특정 픽셀의 압축 비트스트림(bitstream)을 메모리 측으로 전달한다. 아울러, 본 발명에 적용된 부호화기(280)는 GR(Golomb Rice) 파라미터인 k값에 따라 비트수를 조정하는 GR부호화기(Golomb Rice Coder) 등이 될 수 있다.The encoder 280 adjusts the number of bits according to the encoding parameter input from the parameter calculator 270 to the lossy error data input from the lossy processor 250, and then transmits a compressed bitstream of the adjusted specific pixel to the memory do. In addition, the encoder 280 applied to the present invention may be a GR encoder (Golomb Rice Coder) that adjusts the number of bits according to k value, which is a Golomb Rice (GR) parameter.

아울러, 픽셀복원기(290)는 시프터와 가산기(미 도시)로 이루어져 있는데, 상기 손실처리기(250)로부터 입력된 손실 오차데이터를 레프트 시프트(left shift)하여 손실된 최하위비트를 복구한 후 복구된 손실 보상데이터와 공간예측기(230)로부터 입력된 예측데이터(p)를 상호 가산하여 오차 보상데이터를 획득한다. 픽셀복원기(290)는 이와 같이 획득된 특정 픽셀의 오차 보상데이터를 라인버퍼(220)로 출력한다. 아울러, 상기 픽셀복원기(290)는 손실된 최하위비트에 대한 비트수만 복구 할 뿐 손실된 최하위비트에 데이터(0 또는 1)를 정확하게 복원하는 것은 아니므로, 블록버퍼(210)에 저장된 픽셀 데이터와 라인버퍼(220)에 저장된 픽셀 데이터는 다를 수 있다.In addition, the pixel restorer 290 includes a shifter and an adder (not shown). The pixel restorer 290 performs a left shift operation on the loss error data input from the loss processor 250 to recover the lost least significant bits, And compares the loss compensation data with the prediction data p input from the spatial predictor 230 to obtain error compensation data. The pixel restorer 290 outputs error compensation data of the specific pixel thus obtained to the line buffer 220. In addition, since the pixel restorer 290 only restores the number of bits for the lost least significant bit and does not accurately restore the data (0 or 1) to the least significant bit lost, the pixel data stored in the block buffer 210 The pixel data stored in the line buffer 220 may be different.

이와 같이 손실 압축장치(200)는 예측하고자 하는 특정 픽셀에 대한 계조데이터를 메모리(300)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터를 손실팩터에 따라 설정된 목표 압축률에 적합하게 손실 압축하여 메모리에 저장하게 된다. 물론, 상기 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다. In this way, the lossy compression apparatus 200 does not store the grayscale data for a specific pixel to be predicted in the memory 300 as it is, but uses the correlation between surrounding pixels of a specific pixel to be predicted according to a direction prediction algorithm, Predicts the gray level data, subtracts the predicted gray level data from the original gray level data of the specific pixel to obtain error data, and stores the obtained error data in a memory in accordance with the target compression ratio set according to the loss factor . Of course, the error data is stored in the memory by adjusting the number of bits according to the encoding parameters.

상기 공간예측기(230)의 경우 도 5와 같이 구성되어 있다.The space predictor 230 is configured as shown in FIG.

즉, 공간예측기(230)는 제1 감산기(231)와 제2 감산기(232), 제1 비교기(233), 픽셀연산부(234), 제2 비교기(235), 복수의 멀티플렉서(236a~236c) 및 클리핑부(237)를 포함하여 이루어져 있다.That is, the spatial predictor 230 includes a first subtractor 231, a second subtractor 232, a first comparator 233, a pixel computing unit 234, a second comparator 235, a plurality of multiplexers 236a through 236c, And a clipping unit 237. [0034] FIG.

제1 감산기(231)는 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 감산하고 감산된 수직 상관데이터를 출력한다. 예컨대, 제1 감산기(231)는 특정 픽셀인 i에 대한 좌측 픽셀인 a와 좌대각선 픽셀인 c를 각각 라인버퍼(220)로부터 입력받아 이를 감산한 후 감산된 수직 상관데이터(dy=a-c)를 출력하게 된다.The first subtracter 231 receives and subtracts the error compensation data of the left pixel and the left diagonal pixel of the specific pixel to be predicted from the line buffer 220, and outputs the subtracted vertical correlation data. For example, the first subtractor 231 receives the a pixel a, which is the left pixel for i and the left diagonal pixel c, from the line buffer 220 and subtracts the subtracted vertical correlation data dy = a-c ).

제2 감산기(232)는 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력한다. 예컨대, 제2 감산기(232)는 특정 픽셀인 i에 대한 상단 픽셀인 b와 좌대각선 픽셀인 c를 각각 입력받아 이를 감산한 후 감산된 수평 상관데이터(dx=b-c)를 출력하게 된다.The second subtractor 232 receives and subtracts the error compensation data of the upper pixel and the left diagonal pixel for the specific pixel to be predicted from the line buffer 220, and outputs the subtracted horizontal correlation data. For example, the second subtractor 232 receives the upper pixel b and the left diagonal pixel c for a specific pixel i, and subtracts the input and outputs the subtracted horizontal correlation data dx = b-c.

제1 비교기(233)는 제1 감산기(231)와 제2 감산기(232)로부터 각각 입력된 수직 및 수평 상관데이터에 대한 절대값을 상호 비교한 후 비교 결과에 따른 선택 제어신호를 출력한다. 상기에서 라인버퍼(220)에 저장된 각 픽셀의 오차 보상데이터는 상황에 따라 마이너스 값을 가질 수 있으며, 이때에는 각 픽셀의 절대값이 제1 및 제2 감산기(231, 232)로 각각 입력되도록 한다. The first comparator 233 compares absolute values of the vertical and horizontal correlation data input from the first subtractor 231 and the second subtractor 232 with each other and outputs a selection control signal according to the comparison result. In this case, the error compensation data of each pixel stored in the line buffer 220 may have a negative value depending on the situation. In this case, the absolute values of the pixels are input to the first and second subtractors 231 and 232, respectively .

픽셀연산부(234)는 예측하고자 하는 특정 픽셀과 관계된 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 설정된 연산 알고리즘에 따라 가감하여 연산한 후 연산된 결과값을 출력한다. 예컨대, 연산 알고리즘은 예측하고자 하는 특정 픽셀(i)의 좌측 픽셀(a)과 상단 픽셀(b)의 오차 보상데이터(a_d2, b_d2)를 서로 가산하고 가산된 값에 좌대각선 픽셀(c)의 오차 보상데이터(c_d2)를 다시 감산한다. The pixel operation unit 234 receives error compensation data for peripheral pixels related to a specific pixel to be predicted from the line buffer 220, calculates and adds the error compensation data according to a predetermined operation algorithm, and outputs the calculated result. For example, the calculation algorithm adds the error compensation data a_d2 and b_d2 of the left pixel a and the top pixel b of the specific pixel i to be predicted to each other and adds the error to the left diagonal pixel c And the compensation data c_d2 is subtracted again.

제2 비교기(235)는 픽셀연산부(234)로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력한다. 상기 기준값은 계조데이터(n비트)를 기준으로 하여 최대값(2n-1; n은 비트수임)으로 설정하는 것이 바람직하다. 예컨대, 각 픽셀의 계조데이터가 8비트이 므로 십진수로는 최대 255(28-1)값을 가질 수 있으므로 기준값(2n-1; n은 계조데이터의 비트수임)은 255로 설정된다.The second comparator 235 compares the absolute value of the operation result value input from the pixel operation unit 234 with a preset reference value, and outputs a selection control signal according to the comparison result. It is preferable that the reference value is set to a maximum value (2 n -1; n is a bit number) based on gradation data (n bits). For example, since the grayscale data of each pixel is 8 bits, it can have a maximum value of 255 (2 8 -1) as a decimal number, so the reference value (2 n -1; n is the number of bits of grayscale data) is set to 255.

제1 멀티플렉서(236a)는 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀(a)의 오차 보상데이터와 픽셀연산부(234)에서 출력된 연산 결과값을 각각 입력받아 제2 비교기(235)의 선택 제어신호에 따라 선택적으로 출력한다.The first multiplexer 236a receives the error compensation data of the left pixel (a) for the specific pixel to be predicted and the calculation result value output from the pixel computing unit 234, and outputs the result to the selection control signal of the second comparator 235 And outputs it selectively.

제2 멀티플렉서(236b)는 예측하고자 하는 특정 픽셀에 대한 상단 픽셀(b)의 오차 보상데이터와 픽셀연산부(234)에서 출력된 연산 결과값을 각각 입력받아 제2 비교기(235)의 선택 제어신호에 따라 선택적으로 출력한다.The second multiplexer 236b receives the error compensation data of the upper pixel b for the specific pixel to be predicted and the operation result value output from the pixel operation unit 234 and outputs the result to the selection control signal of the second comparator 235 And outputs it selectively.

제3 멀티플렉서(236c)는 제1 및 제2 멀티플렉서(236a, 236b)로부터 출력된 좌측 및 상단 픽셀(a, b)의 오차 보상데이터 또는 연산 결과값을 각각 입력받아 제1 비교기(233)의 선택 제어신호에 따라 선택적으로 출력한다.The third multiplexer 236c receives the error compensation data or operation result values of the left and upper pixels a and b outputted from the first and second multiplexers 236a and 236b and outputs the error compensation data or the operation result to the first comparator 233 And selectively outputs it according to the control signal.

클리핑부(237)는 제3 멀티플렉서(236c)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 예측된 데이터를 출력한다. 예컨대, 클리핑부(237)의 기준범위가 0 내지 255로 설정되어 있을 경우 제3 멀티플렉서(236c)로부터 입력된 값이 256이면 최대값인 255로 클리핑하여 출력하게 된다.The clipping unit 237 clips the data input from the third multiplexer 236c to a maximum value or a minimum value of the set range when the value of the data input from the third multiplexer 236c is out of a predetermined reference range, and outputs the predicted data. For example, when the reference range of the clipping unit 237 is set to 0 to 255, if the value input from the third multiplexer 236c is 256, the output is clipped to 255, which is the maximum value.

이와 같이 구성된 공간예측기(230)에서 특정 픽셀의 계조데이터를 예측하기 위해서 특정 픽셀에 대한 주변 픽셀간의 수평 및 수직 방향의 상관성을 이용하게 되는데, 수평 및 수직 방향의 상관성은 수평 및 수직 변화도(gradient)를 이용하여 계산하게 된다. 수평 및 수직 방향의 상관성은 제1 감산기(231)와 제2 감산기(232)를 통해 수평 픽셀간의 그래디언트(dx=b-c) 및 수직 픽셀간의 그래디언트(dy=a-c)를 이용하여 구한다. 이때 상관성에 따른 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 아래와 같다.In order to predict the gradation data of a specific pixel in the spatial predictor 230 constructed as described above, horizontal and vertical correlation between neighboring pixels is used for a specific pixel. The correlation between the horizontal and vertical directions is determined by a horizontal and vertical gradient ). The correlation in the horizontal and vertical directions is obtained by using the gradients (dx = b-c) between the horizontal pixels and the gradients (dy = a-c) between the vertical pixels through the first subtracter 231 and the second subtracter 232. The prediction data output from the third multiplexer 236c according to the correlation is as follows.

즉, 제1 비교기(233)의 비교 결과가 |dy|<|dx|이고 제2 비교기(235)의 비교 결과가 (|b+dy|)>255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 b픽셀의 오차 보상데이터(Prediction Data=b)이며, 제1 비교기(233)의 비교 결과가 |dy|<|dx|이고 제2 비교기(235)의 비교 결과가 (|b+dy|)<255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 b픽셀과 a픽셀의 오차 보상데이터를 가산한 후 c픽셀의 오차 보상데이터를 감산한 결과값(Prediction Data=b+dy)이다. 또한, 제1 비교기(233)의 비교 결과가 |dy|>|dx|이고 제2 비교기(235)의 비교 결과가 (|a+dx|)>255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 a픽셀의 오차 보상데이터(Prediction Data=a)이며, 제1 비교기(233)의 비교 결과가 |dy|>|dx|이고 제2 비교기(235)의 비교 결과가 (|a+dx|)<255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 a픽셀과 b픽셀의 오차 보상데이터를 가산한 후 c픽셀의 오차 보상데이터를 감산한 결과값(Prediction Data=a+dx)이다.That is, if the comparison result of the first comparator 233 is | dy | <| dx | and the comparison result of the second comparator 235 is (b + dy |)> 255, the prediction data output from the third multiplexer 236c is If the comparison result of the first comparator 233 is | dy | <| dx | and the comparison result of the second comparator 235 is (b + dy |) <255, The prediction data output from the third multiplexer 236c is a result of subtracting the error compensation data of c pixels after adding the error compensation data of the pixel b and the pixel a (Prediction Data = b + dy). If the comparison result of the first comparator 233 is | dy |> | dx | and the comparison result of the second comparator 235 is (a + dx |)> 255, the prediction data output from the third multiplexer 236c is if the comparison result of the first comparator 233 is | dy | &gt; | dx | and the comparison result of the second comparator 235 is (a + dx |) <255, The prediction data output from the third multiplexer 236c is a result of subtracting the error compensation data of c pixels after adding the error compensation data of the pixel a and the pixel b (Prediction Data = a + dx).

상기의 조건과 같이 수직 상관값(|dy|)와 수평 상관값(|dx|)을 비교하는 것을 통해 예측하고자 하는 픽셀이 수평 방향과 수직 방향 중 어느 쪽에 더 상관성이 있는지를 알 수 있다. 만약 dx의 값이 더 작다면 b픽셀의 오차 보상데이터가 예측하고자 하는 특정 픽셀(i)의 계조데이터에 더 가까우며, dy의 값이 더 작다면 a픽 셀의 오차 보상데이터가 예측하고자 하는 특정 픽셀(i)의 계조데이터에 더 가깝게 된다. 또한 a픽셀과 b픽셀 및 c픽셀의 연산값(a+b-c)이 255값 이하이면 예측데이터(p)로 a+b-c의 연산 결과값을 사용한다.By comparing the vertical correlation value (| dy |) with the horizontal correlation value (| dx |) as described above, it is possible to know whether the pixel to be predicted is more related to the horizontal direction or the vertical direction. If the value of dx is smaller, the error compensation data of b pixels is closer to the gray level data of the specific pixel (i) to be predicted. If the value of dy is smaller, the error compensation data of a pixel (i). Also, if the calculated value (a + b-c) of the pixels a, b, and c is 255 or less, the calculation result value of a + b-c is used as the predicted data p.

한편, 상기에서 이미지를 실제로 압축할 경우 매크로블록 단위로 압축하기 때문에 참조할 픽셀이 없는 경우가 존재하는데 이 경우에는 방향 예측이 불가능하다. 이 경우의 픽셀들은 압축율을 높이기 위해서 DPCM(Differential Pulse Coded Modulation)을 이용하여 예측한다. 즉, 블록의 첫 번째 픽셀은 예측할 수 없지만 수평방향의 첫번째 줄과 수직방향의 첫번째 줄은 각각의 이전 픽셀을 이용하여 예측하는 것이 바람직하다. 예컨대, 라인버퍼(220)에 매크로블록의 첫 번째 행인 c와 b픽셀에 대한 오차 보상데이터만 저장되어 있을 경우 b픽셀을 예측하고자 한다면 c픽셀의 오차 보상데이터가 감산기(240)로 입력되는 예측데이터가 되는 것이고, 라인버퍼(220)에 매크로블록의 첫 번째 열인 c와 a픽셀에 대한 오차 보상데이터만 저장되어 있을 경우 a픽셀을 예측하고자 한다면 c픽셀의 오차 보상데이터가 감산기(240)로 입력되는 예측데이터가 되는 것이다.On the other hand, when the image is actually compressed, there is a case where there is no pixel to be referred to because it is compressed in units of macroblocks. In this case, direction prediction is impossible. In this case, the pixels are predicted using Differential Pulse Coded Modulation (DPCM) to increase the compression ratio. That is, although the first pixel of the block is unpredictable, it is desirable to predict the first line in the horizontal direction and the first line in the vertical direction using each previous pixel. For example, if only the error compensation data for the c and b pixels, which are the first row of the macroblock, are stored in the line buffer 220, if the b pixel is predicted, the error compensation data of the c pixel is input to the subtractor 240, When only the error compensation data for c and a pixels, which are the first columns of the macroblock, are stored in the line buffer 220, the error compensation data of c pixels are input to the subtractor 240 Predicted data.

이와 같이 구성된 도 5의 경우 기본적으로 예측하고자 하는 픽셀의 수평 및 수직 방향만 고려하기 때문에 대각선 방향의 픽셀간 상관도가 높은 경우에는 예측 성능이 다소 감소할 수도 있다. 이를 보안하기 위해서 도 6과 같이 수평 및 수직 방향뿐만 아니라 대각선 방향까지 고려하여 예측하도록 한다.5, only the horizontal and vertical directions of the pixel to be predicted are considered, and therefore, the prediction performance may be somewhat reduced when the inter-pixel correlation in the diagonal direction is high. In order to secure this, prediction is performed considering not only horizontal and vertical directions but also diagonal directions as shown in FIG.

즉, 도 6은 본 발명의 다른 실시예에 의한 공간예측기의 세부 구성을 나타낸 기능 블록도로서, 공간예측기(230)는 제1 감산부(231)와 제2 감산부(232), 비교 기(233), 복수의 멀티플렉서(234a, 234b), 가산기(235), 시프터(236), 제3 멀티플렉서(237), 제3 감산기(238) 및 클리핑부(239)를 포함하여 이루어져 있다.That is, FIG. 6 is a functional block diagram showing a detailed configuration of a spatial predictor according to another embodiment of the present invention. The spatial predictor 230 includes a first subtractor 231, a second subtractor 232, a comparator 233, a plurality of multiplexers 234a and 234b, an adder 235, a shifter 236, a third multiplexer 237, a third subtractor 238, and a clipping unit 239.

도 6에서 제1 감산부(231)는 미리 설정된 연산 알고리즘에 따라 예측하고자 하는 특정 픽셀과 관계된 주변 픽셀간의 상관성이 높은 수평, 수직 및 대각선 방향의 픽셀들에 대한 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 상관성이 높은 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력한다. 예컨대, 제1 감산부(231)는 복수의 감산기(231a~231h)로 이루어져 있는데, 각 감산기(231a~231h)는 특정 픽셀을 기준으로 상관성이 높은 수평, 수직, 좌대각선 및 우대각선 방향에 대한 각 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력하게 된다. 6, the first subtractor 231 subtracts error compensation data for horizontal, vertical, and diagonal pixels having high correlation between neighboring pixels related to a specific pixel to be predicted from the line buffer 220, And outputs the correlation data obtained by subtracting the correlation data from each other. For example, the first subtractor 231 includes a plurality of subtractors 231a through 231h. The subtracters 231a through 231h are arranged in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction, And outputs the correlation data obtained by subtracting each of the pixels.

제2 감산부(232)는 제1 감산부(231)로부터 상관성이 높은 복수의 수평, 수직, 좌대각선 및 우대각선의 상관데이터에 대한 절대값을 각각 입력받아 감산한 후 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 출력한다. 예컨대, 제2 감산부(232)는 복수의 감산기(232a~232d)로 이루어져 있는데, 각 감산기(232a~232d)는 제1 감산부(231)로부터 출력된 복수의 수평, 수직, 좌대각선 및 우대각선 방향의 상관데이터 중 동일한 방향의 상관데이터끼리 감산하고 감산된 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 출력하게 된다. 상기에서 제1 감산부(231)에서 출력되는 상관데이터는 상황에 따라 마이너스 값을 가질 수 있으며, 이때에는 각 상관데이터의 절대값이 제2 감산부(232)로 입력되도록 한다. The second subtractor 232 receives and subtracts absolute values of a plurality of correlated horizontal, vertical, left diagonal and right diagonal correlated data from the first subtractor 231, And the right diagonal line, respectively. For example, the second subtractor 232 includes a plurality of subtractors 232a through 232d. Each of the subtractors 232a through 232d includes a plurality of horizontal, vertical, and left diagonal lines and right The correlation data in the same direction among the diagonal direction correlated data is subtracted, and correlation data for the subtracted horizontal, vertical, left diagonal, and right diagonal lines are respectively output. In this case, the correlation data output from the first subtraction unit 231 may have a negative value depending on the situation. In this case, the absolute value of each correlation data is input to the second subtraction unit 232.

비교기(233)는 제2 감산부(232)로부터 입력된 수평, 수직, 좌대각선 및 우대 각선에 대한 상관데이터를 상호 비교한 후 비교 결과에 따른 선택 제어신호를 출력한다. The comparator 233 compares the correlation data for the horizontal, vertical, left diagonal, and right-angled lines inputted from the second subtractor 232, and outputs a selection control signal according to the comparison result.

제1 멀티플렉서(234a)는 제1 감산부(231)로부터 특정 픽셀(i)의 이전 픽셀(a)을 기준으로 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 입력받고, 비교기(233)의 선택 제어신호에 따라 입력된 어느 하나의 상관데이터를 선택하여 출력하게 된다. 상기 특정 픽셀(i)의 이전 픽셀은 특정 픽셀(i)의 좌측에 인접된 픽셀(a)로 특정 픽셀(i)의 바로 이전의 픽셀(a)에 해당된다.The first multiplexer 234a receives the correlation data for the horizontal, vertical, left diagonal and right diagonal lines from the first subtractor 231 based on the previous pixel a of the specific pixel i, And selects and outputs one of the input correlation data. The previous pixel of the specific pixel i corresponds to the pixel a immediately preceding the specific pixel i as the pixel a adjacent to the left of the specific pixel i.

제2 멀티플렉서(234b)는 제1 감산부(231)로부터 특정 픽셀(i)의 이전 픽셀(n)을 기준으로 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 입력받고, 비교기(233)의 선택 제어신호에 따라 입력된 어느 하나의 상관데이터를 선택하여 출력하게 된다. 상기 특정 픽셀(i)의 이전 픽셀은 특정 픽셀(i)의 좌측에 이격된 픽셀(n)로 특정 픽셀(i)의 좌측에 인접된 픽셀(a)의 이전 픽셀(n)에 해당된다.The second multiplexer 234b receives the correlation data for the horizontal, vertical, left diagonal and right diagonal lines from the first subtractor 231 on the basis of the previous pixel n of the specific pixel i, And selects and outputs one of the input correlation data. The previous pixel of the particular pixel i corresponds to the previous pixel n of the pixel a adjacent to the left of the particular pixel i as the pixel n spaced to the left of the particular pixel i.

가산기(235)는 제1 멀티플렉서(234a)와 제2 멀티플렉서(234b)로부터 각각 입력된 상관데이터를 가산하여 출력한다.The adder 235 adds correlation data input from the first multiplexer 234a and the second multiplexer 234b, and outputs the result.

시프터(236)는 가산기(235)로부터 입력된 데이터를 오른쪽(right)으로 1비트 시프트하도록 하여 최하위비트(least significant bit)를 제거(discard)한다.The shifter 236 shifts the data input from the adder 235 by one bit to the right to discard the least significant bit.

제3 멀티플렉서(237)는 예측하고자 하는 특정 픽셀을 기준으로 좌측, 상단, 좌대각선 및 우대각선에 대한 오차 보상데이터(a, b, c, f)를 라인버퍼(220)로부터 각각 입력받고, 비교기(233)의 선택 제어신호에 따라 입력된 어느 하나의 보상데이 터를 선택하여 출력하게 된다.The third multiplexer 237 receives the error compensation data (a, b, c, f) for the left, top, left diagonal and right diagonal from the line buffer 220 based on the specific pixel to be predicted, And selects and outputs any one of the input compensation data according to the selection control signal of the selector 233.

제3 감산기(238)는 제3 멀티플렉서(237)와 시프터(236)로부터 각각 입력된 보상데이터를 상호 감산하여 출력한다.The third subtractor 238 subtracts and outputs the compensation data input from the third multiplexer 237 and the shifter 236, respectively.

클리핑부(239)는 제3 감산기(238)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 감산기(240)로 출력한다. 예컨대, 클리핑부(239)의 기준범위가 0 내지 255로 설정되어 있을 경우 제3 감산기(238)로부터 입력된 값이 256이면 최대값인 255로 클리핑하여 출력하게 된다.When the value of the data input from the third subtracter 238 is out of the predetermined reference range, the clipping unit 239 clips the data to the maximum value or the minimum value of the set range and outputs the result to the subtractor 240. For example, when the reference range of the clipping unit 239 is set to 0 to 255, the value is 256, which is the maximum value 255, and the clipping is output.

도 6과 같이 구성된 공간예측기(230)에서는 수평 및 수직 방향만 고려할 경우에 대각선 방향의 픽셀간 상관성이 수평 및 수직간 픽셀보다 높을 경우에는 예측 성능이 다소 감소될 수 있는 단점을 보완하기 위하여 좌측과 우측 대각선 방향까지 고려하여 특정 픽셀의 계조데이터를 예측한 것이다.The spatial predictor 230 constructed as shown in FIG. 6 compensates the drawback that the correlation between the pixels in the diagonal direction is higher than that between the horizontal and vertical pixels in the case of considering only the horizontal and vertical directions, And the gradation data of a specific pixel is predicted in consideration of the right diagonal direction.

즉, 제1 감산부(231)와 제2 감산부(232)를 통해 아래 수학식 2와 같이 각 방향의 상관성을 예측하였다.That is, through the first subtraction unit 231 and the second subtraction unit 232, the correlation in each direction is predicted as shown in Equation (2) below.

horizontal(수평) = |△cb|-|△na|horizontal (horizontal) = | cb | - | na na |

vertical(수직) = |△dn|-|△ca|vertical (vertical) = | dn | - | ca |

left diagonal(좌대각선) = |△en|-|△da|left diagonal = | △ en | - | △ da |

right diagonal(우대각선) = |△cn|-|△ba| right diagonal = | cn | - | △ ba |

여기서, △cb=c-b이고, △na=n-a이고, △dn=d-n이고, △ca=c-a이고, △en=e-n이고, △da=d-a이고, △cn=c-n이며, △ba=b-a이고, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 보상데이터, n은 a픽셀의 좌측에 위치한 픽셀의 보상데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 b픽셀의 좌측에 위치한 픽셀의 보상데이터, d는 c픽셀의 좌측에 위치한 픽셀의 보상데이터, e는 d픽셀의 좌측에 위치한 픽셀의 보상데이터, f는 b픽셀의 우측에 위치한 픽셀의 보상데이터이다. Where a is cb = c-b,? Na = n-a,? Dn = d-n,? Ca = c-a,? En = e-n,? Da = d- A is the compensation data of the pixel located to the left of the specific pixel to be predicted, n is the compensation data of the pixel located to the left of the pixel a, b is the compensation data of the pixel located to the left of the pixel a, C is the compensation data of the pixel located on the left side of the pixel b, d is the compensation data of the pixel located on the left side of the pixel c, e is the compensation data of the pixel located on the left side of the pixel d, f Is the compensation data of the pixel located on the right side of the b pixel.

상기 수학식 2와 같이 방향성의 예측확률을 높이기 위해 각 방향에 대한 변화값(gradient)을 두 개씩 이용하였다.As shown in Equation (2), two gradient values for each direction are used in order to increase the prediction probability of directionality.

이에 따라 비교기(233)는 수평과 수직, 좌대각선 및 우대각선을 포함한 네 가지 방향에 대한 상관데이터를 비교 계산하여 그 중 가장 작은 값을 갖는 방향을 선택하고, 선택된 방향에 대한 선택 제어신호를 각 멀티플렉서(234a 234b, 237)로 출력하게 된다. 상기에서 가장 작은 상관값은 예측하고자 하는 특정 픽셀(i)의 계조데이터에 가장 가깝다.Accordingly, the comparator 233 compares the correlation data for four directions including the horizontal and vertical directions, the left diagonal line and the right diagonal line, selects a direction having the smallest value among them, and outputs a selection control signal for the selected direction And output to multiplexers 234a 234b and 237, respectively. The smallest correlation value is closest to the grayscale data of the specific pixel (i) to be predicted.

이어, 공간예측기(230)는 가장 작은 상관값이 예측하고자 하는 특정 픽셀(i)의 계조데이터에 가장 가까우므로 그 방향의 오차 보상데이터에 가중치를 더하기 위해서 각 방향에 대해 아래 수학식 3과 같은 계산을 통해 예측데이터를 좀 더 정확하게 예측한다.Since the smallest correlation value is closest to the grayscale data of the specific pixel (i) to be predicted, the spatial predictor 230 performs calculation such as Equation 3 below for each direction in order to add a weight to the error compensation data in that direction To predict the prediction data more accurately.

horizontal(수평) = a-(△cb+△na)/2horizontal (horizontal) = a- (? cb +? na) / 2

vertical(수직) = b-(△dn+△ca)/2vertical = b- (? dn +? ca) / 2

Left diagonal(좌대각선) = c-(△en+△da)/2Left diagonal = c- (? En +? Da) / 2

Right diagonal(우대각선) = f-(△cn+△ba)/2Right diagonal = f- (? Cn +? Ba) / 2

즉, 비교기(233)는 각 방향에 대해 가장 작은 상관값을 갖는 방향을 선택하는 제어신호를 제1 멀티플렉서(234a)와 제2 멀티플렉서(234b)로 먼저 출력하면, 수학식 2와 같이 제1 멀티플렉서(234a)와 제2 멀티플렉서(234b)는 그와 관련된 방향의 상관값(gradient)을 가산기(235)로 각각 출력하고, 가산기(235)는 각 상관값을 가산하여 시프터(236)로 출력하게 된다. 시프터(236)는 가산기(235)로부터 입력된 값을 1비트 라이트 시프트(right shift)하여, 즉 입력값을 1/2로 줄여서 제3 감산기(238)로 출력하게 된다. That is, the comparator 233 first outputs a control signal for selecting a direction having the smallest correlation value to each direction to the first multiplexer 234a and the second multiplexer 234b, The second multiplexer 234a and the second multiplexer 234b respectively output a correlation value in a direction related thereto to the adder 235 and the adder 235 adds the correlation values to output to the shifter 236 . The shifter 236 right shifts the value input from the adder 235 by 1 bit, that is, reduces the input value to 1/2, and outputs the result to the third subtractor 238. [

한편, 제3 멀티플렉서(237)는 비교기(233)로부터 입력된 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 근접한 소정 방향의 픽셀에 대한 오차 보상데이터를 제3 감산기(238)로 출력하게 된다. 이에 따라 제3 감산기(238)는 제3 멀티플렉서(237)와 시프터(236)로부터 입력된 데이터를 감산하여 클리핑부(239)로 출력하게 된다.The third multiplexer 237 outputs error compensation data for pixels in a predetermined direction close to a specific pixel to be predicted to the third subtracter 238 according to the selection control signal input from the comparator 233. Accordingly, the third subtracter 238 subtracts the data input from the third multiplexer 237 and the shifter 236, and outputs the subtracted data to the clipping unit 239.

클리핑부(239)는 제3 감산기(238)로부터 입력된 예측데이터를 미리 설정된 0 내지 255값의 범위로 제한한 후 감산기(240)로 출력하게 된다. The clipping unit 239 limits the prediction data input from the third subtractor 238 to a predetermined range of 0 to 255, and outputs the result to the subtractor 240.

상기에서 이미지를 실제로 압축할 경우 매크로블록 단위로 압축하기 때문에 참조할 픽셀이 없는 경우가 존재하는데 이 경우에는 방향 예측이 불가능하다. 이 경우의 픽셀들은 압축율을 높이기 위해서 DPCM(Differential Pulse Coded Modulation)을 이용하여 예측한다. 즉, 블록의 첫 번째 픽셀은 예측할 수 없지만 수평방향의 첫번째 줄과 수직방향의 첫번째 줄은 각각의 이전 픽셀을 이용하여 예측하는 것이 바람직하다.In the above case, when the image is actually compressed, there is a case where there is no pixel to be referred to because it is compressed in units of macroblocks. In this case, direction prediction is impossible. In this case, the pixels are predicted using Differential Pulse Coded Modulation (DPCM) to increase the compression ratio. That is, although the first pixel of the block is unpredictable, it is desirable to predict the first line in the horizontal direction and the first line in the vertical direction using each previous pixel.

한편, 도 3의 압축장치에서 압축효율을 높이기 위해서는 최적의 부호화 파라미터인 k를 구해야 한다. 따라서, 파라미터계산기(270)는 공간예측기(230)의 시프터(236)에서 출력되는 데이터를 입력받아 비트수를 계산한 후 계산된 비트수를 부호화 파라미터인 k값으로 결정하여 부호화기(280)로 전달하게 된다. On the other hand, in order to increase the compression efficiency in the compression apparatus of FIG. 3, it is necessary to find an optimal encoding parameter k. Therefore, the parameter calculator 270 receives the data output from the shifter 236 of the spatial predictor 230, calculates the number of bits, determines the calculated number of bits to be a k parameter, which is a coding parameter, and transmits it to the encoder 280 .

즉, 공간예측기(230)의 시프터(236)에서 출력되는 데이터(Pe)는 각 방향(horizontal, vertical, left diagonal 및 right diagonal)에 따라 아래 수학식 4와 같으며, 파라미터계산기(270)는 상기 수학식 4에 의해 출력된 데이터(Pe)의 비트수를 체크하여 부호화 파라미터로 정한다.That is, the data Pe output from the shifter 236 of the spatial predictor 230 is expressed by Equation (4) below according to each direction (horizontal, vertical, left diagonal, and right diagonal) The number of bits of the data Pe output by Equation (4) is checked to determine the encoding parameter.

Horizontal: Pe = (△cb+△na)/2 Horizontal: Pe = (? Cb +? Na) / 2

Vertical: Pe = (△dn+△ca)/2Vertical: Pe = (? Dn +? Ca) / 2

Left Diagonal: Pe = (△en+△da)/2Left Diagonal: Pe = (? En +? Da) / 2

Right Diagonal: Pe = (△cn+△ba)/2Right Diagonal: Pe = (? Cn +? Ba) / 2

도 7은 손실팩터선택기(260)에서 하나의 매크로블록에 대한 손실팩터를 정하는 과정을 설명하기 위해 나타낸 플로우챠트로서, 도 3을 참조하여 살펴보면 아래와 같다.FIG. 7 is a flow chart for explaining a process of determining a loss factor for one macroblock in the loss factor selector 260, and will be described with reference to FIG. 3 as follows.

영상처리 칩의 종류에 따라 슬라이스(slice) 또는 라지 매크로블록(Large Macroblock; LMB) 단위로 영상을 라이트(write) 및 리드(read)할 수 있다. 어떤 경 우 2가지 모두 필요한 경우도 있다. 상기 슬라이스(slice)와 라지 매크로블록(Large Macroblock; LMB)은 도 8에 도시된 바와 같다. 예컨대, 이미지에서 한 행의 매크로블록(Macroblock; MB)들이 하나의 슬라이스가 되고, 16개의 매크로블록들이 하나의 라지 매크로블록이 될 수 있으며, 하나의 슬라이스는 복수의 라지 매크로블록에 포함될 수 있다. An image can be written and read in units of a slice or a large macro block (LMB) according to the type of image processing chip. In some cases, both are necessary. The slice and the large macroblock (LMB) are as shown in FIG. For example, one row of macroblocks (MB) in the image may be one slice, and sixteen macroblocks may be one large macro-block, and one slice may be included in a plurality of large macroblocks.

따라서, 칩 관점에서 보면 slice와 LMB 단위로 메모리 대역폭이 일정하도록 만드는 것이 필요하다. 도 7은 이를 위해 제안된 알고리즘으로 매크로블록 단위로 손실팩터를 조절하여 주어진 압축 비트량을 맞춘다. 즉, 매크로블록 내의 모든 픽셀은 동일한 손실팩터를 갖는다.Therefore, from a chip point of view, it is necessary to make the memory bandwidth constant in slice and LMB units. FIG. 7 shows a proposed algorithm for adjusting the loss factor in units of macroblocks to adjust a given amount of compressed bits. That is, all pixels in a macroblock have the same loss factor.

먼저, 손실팩터선택기(260)의 비트수카운터(262)는 부호화기(280)에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하게 되는 데, 상기 카운트값은 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 카운트하여 누적하게 된다(S1). 즉, 비트수카운터(262)에는 하나의 슬라이스 카운터와 상기 슬라이스를 포함하는 복수의 LMB 카운터가 별도로 존재할 수 있다.First, the number-of-bits counter 262 of the loss factor selector 260 counts the number of bits of error data of all pixels output from the encoder 280. The count value is divided into a slice unit including each macroblock, And counts them in units of LMB including macroblocks (S1). That is, the bit number counter 262 may have one slice counter and a plurality of LMB counters including the slice separately.

이와 같은 상태에서 손실팩터계산부(263)는 목표비트저장부(261)에 저장된 매크로블록의 목표 비트량(target bits)을 기준으로 매크로블록, 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 각각 계산하게 된다(S2).In this state, the loss factor calculator 263 calculates the surplus bits for the macroblock, slice or LMB based on the target bits of the macroblock stored in the target bit storage unit 261 (S2).

상기 잉여비트수란 이전 매크로블록(MB)까지 발생한 비트수(발생비트수)가 이전 매크로블록들에 할당된 비트수(타깃비트수)보다 얼마나 적은지를 나타내는 값으로 이 값이 0보다 작으면 손실팩터를 높여 매크로블록의 계조데이터를 더 압축시 켜야 함을 의미한다.The number of redundant bits is a value indicating whether the number of bits (number of generated bits) generated up to the previous macroblock (MB) is smaller than the number of bits (target bits) allocated to the previous macroblocks. It means that the gray level data of the macroblock must be further compressed by increasing the factor.

상기 슬라이스 및 LMB에 대한 현재 잉여비트수는 아래 수학식 5에 구해진다.The current number of redundant bits for the slice and the LMB is obtained from the following equation (5).

현재 LMB_잉여비트수=이전 LMB_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current LMB_condition bits = previous LMB_condition bits + (MB_target bits -MB_bits)

현재 slice_잉여비트수=이전 slice_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current number of slice_three bits = number of previous slice_three bits + (number of MB_target bits - number of MB_breaking bits)

상기 수학식 5의 MB_타깃비트수(target bits)는 각각 슬라이스와 LMB의 대역폭 제한을 매크로블록으로 환산한 값이다.The MB_target bits in Equation (5) are values obtained by converting the bandwidth limitation of the slice and the LMB into macroblocks.

상기에서 손실팩터를 정할 때 슬라이스 또는 LMB의 잉여비트수를 고려하는 이유는 압축 효율도 높이고 화질의 신뢰성도 높이기 위함이다. 예컨대, 매크로블록의 타깃비트수를 100으로 설정하였을 경우 동일한 슬라이스에서 제1 매크로블록의 발생비트수가 90이고 제2 매크로블록의 발생비트수가 110일 경우, 단지 매크로블록의 타깃비트수만 고려한다면 제3 매크로블록은 제2 매크로블록의 발생비트수에 의해 발생비트수가 90이 되도록 손실팩터를 정해야 한다. 하지만, 본 발명에서는 슬라이스내의 잉여비트수를 고려함에 따라 제1 및 제2 매크로블록의 잉여비트수는 0(10+(100-110))이 되므로 제3 매크로블록의 발생비트수가 목표비트수인 100이 되도록 손실팩터를 정할 수가 있다. 이와 같은 방식은 매크로블록별로 목표비트수에 맞추어 무리하게 압축함에 따라 화질이 악화되는 것을 방지할 수 있다.The reason for considering the number of redundant bits of the slice or LMB when determining the loss factor is to increase the compression efficiency and increase the reliability of the image quality. For example, when the number of target bits of a macroblock is set to 100, if the number of generated bits of the first macro block is 90 and the number of generated bits of the second macro block is 110 in the same slice, The macroblock must determine the loss factor so that the number of generated bits is 90 due to the number of generated bits of the second macroblock. However, according to the present invention, considering the number of redundant bits in the slice, the number of redundant bits of the first and second macroblocks is 0 (10 + (100-110)), so that the number of generated bits of the third macroblock is the target number of bits 100 &lt; / RTI &gt; Such a method can prevent image quality from deteriorating due to unreasonable compression in accordance with the target bit number for each macroblock.

따라서, 손실팩터계산부(263)는 상기와 같이 구해진 현재 매크로블록이 속한 슬라이스 또는 LMB의 잉여비트수를 체크하여 0보다 같거나 작은지 또는 큰지를 비교 판단하게 된다(S3).Accordingly, the loss factor calculator 263 checks the number of redundant bits of the slice or the LMB to which the current macroblock belongs, as described above, and compares and judges whether it is equal to or less than 0 (S3).

만일, 현재 슬라이스 또는 LMB의 잉여비트수가 0보다 같거나 작을 경우 다음 매크로블록의 손실팩터를 현재의 손실팩터보다 1비트 증가시켜 압축률을 증가시키게 되고(S4), 현재 슬라이스 또는 LMB의 잉여비트수가 0보다 클 경우 다음 매크로블록의 손실팩터를 현재의 손실팩터보다 1비트 감소시켜 압축률을 감소시키게 된다(S5).If the number of redundant bits of the current slice or LMB is equal to or smaller than 0, the loss factor of the next macroblock is increased by 1 bit from the current loss factor to increase the compression ratio (S4). If the number of redundant bits of the current slice or LMB is 0 The loss factor of the next macroblock is reduced by 1 bit from the current loss factor to reduce the compression ratio (S5).

아울러, 손실팩터계산부(263)는 변화도계산부(265)로부터 입력된 블록 변화도(activity)에 대한 데이터를 미리 설정된 기준값과 비교하여 같거나 작으면 블록 변화도가 작은 것으로 판단하고, 변화도 데이터가 기준값보다 클 경우에는 블록 변화도가 높은 것으로 판단한다(S6, S7).The loss factor calculator 263 compares the data of the block variation input from the variation calculator 265 with a preset reference value to determine that the block variation is small if the loss factor is equal to or smaller than a preset reference value, If the data is larger than the reference value, it is determined that the degree of block change is high (S6, S7).

상기에서 변화도계산부(265)는 특정 픽셀 또는 매크로블록을 기준으로 주변 픽셀 또는 매크로블록의 상관관계를 통해 변화도를 계산한다. 예컨대, 특정 픽셀(i)을 기준으로 상하좌우에 각각 a, b, c 및 d픽셀이 있다고 가정할 경우 변화도는

Figure 112008062637781-pat00001
의 식에 의해 구해질 수 있다.The change degree calculation unit 265 calculates the degree of change based on the correlation between neighboring pixels or macroblocks on the basis of a specific pixel or a macroblock. For example, assuming that a, b, c, and d pixels exist on the upper, lower, left, and right sides of a specific pixel (i)
Figure 112008062637781-pat00001
. &Lt; / RTI &gt;

이어, 손실팩터계산부(263)는 계산된 블록 변화도에 따라 손실팩터를 조정하게 되는 데, 만일 변화도가 낮을 경우 손실팩터를 낮추어 압축률을 감소시킨다(S8). 이는 평탄한 영역에서 손실이 발생되면 블로킹 아티팩트(Blocking Artifact)가 더 잘 띄기 때문에 이를 줄이기 위해서 필요하다. Then, the loss factor calculator 263 adjusts the loss factor according to the calculated block change degree. If the degree of change is low, the loss factor is decreased to reduce the compression ratio (S8). This is necessary in order to reduce the blocking artifact because the loss in the flat area is better.

마지막으로 손실팩터계산부(263)는 구해진 압축 손실팩터를 미리 설정된 최소값(min_LP)과 최대값(max_LP)의 범위 이내로 클리핑(S9)시킨 후 클리핑된 손실팩터를 다음 매크로블록의 손실팩터로 결정한다(S10). 상기에서 블록내 상관성이 적은 픽셀이거나 목표비트수가 너무 작게 설정된 경우에는 한계 메모리 대역폭을 만족시키지 못하는 경우가 발생할 수 있는 데, 이 경우에는 손실팩터의 최대값(max_LP)을 높게 설정하면 이러한 경우를 방지할 수 있다.Finally, the loss factor calculator 263 clips (S9) the obtained compression loss factor within the range of the preset minimum value min_LP and maximum value max_LP, and then determines the clipped loss factor as the loss factor of the next macroblock (S10). In the above case, when the number of pixels in the block is small or the target bit number is set too small, the limit memory bandwidth may not be satisfied. In this case, if the maximum value max_LP of the loss factor is set high, can do.

이와 같이 구성된 압축장치는 기존의 JPEG-LS나 PNG와 같은 알고리즘과 비교하여 처리 시간 및 하드웨어 복잡성을 줄이면서, 거의 화질의 손실없이 대역폭 감축을 얻을 수 있다. 또한, 이와 같은 압축장치를 각종 영상 가전이나 포터블 미디어 기기 및 디지털 방송 등 여러 응용분야의 영상처리 칩에 적용할 경우 가격 경쟁력 강화 및 차별화 기술 등의 큰 효과를 얻을 수 있다.Such a compression device can achieve bandwidth reduction with almost no loss of image quality, while reducing processing time and hardware complexity compared to algorithms such as JPEG-LS and PNG. In addition, when such a compression device is applied to image processing chips of various application fields such as various image appliances, portable media devices, and digital broadcasting, it is possible to obtain a great effect such as cost competitiveness enhancement and differentiation technology.

상기의 본 발명의 바람직한 실시예는 예시의 목적을 위해 개시된 것이고, 본 발명에 대한 통상의 지식을 가진 당업자라면 본 발명의 기술적 사상 내에서 다양한 수정, 변경 및 부가가 가능할 것이다. 그러므로, 이러한 수정, 변경 및 부가는 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.The foregoing preferred embodiments of the present invention have been disclosed for illustrative purposes, and those skilled in the art will appreciate that various modifications, additions and substitutions are possible within the technical scope of the present invention. Therefore, such modifications, alterations, and additions should be defined by the claims appended hereto, as well as the appended claims.

도 1은 본 발명의 일실시예에 의한 이미지 무손실 압축 시스템을 나타낸 기능 블록도이다.1 is a functional block diagram illustrating an image lossless compression system according to an embodiment of the present invention.

도 2는 본 발명에 의한 도 1의 공간예측기를 나타낸 세부 기능 블록도이다.FIG. 2 is a detailed functional block diagram of the space predictor of FIG. 1 according to the present invention.

도 3은 본 발명의 다른 실시예에 의한 이미지 손실 압축 시스템을 나타낸 기능 블록도이다.3 is a functional block diagram illustrating an image loss compression system according to another embodiment of the present invention.

도 4a 및 도 4b는 도 3의 블록버퍼와 라인버퍼에 저장된 데이터를 설명하기 위해 도시한 도면이다.4A and 4B are diagrams for explaining data stored in the block buffer and the line buffer of FIG.

도 5는 본 발명의 일실시예에 의한 도 3의 공간예측기를 나타낸 세부 기능 블록도이다.5 is a detailed functional block diagram illustrating the spatial predictor of FIG. 3 according to an embodiment of the present invention.

도 6은 본 발명의 다른 실시예에 의한 도 3의 공간예측기를 나타낸 세부 기능 블록도이다.6 is a detailed functional block diagram illustrating the spatial predictor of FIG. 3 according to another embodiment of the present invention.

도 7은 도 3의 손실팩터선택기가 손실팩터를 구하는 과정을 나타낸 플로우챠트이다.FIG. 7 is a flowchart illustrating a loss factor estimation process of the loss factor selector of FIG. 3. FIG.

도 8은 이미지의 매크로블록과 슬라이스 및 라지 매크로블록을 설명하기 위해 도시한 도면이다.FIG. 8 is a diagram illustrating a macroblock of an image and a slice and a large macro block.

* 도면의 주요 부분에 대한 부호의 설명DESCRIPTION OF THE REFERENCE NUMERALS

100: 무손실 압축장치 110: 블록버퍼100: lossless compression device 110: block buffer

130: 공간예측기 150: 감산기130: Spatial predictor 150:

170: 파라미터계산기 190: 부호화기170: Parameter calculator 190: Encoder

200: 손실 압축장치 210: 블록버퍼200: lossy compression device 210: block buffer

220: 라인버퍼 230: 공간예측기220: line buffer 230: space predictor

240: 감산기 250: 손실처리기240: Subtractor 250: Loss processor

260: 손실팩터선택기 261: 목표비터저장부260: loss factor selector 261: target bitter storage unit

262: 비트수카운터 263: 손실팩터계산부262: bit number counter 263: loss factor calculation unit

265: 변화도계산부 270: 파라미터계산기265: Change calculator 270: Parameter calculator

280: 부호화기 290: 픽셀복원기280: Encoder 290: Pixel restorer

Claims (22)

이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터가 저장된 블록버퍼;A block buffer in which grayscale data of pixels is stored in macroblock units in which an image is divided into predetermined rows and columns; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기;A spatial predictor for receiving gray level data for at least one or more peripheral pixels related to a specific pixel to be predicted from the block buffer and for predicting gray level data for a specific pixel by using at least one directional correlation between neighboring pixels; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기; 및A subtractor for subtracting the gray level data of the specific pixel input from the block buffer and the prediction data for the specific pixel input from the spatial predictor and outputting the subtracted error data; And 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 이미지 무손실 압축 장치.And an encoder that adjusts the number of bits of the lossless error data input from the subtractor according to the encoding parameter input from the predetermined parameter calculator, and then delivers the adjusted bitstream to the memory. 청구항 1에 있어서,The method according to claim 1, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하는 이미지 무손실 압축 장치.Wherein the parameter calculator compares correlation values for at least one direction between neighboring pixels input from the spatial predictor and calculates the number of data bits of the minimum correlation value as the comparison parameter to determine the coding parameter. Compression device. 청구항 1 또는 청구항 2에 있어서,The method according to claim 1 or 2, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 및 좌측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 하는 이미지 무손실 압축 장치.Wherein the spatial predictor predicts the grayscale data using correlation between at least one of surrounding pixels in a horizontal direction, a vertical direction, and a left diagonal direction with respect to a specific pixel to be predicted. Device. 청구항 1 또는 청구항 2에 있어서, The method according to claim 1 or 2, 상기 공간예측기는 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식1을 이용하여 예측하는 것을 특징으로 하는 이미지 무손실 압축 장치.Wherein the spatial predictor predicts prediction data of a specific pixel to be predicted using Equation (1) below. 수학식 1Equation 1 |dy|<|dx|이고 (|b+dy|)>255 이면, Prediction Data = b| dy | <| dx | and (| b + dy |)> 255, then Prediction Data = b (|b+dy|)≤255 이면, Prediction Data = b+dy               (| b + dy |)? 255, Prediction Data = b + dy |dy|>|dx|이고 (|a+dx|)>255 이면, Prediction Data = a| dy |> | dx | and (| a + dx |)> 255, Prediction Data = a (|a+dx|)≤255 이면, Prediction Data = a+dx               (| a + dx |) &lt; 255, Prediction Data = a + dx 단, dx는 b-c, dy는 a-c, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c 는 예측하고자 하는 특정 픽셀의 좌측 대각선에 위치한 픽셀의 데이터임.B is the data of the pixel located at the top of the specific pixel to be predicted, c is the data of the pixel to be predicted, Data of the pixel located on the left diagonal of the pixel. 청구항 1 또는 청구항 2에 있어서,The method according to claim 1 or 2, 상기 공간예측기는, The space predictor includes: 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; A subtractor for receiving the grayscale data for the surrounding pixels based on the specific pixel to be predicted from the block buffer, subtracting the grayscale data from the surrounding pixels in the horizontal and vertical directions, and obtaining the horizontal and vertical correlation data; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기;A first comparator for comparing the horizontal and vertical correlation data input from the subtractor and outputting a selection control signal according to a comparison result; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부;A pixel arithmetic unit for receiving the gray level data of the surrounding pixels based on the specific pixel to be predicted from the block buffer and adding the pixels located at the left side and the upper side to each other and subtracting the pixels located in the diagonal direction; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기;A second comparator for comparing an absolute value of the operation result value input from the pixel operation unit with a preset reference value and outputting a selection control signal according to the comparison result; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 계조데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서;A first multiplexer for selectively outputting gradation data of a left pixel for a specific pixel to be predicted and an operation result value input from a pixel operation unit according to a selection control signal of the second comparator; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 계조데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출 력하는 제2 멀티플렉서; 및A second multiplexer for selectively outputting gradation data of a top pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; And 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 계조데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 하는 이미지 무손실 압축 장치.And a third multiplexer for selectively outputting gradation data or operation result values of left and upper pixels input from the first and second multiplexers according to the selection control signal of the first comparator, Device. 청구항 5에 있어서,The method of claim 5, 상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 하는 이미지 무손실 압축 장치.Wherein the spatial predictor further comprises a clipping unit for clipping and outputting a maximum value or a minimum value within a predetermined range when the predicted value output from the third multiplexer is out of a preset reference value. 청구항 5에 있어서,The method of claim 5, 상기 감산기는, 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀과 좌대각선 픽셀의 계조데이터를 블록버퍼로부터 각각 입력받아 감산하고 감산된 수직 상관데이터를 출력하는 제1 감산기; 및 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 계조데이터를 블록버퍼로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력하는 제2 감산기;를 포함하는 것을 특징으로 하는 이미지 무손실 압축 장치.Wherein the subtractor comprises: a first subtractor for subtracting and outputting the grayscale data of the left pixel and the left diagonal pixel of the specific pixel to be predicted from the block buffer, and outputting the subtracted vertical correlation data; And a second subtractor for subtracting and outputting the grayscale data of the upper pixel and the left diagonal pixel for the specific pixel to be predicted from the block buffer, respectively, and outputting the subtracted horizontal correlation data. 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼;A block buffer in which gradation data of pixels are stored in macroblock units in which an image is divided into predetermined rows and columns; 상기 각 픽셀의 데이터 손실 처리에 따른 오차데이터를 일정 범위에서 손실 보상되고, 손실 보상된 보상데이터가 저장된 라인버퍼;A line buffer in which the error data according to the data loss process of each pixel is compensated for in a certain range and the loss compensated compensation data is stored; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 보상데이터를 라인버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기;A spatial predictor for receiving compensation data for at least one or more peripheral pixels related to a specific pixel to be predicted from the line buffer and predicting gray level data for a specific pixel by using at least one directional correlation between neighboring pixels; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기; A subtractor for subtracting the gray level data of the specific pixel input from the block buffer and the prediction data for the specific pixel input from the spatial predictor and outputting the subtracted error data; 상기 감산기로부터 입력된 특정 픽셀의 오차데이터를 소정의 손실팩터선택기로부터 입력된 손실팩터(Lossy Factor)에 따라 손실 처리한 후 손실된 오차데이터를 출력하는 손실처리기; 및A loss processor for performing lossy processing of error data of a specific pixel input from the subtractor according to a loss factor input from a predetermined loss factor selector and outputting lossy error data; And 상기 손실처리기로부터 입력된 손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 이미지 손실 압축 장치.And an encoder that adjusts the number of bits of lossy data input from the lossy processor according to a coding parameter input from a predetermined parameter calculator, and then delivers the adjusted bitstream to the memory. 청구항 8에 있어서,The method of claim 8, 상기 손실팩터선택기는 부호화기를 통해 출력되는 각 픽셀의 비트수를 카운트하여 누적하고 누적된 이전 블록의 비트수와 블록별 목표 비트수를 이용하여 현재 매크로블록에 적용할 손실팩터를 계산하여 결정하는 것을 특징으로 하는 이미지 손실 압축 장치.The loss factor selector counts and accumulates the number of bits of each pixel output through the encoder and calculates and determines a loss factor to be applied to the current macroblock by using the number of bits of the previous block and the number of target bits per block Characterized by an image loss compression device. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 손실팩터선택기는, 부호화기에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하여 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 누적하는 비트수카운터; 및 미리 저장된 매크로블록의 목표 비트량을 기준으로 현재 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 아래 수학식 2를 이용하여 계산한 후 계산된 현재 슬라이스(slice) 또는 LMB의 잉여비트수와 설정된 기준값을 상호 비교하여 손실팩터를 결정하는 손실팩터계산부;를 포함하여 구성된 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the loss factor selector comprises: a bit number counter for counting the number of bits of error data of all pixels output from the encoder and accumulating the slice unit including each macroblock and the LMB unit including the macroblock; And the surplus bits for the current slice or the LMB using the target bit amount of the previously stored macroblock, using the following equation (2), and calculating the number of surplus bits of the current slice or LMB And a loss factor calculator for comparing the set reference values with each other to determine a loss factor. 수학식 2Equation 2 현재 LMB_잉여비트수=이전 LMB_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current LMB_condition bits = previous LMB_condition bits + (MB_target bits -MB_bits) 현재 slice_잉여비트수=이전 slice_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current number of slice_three bits = number of previous slice_three bits + (number of MB_target bits - number of MB_breaking bits) 단, slice는 이미지에서 한 행의 매크로블록(Macroblock; MB)들의 집합이고, LMB(Large Macroblock)는 복수의 매크로블록의 집합임.However, slice is a set of macroblocks (MB) of a line in the image, and LMB (Large Macroblock) is a set of plural macroblocks. 청구항 10에 있어서,The method of claim 10, 상기 손실팩터계산부는 입력된 블록 변화도(activity)에 대한 데이터를 미리 설정된 기준값과 비교하여 블록 변화도가 낮을 경우 손실팩터를 감소시키는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the loss factor calculator compares data on an input block activity with a preset reference value to reduce a loss factor when the degree of block variation is low. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the parameter calculator compares correlation values for at least one direction between neighboring pixels input from the spatial predictor and determines a coding parameter by calculating a data bit number of a minimum correlation value as a comparison result, Compression device. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 좌측 대각선 방향 및 우측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the spatial predictor predicts the grayscale data using correlation between at least one of surrounding pixels in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction with reference to a specific pixel to be predicted Image loss compression device. 청구항 8 또는 청구항 9에 있어서, The method according to claim 8 or 9, 상기 공간예측기는 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식 3을 이용하여 예측하는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the spatial predictor predicts prediction data of a specific pixel to be predicted using Equation (3) below. 수학식 3Equation 3 |dy|<|dx|이고 (|b+dy|)>255 이면, Prediction Data = b| dy | <| dx | and (| b + dy |)> 255, then Prediction Data = b (|b+dy|)≤255 이면, Prediction Data = b+dy               (| b + dy |)? 255, Prediction Data = b + dy |dy|>|dx|이고 (|a+dx|)>255 이면, Prediction Data = a| dy |> | dx | and (| a + dx |)> 255, Prediction Data = a (|a+dx|)≤255 이면, Prediction Data = a+dx               (| a + dx |) &lt; 255, Prediction Data = a + dx 단, dx는 b-c, dy는 a-c, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 예측하고자 하는 특정 픽셀의 좌측 대각선에 위치한 픽셀의 데이터임.B is the data of the pixel located at the top of the specific pixel to be predicted, c is the data of the pixel to be predicted, Data of the pixel located on the left diagonal of the pixel. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 공간예측기는, The space predictor includes: 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터 를 라인버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; A subtracter for receiving error compensation data for surrounding pixels based on a specific pixel to be predicted from the line buffer, subtracting the error compensation data between neighboring pixels in the horizontal and vertical directions, and obtaining horizontal and vertical correlation data, respectively; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기;A first comparator for comparing the horizontal and vertical correlation data input from the subtractor and outputting a selection control signal according to a comparison result; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부;A pixel arithmetic unit for receiving error compensation data for neighboring pixels based on a specific pixel to be predicted from the line buffer and adding pixels located on the left and upper sides to each other and subtracting pixels located in the diagonal direction; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기;A second comparator for comparing an absolute value of the operation result value input from the pixel operation unit with a preset reference value and outputting a selection control signal according to the comparison result; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서;A first multiplexer for selectively outputting error correction data of a left pixel for a specific pixel to be predicted and an operation result value input from a pixel operation unit according to the selection control signal of the second comparator; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및A second multiplexer for selectively outputting error correction data of an upper pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; And 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 오차 보상데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 하는 이미지 손실 압축 장치.And a third multiplexer for selectively outputting error compensation data or operation result values of the left and upper pixels input from the first and second multiplexers according to a selection control signal of the first comparator, Compression device. 청구항 15에 있어서,16. The method of claim 15, 상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the spatial predictor further comprises a clipping unit for clipping and outputting a maximum value or a minimum value within a predetermined range when the predicted value output from the third multiplexer is out of a preset reference value. 청구항 15에 있어서,16. The method of claim 15, 상기 감산기는, 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼로부터 각각 입력받아 감산하고 감산된 수직 상관데이터를 출력하는 제1 감산기; 및 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력하는 제2 감산기;를 포함하는 것을 특징으로 하는 이미지 손실 압축 장치.The subtractor may include: a first subtractor for receiving and subtracting error compensation data of a left pixel and a left diagonal pixel for a specific pixel to be predicted from the line buffer, and outputting the subtracted vertical correlation data; And a second subtractor for subtracting and subtracting the error compensation data of the upper pixel and the left diagonal pixel for the specific pixel to be predicted from the line buffer and outputting the subtracted horizontal correlation data, . 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 손실처리기로부터 입력된 손실 오차데이터를 레프트 시프트하여 손실된 데이터를 복구하고, 복구된 데이터와 공간예측기로부터 입력된 예측데이터를 상호 가산하여 오차 보상된 데이터를 라인버퍼로 출력하는 픽셀복원기를 더 포함하는 이미지 손실 압축 장치.And a pixel restorer for restoring the lost data by left shifting the loss error data inputted from the loss processor and adding the recovered data and the predicted data inputted from the space predictor to each other and outputting the error compensated data to the line buffer Image loss compression device. 청구항 8에 있어서,The method of claim 8, 상기 손실처리기는 손실팩터에 따라 오차데이터를 오른쪽(light)으로 시프트하여 손실 처리하는 시프터인 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the lossy processor is a shifter that shifts the error data to the right according to the loss factor to perform loss processing. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 공간예측기는 예측하고자 하는 특정 픽셀의 수평과 수직, 좌측 대각선 및 우측 대각선 방향에 위치한 픽셀들 간의 상관성을 아래 수학식 4를 이용하여 예측하는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the spatial predictor predicts the correlation between pixels located in the horizontal, vertical, left diagonal, and right diagonal directions of a specific pixel to be predicted using Equation (4) below. 수학식 4Equation 4 horizontal(수평) = |△cb|-|△na|horizontal (horizontal) = | cb | - | na na | vertical(수직) = |△dn|-|△ca|vertical (vertical) = | dn | - | ca | left diagonal(좌대각선) = |△en|-|△da|left diagonal = | △ en | - | △ da | right diagonal(우대각선) = |△cn|-|△ba| right diagonal = | cn | - | △ ba | 단, △cb=c-b, △na=n-a, △dn=d-n, △ca=c-a, △en=e-n, △da=d-a, △cn=c-n, △ba=b-a이고, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 보상데이터, n은 a픽셀의 좌측에 위치한 픽셀의 보상데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 b픽셀의 좌측에 위치한 픽셀의 보상데이터, d는 c픽셀의 좌측에 위치한 픽셀의 보상데이터, e는 d픽셀의 좌측에 위치한 픽셀의 보상데이터, f는 b픽셀의 우측에 위치한 픽셀의 보상데이터임.In this case,? Cb = c-b,? Na = n-a,? Dn = dn,? Ca = c-a,? En = , A is the compensation data of the pixel located to the left of the specific pixel to be predicted, n is the compensation data of the pixel located to the left of the pixel a, b is the pixel data of the pixel located at the top of the specific pixel to be predicted C is the compensation data of the pixel located to the left of the pixel b, d is the compensation data of the pixel located to the left of the pixel c, e is the compensation data of the pixel located to the left of the pixel d, f is the data of the pixel located to the right of the pixel b The compensation data of the pixel. 청구항 20에 있어서,The method of claim 20, 상기 공간예측기는, 상기 수학식 4에 의해 가장 작은 상관값을 갖는 방향을 선택하고, 선택된 방향의 오차 보상데이터를 아래 수학식 5를 이용하여 계산하여 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 획득하는 것을 특징으로 하는 이미지 손실 압축 장치.The spatial predictor selects a direction having the smallest correlation value according to Equation (4), calculates error compensation data of the selected direction using the following Equation (5), and outputs prediction data of a specific pixel to be predicted: The image compression method comprising the steps of: 수학식 5Equation 5 horizontal(수평) = a-(△cb+△na)/2horizontal (horizontal) = a- (? cb +? na) / 2 vertical(수직) = b-(△dn+△ca)/2vertical = b- (? dn +? ca) / 2 left diagonal(좌대각선) = c-(△en+△da)/2left diagonal = c- (? en +? da) / 2 right diagonal(우대각선) = f-(△cn+△ba)/2right diagonal = f- (? cn +? ba) / 2 청구항 21에 있어서,23. The method of claim 21, 상기 공간예측기는, 획득된 예측데이터가 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 것을 특징으로 하는 이미지 손실 압축 장치.Wherein the spatial predictor clips the obtained predictive data to a maximum value or a minimum value within a set range when the obtained predicted data is out of a preset reference value and outputs the clipped image.
KR1020080086601A 2008-09-03 2008-09-03 Image compressing apparatus of lossless and lossy type KR101519653B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020080086601A KR101519653B1 (en) 2008-09-03 2008-09-03 Image compressing apparatus of lossless and lossy type

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020080086601A KR101519653B1 (en) 2008-09-03 2008-09-03 Image compressing apparatus of lossless and lossy type

Publications (2)

Publication Number Publication Date
KR20100027612A KR20100027612A (en) 2010-03-11
KR101519653B1 true KR101519653B1 (en) 2015-05-12

Family

ID=42178553

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020080086601A KR101519653B1 (en) 2008-09-03 2008-09-03 Image compressing apparatus of lossless and lossy type

Country Status (1)

Country Link
KR (1) KR101519653B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190039459A (en) * 2017-10-04 2019-04-12 주식회사 스트라드비젼 Learning method and learning device for improving performance of cnn by using feature upsampling networks, and testing method and testing device using the same
KR102142946B1 (en) 2019-11-08 2020-08-10 세종대학교산학협력단 Method and apparatus for lossless image data compression using multiple dpcm
KR20210066707A (en) 2019-11-28 2021-06-07 울산과학기술원 Data compressing and restoring apparatus for loseless image compression

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011155786A2 (en) * 2010-06-09 2011-12-15 엘지전자 주식회사 Entropy decoding method and decoding device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001095012A (en) 1999-09-21 2001-04-06 Sony Corp Image pickup unit and method for processing color image signal
JP2008508756A (en) 2004-07-29 2008-03-21 オセ−テクノロジーズ ビーブイ Lossless color image data compression using entropy coding

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001095012A (en) 1999-09-21 2001-04-06 Sony Corp Image pickup unit and method for processing color image signal
JP2008508756A (en) 2004-07-29 2008-03-21 オセ−テクノロジーズ ビーブイ Lossless color image data compression using entropy coding

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190039459A (en) * 2017-10-04 2019-04-12 주식회사 스트라드비젼 Learning method and learning device for improving performance of cnn by using feature upsampling networks, and testing method and testing device using the same
KR102229342B1 (en) 2017-10-04 2021-03-19 주식회사 스트라드비젼 Learning method and learning device for improving performance of cnn by using feature upsampling networks, and testing method and testing device using the same
KR102142946B1 (en) 2019-11-08 2020-08-10 세종대학교산학협력단 Method and apparatus for lossless image data compression using multiple dpcm
KR20210066707A (en) 2019-11-28 2021-06-07 울산과학기술원 Data compressing and restoring apparatus for loseless image compression

Also Published As

Publication number Publication date
KR20100027612A (en) 2010-03-11

Similar Documents

Publication Publication Date Title
JP5289440B2 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
EP3448038B1 (en) Decoding method for intra predicting a block by first predicting the pixels at the boundary
US8331449B2 (en) Fast encoding method and system using adaptive intra prediction
US10812829B2 (en) 2D block image encoding
RU2608674C2 (en) Moving image encoding device, moving image decoding device, moving image encoding method and moving image decoding method
EP2725795B1 (en) Image encoding device, image decoding device, image encoding method, image decoding method
EP3386199B1 (en) Lossless compression method and system appled to video hard decoding
KR100773761B1 (en) The apparatus and method of moving picture encoding
EP1551186B1 (en) Video coding apparatus with resolution converter
EP2904806B1 (en) 2d block image encoding
CN103118253A (en) Dynamic image encoding device and dynamic image decoding device
US9883188B2 (en) Image compression system for dynamically adjusting compression parameters by content sensitive detection in video signal
KR20170045013A (en) Apparatus and method for encoding data
CN112702603A (en) Video encoding method, video encoding device, computer equipment and storage medium
KR101519653B1 (en) Image compressing apparatus of lossless and lossy type
JP5649296B2 (en) Image encoding device
JPH10304381A (en) Moving image encoding device/method
JP5180887B2 (en) Encoding apparatus and method thereof
JP4073444B2 (en) Video encoding device
JP3889013B2 (en) Moving picture coding apparatus and moving picture coding method
KR100566290B1 (en) Image Scanning Method By Using Scan Table and Discrete Cosine Transform Apparatus adapted it
JP2000032468A (en) Image encoding method and recording medium with motion compensation mode selection program recorded therein
KR102050238B1 (en) System and method for effectively deciding intra prediction mode for hevc encoder
JPH114445A (en) Image coder and its method
JP7033946B2 (en) Image coding device and image coding program

Legal Events

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