JP2009027556A - Image processing circuit - Google Patents

Image processing circuit Download PDF

Info

Publication number
JP2009027556A
JP2009027556A JP2007190007A JP2007190007A JP2009027556A JP 2009027556 A JP2009027556 A JP 2009027556A JP 2007190007 A JP2007190007 A JP 2007190007A JP 2007190007 A JP2007190007 A JP 2007190007A JP 2009027556 A JP2009027556 A JP 2009027556A
Authority
JP
Japan
Prior art keywords
value
pixel
pixel block
data
representative values
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
JP2007190007A
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 JP2007190007A priority Critical patent/JP2009027556A/en
Publication of JP2009027556A publication Critical patent/JP2009027556A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To improve the compressibility of image data by a simple hardware configuration without deteriorating image quality. <P>SOLUTION: An LCD source driver 2 includes an RGB data receiving circuit 4, an RGB/YCC converting circuit, a BTC coding circuit 6, a coded data memory 7, a BTC decoding circuit 8, a YCC/RGB converting circuit 9, and an LCD driving circuit 10. It is detected whether a change amount of pixels in a pixel block exceeds a threshold or not. When exceeding the threshold, it is determined that a change of an image is extremely large, and 3-level maximum/minimum exception BTC coding processing is performed in which pixels in the pixel block are converted into three representative values and coded. In the case that the change amount is smaller than or equal to the threshold, it is determined that the image is flat, and 2-level differential BTC coding processing is performed in which pixels in the pixel block are converted into two representative values and coded. In 3-level maximum/minimum exception BTC coding processing, the threshold is computed based on an average value of pixel values excepting a maximum value MAX and a minimum value MIN in the pixel block, thereby selecting three representative values meeting actual luminance and color tones. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像データを符号化する画像処理回路に関する。   The present invention relates to an image processing circuit that encodes image data.

PCで生成した画像のような人工的な画像では、文字やウィンドウ枠などの人工的な絵文字情報を正しく表示できないと、違和感を感じやすい。特に、文字情報を違和感なく表示することは重要である。   An artificial image such as an image generated by a PC tends to feel uncomfortable if artificial pictographic information such as characters and window frames cannot be displayed correctly. In particular, it is important to display character information without a sense of incongruity.

特許文献1では、画素ブロック内の4レベルの代表値を設定して画像の品質保持を図っている。ところが、特許文献1の技術では、画像が本来的に3レベルの値からなる場合には、その画像を正しく表示できない。特許文献1では、4レベルの代表値を選択するにあたり、最大と最小の2つの代表値を保存し、残りの2つの代表値は、最大・最小の代表値から補間して予想することで、保存メモリの削減を図っている。このため、この補間による予想が実際のデータとうまく一致するときには問題ないが、画像が本来的に3レベルの値からなる場合は、実際の画像とは異なる画像が生成されてしまう。   In Patent Document 1, four levels of representative values in a pixel block are set to maintain image quality. However, with the technique of Patent Document 1, when an image originally has three levels, the image cannot be displayed correctly. In Patent Document 1, when selecting four levels of representative values, the maximum and minimum two representative values are stored, and the remaining two representative values are predicted by interpolation from the maximum and minimum representative values. The saving memory is reduced. For this reason, there is no problem when the prediction by the interpolation is in good agreement with the actual data, but when the image is essentially composed of three levels, an image different from the actual image is generated.

このような問題に対処するには、代表値を正しく予想することが大切である。しかしながら、特許文献2においても、2つの代表色から等間隔で補間して代表値を選定している。ここでは、3レベルでの補間も含んでいるが、等間隔で補間する点は同じである。   To cope with such problems, it is important to correctly predict representative values. However, also in Patent Document 2, representative values are selected by interpolating from two representative colors at equal intervals. Here, although interpolation at three levels is included, the point of interpolation at equal intervals is the same.

非特許文献1ではビットマップ情報をRGBで共通に利用し、かつ代表値を4ビット精度および差分モード時に5ビット精度とすることで、高い圧縮効果を実現している。しかしその一方で次のような問題がある。   Non-Patent Document 1 achieves a high compression effect by using bitmap information in common for RGB and setting the representative value to 4-bit accuracy and 5-bit accuracy in the differential mode. However, there are the following problems.

ビットマップ情報をRGBで1つに共通化するために、量子化テーブル、代表色、修飾子の組み合わせを最適に選択する必要があり、これは非常に探索負担が大きい。特に、携帯機器用LCDドライバICの内蔵RAMに格納されるビット圧縮データを生成するのは、ハードウェアの負担が非常に大きい。   In order to share bitmap information in one RGB, it is necessary to optimally select a combination of a quantization table, a representative color, and a modifier, which has a very heavy search burden. In particular, generating the bit-compressed data stored in the built-in RAM of the LCD driver IC for portable devices has a very heavy hardware load.

また、ビットマップ共通化は、輝度と色を個別に制御することができないから、色の急激な変化に対しては4×2ブロックの大きなサイズのアーティファクト(カラーバウンディング:色固定)として知覚されてしまうという問題がある。また、8ビットの高階調を実現するには、差分モード時でも代表値で5ビット精度しか確保されず、大きな問題となる。量子化テーブルの精度は平坦な画像の場合でも高くとれないため、8ビット精度を保証するこができないためである。
米国特許7058218公報 米国特許7043087公報 Jacob Stroem, Thomas Akenine-Moeller. iPACKMAN: High-Quality, Low-Complexity texture Compression for Mobile Phones, ACM Graphics Hardware 2005, pp. 63- 70.
In addition, since it is impossible to control the brightness and the color separately in the bitmap sharing, it is perceived as a large size artifact (color bounding: color fixed) of 4 × 2 blocks for a sudden change in color. There is a problem of end. Further, in order to realize a high gradation of 8 bits, only a 5-bit accuracy is ensured as a representative value even in the differential mode, which is a serious problem. This is because the accuracy of the quantization table cannot be ensured even in the case of a flat image, and therefore 8-bit accuracy cannot be guaranteed.
US Pat. No. 7,058,218 US Pat. No. 7,043,877 Jacob Stroem, Thomas Akenine-Moeller.iPACKMAN: High-Quality, Low-Complexity texture Compression for Mobile Phones, ACM Graphics Hardware 2005, pp. 63- 70.

本発明は、画質を劣化させずに簡易なハードウェア構成で画像データの圧縮率を高めることが可能な画像処理回路を提供するものである。   The present invention provides an image processing circuit capable of increasing the compression rate of image data with a simple hardware configuration without degrading the image quality.

本発明の一態様によれば、隣接する複数画素からなる画素ブロックのそれぞれごとに、前記画素ブロック内の複数画素の画素値同士の差分が所定の閾値を超えたか否かを判定する活動量検出手段と、前記画素ブロックのそれぞれごとに、前記所定の閾値を設定する閾値設定手段と、前記活動量検出手段により前記所定の閾値を超えたと判定された前記画素ブロック内の各画素値をn(nは2以上の整数)個の代表値に変換してビット圧縮する第1の符号化処理を行い、前記活動量検出手段により前記所定の閾値を超えなかったと判定された前記画素ブロック内の各画素値を前記n個以下の代表値に変換してビット圧縮する第2の符号化処理を行う符号化手段と、を備え、前記閾値設定手段は、前記画素ブロック内の各画素値の最大値および最小値を除いた残りの画素値に基づいて、前記画素ブロック内の各画素値の平均値を計算する平均値計算手段と、前記画素ブロック内の各画素値の最大値および最小値と、前記平均値計算手段で計算された平均値と、に基づいて、前記閾値を計算する閾値計算手段と、を有することを特徴とする画像処理回路が提供される。   According to one aspect of the present invention, for each pixel block composed of a plurality of adjacent pixels, an activity amount detection that determines whether or not a difference between pixel values of a plurality of pixels in the pixel block exceeds a predetermined threshold value. Means, threshold setting means for setting the predetermined threshold for each of the pixel blocks, and each pixel value in the pixel block determined to have exceeded the predetermined threshold by the activity amount detecting means n ( n is an integer equal to or greater than 2) and is subjected to a first encoding process in which bit compression is performed, and each of the pixel blocks in the pixel block determined to have not exceeded the predetermined threshold by the activity amount detection unit Encoding means for performing a second encoding process for converting the pixel value into the n or less representative values and performing bit compression, and the threshold value setting means is a maximum value of each pixel value in the pixel block. And most Average value calculating means for calculating an average value of each pixel value in the pixel block based on the remaining pixel values excluding the value, a maximum value and a minimum value of each pixel value in the pixel block, and the average There is provided an image processing circuit comprising threshold value calculation means for calculating the threshold value based on an average value calculated by the value calculation means.

本発明によれば、画質を劣化させずに画像データの圧縮率を高めることができる。   According to the present invention, it is possible to increase the compression rate of image data without degrading the image quality.

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

図1は本実施形態による画像処理回路を内蔵した液晶表示装置の概略構成を示すブロック図である。図1の液晶表示装置は、液晶パネル(LCD:Liquid Crystal Display)1と、液晶パネル1を駆動するLCDソースドライバ2と、LCDソースドライバ2にRGBの画像データを供給するRGBデータ送信回路3とを備えている。RGBデータ送信回路は、例えばアプリケーションプロセッサである。   FIG. 1 is a block diagram showing a schematic configuration of a liquid crystal display device incorporating an image processing circuit according to the present embodiment. 1 includes a liquid crystal panel (LCD) 1, an LCD source driver 2 that drives the liquid crystal panel 1, and an RGB data transmission circuit 3 that supplies RGB image data to the LCD source driver 2. It has. The RGB data transmission circuit is, for example, an application processor.

LCDソースドライバ2は、RGBデータ受信回路4と、RGB/YCC変換回路5と、BTC符号化回路6と、符号化データメモリ7と、BTC復号化回路8と、YCC/RGB変換回路9と、LCD駆動回路10とを有する。   The LCD source driver 2 includes an RGB data receiving circuit 4, an RGB / YCC conversion circuit 5, a BTC encoding circuit 6, an encoded data memory 7, a BTC decoding circuit 8, a YCC / RGB conversion circuit 9, And an LCD driving circuit 10.

RGBデータ受信回路4は、RGBデータ送信回路3から送信された画像データを受信する。RGB/YCC変換回路5は、RGBの画像データを、輝度データYおよび色差データCb,CrからなるYCCデータに変換する。BTC符号化回路6は、輝度データYおよび色差データCb,Crに対応する符号化データを生成する。生成された符号化データは、符号化データメモリ7に格納される。   The RGB data receiving circuit 4 receives the image data transmitted from the RGB data transmitting circuit 3. The RGB / YCC conversion circuit 5 converts RGB image data into YCC data composed of luminance data Y and color difference data Cb and Cr. The BTC encoding circuit 6 generates encoded data corresponding to the luminance data Y and the color difference data Cb and Cr. The generated encoded data is stored in the encoded data memory 7.

BTC復号化回路8は、符号化データメモリ7に格納されている符号化データを読み出して、輝度データYおよび色差データCb,Crを復元する。YCC/RGB変換回路9は、復元された輝度データYおよび色差データをRGBの画像データに変換する。LCD駆動回路10は、変換された画像データをアナログ画素電圧に変換して液晶パネル1に供給する。   The BTC decoding circuit 8 reads the encoded data stored in the encoded data memory 7 and restores the luminance data Y and the color difference data Cb, Cr. The YCC / RGB conversion circuit 9 converts the restored luminance data Y and color difference data into RGB image data. The LCD drive circuit 10 converts the converted image data into an analog pixel voltage and supplies it to the liquid crystal panel 1.

図2は図1のBTC符号化回路6の内部構成の一例を示すブロック図である。図2のBTC符号化回路6は、4Hラインメモリ11と、16画素保存レジスタ12と、変化量計算部13と、最大最小計算部14と、閾値計算部15と、代表値計算部16と、ビットマップ計算部17と、圧縮データ保存レジスタ18とを有する。   FIG. 2 is a block diagram showing an example of the internal configuration of the BTC encoding circuit 6 of FIG. The BTC encoding circuit 6 in FIG. 2 includes a 4H line memory 11, a 16-pixel storage register 12, a change amount calculation unit 13, a maximum / minimum calculation unit 14, a threshold value calculation unit 15, a representative value calculation unit 16, A bitmap calculation unit 17 and a compressed data storage register 18 are included.

4Hラインメモリ11は、4水平ライン分の画像データを格納するだけのメモリ容量を有する。16画素保存レジスタ12は、4Hラインメモリ11に格納された画像データのうち、1画素ブロック(4×4=16画素)分の画像データを格納する。   The 4H line memory 11 has a memory capacity enough to store image data for four horizontal lines. The 16-pixel storage register 12 stores image data for one pixel block (4 × 4 = 16 pixels) among the image data stored in the 4H line memory 11.

変化量計算部13は、画素ブロック内の輝度データYの変化量と色差データCb,Crの変化量を計算する。最大最小計算部14は、画素ブロック内の輝度データYの最大値および最小値と、色差データCb,Crの最大値および最小値とを計算する。   The change amount calculation unit 13 calculates the change amount of the luminance data Y and the change amounts of the color difference data Cb and Cr in the pixel block. The maximum / minimum calculation unit 14 calculates the maximum value and the minimum value of the luminance data Y in the pixel block, and the maximum value and the minimum value of the color difference data Cb and Cr.

閾値計算部15は、画素ブロック内の輝度データYの閾値と色差データCb,Crの閾値とを計算する。代表値計算部16は、画素ブロック内の輝度データYの代表値と色差データCb,Crの代表値とを計算する。   The threshold value calculation unit 15 calculates the threshold value of the luminance data Y and the threshold values of the color difference data Cb and Cr in the pixel block. The representative value calculator 16 calculates the representative value of the luminance data Y and the representative values of the color difference data Cb and Cr in the pixel block.

ビットマップ計算部17は、画素ブロック内の輝度データYの符号化データのビットマップと色差データCb,Crの符号化データのビットマップとを計算する。   The bitmap calculation unit 17 calculates a bitmap of encoded data of luminance data Y and a bitmap of encoded data of color difference data Cb and Cr in the pixel block.

圧縮データ保存レジスタ18は、画素ブロック内の輝度データYの符号化データと色差データCb,Crの符号化データを格納する。圧縮データ保存レジスタ18に格納された1画素ブロック分の符号化データは、符号化データメモリ7に転送される。   The compressed data storage register 18 stores encoded data of luminance data Y and encoded data of color difference data Cb and Cr in the pixel block. The encoded data for one pixel block stored in the compressed data storage register 18 is transferred to the encoded data memory 7.

図3は図1のBTC復号化回路8の内部構成の一例を示すブロック図である。図3のBTC復号化回路8は、圧縮データ保存レジスタ21と、フラグ抽出部22と、代表値抽出部23と、ビットマップ抽出部24と、16画素保存レジスタ25と、4Hラインメモリ26とを有する。   FIG. 3 is a block diagram showing an example of the internal configuration of the BTC decoding circuit 8 of FIG. The BTC decoding circuit 8 of FIG. 3 includes a compressed data storage register 21, a flag extraction unit 22, a representative value extraction unit 23, a bitmap extraction unit 24, a 16 pixel storage register 25, and a 4H line memory 26. Have.

圧縮データ保存レジスタ21は、符号化データメモリ7に格納されている1画素ブロック分の符号化データを保存する。符号化データは、後述するように、圧縮形式を示すフラグ情報と、代表値を表すビット列と、16画素分の符号情報を示すビットマップとを含んでいる。このような符号化データに対して、フラグ抽出部22はフラグ情報を抽出し、代表値抽出部23は代表値を表すビット列を抽出し、ビットマップ抽出部24はビットマップを抽出する。   The compressed data storage register 21 stores encoded data for one pixel block stored in the encoded data memory 7. As will be described later, the encoded data includes flag information indicating a compression format, a bit string indicating a representative value, and a bitmap indicating code information for 16 pixels. For such encoded data, the flag extraction unit 22 extracts flag information, the representative value extraction unit 23 extracts a bit string representing the representative value, and the bitmap extraction unit 24 extracts a bitmap.

抽出された各ビット列は、輝度データYと色差データCb,Crに変換された後に16画素保存レジスタ25に格納される。16画素保存レジスタ25に格納された輝度データYおよび色差データCb,Crは、4Hラインメモリ26に格納される。4Hラインメモリ26に格納された符号化データは、YCC/RGB変換回路9にてRGBの画像データに変換された後、LCD駆動回路10内の1Hラインメモリ27に転送される。   Each extracted bit string is converted into luminance data Y and color difference data Cb, Cr and then stored in the 16-pixel storage register 25. The luminance data Y and the color difference data Cb and Cr stored in the 16 pixel storage register 25 are stored in the 4H line memory 26. The encoded data stored in the 4H line memory 26 is converted into RGB image data by the YCC / RGB conversion circuit 9 and then transferred to the 1H line memory 27 in the LCD drive circuit 10.

図4は図1のBTC復号化回路8の内部構成の変形例を示すブロック図である。図4のBTC復号化回路8は、YCC/RGB変換回路9と4Hラインメモリ26の接続順序が図3と逆になっている。   FIG. 4 is a block diagram showing a modification of the internal configuration of the BTC decoding circuit 8 of FIG. In the BTC decoding circuit 8 of FIG. 4, the connection order of the YCC / RGB conversion circuit 9 and the 4H line memory 26 is reverse to that of FIG.

図4の場合、4Hラインメモリ26に格納された画像データを1H(1水平ライン)単位で1Hラインメモリ27に転送でき、転送効率がよくなる。また、図4の場合、BTC復号化回路8の回路構成はランダムロジックであり、BTC復号化回路8の外側に規則構造からなる4Hラインメモリ26と1Hラインメモリ27をまとめたため、効率的なレイアウト設計が行える。   In the case of FIG. 4, the image data stored in the 4H line memory 26 can be transferred to the 1H line memory 27 in units of 1H (one horizontal line), and the transfer efficiency is improved. In the case of FIG. 4, the circuit configuration of the BTC decoding circuit 8 is random logic, and the 4H line memory 26 and the 1H line memory 27 having a regular structure are grouped outside the BTC decoding circuit 8. Can design.

本実施形態による画像処理回路は、図1のBTC符号化回路6とBTC復号化回路8の少なくとも一方を含むことを特徴としている。   The image processing circuit according to the present embodiment includes at least one of the BTC encoding circuit 6 and the BTC decoding circuit 8 of FIG.

図5は本実施形態による画像処理回路の概略的な処理手順の一例を示すフローチャートである。このフローチャートは、図1のRGB/YCC変換回路5とBTC符号化回路6の処理動作に対応する。   FIG. 5 is a flowchart showing an example of a schematic processing procedure of the image processing circuit according to the present embodiment. This flowchart corresponds to the processing operations of the RGB / YCC conversion circuit 5 and the BTC encoding circuit 6 of FIG.

まず、RGBの画像データをYCCの色空間に変換する(ステップS1)。次に、画素ブロック内での画像の変化量を計算する(ステップS2)。   First, RGB image data is converted into a YCC color space (step S1). Next, an image change amount in the pixel block is calculated (step S2).

次に、輝度データYと色差データCb,Crのそれぞれについて、画素ブロック内での変化量が予め定めた閾値未満であるか否かを判定する(ステップS3)。   Next, for each of the luminance data Y and the color difference data Cb and Cr, it is determined whether or not the amount of change in the pixel block is less than a predetermined threshold (step S3).

変化量が閾値未満であれば、画素ブロックに対して後述する2レベル差分BTCによる符号化処理を行う(ステップS4)。変化量が閾値未満ということは、画素ブロック内が平坦な画像であることを示しており、画素ブロック内の各画素の輝度データおよび色差データをそれぞれ2レベルで表現しても差し支えないため、各画素の輝度データYおよび色差データCb,Crをそれぞれ2レベルに置き換えた符号化データを生成する。   If the change amount is less than the threshold value, the pixel block is subjected to an encoding process using a two-level difference BTC described later (step S4). When the amount of change is less than the threshold value, it indicates that the pixel block is a flat image, and the luminance data and color difference data of each pixel in the pixel block may be expressed in two levels. Encoded data is generated by replacing the luminance data Y of the pixels and the color difference data Cb and Cr with two levels.

一方、変化量が閾値以上であれば、画素ブロックに対して後述する3レベル最大最小除外BTCによる符号化処理を行う(ステップS5)。変化量が閾値以上ということは、画素ブロック内の画像の変化が激しいことを示している。そこで、画素ブロック内の各画素を3レベルで表現することにする。なお、色情報は、輝度情報ほど人間が敏感に差異を視覚できないため、色差データCb,Crについては、変化量が閾値以上であっても、2レベルで表現してもよい。   On the other hand, if the amount of change is equal to or greater than the threshold value, the pixel block is subjected to encoding processing using a 3-level maximum / minimum exclusion BTC described later (step S5). That the amount of change is equal to or greater than the threshold value indicates that the change in the image in the pixel block is severe. Therefore, each pixel in the pixel block is expressed by three levels. In addition, since color information cannot be visually perceived as sensitively as luminance information, color difference data Cb and Cr may be expressed in two levels even if the amount of change is greater than or equal to a threshold value.

上述した図3において、ステップS1は色情報変換手段に、ステップS3は活動量検出手段に、ステップS4,S5は符号化手段に対応する。   In FIG. 3 described above, step S1 corresponds to color information conversion means, step S3 corresponds to activity amount detection means, and steps S4 and S5 correspond to encoding means.

以下、図5の処理動作を詳述する。図6は4×4画素からなる画素ブロックの一例を示す図である。図6中の各画素の数字は輝度データYの値を表している。図6では、画素ブロック内に3種類の輝度データ値が存在する例を示している。   Hereinafter, the processing operation of FIG. 5 will be described in detail. FIG. 6 is a diagram showing an example of a pixel block composed of 4 × 4 pixels. The number of each pixel in FIG. 6 represents the value of the luminance data Y. FIG. 6 shows an example in which three types of luminance data values exist in the pixel block.

図6において、輝度データYの最大値MAXと最小値MINの差分は、255−0=255である。この差分を画像データの変化量Δとして定義する。この変化量Δが小さければ、画像は平坦であることを示し、変化量が大きければ、画像の変化が激しいことを示す。   In FIG. 6, the difference between the maximum value MAX and the minimum value MIN of the luminance data Y is 255-0 = 255. This difference is defined as the change amount Δ of the image data. If the amount of change Δ is small, it indicates that the image is flat, and if the amount of change is large, it indicates that the image changes drastically.

変化量Δが小さければ、画素ブロック内にレベルの異なる2つの代表値を設けることにする。この場合、代表値同士の値は似通っているため、それぞれの代表値をそのままビット列で表現するのではなく、2つの代表値の中央値と、これら代表値の差分値とで表すことにする。すなわち、代表値1=中央値+差分値、代表値2=中央値−差分値とする。   If the change amount Δ is small, two representative values having different levels are provided in the pixel block. In this case, since the values of the representative values are similar, each representative value is not expressed as a bit string as it is, but is expressed by a median value of two representative values and a difference value of these representative values. That is, representative value 1 = median value + difference value, representative value 2 = median value−difference value.

中央値は例えば8ビットで表現されるが、変化量Δが小さいことが前提であるため、差分値として8ビットを設ける必要はなく、例えば差分は5ビットで足りる。このようにしても、8ビット精度で2つの代表値を計算できるため、8ビットの精度が保証できる。   The median value is expressed by 8 bits, for example, but since it is assumed that the amount of change Δ is small, it is not necessary to provide 8 bits as the difference value, and for example, the difference is 5 bits. Even in this case, since two representative values can be calculated with 8-bit accuracy, 8-bit accuracy can be guaranteed.

