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

Image compressing apparatus of lossless and lossy type Download PDF

Info

Publication number
KR20100027612A
KR20100027612A KR1020080086601A KR20080086601A KR20100027612A KR 20100027612 A KR20100027612 A KR 20100027612A KR 1020080086601 A KR1020080086601 A KR 1020080086601A KR 20080086601 A KR20080086601 A KR 20080086601A KR 20100027612 A KR20100027612 A KR 20100027612A
Authority
KR
South Korea
Prior art keywords
data
pixel
predicted
pixels
specific pixel
Prior art date
Application number
KR1020080086601A
Other languages
Korean (ko)
Other versions
KR101519653B1 (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

PURPOSE: An image lossless/losing compression apparatus is provided to facilitate a chip implementation by lowering the complexity through a DG decoding and a space prediction device. CONSTITUTION: An image lossless/losing compression apparatus comprises the following: a space prediction device(130) inputted with a gradation data regarding a perimeter pixel involved to a specific pixel from a block butter(110); a subtractor(150) subtracting a prediction data regarding the from the specific pixel from the space prediction device, and a graded data inputted from the block buffer; and a decoder(190) adjusting a bit rate regarding a lossless error data by a decoding parameter inputted from a parameter calculator(170).

Description

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

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

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

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

이를 해결하기 위해 기존 방식들은 다중 메모리 제어기(multiple memory controllers)를 사용하거나 비싼 칩 패키지나 많은 데이터 인터페이스들을 사용한다. 그러나 이러한 방식들은 압축 시스템의 비용을 증가시키게 되므로 영상의 무손실/손실 압축을 통한 메모리 대역폭(memory bandwidth) 감축 기법이 영상 및 제품 차별화의 중요한 핵심기술로 대두되고 있다.To solve this problem, existing methods use multiple memory controllers, 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 images has emerged as an important core technology of image and product differentiation.

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

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

정지영상 압축 방식들은 블록단위 DCT변환이나 웨이브릿 변환 등을 이용하고, 예측 부호화(predictive coding)와 양자화 그리고 엔트로피 부호화 등을 함께 사용함으로써 높은 압축률을 얻는 반면에 하드웨어 복잡도는 매우 높은 편이다.Still image compression methods use block-by-block DCT transform or wavelet transform and achieve high compression ratio by using predictive coding, quantization, and entropy coding, while 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 is a lossless compression method using relatively simple predictive coding and entropy coding. However, hardware complexity is relatively low compared to JPEG and JPEG-2000, but still has high complexity. JPEG-LS consists of DPCM, run-length coders, and context modeling-based Glob Rice (GR) coders.

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

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

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

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

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

본 발명의 다른 목적은 간단한 압축 구조로 대용량의 이미지데이터를 화질 손실없이 압축 저장함으로써, 메모리 대역폭을 효율적으로 감축할 수 있음과 아울러 압축 속도를 향상시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치를 제공하는 데 있다.Another object of the present invention is to compress and store a large amount of image data without loss of quality with a simple compression structure, to efficiently reduce the memory bandwidth and to reduce the image bandwidth to reduce the memory bandwidth that can improve the compression speed lossless and lossy compression To provide a device.

상기 목적을 달성하기 위한 본 발명의 이미지 무손실 압축 장치는, 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하 는 감산기; 및 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 것을 특징으로 한다.An image lossless compression apparatus of the present invention for achieving the above object comprises: 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 spatial predictor that receives grayscale data of at least one neighboring pixel related to a specific pixel to be predicted from the block buffer and predicts the grayscale data of the specific pixel using at least one direction correlation between the neighboring pixels; A subtractor for subtracting grayscale data of a specific pixel input from the block buffer and prediction data for the specific pixel input from a spatial predictor and outputting subtracted error data; And an encoder for adjusting the number of bits according to encoding parameters inputted from a predetermined parameter calculator after the lossless error data inputted from the subtractor and delivering the adjusted bitstream to the memory side.

구체적으로, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하고, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 좌측 대각선 방향 및 우측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 한다.In detail, the parameter calculator may compare the correlation values of at least one or more directions between neighboring pixels input from the spatial predictor, calculate the number of data bits of the minimum correlation value as a result of the comparison, and determine the encoding parameter as an encoding parameter. The spatial predictor predicts grayscale data using a correlation between at least one neighboring pixel among pixels located in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction based on a specific pixel to be predicted. It is done.

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

상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 한다.The spatial predictor may further include a clipping unit configured to clip the predicted value output from the third multiplexer to a maximum value or a minimum value within a set 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 a macroblock unit in which an image is divided into predetermined rows and columns; A line buffer in which error data according to data loss processing of each pixel is lost-compensated within a predetermined range and the loss-compensated compensation data is stored; A spatial predictor that receives compensation data for at least one neighboring pixel related to a specific pixel to be predicted from the line buffer and predicts grayscale data for the particular pixel using at least one direction correlation between the neighboring pixels; A subtractor for subtracting grayscale data of a specific pixel input from the block buffer and prediction data for the specific pixel input from a spatial predictor and outputting subtracted error data; A loss processor which processes the error data of the specific pixel inputted from the subtractor according to a loss factor inputted from a predetermined loss factor selector and outputs the lost error data; And an encoder for adjusting the number of bits according to encoding parameters inputted from a predetermined parameter calculator and transmitting 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, and calculates a loss factor to be applied to the current macroblock by using the accumulated number of bits of the previous block and the target number of blocks per block. The loss factor selector counts the number of bits of error data of all pixels output from the encoder and accumulates the number of bits in each slice unit including the macroblock and the LMB unit including the macroblock. ; And calculating surplus bits for the current slice or LMB based on the target bit amount of the pre-stored macroblock, and then comparing the calculated current slice or LMB with the surplus bits and the set reference value. And a loss factor calculator for determining a factor.

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

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

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

상기 공간예측기는, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 오차 보상데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 한다.The spatial predictor is a subtractor that receives error compensation data for peripheral pixels based on a specific pixel to be predicted from a line buffer, and subtracts each other between horizontal and vertical peripheral pixels, and then acquires horizontal and vertical correlation data, respectively. ; A first comparator for comparing horizontal and vertical correlation data inputted from the subtractor and outputting a selection control signal according to a comparison result; A pixel operation unit which receives error compensation data of peripheral pixels based on a specific pixel to be predicted from a line buffer, adds pixels located at the left and top sides and subtracts pixels located at a diagonal direction; A second comparator comparing the absolute value of the operation result value input from the pixel operator with a preset reference value and outputting a selection control signal according to the comparison result; A first multiplexer for selectively outputting error compensation data of a left pixel with respect to a specific pixel to be predicted according to a selection control signal of the second comparator and an operation result value input from a pixel operator; A second multiplexer for selectively outputting error compensation data of the upper pixel with respect to 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 operator; And a third multiplexer for selectively outputting error compensation data or calculation result values of left and top 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 configured to clip the predicted value output from the third multiplexer to a maximum value or a minimum value within a set range when the predicted value output from the third multiplexer is out of a preset reference value.

상기 압축장치는, 손실처리기로부터 입력된 손실 오차데이터를 레프트 시프트하여 손실된 데이터를 복구하고, 복구된 데이터와 공간예측기로부터 입력된 예측데이터를 상호 가산하여 오차 보상된 데이터를 라인버퍼로 출력하는 픽셀복원기를 더 포함하는 것을 특징으로 하며, 상기 손실처리기는 손실팩터에 따라 오차데이터를 오른쪽(light)으로 시프트하여 손실 처리하는 시프터인 것을 특징으로 한다.The compression apparatus may perform a left shift of the lost error data inputted from the loss processor to recover the lost data, and add the recovered data and the predictive data input from the spatial predictor to output the error compensated data to the line buffer. It characterized in that it further comprises a restorer, the loss processor is characterized in that the shifter for the loss processing by shifting the error data to the right (light) according to the loss factor.

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

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

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

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

그리고, 상기 압축장치(100)는 블록버퍼(110)와 공간예측기(130), 감산기(150), 파라미터계산기(170) 및 부호화기(190)를 포함하여 이루어져 있다. The compression device 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 in macroblock units in which the entire original image is divided into predetermined rows and columns (M × N). The macroblock (MB) may be generally composed of 16 × 16 pixels and the like, and each pixel may be composed of 8 bits of gradation data. May be composed of 32x32, 8x8, 32x16, or 16x8 pixels, and the number of data bits of each pixel may also be variously added or subtracted.

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

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

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

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

이와 같이 특성 픽셀에 대한 계조데이터를 메모리(300)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다.As such, instead of storing the grayscale data of the characteristic pixel in the memory 300 as it is, the grayscale data is predicted after predicting the grayscale data for the specific pixel by using the correlation between the neighboring pixels of the specific pixel to be predicted by the direction prediction algorithm. Error data is obtained by subtracting the data from the original gradation data of a specific pixel, and the obtained error data is stored in a memory by adjusting the number of bits according to an 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 and a second subtractor 132, a first comparator 133, a pixel operator 134, a second comparator 135, and a plurality of multiplexers 136a to 136c. And a clipping unit 137.

상기 제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 gray level data of neighboring pixels a, b, and c from the block buffer 110 based on a specific pixel i to be predicted, and are horizontal and vertical. It is configured to obtain horizontal and vertical correlation data after subtracting each other between neighboring pixels in the direction. In detail, the first subtractor 131 is configured to obtain a left pixel a and a left pixel for a specific pixel i to be predicted. The gray level data of the diagonal pixel c are respectively inputted and subtracted from the block buffer 110, and the subtracted vertical correlation data dy is output, and the second subtractor 132 has an upper end for the specific pixel i to be predicted. The grayscale data of the pixel b and the left diagonal pixel c are respectively received from the block buffer 110 and subtracted, and the subtracted horizontal correlation data dx is output.

제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, respectively, and then selects a selection control signal according to the comparison result. )

