KR101519653B1 - Image compressing apparatus of lossless and lossy type - Google Patents
Image compressing apparatus of lossless and lossy type Download PDFInfo
- Publication number
- KR101519653B1 KR101519653B1 KR1020080086601A KR20080086601A KR101519653B1 KR 101519653 B1 KR101519653 B1 KR 101519653B1 KR 1020080086601 A KR1020080086601 A KR 1020080086601A KR 20080086601 A KR20080086601 A KR 20080086601A KR 101519653 B1 KR101519653 B1 KR 101519653B1
- Authority
- KR
- South Korea
- Prior art keywords
- data
- pixel
- predicted
- input
- specific pixel
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/593—Methods 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
본 발명은 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치에 관한 것으로, 이를 위하여 무손실 압축 장치는 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기와, 소정의 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기, 및 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기를 포함한다.
JPEG, 압축, 무손실, 손실, 공간예측, 손실팩터
The present invention relates to an image lossless and lossless compression apparatus for reducing a memory bandwidth that can efficiently reduce a high memory bandwidth caused by a large amount of image data through a simple compression scheme, A spatial predictor for receiving gray level data for at least one or more peripheral pixels related to a specific pixel from a block buffer and for predicting gray level data for a specific pixel using at least one directional correlation between neighboring pixels; A subtracter for subtracting the gradation data of the specific pixel from the predictive data for the specific pixel input from the spatial predictor and outputting the subtracted error data, and a subtractor for subtracting the lossless error data input from the subtracter from the input parameter After adjusting the number of bits depending it includes an encoder for transmitting the adjusted bit stream toward the memory.
JPEG, compression, lossless, loss, spatial prediction, loss factor
Description
본 발명은 이미지 압축 장치에 관한 것으로, 특히 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치에 관한 것이다.The present invention relates to an image compression apparatus, and more particularly, to an image lossless and lossy compression apparatus for reducing memory bandwidth, which can effectively reduce a high memory bandwidth caused by a large amount of image data through a simple compression scheme.
HD(High Definition)급 이상의 크기를 가지는 영상에 대해 실시간 영상처리를 하는 칩은 단지 원영상 데이터를 라이트(write)/리드(read)하는 것만으로도 높은 메모리 대역폭이 요구된다. 1990년대 중반 이후 HD급 MPEG 디코더 칩의 메모리(SDRAM) 사이즈를 줄이기 위해 프레임 압축 기술이 연구 개발되어 왔다. 주로 간단한 하드웨어 기반의 압축 방식들로 ADPCM(adaptive differential pulse coded modulation) 방식이나 다운 컨버전(down conversion) 방식들이 제안되었다. A chip that performs real-time image processing on an image having a size of HD (High Definition) or more requires a high memory bandwidth by simply writing / reading original image data. Since the mid 1990s, frame compression techniques have been researched and developed to reduce the memory (SDRAM) size of HD class MPEG decoder chips. ADPCM (adaptive differential pulse coded modulation) or down conversion schemes have been proposed mainly in simple hardware-based compression schemes.
최근에는 비디오 프로세서 칩들이 HD, Full HD급 이상의 영상들을 다룰 뿐만 아니라 MPEG, 3D 그래픽스 랜더링(rendering), 및 프레임 변환(frame-rate conversion) 등 다양한 비디오 프로세싱 기능들이 탑재됨에 따라 더 높은 메모리 대역폭이 요구된다. In recent years, video processor chips not only handle HD or Full HD class images, but also have various video processing functions such as MPEG, 3D graphics rendering, and frame-rate conversion, do.
이를 해결하기 위해 기존 방식들은 다중 메모리 제어기(multiple memory controllers)를 사용하거나 비싼 칩 패키지나 많은 데이터 인터페이스들을 사용한다. 그러나 이러한 방식들은 압축 시스템의 비용을 증가시키게 되므로 영상의 무손실/손실 압축을 통한 메모리 대역폭(memory bandwidth) 감축 기법이 영상 및 제품 차별화의 중요한 핵심기술로 대두되고 있다.To solve this, existing schemes use multiple memory controllers or use expensive chip packages or many data interfaces. However, since these methods increase the cost of the compression system, the memory bandwidth reduction technique through lossless / lossy compression of the image is becoming an important technology of image and product differentiation.
디지털 영상 압축기법은 무손실(lossless) 압축기법과 손실(lossy) 압축기술로 나누어지며, 이러한 압축기술은 공간적, 시간적, 확률적 중복성들을 제거함으로써 영상 데이터를 압축한다. 영상 압축 표준화는 크게 정지영상 압축관련 JPEG(Joint Photographic Experts Group) 표준화 그룹과 동영상 압축관련 MPEG(Moving Picture Experts Group) 표준화 그룹으로 나뉜다. Digital image compression techniques are divided into lossless and lossy compression techniques, which compress image data by eliminating spatial, temporal, and stochastic redundancies. The standardization of image compression standardization is divided into the standardization group of JPEG (Joint Photographic Experts Group) and the standardization group of MPEG (Moving Picture Experts Group) related to video compression.
정지영상 압축기법의 연구개발은 주로 JPEG 표준화 그룹에 의해서 진행되어 왔으며, 최근에는 JPEG-2000, JPEG-LS 등의 표준화를 통해서 무손실 압축기법뿐만 아니라 손실 압축기법들이 제안되고 있다. R & D of still image compression technique has been mainly performed by JPEG standardization group. Recently, lossless compression techniques as well as lossless compression techniques have been proposed through standardization of JPEG-2000, JPEG-LS and the like.
정지영상 압축 방식들은 블록단위 DCT변환이나 웨이브릿 변환 등을 이용하고, 예측 부호화(predictive coding)와 양자화 그리고 엔트로피 부호화 등을 함께 사용함으로써 높은 압축률을 얻는 반면에 하드웨어 복잡도는 매우 높은 편이다.The still image compression methods use a block-based DCT transform or a wavelet transform, and use a combination of predictive coding, quantization and entropy coding to obtain a high compression ratio, but the hardware complexity is very high.
예컨대, JPEG-LS 방식의 경우 비교적 간단한 예측 부호화와 엔트로피 부호화 를 이용한 무손실 압축기법으로 기존 JPEG과 JPEG-2000에 비해 하드웨어 복잡도가 비교적 낮은 편이나 그래도 높은 복잡성을 갖는다. JPEG-LS는 DPCM과 run-length 코더(coder), 콘텍스트(context) 모델링 기반 GR(Golomb Rice) 코더들로 구성되어 있다. For example, the JPEG-LS method has a relatively low hardware complexity compared to the conventional JPEG and JPEG-2000, but has high complexity even though it is a lossless compression technique using relatively simple predictive coding and entropy coding. JPEG-LS consists of DPCM, run-length coder, and context modeling based GR (Golomb Rice) coders.
이와 같은 JPEG-LS는 영상의 변화가 적은 영역인지 아닌지를 구분하여 두 가지 모드(일반모드와 런모드)로 동작한다. 일반모드에서는 보다 정확한 예측데이터를 구하기 위해 고정된 예측기와 적응적 교정지로 예측데이터를 구한 후 변형된 GR(Golomb Rice) 코드를 사용한다. 런(run)모드에서는 인터럽트(Interrupt) 방식(run 길이와 인터럽트 샘플값을 코딩)과 소모(Exhaustion) 방식(run length만 코딩)을 사용한다.The JPEG-LS operates in two modes (normal mode and run mode) by distinguishing whether or not the image has a small change in the image. In the normal mode, to obtain more accurate prediction data, predicted data is obtained from a fixed predictor and an adaptive proof sheet, and then a modified GR (Golomb Rice) code is used. In the run mode, the interrupt method (coding run length and interrupt sample value) and the exhaustion method (only run length coding) are used.
다른 무손실 압축 방법 중 압축률이 좋은 방식으로 PNG(Potable Network Graphics) 방식이 있다.Among other lossless compression methods, there is a PNG (Potable Network Graphics) method in a compressible manner.
PNG는 GIF를 대체하기 위한 파일로, 파일 구조는 GIF와 동일하여 투명 효과 등 GIF의 장점을 그대로 사용할 수 있으며, GIF보다 압축률이 우수하다. 이 방식은 원 영상을 PNG 영상으로 만들고 인코더를 통해 데이터 스트림을 만든다. 이 과정에서 알파샘플이 분리되고 인덱싱을 통해 각각의 샘플들은 팔레트의 인덱스에 의해 맞는 값으로 바꾸는 작업, 첫 번째 압축(reduced)된 이미지부터 일곱 번째 압축된 이미지를 생성하는 작업, 그리고 필터 타입에 따라 압축하며 이를 순서대로 청크(chunk)를 만들어 비트스트림을 만드는 작업 등이 필요하다.PNG is a file to replace GIF. The file structure is the same as GIF, so you can use the advantages of GIF, such as transparency effect, and it is better than GIF. In this method, the original image is converted into a PNG image and the data stream is generated by an encoder. In this process, the alpha sample is separated and indexed to convert each sample to a value that is based on the index of the palette, to create a seventh compressed image from the first compressed image, It is necessary to compress and create chunks in order to create a bit stream.
이와 같은 PNG 압축 방식도 상기 JPEG-LS 방식처럼 구조적으로 높은 복잡성 을 갖게 되므로 상당히 비효율적이다.The PNG compression method is also inefficient because it has a high complexity like the JPEG-LS method.
본 발명의 목적은 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치를 제공하는 데 있다. An object of the present invention is to provide an image lossless and lossy compression apparatus for reducing memory bandwidth which can efficiently reduce a high memory bandwidth caused by a large amount of image data through a simple compression structure.
본 발명의 다른 목적은 간단한 압축 구조로 대용량의 이미지데이터를 화질 손실없이 압축 저장함으로써, 메모리 대역폭을 효율적으로 감축할 수 있음과 아울러 압축 속도를 향상시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치를 제공하는 데 있다.Another object of the present invention is to provide an image lossless and lossless compression method capable of efficiently reducing the memory bandwidth and compressing the memory bandwidth, which can improve the compression speed, by compressively storing the large- Device.
상기 목적을 달성하기 위한 본 발명의 이미지 무손실 압축 장치는, 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 계조데이터를 블록버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하 는 감산기; 및 상기 감산기로부터 입력된 무손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided an image lossless compression apparatus including a block buffer in which gradation data of pixels are stored in units of macroblocks in which an image is divided into predetermined rows and columns; A spatial predictor for receiving gray level data for at least one or more peripheral pixels related to a specific pixel to be predicted from the block buffer and for predicting gray level data for a specific pixel by using at least one directional correlation between neighboring pixels; A subtracter for subtracting the gray level data of the specific pixel input from the block buffer and the prediction data for the specific pixel input from the spatial predictor and outputting the subtracted error data; And an encoder which adjusts the number of bits of the lossless error data input from the subtractor according to a coding parameter input from a predetermined parameter calculator, and then delivers the adjusted bitstream to the memory.
구체적으로, 상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 하고, 상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 및 좌측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 한다.Specifically, the parameter calculator compares correlation values for at least one direction among neighboring pixels input from the spatial predictor, and determines a coding parameter by calculating a data bit number of a minimum correlation value as a result of comparison. And the spatial predictor predicts the gray level data using the correlation between at least one of the pixels located in the horizontal direction, the vertical direction, and the left diagonal direction based on the specific pixel to be predicted.
아울러, 상기 공간예측기는, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 계조데 이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 계조데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 계조데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 한다.In addition, the spatial predictor receives the gray level data of the surrounding pixels based on the specific pixel to be predicted from the block buffer, and subtracts the gray level data between neighboring pixels in the horizontal and vertical directions to obtain horizontal and vertical correlation data, respectively A subtractor; A first comparator for comparing the horizontal and vertical correlation data input from the subtractor and outputting a selection control signal according to a comparison result; A pixel arithmetic unit for receiving the gray level data of the surrounding pixels based on the specific pixel to be predicted from the block buffer and adding the pixels located at the left side and the upper side to each other and subtracting the pixels located in the diagonal direction; A second comparator for comparing an absolute value of the operation result value input from the pixel operation unit with a preset reference value and outputting a selection control signal according to the comparison result; A first multiplexer for selectively outputting the gradation data of a left pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; A second multiplexer for selectively outputting gradation data of a top pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; And a third multiplexer for selectively outputting gradation data or operation result values of the left and upper pixels input from the first and second multiplexers according to a selection control signal of the first comparator.
상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 한다.The spatial predictor may further include a clipping unit for clipping and outputting a maximum value or a minimum value within a predetermined range when the predicted value output from the third multiplexer is out of a preset reference value.
상기 목적을 달성하기 위한 본 발명의 이미지 손실 압축 장치는, 이미지가 소정의 행과 열로 나누어진 매크로블록 단위로 픽셀들의 계조데이터(gradation data)가 저장된 블록버퍼; 상기 각 픽셀의 데이터 손실 처리에 따른 오차데이터를 일정 범위에서 손실 보상되고, 손실 보상된 보상데이터가 저장된 라인버퍼; 예측하고자 하는 특정 픽셀과 관계된 적어도 하나 이상의 주변 픽셀에 대한 보상데이터를 라인버퍼로부터 입력받아 주변 픽셀간의 적어도 한 방향 이상의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측하는 공간예측기; 상기 블록버퍼로부터 입력된 특정 픽셀의 계조데이터와 공간예측기로부터 입력된 상기 특정 픽셀에 대한 예측데이터를 감산하고 감산된 오차데이터를 출력하는 감산기; 상기 감산기로부터 입력된 특정 픽셀의 오차데이터를 소정의 손실팩터선택기로부터 입력된 손실팩터(Lossy Factor)에 따라 손실 처리한 후 손실된 오차데이터를 출력하는 손실처리기; 및 상 기 손실처리기로부터 입력된 손실 오차데이터를 소정의 파라미터계산기로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림을 메모리 측으로 전달하는 부호화기;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided an image loss compression apparatus including: a block buffer in which gradation data of pixels are stored in macroblock units in which an image is divided into predetermined rows and columns; A line buffer in which the error data according to the data loss process of each pixel is compensated for in a certain range and the loss compensated compensation data is stored; A spatial predictor for receiving compensation data for at least one or more peripheral pixels related to a specific pixel to be predicted from the line buffer and predicting gray level data for a specific pixel by using at least one directional correlation between neighboring pixels; A subtractor for subtracting the gray level data of the specific pixel input from the block buffer and the prediction data for the specific pixel input from the spatial predictor and outputting the subtracted error data; A loss processor for performing lossy processing of error data of a specific pixel input from the subtractor according to a loss factor input from a predetermined loss factor selector and outputting lossy error data; And an encoder that adjusts the number of bits according to the encoding parameter input from the predetermined parameter calculator and transfers the adjusted bitstream to the memory side.
구체적으로, 상기 손실팩터선택기는 부호화기를 통해 출력되는 각 픽셀의 비트수를 카운트하여 누적하고 누적된 이전 블록의 비트수와 블록별 목표 비트수를 이용하여 현재 매크로블록에 적용할 손실팩터를 계산하여 결정하는 것을 특징으로 하고, 상기 손실팩터선택기는, 부호화기에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하여 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 누적하는 비트수카운터; 및 미리 저장된 매크로블록의 목표 비트량을 기준으로 현재 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 계산한 후 계산된 현재 슬라이스(slice) 또는 LMB의 잉여비트수와 설정된 기준값을 상호 비교하여 손실팩터를 결정하는 손실팩터계산부;를 포함하여 구성된 것을 특징으로 한다.Specifically, the loss factor selector counts and accumulates the number of bits of each pixel output through the encoder, calculates a loss factor to be applied to the current macroblock by using the number of bits of the previous block and the number of target bits per block Wherein the loss factor selector comprises: a loss factor selector which counts the number of bits of error data of all pixels output from the encoder and outputs a slice unit including each macroblock and a bit number counter ; And calculating surplus bits for a current slice or LMB based on a target bit amount of a previously stored macroblock and comparing the calculated current slice or the number of redundant bits of the LMB with a set reference value to obtain a loss And a loss factor calculator for determining a factor.
아울러, 상기 손실팩터계산기는 입력된 블록 변화도(activity)에 대한 데이터를 미리 설정된 기준값과 비교하여 블록 변화도가 낮을 경우 손실팩터를 감소시키는 것을 특징으로 한다.The loss factor calculator compares data on an input block activity with a preset reference value to reduce the loss factor when the degree of block variation is low.
상기 파라미터계산기는 공간예측기로부터 입력된 주변 픽셀들 간의 적어도 하나 이상의 방향에 대한 상관값을 상호 비교하고, 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정하는 것을 특징으로 한다.The parameter calculator compares the correlation values of at least one direction between neighboring pixels input from the spatial predictor and calculates the number of data bits of the minimum correlation value as a comparison result to determine the encoding parameter.
상기 공간예측기는 예측하고자 하는 특정 픽셀을 기준으로 수평 방향과 수직 방향, 좌측 대각선 방향 및 우측 대각선 방향에 위치한 픽셀들 중 적어도 어느 하나 이상의 주변 픽셀간의 상관성을 이용하여 계조데이터를 예측하는 것을 특징으로 한다.The spatial predictor is characterized by predicting gray level data using a correlation between at least one of surrounding pixels in a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction with reference to a specific pixel to be predicted .
상기 공간예측기는, 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 수평 및 수직 방향의 주변 픽셀들간에 상호 감산한 후 수평 및 수직 상관데이터를 각각 획득하는 감산기; 상기 감산기로부터 입력된 수평 및 수직 상관데이터를 상호 비교한 후 비교 결과에 따른 선택제어신호를 출력하는 제1 비교기; 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼로부터 입력받아 좌측과 상단에 위치한 픽셀들은 상호 가산하고 대각선 방향에 위치한 픽셀은 감산하는 픽셀연산부; 상기 픽셀연산부로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력하는 제2 비교기; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제1 멀티플렉서; 상기 제2 비교기의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 오차 보상데이터와 픽셀연산부로부터 입력된 연산 결과값을 선택적으로 출력하는 제2 멀티플렉서; 및 상기 제1 및 제2 멀티플렉서로부터 입력된 좌측 및 상단 픽셀의 오차 보상데이터 또는 연산 결과값을 상기 제1 비교기의 선택 제어신호에 따라 선택적으로 출력하는 제3 멀티플렉서;를 포함하는 것을 특징으로 한다.The spatial predictor includes a subtractor for subtracting the error compensation data for neighboring pixels from neighboring pixels in the horizontal and vertical directions and obtaining the horizontal and vertical correlation data, ; A first comparator for comparing the horizontal and vertical correlation data input from the subtractor and outputting a selection control signal according to a comparison result; A pixel arithmetic unit for receiving error compensation data for neighboring pixels based on a specific pixel to be predicted from the line buffer and adding pixels located on the left and upper sides to each other and subtracting pixels located in the diagonal direction; A second comparator for comparing an absolute value of the operation result value input from the pixel operation unit with a preset reference value and outputting a selection control signal according to the comparison result; A first multiplexer for selectively outputting error correction data of a left pixel for a specific pixel to be predicted and an operation result value input from a pixel operation unit according to the selection control signal of the second comparator; A second multiplexer for selectively outputting error correction data of an upper pixel for a specific pixel to be predicted according to the selection control signal of the second comparator and an operation result value input from the pixel operation unit; And a third multiplexer for selectively outputting error compensation data or operation result values of the left and upper pixels input from the first and second multiplexers according to a selection control signal of the first comparator.
상기 공간예측기는, 상기 제3 멀티플렉서에서 출력된 예측값이 미리 설정된 기준값을 벗어날 경우 설정된 범위내의 최대값 또는 최소값으로 클리핑하여 출력하는 클리핑부를 더 포함하는 것을 특징으로 한다.The spatial predictor may further include a clipping unit for clipping and outputting a maximum value or a minimum value within a predetermined range when the predicted value output from the third multiplexer is out of a preset reference value.
상기 압축장치는, 손실처리기로부터 입력된 손실 오차데이터를 레프트 시프트하여 손실된 데이터를 복구하고, 복구된 데이터와 공간예측기로부터 입력된 예측데이터를 상호 가산하여 오차 보상된 데이터를 라인버퍼로 출력하는 픽셀복원기를 더 포함하는 것을 특징으로 하며, 상기 손실처리기는 손실팩터에 따라 오차데이터를 오른쪽(light)으로 시프트하여 손실 처리하는 시프터인 것을 특징으로 한다.The compression device includes a pixel for outputting the error-compensated data to the line buffer by adding the recovered data and the predictive data input from the spatial predictor to each other to restore the lost data by left shifting the loss error data input from the loss processor, Wherein the loss processor is a shifter that shifts the error data to the right according to the loss factor to perform loss processing.
이상에서 설명한 바와 같이 본 발명은 압축장치를 간단한 공간예측기와 GR부호화기로 구성되어 블록 단위로 동작되도록 함으로써, 대용량 영상데이터의 처리와 메모리 대역폭의 감축에 적당하고, 압축장치의 낮은 복잡도로 인해 칩 구현이 용이함과 아울러 데이터 처리 속도와 가격적인 측면에서 유리한 이점이 있다.As described above, according to the present invention, since the compression device is composed of a simple spatial predictor and a GR encoder and is operated on a block basis, it is suitable for processing large-capacity image data and reducing memory bandwidth, Which is advantageous in terms of data processing speed and cost.
이하, 첨부된 도면을 참조하여 본 발명의 실시예에 대하여 보다 상세하게 설명하고자 한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 1은 본 발명의 일실시예에 의한 이미지 무손실 압축 시스템을 나타낸 기능 블록도로서, 압축 시스템은 이미지를 무손실 압축하는 압축장치(100)와, 상기 압축장치(100)를 통해 압축된 데이터가 저장되는 메모리(300)와, 상기 메모리(300)와 외부 장치와의 상호 데이터 인터페이스를 위한 메모리 컨트롤러(350), 및 상기 제반 장치들의 작동을 제어하는 메인컨트롤러(400)를 포함하여 이루어져 있다.FIG. 1 is a functional block diagram of an image lossless compression system according to an embodiment of the present invention. The compression system includes a
상기 무손실 압축장치(100)는 이미지의 압축시 매크로블록 단위로 압축하게 되며, 이때 메인컨트롤러(400)로부터 로컬 버스를 통해 이미지의 사이즈나 타깃 압축률 등에 대한 정보를 선택적으로 제공받아 처리하게 된다.The
그리고, 상기 압축장치(100)는 블록버퍼(110)와 공간예측기(130), 감산기(150), 파라미터계산기(170) 및 부호화기(190)를 포함하여 이루어져 있다. The
상기 블록버퍼(110)는 원래의 이미지 전체가 소정의 행과 열(M×N)로 나누어진 매크로블록 단위의 이미지를 일시 저장한다. 상기 매크로블록(macroblock; MB)은 일반적으로 16×16 픽셀(pixel) 등으로 구성될 수 있고 각 픽셀은 8비트(bit)의 계조데이터(gradation data)로 이루어질 수 있으나, 실시예에 따라 매크로블록은 32×32, 8×8, 32×16 또는 16×8 픽셀 등으로 구성될 수 있고, 각 픽셀의 데이터 비트수도 다양하게 가감될 수 있다.The
공간예측기(130)는 예측하고자 하는 특정 픽셀(i)과 관계된 적어도 하나 이상의 주변 픽셀(a, b, c)에 대한 계조데이터를 블록버퍼(110)로부터 입력받아 주변 픽셀간의 수평 및 수직 등의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 데이터를 감산기(150)로 출력한다. 여기서, 공간예측기(130)에 의한 예측이 완벽할 경우 예측된 계조데이터와 원래의 계조데이터가 동일하게 되며, 이 경우 감산기의 출력값이 '0'이 되어 압축률을 향상시킬 수 있다. 하지만, 예측 하고자 하는 특정 픽셀의 주변 픽셀들의 상관성을 이용하여 특정 픽셀의 계조데이터를 예측하게 되므로 계조의 변화가 심한 모든 픽셀에 대해서 감산기의 출력값이 '0'이 되는 완벽한 예측을 하기가 쉽지 않다.The
감산기(150)는 블록버퍼(110)로부터 입력된 특정 픽셀(i)의 계조데이터(gradation data)와 공간예측기(130)로부터 입력된 상기 특정 픽셀에 대한 예측데이터(prediction data; P)를 감산하고 감산된 오차데이터(error data; e)를 출력한다. 상기 주변 픽셀은 특정 픽셀을 기준으로 좌측과 상단 및 좌대각선 방향에 각각 위치한 픽셀들로 이전 픽셀에 해당된다.The
파라미터계산기(170)는 공간예측기(130)로부터 입력된 주변 픽셀들 간의 수직 및 수평 방향의 상관값을 각각 입력받아 상호 비교하고 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정한다. The
부호화기(190)는 감산기(150)로부터 입력된 무손실 오차데이터를 파라미터계산기(170)로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 비트스트림(bitstream)을 메모리(300) 측으로 전달한다. 아울러, 본 발명에 적용된 부호화기(190)는 GR(Golomb Rice) 파라미터인 k값에 따라 비트수를 조정하는 GR부호화기(Golomb Rice Coder) 등이 될 수 있다.The
이와 같이 특성 픽셀에 대한 계조데이터를 메모리(300)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다.In this manner, instead of storing the grayscale data for the characteristic pixel in the
아울러, 상기 공간예측기(130)의 경우 도 2와 같이 구성되어 있다.In addition, the
즉, 공간예측기(130)는 제1 감산기(131)와 제2 감산기(132), 제1 비교기(133), 픽셀연산부(134), 제2 비교기(135), 복수의 멀티플렉서(136a~136c) 및 클리핑부(137)를 포함하여 이루어져 있다.That is, the
상기 제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
제1 비교기(133)는 상기 제1 및 제2 감산기(131, 132)로부터 각각 입력된 수평 및 수직 상관데이터(dx, dy)의 절대값을 상호 비교한 후 비교 결과에 따른 선택제어신호(select)를 출력한다.The
픽셀연산부(134)는 예측하고자 하는 특정 픽셀을 기준으로 주변 픽셀들에 대한 계조데이터를 블록버퍼(110)로부터 입력받아 좌측과 상단에 위치한 픽셀들(a, b)은 상호 가산하고 대각선 방향에 위치한 픽셀(c)은 감산한다.The pixel
제2 비교기(135)는 상기 픽셀연산부(134)로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력한다. 상기 제2 비교기에 설정된 기준값의 경우 255인 것이 바람직하다.The
제1 멀티플렉서(136a)는 상기 제2 비교기(135)의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀(a)의 계조데이터와 픽셀연산부(134)로부터 입력된 연산 결과값을 선택적으로 출력한다.The
제2 멀티플렉서(136b)는 상기 제2 비교기(135)의 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 대한 상단 픽셀의 계조데이터와 픽셀연산부(134)로부터 입력된 연산 결과값을 선택적으로 출력한다.The
제3 멀티플렉서(136c)는 상기 제1 및 제2 멀티플렉서(136a, 136b)로부터 입력된 좌측 및 상단 픽셀(a, b)의 계조데이터 또는 연산 결과값을 상기 제1 비교기(133)의 선택 제어신호에 따라 선택적으로 출력한다.The
클리핑부(137)는 상기 제3 멀티플렉서(136c)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 출력한다.When the value of the data input from the
즉, 공간예측기(130)는 도시된 바와 같이 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식 1을 이용하여 예측한다.That is, the
(|b+dy|)≤255 이면, Prediction Data = b+dy (| b + dy |)? 255, Prediction Data = b + dy
|dy|>|dx|이고 (|a+dx|)>255 이면, Prediction Data = a| dy |> | dx | and (| a + dx |)> 255, Prediction Data = a
(|a+dx|)≤255 이면, Prediction Data = a+dx (| a + dx |) < 255, Prediction Data = a + dx
여기서, dx는 b-c, dy는 a-c, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 예측하고자 하는 특정 픽셀의 좌측 대각선에 위치한 픽셀의 데이터이다.Here, dx is data of a pixel located at the left side of a specific pixel to be predicted, b is data of a pixel located at a top of a specific pixel to be predicted, c is data of a pixel to be predicted, The data of the pixel located on the left diagonal of the pixel.
이와 같은 무손실 압축 알고리즘의 경우, 블록내 상관성이 떨어지는 경우 압축의 한계로 인하여 주어진 메모리 대역폭을 초과할 수 있으므로, 목표 압축률에 따라 도 2와 같은 무손실 압축 방식과 아래 도 3과 같은 손실 압축 방식을 선택적으로 적용해야 한다.In the case of such a lossless compression algorithm, since a given memory bandwidth can be exceeded due to compression limitations when the intra-block correlation is low, a lossless compression scheme as shown in FIG. 2 and a lossy compression scheme as shown in FIG. .
도 3은 본 발명의 다른 실시예에 의한 이미지 손실 압축 시스템을 나타낸 기능 블록도로서, 압축 시스템은 이미지를 미리 설정된 비트량으로 손실 압축하는 압축장치(200)와, 상기 압축장치를 통해 압축된 데이터가 저장되는 메모리(300)와, 상기 메모리(300)와 외부 장치와의 상호 데이터 인터페이스를 위한 메모리 컨트롤러(350), 및 상기 제반 장치들의 작동을 제어하는 메인컨트롤러(400)를 포함하여 이루어져 있다.FIG. 3 is a functional block diagram illustrating an image loss compression system according to another embodiment of the present invention. The compression system includes a
상기 압축장치(200)는 이미지의 압축시 매크로블록 단위로 압축하게 되며, 이때 메인컨트롤러(400)로부터 로컬 버스를 통해 이미지의 사이즈나 타깃 압축률 등에 대한 정보를 제공받아 처리하게 된다.The
그리고, 상기 손실 압축장치(200)는 블록버퍼(210)와 라인버퍼(220), 공간예 측기(230), 감산기(240), 손실처리기(250), 손실팩터선택기(260), 파라미터계산기(270), 부호화기(280) 및 픽셀복원기(290) 등을 포함하여 이루어져 있다.The
상기 블록버퍼(210)에는 원래의 이미지 전체가 소정의 행과 열(M×N)로 나누어진 매크로블록 단위의 이미지가 일시 저장되어 있다. 상기 매크로블록(macro block)은 일반적으로 16×16 픽셀(pixel) 등으로 구성될 수 있고 각 픽셀은 8비트(bit)의 계조데이터(gradation data)로 이루어질 수 있으나, 실시예에 따라 매크로블록은 32×32, 8×8, 32×16 또는 16×8 픽셀 등으로 구성될 수 있고, 각 픽셀의 데이터 비트수도 다양하게 가감될 수 있다.In the
라인버퍼(220)에는 손실처리기(250)로부터 출력된 각 픽셀의 손실 오차데이터가 일정 범위에서 손실 보상된 보상데이터가 픽셀별로 임시 저장되어 있다. 즉, 블록버퍼(210)에서는 도 4a와 같이 각 픽셀들(c, b, a, i)의 원래의 계조데이터(c_d1, b_d1, a_d1, i_d1)가 저장되어 있지만, 라인버퍼(220)에는 도 4b와 같이 각 픽셀들(c, b, a, i)에 대한 손실 보상된 보상데이터(c_d2, b_d2, a_d2, i_d2)가 저장되어 있다. 그리고, 상기 각 픽셀들의 계조데이터(c_d1, b_d1, a_d1, i_d1)와 각 픽셀들의 손실 보상데이터(c_d2, b_d2, a_d2, i_d2)는 비트수는 서로 동일하지만, 손실에 의해 데이터는 상이할 수 있다.In the
공간예측기(230)는 감산기(240)로 입력되는 특정 픽셀(i)과 관계된 적어도 하나 이상의 주변 픽셀(a, b, c)에 대한 오차 보상데이터를 라인버퍼(220)로부터 입력받아 주변 픽셀간의 수평 및 수직 등의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 감산기(240)로 출력한다. 여기서, 공 간예측기(230)에 의한 예측이 완벽할 경우 예측된 계조데이터와 원래의 계조데이터가 동일하게 되며, 이 경우 감산기의 출력값이 '0'이 되어 압축률을 향상시킬 수 있다. 하지만, 예측하고자 하는 특정 픽셀의 주변 픽셀들의 상관성을 이용하여 특정 픽셀의 계조데이터를 예측하게 되므로 계조의 변화가 심한 모든 픽셀에 대해서 감산기의 출력값이 '0'이 되는 완벽한 예측을 하기가 쉽지 않다.The
감산기(240)는 블록버퍼(210)로부터 입력된 특정 픽셀(i)의 계조데이터(gradation data)와 공간예측기(230)로부터 입력된 상기 특정 픽셀(i)과 관계된 예측데이터(prediction data; p)를 감산하고 감산된 오차데이터(error data; e)를 출력한다. 상기 주변 픽셀은 특정 픽셀을 기준으로 좌측과 상단 및 대각선 방향에 각각 위치한 픽셀들로 이전(previous) 픽셀에 해당된다.The
손실처리기(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
손실팩터선택기(260)는 부호화기(280)를 통해 출력되는 각 픽셀의 비트수를 카운트하여 누적하고 누적된 이전 블록의 비트수와 블록별 목표비트수(target bits)를 이용하여 현재 매크로블록에 적용할 손실팩터(lossy factor)를 계산하여 결정한다.The
파라미터계산기(270)는 공간예측기(230)로부터 예측하고자 하는 특정 픽셀의 주변 픽셀들 간의 수직 및 수평 방향의 상관값을 각각 입력받아 상호 비교하고 비교 결과 최소의 상관값의 데이터 비트수를 계산하여 부호화 파라미터로 결정한다.The
부호화기(280)는 손실처리기(250)로부터 입력된 손실 오차데이터를 파라미터계산기(270)로부터 입력된 부호화 파라미터에 따라 비트수를 조정한 후 조정된 특정 픽셀의 압축 비트스트림(bitstream)을 메모리 측으로 전달한다. 아울러, 본 발명에 적용된 부호화기(280)는 GR(Golomb Rice) 파라미터인 k값에 따라 비트수를 조정하는 GR부호화기(Golomb Rice Coder) 등이 될 수 있다.The
아울러, 픽셀복원기(290)는 시프터와 가산기(미 도시)로 이루어져 있는데, 상기 손실처리기(250)로부터 입력된 손실 오차데이터를 레프트 시프트(left shift)하여 손실된 최하위비트를 복구한 후 복구된 손실 보상데이터와 공간예측기(230)로부터 입력된 예측데이터(p)를 상호 가산하여 오차 보상데이터를 획득한다. 픽셀복원기(290)는 이와 같이 획득된 특정 픽셀의 오차 보상데이터를 라인버퍼(220)로 출력한다. 아울러, 상기 픽셀복원기(290)는 손실된 최하위비트에 대한 비트수만 복구 할 뿐 손실된 최하위비트에 데이터(0 또는 1)를 정확하게 복원하는 것은 아니므로, 블록버퍼(210)에 저장된 픽셀 데이터와 라인버퍼(220)에 저장된 픽셀 데이터는 다를 수 있다.In addition, the
이와 같이 손실 압축장치(200)는 예측하고자 하는 특정 픽셀에 대한 계조데이터를 메모리(300)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터를 손실팩터에 따라 설정된 목표 압축률에 적합하게 손실 압축하여 메모리에 저장하게 된다. 물론, 상기 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다. In this way, the
상기 공간예측기(230)의 경우 도 5와 같이 구성되어 있다.The
즉, 공간예측기(230)는 제1 감산기(231)와 제2 감산기(232), 제1 비교기(233), 픽셀연산부(234), 제2 비교기(235), 복수의 멀티플렉서(236a~236c) 및 클리핑부(237)를 포함하여 이루어져 있다.That is, the
제1 감산기(231)는 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 감산하고 감산된 수직 상관데이터를 출력한다. 예컨대, 제1 감산기(231)는 특정 픽셀인 i에 대한 좌측 픽셀인 a와 좌대각선 픽셀인 c를 각각 라인버퍼(220)로부터 입력받아 이를 감산한 후 감산된 수직 상관데이터(dy=a-c)를 출력하게 된다.The
제2 감산기(232)는 예측하고자 하는 특정 픽셀에 대한 상단 픽셀과 좌대각선 픽셀의 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 감산하고 감산된 수평 상관데이터를 출력한다. 예컨대, 제2 감산기(232)는 특정 픽셀인 i에 대한 상단 픽셀인 b와 좌대각선 픽셀인 c를 각각 입력받아 이를 감산한 후 감산된 수평 상관데이터(dx=b-c)를 출력하게 된다.The
제1 비교기(233)는 제1 감산기(231)와 제2 감산기(232)로부터 각각 입력된 수직 및 수평 상관데이터에 대한 절대값을 상호 비교한 후 비교 결과에 따른 선택 제어신호를 출력한다. 상기에서 라인버퍼(220)에 저장된 각 픽셀의 오차 보상데이터는 상황에 따라 마이너스 값을 가질 수 있으며, 이때에는 각 픽셀의 절대값이 제1 및 제2 감산기(231, 232)로 각각 입력되도록 한다. The
픽셀연산부(234)는 예측하고자 하는 특정 픽셀과 관계된 주변 픽셀들에 대한 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 설정된 연산 알고리즘에 따라 가감하여 연산한 후 연산된 결과값을 출력한다. 예컨대, 연산 알고리즘은 예측하고자 하는 특정 픽셀(i)의 좌측 픽셀(a)과 상단 픽셀(b)의 오차 보상데이터(a_d2, b_d2)를 서로 가산하고 가산된 값에 좌대각선 픽셀(c)의 오차 보상데이터(c_d2)를 다시 감산한다. The
제2 비교기(235)는 픽셀연산부(234)로부터 입력된 연산 결과값에 대한 절대값과 미리 설정된 기준값을 상호 비교하고 그 비교 결과에 따른 선택 제어신호를 출력한다. 상기 기준값은 계조데이터(n비트)를 기준으로 하여 최대값(2n-1; n은 비트수임)으로 설정하는 것이 바람직하다. 예컨대, 각 픽셀의 계조데이터가 8비트이 므로 십진수로는 최대 255(28-1)값을 가질 수 있으므로 기준값(2n-1; n은 계조데이터의 비트수임)은 255로 설정된다.The
제1 멀티플렉서(236a)는 예측하고자 하는 특정 픽셀에 대한 좌측 픽셀(a)의 오차 보상데이터와 픽셀연산부(234)에서 출력된 연산 결과값을 각각 입력받아 제2 비교기(235)의 선택 제어신호에 따라 선택적으로 출력한다.The
제2 멀티플렉서(236b)는 예측하고자 하는 특정 픽셀에 대한 상단 픽셀(b)의 오차 보상데이터와 픽셀연산부(234)에서 출력된 연산 결과값을 각각 입력받아 제2 비교기(235)의 선택 제어신호에 따라 선택적으로 출력한다.The
제3 멀티플렉서(236c)는 제1 및 제2 멀티플렉서(236a, 236b)로부터 출력된 좌측 및 상단 픽셀(a, b)의 오차 보상데이터 또는 연산 결과값을 각각 입력받아 제1 비교기(233)의 선택 제어신호에 따라 선택적으로 출력한다.The
클리핑부(237)는 제3 멀티플렉서(236c)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 예측된 데이터를 출력한다. 예컨대, 클리핑부(237)의 기준범위가 0 내지 255로 설정되어 있을 경우 제3 멀티플렉서(236c)로부터 입력된 값이 256이면 최대값인 255로 클리핑하여 출력하게 된다.The
이와 같이 구성된 공간예측기(230)에서 특정 픽셀의 계조데이터를 예측하기 위해서 특정 픽셀에 대한 주변 픽셀간의 수평 및 수직 방향의 상관성을 이용하게 되는데, 수평 및 수직 방향의 상관성은 수평 및 수직 변화도(gradient)를 이용하여 계산하게 된다. 수평 및 수직 방향의 상관성은 제1 감산기(231)와 제2 감산기(232)를 통해 수평 픽셀간의 그래디언트(dx=b-c) 및 수직 픽셀간의 그래디언트(dy=a-c)를 이용하여 구한다. 이때 상관성에 따른 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 아래와 같다.In order to predict the gradation data of a specific pixel in the
즉, 제1 비교기(233)의 비교 결과가 |dy|<|dx|이고 제2 비교기(235)의 비교 결과가 (|b+dy|)>255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 b픽셀의 오차 보상데이터(Prediction Data=b)이며, 제1 비교기(233)의 비교 결과가 |dy|<|dx|이고 제2 비교기(235)의 비교 결과가 (|b+dy|)<255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 b픽셀과 a픽셀의 오차 보상데이터를 가산한 후 c픽셀의 오차 보상데이터를 감산한 결과값(Prediction Data=b+dy)이다. 또한, 제1 비교기(233)의 비교 결과가 |dy|>|dx|이고 제2 비교기(235)의 비교 결과가 (|a+dx|)>255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 a픽셀의 오차 보상데이터(Prediction Data=a)이며, 제1 비교기(233)의 비교 결과가 |dy|>|dx|이고 제2 비교기(235)의 비교 결과가 (|a+dx|)<255이면 제3 멀티플렉서(236c)에서 출력되는 예측데이터는 a픽셀과 b픽셀의 오차 보상데이터를 가산한 후 c픽셀의 오차 보상데이터를 감산한 결과값(Prediction Data=a+dx)이다.That is, if the comparison result of the
상기의 조건과 같이 수직 상관값(|dy|)와 수평 상관값(|dx|)을 비교하는 것을 통해 예측하고자 하는 픽셀이 수평 방향과 수직 방향 중 어느 쪽에 더 상관성이 있는지를 알 수 있다. 만약 dx의 값이 더 작다면 b픽셀의 오차 보상데이터가 예측하고자 하는 특정 픽셀(i)의 계조데이터에 더 가까우며, dy의 값이 더 작다면 a픽 셀의 오차 보상데이터가 예측하고자 하는 특정 픽셀(i)의 계조데이터에 더 가깝게 된다. 또한 a픽셀과 b픽셀 및 c픽셀의 연산값(a+b-c)이 255값 이하이면 예측데이터(p)로 a+b-c의 연산 결과값을 사용한다.By comparing the vertical correlation value (| dy |) with the horizontal correlation value (| dx |) as described above, it is possible to know whether the pixel to be predicted is more related to the horizontal direction or the vertical direction. If the value of dx is smaller, the error compensation data of b pixels is closer to the gray level data of the specific pixel (i) to be predicted. If the value of dy is smaller, the error compensation data of a pixel (i). Also, if the calculated value (a + b-c) of the pixels a, b, and c is 255 or less, the calculation result value of a + b-c is used as the predicted data p.
한편, 상기에서 이미지를 실제로 압축할 경우 매크로블록 단위로 압축하기 때문에 참조할 픽셀이 없는 경우가 존재하는데 이 경우에는 방향 예측이 불가능하다. 이 경우의 픽셀들은 압축율을 높이기 위해서 DPCM(Differential Pulse Coded Modulation)을 이용하여 예측한다. 즉, 블록의 첫 번째 픽셀은 예측할 수 없지만 수평방향의 첫번째 줄과 수직방향의 첫번째 줄은 각각의 이전 픽셀을 이용하여 예측하는 것이 바람직하다. 예컨대, 라인버퍼(220)에 매크로블록의 첫 번째 행인 c와 b픽셀에 대한 오차 보상데이터만 저장되어 있을 경우 b픽셀을 예측하고자 한다면 c픽셀의 오차 보상데이터가 감산기(240)로 입력되는 예측데이터가 되는 것이고, 라인버퍼(220)에 매크로블록의 첫 번째 열인 c와 a픽셀에 대한 오차 보상데이터만 저장되어 있을 경우 a픽셀을 예측하고자 한다면 c픽셀의 오차 보상데이터가 감산기(240)로 입력되는 예측데이터가 되는 것이다.On the other hand, when the image is actually compressed, there is a case where there is no pixel to be referred to because it is compressed in units of macroblocks. In this case, direction prediction is impossible. In this case, the pixels are predicted using Differential Pulse Coded Modulation (DPCM) to increase the compression ratio. That is, although the first pixel of the block is unpredictable, it is desirable to predict the first line in the horizontal direction and the first line in the vertical direction using each previous pixel. For example, if only the error compensation data for the c and b pixels, which are the first row of the macroblock, are stored in the
이와 같이 구성된 도 5의 경우 기본적으로 예측하고자 하는 픽셀의 수평 및 수직 방향만 고려하기 때문에 대각선 방향의 픽셀간 상관도가 높은 경우에는 예측 성능이 다소 감소할 수도 있다. 이를 보안하기 위해서 도 6과 같이 수평 및 수직 방향뿐만 아니라 대각선 방향까지 고려하여 예측하도록 한다.5, only the horizontal and vertical directions of the pixel to be predicted are considered, and therefore, the prediction performance may be somewhat reduced when the inter-pixel correlation in the diagonal direction is high. In order to secure this, prediction is performed considering not only horizontal and vertical directions but also diagonal directions as shown in FIG.
즉, 도 6은 본 발명의 다른 실시예에 의한 공간예측기의 세부 구성을 나타낸 기능 블록도로서, 공간예측기(230)는 제1 감산부(231)와 제2 감산부(232), 비교 기(233), 복수의 멀티플렉서(234a, 234b), 가산기(235), 시프터(236), 제3 멀티플렉서(237), 제3 감산기(238) 및 클리핑부(239)를 포함하여 이루어져 있다.That is, FIG. 6 is a functional block diagram showing a detailed configuration of a spatial predictor according to another embodiment of the present invention. The
도 6에서 제1 감산부(231)는 미리 설정된 연산 알고리즘에 따라 예측하고자 하는 특정 픽셀과 관계된 주변 픽셀간의 상관성이 높은 수평, 수직 및 대각선 방향의 픽셀들에 대한 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 상관성이 높은 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력한다. 예컨대, 제1 감산부(231)는 복수의 감산기(231a~231h)로 이루어져 있는데, 각 감산기(231a~231h)는 특정 픽셀을 기준으로 상관성이 높은 수평, 수직, 좌대각선 및 우대각선 방향에 대한 각 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력하게 된다. 6, the
제2 감산부(232)는 제1 감산부(231)로부터 상관성이 높은 복수의 수평, 수직, 좌대각선 및 우대각선의 상관데이터에 대한 절대값을 각각 입력받아 감산한 후 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 출력한다. 예컨대, 제2 감산부(232)는 복수의 감산기(232a~232d)로 이루어져 있는데, 각 감산기(232a~232d)는 제1 감산부(231)로부터 출력된 복수의 수평, 수직, 좌대각선 및 우대각선 방향의 상관데이터 중 동일한 방향의 상관데이터끼리 감산하고 감산된 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 출력하게 된다. 상기에서 제1 감산부(231)에서 출력되는 상관데이터는 상황에 따라 마이너스 값을 가질 수 있으며, 이때에는 각 상관데이터의 절대값이 제2 감산부(232)로 입력되도록 한다. The
비교기(233)는 제2 감산부(232)로부터 입력된 수평, 수직, 좌대각선 및 우대 각선에 대한 상관데이터를 상호 비교한 후 비교 결과에 따른 선택 제어신호를 출력한다. The
제1 멀티플렉서(234a)는 제1 감산부(231)로부터 특정 픽셀(i)의 이전 픽셀(a)을 기준으로 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 입력받고, 비교기(233)의 선택 제어신호에 따라 입력된 어느 하나의 상관데이터를 선택하여 출력하게 된다. 상기 특정 픽셀(i)의 이전 픽셀은 특정 픽셀(i)의 좌측에 인접된 픽셀(a)로 특정 픽셀(i)의 바로 이전의 픽셀(a)에 해당된다.The
제2 멀티플렉서(234b)는 제1 감산부(231)로부터 특정 픽셀(i)의 이전 픽셀(n)을 기준으로 수평, 수직, 좌대각선 및 우대각선에 대한 상관데이터를 각각 입력받고, 비교기(233)의 선택 제어신호에 따라 입력된 어느 하나의 상관데이터를 선택하여 출력하게 된다. 상기 특정 픽셀(i)의 이전 픽셀은 특정 픽셀(i)의 좌측에 이격된 픽셀(n)로 특정 픽셀(i)의 좌측에 인접된 픽셀(a)의 이전 픽셀(n)에 해당된다.The
가산기(235)는 제1 멀티플렉서(234a)와 제2 멀티플렉서(234b)로부터 각각 입력된 상관데이터를 가산하여 출력한다.The
시프터(236)는 가산기(235)로부터 입력된 데이터를 오른쪽(right)으로 1비트 시프트하도록 하여 최하위비트(least significant bit)를 제거(discard)한다.The
제3 멀티플렉서(237)는 예측하고자 하는 특정 픽셀을 기준으로 좌측, 상단, 좌대각선 및 우대각선에 대한 오차 보상데이터(a, b, c, f)를 라인버퍼(220)로부터 각각 입력받고, 비교기(233)의 선택 제어신호에 따라 입력된 어느 하나의 보상데이 터를 선택하여 출력하게 된다.The
제3 감산기(238)는 제3 멀티플렉서(237)와 시프터(236)로부터 각각 입력된 보상데이터를 상호 감산하여 출력한다.The
클리핑부(239)는 제3 감산기(238)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 감산기(240)로 출력한다. 예컨대, 클리핑부(239)의 기준범위가 0 내지 255로 설정되어 있을 경우 제3 감산기(238)로부터 입력된 값이 256이면 최대값인 255로 클리핑하여 출력하게 된다.When the value of the data input from the
도 6과 같이 구성된 공간예측기(230)에서는 수평 및 수직 방향만 고려할 경우에 대각선 방향의 픽셀간 상관성이 수평 및 수직간 픽셀보다 높을 경우에는 예측 성능이 다소 감소될 수 있는 단점을 보완하기 위하여 좌측과 우측 대각선 방향까지 고려하여 특정 픽셀의 계조데이터를 예측한 것이다.The
즉, 제1 감산부(231)와 제2 감산부(232)를 통해 아래 수학식 2와 같이 각 방향의 상관성을 예측하였다.That is, through the
vertical(수직) = |△dn|-|△ca|vertical (vertical) = | dn | - | ca |
left diagonal(좌대각선) = |△en|-|△da|left diagonal = | △ en | - | △ da |
right diagonal(우대각선) = |△cn|-|△ba| right diagonal = | cn | - | △ ba |
여기서, △cb=c-b이고, △na=n-a이고, △dn=d-n이고, △ca=c-a이고, △en=e-n이고, △da=d-a이고, △cn=c-n이며, △ba=b-a이고, a는 예측하고자 하는 특정 픽셀의 좌측에 위치한 픽셀의 보상데이터, n은 a픽셀의 좌측에 위치한 픽셀의 보상데이터, b는 예측하고자 하는 특정 픽셀의 상단에 위치한 픽셀의 데이터, c는 b픽셀의 좌측에 위치한 픽셀의 보상데이터, d는 c픽셀의 좌측에 위치한 픽셀의 보상데이터, e는 d픽셀의 좌측에 위치한 픽셀의 보상데이터, f는 b픽셀의 우측에 위치한 픽셀의 보상데이터이다. Where a is cb = c-b,? Na = n-a,? Dn = d-n,? Ca = c-a,? En = e-n,? Da = d- A is the compensation data of the pixel located to the left of the specific pixel to be predicted, n is the compensation data of the pixel located to the left of the pixel a, b is the compensation data of the pixel located to the left of the pixel a, C is the compensation data of the pixel located on the left side of the pixel b, d is the compensation data of the pixel located on the left side of the pixel c, e is the compensation data of the pixel located on the left side of the pixel d, f Is the compensation data of the pixel located on the right side of the b pixel.
상기 수학식 2와 같이 방향성의 예측확률을 높이기 위해 각 방향에 대한 변화값(gradient)을 두 개씩 이용하였다.As shown in Equation (2), two gradient values for each direction are used in order to increase the prediction probability of directionality.
이에 따라 비교기(233)는 수평과 수직, 좌대각선 및 우대각선을 포함한 네 가지 방향에 대한 상관데이터를 비교 계산하여 그 중 가장 작은 값을 갖는 방향을 선택하고, 선택된 방향에 대한 선택 제어신호를 각 멀티플렉서(234a 234b, 237)로 출력하게 된다. 상기에서 가장 작은 상관값은 예측하고자 하는 특정 픽셀(i)의 계조데이터에 가장 가깝다.Accordingly, the
이어, 공간예측기(230)는 가장 작은 상관값이 예측하고자 하는 특정 픽셀(i)의 계조데이터에 가장 가까우므로 그 방향의 오차 보상데이터에 가중치를 더하기 위해서 각 방향에 대해 아래 수학식 3과 같은 계산을 통해 예측데이터를 좀 더 정확하게 예측한다.Since the smallest correlation value is closest to the grayscale data of the specific pixel (i) to be predicted, the
vertical(수직) = b-(△dn+△ca)/2vertical = b- (? dn +? ca) / 2
Left diagonal(좌대각선) = c-(△en+△da)/2Left diagonal = c- (? En +? Da) / 2
Right diagonal(우대각선) = f-(△cn+△ba)/2Right diagonal = f- (? Cn +? Ba) / 2
즉, 비교기(233)는 각 방향에 대해 가장 작은 상관값을 갖는 방향을 선택하는 제어신호를 제1 멀티플렉서(234a)와 제2 멀티플렉서(234b)로 먼저 출력하면, 수학식 2와 같이 제1 멀티플렉서(234a)와 제2 멀티플렉서(234b)는 그와 관련된 방향의 상관값(gradient)을 가산기(235)로 각각 출력하고, 가산기(235)는 각 상관값을 가산하여 시프터(236)로 출력하게 된다. 시프터(236)는 가산기(235)로부터 입력된 값을 1비트 라이트 시프트(right shift)하여, 즉 입력값을 1/2로 줄여서 제3 감산기(238)로 출력하게 된다. That is, the
한편, 제3 멀티플렉서(237)는 비교기(233)로부터 입력된 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 근접한 소정 방향의 픽셀에 대한 오차 보상데이터를 제3 감산기(238)로 출력하게 된다. 이에 따라 제3 감산기(238)는 제3 멀티플렉서(237)와 시프터(236)로부터 입력된 데이터를 감산하여 클리핑부(239)로 출력하게 된다.The
클리핑부(239)는 제3 감산기(238)로부터 입력된 예측데이터를 미리 설정된 0 내지 255값의 범위로 제한한 후 감산기(240)로 출력하게 된다. The
상기에서 이미지를 실제로 압축할 경우 매크로블록 단위로 압축하기 때문에 참조할 픽셀이 없는 경우가 존재하는데 이 경우에는 방향 예측이 불가능하다. 이 경우의 픽셀들은 압축율을 높이기 위해서 DPCM(Differential Pulse Coded Modulation)을 이용하여 예측한다. 즉, 블록의 첫 번째 픽셀은 예측할 수 없지만 수평방향의 첫번째 줄과 수직방향의 첫번째 줄은 각각의 이전 픽셀을 이용하여 예측하는 것이 바람직하다.In the above case, when the image is actually compressed, there is a case where there is no pixel to be referred to because it is compressed in units of macroblocks. In this case, direction prediction is impossible. In this case, the pixels are predicted using Differential Pulse Coded Modulation (DPCM) to increase the compression ratio. That is, although the first pixel of the block is unpredictable, it is desirable to predict the first line in the horizontal direction and the first line in the vertical direction using each previous pixel.
한편, 도 3의 압축장치에서 압축효율을 높이기 위해서는 최적의 부호화 파라미터인 k를 구해야 한다. 따라서, 파라미터계산기(270)는 공간예측기(230)의 시프터(236)에서 출력되는 데이터를 입력받아 비트수를 계산한 후 계산된 비트수를 부호화 파라미터인 k값으로 결정하여 부호화기(280)로 전달하게 된다. On the other hand, in order to increase the compression efficiency in the compression apparatus of FIG. 3, it is necessary to find an optimal encoding parameter k. Therefore, the
즉, 공간예측기(230)의 시프터(236)에서 출력되는 데이터(Pe)는 각 방향(horizontal, vertical, left diagonal 및 right diagonal)에 따라 아래 수학식 4와 같으며, 파라미터계산기(270)는 상기 수학식 4에 의해 출력된 데이터(Pe)의 비트수를 체크하여 부호화 파라미터로 정한다.That is, the data Pe output from the
Vertical: Pe = (△dn+△ca)/2Vertical: Pe = (? Dn +? Ca) / 2
Left Diagonal: Pe = (△en+△da)/2Left Diagonal: Pe = (? En +? Da) / 2
Right Diagonal: Pe = (△cn+△ba)/2Right Diagonal: Pe = (? Cn +? Ba) / 2
도 7은 손실팩터선택기(260)에서 하나의 매크로블록에 대한 손실팩터를 정하는 과정을 설명하기 위해 나타낸 플로우챠트로서, 도 3을 참조하여 살펴보면 아래와 같다.FIG. 7 is a flow chart for explaining a process of determining a loss factor for one macroblock in the
영상처리 칩의 종류에 따라 슬라이스(slice) 또는 라지 매크로블록(Large Macroblock; LMB) 단위로 영상을 라이트(write) 및 리드(read)할 수 있다. 어떤 경 우 2가지 모두 필요한 경우도 있다. 상기 슬라이스(slice)와 라지 매크로블록(Large Macroblock; LMB)은 도 8에 도시된 바와 같다. 예컨대, 이미지에서 한 행의 매크로블록(Macroblock; MB)들이 하나의 슬라이스가 되고, 16개의 매크로블록들이 하나의 라지 매크로블록이 될 수 있으며, 하나의 슬라이스는 복수의 라지 매크로블록에 포함될 수 있다. An image can be written and read in units of a slice or a large macro block (LMB) according to the type of image processing chip. In some cases, both are necessary. The slice and the large macroblock (LMB) are as shown in FIG. For example, one row of macroblocks (MB) in the image may be one slice, and sixteen macroblocks may be one large macro-block, and one slice may be included in a plurality of large macroblocks.
따라서, 칩 관점에서 보면 slice와 LMB 단위로 메모리 대역폭이 일정하도록 만드는 것이 필요하다. 도 7은 이를 위해 제안된 알고리즘으로 매크로블록 단위로 손실팩터를 조절하여 주어진 압축 비트량을 맞춘다. 즉, 매크로블록 내의 모든 픽셀은 동일한 손실팩터를 갖는다.Therefore, from a chip point of view, it is necessary to make the memory bandwidth constant in slice and LMB units. FIG. 7 shows a proposed algorithm for adjusting the loss factor in units of macroblocks to adjust a given amount of compressed bits. That is, all pixels in a macroblock have the same loss factor.
먼저, 손실팩터선택기(260)의 비트수카운터(262)는 부호화기(280)에서 출력되는 모든 픽셀의 오차데이터의 비트수를 카운트하게 되는 데, 상기 카운트값은 각 매크로블록을 포함한 슬라이스 단위와 상기 매크로블록을 포함하는 LMB 단위로 카운트하여 누적하게 된다(S1). 즉, 비트수카운터(262)에는 하나의 슬라이스 카운터와 상기 슬라이스를 포함하는 복수의 LMB 카운터가 별도로 존재할 수 있다.First, the number-of-bits counter 262 of the
이와 같은 상태에서 손실팩터계산부(263)는 목표비트저장부(261)에 저장된 매크로블록의 목표 비트량(target bits)을 기준으로 매크로블록, 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 각각 계산하게 된다(S2).In this state, the
상기 잉여비트수란 이전 매크로블록(MB)까지 발생한 비트수(발생비트수)가 이전 매크로블록들에 할당된 비트수(타깃비트수)보다 얼마나 적은지를 나타내는 값으로 이 값이 0보다 작으면 손실팩터를 높여 매크로블록의 계조데이터를 더 압축시 켜야 함을 의미한다.The number of redundant bits is a value indicating whether the number of bits (number of generated bits) generated up to the previous macroblock (MB) is smaller than the number of bits (target bits) allocated to the previous macroblocks. It means that the gray level data of the macroblock must be further compressed by increasing the factor.
상기 슬라이스 및 LMB에 대한 현재 잉여비트수는 아래 수학식 5에 구해진다.The current number of redundant bits for the slice and the LMB is obtained from the following equation (5).
현재 slice_잉여비트수=이전 slice_잉여비트수+(MB_타깃비트수-MB_발생비트수)Current number of slice_three bits = number of previous slice_three bits + (number of MB_target bits - number of MB_breaking bits)
상기 수학식 5의 MB_타깃비트수(target bits)는 각각 슬라이스와 LMB의 대역폭 제한을 매크로블록으로 환산한 값이다.The MB_target bits in Equation (5) are values obtained by converting the bandwidth limitation of the slice and the LMB into macroblocks.
상기에서 손실팩터를 정할 때 슬라이스 또는 LMB의 잉여비트수를 고려하는 이유는 압축 효율도 높이고 화질의 신뢰성도 높이기 위함이다. 예컨대, 매크로블록의 타깃비트수를 100으로 설정하였을 경우 동일한 슬라이스에서 제1 매크로블록의 발생비트수가 90이고 제2 매크로블록의 발생비트수가 110일 경우, 단지 매크로블록의 타깃비트수만 고려한다면 제3 매크로블록은 제2 매크로블록의 발생비트수에 의해 발생비트수가 90이 되도록 손실팩터를 정해야 한다. 하지만, 본 발명에서는 슬라이스내의 잉여비트수를 고려함에 따라 제1 및 제2 매크로블록의 잉여비트수는 0(10+(100-110))이 되므로 제3 매크로블록의 발생비트수가 목표비트수인 100이 되도록 손실팩터를 정할 수가 있다. 이와 같은 방식은 매크로블록별로 목표비트수에 맞추어 무리하게 압축함에 따라 화질이 악화되는 것을 방지할 수 있다.The reason for considering the number of redundant bits of the slice or LMB when determining the loss factor is to increase the compression efficiency and increase the reliability of the image quality. For example, when the number of target bits of a macroblock is set to 100, if the number of generated bits of the first macro block is 90 and the number of generated bits of the second macro block is 110 in the same slice, The macroblock must determine the loss factor so that the number of generated bits is 90 due to the number of generated bits of the second macroblock. However, according to the present invention, considering the number of redundant bits in the slice, the number of redundant bits of the first and second macroblocks is 0 (10 + (100-110)), so that the number of generated bits of the third macroblock is the target number of
따라서, 손실팩터계산부(263)는 상기와 같이 구해진 현재 매크로블록이 속한 슬라이스 또는 LMB의 잉여비트수를 체크하여 0보다 같거나 작은지 또는 큰지를 비교 판단하게 된다(S3).Accordingly, the
만일, 현재 슬라이스 또는 LMB의 잉여비트수가 0보다 같거나 작을 경우 다음 매크로블록의 손실팩터를 현재의 손실팩터보다 1비트 증가시켜 압축률을 증가시키게 되고(S4), 현재 슬라이스 또는 LMB의 잉여비트수가 0보다 클 경우 다음 매크로블록의 손실팩터를 현재의 손실팩터보다 1비트 감소시켜 압축률을 감소시키게 된다(S5).If the number of redundant bits of the current slice or LMB is equal to or smaller than 0, the loss factor of the next macroblock is increased by 1 bit from the current loss factor to increase the compression ratio (S4). If the number of redundant bits of the current slice or LMB is 0 The loss factor of the next macroblock is reduced by 1 bit from the current loss factor to reduce the compression ratio (S5).
아울러, 손실팩터계산부(263)는 변화도계산부(265)로부터 입력된 블록 변화도(activity)에 대한 데이터를 미리 설정된 기준값과 비교하여 같거나 작으면 블록 변화도가 작은 것으로 판단하고, 변화도 데이터가 기준값보다 클 경우에는 블록 변화도가 높은 것으로 판단한다(S6, S7).The
상기에서 변화도계산부(265)는 특정 픽셀 또는 매크로블록을 기준으로 주변 픽셀 또는 매크로블록의 상관관계를 통해 변화도를 계산한다. 예컨대, 특정 픽셀(i)을 기준으로 상하좌우에 각각 a, b, c 및 d픽셀이 있다고 가정할 경우 변화도는 의 식에 의해 구해질 수 있다.The change
이어, 손실팩터계산부(263)는 계산된 블록 변화도에 따라 손실팩터를 조정하게 되는 데, 만일 변화도가 낮을 경우 손실팩터를 낮추어 압축률을 감소시킨다(S8). 이는 평탄한 영역에서 손실이 발생되면 블로킹 아티팩트(Blocking Artifact)가 더 잘 띄기 때문에 이를 줄이기 위해서 필요하다. Then, the
마지막으로 손실팩터계산부(263)는 구해진 압축 손실팩터를 미리 설정된 최소값(min_LP)과 최대값(max_LP)의 범위 이내로 클리핑(S9)시킨 후 클리핑된 손실팩터를 다음 매크로블록의 손실팩터로 결정한다(S10). 상기에서 블록내 상관성이 적은 픽셀이거나 목표비트수가 너무 작게 설정된 경우에는 한계 메모리 대역폭을 만족시키지 못하는 경우가 발생할 수 있는 데, 이 경우에는 손실팩터의 최대값(max_LP)을 높게 설정하면 이러한 경우를 방지할 수 있다.Finally, the
이와 같이 구성된 압축장치는 기존의 JPEG-LS나 PNG와 같은 알고리즘과 비교하여 처리 시간 및 하드웨어 복잡성을 줄이면서, 거의 화질의 손실없이 대역폭 감축을 얻을 수 있다. 또한, 이와 같은 압축장치를 각종 영상 가전이나 포터블 미디어 기기 및 디지털 방송 등 여러 응용분야의 영상처리 칩에 적용할 경우 가격 경쟁력 강화 및 차별화 기술 등의 큰 효과를 얻을 수 있다.Such a compression device can achieve bandwidth reduction with almost no loss of image quality, while reducing processing time and hardware complexity compared to algorithms such as JPEG-LS and PNG. In addition, when such a compression device is applied to image processing chips of various application fields such as various image appliances, portable media devices, and digital broadcasting, it is possible to obtain a great effect such as cost competitiveness enhancement and differentiation technology.
상기의 본 발명의 바람직한 실시예는 예시의 목적을 위해 개시된 것이고, 본 발명에 대한 통상의 지식을 가진 당업자라면 본 발명의 기술적 사상 내에서 다양한 수정, 변경 및 부가가 가능할 것이다. 그러므로, 이러한 수정, 변경 및 부가는 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.The foregoing preferred embodiments of the present invention have been disclosed for illustrative purposes, and those skilled in the art will appreciate that various modifications, additions and substitutions are possible within the technical scope of the present invention. Therefore, such modifications, alterations, and additions should be defined by the claims appended hereto, as well as the appended claims.
도 1은 본 발명의 일실시예에 의한 이미지 무손실 압축 시스템을 나타낸 기능 블록도이다.1 is a functional block diagram illustrating an image lossless compression system according to an embodiment of the present invention.
도 2는 본 발명에 의한 도 1의 공간예측기를 나타낸 세부 기능 블록도이다.FIG. 2 is a detailed functional block diagram of the space predictor of FIG. 1 according to the present invention.
도 3은 본 발명의 다른 실시예에 의한 이미지 손실 압축 시스템을 나타낸 기능 블록도이다.3 is a functional block diagram illustrating an image loss compression system according to another embodiment of the present invention.
도 4a 및 도 4b는 도 3의 블록버퍼와 라인버퍼에 저장된 데이터를 설명하기 위해 도시한 도면이다.4A and 4B are diagrams for explaining data stored in the block buffer and the line buffer of FIG.
도 5는 본 발명의 일실시예에 의한 도 3의 공간예측기를 나타낸 세부 기능 블록도이다.5 is a detailed functional block diagram illustrating the spatial predictor of FIG. 3 according to an embodiment of the present invention.
도 6은 본 발명의 다른 실시예에 의한 도 3의 공간예측기를 나타낸 세부 기능 블록도이다.6 is a detailed functional block diagram illustrating the spatial predictor of FIG. 3 according to another embodiment of the present invention.
도 7은 도 3의 손실팩터선택기가 손실팩터를 구하는 과정을 나타낸 플로우챠트이다.FIG. 7 is a flowchart illustrating a loss factor estimation process of the loss factor selector of FIG. 3. FIG.
도 8은 이미지의 매크로블록과 슬라이스 및 라지 매크로블록을 설명하기 위해 도시한 도면이다.FIG. 8 is a diagram illustrating a macroblock of an image and a slice and a large macro block.
* 도면의 주요 부분에 대한 부호의 설명DESCRIPTION OF THE REFERENCE NUMERALS
100: 무손실 압축장치 110: 블록버퍼100: lossless compression device 110: block buffer
130: 공간예측기 150: 감산기130: Spatial predictor 150:
170: 파라미터계산기 190: 부호화기170: Parameter calculator 190: Encoder
200: 손실 압축장치 210: 블록버퍼200: lossy compression device 210: block buffer
220: 라인버퍼 230: 공간예측기220: line buffer 230: space predictor
240: 감산기 250: 손실처리기240: Subtractor 250: Loss processor
260: 손실팩터선택기 261: 목표비터저장부260: loss factor selector 261: target bitter storage unit
262: 비트수카운터 263: 손실팩터계산부262: bit number counter 263: loss factor calculation unit
265: 변화도계산부 270: 파라미터계산기265: Change calculator 270: Parameter calculator
280: 부호화기 290: 픽셀복원기280: Encoder 290: Pixel restorer
Claims (22)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020080086601A KR101519653B1 (en) | 2008-09-03 | 2008-09-03 | Image compressing apparatus of lossless and lossy type |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020080086601A KR101519653B1 (en) | 2008-09-03 | 2008-09-03 | Image compressing apparatus of lossless and lossy type |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20100027612A KR20100027612A (en) | 2010-03-11 |
KR101519653B1 true KR101519653B1 (en) | 2015-05-12 |
Family
ID=42178553
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020080086601A KR101519653B1 (en) | 2008-09-03 | 2008-09-03 | Image compressing apparatus of lossless and lossy type |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101519653B1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190039459A (en) * | 2017-10-04 | 2019-04-12 | 주식회사 스트라드비젼 | Learning method and learning device for improving performance of cnn by using feature upsampling networks, and testing method and testing device using the same |
KR102142946B1 (en) | 2019-11-08 | 2020-08-10 | 세종대학교산학협력단 | Method and apparatus for lossless image data compression using multiple dpcm |
KR20210066707A (en) | 2019-11-28 | 2021-06-07 | 울산과학기술원 | Data compressing and restoring apparatus for loseless image compression |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011155786A2 (en) * | 2010-06-09 | 2011-12-15 | 엘지전자 주식회사 | Entropy decoding method and decoding device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001095012A (en) | 1999-09-21 | 2001-04-06 | Sony Corp | Image pickup unit and method for processing color image signal |
JP2008508756A (en) | 2004-07-29 | 2008-03-21 | オセ−テクノロジーズ ビーブイ | Lossless color image data compression using entropy coding |
-
2008
- 2008-09-03 KR KR1020080086601A patent/KR101519653B1/en active IP Right Grant
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001095012A (en) | 1999-09-21 | 2001-04-06 | Sony Corp | Image pickup unit and method for processing color image signal |
JP2008508756A (en) | 2004-07-29 | 2008-03-21 | オセ−テクノロジーズ ビーブイ | Lossless color image data compression using entropy coding |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190039459A (en) * | 2017-10-04 | 2019-04-12 | 주식회사 스트라드비젼 | Learning method and learning device for improving performance of cnn by using feature upsampling networks, and testing method and testing device using the same |
KR102229342B1 (en) | 2017-10-04 | 2021-03-19 | 주식회사 스트라드비젼 | Learning method and learning device for improving performance of cnn by using feature upsampling networks, and testing method and testing device using the same |
KR102142946B1 (en) | 2019-11-08 | 2020-08-10 | 세종대학교산학협력단 | Method and apparatus for lossless image data compression using multiple dpcm |
KR20210066707A (en) | 2019-11-28 | 2021-06-07 | 울산과학기술원 | Data compressing and restoring apparatus for loseless image compression |
Also Published As
Publication number | Publication date |
---|---|
KR20100027612A (en) | 2010-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5289440B2 (en) | Image encoding device, image decoding device, image encoding method, and image decoding method | |
EP3448038B1 (en) | Decoding method for intra predicting a block by first predicting the pixels at the boundary | |
US8331449B2 (en) | Fast encoding method and system using adaptive intra prediction | |
US10812829B2 (en) | 2D block image encoding | |
RU2608674C2 (en) | Moving image encoding device, moving image decoding device, moving image encoding method and moving image decoding method | |
EP2725795B1 (en) | Image encoding device, image decoding device, image encoding method, image decoding method | |
EP3386199B1 (en) | Lossless compression method and system appled to video hard decoding | |
KR100773761B1 (en) | The apparatus and method of moving picture encoding | |
EP1551186B1 (en) | Video coding apparatus with resolution converter | |
EP2904806B1 (en) | 2d block image encoding | |
CN103118253A (en) | Dynamic image encoding device and dynamic image decoding device | |
US9883188B2 (en) | Image compression system for dynamically adjusting compression parameters by content sensitive detection in video signal | |
KR20170045013A (en) | Apparatus and method for encoding data | |
CN112702603A (en) | Video encoding method, video encoding device, computer equipment and storage medium | |
KR101519653B1 (en) | Image compressing apparatus of lossless and lossy type | |
JP5649296B2 (en) | Image encoding device | |
JPH10304381A (en) | Moving image encoding device/method | |
JP5180887B2 (en) | Encoding apparatus and method thereof | |
JP4073444B2 (en) | Video encoding device | |
JP3889013B2 (en) | Moving picture coding apparatus and moving picture coding method | |
KR100566290B1 (en) | Image Scanning Method By Using Scan Table and Discrete Cosine Transform Apparatus adapted it | |
JP2000032468A (en) | Image encoding method and recording medium with motion compensation mode selection program recorded therein | |
KR102050238B1 (en) | System and method for effectively deciding intra prediction mode for hevc encoder | |
JPH114445A (en) | Image coder and its method | |
JP7033946B2 (en) | Image coding device and image coding program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant |