JP2009071598A - Image processing unit - Google Patents

Image processing unit Download PDF

Info

Publication number
JP2009071598A
JP2009071598A JP2007238077A JP2007238077A JP2009071598A JP 2009071598 A JP2009071598 A JP 2009071598A JP 2007238077 A JP2007238077 A JP 2007238077A JP 2007238077 A JP2007238077 A JP 2007238077A JP 2009071598 A JP2009071598 A JP 2009071598A
Authority
JP
Japan
Prior art keywords
value
pixel
representative value
circuit
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007238077A
Other languages
Japanese (ja)
Inventor
Takashi Sasaki
尚 佐々木
Hironori Nanzaki
崎 浩 徳 南
Haruhiko Okumura
村 治 彦 奥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2007238077A priority Critical patent/JP2009071598A/en
Publication of JP2009071598A publication Critical patent/JP2009071598A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing unit efficiently making encoding without degrading image quality. <P>SOLUTION: A liquid display device is equipped with an RGB data transmitting circuit 1, an LCD(Liquid Crystal Display) source driver 2, and an LCD panel 3. The LCD source driver 2 has an RGB data receiving circuit 4, an ABD-BTC encoding circuit 5, a memory 6, an ABD-BTC decoding circuit 7, and an LCD driving circuit 8. A pixel block is made in a small size of 2×2 pixels. Thus, a simple circuit calculate an average value in the pixel block. Especially, a divider tending to have a large hardware scale can be comprised of only a 1/3 multiplier. The 1/3 multiplier can reduce the hardware scale by performing approximate calculation. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、RGBデータを符号化または復号化する画像処理装置に関する。   The present invention relates to an image processing apparatus that encodes or decodes RGB data.

ブロックトランケーション符号化(BTC:Block truncation coding)による画像圧縮技術(以下、BTC技術)は広く研究されている。BTC技術は、従来からFAX機やコピー機で使用されているが、近年は表示装置に使用される例も増えてきた。表示装置では、液晶TVのオーバードライブ技術に使用されるフレームメモリをできるだけ削減する必要があり、フレームメモリの削減のためにBTC技術が用いられる。表示装置でBTC技術が用いられることになった理由は2つある。一つの理由は、TV画像は420間引きやMPEG圧縮などで処理されており、元々動画画像自体の歪も大きく含まれており、画像劣化が大きいので、BTC圧縮してもそう大きな劣化とは認識されないためである。他の理由は、オーバードライブで必要なフレームメオリはあくまで処理に必要な参照データであり、実際にはこの他に直接データを利用して、補正量を決めるため、保存画像が劣化しても、直接データを利用することができているため、オーバードライブ補正量としての劣化はそれほど大きくないためである。   Image compression technology (hereinafter referred to as BTC technology) by block truncation coding (BTC) has been widely studied. BTC technology has been conventionally used in FAX machines and copiers, but in recent years, examples of use in display devices have increased. In the display device, it is necessary to reduce the frame memory used for the overdrive technology of the liquid crystal TV as much as possible, and the BTC technology is used to reduce the frame memory. There are two reasons why BTC technology is used in display devices. One reason is that TV images are processed by 420 decimation, MPEG compression, and the like, and originally the distortion of the moving image itself is large and the image degradation is large. Because it is not done. The other reason is that the frame memory required for overdrive is only the reference data necessary for processing.In fact, the correction amount is determined by directly using the data, so even if the stored image deteriorates. This is because since the data can be directly used, the deterioration as the overdrive correction amount is not so great.

一方、携帯電話に搭載する埋め込みRAMも、フレームメモリとして画像データを保存するが、これはそのデータを静止画として直接に利用するために、これ自体の画像劣化があると、直接的にそのエラーを発見することができてしまう。これは、BTC利用に大きな問題であり、従来はBTC利用を想定できないでいた。   On the other hand, the embedded RAM mounted on the mobile phone also stores image data as a frame memory. This is directly used as a still image. Can be found. This is a big problem for BTC use, and BTC use cannot be assumed in the past.

これに対して、本発明者は、BTCを拡張することでブロックエラーを少なくし、携帯RAMの圧縮技術として、BTCを利用できることを初めて提案した。本発明者による提案では、4×4画素ブロック処理で、VGAサイズのメモリを1/4のQVGA相当のメモリサイズに削減できる。このときの符号化ハードウェアは、25KG程度と比較的大きなサイズであり、メモリが大きく削減されたことで、その符号化器と復号化器のハードウェア増加を吸収できる。   On the other hand, the present inventor proposed for the first time that BTC can be used as a compression technique for portable RAM by reducing the block error by extending BTC. According to the proposal by the present inventor, the VGA size memory can be reduced to a quarter QVGA memory size by 4 × 4 pixel block processing. The encoding hardware at this time is a comparatively large size of about 25 KG, and the increase in hardware of the encoder and decoder can be absorbed by greatly reducing the memory.

一方、商業的な普及の割合からいえば、携帯電話用の表示装置は、まだQVGAが主力である。そこで、QVGAにBTC技術を適用することを考えたい。しかし、このとき以下の問題がある。QVGAでははじめのメモリサイズが小さいので、メモリサイズの削減よりも逆に符号化器と復号化器のハードウェアサイズ増加のほうが大きくなってしまい、削減効果を得ることができない。   On the other hand, in terms of the rate of commercial spread, QVGA is still the main display device for mobile phones. Therefore, I would like to consider applying BTC technology to QVGA. However, there are the following problems at this time. In QVGA, since the initial memory size is small, the increase in the hardware size of the encoder and decoder becomes larger than the reduction in the memory size, and the reduction effect cannot be obtained.

非特許文献1には、適応的にBTCを制御する技術が開示されている。2次元量子化(Two-Dimensional Quantization:またはJoint Coding結合符号化とも呼ばれている)は高変化領域では精度が必要ないが、低変化領域では高精度が必要である事実を利用している。2次元量子化では、平均値Xと分散σを結合させて1つの符号とすることにより、圧縮率をさらに高めている。ところが、2次元量子化を行うと、ハードウェアサイズが大きくなるという問題がある。   Non-Patent Document 1 discloses a technique for adaptively controlling BTC. Two-dimensional quantization (also called joint coding coding) is based on the fact that high accuracy is not required in the high change region, but high accuracy is required in the low change region. In the two-dimensional quantization, the compression ratio is further increased by combining the average value X and the variance σ into one code. However, when two-dimensional quantization is performed, there is a problem that the hardware size increases.

また、特許文献1には、BTC技術を液晶TVのオーバードライブ用メモリの圧縮に利用する技術が開示されている。特許文献2は、TVなどの大型の液晶TVを対象としており、厳しい画像評価基準が要求される。このため、複雑なBTCアルゴリズムが必要となる。携帯電話等の小型の表示装置は、表示サイズと解像度が限られており、特許文献1のような複雑なBTCアルゴリズムは不要である。
特開2006−208770号公報 O. R. Mitchell, E. J. Delp, “Multilevel Graphics Representation Using Block Truncation Coding,” Proceedings of the IEEE, VOL. 68, NO.7, JULY 1980, pp.868-873.
Japanese Patent Application Laid-Open No. H10-228561 discloses a technique that uses the BTC technique for compressing an overdrive memory of a liquid crystal TV. Patent Document 2 is intended for large-sized liquid crystal TVs such as TVs, and requires strict image evaluation standards. For this reason, a complicated BTC algorithm is required. A small display device such as a cellular phone has a limited display size and resolution, and does not require a complicated BTC algorithm as in Patent Document 1.
JP 2006-208770 A OR Mitchell, EJ Delp, “Multilevel Graphics Representation Using Block Truncation Coding,” Proceedings of the IEEE, VOL. 68, NO.7, JULY 1980, pp.868-873.

本発明は、画質を落とさずに効率よく符号化できる画像処理装置を提供するものである。   The present invention provides an image processing apparatus capable of efficiently encoding without degrading image quality.

本発明の一態様によれば、隣接する2×2画素からなる画素ブロックのそれぞれごとに、前記画素ブロック内の画素値の平均値を計算する平均値計算手段と、
前記画素ブロックのそれぞれごとに、前記平均値計算手段で計算された平均値より大きい上代表値と前記平均値より小さい下代表値とを計算する代表値計算手段と、
前記画素ブロックごとに、前記上代表値と前記下代表値との差分が所定の閾値より大きいか否かを判定する画像変化判定手段と、
前記画像変化判定手段により前記閾値より大きいと判定されると、画像がラフであると判断して第1の符号化データを生成し、前記画像変化判定手段により前記閾値以下と判定されると、画像が平坦であると判断して第2の符号化データを生成する符号化処理手段と、
前記第1の符号化データおよび前記第2の符号化データを格納する記憶手段と、を備え、
前記平均値計算手段は、
前記画素ブロック内の2画素ずつの画素値の和を並行して計算する第1および第2の加算器と、
前記第1の加算器の加算結果と前記第2の加算器の加算結果との和を計算する第3の加算器と、
前記第3の加算器の加算結果を表すビット列を2ビットシフトさせて、前記平均値を計算する1/4割算器と、を有し、
前記代表値計算手段は、
前記平均値と前記画素ブロック内の各画素値とを比較して、前記平均値よりも大きい画素値を累積加算した第1の累積加算値と、前記平均値以下の画素値を累積加算した第2の累積加算値とを計算する累積加算器と、
前記第1の累積加算値とその累積加算した回数とに基づいて前記上代表値を計算し、かつ前記第2の累積加算値とその累積した回数とに基づいて前記下代表値を計算する上下代表値計算手段と、を有することを特徴とする画像処理装置が提供される。
According to one aspect of the present invention, an average value calculating means for calculating an average value of pixel values in the pixel block for each of adjacent 2 × 2 pixel block,
Representative value calculating means for calculating an upper representative value larger than the average value calculated by the average value calculating means and a lower representative value smaller than the average value for each of the pixel blocks;
Image change determination means for determining whether a difference between the upper representative value and the lower representative value is greater than a predetermined threshold for each pixel block;
If it is determined by the image change determination means that it is larger than the threshold value, it is determined that the image is rough and first encoded data is generated, and if the image change determination means determines that the threshold value is equal to or less than the threshold value, Encoding processing means for determining that the image is flat and generating second encoded data;
Storage means for storing the first encoded data and the second encoded data,
The average value calculating means includes
First and second adders for calculating in parallel the sum of pixel values of every two pixels in the pixel block;
A third adder that calculates the sum of the addition result of the first adder and the addition result of the second adder;
A quarter divider that shifts the bit string representing the addition result of the third adder by 2 bits and calculates the average value;
The representative value calculating means includes:
A comparison is made between the average value and each pixel value in the pixel block, and a first cumulative addition value obtained by cumulatively adding pixel values larger than the average value, and a pixel value less than the average value are cumulatively added. A cumulative adder that calculates a cumulative added value of 2;
Upper and lower calculating the upper representative value based on the first cumulative added value and the cumulative number of times and calculating the lower representative value based on the second cumulative added value and the cumulative number of times And a representative value calculating means.

本発明によれば、画質を落とさずに効率よく符号化を行うことができる。   According to the present invention, encoding can be performed efficiently without degrading image quality.

以下、図面を参照しながら、本発明の一実施形態について説明する。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

図1は本発明の一実施形態による画像処理装置を含む液晶表示装置の概略構成を示すブロック図である。図1の液晶表示装置は、RGBデータ送信回路1と、LCD(Liquid Crystal Display)ソースドライバ2と、LCDパネル3とを備えている。LCDソースドライバ2は、RGBデータ受信回路4と、ABD−BTC符号化回路5と、メモリ6と、ABD−BTC復号化回路7と、LCD駆動回路8とを有する。本発明の一実施形態による画像処理装置は、少なくともABD−BTC符号化回路5とメモリ6を含んでいる。   FIG. 1 is a block diagram showing a schematic configuration of a liquid crystal display device including an image processing device according to an embodiment of the present invention. The liquid crystal display device of FIG. 1 includes an RGB data transmission circuit 1, an LCD (Liquid Crystal Display) source driver 2, and an LCD panel 3. The LCD source driver 2 includes an RGB data receiving circuit 4, an ABD-BTC encoding circuit 5, a memory 6, an ABD-BTC decoding circuit 7, and an LCD driving circuit 8. An image processing apparatus according to an embodiment of the present invention includes at least an ABD-BTC encoding circuit 5 and a memory 6.

RGBデータ送信回路1は、例えば不図示のホストコンピュータに内蔵されており、RGBデータを送信する。このRGBデータは、RGBデータ受信回路4により受信される。ABD−BTC符号化回路5は、後述するように、2×2画素からなる画素ブロックを単位として、RGBデータを符号化する。符号化された符号化データは、メモリ6に格納される。ABD−BTC復号化回路7は、メモリ6に格納された符号化データを元のRGBデータに復号する。LCD駆動回路8は、ABD−BTC復号化回路7で復号されたRGBデータを階調電圧に変換して、LCDパネル3の各信号線に供給する。   The RGB data transmission circuit 1 is incorporated in a host computer (not shown), for example, and transmits RGB data. The RGB data is received by the RGB data receiving circuit 4. As will be described later, the ABD-BTC encoding circuit 5 encodes RGB data in units of pixel blocks each including 2 × 2 pixels. The encoded data that has been encoded is stored in the memory 6. The ABD-BTC decoding circuit 7 decodes the encoded data stored in the memory 6 into the original RGB data. The LCD drive circuit 8 converts the RGB data decoded by the ABD-BTC decoding circuit 7 into a gradation voltage and supplies it to each signal line of the LCD panel 3.

図2はABD−BTC符号化回路5の処理手順の概略を示すフローチャートである。まず、RGBデータを入力し(ステップS1)、2×2画素の画素ブロックに分割する(ステップS2)。次に、各画素ブロックごとにRGBデータを符号化する(ステップS3)。次に、符号化して得られた符号化データを画素ブロック単位でメモリ6に格納する(ステップS4)。   FIG. 2 is a flowchart showing an outline of the processing procedure of the ABD-BTC encoding circuit 5. First, RGB data is input (step S1) and divided into 2 × 2 pixel blocks (step S2). Next, RGB data is encoded for each pixel block (step S3). Next, the encoded data obtained by encoding is stored in the memory 6 in units of pixel blocks (step S4).