一方、変化量Δが大きい場合、人間の視覚は8ビット精度で認識できないことから、荒く4ビットにしても支障はない。そこで、この場合は、レベルの異なる3つの代表値を設けるものの、各代表値のビット幅を削減する。携帯電話等に用いられる小サイズ画面に高精細画像を表示する場合、画素ブロックを3レベルで表現することで、画像のエッジ変化のギザギザ感を緩和でき、高画質を維持できる。   On the other hand, when the amount of change Δ is large, human vision cannot be recognized with 8-bit accuracy, so even rough 4 bits will not cause any problem. Therefore, in this case, although three representative values having different levels are provided, the bit width of each representative value is reduced. When a high-definition image is displayed on a small-size screen used for a mobile phone or the like, the jagged feeling of the edge change of the image can be reduced and the high image quality can be maintained by expressing the pixel block at three levels.

変化量は、輝度データYと色差データCb,Crのそれぞれについて計算されるが、各データの変化量の最大値MAXを最終的な変化量としてもよい。すなわち、輝度データYの変化量をΔY、色差データCbの変化量をΔCb、色差データCrの変化量をΔCrとすると、最終的な変化量Δ=MAX(ΔY,ΔCb,ΔCr)としてもよい。   The amount of change is calculated for each of the luminance data Y and the color difference data Cb, Cr, but the maximum value MAX of the amount of change of each data may be the final amount of change. That is, if the change amount of the luminance data Y is ΔY, the change amount of the color difference data Cb is ΔCb, and the change amount of the color difference data Cr is ΔCr, the final change amount Δ = MAX (ΔY, ΔCb, ΔCr) may be obtained.

自然画像における青空は、変化量Δ=15以下であることが経験的にわかっている。また、青空と地上の境界では、変化量Δ=31以下であることも経験的にわかっている。そこで、例えば、これらの経験的な値を参考にして、図5のステップS3における閾値Δthを設定する。なお、後述するように、閾値Δthは、所定のアルゴリズムに従って計算してもよい。以下では、輝度データYと色差データCb,Crごとに別個に変化量と閾値を設定する例について説明する。   It has been empirically known that the blue sky in the natural image has a change amount Δ = 15 or less. It is also empirically known that the change amount Δ = 31 or less at the boundary between the blue sky and the ground. Therefore, for example, the threshold value Δth in step S3 in FIG. 5 is set with reference to these empirical values. As will be described later, the threshold Δth may be calculated according to a predetermined algorithm. Hereinafter, an example in which the change amount and the threshold value are set separately for each of the luminance data Y and the color difference data Cb and Cr will be described.

図7は図6の画素ブロックに対応する符号化データを示す図である。図7の符号化データは、図1のBTC符号化回路6により生成される。   FIG. 7 is a diagram showing encoded data corresponding to the pixel block of FIG. The encoded data in FIG. 7 is generated by the BTC encoding circuit 6 in FIG.

図6の場合、変化量Δが255−0=255であり、変化量Δは閾値Δthよりも大きいと判定され、3レベル最大最小除外BTC符号化処理が行われる。画素ブロック内の各画素は、3つの代表値で表される。3つの代表値は、図7に示すように、それぞれ4ビットで表現される。3つの代表値”0000”、”1000”、”1111”はLSB側4ビットを省略したビット列である。これら3つの代表値には、実際には4ビットに圧縮することによる調整値として8が足される。これにより、代表値”0000”は値8を表し、代表値”1000”は128+8=136を表し、代表値”1111”は240+8=248を表すことになる。   In the case of FIG. 6, the change amount Δ is 255-0 = 255, and it is determined that the change amount Δ is larger than the threshold value Δth, and the 3-level maximum / minimum exclusion BTC encoding process is performed. Each pixel in the pixel block is represented by three representative values. The three representative values are each represented by 4 bits as shown in FIG. Three representative values “0000”, “1000”, and “1111” are bit strings in which 4 bits on the LSB side are omitted. To these three representative values, 8 is actually added as an adjustment value by compressing to 4 bits. Thus, the representative value “0000” represents the value 8, the representative value “1000” represents 128 + 8 = 136, and the representative value “1111” represents 240 + 8 = 248.

8を足さなかった場合、全体として輝度が暗くなることから、上述した調整値が必要となる。3つの代表値は、それぞれ4ビットで保存されるが、実際にはLSB側に4ビットの”1000”を加えて8ビットとして利用される。   When 8 is not added, the brightness becomes dark as a whole, and thus the adjustment value described above is necessary. Each of the three representative values is stored as 4 bits, but actually, 4 bits “1000” is added to the LSB side and used as 8 bits.

図6の画素ブロックは3つの代表値で表されるため、これら代表値を識別する情報としては2ビットで足りる。そこで、画素ブロックのビットマップを表す情報は、図7に示すように各画素を2ビットとして、計2×16=32ビットで表される。   Since the pixel block in FIG. 6 is represented by three representative values, two bits are sufficient as information for identifying these representative values. Therefore, the information representing the pixel block bitmap is represented by 2 × 16 = 32 bits in total, with each pixel being 2 bits as shown in FIG.

以上より、図6の画素ブロックの符号化データは、図7に示すように、3つの代表値を表す計4×3=12ビットのビット列と、画素ブロックのビットマップを表す32ビットのビット列とを合わせた計44ビットで表される。   As described above, the encoded data of the pixel block in FIG. 6 includes a bit string of 4 × 3 = 12 bits in total representing three representative values, and a 32-bit bit string representing a bitmap of the pixel block, as shown in FIG. Is represented by a total of 44 bits.

なお、3つの代表値を4ビットに圧縮する際、圧縮の仕方を変えれば、必ずしも調整値を加える必要はなくなる。したがって、調整値を任意に変更できるようにしてもよい。   When the three representative values are compressed to 4 bits, it is not always necessary to add adjustment values if the compression method is changed. Therefore, the adjustment value may be arbitrarily changed.

本実施形態は、iPACKMANのような全サーチによる最適化を行わずに、後述する決定的なアルゴリズムにより計算を行うため、ハードウェアで実現する場合のハードウェアの規模縮小が図れる。   In the present embodiment, calculation is performed by a definitive algorithm described later without performing optimization by full search as in iPACKMAN, so that the hardware scale when realized by hardware can be reduced.

図8は画素ブロックの他の例を示す図、図9は図8の画素ブロックに対応する符号化データを示す図である。図8の画素ブロック内の各数字は輝度データYの値を示している。   FIG. 8 is a diagram illustrating another example of the pixel block, and FIG. 9 is a diagram illustrating encoded data corresponding to the pixel block of FIG. Each number in the pixel block in FIG. 8 indicates the value of the luminance data Y.

図8の画素ブロックの変化量Δは、145−115=30である。この場合、変化量Δが閾値よりも小さいと判断され、2レベル差分BTC符号化処理が行われる。画素ブロック内の各画素は2つの代表値で表される。   The change amount Δ of the pixel block in FIG. 8 is 145−115 = 30. In this case, it is determined that the change amount Δ is smaller than the threshold value, and a two-level differential BTC encoding process is performed. Each pixel in the pixel block is represented by two representative values.

図8の画素ブロック内の輝度データYの平均値は130である。平均値以上の値を持つ画素(図8の白ヌキ部)の平均値(上平均値)は135、平均値未満の値を持つ画素(図8の斜線部)の平均値(下平均値)は125である。上平均値と平均値との差分値は5で、下平均値と平均値との差分値は−5である。したがって、平均値130と差分値5だけで、各画素の値をおおまかに表現できる。そこで、図8の画素ブロックを符号化する際には、平均値130を表すビット列と、平均値からの差分値5を表すビット列とで、画素ブロック内の2つの代表値を表す。   The average value of the luminance data Y in the pixel block in FIG. The average value (upper average value) of pixels having a value equal to or higher than the average value (white dark area in FIG. 8) is 135, and the average value (lower average value) of pixels having a value less than the average value (shaded area in FIG. 8). Is 125. The difference value between the upper average value and the average value is 5, and the difference value between the lower average value and the average value is −5. Therefore, the value of each pixel can be roughly expressed by only the average value 130 and the difference value 5. Therefore, when encoding the pixel block of FIG. 8, two representative values in the pixel block are represented by a bit string representing the average value 130 and a bit string representing the difference value 5 from the average value.

図8の画素ブロックのように、画像の変化が小さい場合、図6のように変化の激しい画像と比べて、画素単位での変化に気づきやすい。このため、代表値を表すビット列のビット幅を増やして画素単位のビット精度を上げる。具体的には、図9に示すように、平均値を表すビット列は8ビットで表現する。また、平均値からの差分値はあまり大きな値にならないため、図9に示すように5ビットのビット列で表現する。   When the change in the image is small as in the pixel block of FIG. 8, it is easier to notice the change in the pixel unit than in the image with a rapid change as shown in FIG. 6. For this reason, the bit width of the bit string representing the representative value is increased to increase the bit accuracy in units of pixels. Specifically, as shown in FIG. 9, the bit string representing the average value is represented by 8 bits. Further, since the difference value from the average value is not so large, it is expressed by a 5-bit bit string as shown in FIG.

また、図8の画素ブロックは2つの代表値しかないため、これら2つの代表値の識別は1ビットで行える。したがって、図9に示すように、ビットマップは計16ビットで表現する。   Further, since the pixel block of FIG. 8 has only two representative values, these two representative values can be identified by one bit. Therefore, as shown in FIG. 9, the bitmap is expressed by a total of 16 bits.

この結果、図8の画素ブロックに対応する符号化データは、図9に示すように、平均値を表す8ビットと、差分値を表す5ビットと、ビットマップを表す16ビットの計29ビットになる。   As a result, as shown in FIG. 9, the encoded data corresponding to the pixel block in FIG. 8 is a total of 29 bits including 8 bits representing the average value, 5 bits representing the difference value, and 16 bits representing the bitmap. Become.

次に、色差データCb,Crの符号化処理について説明する。図10は画素ブロックの一例を示す図、図11は図10の画素ブロックを2×2画素のサブブロックごとに間引いた例を示す図、図12は画素ブロックを4つのサブブロックの値だけで表した図である。   Next, the encoding process of the color difference data Cb and Cr will be described. FIG. 10 is a diagram illustrating an example of a pixel block, FIG. 11 is a diagram illustrating an example in which the pixel block of FIG. 10 is thinned out for each 2 × 2 pixel sub-block, and FIG. FIG.

図11および図12は、4×4画素の画素ブロックを2×2画素のサブブロックに分割して、各サブブロック内の画素値を等しくする間引き処理を行った例を示している。このような間引き処理は、420間引きとして一般に知られている。   FIGS. 11 and 12 show an example in which a 4 × 4 pixel block is divided into 2 × 2 pixel sub-blocks, and a thinning process is performed to equalize the pixel values in each sub-block. Such decimation processing is generally known as 420 decimation.

サブブロックの値は、サブブロックを構成する4つの画素の平均値である。例えば、図10の画素ブロック内の左上のサブブロックの値は、(128+255+0+128)/4=128になる。   The value of the sub block is an average value of four pixels constituting the sub block. For example, the value of the upper left sub-block in the pixel block of FIG. 10 is (128 + 255 + 0 + 128) / 4 = 128.

図12は図10の画素ブロックを4つの画素値だけで表現しているが、420間引きを行えば、4つの画素値だけで画素ブロックの全画素の値を表現できるため、データ量を大幅に削減できることがわかる。   FIG. 12 represents the pixel block of FIG. 10 with only four pixel values. However, if 420 decimation is performed, the values of all the pixels in the pixel block can be represented with only four pixel values. It can be seen that it can be reduced.

図13は420間引きを行った後の符号化処理を示す図である。図10の画素ブロックは、変化量Δが大きい例を示すが、色差データは輝度データYよりも空間的変化が緩やかであるため、輝度データYのように3つの代表値を設ける必要はない。そこで、本実施形態では2つの代表値を設け、各代表値のビット長を、LSB側4ビットを省略して4ビットとする。また、各代表値を表すビット列に、データ圧縮の調整値として8を加えることとする。   FIG. 13 is a diagram showing an encoding process after performing 420 thinning. The pixel block in FIG. 10 shows an example in which the amount of change Δ is large. However, since the color difference data has a smaller spatial change than the luminance data Y, it is not necessary to provide three representative values unlike the luminance data Y. Therefore, in this embodiment, two representative values are provided, and the bit length of each representative value is set to 4 bits by omitting 4 bits on the LSB side. Further, 8 is added to the bit string representing each representative value as an adjustment value for data compression.