픽셀연산부(134)는 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼(110)로부터 입력받아 좌측과 상단에 위치한 픽셀들(a, b)은 상호 가산하고 대각선 방향에 위치한 픽셀(c)은 감산한다.The pixel operator 134 receives gradation data of neighboring pixels from the block buffer 110 based on a specific pixel to be predicted, and the pixels a and b located at the left and the top are added to each other and positioned diagonally. 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 operator 134 with a preset reference value and outputs a selection control signal according to the comparison result. The reference value set in the second comparator is preferably 255.

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

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

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

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

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

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

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

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

(|a+dx|)≤255 이면, Prediction Data = a+dx               If (| a + dx |) ≤255, Prediction Data = a + dx

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

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

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

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

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

상기 블록버퍼(210)에는 원래의 이미지 전체가 소정의 행과 열(M×N)로 나누어진 매크로블록 단위의 이미지가 일시 저장되어 있다. 상기 매크로블록(macro block)은 일반적으로 16×16 픽셀(pixel) 등으로 구성될 수 있고 각 픽셀은 8비트(bit)의 계조데이터(gradation data)로 이루어질 수 있으나, 실시예에 따라 매크로블록은 32×32, 8×8, 32×16 또는 16×8 픽셀 등으로 구성될 수 있고, 각 픽셀의 데이터 비트수도 다양하게 가감될 수 있다.The block buffer 210 temporarily stores an image in macroblock units in which the entire original image is divided into predetermined rows and columns (M × N). The macro block may be generally composed of 16 × 16 pixels and the like, and each pixel may be composed of 8 bits of gradation data. 32x32, 8x8, 32x16 or 16x8 pixels or the like, and the number of data bits of each pixel can also 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)는 비트수는 서로 동일하지만, 손실에 의해 데이터는 상이할 수 있다.The line buffer 220 temporarily stores the compensation data in which the loss error data of each pixel output from the loss processor 250 is loss-compensated within a predetermined range for each pixel. That is, in the block buffer 210, original grayscale data c_d1, b_d1, a_d1, and i_d1 of the pixels c, b, a, and i are stored as shown in FIG. 4A, but in the line buffer 220, FIG. As in 4b, loss-compensated compensation data c_d2, b_d2, a_d2, and i_d2 for each of the pixels c, b, a, and i are stored. The gray level data c_d1, b_d1, a_d1, and i_d1 of the pixels and the loss compensation data c_d2, b_d2, a_d2, and i_d2 of each pixel have the same number of bits, but data may be different due to loss. .

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

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