図3は図2のステップS3の詳細処理の一例を示すフローチャートである。まず、画素ブロックの平均値を計算する(ステップS11)。ここでは、画素ブロックごとに、2×2=4画素のRGBデータの平均値を計算する。RGBデータの各色ごとに平均値を計算する。   FIG. 3 is a flowchart showing an example of detailed processing in step S3 of FIG. First, an average value of pixel blocks is calculated (step S11). Here, an average value of RGB data of 2 × 2 = 4 pixels is calculated for each pixel block. An average value is calculated for each color of RGB data.

次に、画素ブロックごとに、平均値より大きい上代表値と平均値以下の下代表値とを計算し、画素ブロックを構成する4画素のそれぞれを上代表値または下代表値に置き換えたビットマップデータを生成する(ステップS12)。   Next, for each pixel block, the upper representative value larger than the average value and the lower representative value below the average value are calculated, and each of the four pixels constituting the pixel block is replaced with the upper representative value or the lower representative value. Data is generated (step S12).

次に、画素ブロックの活動量を検出した結果に基づいて、上代表値と下代表値のビット精度を決定する(ステップS13)。   Next, the bit accuracy of the upper representative value and the lower representative value is determined based on the result of detecting the activity amount of the pixel block (step S13).

図4は図3のステップS11の詳細処理の一例を示すフローチャートである。まず、画素値の累積値を計算する変数SUMを0に初期化する(ステップS21)。次に、画素ブロック内の全画素の画素値を各色ごとに累積加算したか否かを判定する(ステップS22)。ステップS22がNOの場合は、まだ累積加算していない画素値を変数SUMの値に累積加算し(ステップS23)、ステップS22に戻る。ステップS22がYESの場合は、画素ブロック内の全画素値を累積加算したものと判断して、変数SUMを4で割って平均値を計算する(ステップS24)。図4では、RGBの各色ごとに、平均値SUMを計算する。   FIG. 4 is a flowchart showing an example of detailed processing in step S11 of FIG. First, a variable SUM for calculating a cumulative pixel value is initialized to 0 (step S21). Next, it is determined whether or not the pixel values of all the pixels in the pixel block are cumulatively added for each color (step S22). If step S22 is NO, the pixel value that has not been cumulatively added is cumulatively added to the value of the variable SUM (step S23), and the process returns to step S22. If step S22 is YES, it is determined that all the pixel values in the pixel block are cumulatively added, and the variable SUM is divided by 4 to calculate an average value (step S24). In FIG. 4, the average value SUM is calculated for each color of RGB.

図5は図3のステップS12の詳細処理の一例を示すフローチャートである。まず、平均値より大きい画素値の累積加算値を計算する変数SUMUと、平均値以下の画素値の累積加算値を計算する変数SUMLと、平均値より大きい画素値の数を計算する変数CNTUと、平均値以下の画素値の数を計算する変数CNTLとを、いずれも0に初期化する(ステップS31)。   FIG. 5 is a flowchart showing an example of detailed processing in step S12 of FIG. First, a variable SUMU that calculates a cumulative addition value of pixel values that are greater than the average value, a variable SUML that calculates a cumulative addition value of pixel values that are less than or equal to the average value, and a variable CNTU that calculates the number of pixel values that are greater than the average value The variable CNTL for calculating the number of pixel values below the average value is initialized to 0 (step S31).

次に、画素ブロック内の全画素について累積加算値を計算したか否かを判定する(ステップS32)。ステップS32がNOの場合は、画素ブロック内のまだ累積加算をしていない画素値(RGBデータ)を取得し、この画素値が平均値以下か否かを判定する(ステップS33)。ステップS33がYESの場合は、取得した画素値を変数SUMLに累積加算し、変数CNTLを1加算する。また、この画素についてはビットマップデータを0とする(ステップS34)。   Next, it is determined whether or not the cumulative addition value has been calculated for all the pixels in the pixel block (step S32). If step S32 is NO, a pixel value (RGB data) in the pixel block that has not been cumulatively added is acquired, and it is determined whether this pixel value is equal to or less than the average value (step S33). When step S33 is YES, the acquired pixel value is cumulatively added to the variable SUML, and 1 is added to the variable CNTL. For this pixel, the bitmap data is set to 0 (step S34).

ステップS33がNOの場合は、取得した画素値を変数SUMUに累積加算し、変数CNTUを1加算する。また、この画素についてはビットマップデータを1とする(ステップS35)。   When step S33 is NO, the acquired pixel value is cumulatively added to the variable SUMU, and 1 is added to the variable CNTU. For this pixel, the bitmap data is set to 1 (step S35).

一方、ステップS32がYESの場合は、上代表値と下代表値を以下の(1)(2)式で計算する(ステップS36)。
上代表値=変数SUMU/CNTU …(1)
下代表値=変数SUML/CNTL …(2)
On the other hand, when step S32 is YES, the upper representative value and the lower representative value are calculated by the following equations (1) and (2) (step S36).
Upper representative value = variable SUMU / CNTU (1)
Lower representative value = variable SUML / CNTL (2)

図5では、RGBの各色ごとに、上代表値と下代表値を計算し、ビットマップデータを生成する。   In FIG. 5, the upper representative value and the lower representative value are calculated for each color of RGB to generate bitmap data.

図6は図3のステップS13の詳細処理の一例を示すフローチャートである。まず、RGBの各色について、上代表値と下代表値の差分MAXDIFを計算する(ステップS41)。次に、差分MAXDIFが閾値T以下であるか否かを判定する(ステップS42)。ステップS42がYESの場合は、画素ブロックは平坦画像であると判断して、上代表値と下代表値の平均値を計算するとともに、上代表値と下代表値の差分を計算する。そして、判定フラグビットを0に設定する(ステップS43)。ステップS42がNOの場合は、画素ブロックはラフな画像であると判断して、上代表値と下代表値を丸める処理を行うとともに、判定フラグビットを1に設定する。   FIG. 6 is a flowchart showing an example of detailed processing in step S13 of FIG. First, the difference MAXDIF between the upper representative value and the lower representative value is calculated for each color of RGB (step S41). Next, it is determined whether or not the difference MAXDIF is equal to or less than a threshold value T (step S42). If YES in step S42, the pixel block is determined to be a flat image, and the average value of the upper representative value and the lower representative value is calculated, and the difference between the upper representative value and the lower representative value is calculated. Then, the determination flag bit is set to 0 (step S43). When step S42 is NO, it is determined that the pixel block is a rough image, and processing for rounding the upper representative value and the lower representative value is performed, and the determination flag bit is set to 1.

このように、図6では、画素ブロック内の画像を2種類に分類している。2種類に制限することにより、ハードウェアサイズを小さくできる。分類数を増やすと、符号化による画質劣化を抑制できるが、意図的に分類数を2種類に制限する。その理由は、本実施形態は、携帯電話等の小型のLCDパネル3の駆動を念頭に置いており、また、画素ブロックのサイズも2×2画素と小さいため、BTC符号化による丸め誤差も少ないためである。画素ブロックを2×2画素にすることにより、画素ブロックの平均値、上代表値および下代表値も容易に計算できる。   As described above, in FIG. 6, the images in the pixel block are classified into two types. By limiting to two types, the hardware size can be reduced. Increasing the number of classifications can suppress image quality deterioration due to encoding, but intentionally limits the number of classifications to two. The reason is that this embodiment is designed to drive a small LCD panel 3 such as a mobile phone, and the pixel block size is as small as 2 × 2 pixels, so that rounding errors due to BTC encoding are small. It is. By making the pixel block 2 × 2 pixels, the average value, the upper representative value, and the lower representative value of the pixel block can be easily calculated.

平均値や代表値を計算する際に、2や4で割る計算は、ビット列を1ビットあるいは2ビットシフトするだけでよく、実際の割算処理を行わなくても計算可能である。また、3で割る処理も、後述するように比較的簡易な計算で得られる。   When calculating the average value or the representative value, the calculation of dividing by 2 or 4 is only required to shift the bit string by 1 bit or 2 bits, and can be performed without performing actual division processing. Also, the process of dividing by 3 can be obtained by relatively simple calculation as will be described later.

図7(a)は画像の閾値を3通りに変化させて二値化した例を示す図であり、図7(a)の左側縦列の画像は二値化後のデータ、図7(a)の右側縦列の画像は元画像を示している。人間の視覚は8ビット以上の高階調を識別できるが、画素ごとに8ビット精度で差異を識別できるわけではなく、ある程度の広がりを持った面と面で比較して初めて8ビット精度の識別力が得られる。小さい画素の集まりになるほど、ビット精度は必要なくなる。この視覚の特性を利用したのがBTCである。   FIG. 7A is a diagram showing an example of binarization by changing the threshold value of the image in three ways, and the image in the left column in FIG. 7A is the data after binarization, FIG. The images in the right-hand column indicate the original images. Although human vision can identify high gradations of 8 bits or more, it cannot distinguish differences with 8-bit accuracy for each pixel. Is obtained. The smaller the collection of pixels, the less bit accuracy is required. BTC uses this visual characteristic.

このような人間の視覚の特性を考慮すると、青空のように極めて近い値が広い範囲でまとまっている平坦な領域に対してのみ、8ビット精度が必要であり、地面のような変化が激しいラフな領域では、8ビット精度は必要ないことがわかる。   Considering such human visual characteristics, 8-bit precision is required only for a flat region in which extremely close values such as a blue sky are gathered in a wide range, and rough changes such as the ground are severe. It can be seen that 8-bit precision is not necessary in such a region.

図7(a)の左側縦列の画像では、2×2画素単位で閾値との比較を行い、平坦と判定された2×2画素を白、ラフと判定された2×2画素を黒で表している。活動の大きさは、2×2画素中の4画素における最大値と最小値の差分と定義している。この差分は、RGBの各色ごとに存在する。   In the left column image of FIG. 7A, the threshold value is compared in units of 2 × 2 pixels, and 2 × 2 pixels determined to be flat are expressed in white, and 2 × 2 pixels determined as rough are expressed in black. ing. The magnitude of the activity is defined as the difference between the maximum value and the minimum value in 4 pixels out of 2 × 2 pixels. This difference exists for each color of RGB.

ここでは、RGBの全色において平坦の場合に平坦と定義する。RGBの一色でも平坦でなければラフと定義する。このような定義は適宜変更してもよい。   Here, when all the RGB colors are flat, it is defined as flat. If even one color of RGB is not flat, it is defined as rough. Such a definition may be changed as appropriate.

図7(a)からわかるように、閾値T=6でも青空がカバーできることがわかる。したがって、閾値T=6で、8ビット精度を確保すべき領域が特定できる。この値を参考にして、図7(a)における閾値が経験的に決定される。   As can be seen from FIG. 7A, the blue sky can be covered even with the threshold T = 6. Therefore, it is possible to specify an area where 8-bit accuracy should be secured with the threshold T = 6. With reference to this value, the threshold value in FIG. 7A is empirically determined.

正確に言えば、図7(a)の閾値は、最大最小の幅ではなく、上代表値と下代表値の差分である。しかしながら、経験的には同様に振る舞うため、計算上は代表値の差分の閾値を閾値Tとする。   Strictly speaking, the threshold value in FIG. 7A is not the maximum and minimum width but the difference between the upper representative value and the lower representative value. However, since it behaves in the same way empirically, the threshold value of the difference between the representative values is set as the threshold value T in the calculation.

図7(b)はラフな画像の画素値の一例を示す図、図7(c)は平坦な画像の画素値の一例を示す図である。ラフな画像の場合は、図7(b)のように、差分の大きな2つの画素値で表現できる。また、平坦な画像の場合は、図7(c)のように、2×2画素のそれぞれを差分が小さい4つの画素値で表現できる。   FIG. 7B is a diagram illustrating an example of a pixel value of a rough image, and FIG. 7C is a diagram illustrating an example of a pixel value of a flat image. In the case of a rough image, it can be expressed by two pixel values having a large difference as shown in FIG. In the case of a flat image, each 2 × 2 pixel can be expressed by four pixel values having small differences as shown in FIG.

図8はラフな画像の符号化を説明する図である。この場合の符号化データは、RGBの各色ごとに、上代表値および下代表値と、画素ブロックを表すビットマップとを含む。R画素を例に取って説明する。下代表値の5ビット01010は、下位3ビットを省略したものであり、実際のデータは01010000(バイナリ)である。数値的には、64+16=80を表す。   FIG. 8 is a diagram for explaining rough image coding. The encoded data in this case includes an upper representative value and a lower representative value and a bitmap representing a pixel block for each color of RGB. A description will be given by taking an R pixel as an example. The lower representative value of 5 bits 01010 is obtained by omitting the lower 3 bits, and the actual data is 01010000 (binary). Numerically, it represents 64 + 16 = 80.

後述するが、符号化データをデコードする際には、オフセットを加えて、符号化による丸めをさらに調整する。オフセットとしては、例えば4を加えて、画素値が80なら84に、画素値が168なら172に変換する。   As will be described later, when decoding encoded data, an offset is added to further adjust rounding by encoding. As an offset, for example, 4 is added and converted to 84 if the pixel value is 80, and to 172 if the pixel value is 168.

図8の例では、RGBの各色とも、2×2画素の画素ブロックのビットマップが1010であり、ビットマップ中の1は画素値172に対応し、0は画素値168に対応する。   In the example of FIG. 8, the bitmap of a pixel block of 2 × 2 pixels is 1010 for each color of RGB, 1 in the bitmap corresponds to the pixel value 172, and 0 corresponds to the pixel value 168.