図13の例では、2つの代表値を表すビット列を”0000”と”1111”とする例を示しているが、これらビット列は実際にはLSB側に”0100”を加えた値を持つ。すなわち、”0000”は値8を表し、”1111”は値248を表す。   The example of FIG. 13 shows an example in which the bit strings representing two representative values are “0000” and “1111”, but these bit strings actually have values obtained by adding “0100” to the LSB side. That is, “0000” represents the value 8 and “1111” represents the value 248.

また、画素ブロックを表すビットマップは、図13に示すように、わずか4ビット”0100” (左上から右下への順番)で表現できる。結果として、図10の画素ブロックは、4×2+4=12ビットで表現できる。   Further, as shown in FIG. 13, the bitmap representing the pixel block can be expressed by only 4 bits “0100” (in order from the upper left to the lower right). As a result, the pixel block of FIG. 10 can be expressed by 4 × 2 + 4 = 12 bits.

一方、図14は画素ブロック内の画像が平坦な場合(変化量が閾値よりも小さい場合)の符号化処理の一例を示す図である。画素ブロック内の変化量が小さい場合は、図9と同様に、画素ブロック内の平均値を表すビット列と、平均値からの差分値を表すビット列と、ビットマップを表すビット列とを含む符号化データを生成する。   On the other hand, FIG. 14 is a diagram showing an example of the encoding process when the image in the pixel block is flat (when the change amount is smaller than the threshold value). When the amount of change in the pixel block is small, similarly to FIG. 9, encoded data including a bit string representing an average value in the pixel block, a bit string representing a difference value from the average value, and a bit string representing a bitmap. Is generated.

図14の場合、平均値を表すビット列は8ビットで表現し、平均値を表すビット列は5ビットで表現し、ビットマップを表すビット列は4ビットで表現する。これにより、画素ブロック内の画素値が8ビット精度になるようにする。   In the case of FIG. 14, the bit string representing the average value is represented by 8 bits, the bit string representing the average value is represented by 5 bits, and the bit string representing the bitmap is represented by 4 bits. Thereby, the pixel value in the pixel block is made to have 8-bit precision.

ここで、差分値は量子化(圧縮)していないことに注意されたい。ビット幅を削減するには、差分値も量子化するのが望ましく、差分値を量子化する公知技術も存在する。差分値を量子化する必要性があるのは、差分値が画素値と同じ範囲の値を取りうるためである。   Note that the difference value is not quantized (compressed). In order to reduce the bit width, it is desirable to quantize the difference value, and there is a known technique for quantizing the difference value. The reason that the difference value needs to be quantized is that the difference value can take a value in the same range as the pixel value.

本実施形態では、最大値MAXと最小値MINの差分である変化量が閾値Δthよりも小さい場合しか、差分値を符号化しないため、差分値は画素値よりはるかに小さな値しか取らない。これにより、差分値のビット幅を画素値のビット幅よりも少なくしても、画素値のビット幅の精度を確保できる。   In the present embodiment, the difference value is encoded only when the amount of change, which is the difference between the maximum value MAX and the minimum value MIN, is smaller than the threshold value Δth. Therefore, the difference value takes a value much smaller than the pixel value. Thereby, even if the bit width of the difference value is made smaller than the bit width of the pixel value, the accuracy of the bit width of the pixel value can be ensured.

図9等では、閾値Δth=30としており、差分値は−15〜+15の範囲内であり、差分値は4ビットで表現できる。図9では、閾値Δthが31を超える場合も考慮して、差分値を5ビットで表現しているが、Δthを30以下に限定してよければ差分値を4ビットで表現できる。   In FIG. 9 and the like, the threshold value Δth = 30, the difference value is in the range of −15 to +15, and the difference value can be expressed by 4 bits. In FIG. 9, considering the case where the threshold value Δth exceeds 31, the difference value is expressed by 5 bits. However, if Δth is limited to 30 or less, the difference value can be expressed by 4 bits.

図15は画素ブロックの変化量Δが閾値Δthよりも大きい場合の輝度データYと色差データCb,Crの符号化データの一例を示す図であり、図7と図13の符号化データを組み合わせたものである。図15の場合、輝度データYの符号化データが44ビットで、色差データCb,Crの符号化データが各12ビットであり、計68ビットの符号化データになる。   FIG. 15 is a diagram showing an example of encoded data of the luminance data Y and the color difference data Cb and Cr when the change amount Δ of the pixel block is larger than the threshold value Δth. The encoded data of FIGS. 7 and 13 are combined. Is. In the case of FIG. 15, the encoded data of the luminance data Y is 44 bits, the encoded data of the color difference data Cb and Cr is 12 bits each, and the encoded data is 68 bits in total.

図16は画素ブロックの変化量Δが閾値Δthよりも小さい場合の輝度データYと色差データCb,Crの符号化データの一例を示す図であり、図9と図14の符号化データを組み合わせたものである。図16の場合、輝度データYの符号化データが29ビットで、色差データCb,Crの符号化データが各17ビットであり、計63ビットの符号化データになる。   FIG. 16 is a diagram illustrating an example of the encoded data of the luminance data Y and the color difference data Cb and Cr when the change amount Δ of the pixel block is smaller than the threshold value Δth. The encoded data of FIGS. 9 and 14 are combined. Is. In the case of FIG. 16, the encoded data of the luminance data Y is 29 bits, the encoded data of the color difference data Cb and Cr is 17 bits each, and the encoded data is 63 bits in total.

図17は図15および図16の符号化データの先頭ビットに圧縮形式を示すフラグ情報を追加した符号化データの一例を示す図である。このフラグ情報は、図15のように3つの代表値を設けて符号化データを生成する3レベル最大最小除外BTC符号化処理を行った場合には0になり、図16のように2つの代表値を設けて符号化データを生成する2レベル差分BTC符号化処理を行った場合には1になる。   FIG. 17 is a diagram illustrating an example of encoded data in which flag information indicating a compression format is added to the first bit of the encoded data in FIGS. 15 and 16. This flag information becomes 0 when three-level maximum / minimum exclusion BTC encoding processing for generating encoded data by providing three representative values as shown in FIG. 15, and two representative values as shown in FIG. When a two-level differential BTC encoding process for generating encoded data by providing a value is performed, the value is 1.

なお、先にも述べたが、Y、Cb、Crそれぞれに独立に判定を行えばフラグは3つ必要で、Y、Cb、Crそれぞれで代表値とビットマップの選択を行う構成となる。ここではΔ=MAX(ΔY、ΔCb、ΔCr)と1つの最大Δで判定したフラグの構成例を示している。3つの独立したΔ判定を排除するわけではないが、最大Δでデータを構成することにより、後に図22で示すようにデータサイズを調整しやすいというメリットがある。もし独立してフラグ3つで取り扱いたいなら、これら3フラグ値の組み合わせに関する符号化データの構成があるので、その最大サイズで考える必要がある。   As described above, if determination is made independently for each of Y, Cb, and Cr, three flags are required, and a representative value and a bitmap are selected for each of Y, Cb, and Cr. Here, a configuration example of a flag determined by Δ = MAX (ΔY, ΔCb, ΔCr) and one maximum Δ is shown. Although the three independent Δ determinations are not excluded, by configuring the data with the maximum Δ, there is an advantage that the data size can be easily adjusted as shown in FIG. If it is desired to handle three flags independently, there is a structure of encoded data related to a combination of these three flag values, and it is necessary to consider the maximum size.

図17(a)は図15に対応する符号化データを示し、図17(b)は図16に対応する符号化データを示している。   17A shows the encoded data corresponding to FIG. 15, and FIG. 17B shows the encoded data corresponding to FIG.

図18は図5で説明した閾値の決め方を説明する図である。まず、画素ブロック内の最大値MAXと最小値MINを検出し、これら最大値MAXと最小値MINを除いた残りの画素値の平均値AVE’を計算する。最大値MAXと最小値MINを除いて平均値AVE’を計算することにより、平均値AVE’が最大値MAXまたは最小値MINの影響を受けなくなり、実際の輝度および色に近い平均値を検出できる。   FIG. 18 is a diagram for explaining how to determine the threshold value described in FIG. First, the maximum value MAX and the minimum value MIN in the pixel block are detected, and the average value AVE 'of the remaining pixel values excluding the maximum value MAX and the minimum value MIN is calculated. By calculating the average value AVE ′ excluding the maximum value MAX and the minimum value MIN, the average value AVE ′ is not affected by the maximum value MAX or the minimum value MIN, and an average value close to actual luminance and color can be detected. .

PCで生成した画像の場合、絵や文字が表示される割合が多く、最大値MAXや最小値MINが他の画素値とかけ離れた値になることがある。この場合、最大値MAXと最小値MINを用いて平均値を計算しても、実際の輝度や色とは異なった値である可能性が高い。   In the case of an image generated by a PC, the ratio of displaying pictures and characters is high, and the maximum value MAX and the minimum value MIN may be different from other pixel values. In this case, even if the average value is calculated using the maximum value MAX and the minimum value MIN, there is a high possibility that the value is different from the actual luminance or color.

また、PCで生成した画像に表示されるウィンドウ枠等の絵情報は、広範囲にわたって同じ色であることが多い。このため、最大値MAXと最小値MINを用いて平均値を計算すると、ウィンドウ枠の色やサイズ等によって、平均値が大きく変化してしまい、実際の画面全体の輝度や色合いとは異なったものになる。   In addition, picture information such as window frames displayed on an image generated by a PC often has the same color over a wide range. For this reason, when the average value is calculated using the maximum value MAX and the minimum value MIN, the average value varies greatly depending on the color and size of the window frame, and the actual brightness and color of the entire screen are different. become.

これに対して、自然画像の場合は、最大値MAXと最小値MINを考慮に入れて平均値を計算しても、実際の輝度や色との違いはそれほど感じられない。   On the other hand, in the case of a natural image, even if the average value is calculated in consideration of the maximum value MAX and the minimum value MIN, the difference from the actual brightness and color is not so much felt.

最大値MAXと最小値MINを除いて平均値AVE’を計算した後、図18に示すように、平均値AVE’と最小値MINとの中間値を低レベル閾値Th_lowとし、平均値AVE’と最大値MAXとの中間値を高レベル閾値Th_highとする。得られた低レベル閾値Th_lowと高レベル閾値Th_highは、画素ブロック内で3つの代表値を計算する場合に用いられる。   After calculating the average value AVE ′ excluding the maximum value MAX and the minimum value MIN, as shown in FIG. 18, an intermediate value between the average value AVE ′ and the minimum value MIN is set as a low level threshold Th_low, and the average value AVE ′ An intermediate value between the maximum value MAX is set as a high level threshold Th_high. The obtained low level threshold Th_low and high level threshold Th_high are used when three representative values are calculated in the pixel block.

本実施形態のように、最大値MAXと最小値MINを除いて平均値を計算すると、特にPCで生成した画像を符号化する場合に効果が大きい。PCで生成した画像の場合、画面全体に現れる輝度や色の数はそれほど多くないため、上述したように3レベルの符号化を行うことにより、画質を低下させずに圧縮率を高めることができる。   If the average value is calculated by removing the maximum value MAX and the minimum value MIN as in the present embodiment, the effect is particularly great when encoding an image generated by a PC. In the case of an image generated by a PC, the number of luminances and colors appearing on the entire screen is not so large. Therefore, by performing the three-level encoding as described above, the compression rate can be increased without degrading the image quality. .

一方、自然画像の場合、画像内に同じ値が存在する確率は低いため、低レベル閾値と高レベル閾値で区分けされる各領域の平均値を代表値とすることも考えられる。本実施形態では、処理の簡略化のために、PCで生成した画像でも自然画像でも、最大値MAXと最小値MINを除いて平均値を計算する。これにより、PCで生成した画像と自然画像で処理方法を変えなくて済み、ハードウェア構成を簡略化できるとともに、符号化処理に要する演算量も削減でき、高速に符号化処理を行うことができる。したがって、本実施形態は、携帯電話等のハードウェア性能が高くなく、メモリ容量も限られている電子機器に応用すると、より効果が大きい。   On the other hand, in the case of a natural image, since the probability that the same value exists in the image is low, an average value of each region divided by the low level threshold and the high level threshold may be used as the representative value. In the present embodiment, for simplification of processing, an average value is calculated by excluding the maximum value MAX and the minimum value MIN for both an image generated by a PC and a natural image. As a result, it is not necessary to change the processing method between the image generated by the PC and the natural image, the hardware configuration can be simplified, the amount of calculation required for the encoding process can be reduced, and the encoding process can be performed at high speed. . Therefore, the present embodiment is more effective when applied to an electronic device that does not have high hardware performance such as a mobile phone and has a limited memory capacity.

図19は画素ブロックの各画素を3つの代表値で表す処理手順の一例を示すフローチャートである。まず、画像ブロック中の最大値MAXと最小値MINを検出する(ステップS11)。次に、高レベル閾値Th_highおよび低レベル閾値Th_lowと、最大値MAXおよび最小値MINの中間値MINとを計算する(ステップS12)。このステップS12の詳細な処理手順は後述する。   FIG. 19 is a flowchart illustrating an example of a processing procedure in which each pixel of a pixel block is represented by three representative values. First, the maximum value MAX and the minimum value MIN in the image block are detected (step S11). Next, a high level threshold Th_high and a low level threshold Th_low, and an intermediate value MIN between the maximum value MAX and the minimum value MIN are calculated (step S12). The detailed processing procedure of step S12 will be described later.

次に、画素ブロック内の3つの代表値V_plus,V_mid,V_minusを計算する(ステップS13)。これら3つの代表値は以下の(1)〜(3)式で表される。
V_plus=Round1(MAX,bit) …(1)
V_mid=Round1(MID,bit) …(2)
V_plus=Round1(MIN,bit) …(3)
Next, three representative values V_plus, V_mid, and V_minus in the pixel block are calculated (step S13). These three representative values are represented by the following formulas (1) to (3).
V_plus = Round1 (MAX, bit) (1)
V_mid = Round1 (MID, bit) (2)
V_plus = Round1 (MIN, bit) (3)

関数Round1は、ビット幅の削減を行う関数であり、引数のbitは、削減後のビット幅を示している。   The function Round1 is a function for reducing the bit width, and the bit of the argument indicates the bit width after the reduction.

例えば、128は8ビットでは”10000000”であるが、4ビット”1000”で表される。実際にはビット圧縮時の調整値として8が加算されるため、V_mid=Round1(10000000,4)=128+8=136となる。同様に、V_plus=248、V_minus=8となる。これらV_plus、V_mid、V_minusが代表値となる。   For example, 128 is “10000000” in 8 bits, but is represented by 4 bits “1000”. Actually, since 8 is added as an adjustment value at the time of bit compression, V_mid = Round1 (10000000,4) = 128 + 8 = 136. Similarly, V_plus = 248 and V_minus = 8. These V_plus, V_mid, and V_minus are representative values.

次に、画素ブロック中の各画素を3つの代表値に振り分ける処理を行う(ステップS14〜S7)。まず、ステップS14では、画素値を高レベル閾値Th_highおよび低レベル閾値Th_lowと比較する。そして、画素値が高レベル閾値Th_high以上であれば、代表値V_plusを選択する(ステップS15)。画素値が低レベル閾値Th_lowより大きくて高レベル閾値Th_high未満であれば、代表値V_midを選択する(ステップS16)。画素値が低レベル以下であれば、代表値V_minを選択する(ステップS17)。   Next, a process of distributing each pixel in the pixel block into three representative values is performed (steps S14 to S7). First, in step S14, the pixel value is compared with a high level threshold Th_high and a low level threshold Th_low. If the pixel value is equal to or higher than the high level threshold Th_high, the representative value V_plus is selected (step S15). If the pixel value is greater than the low level threshold Th_low and less than the high level threshold Th_high, the representative value V_mid is selected (step S16). If the pixel value is below the low level, the representative value V_min is selected (step S17).

図20は図19のステップS18の詳細な処理手順の一例を示すフローチャートである。まず、画素値の総計を計算する変数SUMと、画素値の数を計測する変数CNTとをともにゼロに初期設定する(ステップS21)。   FIG. 20 is a flowchart showing an example of a detailed processing procedure of step S18 of FIG. First, a variable SUM for calculating the total pixel value and a variable CNT for measuring the number of pixel values are both initially set to zero (step S21).

次に、画素値が最大値MAXまたは最小値MINか否かを判定する(ステップS22)。ステップS22の判定がNOであれば、変数SUMに画素値を加算し、変数CNTを1だけ増やす(ステップS23)。   Next, it is determined whether the pixel value is the maximum value MAX or the minimum value MIN (step S22). If the determination in step S22 is NO, the pixel value is added to the variable SUM, and the variable CNT is increased by 1 (step S23).

ステップS22の判定がYESの場合、あるいはステップS23の処理が終了した場合は、画素ブロック内の全画素の処理が終わったか否かを判定する(ステップS24)。ステップS24の判定がNOの場合にはステップS22以降の処理を繰り返す。   If the determination in step S22 is YES, or if the process in step S23 is completed, it is determined whether or not the processing for all the pixels in the pixel block has been completed (step S24). When determination of step S24 is NO, the process after step S22 is repeated.

このステップS22〜S14の処理により、最大値MAXと最小値MINを除いた画素値の累積加算値が変数SUMに保持され、最大値MAXと最小値MINを除いた画素値の総数が変数CNTに保持される。   Through the processing in steps S22 to S14, the cumulative addition value of the pixel values excluding the maximum value MAX and the minimum value MIN is held in the variable SUM, and the total number of pixel values excluding the maximum value MAX and the minimum value MIN is stored in the variable CNT. Retained.

ステップS24の判定がYESの場合、変数CNTがゼロか否かを判定する(ステップS25)。変数CNTがゼロの場合は、画素ブロック内の全画素が最大値MAXか最小値MINであり、中間値が存在しないことを示しており、この場合は、2レベル(あるいは1レベル)を扱う仮の処理として、最大値MAXと最小値MINの中間値を計算し、これを中間値MIDとする(ステップS26)。   If the determination in step S24 is yes, it is determined whether the variable CNT is zero (step S25). When the variable CNT is zero, all the pixels in the pixel block have the maximum value MAX or the minimum value MIN, which indicates that there is no intermediate value. In this case, it is assumed that two levels (or one level) are handled. As a process of (2), an intermediate value between the maximum value MAX and the minimum value MIN is calculated, and this is set as the intermediate value MID (step S26).

ステップS25の判定がNOの場合、最大値MAXと最小値MINが等しいか否かを判定する(ステップS27)。両者が等しい場合、中間値が存在しないことになるが、仮の処理として最大値MAXを中間値として設定する(ステップS28)。   If the determination in step S25 is no, it is determined whether the maximum value MAX and the minimum value MIN are equal (step S27). If they are equal, there is no intermediate value, but the maximum value MAX is set as the intermediate value as a temporary process (step S28).

ステップS27の判定がNOの場合は、中間値が存在することを示しており、変数SUMを変数CNTで割った値を中間値MIDとして設定する(ステップS29)。この中間値MIDは、最大値MAXと最小値MINを除いた画素値の平均値に他ならない。このステップS29は平均値計算手段に対応する。   If the determination in step S27 is NO, it indicates that an intermediate value exists, and a value obtained by dividing the variable SUM by the variable CNT is set as the intermediate value MID (step S29). This intermediate value MID is nothing but an average value of pixel values excluding the maximum value MAX and the minimum value MIN. This step S29 corresponds to an average value calculation means.

ステップS26、S28またはS29の処理が終わった場合、以下の(4)(5)式に基づいて閾値を計算する(ステップS30)。このステップS30は閾値設定手段に対応する。
Th_high=ROUND((MAX+MID)/2) …(4)
Th_low=ROUND((MIN+MID)/2) …(5)
When the process of step S26, S28 or S29 is completed, a threshold value is calculated based on the following equations (4) and (5) (step S30). This step S30 corresponds to threshold setting means.
Th_high = ROUND ((MAX + MID) / 2) (4)
Th_low = ROUND ((MIN + MID) / 2) (5)

図20のフローチャートの特徴は、最適化のために検索処理を行わないことである。決定的なアルゴリズムで処理を行うため、少ない計算量で済み、計算時間も短縮できる。したがって、図20のフローチャートによれば、図2に示すBTC符号化回路6のハードウェア構成を簡略化できる。   The feature of the flowchart of FIG. 20 is that the search process is not performed for optimization. Since the process is performed with a definitive algorithm, a small amount of calculation is required and the calculation time can be shortened. Therefore, according to the flowchart of FIG. 20, the hardware configuration of the BTC encoding circuit 6 shown in FIG. 2 can be simplified.

このように、第1の実施形態では、画素ブロック内の画像の変化量が閾値を超えるか否かを検出し、閾値を超える場合には画像の変化が激しいと判断して、画素ブロック内の各画素を3つの代表値(色差データの場合は2つの代表値)に変換して符号化する3レベル最大最小除外BTC符号化処理を行い、変化量が閾値以下の場合には、平坦な画像と判断して、画素ブロック内の各画素を2つの代表値に変換して符号化する2レベル差分BTC符号化処理を行う。3レベル最大最小除外BTC符号化処理では、画素ブロック内の最大値MAXと最小値MINを除いた画素値の平均値に基づいて閾値を計算するため、実際の輝度および色合いに合致した3つの代表値を選択できる。3つの代表値は、それぞれ4ビットで表現するため、ビット幅の削減が図れる。2レベル差分BTC符号化処理では、420間引き処理を利用して2つの代表値を選定し、各代表値を8ビットで表現するため、8ビット精度が得られる。   As described above, in the first embodiment, it is detected whether or not the amount of change in the image in the pixel block exceeds the threshold. If the amount of change exceeds the threshold, it is determined that the change in the image is severe, A three-level maximum / minimum exclusion BTC encoding process is performed in which each pixel is converted into three representative values (two representative values in the case of color difference data) and encoded. Therefore, a two-level differential BTC encoding process is performed in which each pixel in the pixel block is converted into two representative values and encoded. In the 3-level maximum / minimum exclusion BTC encoding process, the threshold value is calculated based on the average value of the pixel values excluding the maximum value MAX and the minimum value MIN in the pixel block, and therefore, three representatives that match the actual luminance and hue. A value can be selected. Since the three representative values are each expressed by 4 bits, the bit width can be reduced. In the two-level differential BTC encoding process, two representative values are selected using the 420 decimation process, and each representative value is represented by 8 bits, so that 8-bit accuracy is obtained.

このような処理により、3レベル最大最小除外BTC符号化処理と2レベル差分BTC符号化処理のいずれでも、画質を劣化させずに、符号化データのビット幅をより削減できる。   With such a process, the bit width of the encoded data can be further reduced without degrading the image quality in any of the 3-level maximum / minimum exclusion BTC encoding process and the 2-level differential BTC encoding process.

(第2の実施形態)
第2の実施形態は、3レベル最大最小除外BTC符号化処理が第1の実施形態と異なることを特徴とする。この他は第1の実施形態と同様であるため、以下では、相違点を中心に説明する。
(Second Embodiment)
The second embodiment is characterized in that the three-level maximum / minimum exclusion BTC encoding process is different from that of the first embodiment. Since the rest is the same as that of the first embodiment, the following description will focus on the differences.

図21は第2の実施形態による3レベル最大最小除外BTC符号化処理の概要を説明する図である。図21(a)は画素ブロック内の各画素を3つの代表値で表現した場合のビットマップの一例を示す図である。   FIG. 21 is a diagram for explaining the outline of the 3-level maximum / minimum exclusion BTC encoding process according to the second embodiment. FIG. 21A is a diagram showing an example of a bitmap when each pixel in the pixel block is expressed by three representative values.

画素ブロック内の3画素からなるグループを考えると、このグループ内の代表値の組み合わせとして、3×3×3=27通りが考えられる。したがって、各グループを表現するには、5ビット(2の5乗=32>27)があれば足りる。したがって、各グループを2×3=6ビットで表現するよりも1ビット削減できる。   Considering a group of three pixels in a pixel block, there are 3 × 3 × 3 = 27 combinations of representative values in this group. Therefore, 5 bits (2 5 = 32> 27) are sufficient to represent each group. Accordingly, each group can be reduced by 1 bit, rather than expressed by 2 × 3 = 6 bits.

図21(a)では、隣接する3画素を一つのグループとして、破線で図示している。画素ブロック内に、5個のグループと残りの1画素ができる。各グループは、図21(b)に示すように、5ビットで表現される。したがって、ビットマップは、図21(c)に示すように、5×5+2=27ビットで表現でき、図7等のように32ビットのビットマップに比べて5ビットの削減になる。   In FIG. 21A, three adjacent pixels are shown as a group by a broken line. In the pixel block, five groups and one remaining pixel are formed. Each group is expressed by 5 bits as shown in FIG. Therefore, the bit map can be expressed by 5 × 5 + 2 = 27 bits as shown in FIG. 21C, and is reduced by 5 bits compared to the 32-bit bitmap as shown in FIG.

なお、図21では3画素を一つのグループにする例を説明したが、3画素以外の複数画素でグループを構成してもよい。ただし、ビットマップのビット幅をできるだけ削減するようなグループ分けが望ましい。ビット幅削減の観点からは、グループの数を増やすのが望ましい。したがって、ビットマップのビット幅を考慮しながらグループ分けを行うのが望ましい。   In addition, although the example which makes 3 pixels one group was demonstrated in FIG. 21, you may comprise a group by multiple pixels other than 3 pixels. However, grouping that reduces the bit width of the bitmap as much as possible is desirable. From the viewpoint of reducing the bit width, it is desirable to increase the number of groups. Therefore, it is desirable to perform grouping in consideration of the bit width of the bitmap.

図22は第2の実施形態にて生成した符号化データの一例を示す図である。図22の符号化データは、圧縮形式を示すフラグ情報が0の場合の符号化データが図17と異なる。より具体的には、ビットマップを構成するビット列が異なっており、フラグ情報が0の場合の総ビット幅は64ビットであり、図17に比べて5ビット削減されている。   FIG. 22 is a diagram illustrating an example of encoded data generated in the second embodiment. The encoded data in FIG. 22 differs from that in FIG. 17 in the case where the flag information indicating the compression format is 0. More specifically, the bit strings constituting the bitmap are different, and the total bit width when the flag information is 0 is 64 bits, which is reduced by 5 bits compared to FIG.

図21では、6ビットを5ビットに変換する手法について説明したが、ビットを削減する他の手法を採用してもよい。具体的には、3進表示での値を2進表示の値に変換する手法がある。例えば000101は、0×9+1×3+1=4であるため、3進表示では、011となる。したがって、2進表示に変換すると、00100になり、1ビット減って5ビットになることがわかる。なお、この手法も一例にすぎず、他の手法を採用してもよい。   In FIG. 21, the method of converting 6 bits to 5 bits has been described, but other methods of reducing bits may be employed. Specifically, there is a method of converting a value in ternary display into a value in binary display. For example, since 00101 is 0 × 9 + 1 × 3 + 1 = 4, it becomes 011 in the ternary display. Therefore, when converted to binary display, it becomes 00100, and it can be seen that 1 bit is reduced to 5 bits. This method is only an example, and other methods may be adopted.

このように、第2の実施形態では、3レベル最大最小除外BTC符号化処理を行う際に、ビットマップを表すビット幅をより削減できるため、符号化データのよりいっそうのビット幅削減が図れる。   As described above, in the second embodiment, when the 3-level maximum / minimum exclusion BTC encoding process is performed, the bit width representing the bitmap can be further reduced, so that the bit width of the encoded data can be further reduced.

(第3の実施形態)
第3の実施形態は、2レベル差分BTC符号化処理の内容が第1および第2の実施形態とは異なることを特徴とする。
(Third embodiment)
The third embodiment is characterized in that the contents of the two-level differential BTC encoding process are different from those in the first and second embodiments.

上述したように、2レベル差分BTC符号化処理では、画素ブロックの平均値と、この平均値からの差分値とを符号化データに含めている。差分値は、値が小さいものほど出現頻度が高い。したがって、出現頻度の高い差分値を表すビット列にできるだけ多くの0を含ませて、出現頻度の高い差分値ほど、ビットの遷移確率が低くなるようにする。これにより、BTC符号化回路6から符号化データメモリ7に符号化データを転送する際の消費電力削減を図る。   As described above, in the two-level difference BTC encoding process, the average value of the pixel block and the difference value from this average value are included in the encoded data. As the difference value is smaller, the appearance frequency is higher. Therefore, as many 0s as possible are included in the bit string representing the difference value having a high appearance frequency so that the difference value having the higher appearance frequency has a lower bit transition probability. As a result, power consumption when the encoded data is transferred from the BTC encoding circuit 6 to the encoded data memory 7 is reduced.

例えば、差分値0には符号00000を割り当て、発生頻度が最も低い差分値31には符号11111を割り当てる。これにより、符号化データメモリ7に格納されるデータが0に偏る。ビットが0から1、あるいは1から0に遷移すると、符号化データメモリ7には電流が流れて消費電力が増大する。したがって、ビットの遷移回数を減らすことにより、符号化データメモリ7の消費電力削減が図れる。   For example, a code 00000 is assigned to the difference value 0, and a code 11111 is assigned to the difference value 31 having the lowest occurrence frequency. Thereby, the data stored in the encoded data memory 7 is biased to zero. When the bit transitions from 0 to 1 or from 1 to 0, a current flows through the encoded data memory 7 and the power consumption increases. Therefore, the power consumption of the encoded data memory 7 can be reduced by reducing the number of bit transitions.

図23は差分値に対応する符号化データの一例を示す図である。ここで、遷移とは、符号化データメモリ7の同一の記憶領域にてビット値がフレーム間で変化することを意味し、差分値を表すビット列の0と1が変化するという意味ではない。したがって、ビットの遷移が少ないビット列よりも、ビット列中に0が多いビット列が優先的に選択される。   FIG. 23 is a diagram illustrating an example of encoded data corresponding to a difference value. Here, transition means that the bit value changes between frames in the same storage area of the encoded data memory 7, and does not mean that 0 and 1 of the bit string representing the difference value change. Therefore, a bit string with many 0s in the bit string is preferentially selected over a bit string with few bit transitions.

上記では、差分値の符号化について説明したが、ビットマップを表すビット列にも同じ原理を適用することができる。ビットマップ中の隣接する画素は同じ画素値を取ることが多い。そこで、第2の実施形態で説明した6ビットから5ビットへの変換の代わりに、ビット列の発生頻度を考慮に入れて5ビットへの変換を行ってもよい。   In the above description, encoding of the difference value has been described. However, the same principle can be applied to a bit string representing a bitmap. Adjacent pixels in the bitmap often take the same pixel value. Therefore, instead of the conversion from 6 bits to 5 bits described in the second embodiment, conversion to 5 bits may be performed in consideration of the occurrence frequency of the bit string.

図24は画素ブロックのビットマップに対応する符号化データの一例を示す図である。図24の「組み合わせ」の欄では、ビットマップ値00を値0、ビットマップ値01を値1、ビットマップ値10を値2としている。例えば、「00」「01」「01」なるビットマップの組み合わせは011である。   FIG. 24 is a diagram illustrating an example of encoded data corresponding to a bitmap of a pixel block. In the “combination” column of FIG. 24, the bitmap value 00 is a value 0, the bitmap value 01 is a value 1, and the bitmap value 10 is a value 2. For example, the combination of bitmaps “00”, “01”, and “01” is 011.

図21(a)のグループは全部で27種類あり、各グループを3ビット幅で表している。図21(a)では、グループを構成する3画素は隣接している必要はなかったが、本実施形態では、隣接する3画素にて一つのグループが構成されている。   There are 27 types of groups in FIG. 21A in total, and each group is represented by a 3-bit width. In FIG. 21A, the three pixels constituting the group need not be adjacent to each other, but in the present embodiment, one group is constituted by the adjacent three pixels.

グループを構成する3画素同士の変化量が少ないものは、3画素とも同じ値を取る組み合わせ”000”、”111”、”222”である。したがって、これらの組み合わせについては、1を最大一つしか含まない符号化データを割り当てる。   Those having a small change amount among the three pixels constituting the group are combinations “000”, “111”, and “222” that take the same value for all three pixels. Therefore, for these combinations, encoded data including at most one 1 is allocated.

逆に、組み合わせ”020”は最も変化量が大きい。0から2に変化して、また0に戻るため、変化量は2+2=4である。したがって、組み合わせ”020”には、すべてが1の符号化データを割り当てる。   Conversely, the combination “020” has the largest amount of change. Since the value changes from 0 to 2 and then returns to 0, the amount of change is 2 + 2 = 4. Therefore, all “1” encoded data is assigned to the combination “020”.

図25は第3の実施形態によるBTC符号化回路6の内部構成を示すブロック図、図26は第3の実施形態によるBTC復号化回路8の内部構成を示すブロック図である。図25および図26では、図2および図3と共通する構成部分には同一符号を付しており、以下では相違点を中心に説明する。   FIG. 25 is a block diagram showing the internal configuration of the BTC encoding circuit 6 according to the third embodiment, and FIG. 26 is a block diagram showing the internal configuration of the BTC decoding circuit 8 according to the third embodiment. In FIG. 25 and FIG. 26, the same reference numerals are given to the components common to FIG. 2 and FIG. 3, and the differences will be mainly described below.

図25のBTC符号化回路6は、図2になかった構成として、第1の遷移最小符号化回路31と、第2の遷移最小符号化回路32とを有する。第1の遷移最小符号化回路31は、図23に示すように、差分値に対応する符号化データを生成する。第2の遷移最小符号化回路32は、図24に示すように、ビットマップに対応する符号化データを生成する。   The BTC encoding circuit 6 in FIG. 25 includes a first transition minimum encoding circuit 31 and a second transition minimum encoding circuit 32 as a configuration not shown in FIG. As shown in FIG. 23, the first transition minimum encoding circuit 31 generates encoded data corresponding to the difference value. The second transition minimum encoding circuit 32 generates encoded data corresponding to the bitmap as shown in FIG.

第1および第2の遷移最小符号化回路31,32で生成された符号化データを用いて最終的な符号化データが生成されて、圧縮データ保存レジスタ18に保存される。   Final encoded data is generated using the encoded data generated by the first and second transition minimum encoding circuits 31 and 32 and stored in the compressed data storage register 18.

図26のBTC復号化回路8は、図3になかった構成として、第1の遷移最小復号化回路33と、第2の遷移最小復号化回路34とを有する。第1の遷移最小復号化回路33は、図23の符号化データを元の差分値に復号する。第2の遷移最小復号化回路34は、図24の符号化データを元のビットマップデータに復号する。   The BTC decoding circuit 8 of FIG. 26 includes a first transition minimum decoding circuit 33 and a second transition minimum decoding circuit 34 as configurations not shown in FIG. The first transition minimum decoding circuit 33 decodes the encoded data of FIG. 23 to the original difference value. The second transition minimum decoding circuit 34 decodes the encoded data in FIG. 24 into the original bitmap data.

第1および第2の遷移最小復号化回路33,34で復号された差分値およびビットマップデータは、16画素保存レジスタ12に保存されて、16画素分の輝度データYおよび色差データが生成される。   The difference value and bitmap data decoded by the first and second transition minimum decoding circuits 33 and 34 are stored in the 16-pixel storage register 12, and luminance data Y and color difference data for 16 pixels are generated. .