손실처리기(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 processes the error data of a specific pixel input from the subtractor 240 according to a loss factor input from the loss factor selector 260 and then outputs the lost error data. The loss processor 250 is a shifter to shift the error data to the right according to the loss factor to remove 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 loss processor 250 shifts the error data 1 bit to the right to output '100'. In other words, if the loss factor is 1, the error data is shifted 1 bit to the right to reduce the error value by 2 times. If the loss factor is 2, the error data is shifted to the right 2 bits to reduce the error value by 4 times and the loss factor is 3 In this case, the error value is shifted three bits to the right to reduce the error value by eight times. That is, according to the loss factor, the error value is reduced by 2 n (n is the loss factor value).

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

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

부호화기(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 after the loss error data input from the loss processor 250 and transmits the compressed bitstream of the adjusted specific pixel to the memory side. do. In addition, the encoder 280 applied to the present invention may be a GR encoder (Golomb Rice Coder) for adjusting the number of bits according to the k value, which is a GR (Golomb Rice) 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 recovers the least significant bits lost by left shifting the lost error data input from the loss processor 250. Error compensation data is obtained by adding the loss compensation data and the prediction data p input from the spatial predictor 230. The pixel restorer 290 outputs the error compensation data of the specific pixel thus obtained to the line buffer 220. In addition, since the pixel restorer 290 recovers only the number of bits for the least significant bit lost, it does not accurately restore the data (0 or 1) to the least significant bit lost. Pixel data stored in the line buffer 220 may be different.

이와 같이 손실 압축장치(200)는 예측하고자 하는 특정 픽셀에 대한 계조데이터를 메모리(300)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터를 손실팩터에 따라 설정된 목표 압축률에 적합하게 손실 압축하여 메모리에 저장하게 된다. 물론, 상기 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다. As described above, the lossy compression apparatus 200 does not store the grayscale data of the specific pixel to be predicted in the memory 300 as it is but uses the correlation between the neighboring pixels of the specific pixel to be predicted according to the direction prediction algorithm. After predicting the gradation data, the gradation data is subtracted from the original gradation data of a specific pixel to obtain error data, and the loss data is stored in memory by compressing the obtained error data appropriately according to 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 in accordance with the coding parameters.

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

즉, 공간예측기(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 operator 234, a second comparator 235, and a plurality of multiplexers 236a to 236c. And a clipping unit 237.

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

제2 감산기(232)는 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력한다. 예컨대, 제2 감산기(232)는 특정 픽셀인 i에 대한 상단 픽셀인 b와 좌대각선 픽셀인 c를 각각 입력받아 이를 감산한 후 감산된 수평 상관데이터(dx=b-c)를 출력하게 된다.The second subtractor 232 receives the error compensation data of the top 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 b, which is a top pixel for a specific pixel i, and c, which is a left diagonal pixel, respectively, and subtracts it, and then outputs subtracted horizontal correlation data (dx = b-c).

제1 비교기(233)는 제1 감산기(231)와 제2 감산기(232)로부터 각각 입력된 수직 및 수평 상관데이터에 대한 절대값을 상호 비교한 후 비교 결과에 따른 선택 제어신호를 출력한다. 상기에서 라인버퍼(220)에 저장된 각 픽셀의 오차 보상데이터는 상황에 따라 마이너스 값을 가질 수 있으며, 이때에는 각 픽셀의 절대값이 제1 및 제2 감산기(231, 232)로 각각 입력되도록 한다. The first comparator 233 compares the absolute values of the vertical and horizontal correlation data respectively input from the first subtractor 231 and the second subtractor 232, and then outputs a selection control signal according to the comparison result. The error compensation data of each pixel stored in the line buffer 220 may have a negative value according to a situation, and in this case, an absolute value of each pixel is 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 operator 234 receives the error compensation data for the neighboring pixels related to the specific pixel to be predicted from the line buffer 220 and adds or subtracts them according to a set algorithm, and then 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 of the left diagonal pixel c to the added value. The compensation data c_d2 is further subtracted.

제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 operator 234 with a preset reference value and outputs a selection control signal according to the comparison result. It is preferable to set the reference value to a maximum value (2 n- 1, n is the number of bits) on the basis of the gray scale data (n bits). For example, since the gradation data of each pixel is 8 bits, it can have a maximum value of 255 (2 8-1 ) in decimal, so that the reference value (2 n -1; n is the number of bits of the gradation data) is set to 255.

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

제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 operator 234, respectively, and receives the selected control signal of the second comparator 235. Optionally output accordingly.

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

클리핑부(237)는 제3 멀티플렉서(236c)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 예측된 데이터를 출력한다. 예컨대, 클리핑부(237)의 기준범위가 0 내지 255로 설정되어 있을 경우 제3 멀티플렉서(236c)로부터 입력된 값이 256이면 최대값인 255로 클리핑하여 출력하게 된다.The clipping unit 237 outputs the predicted data by clipping 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 outside the preset reference range. 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, it is clipped to the maximum value of 255 and output.

이와 같이 구성된 공간예측기(230)에서 특정 픽셀의 계조데이터를 예측하기 위해서 특정 픽셀에 대한 주변 픽셀간의 수평 및 수직 방향의 상관성을 이용하게 되는데, 수평 및 수직 방향의 상관성은 수평 및 수직 변화도(gradient)를 이용하여 계산하게 된다. 수평 및 수직 방향의 상관성은 제1 감산기(231)와 제2 감산기(232)를 통해 수평 픽셀간의 그래디언트(dx=b-c) 및 수직 픽셀간의 그래디언트(dy=a-c)를 이용하여 구한다. 이때 상관성에 따른 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 아래와 같다.In the spatial predictor 230 configured as described above, in order to predict the gray scale data of a specific pixel, the horizontal and vertical correlations between neighboring pixels with respect to a specific pixel are used. Will be calculated using Correlation between the horizontal and vertical directions is obtained using the gradient between horizontal pixels (dx = b-c) and the gradient between vertical pixels (dy = a-c) through the first subtractor 231 and the second subtractor 232. At this time, 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, when 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 b-pixel error compensation data (Prediction Data = b), 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 value (Prediction Data = b + dy) obtained by subtracting the error compensation data of the pixel c and the error compensation data of the pixel b and the pixel a. Further, when 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 a pixel is error compensation data (Prediction Data = a), 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 a result value (Prediction Data = a + dx) obtained by subtracting the error compensation data of the pixel c and the error compensation data of the pixel a and the pixel b.

상기의 조건과 같이 수직 상관값(|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 | and the horizontal correlation value | dx |, as in the above condition, it can be seen whether the pixel to be predicted is more correlated in either 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 gradation data of the specific pixel i to be predicted. If the value of dy is smaller, the error compensation data of a pixel is the specific pixel to be predicted. It is closer to the gradation data of (i). If the calculated value a + b-c of a pixel, b pixel and c pixel is 255 or less, the arithmetic result value of a + b-c is used as the predictive data p.

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

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

즉, 도 6은 본 발명의 다른 실시예에 의한 공간예측기의 세부 구성을 나타낸 기능 블록도로서, 공간예측기(230)는 제1 감산부(231)와 제2 감산부(232), 비교 기(233), 복수의 멀티플렉서(234a, 234b), 가산기(235), 시프터(236), 제3 멀티플렉서(237), 제3 감산기(238) 및 클리핑부(239)를 포함하여 이루어져 있다.6 is a functional block diagram showing a detailed configuration of the spatial predictor according to another embodiment of the present invention. The spatial predictor 230 may include a first subtractor 231, a second subtractor 232, and 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)는 특정 픽셀을 기준으로 상관성이 높은 수평, 수직, 좌대각선 및 우대각선 방향에 대한 각 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력하게 된다. In FIG. 6, the first subtractor 231 outputs error compensation data for pixels in horizontal, vertical, and diagonal directions that are highly correlated between a specific pixel to be predicted according to a preset algorithm and a line buffer 220. Each of the pixels having a high correlation is subtracted from each other and outputted by subtracting the correlation data. For example, the first subtractor 231 includes a plurality of subtractors 231a to 231h, each subtractor 231a to 231h having a high correlation with respect to horizontal, vertical, left diagonal, and right diagonal directions based on a specific pixel. Each pixel is subtracted from each other to output subtracted correlation data.

제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 correlation data of a plurality of highly correlated horizontal, vertical, left and right diagonal lines from the first subtractor 231, and then subtracts the horizontal, vertical, and left diagonal lines. And correlation data for the preferential diagonal line, respectively. For example, the second subtractor 232 includes a plurality of subtractors 232a to 232d, and each subtractor 232a to 232d includes a plurality of horizontal, vertical, left diagonal, and right outputs from the first subtractor 231. Among the correlation data in the diagonal direction, the correlation data in the same direction is subtracted from each other, and the correlation data for the subtracted horizontal, vertical, left diagonal, and right angle lines are respectively output. The correlation data output from the first subtraction unit 231 may have a negative value according to a situation, and in this case, an 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 angle lines input from the second subtraction unit 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 correlation data for horizontal, vertical, left and right diagonal lines from the first subtractor 231 on the basis of the previous pixel a of the specific pixel i, and the comparator 233. According to the selection control signal of the) any one of the input correlation data is selected and output. The previous pixel of the specific pixel i is the pixel a adjacent to the left of the specific pixel i and corresponds to the pixel a immediately preceding the specific pixel i.

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

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

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

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

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

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

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

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

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

vertical(수직) = |△dn|-|△ca|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픽셀의 우측에 위치한 픽셀의 보상데이터이다. Here,? 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 is compensation data of a pixel located to the left of a specific pixel to be predicted, n is compensation data of a pixel located to the left of a pixel, and b is to be predicted Data of the pixel located on the top of a specific pixel, c is the compensation data of the pixel located to the left of b pixels, d is the compensation data of the pixel located to the left of c pixels, e is the compensation data of the pixel located to the left of the d pixels, f Is compensation data of a pixel located to the right of b pixels.

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

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

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

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

vertical(수직) = b-(△dn+△ca)/2vertical (vertical) = 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, when the comparator 233 first outputs a control signal for selecting a direction having the smallest correlation value for each direction to the first multiplexer 234a and the second multiplexer 234b, the first multiplexer as shown in Equation (2). 234a and the second multiplexer 234b respectively output the correlation values (gradients) related to the directions to the adder 235, and the adders 235 add the respective correlation values to the shifter 236. . The shifter 236 may right shift the value input from the adder 235, that is, reduce the input value by 1/2 and output the result to the third subtractor 238.

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

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

상기에서 이미지를 실제로 압축할 경우 매크로블록 단위로 압축하기 때문에 참조할 픽셀이 없는 경우가 존재하는데 이 경우에는 방향 예측이 불가능하다. 이 경우의 픽셀들은 압축율을 높이기 위해서 DPCM(Differential Pulse Coded Modulation)을 이용하여 예측한다. 즉, 블록의 첫 번째 픽셀은 예측할 수 없지만 수평방향의 첫번째 줄과 수직방향의 첫번째 줄은 각각의 이전 픽셀을 이용하여 예측하는 것이 바람직하다.In the case of actually compressing an image, since there is no pixel to refer to because it is compressed in macroblock units, in this case, direction prediction is impossible. The pixels in this case are predicted using differential pulse coded modulation (DPCM) to increase the compression ratio. That is, the first pixel of the block is unpredictable, but it is preferable to predict the first row in the horizontal direction and the first row in the vertical direction by 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. Accordingly, the parameter calculator 270 receives the data output from the shifter 236 of the spatial predictor 230, calculates the number of bits, and then determines the calculated number of bits as the encoding parameter k value and transmits the calculated number to the encoder 280. Done.

즉, 공간예측기(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 represented by Equation 4 below in accordance with each direction (horizontal, vertical, left diagonal and right diagonal), and the parameter calculator 270 is the above. The number of bits of the data Pe output by Equation 4 is checked and determined as an 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 flowchart illustrating a process of determining a loss factor for one macroblock in the loss factor selector 260. Referring to FIG.

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

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

먼저, 손실팩터선택기(260)의 비트수카운터(262)는 부호화기(280)에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하게 되는 데, 상기 카운트값은 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 카운트하여 누적하게 된다(S1). 즉, 비트수카운터(262)에는 하나의 슬라이스 카운터와 상기 슬라이스를 포함하는 복수의 LMB 카운터가 별도로 존재할 수 있다.First, the bit number 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 a slice unit including each macro block and the It counts and accumulates in LMB units 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 such a state, the loss factor calculator 263 calculates surplus bits for the macroblock, the slice, or the LMB based on the target bits of the macroblocks stored in the target bit storage 261. Each is calculated (S2).

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

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

현재 LMB_잉여비트수=이전 LMB_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current LMB_Residual Bits = Previous LMB_Residual Bits + (MB_Number of Target Bits-MB_Number of Generated Bits)

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

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

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

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

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

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

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

Figure 112008062637781-PAT00001
의 식에 의해 구해질 수 있다.In the above, the gradient calculator 265 calculates a gradient through correlation of neighboring pixels or macroblocks based on a specific pixel or macroblock. For example, assuming that there are a, b, c, and d pixels on the basis of a specific pixel i, respectively, the degree of change is
Figure 112008062637781-PAT00001
Can be obtained by consciousness.

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

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

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

상기의 본 발명의 바람직한 실시예는 예시의 목적을 위해 개시된 것이고, 본 발명에 대한 통상의 지식을 가진 당업자라면 본 발명의 기술적 사상 내에서 다양한 수정, 변경 및 부가가 가능할 것이다. 그러므로, 이러한 수정, 변경 및 부가는 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.Preferred embodiments of the present invention are disclosed for purposes of illustration, and those skilled in the art will be able to make various modifications, changes, and additions within the spirit of the present invention. Therefore, such modifications, changes and additions should be determined not only by the claims below, but also by equivalents to those claims.

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

도 2는 본 발명에 의한 도 1의 공간예측기를 나타낸 세부 기능 블록도이다.2 is a detailed functional block diagram illustrating the spatial 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. 3.

도 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 of the spatial predictor of FIG. 3 according to another embodiment of the present invention.

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

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

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

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

130: 공간예측기 150: 감산기130: space predictor 150: subtractor

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 handler

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

262: 비트수카운터 263: 손실팩터계산부262: bit count counter 263: loss factor calculator

265: 변화도계산부 270: 파라미터계산기265: gradient calculator 270: parameter calculator

280: 부호화기 290: 픽셀복원기280: encoder 290: pixel restorer

Claims (22)

이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터가 저장된 블록버퍼;A block buffer in which grayscale data of pixels are stored in macroblock units in which an image is divided into predetermined rows and columns; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기;A spatial predictor that receives grayscale data of at least one neighboring pixel related to a specific pixel to be predicted from the block buffer and predicts the grayscale data of the specific pixel using at least one direction correlation between the neighboring pixels; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기; 및A subtractor for subtracting grayscale data of a specific pixel input from the block buffer and prediction data for the specific pixel input from a spatial predictor and outputting subtracted error data; And 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 이미지 무손실 압축 장치.And an encoder which adjusts the number of bits according to encoding parameters input from a predetermined parameter calculator and transmits the adjusted bitstream to the memory side, after the lossless error data inputted from the subtractor is adjusted. 청구항 1에 있어서,The method according to claim 1, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하는 이미지 무손실 압축 장치.The parameter calculator compares correlation values of at least one or more directions between neighboring pixels input from the spatial predictor, calculates the number of data bits of the minimum correlation value as a result of the comparison, and determines an encoding parameter as an image lossless method. Compression device. 청구항 1 또는 청구항 2에 있어서,The method according to claim 1 or 2, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 좌측 대각선 방향 및 우측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 하는 이미지 무손실 압축 장치.The spatial predictor predicts grayscale data using a correlation between at least one peripheral pixel among pixels located in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction based on a specific pixel to be predicted. Image lossless compression device. 청구항 1 또는 청구항 2에 있어서, The method according to claim 1 or 2, 상기 공간예측기는 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식1을 이용하여 예측하는 것을 특징으로 하는 이미지 무손실 압축 장치.And 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 = bIf | dy | <| dx | and (| b + dy |)> 255, Prediction Data = b (|b+dy|)≤255 이면, Prediction Data = b+dy               If (| b + dy |) ≤255, Prediction Data = b + dy |dy|>|dx|이고 (|a+dx|)>255 이면, Prediction Data = aIf | dy |> | dx | and (| a + dx |)> 255, Prediction Data = a (|a+dx|)≤255 이면, Prediction Data = a+dx               If (| a + dx |) ≤255, Prediction Data = a + dx 단, dx는 b-c, dy는 a-c, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c 는 예측하고자 하는 특정 픽셀의 좌측 대각선에 위치한 픽셀의 데이터임.Where dx is b-c, dy is a-c, a is data of a pixel located on the left of a specific pixel to be predicted, b is data of a pixel located on the top of a specific pixel to be predicted, and c is a specific data 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, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; A subtractor which receives gradation data of neighboring pixels from a block buffer based on a specific pixel to be predicted, mutually subtracts the neighboring pixels in horizontal and vertical directions, and obtains horizontal and vertical correlation data, respectively; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기;A first comparator for comparing horizontal and vertical correlation data inputted from the subtractor and outputting a selection control signal according to a comparison result; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부;A pixel operator which receives grayscale data of neighboring pixels from a block buffer based on a specific pixel to be predicted, and adds pixels located on the left and top sides and subtracts pixels located in a diagonal direction; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기;A second comparator comparing the absolute value of the operation result value input from the pixel operator with a preset reference value and outputting a selection control signal according to the comparison result; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 계조데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서;A first multiplexer for selectively outputting grayscale data of a left pixel and a calculation result value input from a pixel operator according to a selection control signal of the second comparator; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 계조데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출 력하는 제2 멀티플렉서; 및A second multiplexer for selectively outputting grayscale data of the upper pixel for the specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operator; And 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 계조데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 하는 이미지 무손실 압축 장치.And a third multiplexer for selectively outputting grayscale data or calculation result values of the left and top pixels inputted from the first and second multiplexers according to a selection control signal of the first comparator. Device. 청구항 5에 있어서,The method according to claim 5, 상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 하는 이미지 무손실 압축 장치.The spatial predictor may further include a clipping unit configured to clip the prediction value output from the third multiplexer to a maximum value or a minimum value within a set range when the predicted value output from the third multiplexer is out of a preset reference value. 청구항 5에 있어서,The method according to claim 5, 상기 감산기는, 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀과 좌대각선 픽셀의 계조데이터를 블록버퍼로부터 각각 입력받아 감산하고 감산된 수직 상관데이터를 출력하는 제1 감산기; 및 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 계조데이터를 블록버퍼로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력하는 제2 감산기;를 포함하는 것을 특징으로 하는 이미지 무손실 압축 장치.The subtractor may include: a first subtractor configured to subtract grayscale data of a left pixel and a left diagonal pixel of a specific pixel to be predicted from the block buffer and output subtracted vertical correlation data; And a second subtractor which receives the gray level data of the upper pixel and the left diagonal pixel of the specific pixel to be predicted from the block buffer, respectively, and subtracts the gray level data from the block buffer and outputs the subtracted horizontal correlation data. 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼;A block buffer that stores gradation data of pixels in macroblock units in which an image is divided into predetermined rows and columns; 상기 각 픽셀의 데이터 손실 처리에 따른 오차데이터를 일정 범위에서 손실 보상되고, 손실 보상된 보상데이터가 저장된 라인버퍼;A line buffer in which error data according to data loss processing of each pixel is lost-compensated within a predetermined range and the loss-compensated compensation data is stored; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 보상데이터를 라인버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기;A spatial predictor that receives compensation data for at least one neighboring pixel related to a specific pixel to be predicted from the line buffer and predicts grayscale data for the particular pixel using at least one direction correlation between the neighboring pixels; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기; A subtractor for subtracting grayscale data of a specific pixel input from the block buffer and prediction data for the specific pixel input from a spatial predictor and outputting subtracted error data; 상기 감산기로부터 입력된 특정 픽셀의 오차데이터를 소정의 손실팩터선택기로부터 입력된 손실팩터(Lossy Factor)에 따라 손실 처리한 후 손실된 오차데이터를 출력하는 손실처리기; 및A loss processor which processes the error data of the specific pixel inputted from the subtractor according to a loss factor inputted from a predetermined loss factor selector and outputs the lost error data; And 상기 손실처리기로부터 입력된 손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 이미지 손실 압축 장치.And an encoder for adjusting the number of bits according to coding parameters input from a parameter calculator and transmitting the adjusted bitstream to the memory side, after the loss error data inputted from the loss processor is adjusted. 청구항 8에 있어서,The method according to 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 accumulated number of bits of the previous block and the target number of blocks per block. An image loss compression device. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 손실팩터선택기는, 부호화기에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하여 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 누적하는 비트수카운터; 및 미리 저장된 매크로블록의 목표 비트량을 기준으로 현재 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 아래 수학식 2를 이용하여 계산한 후 계산된 현재 슬라이스(slice) 또는 LMB의 잉여비트수와 설정된 기준값을 상호 비교하여 손실팩터를 결정하는 손실팩터계산부;를 포함하여 구성된 것을 특징으로 하는 이미지 손실 압축 장치.The loss factor selector may include: a bit number counter that counts the number of bits of error data of all pixels output from the encoder and accumulates the slice unit including each macro block and the LMB unit including the macro block; And calculating surplus bits for the current slice or LMB based on the target bit amount of the pre-stored macroblock using Equation 2 below, and calculating the 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_Residual Bits = Previous LMB_Residual Bits + (MB_Number of Target Bits-MB_Number of Generated Bits) 현재 slice_잉여비트수=이전 slice_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current slice_surplus bits = previous slice_surplus bits + (MB_target bits-MB_number of generated bits) 단, slice는 이미지에서 한 행의 매크로블록(Macroblock; MB)들의 집합이고, LMB(Large Macroblock)는 복수의 매크로블록의 집합임.However, slice is a set of macroblocks (MBs) in a row in the image, and a large macroblock (LMB) is a set of macroblocks. 청구항 10에 있어서,The method according to claim 10, 상기 손실팩터계산기는 입력된 블록 변화도(activity)에 대한 데이터를 미리 설정된 기준값과 비교하여 블록 변화도가 낮을 경우 손실팩터를 감소시키는 것을 특징으로 하는 이미지 손실 압축 장치.And a loss factor calculator to reduce the loss factor when the block variation is low by comparing the data on the input block activity with a preset reference value. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하는 이미지 손실 압축 장치.The parameter calculator compares the correlation values of at least one or more directions between neighboring pixels input from the spatial predictor, calculates the number of data bits of the minimum correlation value as a result of the comparison, and determines the image loss as an encoding parameter. Compression device. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 좌측 대각선 방향 및 우측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 하는 이미지 손실 압축 장치.The spatial predictor predicts grayscale data using a correlation between at least one peripheral pixel among pixels located in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction based on a specific pixel to be predicted. Image Loss Compression Device. 청구항 8 또는 청구항 9에 있어서, The method according to claim 8 or 9, 상기 공간예측기는 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식 3을 이용하여 예측하는 것을 특징으로 하는 이미지 손실 압축 장치.And 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 = bIf | dy | <| dx | and (| b + dy |)> 255, Prediction Data = b (|b+dy|)≤255 이면, Prediction Data = b+dy               If (| b + dy |) ≤255, Prediction Data = b + dy |dy|>|dx|이고 (|a+dx|)>255 이면, Prediction Data = aIf | dy |> | dx | and (| a + dx |)> 255, Prediction Data = a (|a+dx|)≤255 이면, Prediction Data = a+dx               If (| a + dx |) ≤255, Prediction Data = a + dx 단, dx는 b-c, dy는 a-c, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 예측하고자 하는 특정 픽셀의 좌측 대각선에 위치한 픽셀의 데이터임.Where dx is b-c, dy is a-c, a is data of a pixel located on the left of a specific pixel to be predicted, b is data of a pixel located on the top of a specific pixel to be predicted, and c is a specific data 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, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터 를 라인버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; A subtractor which receives error compensation data on peripheral pixels based on a specific pixel to be predicted from a line buffer, and subtracts mutually between peripheral pixels in a horizontal and vertical direction and then obtains horizontal and vertical correlation data, respectively; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기;A first comparator for comparing horizontal and vertical correlation data inputted from the subtractor and outputting a selection control signal according to a comparison result; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부;A pixel operation unit which receives error compensation data of peripheral pixels based on a specific pixel to be predicted from a line buffer, adds pixels located at the left and top sides and subtracts pixels located at a diagonal direction; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기;A second comparator comparing the absolute value of the operation result value input from the pixel operator 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 compensation data of a left pixel with respect to a specific pixel to be predicted according to a selection control signal of the second comparator and an operation result value input from a pixel operator; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및A second multiplexer for selectively outputting error compensation data of the upper pixel with respect to 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 operator; And 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 오차 보상데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 하는 이미지 손실 압축 장치.And a third multiplexer for selectively outputting error compensation data or calculation result values of the left and top pixels inputted from the first and second multiplexers according to a selection control signal of the first comparator. Compression device. 청구항 15에 있어서,The method according to claim 15, 상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 하는 이미지 손실 압축 장치.The spatial predictor may further include a clipping unit configured to clip the predicted value output from the third multiplexer to a maximum value or a minimum value within a set range when the predicted value output from the third multiplexer is out of a preset reference value. 청구항 15에 있어서,The method according to claim 15, 상기 감산기는, 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼로부터 각각 입력받아 감산하고 감산된 수직 상관데이터를 출력하는 제1 감산기; 및 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력하는 제2 감산기;를 포함하는 것을 특징으로 하는 이미지 손실 압축 장치.The subtractor may include: a first subtractor configured to subtract error compensation data of a left pixel and a left diagonal pixel from a line buffer for a specific pixel to be predicted, and output subtracted vertical correlation data; And a second subtractor configured to receive and subtract error compensation data of the upper and left diagonal pixels of the specific pixel to be predicted from the line buffer, and output the subtracted horizontal correlation data, respectively. . 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 손실처리기로부터 입력된 손실 오차데이터를 레프트 시프트하여 손실된 데이터를 복구하고, 복구된 데이터와 공간예측기로부터 입력된 예측데이터를 상호 가산하여 오차 보상된 데이터를 라인버퍼로 출력하는 픽셀복원기를 더 포함하는 이미지 손실 압축 장치.And a pixel restorer for restoring the lost data by left shifting the lost error data inputted from the loss processor, and adding the recovered data and the predictive data inputted from the spatial predictor to output error compensated data to the line buffer. Image loss compression device. 청구항 8에 있어서,The method according to claim 8, 상기 손실처리기는 손실팩터에 따라 오차데이터를 오른쪽(light)으로 시프트하여 손실 처리하는 시프터인 것을 특징으로 하는 이미지 손실 압축 장치.And the loss processor is a shifter which shifts the error data to the right according to a loss factor to perform loss processing. 청구항 8 또는 청구항 9에 있어서,The method according to claim 8 or 9, 상기 공간예측기는 예측하고자 하는 특정 픽셀의 수평과 수직, 좌측 대각선 및 우측 대각선 방향에 위치한 픽셀들 간의 상관성을 아래 수학식 4를 이용하여 예측하는 것을 특징으로 하는 이미지 손실 압축 장치.The spatial predictor is to predict the correlation between the pixels located in the horizontal and vertical, left diagonal and right diagonal direction of the specific pixel to be predicted using the following equation (4). 수학식 4Equation 4 horizontal(수평) = |△cb|-|△na|horizontal = | △ cb |-| △ na | vertical(수직) = |△dn|-|△ca|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픽셀의 우측에 위치한 픽셀의 보상데이터임.However,? 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 is compensation data of a pixel located to the left of a specific pixel to be predicted, n is compensation data of a pixel located to the left of a pixel, and b is a pixel located at the top of a specific pixel to be predicted. Where c is the compensation data of the pixel located to the left of b pixels, d is the compensation data of the pixel located to the left of c pixels, e is the compensation data of the pixel located to the left of d pixels, and f is located to the right of b pixels. Pixel compensation data. 청구항 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, and calculates error compensation data of the selected direction using Equation 5 below to predict prediction data of a specific pixel. Image loss compression apparatus, characterized in that to obtain. 수학식 5Equation 5 horizontal(수평) = a-(△cb+△na)/2horizontal = a- (△ cb + △ na) / 2 vertical(수직) = b-(△dn+△ca)/2vertical (vertical) = 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에 있어서,The method according to claim 21, 상기 공간예측기는, 획득된 예측데이터가 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 것을 특징으로 하는 이미지 손실 압축 장치.The spatial predictor compresses and outputs the obtained prediction data by clipping to a maximum value or a minimum value within a set range when the obtained prediction data deviates from a preset reference value.
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 true KR20100027612A (en) 2010-03-11
KR101519653B1 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 (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

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9984325B1 (en) * 2017-10-04 2018-05-29 StradVision, Inc. 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
KR102524547B1 (en) 2019-11-28 2023-04-24 울산과학기술원 Data compressing and restoring apparatus for loseless image compression

Family Cites Families (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
US8300956B2 (en) 2004-07-29 2012-10-30 Oce-Technologies B.V. Lossless compression of color image data using entropy encoding

Cited By (2)

* 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
WO2011155786A3 (en) * 2010-06-09 2012-04-19 엘지전자 주식회사 Entropy decoding method and decoding device

Also Published As

Publication number Publication date
KR101519653B1 (en) 2015-05-12

Similar Documents

Publication Publication Date Title
US20200221101A1 (en) Image encoder and decoder using unidirectional prediction
US10812829B2 (en) 2D block image encoding
EP2940998B1 (en) Bounded rate near-lossless and lossless image compression
US9805442B2 (en) Fine-grained bit-rate control
JP5289440B2 (en) Image encoding device, image decoding device, image encoding method, and 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
US9813711B2 (en) Hybrid transform-based compression
US20110206118A1 (en) Data Compression for Video
US20110206132A1 (en) Data Compression for Video
EP2904806B1 (en) 2d block image encoding
CN101933331A (en) Video encoding device, video decoding device, video encoding method, video decoding method, and video encoding or decoding program
CN103118252A (en) Dynamic image encoding device and dynamic image decoding device
US11882292B2 (en) Image encoder and decoder using unidirectional prediction
KR101519653B1 (en) Image compressing apparatus of lossless and lossy type
US20110310975A1 (en) Method, Device and Computer-Readable Storage Medium for Encoding and Decoding a Video Signal and Recording Medium Storing a Compressed Bitstream
GB2474535A (en) Adaptive filtering of video data based upon rate distortion cost
JP2010068219A (en) Moving image encoding device

Legal Events

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