符号化前は、RGBの各色とも8ビットであるため、2×2画素では、4×8×3=96ビット必要であった。これに対して図8のような符号化を行うと、上代表値と下代表値のそれぞれに5ビットで、ビットマップに4ビットが必要なため、RGBの全色では、(10+4)×3=42ビットに圧縮できる。結局、ビット数を42/96=約44%に圧縮できる。   Before encoding, each RGB color is 8 bits, so 2 × 2 pixels require 4 × 8 × 3 = 96 bits. On the other hand, when encoding as shown in FIG. 8 is performed, 5 bits are required for each of the upper representative value and the lower representative value, and 4 bits are required for the bitmap. Therefore, for all the RGB colors, (10 + 4) × 3 = 42 bits can be compressed. Eventually, the number of bits can be compressed to 42/96 = about 44%.

図9は図8で説明した符号化により得られる符号化データのビット列を示す図である。符号化データの先頭ビットには、ラフな画像を意味する判定フラグビット1が追加される。判定フラグビットに続けて、代表値を表す10×3ビットと、ビットマップを表す4×3ビットが配置される。図9の符号化データは、図1のメモリ6に格納される。   FIG. 9 is a diagram showing a bit string of encoded data obtained by the encoding described in FIG. A determination flag bit 1 meaning a rough image is added to the first bit of the encoded data. Following the determination flag bit, 10 × 3 bits representing a representative value and 4 × 3 bits representing a bitmap are arranged. The encoded data in FIG. 9 is stored in the memory 6 in FIG.

図10は平坦な画像の符号化を説明する図である。この場合の符号化データは、RGBの各色ごとに、中央値と、中央値からの差分値とを含む。中央値はビット精度を高めるために8ビットであり、差分値は2ビットである。図10の例では、中央値が01010101(バイナリ)=85で、差分値が10(バイナリ)=3である。したがって、上代表値=85+3=88、下代表値=85−3=82となる。ビットマップは、図9と同様である。   FIG. 10 is a diagram for explaining encoding of a flat image. The encoded data in this case includes a median value and a difference value from the median value for each color of RGB. The median value is 8 bits to increase bit accuracy, and the difference value is 2 bits. In the example of FIG. 10, the median is 01010101 (binary) = 85, and the difference value is 10 (binary) = 3. Therefore, the upper representative value = 85 + 3 = 88 and the lower representative value = 85−3 = 82. The bitmap is the same as in FIG.

RGBの各色ごとに、中央値が8ビット、差分値が2ビット、ビットマップが4ビットであり、合計(8+2+4)×3=42ビットになる。   For each RGB color, the median value is 8 bits, the difference value is 2 bits, and the bitmap is 4 bits, for a total of (8 + 2 + 4) × 3 = 42 bits.

図11は図10で説明した符号化により得られる符号化データのビット列を示す図である。符号化データの先頭ビットには、平坦な画像を意味する判定フラグビット0が追加される。判定フラグビットに続いて、R画素の中央値と差分値、G画素の中央値と差分値、B画素の中央値と差分値、ビットマップが順に配置される。   FIG. 11 is a diagram showing a bit string of encoded data obtained by the encoding described in FIG. A determination flag bit 0 indicating a flat image is added to the first bit of the encoded data. Following the determination flag bit, the median value and difference value of the R pixel, the median value and difference value of the G pixel, the median value and difference value of the B pixel, and the bitmap are sequentially arranged.

図8と図10からわかるように、ラフな画像でも平坦な画像でも、総ビット数は同じ42+1=43ビットになる。   As can be seen from FIGS. 8 and 10, the total number of bits is the same 42 + 1 = 43 bits for both rough and flat images.

図12は画素値0と255で構成されたラフな画像のオフセット調整を説明する図である。ラフな画像は上代表値と下代表値をともに5ビットで表現するため、2×2画素の画素ブロック内の最大値は11111で最小値は00000になる。実際には下位3ビット000が付加されるため、最大値は248で、最小値は0になる。これら最大値と最小値にともにオフセット4が加算されて、上代表値=248+4=252になり、下代表値=0+4=4になる。   FIG. 12 is a diagram for explaining offset adjustment of a rough image composed of pixel values 0 and 255. FIG. In a rough image, the upper representative value and the lower representative value are both expressed by 5 bits, and therefore the maximum value in the 2 × 2 pixel block is 11111 and the minimum value is 00000. Actually, since the lower 3 bits 000 are added, the maximum value is 248 and the minimum value is 0. The offset 4 is added to both the maximum value and the minimum value, so that the upper representative value = 248 + 4 = 252 and the lower representative value = 0 + 4 = 4.

図13および図14は画素値127,129,125,131で構成された平坦な画像のオフセット調整を説明する図である。これら4つの画素値の平均値は128であり、平均値よりも大きい画素値の平均値は130であり、これが上代表値となる。また、平均値以下の画素値の平均値は126であり、これが下代表値となる。   13 and 14 are diagrams for explaining offset adjustment of a flat image composed of pixel values 127, 129, 125, and 131. FIG. The average value of these four pixel values is 128, and the average value of pixel values larger than the average value is 130, which is the upper representative value. Further, the average value of pixel values equal to or less than the average value is 126, which is the lower representative value.

このように、上代表値と下代表値はいずれも、全体の平均値から2だけずれている。丸め計算を考えると、上代表値と平均値との差分が、下代表値と平均値との差分に必ず一致するわけではないが、誤差が生じても、たかだか1だけの差分であるため、この誤差を許容する。そこで、実際には、平均値より上または下の画素値を利用して差分を計算する。   Thus, both the upper representative value and the lower representative value are deviated by 2 from the overall average value. Considering the rounding calculation, the difference between the upper representative value and the average value does not necessarily match the difference between the lower representative value and the average value, but even if an error occurs, it is a difference of only 1 at most. This error is allowed. Therefore, in practice, the difference is calculated using pixel values above or below the average value.

図13の画素ブロックの場合、図14に示すように、中央値は10000000(バイナリ)=128で、差分は10(バイナリ)=2となる。ビットマップは0101である。上代表値=128+2=130、下代表値=128−2=126になる。   In the case of the pixel block of FIG. 13, the median is 10000000 (binary) = 128 and the difference is 10 (binary) = 2, as shown in FIG. The bitmap is 0101. Upper representative value = 128 + 2 = 130, lower representative value = 128−2 = 126.

次に、上記の処理手順で符号化を行ってメモリ6に格納された符号化データを復号する処理手順について説明する。   Next, a processing procedure for performing the encoding according to the above processing procedure and decoding the encoded data stored in the memory 6 will be described.

図15は図1のABD−BTC復号化回路7の処理手順の概略を示すフローチャートである。まず、メモリ6から符号化データを読み出す(ステップS51)。次に、画素ブロックごとに、画素ブロック内の符号化データを復号する(ステップS52)。次に、画素ブロックを単位とした画素値から全体画像の画素値に変換する(ステップS53)。次に、変換した画素値を保存する(ステップS54)。   FIG. 15 is a flowchart showing an outline of the processing procedure of the ABD-BTC decoding circuit 7 of FIG. First, encoded data is read from the memory 6 (step S51). Next, the encoded data in the pixel block is decoded for each pixel block (step S52). Next, the pixel value with the pixel block as a unit is converted into the pixel value of the entire image (step S53). Next, the converted pixel value is stored (step S54).

図16は図15のステップS52の詳細処理の一例を示すフローチャートである。まず、符号化データの先頭ビットである判定フラグビットを抽出する(ステップS61)。この判定フラグビットの値により、平坦な画像かラフな画像かを判別できる。   FIG. 16 is a flowchart showing an example of detailed processing in step S52 of FIG. First, the determination flag bit that is the first bit of the encoded data is extracted (step S61). Based on the value of the determination flag bit, it is possible to determine whether the image is flat or rough.

次に、判定フラグの後に配置されているビット列(代表値、差分、ビットマップなど)を取得する(ステップS62)。より詳細には、判定フラグビットが1の場合は、上代表値、下代表値およびビットマップを取得する。判定フラグビットが0の場合は、中央値、差分値、ビットマップを取得する。   Next, a bit string (representative value, difference, bitmap, etc.) arranged after the determination flag is acquired (step S62). More specifically, when the determination flag bit is 1, the upper representative value, the lower representative value, and the bitmap are acquired. When the determination flag bit is 0, a median value, a difference value, and a bitmap are acquired.

次に、ステップS62で取得したビット列に基づいて、符号化前の画素値を復元する(ステップS63)。   Next, the pixel value before encoding is restored based on the bit string acquired in step S62 (step S63).

図17は図15のステップS53の詳細処理の一例を示すフローチャートである。まず、判定フラグビットに基づいて、上代表値と下代表値を計算し、ラフな画像の場合には8ビットに拡張する処理を行う(ステップS71)。このとき、オフセット加算処理も行う。   FIG. 17 is a flowchart showing an example of detailed processing in step S53 of FIG. First, based on the determination flag bit, the upper representative value and the lower representative value are calculated, and in the case of a rough image, a process of extending to 8 bits is performed (step S71). At this time, offset addition processing is also performed.

次に、画素ブロック内の全画素についてステップS71の処理を行ったか否かを判定し(ステップS72)、まだ処理を行っていない画素が存在する場合には、ビットマップ中の対応するビットが0か否かを判定する(ステップS73)。判定がYESの場合は、下代表値を画素値として選択し(ステップS74)、判定がNOの場合は、上代表値を画素値として選択する(ステップS75)。   Next, it is determined whether or not the processing in step S71 has been performed for all the pixels in the pixel block (step S72). If there is a pixel that has not yet been processed, the corresponding bit in the bitmap is 0. Is determined (step S73). If the determination is YES, the lower representative value is selected as the pixel value (step S74), and if the determination is NO, the upper representative value is selected as the pixel value (step S75).

ステップS74またはS75の処理が終了すると、ステップS72に戻り、ステップS72の判定がYESの場合には処理を終了する。   When the process of step S74 or S75 ends, the process returns to step S72, and when the determination of step S72 is YES, the process ends.

図18は圧縮率とPSNR(Peak Signal Noise Ratio)の関係を示す図である。PSNRは、100画像の統計的な結果を示す。No.1は従来のBTCを利用した2×2画素の符号化を示し、No.2は本実施形態による2×2画素の符号化を示し、No.3は従来のBTCを利用した4×4画素の符号化を示し、No.4はMoMA−BTCを利用した4×4画素の符号化を示し、No.5はDCM4(単純間引き)による符号化を示している。   FIG. 18 is a diagram showing the relationship between the compression ratio and PSNR (Peak Signal Noise Ratio). PSNR shows the statistical result of 100 images. No. 1 shows 2 × 2 pixel encoding using conventional BTC. 2 shows 2 × 2 pixel encoding according to the present embodiment. 3 shows encoding of 4 × 4 pixels using conventional BTC. 4 shows 4 × 4 pixel encoding using MoMA-BTC. Reference numeral 5 denotes encoding by DCM4 (simple decimation).

No.1は圧縮率が2を超えておらず、圧縮効率が悪いことから、望ましくない。No.3および4は、PSNR値が低いことから、画質が悪く、望ましくない。   No. 1 is not desirable because the compression ratio does not exceed 2 and the compression efficiency is poor. No. 3 and 4 are not desirable because the PSNR value is low and the image quality is poor.

一方、No.2に示す本実施形態は、予め画像をラフか平坦かに分類して、実質的に8ビット精度が得られるようにし、かつPSNR値も高く維持し、ハードウェア規模も小さくできるため、望ましい。   On the other hand, no. The present embodiment shown in FIG. 2 is desirable because images are classified into rough or flat in advance so that an 8-bit accuracy can be obtained substantially, the PSNR value is maintained high, and the hardware scale can be reduced.

本実施形態は、携帯電話等に使用されるQVGAタイプのLCDパネル3の表示制御を行うことを念頭に置いており、メモリ6の容量をできるだけ削減しつつ、画質の劣化をできるだけ抑制する必要性があることから、上記No.2が最も望ましい。   In the present embodiment, the display control of the QVGA type LCD panel 3 used for a mobile phone or the like is performed in mind, and it is necessary to reduce the capacity of the memory 6 as much as possible and suppress deterioration in image quality as much as possible. Therefore, the above No. 2 is most desirable.

図19は液晶表示装置の一変形例を示すブロック図である。図19では、図1と共通する構成部分には同一符号を付しており、以下では相違点を中心に説明する。図19の液晶表示装置は、LCDソースドライバ2aの他にコントローラ(アプリケーションプロセッサ)11を備えており、このコントローラ11は、ABD−BTC符号化回路5と、圧縮データ送信回路12とを有する。LCDソースドライバ2aは、圧縮データ受信回路13と、メモリ6と、ABD−BTC復号化回路7と、LCD駆動回路8とを有する。   FIG. 19 is a block diagram showing a modification of the liquid crystal display device. In FIG. 19, the same components as those in FIG. 1 are denoted by the same reference numerals, and different points will be mainly described below. The liquid crystal display device of FIG. 19 includes a controller (application processor) 11 in addition to the LCD source driver 2 a. The controller 11 includes an ABD-BTC encoding circuit 5 and a compressed data transmission circuit 12. The LCD source driver 2 a includes a compressed data receiving circuit 13, a memory 6, an ABD-BTC decoding circuit 7, and an LCD driving circuit 8.

圧縮データ送信回路12は、ABD−BTC符号化回路5で符号化した符号化データをLCDソースドライバ2aに送信する。圧縮データ受信回路13は、符号化データを受信して、メモリ6に格納する。   The compressed data transmission circuit 12 transmits the encoded data encoded by the ABD-BTC encoding circuit 5 to the LCD source driver 2a. The compressed data receiving circuit 13 receives the encoded data and stores it in the memory 6.

このように、図19は、LCDソースドライバ2a内にABD−BTC符号化回路5を持たないため、LCDソースドライバ2aの内部構成を簡略化でき、LCDソースドライバ2aの小型化と消費電力の削減が図れる。また、コントローラ11とLCDソースドライバ2aは、圧縮された符号化データを送受するため、転送データ量を抑制でき、配線本数やEMIノイズが増大するおそれはない。   19 does not have the ABD-BTC encoding circuit 5 in the LCD source driver 2a, the internal configuration of the LCD source driver 2a can be simplified, and the LCD source driver 2a can be reduced in size and reduced in power consumption. Can be planned. Further, since the controller 11 and the LCD source driver 2a send and receive the compressed encoded data, the amount of transfer data can be suppressed, and there is no possibility that the number of wires and EMI noise will increase.