このように、第3の実施形態では、画像の相関が高いことを利用して、2レベル差分BTC符号化処理と3レベル最大最小除外BTC符号化処理にチャネル符号化技術を適用し、これにより符号化データメモリ7の消費電力(電流)の削減を図っている。より具体的には、出現頻度の高い差分値を表すビット列にできるだけ多くの0を割り当てるため、符号化データメモリ7でのビット遷移確率を削減でき、符号化データメモリ7の消費電力をより削減できる。また、ビットマップを構成するビット列についても、変化の少ない画素を表すビット列にできるだけ多くの0を割り当てるため、同様に符号化データメモリ7の消費電力の削減が図れる。   As described above, in the third embodiment, the channel coding technique is applied to the 2-level differential BTC encoding process and the 3-level maximum / minimum exclusion BTC encoding process by utilizing the fact that the correlation of images is high. The power consumption (current) of the encoded data memory 7 is reduced. More specifically, since as many 0s as possible are assigned to a bit string representing a difference value having a high appearance frequency, the bit transition probability in the encoded data memory 7 can be reduced, and the power consumption of the encoded data memory 7 can be further reduced. . Also, as for the bit strings constituting the bitmap, as many 0s as possible are assigned to the bit strings representing the pixels with little change, so that the power consumption of the encoded data memory 7 can be similarly reduced.

可変長符号を利用して符号化処理を行うと、符号化データメモリ7へのランダムアクセスが困難になる。そこで、本実施形態では、符号長(ビット幅)は共通にして符号化データメモリ7へのランダムアクセスを可能としている。図24の遷移最小符号化処理は可逆変換であり、この符号化により情報は失われないため、画質への影響はない。   When encoding processing is performed using a variable length code, random access to the encoded data memory 7 becomes difficult. Therefore, in the present embodiment, the code length (bit width) is shared, and random access to the encoded data memory 7 is possible. The transition minimum encoding process of FIG. 24 is a reversible conversion, and information is not lost by this encoding, so there is no influence on the image quality.

(第4の実施形態)
上述した2レベル差分BTC符号化処理では、420間引き処理を採用したが、3レベル最大最小除外BTC符号化処理と2レベル差分BTC符号化処理の少なくとも一方は、以下に説明する422間引き処理を行ってもよい。
(Fourth embodiment)
In the above-described 2-level differential BTC encoding process, 420 decimation processing is adopted, but at least one of the 3-level maximum / minimum exclusion BTC encoding process and 2-level differential BTC encoding process performs 422 decimation processing described below. May be.

図27は画素ブロックの一例を示す図である。図28は図27の画素ブロックを縦方向に隣接する2画素で422間引きを行った例を示す図である。図28では、縦方向に隣接する2画素の平均値を、その2画素の値として設定する。例えば、左上隅から縦方向に2画素の平均値は、(128+0)/2=64であり、これら2画素の値はいずれも64に設定される。   FIG. 27 is a diagram illustrating an example of a pixel block. FIG. 28 is a diagram showing an example in which the pixel block in FIG. 27 is thinned 422 by two pixels adjacent in the vertical direction. In FIG. 28, the average value of two pixels adjacent in the vertical direction is set as the value of the two pixels. For example, the average value of two pixels in the vertical direction from the upper left corner is (128 + 0) / 2 = 64, and the values of these two pixels are both set to 64.

図29は図28の処理結果を8画素で表現した図である。なお、縦方向に隣接する2画素の代わりに、横方向に隣接する2画素単位で422間引きを行ってもよい。   FIG. 29 is a diagram in which the processing result of FIG. 28 is expressed by 8 pixels. Note that 422 thinning may be performed in units of two pixels adjacent in the horizontal direction instead of two pixels adjacent in the vertical direction.

図30は2レベル差分BTC符号化処理の中で422間引き処理を行う例を示す図である。図30の場合、ビットマップが図13のような4ビットから8ビットに増加することで、空間的な解像度の向上が図れ、420間引きよりも元の画像に近い画像が得られる。   FIG. 30 is a diagram illustrating an example in which 422 decimation processing is performed in the two-level differential BTC encoding processing. In the case of FIG. 30, the bitmap is increased from 4 bits to 8 bits as shown in FIG. 13, so that the spatial resolution can be improved, and an image closer to the original image can be obtained than 420 thinning.

図30の符号化データは、2つの代表値をそれぞれ4ビット幅とし、データ圧縮による調整値として8を各代表値に加算する。   In the encoded data in FIG. 30, two representative values are each 4 bits wide, and 8 is added to each representative value as an adjustment value by data compression.

図31は縦方向および横方向の422間引きを行う場合の水平変化量と垂直変化量を説明する図である。水平方向の画素同士の変化量の総和が水平変化量であり、垂直方向の画素同士の変化量の総和が垂直変化量である。   FIG. 31 is a diagram for explaining the horizontal change amount and the vertical change amount when performing vertical and horizontal 422 decimation. The total change amount between the pixels in the horizontal direction is the horizontal change amount, and the total change amount between the pixels in the vertical direction is the vertical change amount.

図31の場合、水平方向変化量=0で、垂直変化量=4×5+4×20+4×5=120である。水平変化量と垂直変化量を比較して、変化量の小さい水平方向を選択して、422間引きを行う。   In the case of FIG. 31, the horizontal change amount = 0 and the vertical change amount = 4 × 5 + 4 × 20 + 4 × 5 = 120. The horizontal change amount is compared with the vertical change amount, the horizontal direction with a small change amount is selected, and 422 thinning is performed.

図32は図31の例について水平方向の422間引きを行って生成した符号化データの一例を示す図である。図32(a)は、BTCモード選択フラグが0の場合(輝度データYについて3レベル最大最小除外BTC符号化処理を行う場合)を示しており、一方の色差データCbだけを422間引きし、色差データCrは図17(a)と同様に420間引きをする例を示している。色差データCrに対しては、水平または垂直方向に変化量を計算したことを示すHV選択フラグが設けられる。このフラグが0であるので、水平方向に変化量を計算したことを示している。   FIG. 32 is a diagram showing an example of encoded data generated by performing 422 decimation in the horizontal direction for the example of FIG. FIG. 32A shows the case where the BTC mode selection flag is 0 (when the 3-level maximum / minimum exclusion BTC encoding process is performed on the luminance data Y), and only one of the color difference data Cb is thinned out 422 to obtain the color difference. Data Cr shows an example in which 420 thinning is performed as in FIG. For the color difference data Cr, an HV selection flag indicating that the change amount is calculated in the horizontal or vertical direction is provided. Since this flag is 0, it indicates that the amount of change is calculated in the horizontal direction.

色差データCrではなく、色差データCbについて422間引きを行う理由は、CrはCbよりも画素間の相関が強いためであり、色差データCrについて422間引きを行っても、さほど画質は改善しないためである。   The reason why the 422 thinning is performed for the color difference data Cb instead of the color difference data Cr is because Cr has a stronger correlation between pixels than Cb, and even if the 422 thinning is performed for the color difference data Cr, the image quality is not improved so much. is there.

一方、図32(b)は、BTCモード選択フラグが1の場合(輝度データYについて2レベル差分BTC符号化処理を行う場合)を示しており、色差データCb,Crともに422間引きを行う例を示している。   On the other hand, FIG. 32B shows a case where the BTC mode selection flag is 1 (when the 2-level difference BTC encoding process is performed on the luminance data Y), and an example in which 422 decimation is performed for both the color difference data Cb and Cr. Show.

図32(a)で、色差データCbしか422間引きを行わない理由は、BTCモード選択フラグが0の場合と1の場合で、符号化データの総ビット数を同じにするためである。   In FIG. 32A, the reason why only the color difference data Cb is subjected to 422 thinning is to make the total number of bits of encoded data the same when the BTC mode selection flag is 0 and 1.

なお、この第4の実施形態を第3の実施形態と組み合わせてもよい。   Note that this fourth embodiment may be combined with the third embodiment.

このように、第4の実施形態では、色差データについて422間引き処理を行うため、420間引き処理を行うよりも、画質向上が図れる。   Thus, in the fourth embodiment, since the 422 thinning process is performed on the color difference data, the image quality can be improved as compared with the 420 thinning process.

上述した各実施形態では、変化量が閾値よりも大きい場合には、輝度データYについては3つの代表値、色差データCb,Crについてはそれぞれ2つの代表値を設け、変化量が閾値以下の場合には、輝度データYと色差データCb,Crについていずれも2つの代表値を設ける例を説明したが、代表値の数には特に制限はない。代表値の数について一般化すると、変化量が閾値よりも大きい場合にはn(nは2以上の整数)個の代表値を設け、変化量が閾値以下の場合にはn個以下の代表値を設けることになる。   In each of the above-described embodiments, when the change amount is larger than the threshold value, three representative values are provided for the luminance data Y, and two representative values are provided for the color difference data Cb and Cr, and the change amount is equal to or less than the threshold value. In the above, an example in which two representative values are provided for both the luminance data Y and the color difference data Cb and Cr has been described, but the number of representative values is not particularly limited. When the number of representative values is generalized, n (n is an integer of 2 or more) representative values are provided when the change amount is larger than the threshold value, and n or less representative values are provided when the change amount is less than or equal to the threshold value. Will be provided.

本実施形態による画像処理回路を内蔵した液晶表示装置の概略構成を示すブロック図。1 is a block diagram showing a schematic configuration of a liquid crystal display device incorporating an image processing circuit according to an embodiment. 図1のBTC符号化回路6の内部構成の一例を示すブロック図。The block diagram which shows an example of an internal structure of the BTC encoding circuit 6 of FIG. 図1のBTC復号化回路8の内部構成の一例を示すブロック図。The block diagram which shows an example of an internal structure of the BTC decoding circuit 8 of FIG. 図1のBTC復号化回路8の内部構成の変形例を示すブロック図。The block diagram which shows the modification of the internal structure of the BTC decoding circuit 8 of FIG. 本実施形態による画像処理回路の概略的な処理手順の一例を示すフローチャート。5 is a flowchart illustrating an example of a schematic processing procedure of the image processing circuit according to the present embodiment. 4×4画素からなる画素ブロックの一例を示す図。The figure which shows an example of the pixel block which consists of 4x4 pixels. 図6の画素ブロックに対応する符号化データを示す図。The figure which shows the encoding data corresponding to the pixel block of FIG. 画素ブロックの他の例を示す図。The figure which shows the other example of a pixel block. 図8の画素ブロックに対応する符号化データを示す図。The figure which shows the encoding data corresponding to the pixel block of FIG. 画素ブロックの一例を示す図。The figure which shows an example of a pixel block. 図10の画素ブロックを2×2画素のサブブロックごとに間引いた例を示す図。The figure which shows the example which thinned out the pixel block of FIG. 10 for every 2 * 2 pixel subblock. 画素ブロックを4つのサブブロックの値だけで表した図。The figure which represented the pixel block only with the value of four subblocks. 420間引きを行った後の符号化処理を示す図。The figure which shows the encoding process after performing 420 thinning. 画素ブロック内の画像が平坦な場合の符号化処理の一例を示す図。The figure which shows an example of an encoding process in case the image in a pixel block is flat. 画素ブロックの変化量Δが閾値Δthよりも大きい場合の輝度データYと色差データCb,Crの符号化データの一例を示す図。The figure which shows an example of the coding data of luminance data Y and color difference data Cb, Cr when the variation | change_quantity (DELTA) of a pixel block is larger than threshold value (DELTA) th. 画素ブロックの変化量Δが閾値Δthよりも小さい場合の輝度データYと色差データCb,Crの符号化データの一例を示す図。The figure which shows an example of the encoding data of luminance data Y and color difference data Cb and Cr when the variation | change_quantity (DELTA) of a pixel block is smaller than threshold value (DELTA) th. (a)(b)は図15および図16の符号化データの先頭ビットに圧縮形式を示すフラグ情報を追加した符号化データの一例を示す図。(A) and (b) are figures which show an example of the coding data which added the flag information which shows a compression format to the head bit of the coding data of FIG.15 and FIG.16. 図5で説明した閾値の決め方を説明する図。The figure explaining how to determine the threshold value explained in FIG. 画素ブロックの各画素を3つの代表値で表す処理手順の一例を示すフローチャート。The flowchart which shows an example of the process sequence which represents each pixel of a pixel block with three representative values. 図19のステップS18の詳細な処理手順の一例を示すフローチャート。20 is a flowchart showing an example of a detailed processing procedure of step S18 of FIG. (a)(b)(c)は第2の実施形態による3レベル最大最小除外BTC符号化処理の概要を説明する図。(A), (b), and (c) are diagrams for explaining an overview of a 3-level maximum / minimum exclusion BTC encoding process according to the second embodiment. (a)(b)は第2の実施形態にて生成した符号化データの一例を示す図。(A) and (b) are figures which show an example of the coding data produced | generated in 2nd Embodiment. 差分値に対応する符号化データの一例を示す図。The figure which shows an example of the coding data corresponding to a difference value. 画素ブロックのビットマップに対応する符号化データの一例を示す図。The figure which shows an example of the encoding data corresponding to the bitmap of a pixel block. 第3の実施形態によるBTC符号化回路6の内部構成を示すブロック図。The block diagram which shows the internal structure of the BTC encoding circuit 6 by 3rd Embodiment. 第3の実施形態によるBTC復号化回路8の内部構成を示すブロック図。The block diagram which shows the internal structure of the BTC decoding circuit 8 by 3rd Embodiment. 画素ブロックの一例を示す図。The figure which shows an example of a pixel block. 図27の画素ブロックを縦方向に隣接する2画素で422間引きを行った例を示す図。FIG. 28 is a diagram showing an example in which the pixel block in FIG. 27 is subjected to 422 thinning by two pixels adjacent in the vertical direction. 図28の処理結果を8画素で表現した図。The figure which expressed the processing result of FIG. 28 by 8 pixels. 2レベル差分BTC符号化処理の中で422間引き処理を行う例を示す図。The figure which shows the example which performs 422 thinning-out processing in 2 level difference BTC encoding processing. 縦方向および横方向の422間引きを行う場合の水平変化量と垂直変化量を説明する図。The figure explaining the horizontal variation | change_quantity and vertical variation | change_quantity in the case of performing 422 thinning | decimation in the vertical direction and a horizontal direction. 図31の例について水平方向の422間引きを行って生成した符号化データの一例を示す図。The figure which shows an example of the coding data produced | generated by performing 422 thinning | decimation of the horizontal direction about the example of FIG.

