KR20100027612A - Image compressing apparatus of lossless and lossy type - Google Patents
Image compressing apparatus of lossless and lossy type Download PDFInfo
- 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
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
Description
본 발명은 이미지 압축 장치에 관한 것으로, 특히 대용량의 이미지데이터로 인해 발생하는 높은 메모리 대역폭을 간단한 압축 구조를 통해 효율적으로 감축시킬 수 있는 메모리 대역폭 감축을 위한 이미지 무손실 및 손실 압축 장치에 관한 것이다.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
상기 무손실 압축장치(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)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다.As such, instead of storing the grayscale data of 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
제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)로부터 입력된 데이터의 값이 미리 설정된 기준범위를 벗어날 경우 설정된 범위의 최대값 또는 최소값으로 클리핑하여 출력한다.If the value of the data input from the
즉, 공간예측기(130)는 도시된 바와 같이 예측하고자 하는 특정 픽셀의 예측데이터(Prediction Data)를 아래 수학식 1을 이용하여 예측한다.That is, the
(|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
상기 압축장치(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 픽셀 등으로 구성될 수 있고, 각 픽셀의 데이터 비트수도 다양하게 가감될 수 있다.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)는 비트수는 서로 동일하지만, 손실에 의해 데이터는 상이할 수 있다.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)에 그대로 저장하는 것이 아니라 방향 예측 알고리즘에 따라 예측하고자 하는 특정 픽셀의 주변 픽셀간의 상관성을 이용하여 특정 픽셀에 대한 계조데이터를 예측한 후 예측된 계조데이터를 특정 픽셀의 원래 계조데이터에서 감산하여 오차데이터를 획득하고, 획득된 오차데이터를 손실팩터에 따라 설정된 목표 압축률에 적합하게 손실 압축하여 메모리에 저장하게 된다. 물론, 상기 오차데이터는 부호화 파라미터에 따라 비트수가 조정되어 메모리에 저장된다. As described above, 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 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, when 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 | 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
이와 같이 구성된 도 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
도 6에서 제1 감산부(231)는 미리 설정된 연산 알고리즘에 따라 예측하고자 하는 특정 픽셀과 관계된 주변 픽셀간의 상관성이 높은 수평, 수직 및 대각선 방향의 픽셀들에 대한 오차 보상데이터를 라인버퍼(220)로부터 각각 입력받아 상관성이 높은 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력한다. 예컨대, 제1 감산부(231)는 복수의 감산기(231a~231h)로 이루어져 있는데, 각 감산기(231a~231h)는 특정 픽셀을 기준으로 상관성이 높은 수평, 수직, 좌대각선 및 우대각선 방향에 대한 각 픽셀들끼리 감산하여 감산된 상관데이터를 각각 출력하게 된다. In FIG. 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)에서는 수평 및 수직 방향만 고려할 경우에 대각선 방향의 픽셀간 상관성이 수평 및 수직간 픽셀보다 높을 경우에는 예측 성능이 다소 감소될 수 있는 단점을 보완하기 위하여 좌측과 우측 대각선 방향까지 고려하여 특정 픽셀의 계조데이터를 예측한 것이다.In the
즉, 제1 감산부(231)와 제2 감산부(232)를 통해 아래 수학식 2와 같이 각 방향의 상관성을 예측하였다.That is, the correlation of each direction is predicted through the
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
이에 따라 비교기(233)는 수평과 수직, 좌대각선 및 우대각선을 포함한 네 가지 방향에 대한 상관데이터를 비교 계산하여 그 중 가장 작은 값을 갖는 방향을 선택하고, 선택된 방향에 대한 선택 제어신호를 각 멀티플렉서(234a 234b, 237)로 출력하게 된다. 상기에서 가장 작은 상관값은 예측하고자 하는 특정 픽셀(i)의 계조데이터에 가장 가깝다.Accordingly, the
이어, 공간예측기(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
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
한편, 제3 멀티플렉서(237)는 비교기(233)로부터 입력된 선택 제어신호에 따라 예측하고자 하는 특정 픽셀에 근접한 소정 방향의 픽셀에 대한 오차 보상데이터를 제3 감산기(238)로 출력하게 된다. 이에 따라 제3 감산기(238)는 제3 멀티플렉서(237)와 시프터(236)로부터 입력된 데이터를 감산하여 클리핑부(239)로 출력하게 된다.Meanwhile, the
클리핑부(239)는 제3 감산기(238)로부터 입력된 예측데이터를 미리 설정된 0 내지 255값의 범위로 제한한 후 감산기(240)로 출력하게 된다. The
상기에서 이미지를 실제로 압축할 경우 매크로블록 단위로 압축하기 때문에 참조할 픽셀이 없는 경우가 존재하는데 이 경우에는 방향 예측이 불가능하다. 이 경우의 픽셀들은 압축율을 높이기 위해서 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
즉, 공간예측기(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 flowchart illustrating 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개의 매크로블록들이 하나의 라지 매크로블록이 될 수 있으며, 하나의 슬라이스는 복수의 라지 매크로블록에 포함될 수 있다. 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
이와 같은 상태에서 손실팩터계산부(263)는 목표비트저장부(261)에 저장된 매크로블록의 목표 비트량(target bits)을 기준으로 매크로블록, 슬라이스 또는 LMB에 대한 잉여비트수(surplus bits)를 각각 계산하게 된다(S2).In such a state, the
상기 잉여비트수란 이전 매크로블록(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.
현재 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
만일, 현재 슬라이스 또는 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
상기에서 변화도계산부(265)는 특정 픽셀 또는 매크로블록을 기준으로 주변 픽셀 또는 매크로블록의 상관관계를 통해 변화도를 계산한다. 예컨대, 특정 픽셀(i)을 기준으로 상하좌우에 각각 a, b, c 및 d픽셀이 있다고 가정할 경우 변화도는 의 식에 의해 구해질 수 있다.In the above, the
이어, 손실팩터계산부(263)는 계산된 블록 변화도에 따라 손실팩터를 조정하게 되는 데, 만일 변화도가 낮을 경우 손실팩터를 낮추어 압축률을 감소시킨다(S8). 이는 평탄한 영역에서 손실이 발생되면 블로킹 아티팩트(Blocking Artifact)가 더 잘 띄기 때문에 이를 줄이기 위해서 필요하다. Subsequently, the
마지막으로 손실팩터계산부(263)는 구해진 압축 손실팩터를 미리 설정된 최소값(min_LP)과 최대값(max_LP)의 범위 이내로 클리핑(S9)시킨 후 클리핑된 손실팩터를 다음 매크로블록의 손실팩터로 결정한다(S10). 상기에서 블록내 상관성이 적은 픽셀이거나 목표비트수가 너무 작게 설정된 경우에는 한계 메모리 대역폭을 만족시키지 못하는 경우가 발생할 수 있는 데, 이 경우에는 손실팩터의 최대값(max_LP)을 높게 설정하면 이러한 경우를 방지할 수 있다.Finally, the
이와 같이 구성된 압축장치는 기존의 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)
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)
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)
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)
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 |
-
2008
- 2008-09-03 KR KR1020080086601A patent/KR101519653B1/en active IP Right Grant
Cited By (2)
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 |