図20は図1または図19のABD−BTC符号化回路5の内部構成の一例を示すブロック図である。図20のABD−BTC符号化回路5は、2Hラインメモリ21と、4画素保存レジスタ22と、エンコーダ23と、圧縮データ保存レジスタ24とを有する。   FIG. 20 is a block diagram showing an example of the internal configuration of the ABD-BTC encoding circuit 5 of FIG. 1 or FIG. The ABD-BTC encoding circuit 5 in FIG. 20 includes a 2H line memory 21, a 4-pixel storage register 22, an encoder 23, and a compressed data storage register 24.

本実施形態では、2×2画素からなる画素ブロックを単位として符号化処理を行うため、2ライン分の画素データを格納する2Hラインメモリ21が必要となる。4画素保存レジスタ22は、2Hラインメモリ21に格納された2ライン分の画素データの中から、画素ブロックを構成する2×2画素の画素データを抽出する。   In the present embodiment, since the encoding process is performed in units of 2 × 2 pixel blocks, a 2H line memory 21 that stores pixel data for two lines is required. The 4-pixel storage register 22 extracts pixel data of 2 × 2 pixels constituting the pixel block from the pixel data for two lines stored in the 2H line memory 21.

エンコーダ23は、後述するように、画素ブロックを単位として符号化処理を行って、判定フラグビットと、代表値(上代表値および下代表値、差分値など)と、ビットマップを生成する。圧縮データ保存レジスタ24は、エンコーダ23が生成した各データを組合わせて生成される符号化データを一時的に格納する。圧縮データ保存レジスタ24に格納された符号化データは、メモリ6に格納される。   As will be described later, the encoder 23 performs encoding processing in units of pixel blocks, and generates determination flag bits, representative values (upper representative value, lower representative value, difference value, and the like), and a bitmap. The compressed data storage register 24 temporarily stores encoded data generated by combining the data generated by the encoder 23. The encoded data stored in the compressed data storage register 24 is stored in the memory 6.

2Hラインメモリ21を設ける代わりに、1Hラインメモリを用いることも可能である。1Hラインメモリを設ける場合は、同メモリ6に最初の1Hライン分を格納し、次の1Hライン分の画素値を取得して格納する際に符号化処理を行う。2クロックで1画素ブロック分の符号化処理を行えばよいため、1Hライン+2画素だけ保存するだけのメモリ容量があればよい。   Instead of providing the 2H line memory 21, it is also possible to use a 1H line memory. When the 1H line memory is provided, the first 1H line is stored in the memory 6, and the encoding process is performed when the pixel value for the next 1H line is acquired and stored. Since it is sufficient to perform encoding processing for one pixel block in two clocks, it is sufficient if the memory capacity is sufficient to store only 1H line + 2 pixels.

ただし、1Hラインメモリを設ける場合には、同メモリ6内のデータを毎回シフトさせる必要があり、EMIノイズや消費電力が多少増加してしまう。EMIや消費電力を削減する必要がある場合には、2Hラインメモリ21を設けるのが望ましい。   However, when the 1H line memory is provided, it is necessary to shift the data in the memory 6 every time, and EMI noise and power consumption increase somewhat. When it is necessary to reduce EMI and power consumption, it is desirable to provide the 2H line memory 21.

図21は図20のエンコーダ23の内部構成の一例を示すブロック図である。図21のエンコーダ23は、第1の階層計算器(平均値計算手段)31と、第2の階層計算器32とを有する。第1の階層計算器31は、画素ブロック内の全画素値の平均値を計算する。第2の階層計算器32は、代表値とビットマップを計算するとともに、画素ブロック内の画像の活動判定を行う。   FIG. 21 is a block diagram showing an example of the internal configuration of the encoder 23 of FIG. The encoder 23 in FIG. 21 includes a first hierarchical calculator (average value calculating means) 31 and a second hierarchical calculator 32. The first hierarchy calculator 31 calculates an average value of all the pixel values in the pixel block. The second hierarchy calculator 32 calculates representative values and bitmaps, and determines the activity of the image in the pixel block.

第1の階層計算器31は、第1の累積加算部33と、第2の累積加算部34と、平均値計算部(1/4割算器)35とを有する。第1の累積加算部33と第2の累積加算部34は、2×2画素の画素値を階層的に累積加算する。より具体的には、第1の累積加算部33は、2つの加算器(第1および第2の加算器)36を有し、各加算器36は、2画素分の画素値を加算する。第2の累積加算部34は、第1の累積加算部33内の2つの加算器36の出力同士を加算する加算器(第3の加算器)37を有する。   The first hierarchy calculator 31 includes a first cumulative adder 33, a second cumulative adder 34, and an average value calculator (¼ divider) 35. The first cumulative adder 33 and the second cumulative adder 34 cumulatively add pixel values of 2 × 2 pixels hierarchically. More specifically, the first cumulative adder 33 has two adders (first and second adders) 36, and each adder 36 adds pixel values for two pixels. The second cumulative adder 34 has an adder (third adder) 37 that adds the outputs of the two adders 36 in the first cumulative adder 33.

平均値計算部35は、第2の累積加算部34の出力ビット列を2ビットシフトすることにより、4画素分の画素値の累積加算値を4で割った値(平均値)を計算する。   The average value calculation unit 35 calculates a value (average value) obtained by dividing the cumulative addition value of the pixel values for four pixels by 4 by shifting the output bit string of the second cumulative addition unit 34 by 2 bits.

第2の階層計算器32は、第1の比較加算部41と、第2の比較加算部42と、代表値計算部43と、ビット幅設定部44とを有する。第1の比較加算部41は、2つの比較加算器45を有し、各比較加算器45は、2画素分の画素値を平均値と比較して、平均値より大きい画素値の累積加算値およびその個数と、平均値以下の画素値の累積加算値およびその個数とを計算する。第2の比較加算部42は一つの比較加算器46を有し、この比較加算器46は、第1の比較加算部41の出力に基づいて、4画素のうち、平均値より大きい画素値の累積加算値およびその個数と、平均値以下の画素値の累積加算値およびその個数とを計算する。   The second hierarchy calculator 32 includes a first comparison / addition unit 41, a second comparison / addition unit 42, a representative value calculation unit 43, and a bit width setting unit 44. The first comparison / addition unit 41 includes two comparison adders 45. Each comparison adder 45 compares the pixel values of two pixels with the average value, and the cumulative addition value of the pixel values larger than the average value. And the number thereof, the cumulative addition value of the pixel values below the average value, and the number thereof are calculated. The second comparison / addition unit 42 has one comparison / adder 46, and this comparison / adder 46 has a pixel value larger than the average value among the four pixels based on the output of the first comparison / addition unit 41. The cumulative addition value and its number, and the cumulative addition value and the number of pixel values below the average value are calculated.

代表値計算部43は、平均値より大きい画素値の累積加算値およびその個数に基づいて上代表値を計算するとともに、平均値以下の画素値の累積加算値およびその個数に基づいて下代表値を計算する。   The representative value calculation unit 43 calculates the upper representative value based on the cumulative addition value and the number of pixel values larger than the average value, and the lower representative value based on the cumulative addition value and the number of pixel values less than the average value. Calculate

第1の比較加算部41と第2の比較加算部42が累積加算器に対応し、代表値計算部43が上下代表値計算手段に対応する。また、第1の比較加算部41、第2の比較加算部42および代表値計算部43が代表値計算手段に対応する。   The first comparison / addition unit 41 and the second comparison / addition unit 42 correspond to cumulative adders, and the representative value calculation unit 43 corresponds to upper and lower representative value calculation means. The first comparison / addition unit 41, the second comparison / addition unit 42, and the representative value calculation unit 43 correspond to the representative value calculation means.

ビット幅設定部44は、上代表値と下代表値の差分に基づいて、画素ブロックの活動量を判定し、ラフな画層か平坦な画像かを判別する。その判別結果に基づいて、代表値のビット幅を決定する。   The bit width setting unit 44 determines the amount of activity of the pixel block based on the difference between the upper representative value and the lower representative value, and determines whether the image is a rough image or a flat image. Based on the determination result, the bit width of the representative value is determined.

図22は図21の第1の累積加算部33と第2の累積加算部34の内部構成の一例を示すブロック図である。第1の累積加算部33と第2の累積加算部34は、両方とも2入力の演算回路47を有する。第1の累積加算部33は、画素ブロック内の2×2画素の画素値を直接入力し、第2の累積加算部34は、2×2画素のうち2画素分ずつの画素値の加算値を入力して、4画素分の画素値の総和を出力する。   FIG. 22 is a block diagram showing an example of the internal configuration of the first cumulative adder 33 and the second cumulative adder 34 of FIG. Both the first cumulative adder 33 and the second cumulative adder 34 have a two-input arithmetic circuit 47. The first cumulative addition unit 33 directly inputs the pixel value of 2 × 2 pixels in the pixel block, and the second cumulative addition unit 34 adds the pixel values of two pixels out of 2 × 2 pixels. Is input and the sum of the pixel values for four pixels is output.

第1の累積加算部33と第2の累積加算部34は、図4に示すフローチャートに示す処理動作を行う。   The first cumulative adder 33 and the second cumulative adder 34 perform the processing operation shown in the flowchart shown in FIG.

図21の平均値計算部35におけるビット幅は、第1の累積加算部33と第2の累積加算部34の計算から2ビット増加して10ビットになる。平均値として8ビットを利用する場合には丸め処理を行う必要がある。もしくは、10ビット幅や9ビット幅で以下の計算を行うオプションもある。   The bit width in the average value calculation unit 35 of FIG. 21 is increased by 2 bits from the calculation of the first cumulative addition unit 33 and the second cumulative addition unit 34 to 10 bits. When 8 bits are used as the average value, it is necessary to perform rounding. Alternatively, there is an option to perform the following calculation with a 10-bit width or a 9-bit width.

図23は図21の第1の比較加算部41内の各比較加算器45の内部構成の一例を示すブロック図である。図23に示すように、各比較加算器45は、比較回路48と演算回路49を有し、2画素分ずつを処理する。比較回路48は、対応する2画素のそれぞれについて、画素値Aと画素ブロックの平均値MIDとを比較する。演算回路49は、比較回路48の比較結果に基づいて、平均値より大きい画素値を持つ画素のグループ(上グループ)における画素値の総和SU1(またはSU2)およびその画素数CU1(またはCU2)と、平均値以下の画素値を持つ画素のグループ(下グループ)における画素値の総和SL1(またはSL2)およびその画素数CL1(またはCL2)とを計算する。また、演算回路49は、上グループの画素を1、下グループの画素を0として、画素ブロックのビットマップBMを生成する。   FIG. 23 is a block diagram showing an example of the internal configuration of each comparison adder 45 in the first comparison adder 41 of FIG. As shown in FIG. 23, each comparison adder 45 has a comparison circuit 48 and an arithmetic circuit 49, and processes two pixels at a time. The comparison circuit 48 compares the pixel value A with the average value MID of the pixel block for each of the two corresponding pixels. Based on the comparison result of the comparison circuit 48, the arithmetic circuit 49 calculates the sum SU1 (or SU2) of pixel values and the number of pixels CU1 (or CU2) in a group (upper group) of pixels having pixel values larger than the average value. Then, the sum SL1 (or SL2) of pixel values and the number of pixels CL1 (or CL2) in a group of pixels having a pixel value equal to or less than the average value (lower group) are calculated. The arithmetic circuit 49 generates a pixel block bitmap BM with the upper group of pixels set to 1 and the lower group of pixels set to 0.

図24は図23に示す第1の比較加算部41の動作を表した図である。図24に示すように、画素値Aが平均値MID以下の場合は、変数SL1にその画素値Aが累積加算されるとともに、変数CL1が1加算され、ビットマップBM中の対応画素値は0になる。画素値Aが平均値MIDより大きい場合は、変数SU1にその画素値Aが累積加算されるとともに、変数CU1が1加算され、ビットマップBM中の対応画素値は1になる。   FIG. 24 is a diagram showing the operation of the first comparison and addition unit 41 shown in FIG. As shown in FIG. 24, when the pixel value A is equal to or less than the average value MID, the pixel value A is cumulatively added to the variable SL1 and 1 is added to the variable CL1, and the corresponding pixel value in the bitmap BM is 0. become. When the pixel value A is larger than the average value MID, the pixel value A is cumulatively added to the variable SU1, and the variable CU1 is incremented by 1, so that the corresponding pixel value in the bitmap BM becomes 1.

図25は図21の第2の比較加算部42の内部構成の一例を示すブロック図である。図25に示すように、第2の比較加算部42は、第1の比較加算部41の出力SL1,CL1,SL2,CL2を入力して下グループの総和SUMLおよび画素数CNTLを計算する演算回路50と、第1の比較加算部41の出力SU1,CU1,SU2,CU2を入力して上グループの総和SUMUおよび画素数CNTUを計算する演算回路51とを有する。   FIG. 25 is a block diagram showing an example of the internal configuration of the second comparison / addition unit 42 of FIG. As shown in FIG. 25, the second comparison / addition unit 42 receives the outputs SL1, CL1, SL2, and CL2 of the first comparison / addition unit 41 and calculates the total sum SUML and the number of pixels CNTL of the lower group. 50 and an arithmetic circuit 51 that receives the outputs SU1, CU1, SU2, and CU2 of the first comparison / addition unit 41 and calculates the sum SUMU of the upper group and the number of pixels CNTU.