符号の説明Explanation of symbols

1 液晶パネル
2 LCDソースドライバ
3 RGBデータ送信回路
4 RGBデータ受信回路
5 RGB/YCC変換回路
6 BTC符号化回路
7 符号化データメモリ
8 BTC復号化回路
9 YCC/RGB変換回路
10 LCD駆動回路
11 4Hラインメモリ
12 16画素保存レジスタ
13 変化量計算部
14 最大最小計算部
15 閾値計算部
16 代表値計算部
17 ビットマップ計算部
18 圧縮データ保存レジスタ
21 圧縮データ保存レジスタ
22 フラグ抽出部
23 代表値抽出部
24 ビットマップ抽出部
25 16画素保存レジスタ
26 4Hラインメモリ
27 1Hラインメモリ
DESCRIPTION OF SYMBOLS 1 Liquid crystal panel 2 LCD source driver 3 RGB data transmission circuit 4 RGB data reception circuit 5 RGB / YCC conversion circuit 6 BTC encoding circuit 7 Encoded data memory 8 BTC decoding circuit 9 YCC / RGB conversion circuit 10 LCD drive circuit 11 4H Line memory 12 16 pixel storage register 13 change amount calculation unit 14 maximum / minimum calculation unit 15 threshold calculation unit 16 representative value calculation unit 17 bitmap calculation unit 18 compressed data storage register 21 compressed data storage register 22 flag extraction unit 23 representative value extraction unit 24 Bitmap extraction unit 25 16 pixel storage register 26 4H line memory 27 1H line memory

Claims (5)

隣接する複数画素からなる画素ブロックのそれぞれごとに、前記画素ブロック内の複数画素の画素値同士の差分が所定の閾値を超えたか否かを判定する活動量検出手段と、
前記画素ブロックのそれぞれごとに、前記所定の閾値を設定する閾値設定手段と、
前記活動量検出手段により前記所定の閾値を超えたと判定された前記画素ブロック内の各画素値をn(nは2以上の整数)個の代表値に変換してビット圧縮する第1の符号化処理を行い、前記活動量検出手段により前記所定の閾値を超えなかったと判定された前記画素ブロック内の各画素値を前記n個以下の代表値に変換してビット圧縮する第2の符号化処理を行う符号化手段と、を備え、
前記閾値設定手段は、
前記画素ブロック内の各画素値の最大値および最小値を除いた残りの画素値に基づいて、前記画素ブロック内の各画素値の平均値を計算する平均値計算手段と、
前記画素ブロック内の各画素値の最大値および最小値と、前記平均値計算手段で計算された平均値と、に基づいて、前記閾値を計算する閾値計算手段と、を有することを特徴とする画像処理回路。
An activity amount detecting means for determining whether or not a difference between pixel values of a plurality of pixels in the pixel block exceeds a predetermined threshold for each of the pixel blocks composed of a plurality of adjacent pixels;
Threshold setting means for setting the predetermined threshold for each of the pixel blocks;
First encoding that converts each pixel value in the pixel block determined to have exceeded the predetermined threshold by the activity amount detection means into n (n is an integer of 2 or more) representative values and performs bit compression. A second encoding process for performing bit compression by converting each pixel value in the pixel block determined to have not exceeded the predetermined threshold by the activity amount detection means to the n or less representative values Encoding means for performing
The threshold setting means includes
Average value calculating means for calculating an average value of the pixel values in the pixel block based on the remaining pixel values excluding the maximum value and the minimum value of the pixel values in the pixel block;
Threshold value calculating means for calculating the threshold value based on a maximum value and a minimum value of each pixel value in the pixel block and an average value calculated by the average value calculating means; Image processing circuit.
前記第1の符号化処理は、前記第1の符号化処理を行ったことを示すフラグ情報と、前記n個の代表値をビット圧縮処理したビット列と、前記画素ブロック内の各画素に対応する代表値の割り当てを示すビットマップ情報と、を含む第1の符号化データを生成し、
前記第2の符号化処理は、前記第2の符号化処理を行ったことを示すフラグ情報と、前記n個以下の代表値をビット圧縮処理したビット列と、前記画素ブロック内の各画素に対応する代表値の割り当てを示すビットマップ情報と、を含む第2の符号化データを生成することを特徴とする請求項1に記載の画像処理回路。
The first encoding process corresponds to flag information indicating that the first encoding process has been performed, a bit string obtained by bit compression processing of the n representative values, and each pixel in the pixel block. Generating first encoded data including bitmap information indicating assignment of representative values;
The second encoding process corresponds to flag information indicating that the second encoding process has been performed, a bit string obtained by bit compression processing of the n or less representative values, and each pixel in the pixel block. The image processing circuit according to claim 1, wherein second encoded data including bitmap information indicating assignment of representative values to be generated is generated.
前記第1の符号化データは、前記n個の代表値をビット圧縮したビット列に対応する値に共通の値を足し合わせた値であることを特徴とする請求項2に記載の画像処理回路。   The image processing circuit according to claim 2, wherein the first encoded data is a value obtained by adding a common value to a value corresponding to a bit string obtained by bit-compressing the n representative values. 前記第2の符号化処理は、
前記画素ブロックを縦長または横長の複数のサブブロックに分割した後、前記複数のサブブロックのそれぞれに前記n個以下の代表値のいずれかを割り当てて、前記第2の符号化データを生成することを特徴とする請求項2または3に記載の画像処理回路。
The second encoding process includes:
After dividing the pixel block into a plurality of vertically or horizontally long sub-blocks, assigning one of the n or less representative values to each of the plurality of sub-blocks to generate the second encoded data The image processing circuit according to claim 2, wherein:
複数の色情報からなる画像データを輝度データと色差データとに変換する色情報変換手段を備え、
前記活動量検出手段は、前記画素ブロックのそれぞれごとに、前記画素ブロック内の複数画素の輝度データの差分と色差データの差分とのそれぞれが所定の閾値を超えたか否かを判定し、
前記第1の符号化処理は、
前記活動量検出手段により前記所定の閾値を超えたと判定された前記画素ブロック内の複数画素の輝度データを3個の代表値に変換してビット圧縮する第3の符号化処理と、
前記活動量検出手段により前記所定の閾値を超えたと判定された前記画素ブロック内の複数画素の色差データを2個の代表値に変換してビット圧縮する第4の符号化処理と、を含み、
前記第2の符号化処理は、
前記活動量検出手段により前記所定の閾値を超えなかったと判定された前記画素ブロック内の複数画素の輝度データを中央値と差分値とに変換してビット圧縮する第5の符号化処理と、
前記活動量検出手段により前記所定の閾値を超えなかったと判定された前記画素ブロック内の複数画素の色差データを中央値と差分値とに変換してビット圧縮する第6の符号化処理と、を含むことを特徴とする請求項1乃至4のいずれかに記載の画像処理回路。
Color information conversion means for converting image data consisting of a plurality of color information into luminance data and color difference data,
The activity amount detecting means determines, for each of the pixel blocks, whether or not each of a difference in luminance data and a difference in color difference data of a plurality of pixels in the pixel block exceeds a predetermined threshold value,
The first encoding process includes:
A third encoding process for converting the luminance data of a plurality of pixels in the pixel block determined to have exceeded the predetermined threshold by the activity amount detection means into three representative values and performing bit compression;
A fourth encoding process that converts the color difference data of a plurality of pixels in the pixel block determined to have exceeded the predetermined threshold by the activity amount detection means into two representative values and performs bit compression, and
The second encoding process includes:
A fifth encoding process for converting the luminance data of a plurality of pixels in the pixel block determined not to exceed the predetermined threshold by the activity amount detection means into a median value and a difference value and bit-compressing the data;
A sixth encoding process for converting the color difference data of a plurality of pixels in the pixel block determined not to exceed the predetermined threshold by the activity amount detection means into a median value and a difference value and performing bit compression; The image processing circuit according to claim 1, further comprising:
JP2007190007A 2007-07-20 2007-07-20 Image processing circuit Pending JP2009027556A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007190007A JP2009027556A (en) 2007-07-20 2007-07-20 Image processing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007190007A JP2009027556A (en) 2007-07-20 2007-07-20 Image processing circuit

Publications (1)

Publication Number Publication Date
JP2009027556A true JP2009027556A (en) 2009-02-05

Family

ID=40398915

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007190007A Pending JP2009027556A (en) 2007-07-20 2007-07-20 Image processing circuit

Country Status (1)

Country Link
JP (1) JP2009027556A (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
JP2013247681A (en) * 2012-05-24 2013-12-09 Fujitsu Ltd Image encoding method and image decoding method

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
JP2013247681A (en) * 2012-05-24 2013-12-09 Fujitsu Ltd Image encoding method and image decoding method

Similar Documents

Publication Publication Date Title
ES2551561T3 (en) High dynamic range codecs
US8285037B2 (en) Compression format and apparatus using the new compression format for temporarily storing image data in a frame memory
RU2317587C1 (en) Method for processing images
EP1697898B1 (en) Alpha image processing
US8385639B2 (en) Compressive coding device and visual display control device
US8311352B2 (en) Lossless compression-encoding device
US20120127188A1 (en) Image processing circuit, and display panel driver and display device mounting the circuit
EP1309174A2 (en) Data compression
US20140146098A1 (en) Image processing circuit for image compression and decompression and display panel driver incorporating the same
JP2006047993A (en) Data conversion device
US8315459B2 (en) Lossless compression-encoding device and decoding device for image data
JP5375372B2 (en) Compression encoding apparatus and decoding apparatus
JP6512741B2 (en) Image processing apparatus and image processing method
JP2009027556A (en) Image processing circuit
JP4552400B2 (en) Image display device, image display method, and image display program
JP2008079224A (en) Image data processing system, and image data processing method
JP2006080793A (en) Image coder, method, compputer program, and computer readable storage medium
JP2005055825A (en) Image display device, image display method and image display program
JP5159226B2 (en) Image data processing system
JP2011124866A (en) Encoding apparatus and display control apparatus
KR20150028716A (en) Image encoding apparatus and image encoding method
JP2009071598A (en) Image processing unit
US8774505B2 (en) Method and apparatus of fixed bit-rate image compression/decompression based on 2×2 image unit
KR20100087845A (en) Data compressing and decompressing method and apparatus, liquid crystal display using the same
JP2009111821A (en) Image encoding apparatus, image decoding apparatus, image data processing apparatus, image encoding method, and image decoding method