図26は図21の代表値計算部43の内部構成の一例を示すブロック図である。図26に示すように、代表値計算部43は、下代表値を計算するためのシフト回路52および演算回路53と、上代表値を計算するためのシフト回路54および演算回路55とを有する。シフト回路52,54は、画素値の総和SUML(またはSUMU)を2ビット拡張して10ビット幅にする。演算回路53,55は、画素数CNTL(またはCNTU)の値に応じて、割算処理を行う。   FIG. 26 is a block diagram showing an example of the internal configuration of the representative value calculation unit 43 in FIG. As shown in FIG. 26, the representative value calculation unit 43 includes a shift circuit 52 and an arithmetic circuit 53 for calculating the lower representative value, and a shift circuit 54 and an arithmetic circuit 55 for calculating the upper representative value. The shift circuits 52 and 54 extend the sum of pixel values SUML (or SUMU) by 2 bits to a 10-bit width. The arithmetic circuits 53 and 55 perform division processing according to the value of the number of pixels CNTL (or CNTU).

図27は図26の演算回路53,55の動作を説明する図である。以下では、総和SUML(またはSUMU)を総称してSUMと呼び、画素数CNTL(またはCNTU)を総称してCNTと呼ぶ。   FIG. 27 is a diagram for explaining the operation of the arithmetic circuits 53 and 55 of FIG. Hereinafter, the sum SUML (or SUMU) is generically called SUM, and the number of pixels CNTL (or CNTU) is generically called CNT.

画素数CNTが0または1のときは、ビット拡張された総和SUMをそのまま出力する。なお、画素数CNTが0のときに総和SUMをそのまま出力する理由は、0で割ることはできないが、不定の値とするのはハードウェア構成上望ましくないためである。   When the number of pixels CNT is 0 or 1, the bit-extended sum SUM is output as it is. The reason why the sum SUM is output as it is when the number of pixels CNT is 0 is that it cannot be divided by 0, but an indefinite value is not desirable in terms of hardware configuration.

画素数CNTが2の場合は、総和SUMを1ビットシフトさせることにより、2の割算処理を行う。   When the number of pixels CNT is 2, the division process of 2 is performed by shifting the sum SUM by 1 bit.

画素数CNTが3の場合は、総和SUMを3で割ることを示しており、単純なシフト動作では行えない。そこで、後述する手法により3の割算処理を行う。   When the number of pixels CNT is 3, it indicates that the sum SUM is divided by 3, which cannot be performed by a simple shift operation. Therefore, the division process of 3 is performed by a method described later.

画素数CNTが4の場合は、総和SUMを2ビットシフトさせることにより、4の割算処理を行う。   When the number of pixels CNT is 4, the division process of 4 is performed by shifting the sum SUM by 2 bits.

図28は図26に示したシフト回路52または54と演算回路53または55の具体的構成の一例を示すブロック図である。図示のように、シフト回路52または54と演算回路53または55は、1ビットシフト回路61と、1/3乗算回路62と、2ビットシフト回路63と、スイッチ回路64と、スイッチ制御回路65とを有する。   FIG. 28 is a block diagram showing an example of a specific configuration of the shift circuit 52 or 54 and the arithmetic circuit 53 or 55 shown in FIG. As shown, the shift circuit 52 or 54 and the arithmetic circuit 53 or 55 include a 1-bit shift circuit 61, a 1/3 multiplication circuit 62, a 2-bit shift circuit 63, a switch circuit 64, and a switch control circuit 65. Have

総和SUMは、1ビットシフト回路61と、1/3乗算回路62と、2ビットシフト回路63とに入力される。スイッチ回路64は、スイッチ制御回路65の制御により、総和SUMと、1ビットシフト回路61の出力と、1/3乗算回路62の出力と、2ビットシフト回路63の出力とのいずれかを選択する。   The sum SUM is input to the 1-bit shift circuit 61, the 1/3 multiplication circuit 62, and the 2-bit shift circuit 63. The switch circuit 64 selects one of the sum SUM, the output of the 1-bit shift circuit 61, the output of the 1/3 multiplier circuit 62, and the output of the 2-bit shift circuit 63 under the control of the switch control circuit 65. .

図29は1/3乗算回路62の内部構成の一例を示すブロック図である。図示のように、1/3乗算回路62は、6ビットシフト回路71と、4ビットシフト回路72と、2ビットシフト回路73と、0ビットシフト回路74と、加算器75〜77とを有する。   FIG. 29 is a block diagram showing an example of the internal configuration of the 1/3 multiplication circuit 62. As shown in FIG. As illustrated, the 1/3 multiplication circuit 62 includes a 6-bit shift circuit 71, a 4-bit shift circuit 72, a 2-bit shift circuit 73, a 0-bit shift circuit 74, and adders 75 to 77.

256を3で割ると、約85.3となることから、この除算結果を85とみなしてバイナリ表現すると、01010101となる。そこで、図29では、総和SUMに、01010101を乗算する処理を行い、結果として約1/3の除算を行う。   When 256 is divided by 3, the result is about 85.3. Therefore, when the division result is regarded as 85 and expressed in binary, it becomes 01010101. Therefore, in FIG. 29, a process of multiplying the sum SUM by 01010101 is performed, and as a result, a division of about 1/3 is performed.

01010101は、1ビット目、3ビット目、5ビット目、7ビット目がそれぞれ1であり、元の総和SUMを、0ビットシフトさせた値と、2ビットシフトさせた値と、4ビットシフトさせた値と、6ビットシフトさせた値とを加算すれば、01010101と総和SUMとの乗算結果が得られる。これらのシフト処理と加算処理を図29で行っている。この結果、図29の最終段の加算器77からは、総和SUMをほぼ3で割った値が得られる。   In 01010101, the first bit, the third bit, the fifth bit, and the seventh bit are each 1, and the original sum SUM is shifted by 0 bits, shifted by 2 bits, and shifted by 4 bits. And the value shifted by 6 bits are added to obtain the multiplication result of 01010101 and the sum SUM. These shift processing and addition processing are performed in FIG. As a result, the adder 77 in the final stage of FIG. 29 obtains a value obtained by dividing the sum SUM by approximately 3.

図29のブロック構成は簡略化させることが可能である。図30は図29を簡略化したブロック図である。図30の1/3乗算回路62aは、2ビットシフト回路73と、0ビットシフト回路74と、加算器と、4ビットシフト回路72と、加算器とを有する。図30では、図29と同じ結果が得られる。   The block configuration in FIG. 29 can be simplified. FIG. 30 is a simplified block diagram of FIG. 30 includes a 2-bit shift circuit 73, a 0-bit shift circuit 74, an adder, a 4-bit shift circuit 72, and an adder. In FIG. 30, the same result as in FIG. 29 is obtained.

1/3の除算結果の精度をより高めるには、256を3で割った値を小数点まで考慮してもよい。小数点以下2桁まで考慮すると、256/3=約85.25となる。85.25をバイナリ表現すると、0101010101となる。この0101010101を総和SUMに乗じることにより、総和SUMを3で割った値に近似する値が得られる。   In order to further improve the accuracy of the 1/3 division result, a value obtained by dividing 256 by 3 may be taken into consideration. When considering up to two digits after the decimal point, 256/3 = about 85.25. When 85.25 is expressed in binary, it becomes 0101010101. By multiplying the total sum SUM by this 0101010101, a value approximate to a value obtained by dividing the total sum SUM by 3 is obtained.

図31は総和SUMに85.25を乗じる処理を行う1/3乗算回路62bのブロック図である。図31の1/3乗算回路62bは、8ビットシフト回路70と、6ビットシフト回路71と、4ビットシフト回路72と、2ビットシフト回路73と、0ビットシフト回路74と、加算器75〜78とを有する。図32は図31の回路を最適化したブロック図である。図32の1/3乗算回路62cは、4ビットシフト回路72と、2ビットシフト回路73と、0ビットシフト回路74と、加算器と、4ビットシフト回路72と、加算器とを有する。図32の1/3乗算回路62は、図31の8ビットシフト回路70と6ビットシフト回路71を省略して、加算器の数も減らしている。   FIG. 31 is a block diagram of a 1/3 multiplication circuit 62b that performs a process of multiplying the sum SUM by 85.25. 31 includes an 8-bit shift circuit 70, a 6-bit shift circuit 71, a 4-bit shift circuit 72, a 2-bit shift circuit 73, a 0-bit shift circuit 74, and adders 75 to 78. FIG. 32 is a block diagram in which the circuit of FIG. 31 is optimized. 32 includes a 4-bit shift circuit 72, a 2-bit shift circuit 73, a 0-bit shift circuit 74, an adder, a 4-bit shift circuit 72, and an adder. The 1/3 multiplication circuit 62 in FIG. 32 omits the 8-bit shift circuit 70 and the 6-bit shift circuit 71 in FIG. 31 to reduce the number of adders.

このように、256を3で割った値をより精度よく近似させることにより、より正確に1/3の除算を行うことができる。256を3で割った値を小数点以下4桁まで考慮すると、小数点以下2桁まで考慮した場合よりも、より精度よく1/3除算を行うことができる。256/3=約85.3125になる。   Thus, by dividing the value obtained by dividing 256 by 3 with higher accuracy, it is possible to perform the division by 1/3 more accurately. When the value obtained by dividing 256 by 3 is taken into consideration up to 4 digits after the decimal point, 1/3 division can be performed with higher accuracy than in the case of taking into consideration 2 digits after the decimal point. 256/3 = about 85.3125.

図33は256を3で割った値を85.3125とした場合の1/3乗算回路62のブロック図である。図33の1/3乗算回路62dは、10ビットシフト回路74と、8ビットシフト回路70と、6ビットシフト回路71と、4ビットシフト回路72と、2ビットシフト回路73と、0ビットシフト回路74と、加算器とを有する。図34は図33を最適化した1/3乗算回路62eのブロック図である。図34の1/3乗算回路62は、2ビットシフト回路73と、0ビットシフト回路74と、加算器75と、8ビットシフト回路70と、4ビットシフト回路72と、加算器76,77とを有する。   FIG. 33 is a block diagram of the 1/3 multiplication circuit 62 when the value obtained by dividing 256 by 3 is 85.3125. 33 includes a 10-bit shift circuit 74, an 8-bit shift circuit 70, a 6-bit shift circuit 71, a 4-bit shift circuit 72, a 2-bit shift circuit 73, and a 0-bit shift circuit. 74 and an adder. FIG. 34 is a block diagram of a 1/3 multiplication circuit 62e optimized from FIG. 34 includes a 2-bit shift circuit 73, a 0-bit shift circuit 74, an adder 75, an 8-bit shift circuit 70, a 4-bit shift circuit 72, and adders 76 and 77. Have

図35は図21のビット幅設定部44の内部構成の一例を示すブロック図である。図35のビット幅設定部44は、上代表値と下代表値の差分が閾値Tより大きいか否かを比較する比較回路81と、この比較回路81の比較結果に基づいて画素ブロック内の画像がラフか平坦かを決定する演算回路82とを有する。   FIG. 35 is a block diagram showing an example of the internal configuration of the bit width setting unit 44 of FIG. The bit width setting unit 44 in FIG. 35 compares the difference between the upper representative value and the lower representative value with respect to the threshold value T, and the image in the pixel block based on the comparison result of the comparison circuit 81. And an arithmetic circuit 82 for determining whether or not is rough or flat.

図36は図35の演算回路47の動作を示す図である。図36に示すように、上代表値REPUと下代表値REPLとの差分が閾値T以下であれば、平坦な画像と判断して、中央値と、中央値からの差分値とをREP1,REP2として出力するとともに、判定フラグビットを0にする。上代表値REPUと下代表値REPLとの差分が閾値未満であれば、ラフな画像と判断して、上代表値REPUを丸めた新たな上代表値REP1と、下代表値REPLを丸めた新たな下代表値REP2とを出力するとともに、判定フラグビットを1にする。   FIG. 36 shows the operation of the arithmetic circuit 47 of FIG. As shown in FIG. 36, if the difference between the upper representative value REPU and the lower representative value REPL is equal to or smaller than the threshold value T, it is determined that the image is flat, and the median value and the difference value from the median value are represented by REP1, REP2. And the determination flag bit is set to 0. If the difference between the upper representative value REPU and the lower representative value REPL is less than the threshold value, it is determined as a rough image, and a new upper representative value REP1 obtained by rounding the upper representative value REPU and a new one obtained by rounding the lower representative value REPL. The lower representative value REP2 is output and the determination flag bit is set to 1.

図37は図21のエンコーダ23内の各回路のハードウェアサイズを見積もった図である。より具体的には、エンコーダ23内の各回路に含まれる加算器の数を示している。   FIG. 37 is a diagram in which the hardware size of each circuit in the encoder 23 of FIG. 21 is estimated. More specifically, the number of adders included in each circuit in the encoder 23 is shown.

第1の階層計算器31は、第1の累積加算部33と第2の累積加算部34を有し、計3個の加算器を有する。第2の階層計算器32は、第1の比較加算部41と第2の比較加算部42を有し、これらで計4個の加算器を有する。また、代表値計算部43は4〜6個の加算器を有し、ビット幅設定部44は3個の加算器を有する。結局、エンコーダ23全体で、14〜16個の加算器を有する。   The first hierarchical calculator 31 has a first cumulative adder 33 and a second cumulative adder 34, and has a total of three adders. The second hierarchical calculator 32 includes a first comparison / addition unit 41 and a second comparison / addition unit 42, and these units have a total of four adders. The representative value calculation unit 43 has 4 to 6 adders, and the bit width setting unit 44 has 3 adders. After all, the encoder 23 as a whole has 14 to 16 adders.

8×8の乗算器は、8個の8ビット列の加算器で構成される。図37からわかるように、乗算器を単位に見積もると、エンコーダ23の全体で、ほぼ2個分の乗算器と同様のハードウェアサイズになる。これは十分に小さなハードウェアサイズである。   The 8 × 8 multiplier is composed of eight 8-bit string adders. As can be seen from FIG. 37, when the multiplier is estimated in units, the encoder 23 as a whole has the same hardware size as that of two multipliers. This is a sufficiently small hardware size.

図38は図21のエンコーダ23を簡略化した例を示すブロック図である。図38では、図21の第1の階層計算器31と第2の階層計算器32の構成が似ていることから、ハードウェアの共有化を図っている。すなわち、共通のハードウェアを利用して、時間をずらして計算を行うことで、一つの回路で、第1の階層計算器31と第2の階層計算器32と同様の処理を行う。   FIG. 38 is a block diagram showing a simplified example of the encoder 23 of FIG. In FIG. 38, since the configurations of the first hierarchical calculator 31 and the second hierarchical calculator 32 in FIG. 21 are similar, the hardware is shared. That is, the same processing as that of the first hierarchical calculator 31 and the second hierarchical calculator 32 is performed by one circuit by performing calculation while shifting the time using common hardware.

図38のエンコーダ23aは、第1の加算部83と、第2の加算部84と、代表値計算部43と、ビット幅設定部44とを有する。第1の加算部83は2個の加算器85を有し、第2の加算部84は1個の加算器86を有する。   The encoder 23a of FIG. 38 includes a first addition unit 83, a second addition unit 84, a representative value calculation unit 43, and a bit width setting unit 44. The first adder 83 has two adders 85, and the second adder 84 has one adder 86.

第1の加算部83は、第1の時刻では図21の第1の累積加算部33と同様の計算を行い、第2の時刻では図21の第1の比較加算部41と同様の計算を行う。第2の加算部84は、第1の時刻では図21の第2の累積加算部34と同様の計算を行い、第2の時刻では図21の第2の比較加算部42と同様の計算を行う。   The first adder 83 performs the same calculation as the first cumulative adder 33 in FIG. 21 at the first time, and performs the same calculation as the first comparison adder 41 in FIG. 21 at the second time. Do. The second adder 84 performs the same calculation as the second cumulative adder 34 in FIG. 21 at the first time, and performs the same calculation as the second comparison adder 42 in FIG. 21 at the second time. Do.

図38の代表値計算部43は、第1の時刻では図21の平均値計算部35と同様の計算を行い、第2の時刻では図21の代表値計算部43と同様の計算を行う。   The representative value calculator 43 in FIG. 38 performs the same calculation as the average value calculator 35 in FIG. 21 at the first time, and performs the same calculation as the representative value calculator 43 in FIG. 21 at the second time.

図38のように、一部の回路を共有化して、時間によって計算内容を切り替えることにより、ハードウェアの規模を縮小できる。より具体的には、加算器の数を削減できる。   As shown in FIG. 38, the hardware scale can be reduced by sharing some circuits and switching the calculation contents according to time. More specifically, the number of adders can be reduced.

図38以外の手法により、ハードウェアの最適化を図ってもよい。図21の平均値計算部35は、2ビットシフトさせることにより平均値を計算している。これは、シフトによって配線の接続先を変更することを意味しており、シフト処理のためのハードウェアを備えているわけではない。このため、遅延を考慮して全体を2時刻で制御する観点から考えると、平均値計算部35の処理時間は無視できる。したがって、第1の時刻で、図21の第1の累積加算部33から第1の比較加算部41までの処理を行い、第2の時刻で、図22の第2の比較加算部42からビット幅設定部44までの処理を行うことも考えられる。あるいは、処理時間の均一化を図って、第1の比較加算部41や第2の比較加算部42の処理の途中で、処理サイクルを切り替えてもよい。   The hardware may be optimized by a method other than that shown in FIG. The average value calculator 35 in FIG. 21 calculates the average value by shifting by 2 bits. This means that the connection destination of the wiring is changed by shifting, and does not include hardware for the shift processing. For this reason, the processing time of the average value calculation unit 35 can be ignored from the viewpoint of controlling the whole at two times in consideration of the delay. Therefore, the processing from the first cumulative addition unit 33 to the first comparison addition unit 41 in FIG. 21 is performed at the first time, and the second comparison addition unit 42 in FIG. It is also conceivable to perform processing up to the width setting unit 44. Alternatively, the processing cycles may be switched in the middle of the processing of the first comparison / addition unit 41 and the second comparison / addition unit 42 in order to equalize the processing time.

このように、処理サイクルの区切りをどこに設定するかは、各回路の処理遅延時間を鑑みて調整するのが望ましい。   Thus, it is desirable to adjust where the processing cycle interval is set in consideration of the processing delay time of each circuit.

図39は図1のABD−BTC復号化回路7の内部構成の一例を示すブロック図である。図39の復号化回路7は、圧縮データ保存レジスタ91と、フラグ抽出部92と、代表値抽出部93と、ビットマップ抽出部94と、2×2画素復元計算部95と、2×2画素保存レジスタ96と、ラインメモリ97とを有する。   FIG. 39 is a block diagram showing an example of the internal configuration of the ABD-BTC decoding circuit 7 of FIG. The decoding circuit 7 of FIG. 39 includes a compressed data storage register 91, a flag extraction unit 92, a representative value extraction unit 93, a bitmap extraction unit 94, a 2 × 2 pixel restoration calculation unit 95, and 2 × 2 pixels. A storage register 96 and a line memory 97 are provided.

圧縮データ保存レジスタ91は、メモリ6に格納されている符号化データを一時的に保存する。フラグ抽出部92は、符号化データの先頭ビットである判定フラグビットを抽出する。1であれば、ラフな画像を示し、0であれば、平坦な画像を示している。   The compressed data storage register 91 temporarily stores the encoded data stored in the memory 6. The flag extraction unit 92 extracts a determination flag bit that is the first bit of the encoded data. A 1 indicates a rough image, and a 0 indicates a flat image.

代表値抽出部93は、判定フラグビットの値に応じて、中央値および差分値を抽出するか、上代表値および下代表値を抽出する。ビットマップ抽出部94は、判定フラグビットの値に応じて、ビットマップの抽出を行う。   The representative value extraction unit 93 extracts the median value and the difference value or extracts the upper representative value and the lower representative value according to the value of the determination flag bit. The bitmap extraction unit 94 extracts a bitmap according to the value of the determination flag bit.

2×2画素復元計算部95は、フラグ抽出部92、代表値抽出部93およびビットマップ抽出部94の出力に基づいて、画素値の復元を行う。復元された画素値は2×2画素保存レジスタ96に一時的に格納された後、ラインメモリ97に格納される。   The 2 × 2 pixel restoration calculation unit 95 restores the pixel value based on the outputs of the flag extraction unit 92, the representative value extraction unit 93, and the bitmap extraction unit 94. The restored pixel value is temporarily stored in the 2 × 2 pixel storage register 96 and then stored in the line memory 97.

ラインメモリ97は、2Hライン分のメモリ容量を有する。これだけのメモリ容量を必要とする理由は、2×2画素からなる画素ブロックを単位として復号化処理を行うためである。ただし、1Hラインメモリ8がすでにあるので、ラインメモリ97としては2Hメモリまで設けなくても、1Hメモリがあれば足りるので、この1Hメモリ実現がより好ましい。   The line memory 97 has a memory capacity for 2H lines. The reason why such a memory capacity is required is that the decoding process is performed in units of 2 × 2 pixel blocks. However, since the 1H line memory 8 already exists, it is sufficient to provide the 1H memory as the line memory 97 even if the 2H memory is not provided.

フラグ抽出部92、代表値抽出部93およびビットマップ抽出部94は符号化データ抽出部に対応する。   The flag extraction unit 92, the representative value extraction unit 93, and the bitmap extraction unit 94 correspond to an encoded data extraction unit.

図39の復号化回路7は、上述した図15のフローチャートに沿って処理を行う。図15のステップS51は圧縮データ保存レジスタ91の処理、ステップS52はフラグ抽出部92、代表値抽出部93、ビットマップ抽出部94および2×2画素復元計算部95の処理、ステップS53は2×2画素保存レジスタ96の処理、ステップS54はラインメモリ97の処理に対応する。   The decoding circuit 7 in FIG. 39 performs processing according to the flowchart in FIG. 15 described above. Step S51 of FIG. 15 is processing of the compressed data storage register 91, step S52 is processing of the flag extraction unit 92, representative value extraction unit 93, bitmap extraction unit 94, and 2 × 2 pixel restoration calculation unit 95, and step S53 is 2 ×. The process of the two-pixel storage register 96, step S54, corresponds to the process of the line memory 97.

図40は図39の2×2画素復元計算部95の処理内容を説明する図である。図40(a)は2×2画素復元計算部95の内部構成の一例を示すブロック図である。図40(a)に示す2×2画素復元計算部95は、4つの選択回路98を有する。4つの選択回路98には、代表値REP1,REP2と、判定フラグビットFLAGと、ビットマップを構成する各値BM11,BM12,BM21,BM22とが入力される。例えば、FLAG=0であれば、平坦な画像と判断して、入力されたビットマップの各値を代表値REP1,REP2を用いて変換して、C11,C12,C21,C22を出力する。2×2画素復元計算部95は、図17のフローチャートに沿って処理を行う。   FIG. 40 is a diagram for explaining the processing contents of the 2 × 2 pixel restoration calculation unit 95 in FIG. 39. FIG. 40A is a block diagram illustrating an example of the internal configuration of the 2 × 2 pixel restoration calculation unit 95. The 2 × 2 pixel restoration calculation unit 95 illustrated in FIG. 40A includes four selection circuits 98. Representative values REP1 and REP2, determination flag bit FLAG, and values BM11, BM12, BM21, and BM22 constituting a bitmap are input to the four selection circuits 98. For example, if FLAG = 0, it is determined as a flat image, and each value of the input bitmap is converted using the representative values REP1, REP2, and C11, C12, C21, C22 are output. The 2 × 2 pixel restoration calculation unit 95 performs processing according to the flowchart of FIG.

画像復元を行う際に、画像の回転や反転を行う機能を設けることも可能である。この場合、画素ブロックを構成する4画素の復元画素値C11,C12,C21,C22を入れ替えることも可能だが、各画素値は例えば8ビット幅であるため、入れ替えが大がかりになる。   When performing image restoration, it is also possible to provide a function for rotating or inverting an image. In this case, it is possible to replace the restored pixel values C11, C12, C21, and C22 of the four pixels constituting the pixel block. However, since each pixel value is, for example, 8 bits wide, the replacement becomes large.

そこで、ビットマップを構成する各値BM11,BM12,BM21,BM22の位置を交換すればよい。これにより、8ビットの入れ替えではなく、わずか1ビットの入れ替えで済むため、ハードウェア規模を削減できる。この入れ替え処理を行うハードウェア(回転・反転回路99)は、図40(b)のようなものになる。   Therefore, the positions of the values BM11, BM12, BM21, and BM22 constituting the bitmap may be exchanged. As a result, the hardware scale can be reduced because only 1 bit is replaced instead of 8 bits. The hardware (rotation / inversion circuit 99) for performing the replacement process is as shown in FIG.

図40(b)の入力データB11,B12,B21,B22は回転・反転前のビットマップ、出力データBM11,BM12,BM21,BM22は回転・反転後のビットマップである。   In FIG. 40B, input data B11, B12, B21, and B22 are bitmaps before rotation and inversion, and output data BM11, BM12, BM21, and BM22 are bitmaps after rotation and inversion.

復号化の段階で回転・反転を行う代わりに、符号化の段階で回転・反転処理を行ってもよい。この場合、回転・反転を行った後の符号化データがメモリ6に格納される。   Instead of performing rotation / inversion at the decoding stage, rotation / inversion processing may be performed at the encoding stage. In this case, the encoded data after rotation / inversion is stored in the memory 6.

実際の画像処理では、符号化の際に回転・反転処理を行うのが望ましい。その理由は、復号化器のハードウェアをより小型化できるためと、メモリ6の利用効率の観点からは縦横を逆にして保存した方が画像の縦横方向とメモリ6の縦横方向を一致させることができるためである。   In actual image processing, it is desirable to perform rotation / inversion processing during encoding. The reason is that the hardware of the decoder can be further reduced, and from the viewpoint of the utilization efficiency of the memory 6, when the image is stored with the vertical and horizontal directions reversed, the vertical and horizontal directions of the image and the vertical and horizontal directions of the memory 6 are matched. It is because it can do.

仮に、画像の縦横方向とメモリ6の縦横方向とを一致させないとすると、メモリ6内に有効利用されない空き領域が増える一方、縦または横のいずれか一方のメモリ容量が不足する可能性がある。   If the vertical and horizontal directions of the image and the vertical and horizontal directions of the memory 6 do not coincide with each other, there is a possibility that an empty area that is not effectively used increases in the memory 6 while either the vertical or horizontal memory capacity is insufficient.

図41はラフな画像の画像復元を説明する図である。この場合の代表値は、精度が5ビットの上代表値と下代表値である。ビットマップが0の場合は下代表値が選択され、ビットマップが1の場合は上代表値が選択される。画像復元の際には、代表値が5ビットから8ビットに拡張される。そして、ビットマップの各ビットが8ビットからなる代表値(上代表値または下代表値)に置換されて、C11,C12,C21,C22が得られる。   FIG. 41 is a diagram for explaining image restoration of a rough image. The representative values in this case are an upper representative value and a lower representative value having a precision of 5 bits. When the bitmap is 0, the lower representative value is selected, and when the bitmap is 1, the upper representative value is selected. At the time of image restoration, the representative value is expanded from 5 bits to 8 bits. Then, each bit of the bitmap is replaced with a representative value (upper representative value or lower representative value) consisting of 8 bits to obtain C11, C12, C21, and C22.

図42は平坦な画像の画像復元を説明する図である。この場合の代表値は、精度が8ビットの中央値と2ビットの差分値である。下代表値=中央値−差分値、上代表値=中央値+差分値で計算される。ビットマップの各ビットは、上代表値と下代表値に置換されて、C11,C12,C21,C22が得られる。   FIG. 42 is a diagram for explaining image restoration of a flat image. The representative value in this case is a median value of accuracy of 8 bits and a difference value of 2 bits. Lower representative value = median value−difference value, upper representative value = median value + difference value. Each bit of the bitmap is replaced with the upper representative value and the lower representative value to obtain C11, C12, C21, and C22.

図43は図40(a)の選択回路98の内部構成の一例を示すブロック図である。図43の選択回路98は、差分復元回路101と、ビット拡張回路102と、第1のスイッチ回路103と、第2のスイッチ回路104とを有する。   FIG. 43 is a block diagram showing an example of the internal configuration of the selection circuit 98 of FIG. The selection circuit 98 in FIG. 43 includes a difference restoration circuit 101, a bit expansion circuit 102, a first switch circuit 103, and a second switch circuit 104.

差分復元回路101とビット拡張回路102には、データ保存レジスタ91の値が入力される。データ保存レジスタ91の先頭ビットは判定フラグビットを表しており、1はラフな画像、0は平坦な画像を示す。ラフな画像の場合も平坦な画像の場合も、代表値の抽出には、データ保存レジスタの2ビット目から11ビット目までの10ビットが用いられる。   The value of the data storage register 91 is input to the difference restoration circuit 101 and the bit extension circuit 102. The first bit of the data storage register 91 represents a determination flag bit, where 1 indicates a rough image and 0 indicates a flat image. For both a rough image and a flat image, 10 bits from the second bit to the eleventh bit of the data storage register are used to extract the representative value.

差分復元回路101は、ラフな画像の場合は、上記10ビットにより、上代表値と下代表値を抽出する。ビット拡張回路102は、ラフな画像の場合には、5ビット精度から8ビット精度にビット拡張を行う。また、ビット拡張回路102は、丸め調整のためにオフセットを加算する。   In the case of a rough image, the difference restoration circuit 101 extracts the upper representative value and the lower representative value by the 10 bits. In the case of a rough image, the bit extension circuit 102 performs bit extension from 5 bit precision to 8 bit precision. The bit extension circuit 102 adds an offset for rounding adjustment.

第1のスイッチ回路103は、判定フラグビットに基づいて、復元または拡張された2つの代表値を選択する。第2のスイッチ回路104は、ビットマップの各ビットにもとづいて、上代表値か下代表値を選択する。   The first switch circuit 103 selects two representative values restored or expanded based on the determination flag bit. The second switch circuit 104 selects the upper representative value or the lower representative value based on each bit of the bitmap.

差分復元回路101には、加算・減算によるオーバーフローとアンダーフローの処理回路を追加してもよい。例えば、上述したように、代表値を求める1/3乗算器にて近似誤差が生じる可能性がある。このような誤差の累積により、上述したオーバーフローとアンダーフローの処理回路が必要になる可能性がある。逆に、十分に計算のビット幅を増やして、誤差が出にくくする手法も考えられる。このように、実際に実現する回路と、画質の劣化の程度により、必要に応じて、上記処理回路を追加するのが望ましい。   An overflow / underflow processing circuit by addition / subtraction may be added to the difference restoration circuit 101. For example, as described above, an approximation error may occur in a 1/3 multiplier that obtains a representative value. Such accumulation of errors may require the overflow and underflow processing circuits described above. On the other hand, a method can be considered in which the bit width of the calculation is sufficiently increased to make it difficult for errors to occur. As described above, it is desirable to add the processing circuit as necessary depending on the actual circuit to be realized and the degree of deterioration of the image quality.

差分復元回路101とビット拡張回路102の内部にはそれぞれ加算器が含まれているが、加算器の数を削減することも考えられる。ビット拡張回路102が行う丸め調整は、ABD−BTC符号化回路5での丸め処理により発生する四捨五入や切り捨て等の数値処理により発生するエラーを最小化する操作である。このようなエラーを最小化する処理は、ABD−BTC符号化回路5で行うことも可能である。すなわち、符号化回路5による丸め処理で生じるエラーを予め考慮して、オフセット調整をした後で、丸め処理を実行する。   Although the difference restoration circuit 101 and the bit extension circuit 102 each include an adder, it is conceivable to reduce the number of adders. The rounding adjustment performed by the bit extension circuit 102 is an operation for minimizing an error generated by numerical processing such as rounding off or truncation generated by rounding processing in the ABD-BTC encoding circuit 5. Such processing for minimizing errors can also be performed by the ABD-BTC encoding circuit 5. That is, the rounding process is executed after the offset adjustment is performed in consideration of an error caused by the rounding process by the encoding circuit 5 in advance.

これにより、ビット拡張回路102内の加算器を省略でき、単にLSBを0で埋める機能だけが残る。なお、これは丸めに関係のあるラフな画像の場合の話であり、平坦な画像の場合は、差分復元回路101で復元された8ビット精度の代表値を利用する。この8ビット代表値は、丸めに関係なく、ビット拡張回路102を通過する。さらに画質が若干落ちても気にならないのであれば、符号化回路5での丸め用オフセット調整を削除する方策もありうる。   As a result, the adder in the bit extension circuit 102 can be omitted, and only the function of filling the LSB with 0 remains. Note that this is a case of a rough image related to rounding. In the case of a flat image, a representative value of 8-bit accuracy restored by the difference restoration circuit 101 is used. The 8-bit representative value passes through the bit extension circuit 102 regardless of rounding. Further, if the image quality is slightly deteriorated, there may be a method of deleting the rounding offset adjustment in the encoding circuit 5.

上述した加算器を削減する別案として、差分復元回路101内の加算器とビット拡張回路102内の加算器を共用することが考えられる。この場合、差分復元回路101にて、中央値−差分値の減算処理を行う場合も、補数を用いて加算器で行えるため、二つの代表値それぞれに1個の加算器が必要となり、ビット拡張での2個の加算器とつじつまが合う。   As an alternative to reduce the above-described adder, it is conceivable to share the adder in the difference restoration circuit 101 and the adder in the bit extension circuit 102. In this case, even when the median-difference subtraction process is performed in the difference restoration circuit 101, since it can be performed by an adder using a complement, one adder is required for each of the two representative values, and bit extension is performed. It matches the two adders in.

さらなる別案として、丸め調整のオフセットを特定の値(例えば+4、+3、0など)に固定する。これは、バイナリの10、011、000を、ビット列の下位側に追加するだけでよく、ハードウェア規模を増大させることなく、実現できる。非常にシンプルな構成であるが、微調整は行えない。   As a further alternative, the rounding adjustment offset is fixed at a specific value (eg, +4, +3, 0, etc.). This only needs to be added to binary 10, 011,000 on the lower side of the bit string, and can be realized without increasing the hardware scale. Although it is a very simple configuration, fine adjustment is not possible.

このように、本実施形態では、2×2画素からなる画素ブロックを単位として、ラフな画像か平坦な画像かを判定し、ラフな画像であれば5ビット精度の符号化データを生成し、平坦な画像であれば8ビット精度の符号化データを生成する。ラフな画像の場合も平坦な画像の場合も、同じビット幅からなる符号化データを生成するため、画像の種類により符号化データのビット幅が変動することはない。画像をラフか平坦かの2種類のみに分類するため、画像の場合分けの数を最小限に抑えることができ、ハードウェア規模を削減できる。   As described above, in this embodiment, whether a rough image or a flat image is determined in units of a pixel block composed of 2 × 2 pixels, and if it is a rough image, encoded data with 5-bit accuracy is generated. If the image is flat, encoded data with 8-bit accuracy is generated. In both the case of a rough image and the case of a flat image, encoded data having the same bit width is generated. Therefore, the bit width of the encoded data does not vary depending on the type of image. Since the images are classified into only two types, rough and flat, the number of image divisions can be minimized, and the hardware scale can be reduced.

また、本実施形態では、画素ブロックを2×2画素の小サイズにしているため、画素ブロック内の平均値の計算を簡易な回路で行うことができる。すなわち、ハードウェア規模が大きくなりやすい除算器を、1/3乗算器だけで構成できる。この1/3乗算器も、近似計算を行うことで、ハードウェア規模を削減できる。   In this embodiment, since the pixel block has a small size of 2 × 2 pixels, the average value in the pixel block can be calculated with a simple circuit. That is, a divider that tends to increase in hardware scale can be configured with only a 1/3 multiplier. This 1/3 multiplier can also reduce the hardware scale by performing approximate calculation.

さらに、画素ブロックの平均値を計算する際には、階層的な計算を行うことで、ハードウェアの共有化を図ることができる。また、画像の回転や反転処理も、専用のハードウェアを設けずに行うことができる。   Furthermore, when calculating the average value of pixel blocks, it is possible to share hardware by performing hierarchical calculation. Also, image rotation and inversion processing can be performed without providing dedicated hardware.

また、符号化の際には、画素ブロックを2つの代表値で表現するため、代表値の数を削減できて、符号化データのビット幅を抑制できる。また、ラフな画像と平坦な画像で符号化データのビット精度を切り替えるため、人間の目には画質の劣化が感じられることはない。   Further, since the pixel block is expressed by two representative values at the time of encoding, the number of representative values can be reduced and the bit width of the encoded data can be suppressed. In addition, since the bit accuracy of the encoded data is switched between a rough image and a flat image, the human eye does not feel deterioration in image quality.

このように、本実施形態の符号化処理により得られた符号化データはビット幅が小さいため、符号化データを格納するメモリ6のメモリ容量を削減でき、画像処理装置のハードウェア規模の削減とコスト削減が図れる。   Thus, since the encoded data obtained by the encoding process of this embodiment has a small bit width, the memory capacity of the memory 6 for storing the encoded data can be reduced, and the hardware scale of the image processing apparatus can be reduced. Cost reduction can be achieved.

以上より、本実施形態によれば、携帯電話等に利用される小サイズ(例えばQVGA)のLCDパネル3の表示制御を行う際に、BTCアルゴリズムによる圧縮効果を活用できる。すなわち、従来のVGAメモリ6サイズで有効であったBTCアルゴリズムは、その符号化器と復号化器がQVGA時のメモリ6削減と比較して相対的に大きいため、QVGAサイズの表示制御にはBTC技術を利用できなかったが、本実施形態ではQVGAサイズの表示制御にもBTC技術を適用することができる。   As described above, according to the present embodiment, the compression effect of the BTC algorithm can be utilized when performing display control of the LCD panel 3 of a small size (for example, QVGA) used for a mobile phone or the like. In other words, the BTC algorithm that is effective with the conventional VGA memory 6 size is relatively large compared to the memory 6 reduction at the time of QVGA because its encoder and decoder are relatively large. Although the technology could not be used, the BTC technology can also be applied to the display control of the QVGA size in this embodiment.

本発明の一実施形態による画像処理装置を含む液晶表示装置の概略構成を示すブロック図。1 is a block diagram showing a schematic configuration of a liquid crystal display device including an image processing device according to an embodiment of the present invention. ABD−BTC符号化回路5の処理手順の概略を示すフローチャート。5 is a flowchart showing an outline of a processing procedure of an ABD-BTC encoding circuit 5; 図2のステップS3の詳細処理の一例を示すフローチャート。The flowchart which shows an example of the detailed process of step S3 of FIG. 図3のステップS11の詳細処理の一例を示すフローチャート。The flowchart which shows an example of the detailed process of FIG.3 S11. 図3のステップS12の詳細処理の一例を示すフローチャート。The flowchart which shows an example of the detailed process of FIG.3 S12. 図3のステップS13の詳細処理の一例を示すフローチャート。The flowchart which shows an example of the detailed process of FIG.3 S13. (a)は画像の閾値を3通りに変化させて二値化した例を示す図、(b)はラフな画像の画素値の一例を示す図、(c)は平坦な画像の画素値の一例を示す図。(A) is a diagram showing an example of binarization by changing the threshold value of an image in three ways, (b) is a diagram showing an example of a pixel value of a rough image, and (c) is a pixel value of a flat image. The figure which shows an example. ラフな画像の符号化を説明する図。The figure explaining encoding of a rough image. 図8で説明した符号化により得られる符号化データのビット列を示す図。FIG. 9 is a diagram showing a bit string of encoded data obtained by the encoding described in FIG. 8. 平坦な画像の符号化を説明する図。The figure explaining encoding of a flat image. 図10で説明した符号化により得られる符号化データのビット列を示す図。FIG. 11 is a diagram showing a bit string of encoded data obtained by the encoding described in FIG. 10. 画素値0と255で構成されたラフな画像のオフセット調整を説明する図。The figure explaining the offset adjustment of the rough image comprised by pixel value 0 and 255. FIG. 平坦な画像のオフセット調整を説明する図。The figure explaining the offset adjustment of a flat image. 平坦な画像のオフセット調整を説明する図。The figure explaining the offset adjustment of a flat image. 図1のABD−BTC復号化回路7の処理手順の概略を示すフローチャート。The flowchart which shows the outline of the process sequence of the ABD-BTC decoding circuit 7 of FIG. 図15のステップS52の詳細処理の一例を示すフローチャート。The flowchart which shows an example of the detailed process of FIG.15 S52. 図15のステップS53の詳細処理の一例を示すフローチャート。The flowchart which shows an example of the detailed process of step S53 of FIG. 圧縮率とPSNR(Peak Signal Noise Ratio)の関係を示す図。The figure which shows the relationship between a compression rate and PSNR (Peak Signal Noise Ratio). 液晶表示装置の一変形例を示すブロック図。The block diagram which shows the modification of a liquid crystal display device. 図1または図19のABD−BTC符号化回路5の内部構成の一例を示すブロック図。FIG. 20 is a block diagram showing an example of an internal configuration of the ABD-BTC encoding circuit 5 of FIG. 1 or FIG. 図20のエンコーダ23の内部構成の一例を示すブロック図。FIG. 21 is a block diagram illustrating an example of an internal configuration of an encoder 23 in FIG. 20. 図21の第1の累積加算部33と第2の累積加算部34の内部構成の一例を示すブロック図。FIG. 22 is a block diagram showing an example of the internal configuration of a first cumulative adder 33 and a second cumulative adder 34 in FIG. 21. 図21の第1の比較加算部41内の各比較加算器45の内部構成の一例を示すブロック図。FIG. 22 is a block diagram showing an example of the internal configuration of each comparison adder 45 in the first comparison adder 41 of FIG. 21. 図23に示す第1の比較加算部41の動作を真理値で表した図。The figure which represented the operation | movement of the 1st comparison addition part 41 shown in FIG. 23 with a truth value. 図21の第2の比較加算部42の内部構成の一例を示すブロック図。FIG. 22 is a block diagram illustrating an example of an internal configuration of a second comparison / addition unit in FIG. 21. 図21の代表値計算部43の内部構成の一例を示すブロック図。FIG. 22 is a block diagram showing an example of an internal configuration of a representative value calculation unit 43 in FIG. 21. 図26の演算回路53,55の動作を説明する図。FIG. 27 is a diagram for explaining the operation of arithmetic circuits 53 and 55 in FIG. 26. 図26に示したシフト回路と演算回路の具体的構成の一例を示すブロック図。FIG. 27 is a block diagram illustrating an example of a specific configuration of a shift circuit and an arithmetic circuit illustrated in FIG. 26. 1/3乗算回路62の内部構成の一例を示すブロック図。FIG. 3 is a block diagram showing an example of an internal configuration of a 1/3 multiplication circuit 62. 図29を簡略化したブロック図。The block diagram which simplified FIG. 総和SUMに85.25を乗じる処理を行う1/3乗算回路62bのブロック図。The block diagram of the 1/3 multiplication circuit 62b which performs the process which multiplies 85.25 to total SUM. 図31の回路を最適化したブロック図。The block diagram which optimized the circuit of FIG. 256を3で割った値を85.3125とした場合の1/3乗算回路62のブロック図。The block diagram of the 1/3 multiplication circuit 62 when the value which divided 256 by 3 is set to 85.3125. 図33を最適化した1/3乗算回路62eのブロック図。The block diagram of the 1/3 multiplication circuit 62e which optimized FIG. 図21のビット幅設定部44の内部構成の一例を示すブロック図。FIG. 22 is a block diagram showing an example of an internal configuration of a bit width setting unit 44 in FIG. 21. 図35の演算回路47の動作を示す図。FIG. 36 is a diagram showing an operation of the arithmetic circuit 47 in FIG. 35. 図21のエンコーダ23内の各回路のハードウェアサイズを見積もった図。The figure which estimated the hardware size of each circuit in the encoder 23 of FIG. 図21のエンコーダ23を簡略化した例を示すブロック図。The block diagram which shows the example which simplified the encoder 23 of FIG. 図1のABD−BTC復号化回路7の内部構成の一例を示すブロック図。The block diagram which shows an example of the internal structure of the ABD-BTC decoding circuit 7 of FIG. 図39の2×2画素復元計算部95の処理内容を説明する図。The figure explaining the processing content of the 2 * 2 pixel restoration calculation part 95 of FIG. ラフな画像の画像復元を説明する図。The figure explaining the image restoration of a rough image. 平坦な画像の画像復元を説明する図。The figure explaining the image restoration of a flat image. 図40(a)の選択回路98の内部構成の一例を示すブロック図。FIG. 41 is a block diagram showing an example of the internal configuration of the selection circuit 98 in FIG.

符号の説明Explanation of symbols

1 RGBデータ送信回路
2 LCDソースドライバ
3 LCDパネル
4 RGBデータ受信回路
5 ABD−BTC符号化回路
6 メモリ
7 ABD−BTC復号化回路
8 LCD駆動回路
11 コントローラ
12 圧縮データ送信回路
13 圧縮データ受信回路
21 2Hラインメモリ
22 4画素保存レジスタ
23 エンコーダ
24 圧縮データ保存レジスタ
31 第1の階層計算器
32 第2の階層計算器
33 第1の累積加算部
34 第2の累積加算部
35 平均値計算部
41 第1の比較加算部
42 第2の比較加算部
43 代表値計算部
44 ビット幅設定部
DESCRIPTION OF SYMBOLS 1 RGB data transmission circuit 2 LCD source driver 3 LCD panel 4 RGB data reception circuit 5 ABD-BTC encoding circuit 6 Memory 7 ABD-BTC decoding circuit 8 LCD drive circuit 11 Controller 12 Compressed data transmission circuit 13 Compressed data reception circuit 21 2H line memory 22 4 pixel storage register 23 encoder 24 compressed data storage register 31 first hierarchical calculator 32 second hierarchical calculator 33 first cumulative adder 34 second cumulative adder 35 average value calculator 41 first 1 comparison addition unit 42 second comparison addition unit 43 representative value calculation unit 44 bit width setting unit

Claims (5)

隣接する2×2画素からなる画素ブロックのそれぞれごとに、前記画素ブロック内の画素値の平均値を計算する平均値計算手段と、
前記画素ブロックのそれぞれごとに、前記平均値計算手段で計算された平均値より大きい上代表値と前記平均値より小さい下代表値とを計算する代表値計算手段と、
前記画素ブロックごとに、前記上代表値と前記下代表値との差分が所定の閾値より大きいか否かを判定する画像変化判定手段と、
前記画像変化判定手段により前記閾値より大きいと判定されると、画像がラフであると判断して第1の符号化データを生成し、前記画像変化判定手段により前記閾値以下と判定されると、画像が平坦であると判断して第2の符号化データを生成する符号化処理手段と、
前記第1の符号化データおよび前記第2の符号化データを格納する記憶手段と、を備え、
前記平均値計算手段は、
前記画素ブロック内の2画素ずつの画素値の和を並行して計算する第1および第2の加算器と、
前記第1の加算器の加算結果と前記第2の加算器の加算結果との和を計算する第3の加算器と、
前記第3の加算器の加算結果を表すビット列を2ビットシフトさせて、前記平均値を計算する1/4割算器と、を有し、
前記代表値計算手段は、
前記平均値と前記画素ブロック内の各画素値とを比較して、前記平均値よりも大きい画素値を累積加算した第1の累積加算値と、前記平均値以下の画素値を累積加算した第2の累積加算値とを計算する累積加算器と、
前記第1の累積加算値とその累積加算した回数とに基づいて前記上代表値を計算し、かつ前記第2の累積加算値とその累積した回数とに基づいて前記下代表値を計算する上下代表値計算手段と、を有することを特徴とする画像処理装置。
An average value calculating means for calculating an average value of pixel values in the pixel block for each of adjacent pixel blocks composed of 2 × 2 pixels;
Representative value calculating means for calculating an upper representative value larger than the average value calculated by the average value calculating means and a lower representative value smaller than the average value for each of the pixel blocks;
Image change determination means for determining whether a difference between the upper representative value and the lower representative value is greater than a predetermined threshold for each pixel block;
If it is determined by the image change determination means that it is larger than the threshold value, it is determined that the image is rough and first encoded data is generated, and if the image change determination means determines that the threshold value is equal to or less than the threshold value, Encoding processing means for determining that the image is flat and generating second encoded data;
Storage means for storing the first encoded data and the second encoded data,
The average value calculating means includes
First and second adders for calculating in parallel the sum of pixel values of every two pixels in the pixel block;
A third adder that calculates the sum of the addition result of the first adder and the addition result of the second adder;
A quarter divider that shifts the bit string representing the addition result of the third adder by 2 bits and calculates the average value;
The representative value calculating means includes:
A comparison is made between the average value and each pixel value in the pixel block, and a first cumulative addition value obtained by cumulatively adding pixel values larger than the average value, and a pixel value less than the average value are cumulatively added. A cumulative adder that calculates a cumulative added value of 2;
Upper and lower calculating the upper representative value based on the first cumulative added value and the cumulative number of times and calculating the lower representative value based on the second cumulative added value and the cumulative number of times An image processing apparatus comprising: representative value calculation means;
前記平均値計算手段は、前記画素ブロック内の4画素分のRGBデータのそれぞれについて平均値を計算し、
前記代表値計算手段は、前記画素ブロック内の4画素分のRGBデータのそれぞれについて前記上代表値および前記下代表値を計算し、
前記画像変化判定手段は、前記画素ブロック内の4画素分のRGBデータのそれぞれについて、前記上代表値と前記下代表値との差分が所定の閾値より大きいか否かを判定し、
前記符号化処理手段は、前記画素ブロック内の4画素分のRGBデータのそれぞれについて前記第1および第2の符号化データを生成することを特徴とする請求項1に記載の画像処理装置。
The average value calculating means calculates an average value for each of RGB data for four pixels in the pixel block,
The representative value calculation means calculates the upper representative value and the lower representative value for each of RGB data for four pixels in the pixel block,
The image change determination means determines whether or not a difference between the upper representative value and the lower representative value is greater than a predetermined threshold for each of RGB data for four pixels in the pixel block,
The image processing apparatus according to claim 1, wherein the encoding processing unit generates the first and second encoded data for each of RGB data for four pixels in the pixel block.
前記第1の符号化データは、前記画像変化判定手段の判定結果を示すビットと、前記画素ブロック内の中心値を示すビット列と、前記中心値からの差分を示すビット列と、前記画素ブロック内のビットマップデータとを含んでおり、
前記第2の符号化データは、前記画像変化判定手段の判定結果を示すビットと、前記上代表値を表すビット列と、前記下代表値を表すビット列と、前記画素ブロック内のビットマップデータとを含むことを特徴とする請求項1または2に記載の画像処理装置。
The first encoded data includes a bit indicating a determination result of the image change determination unit, a bit string indicating a center value in the pixel block, a bit string indicating a difference from the center value, and a bit string in the pixel block. Bitmap data,
The second encoded data includes a bit indicating a determination result of the image change determination unit, a bit string indicating the upper representative value, a bit string indicating the lower representative value, and bitmap data in the pixel block. The image processing apparatus according to claim 1, further comprising:
前記上下代表値計算手段は、累積加算した回数が2または4の場合には、前記第1の累積加算値または前記第2の累積加算値を表すビット列をシフトさせることにより前記上代表値または前記下代表値を計算し、累積加算した回数が3の場合には、前記第1の累積加算値または前記第2の累積加算値に所定のビット列を乗じることにより近似的に前記上代表値または前記下代表値を計算することを特徴とする請求項1乃至3のいずれかに記載の画像処理装置。   When the number of cumulative additions is 2 or 4, the upper and lower representative value calculating means shifts the bit string representing the first cumulative addition value or the second cumulative addition value to shift the upper representative value or the When the lower representative value is calculated and the cumulative number of additions is 3, the upper representative value or the approximate value is approximately calculated by multiplying the first cumulative addition value or the second cumulative addition value by a predetermined bit string. The image processing apparatus according to claim 1, wherein a lower representative value is calculated. 前記記憶装置に格納された前記第1の符号化データおよび前記第2の符号化データを復号する復号化処理手段を備え、
前記復号化処理手段は、
前記第1の符号化データおよび前記第2の符号化データに含まれる、前記画像変化判定手段の判定結果を示すビットと、前記画素ブロックの代表値に対応するビット列と、前記画素ブロック内のビットマップデータとを抽出する符号化データ抽出部と、
前記符号化データ抽出部にて抽出したデータに基づいて、前記画素ブロックごとに符号化前の画素値を復元する画素復元計算手段と、を有することを特徴とする請求項1乃至4のいずれかに記載の画像処理装置。
Decoding means for decoding the first encoded data and the second encoded data stored in the storage device;
The decryption processing means includes:
A bit indicating a determination result of the image change determination means, a bit string corresponding to a representative value of the pixel block, and a bit in the pixel block, which are included in the first encoded data and the second encoded data An encoded data extraction unit for extracting map data;
5. A pixel restoration calculation unit that restores a pixel value before encoding for each of the pixel blocks based on data extracted by the encoded data extraction unit. An image processing apparatus according to 1.
JP2007238077A 2007-09-13 2007-09-13 Image processing unit Pending JP2009071598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007238077A JP2009071598A (en) 2007-09-13 2007-09-13 Image processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007238077A JP2009071598A (en) 2007-09-13 2007-09-13 Image processing unit

Publications (1)

Publication Number Publication Date
JP2009071598A true JP2009071598A (en) 2009-04-02

Family

ID=40607399

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007238077A Pending JP2009071598A (en) 2007-09-13 2007-09-13 Image processing unit

Country Status (1)

Country Link
JP (1) JP2009071598A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011124866A (en) * 2009-12-11 2011-06-23 Toshiba Corp Encoding apparatus and display control apparatus
JP2014187539A (en) * 2013-03-22 2014-10-02 Mega Chips Corp Image processing apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011124866A (en) * 2009-12-11 2011-06-23 Toshiba Corp Encoding apparatus and display control apparatus
JP2014187539A (en) * 2013-03-22 2014-10-02 Mega Chips Corp Image processing apparatus
US9532075B2 (en) 2013-03-22 2016-12-27 Megachips Corporation Image processor

Similar Documents

Publication Publication Date Title
EP2688042B1 (en) Image processing
JP4444968B2 (en) Alpha image processing
KR101547434B1 (en) Selective lossless-lossy compression of image data based on bit budget
EP1697900B1 (en) Multi-mode image processing
US7668383B2 (en) Image processing, compressing, decompressing, transmitting, sending and receiving devices and methods, programs thereof and displaying device
KR102294830B1 (en) Display drive device and method of operating image data processing device
JP5548064B2 (en) Display system and display device driver
US7808510B2 (en) Image processing apparatus, image transmission apparatus, display, image processing method, and image transmission method
US8270747B2 (en) Image encoding device, image decoding device, and integrated circuit
US10417951B2 (en) Image processing apparatus
KR20150057405A (en) Display driving device and display device including the same
JP6744757B2 (en) Image compression device, image decompression device, image compression decompression system, and display driver
US8358861B2 (en) Image compression device and image decompression device
US20090129685A1 (en) Image processing apparatus, image transmitting apparatus and method and program of the same and display device
JP2009071598A (en) Image processing unit
KR101028161B1 (en) Data compression-decompression apparatus and method for flat display panel memory and apparatus of histogram data precessing, lut data compression and frame rate enhancement using the same
JP4552400B2 (en) Image display device, image display method, and image display program
JP2005055825A (en) Image display device, image display method and image display program
JP2008079224A (en) Image data processing system, and image data processing method
JP2009027556A (en) Image processing circuit
KR20150028716A (en) Image encoding apparatus and image encoding method
KR101868435B1 (en) Image encoding device and image processing device including the same
CN110300303B (en) Encoding device, display device, method for controlling encoding device, and computer-readable recording medium
US7864191B2 (en) Techniques for efficient dithering
JP3642158B2 (en) Image encoding device, image encoding method, image decoding device, image decoding method, and transmission method