JP4939460B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP4939460B2
JP4939460B2 JP2008044116A JP2008044116A JP4939460B2 JP 4939460 B2 JP4939460 B2 JP 4939460B2 JP 2008044116 A JP2008044116 A JP 2008044116A JP 2008044116 A JP2008044116 A JP 2008044116A JP 4939460 B2 JP4939460 B2 JP 4939460B2
Authority
JP
Japan
Prior art keywords
component
quantization
image data
quantization table
ratio
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.)
Expired - Fee Related
Application number
JP2008044116A
Other languages
Japanese (ja)
Other versions
JP2009206566A (en
Inventor
信二 林
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.)
Kyocera Document Solutions Inc
Original Assignee
Kyocera Mita 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 Kyocera Mita Corp filed Critical Kyocera Mita Corp
Priority to JP2008044116A priority Critical patent/JP4939460B2/en
Publication of JP2009206566A publication Critical patent/JP2009206566A/en
Application granted granted Critical
Publication of JP4939460B2 publication Critical patent/JP4939460B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)

Description

本発明は、画像データの圧縮データを生成するための画像処理装置に関するものである。   The present invention relates to an image processing apparatus for generating compressed data of image data.

スキャナやデジタルカメラ等の画像入力装置では、撮像した画像を画像データとして取り込み、この画像データをJPEG(Joint Photographic Experts Group)圧縮法を用いて圧縮符号化するものが多い。一般的にJPEG圧縮法は、特許文献1に示すように、入力した画像データをRGB形式からYUV形式へ変換し、n×n(nは自然数。多くはn=8が用いられる)の画素データからなるサブブロックに分割した後、直交変換の一種である離散コサイン変換(以下「DCT(Discrete Cosine Transform)」という)を行う。   Many image input devices such as scanners and digital cameras take captured images as image data, and compress and encode the image data using a JPEG (Joint Photographic Experts Group) compression method. In general, in the JPEG compression method, as shown in Patent Document 1, input image data is converted from RGB format to YUV format, and pixel data of n × n (n is a natural number, mostly n = 8 is used). Then, a discrete cosine transform (hereinafter referred to as “DCT (Discrete Cosine Transform)”), which is a kind of orthogonal transform, is performed.

DCT変換が施されたデータは、量子化テーブルを用いて量子化される。この量子化は、DCT変換されたデータを量子化テーブルが持つ量子化定数で除算することによって行われる。ここで、量子化テーブルが持つ量子化定数の大きさは、量子化ステップを決定するものである。つまり、量子化定数を大きくすれば量子化ステップが大きくなるため圧縮率が高くなり、その反面、圧縮後の画像データの画質が劣化する。逆に、量子化定数を小さくすれば量子化ステップが小さくなるため圧縮率が低くなるが、圧縮後の画像データの画質劣化を抑えることができる。   Data subjected to the DCT transformation is quantized using a quantization table. This quantization is performed by dividing the DCT transformed data by the quantization constant of the quantization table. Here, the magnitude of the quantization constant of the quantization table determines the quantization step. That is, if the quantization constant is increased, the quantization step is increased and the compression rate is increased. On the other hand, the image quality of the compressed image data is deteriorated. On the contrary, if the quantization constant is reduced, the quantization step is reduced and the compression rate is lowered. However, the image quality deterioration of the image data after compression can be suppressed.

そして、量子化の行われたデータは符号化され、圧縮データが生成される。符号化には、エントロピー符号化の一種であるハフマン符号化が主に用いられる。
特開2000−184330号公報
Then, the quantized data is encoded to generate compressed data. For encoding, Huffman encoding, which is a kind of entropy encoding, is mainly used.
JP 2000-184330 A

しかしながら、上記のような一般的なJPEG圧縮法の場合、多くは量子化の際はY成分、U成分、V成分に対して共通の量子化テーブルを用いて量子化を行っていた。つまり、画像データに対するY成分、U成分、V成分の比率に関係なく、全ての成分について同じ圧縮率で圧縮が行われることになる。例えば、画像データに対するY成分の比率がU成分及びV成分に比べて非常に高いにも関わらず全成分が同じ圧縮率で圧縮された場合、Y成分は画質の低い状態で圧縮されることになる。このことは、画像全体の画質を低下させる原因となっていた。   However, in the case of the general JPEG compression method as described above, in many cases, quantization is performed using a common quantization table for the Y component, U component, and V component. In other words, regardless of the ratio of the Y component, U component, and V component with respect to the image data, all components are compressed at the same compression rate. For example, if the ratio of the Y component to the image data is very high compared to the U component and the V component, but all the components are compressed at the same compression rate, the Y component is compressed with a low image quality. Become. This has been a cause of lowering the image quality of the entire image.

本発明は、上記の問題を解決するためになされたもので、YUV変換後、成分毎に圧縮率を可変することによって、圧縮後の画質を維持しつつ圧縮率を向上させることを目的とするものである。   The present invention has been made to solve the above problem, and aims to improve the compression ratio while maintaining the image quality after compression by changing the compression ratio for each component after YUV conversion. Is.

請求項1に記載の発明の画像処理装置は、画像データを輝度成分と色差成分からなる表色系に変換する変換手段と、前記輝度成分及び前記色差成分のヒストグラムを作成するヒストグラム作成手段と、前記作成されたヒストグラムから、前記画像データに対する前記輝度成分の比率と前記色差成分の比率を算出する比率算出手段と、前記変換された画像データを直交変換する直交変換手段と、異なる量子化定数が設定された複数の量子化テーブルを記憶する記憶手段と、予め設定された画質レベルと前記算出された比率に応じて、前記記憶された複数の量子化テーブルから前記輝度成分用の量子化テーブルと、前記色差成分用の量子化テーブルをそれぞれ選択する選択手段と、前記直交変換された画像データのうち、前記輝度成分を前記輝度成分用の量子化テーブルを用いて量子化し、前記色差成分を前記色差成分用の量子化テーブルを用いて量子化する量子化手段と、前記量子化された画像データを符号化して圧縮データを出力する符号化手段と、を備えていることを特徴としている。   The image processing apparatus according to claim 1 is a conversion unit that converts image data into a color system composed of a luminance component and a color difference component; a histogram generation unit that generates a histogram of the luminance component and the color difference component; From the created histogram, ratio calculation means for calculating the ratio of the luminance component and the ratio of the color difference component to the image data, orthogonal transformation means for orthogonal transformation of the transformed image data, and different quantization constants A storage means for storing a plurality of set quantization tables; a quantization table for the luminance component from the plurality of stored quantization tables according to a preset image quality level and the calculated ratio; Selection means for selecting the quantization table for each of the color difference components, and the luminance component of the orthogonally transformed image data as the luminance Quantization means for quantizing using a quantization table for quantization, and quantizing the chrominance component using the quantization table for the chrominance component, and encoding the quantized image data and outputting compressed data And encoding means.

この構成によれば、予め設定された画質レベルと画像データに対する各成分の比率に応じて、各成分毎に異なる量子化定数を持つ量子化テーブルを選択することができる。従って、各成分の比率に適した圧縮率でデータ圧縮を行うことができる。   According to this configuration, it is possible to select a quantization table having a different quantization constant for each component according to a preset image quality level and the ratio of each component to image data. Therefore, data compression can be performed at a compression rate suitable for the ratio of each component.

請求項2に記載の発明は、請求項1に記載の画像処理装置であって、前記選択手段は、前記輝度成分と前記色差成分のうち前記画像データに対する比率が低い成分に対しては、前記画像データに対する比率が高い成分に対して選択した量子化テーブルより前記量子化定数の大きい量子化テーブルを選択することを特徴としている。   A second aspect of the present invention is the image processing apparatus according to the first aspect, wherein the selection unit is configured to detect a component having a low ratio to the image data among the luminance component and the color difference component. A quantization table having a larger quantization constant than a quantization table selected for a component having a high ratio to image data is selected.

この構成によれば、比率の高い成分に対しては低い圧縮率で、比率の低い成分に対しては高い圧縮率で量子化を行うことができる。つまり、比率の高い成分は低い圧縮率で圧縮するため圧縮後の画質劣化を抑えることができ、比率の低い成分は高い圧縮率で圧縮するため圧縮率を向上させることができる。従って、全体として、圧縮後の画質劣化を抑えつつ、高い圧縮率で圧縮を行うことができる。   According to this configuration, it is possible to perform quantization with a low compression ratio for a component with a high ratio and with a high compression ratio for a component with a low ratio. That is, since a component with a high ratio is compressed at a low compression rate, deterioration in image quality after compression can be suppressed, and a component with a low ratio is compressed at a high compression rate, so that the compression rate can be improved. Therefore, as a whole, compression can be performed at a high compression rate while suppressing deterioration in image quality after compression.

請求項3に記載の発明は、請求項1又は2に記載の発明であって、前記出力された圧縮データを復号して復元画像データを出力する復号化手段と、前記復元画像データの画質が前記画質レベルに達しているか否かを比較する比較手段と、前記復元画像データの画質が前記画質レベルに達していないとき、前記選択手段に前記輝度成分と前記色差成分のうち前記画像データに対する比率の高い成分用の量子化テーブルより量子化定数の小さい量子化テーブルを切り換えて選択させ、前記量子化手段に前記切り替えて選択された量子化テーブルを用いて前記輝度成分及び色差成分を量子化させ、前記符号化手段に前記量子化された画像データを符号化して圧縮データを出力させる繰り返し制御手段と、を更に備えることを特徴としている。   Invention of Claim 3 is invention of Claim 1 or 2, Comprising: The decoding means which decodes the output said compression data, and outputs decompression | restoration image data, The image quality of the said decompression | restoration image data is Comparing means for comparing whether or not the image quality level has been reached, and when the image quality of the restored image data has not reached the image quality level, the selection means sends a ratio of the luminance component and the color difference component to the image data. A quantization table having a smaller quantization constant than the quantization table for the higher component, and the quantization means quantizes the luminance component and the color difference component using the selected quantization table. Further, it is characterized by further comprising repetition control means for causing the encoding means to encode the quantized image data and output compressed data.

この構成によれば、復元画像データの画質が予め設定された画質レベルに達するまで、各成分の比率に応じて量子化テーブルが切り換えて選択されて圧縮処理が施されるため、各成分に対する圧縮率を効率的に調整することができる。   According to this configuration, since the quantization table is switched and selected according to the ratio of each component and compression processing is performed until the image quality of the restored image data reaches a preset image quality level, compression for each component is performed. The rate can be adjusted efficiently.

この発明によれば、予め設定された画質レベルと画像データに対する各成分の比率に応じて異なる量子化定数を持つ量子化テーブルを選択することができるため、各成分の比率に適した圧縮率でデータ圧縮を行うことができる。更に、比率の高い成分は低い圧縮率で圧縮するため圧縮後の画質劣化を抑えることができ、比率の低い成分は高い圧縮率で圧縮するため圧縮率を向上させることができる。従って、全体として、圧縮後の画質劣化を抑えつつ、高い圧縮率で圧縮を行うことができる。   According to the present invention, it is possible to select a quantization table having different quantization constants according to a preset image quality level and a ratio of each component to image data, so that a compression rate suitable for the ratio of each component can be selected. Data compression can be performed. Furthermore, since a component with a high ratio is compressed at a low compression rate, image quality deterioration after compression can be suppressed, and a component with a low ratio is compressed at a high compression rate, so that the compression rate can be improved. Therefore, as a whole, compression can be performed at a high compression rate while suppressing deterioration in image quality after compression.

本発明における画像処理装置の実施の形態について図面を参照して説明する。図1は、本実施の形態における画像処理装置1の機能ブロック図である。画像処理装置1は、入力された画像データをJPEG圧縮法を用いて画像圧縮を行うものであり、制御部11、データ入出力部12、YUV変換部13、ヒストグラム作成部14、DCT変換部15、記憶部16、量子化部17、符号化部18及び復号化部19等を備えて構成される。   An image processing apparatus according to an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a functional block diagram of an image processing apparatus 1 according to the present embodiment. The image processing apparatus 1 compresses input image data using a JPEG compression method, and includes a control unit 11, a data input / output unit 12, a YUV conversion unit 13, a histogram creation unit 14, and a DCT conversion unit 15. A storage unit 16, a quantization unit 17, an encoding unit 18, a decoding unit 19, and the like.

データ入出力部12は、外部から入力される画像データを受け付けて制御部11へ出力する。また制御部11の制御で、圧縮データや復号画像データを外部へ出力する。YUV変換部13は、入力された画像データをRGB形式からYUV形式に変換する。   The data input / output unit 12 receives image data input from the outside and outputs it to the control unit 11. Further, under the control of the control unit 11, compressed data and decoded image data are output to the outside. The YUV conversion unit 13 converts the input image data from the RGB format to the YUV format.

ヒストグラム作成部14は、図4及び図5に示すようなY成分、U成分及びV成分のヒストグラムを生成する。DCT変換部15は、YUV変換後に制御部11にn×nの画素データに分割されたサブブロックをDCT変換を用いて空間領域から周波数領域のDCT係数に変換する。尚、DCT変換部15は、分割されたサブブロックを1画像(1フレーム)分にわたって繰り返しDCT変換を行う。   The histogram creation unit 14 generates a histogram of Y component, U component, and V component as shown in FIGS. The DCT conversion unit 15 converts the sub-blocks divided into n × n pixel data into Y × n pixel data after the YUV conversion from the spatial domain to the frequency domain DCT coefficients using DCT conversion. The DCT conversion unit 15 repeatedly performs DCT conversion on the divided sub-blocks over one image (one frame).

記憶部16は、量子化テーブル群2を記憶すると共に、画像処理装置1の備える種々の機能を実現するためのプログラムやデータ等を記憶する。量子化テーブル群2は、量子化定数の異なる複数の量子化テーブルを記憶する。図2は、記憶部15が記憶する量子化テーブル群2のデータ構成を示す図である。制御部11がYUV変換された画像データを例えば8×8のサブブロックに分割する場合、量子化テーブルはサブブロックと同じ行列数である8×8の量子化定数を持つ。一般的には、画質を維持しつつ圧縮率を上げるために、行列の左上側に対応する量子化定数を小さく、右下側に対応する量子化定数を大きく設定する。   The storage unit 16 stores the quantization table group 2 and stores programs, data, and the like for realizing various functions of the image processing apparatus 1. The quantization table group 2 stores a plurality of quantization tables having different quantization constants. FIG. 2 is a diagram illustrating a data configuration of the quantization table group 2 stored in the storage unit 15. When the control unit 11 divides the YUV-converted image data into, for example, 8 × 8 sub-blocks, the quantization table has an 8 × 8 quantization constant that is the same number of matrices as the sub-blocks. In general, in order to increase the compression rate while maintaining the image quality, the quantization constant corresponding to the upper left side of the matrix is set small, and the quantization constant corresponding to the lower right side is set large.

各量子化テーブル21、22、・・・、N(Nは1以上の整数。以下、包括的に「量子化テーブル20」という)は、量子化部17がサブブロックを量子化する際の量子化ステップが大きい方から(つまり、圧縮率の高い方から)順にテーブル番号が対応付けられて記憶されている。図3は量子化テーブルのテーブル番号と圧縮率の関係の一例を示した図である。例えば、テーブル番号1の量子化テーブル(量子化テーブル21)を用いてサブブロックが量子化されて符号化されると圧縮率5%の圧縮データが生成され、テーブル番号2の量子化テーブル(量子化テーブル22)を用いてサブブロックが量子化されて符号化されると圧縮率10%の圧縮データが生成される。   Each of the quantization tables 21, 22,..., N (N is an integer equal to or greater than 1; hereinafter referred to as “quantization table 20”) is a quantum when the quantization unit 17 quantizes the sub-block. Table numbers are stored in association with each other in descending order of the conversion step (that is, from the higher compression ratio). FIG. 3 shows an example of the relationship between the table number of the quantization table and the compression rate. For example, if a sub-block is quantized and encoded using the quantization table (quantization table 21) of table number 1, compressed data with a compression rate of 5% is generated, and the quantization table (quantum table of table number 2) When the sub-block is quantized and encoded using the conversion table 22), compressed data with a compression rate of 10% is generated.

図1に戻る。量子化部17は、DCT変換されたサブブロックを量子化テーブル選択部111によって選択された量子化テーブルを用いて量子化する。符号化部18は、量子化部17によって量子化されたサブブロックをハフマン符号化によるエントロピー符号化によって符号化し、符号化したデータを圧縮データとして制御部11に出力する。具体的には、サブブロックが有する係数列をジグザグスキャンし、連続する0に対して周知のランレングス符号化を行って、可変長符号化であるはハフマン符号化を行う。   Returning to FIG. The quantization unit 17 quantizes the DCT-transformed sub-block using the quantization table selected by the quantization table selection unit 111. The encoding unit 18 encodes the sub-block quantized by the quantization unit 17 by entropy encoding using Huffman encoding, and outputs the encoded data to the control unit 11 as compressed data. Specifically, the coefficient sequence of the sub-block is zigzag scanned, and a known run-length encoding is performed on consecutive 0s, and variable-length encoding or Huffman encoding is performed.

復号化部19は、上記で説明した画像データの圧縮手段とは逆の手段を用いて、圧縮データを復号し、復元圧縮データを生成する。尚、復号化については周知の技術を用いるため詳しい説明を省略する。   The decoding unit 19 decodes the compressed data using means opposite to the image data compression means described above, and generates decompressed compressed data. Note that a detailed description of decoding is omitted because a known technique is used.

制御部11は、CPU(Central Processing Unit:中央処理装置)等によって構成され、各機能部への指示信号の出力、データ転送等を行って画像処理装置1を統括的に制御するものである。また制御部11は、比率算出部111、量子化テーブル選択部112及び画質比較部113として機能する。   The control unit 11 is configured by a CPU (Central Processing Unit) or the like, and performs overall control of the image processing apparatus 1 by outputting instruction signals to each function unit, transferring data, and the like. The control unit 11 also functions as a ratio calculation unit 111, a quantization table selection unit 112, and an image quality comparison unit 113.

具体的には、データ入出力部12が画像データを入力すると、制御部11はYUV変換部13に対して画像データをYUV変換させ、ヒストグラム作成部14に各成分のヒストグラムを生成させる。そして、比率算出部111が画像データに対する各成分の比率を算出する。   Specifically, when the data input / output unit 12 inputs image data, the control unit 11 causes the YUV conversion unit 13 to YUV convert the image data, and causes the histogram creation unit 14 to generate a histogram of each component. Then, the ratio calculation unit 111 calculates the ratio of each component to the image data.

比率算出部111による各成分の比率の算出方法の一例を具体的に説明する。ここで比率とは、1フレーム分(1画像分)の画像データの情報量に対して各成分の情報量が占める割合を意味する。   An example of a method for calculating the ratio of each component by the ratio calculation unit 111 will be specifically described. Here, the ratio means the ratio of the information amount of each component to the information amount of image data for one frame (one image).

図4に、(a)はY成分のヒストグラム、(b)はU成分のヒストグラム、(c)はV成分のヒストグラムの一例を示す。比率算出部111は、各成分のヒストグラムを用いて、各Y値、各U値及び各V値における頻度の総和を算出し、各総和の合計値を算出する。そして、比率算出部111は(各Y値における頻度の総和/合計値)の計算式を用いてY値の比率を算出し、続いて(各U値における頻度の総数/合計値)、(各V値における頻度の総数/合計値)の計算式を用いてU値及びV値の比率を算出する。   4A shows an example of a Y component histogram, FIG. 4B shows an example of a U component histogram, and FIG. 4C shows an example of a V component histogram. The ratio calculation unit 111 calculates the total sum of frequencies in each Y value, each U value, and each V value using the histogram of each component, and calculates the total value of each sum. Then, the ratio calculation unit 111 calculates the ratio of the Y values using the formula of (the sum of the frequencies at each Y value / total value), and then (the total number / the total value of the frequencies at each U value), (each The ratio of the U value and the V value is calculated using a formula of (total number of frequencies in V value / total value).

各値の頻度の総和と、各ヒストグラムの面積(グラフの塗りつぶし部分の面積)は比例することは言うまでもない。図4に示すYUV各成分のヒストグラムの面積がほぼ同じであると仮定すると、各値の頻度の総数はほぼ同じであると考えられる。この場合、各成分において同等(例えば30%台)の比率が算出される。一方、図5に示すように、UV各成分のヒストグラムの面積はほぼ同じだが、UV各成分のヒストグラムの面積に対してY成分の面積は約2倍あると仮定する。この場合、例えばY成分は50%、UV各成分は25%の比率が算出される。   Needless to say, the sum of the frequency of each value is proportional to the area of each histogram (area of the filled area of the graph). Assuming that the area of the histogram of each YUV component shown in FIG. 4 is substantially the same, the total number of frequencies of each value is considered to be substantially the same. In this case, an equivalent ratio (for example, about 30%) is calculated for each component. On the other hand, as shown in FIG. 5, it is assumed that the area of the histogram of each UV component is substantially the same, but the area of the Y component is about twice the area of the histogram of each UV component. In this case, for example, a ratio of 50% for the Y component and 25% for each UV component is calculated.

そして、各成分の比率と予め設定された画質レベル(以下、「設定画質レベル」という)に応じて、量子化テーブル選択部112が記憶部16に記憶されている量子化テーブル群2からYUV各成分を量子化する際に用いる量子化テーブルを選択する。具体的には、まず、設定画質レベルのみに基づいて量子化テーブルを選択する。例えば、設定画質レベルに基づいて圧縮率30%の量子化テーブルが選択された場合、各成分の比率が同じであれば、量子化テーブル選択部112は圧縮率30%の量子化テーブルをYUV各成分用の量子化テーブルとして選択する。   Then, in accordance with the ratio of each component and a preset image quality level (hereinafter referred to as “set image quality level”), the quantization table selection unit 112 selects each YUV from the quantization table group 2 stored in the storage unit 16. Select a quantization table to be used when quantizing components. Specifically, first, a quantization table is selected based only on the set image quality level. For example, when a quantization table with a compression rate of 30% is selected based on the set image quality level, if the ratio of each component is the same, the quantization table selection unit 112 converts the quantization table with a compression rate of 30% to each YUV. Select as a quantization table for components.

一方、Y成分は50%、UV各成分は25%の比率が算出された場合、量子化テーブル選択部112は、設定画質レベルに基づいて選択された量子化テーブルの圧縮率を基準として、例えばY成分用の量子化テーブルとして圧縮率40%の量子化テーブルを選択し、UV各成分用の量子化テーブルとして圧縮率20%の量子化テーブルを選択する。即ち、Y成分の比率に対してUV各成分の比率は1/2であるため、量子化テーブル選択部112はUV成分用の量子化テーブルとしてY成分用の量子化テーブルの圧縮率より2倍の圧縮率を持つものを選択する。   On the other hand, when the ratio of 50% for the Y component and 25% for each UV component is calculated, the quantization table selection unit 112 uses the compression rate of the quantization table selected based on the set image quality level as a reference, for example, A quantization table with a compression rate of 40% is selected as the quantization table for the Y component, and a quantization table with a compression rate of 20% is selected as the quantization table for each UV component. That is, since the ratio of each UV component to the ratio of the Y component is 1/2, the quantization table selection unit 112 doubles the compression ratio of the quantization table for the Y component as the quantization table for the UV component. Select one with a compression ratio of.

このように、各成分の比率に応じて異なる圧縮率の量子化テーブルを選択することによって、比率の高い成分は比率の低い成分より低い圧縮率で量子化が行われることになるため、比率の高い成分の圧縮後の画質劣化を抑えることができ、更に比率の低い成分は高い圧縮率で圧縮できるため、全体として圧縮率を高めつつ復元画像の画質を維持することができる。   In this way, by selecting a quantization table with a different compression ratio according to the ratio of each component, a component with a higher ratio is quantized with a lower compression ratio than a component with a lower ratio. Image quality degradation after compression of high components can be suppressed, and components with lower ratios can be compressed with a high compression rate, so that the quality of the restored image can be maintained while increasing the compression rate as a whole.

図1に戻る。量子化テーブル選択部112によって各成分用の量子化テーブルが選択された後、制御部11はYUV変換されたデータをn×nの画素データからなるサブブロックに分割し、サブブロック毎にDCT変換部14にDCT変換させる。そして、量子化部17にDCT変換されたサブブロックを量子化テーブルを用いて量子化させて、量子化されたサブブロックを符号化部18に符号化させて圧縮データを生成させる。   Returning to FIG. After the quantization table for each component is selected by the quantization table selection unit 112, the control unit 11 divides the YUV converted data into sub-blocks made up of n × n pixel data, and performs DCT conversion for each sub-block. The unit 14 performs DCT conversion. Then, the quantizing unit 17 quantizes the DCT-transformed sub-block using the quantization table, and causes the coding unit 18 to encode the quantized sub-block to generate compressed data.

そして、制御部11は復号化部19に圧縮データを復号させて復元画像データを出力させ、画質比較部113が圧縮前の画像データと復元画像データの画質比較を行う。具体的には、画質比較部113は例えばPSNR(Peak Signal Noise Ratio)値を算出して画質評価を行う。PSNR値とは、入力された原画像と原画像の圧縮データを復号した復元画像との間で、画素毎の差分相対比を全画素にわたって平均した値あり、算出には以下の式(1)が用いられる。   Then, the control unit 11 causes the decoding unit 19 to decode the compressed data and output the restored image data, and the image quality comparing unit 113 compares the image quality of the uncompressed image data and the restored image data. Specifically, the image quality comparison unit 113 performs image quality evaluation by calculating a PSNR (Peak Signal Noise Ratio) value, for example. The PSNR value is a value obtained by averaging the difference relative ratio of each pixel over all pixels between the input original image and the restored image obtained by decoding the compressed data of the original image. Is used.

画質比較部113はPSNR値を用いて、復元画像データが設定画質レベルに達しているか否かを判断する。 The image quality comparison unit 113 uses the PSNR value to determine whether the restored image data has reached the set image quality level.

この判断結果に応じて、量子化テーブル選択部111は各成分用の量子化テーブルを切り替えて選択し、制御部11は量子化部17に切り替えて選択された量子化テーブルで量子化させ、符号化部18に符号化させて圧縮データを出力させる。制御部11は、復元画像データの画質が設定画質レベルに達するまでこの制御を繰り返して行う。この繰り返し制御の詳細は後述する。   In accordance with this determination result, the quantization table selection unit 111 switches and selects the quantization table for each component, and the control unit 11 switches to the quantization unit 17 to perform quantization with the selected quantization table, The encoding unit 18 encodes the compressed data. The controller 11 repeats this control until the image quality of the restored image data reaches the set image quality level. Details of this repetitive control will be described later.

図6及び図7は、画像処理装置1による圧縮処理の流れを示したフローチャートである。データ入出力部12が画像データを入力すると、制御部11はYUV変換部13に入力した画像データをYUV変換させ(ステップS11)、ヒストグラム作成部14に各成分のヒストグラムを作成させる(ステップS12)。そして比率算出部111が画像データにおける各成分の比率を算出する(ステップS13)。次に、制御部11は信号変換された画像データをn×nの画素データからなるサブブロックに分割し、DCT変換部14に各サブブロックをDCT変換させる(ステップS14)。ここで制御部11は、DCT変換された各サブブロックを制御部11が有するワーキングメモリ(不図示)に記憶する。   6 and 7 are flowcharts showing the flow of compression processing by the image processing apparatus 1. When the data input / output unit 12 inputs image data, the control unit 11 performs YUV conversion on the image data input to the YUV conversion unit 13 (step S11), and causes the histogram creation unit 14 to create a histogram of each component (step S12). . Then, the ratio calculation unit 111 calculates the ratio of each component in the image data (step S13). Next, the control unit 11 divides the signal-converted image data into sub-blocks made up of n × n pixel data, and causes the DCT conversion unit 14 to DCT-convert each sub-block (step S14). Here, the control unit 11 stores each DCT-converted sub-block in a working memory (not shown) included in the control unit 11.

次に、量子化テーブル選択部112は設定画質レベルと各成分の比率に応じて各成分用の量子化テーブルを量子化テーブル群2から選択する(ステップS15)。ここで、制御部11は、量子化テーブル選択部112によって選択されたY成分用の量子化テーブルのテーブル番号を変数Iyに代入し、U成分用の量子化テーブルのテーブル番号を変数Iuに代入し、V成分用の量子化テーブルのテーブル番号を変数Ivに代入する。変数Iy、Iu及びIvは制御部11が有するワーキングメモリ内で設定される変数である。尚、ステップS15において、量子化テーブル選択部112は圧縮されて復号された後の復元画像データの画質レベルが設定画質レベルより若干上になるように各成分用の量子化テーブルを選択することが望ましい。   Next, the quantization table selection unit 112 selects a quantization table for each component from the quantization table group 2 according to the set image quality level and the ratio of each component (step S15). Here, the control unit 11 assigns the table number of the quantization table for the Y component selected by the quantization table selection unit 112 to the variable Iy, and assigns the table number of the quantization table for the U component to the variable Iu. Then, the table number of the quantization table for the V component is substituted into the variable Iv. Variables Iy, Iu, and Iv are variables set in the working memory of the control unit 11. In step S15, the quantization table selection unit 112 may select the quantization table for each component so that the image quality level of the restored image data after being compressed and decoded is slightly higher than the set image quality level. desirable.

そして制御部11は、各サブブロックを量子化させ(ステップS16)、量子化された各サブブロックを符号化部18に符号化させて圧縮データを出力させる(ステップS17)。更に、制御部11は復号化部19に圧縮データを復号させて復元画像データを出力させる(ステップS18)。   Then, the control unit 11 quantizes each sub-block (step S16), causes the encoding unit 18 to encode each quantized sub-block and outputs compressed data (step S17). Further, the control unit 11 causes the decoding unit 19 to decode the compressed data and output restored image data (step S18).

次に、画質比較部113は、入力された画像データと復元画像データの画質比較を行って、復元画像データの画質が設定画像レベルに達しているか否かを判断する(ステップS19)。復元画像データの画質が設定画像レベルにある場合(ステップS19;設定画質レベル)、制御部11はデータ入出力部12を介して圧縮データを外部に出力し、制御を終了する。   Next, the image quality comparison unit 113 compares the image quality of the input image data and the restored image data, and determines whether or not the image quality of the restored image data has reached the set image level (step S19). When the image quality of the restored image data is at the set image level (step S19; set image quality level), the control unit 11 outputs the compressed data to the outside via the data input / output unit 12, and ends the control.

復元画像データの画質が設定画像レベルより上であり(ステップS19;設定画質レベルより上)、且つ変数fが0であり(ステップS20;0)、且つ変数Iy、Iu及びIvの何れかが1(つまり、量子化テーブル20の最初のテーブル番号)でない場合(ステップS21;NO)、制御部11は変数Iy、Iu及びIvから1を引き(ステップS22)、ステップS16へ処理を移行する。つまり、量子化テーブル選択部112は各成分用に対して圧縮率が一段階高い量子化テーブルを切り換えて選択し、制御部11は量子化部17に切り換えて選択された量子化テーブルを用いて、ステップ14においてワーキングメモリに記憶されたDCT変換された各サブブロックの量子化を行わせる。尚、変数fは制御部1のワーキングメモリに設定された変数であり、変数fに代入される数値の内容については後述する。   The image quality of the restored image data is above the set image level (step S19; above the set image quality level), the variable f is 0 (step S20; 0), and any of the variables Iy, Iu, and Iv is 1. If it is not (that is, the first table number of the quantization table 20) (step S21; NO), the control unit 11 subtracts 1 from the variables Iy, Iu, and Iv (step S22), and shifts the processing to step S16. That is, the quantization table selection unit 112 switches and selects a quantization table whose compression ratio is one step higher for each component, and the control unit 11 switches to the quantization unit 17 and uses the selected quantization table. In step 14, each DCT transformed sub-block stored in the working memory is quantized. Note that the variable f is a variable set in the working memory of the control unit 1, and the contents of the numerical value substituted for the variable f will be described later.

変数Iy、Iu及びIvの何れかが1である場合(ステップS21;YES)、量子化テーブル群2はこれ以上大きい量子化定数を持つ量子化テーブル(つまり、これ以上高い圧縮率で量子化できる量子化テーブル)を記憶していないことから、これ以上高い圧縮率での圧縮処理は行うことができない。従って、制御部11はデータ入出力部12を介してステップS17において出力された圧縮データを外部に出力し、制御を終了する。尚、テーブル番号1の量子化テーブルが持つ各量子化定数を定数で乗算することによって、更に圧縮率の高い量子化テーブルを生成するようにしてもよい。   When any of the variables Iy, Iu, and Iv is 1 (step S21; YES), the quantization table group 2 is a quantization table having a larger quantization constant (ie, can be quantized with a higher compression rate). Since the (quantization table) is not stored, compression processing at a higher compression rate cannot be performed. Therefore, the control unit 11 outputs the compressed data output in step S17 to the outside via the data input / output unit 12, and ends the control. Note that a quantization table having a higher compression rate may be generated by multiplying each quantization constant of the quantization table of table number 1 by a constant.

ステップS16〜S22に示すように、復元画像データの画質が設定画質レベルより上にある間は、量子化テーブル選択部112は各成分用の量子化テーブルを1段階ずつ圧縮率の高い量子化テーブルに切り換えて選択していき、選択された量子化テーブルを用いて制御部11は量子化、符号化、復号化を繰り返し行わせる制御を行う。   As shown in steps S16 to S22, while the image quality of the restored image data is above the set image quality level, the quantization table selection unit 112 converts the quantization table for each component into a quantization table with a high compression rate by one step. The control unit 11 performs control to repeatedly perform quantization, encoding, and decoding using the selected quantization table.

このように量子化テーブルを切り換えて選択していくと、復元画像データの画質が設定画質レベルより下になるタイミングが発生する。つまり、ステップS19において、復元画像データの画質が設定画像レベルより下であると判断され、且つ変数Iy、Iu及びIvの何れかがN(つまり、量子化テーブル20の最後のテーブル番号)ではなく(ステップS23;NO)、変数fが0である場合(ステップS24;0)、制御部11はステップS13で算出された比率が最も高い成分のテーブル番号に1を加算して更に変数fに1を代入し(ステップS25)、ステップS16へ処理を移行する。つまり、量子化テーブル選択部112は比率の最も高い成分に対しては圧縮率が一段低い量子化テーブルに切り換えて選択する。   When the quantization table is switched and selected in this way, the timing at which the image quality of the restored image data falls below the set image quality level occurs. That is, in step S19, it is determined that the image quality of the restored image data is lower than the set image level, and any of the variables Iy, Iu, and Iv is not N (that is, the last table number of the quantization table 20). (Step S23; NO) When the variable f is 0 (Step S24; 0), the control unit 11 adds 1 to the table number of the component having the highest ratio calculated in Step S13, and further sets the variable f to 1. Is substituted (step S25), and the process proceeds to step S16. That is, the quantization table selection unit 112 selects and selects the component with the highest ratio by switching to a quantization table with a lower compression ratio.

ここで、変数fは、何れの成分の量子化テーブルが個別に切り換えられたかを示すものである。f=0のときはステップS15において設定された量子化テーブルが選択されている状態であり、f=1のときは比率が最も高い成分の量子化テーブルが切り換えられたことを示し、f=2のときは2番目に比率の高い成分の量子化テーブルが切り換えられたことを示す。   Here, the variable f indicates which component quantization table is individually switched. When f = 0, the quantization table set in step S15 is selected. When f = 1, it indicates that the quantization table of the component with the highest ratio has been switched, and f = 2. Indicates that the quantization table of the component with the second highest ratio has been switched.

また、変数fが1の場合(ステップS24;1)、制御部11は比率が2番目に高い成分のテーブル番号に1を加算して更に変数fに2を代入し(ステップS26)、ステップS16へ処理を移行する。   When the variable f is 1 (step S24; 1), the control unit 11 adds 1 to the table number of the component having the second highest ratio, and further substitutes 2 for the variable f (step S26). Transfer processing to.

そして、変数fが2の場合(ステップS24;2)、既に2つの成分に対して異なる圧縮率を持つ量子化テーブルが切り換えて選択されているため、制御部11はデータ入出力部12を介して圧縮データを外部に出力し、制御を終了する。   When the variable f is 2 (step S24; 2), since the quantization table having different compression ratios for the two components has already been switched and selected, the control unit 11 passes through the data input / output unit 12. To output the compressed data to the outside and finish the control.

また、ステップS23において、制御部11が変数Iy、Iu及びIvの何れかがNではあると判断した場合(ステップS23;YES)、量子化テーブル群2はこれ以上小さい量子化定数を持つ量子化テーブル(つまり、これ以上低い圧縮率で量子化できる量子化テーブル)を記憶していないことから、これ以上低い圧縮率での圧縮処理は行うことができない。従って、制御部11はデータ入出力部12を介して圧縮データを外部に出力し、制御を終了する。尚、テーブル番号Nの量子化テーブルが持つ各量子化定数を定数で割ることによって、更に圧縮率の低い量子化テーブルを生成するようにしてもよい。   In step S23, when the control unit 11 determines that any of the variables Iy, Iu, and Iv is N (step S23; YES), the quantization table group 2 is quantized having a smaller quantization constant. Since a table (that is, a quantization table that can be quantized at a lower compression rate) is not stored, compression processing at a lower compression rate cannot be performed. Therefore, the control unit 11 outputs the compressed data to the outside via the data input / output unit 12 and ends the control. Note that a quantization table having a lower compression rate may be generated by dividing each quantization constant of the quantization table having the table number N by a constant.

更に、ステップS19において画質比較部113が復元画像データの画質は設定画質レベルより上であると判断し(ステップS19;設定レベルより上)、且つ制御部11が変数fは1又は2であると判断したとき(ステップS20;1or2)、制御部11はデータ入出力部12を介して圧縮データを外部に出力し、制御を終了する。   Further, in step S19, the image quality comparison unit 113 determines that the image quality of the restored image data is above the set image quality level (step S19; above the set level), and the control unit 11 determines that the variable f is 1 or 2. When the determination is made (step S20; 1 or 2), the control unit 11 outputs the compressed data to the outside via the data input / output unit 12, and ends the control.

以上説明したように、画像データに対するYUV各成分の比率を算出し、この比率と設定画質レベルに応じて各成分用の量子化テーブルをそれぞれ切り換えて選択するようにすることにより、比率の高い成分に対しては低い圧縮率で、比率の低い成分に対しては高い圧縮率で量子化を行うことができる。つまり、圧縮後の画質劣化を抑えつつ、高い圧縮率で画像データの圧縮を行うことができる。   As described above, by calculating the ratio of each component of YUV to image data and switching and selecting the quantization table for each component according to this ratio and the set image quality level, the component with a high ratio is obtained. Quantization can be performed with a low compression rate and with a high compression rate for components with a low ratio. That is, image data can be compressed at a high compression rate while suppressing deterioration in image quality after compression.

画像処理装置の内部構成を示すブロック図。The block diagram which shows the internal structure of an image processing apparatus. 記憶部のデータ構成を示す図。The figure which shows the data structure of a memory | storage part. 各成分のヒストグラムの一例。An example of the histogram of each component. 各成分のヒストグラムの一例。An example of the histogram of each component. 量子化テーブルのテーブル番号を圧縮率の関係の一例を示す図。The figure which shows an example of the relationship of the compression rate with the table number of a quantization table. 圧縮処理の流れを示すフローチャート。The flowchart which shows the flow of a compression process. 図6の続きのフローチャート。FIG. 7 is a continuation flowchart of FIG. 6.

符号の説明Explanation of symbols

1 画像処理装置
11 制御部(繰り返し制御手段)
111 比率算出部(比率算出手段)
112 量子化テーブル選択部(選択手段)
113 画質比較部(比較手段)
12 データ入出力部
13 YUV変換部(変換手段)
14 ヒストグラム作成部(ヒストグラム作成手段)
15 DCT変換部(直交変換手段)
16 記憶部(記憶手段)
2 量子化テーブル群
20 量子化テーブル
17 量子化部(量子化手段)
18 符号化部(符号化手段)
19 復号化部(復号化手段)
1 Image Processing Device 11 Control Unit (Repetitive Control Unit)
111 Ratio calculation part (ratio calculation means)
112 Quantization table selection unit (selection means)
113 Image quality comparison unit (comparison means)
12 Data input / output unit 13 YUV conversion unit (conversion means)
14 Histogram creation part (histogram creation means)
15 DCT transform unit (orthogonal transform means)
16 Storage unit (storage means)
2 Quantization table group 20 Quantization table 17 Quantization unit (quantization means)
18 Encoding unit (encoding means)
19 Decoding unit (decoding means)

Claims (3)

画像データを輝度成分と色差成分からなる表色系に変換する変換手段と、
前記輝度成分及び前記色差成分のヒストグラムを作成するヒストグラム作成手段と、
前記作成されたヒストグラムから、前記画像データに対する前記輝度成分の比率と前記色差成分の比率を算出する比率算出手段と、
前記変換された画像データを直交変換する直交変換手段と、
異なる量子化定数が設定された複数の量子化テーブルを記憶する記憶手段と、
予め設定された画質レベルと前記算出された比率に応じて、前記記憶された複数の量子化テーブルから前記輝度成分用の量子化テーブルと、前記色差成分用の量子化テーブルをそれぞれ選択する選択手段と、
前記直交変換された画像データのうち、前記輝度成分を前記輝度成分用の量子化テーブルを用いて量子化し、前記色差成分を前記色差成分用の量子化テーブルを用いて量子化する量子化手段と、
前記量子化された画像データを符号化して圧縮データを出力する符号化手段と、
を備えた画像処理装置。
Conversion means for converting image data into a color system comprising a luminance component and a color difference component;
Histogram creation means for creating a histogram of the luminance component and the color difference component;
Ratio calculation means for calculating a ratio of the luminance component and a ratio of the color difference component with respect to the image data from the created histogram,
Orthogonal transformation means for orthogonal transformation of the transformed image data;
Storage means for storing a plurality of quantization tables set with different quantization constants;
Selection means for selecting the luminance component quantization table and the color difference component quantization table from the plurality of stored quantization tables, respectively, in accordance with a preset image quality level and the calculated ratio. When,
Quantization means for quantizing the luminance component of the orthogonally transformed image data using a quantization table for the luminance component and quantizing the color difference component using the quantization table for the color difference component; ,
Encoding means for encoding the quantized image data and outputting compressed data;
An image processing apparatus.
前記選択手段は、前記輝度成分と前記色差成分のうち前記画像データに対する比率が低い成分に対しては、前記画像データに対する比率が高い成分に対して選択した量子化テーブルより前記量子化定数の大きい量子化テーブルを選択することを特徴とする請求項1に記載の画像処理装置。   The selection means has a larger quantization constant than a quantization table selected for a component having a low ratio to the image data among the luminance component and the color difference component for a component having a high ratio to the image data. The image processing apparatus according to claim 1, wherein a quantization table is selected. 前記出力された圧縮データを復号して復元画像データを出力する復号化手段と、
前記復元画像データの画質が前記画質レベルに達しているか否かを比較する比較手段と、
前記復元画像データの画質が前記画質レベルに達していないとき、前記選択手段に前記輝度成分と前記色差成分のうち前記画像データに対する比率の高い成分用の量子化テーブルを量子化定数の小さい量子化テーブルに切り換えて選択させ、前記量子化手段に前記切り替えて選択された量子化テーブルを用いて前記輝度成分及び色差成分を量子化させ、前記符号化手段に前記量子化された画像データを符号化して圧縮データを出力させる繰り返し制御手段と、
を更に備えることを特徴とする請求項1又は2に記載の画像処理装置。
Decoding means for decoding the output compressed data and outputting restored image data;
Comparison means for comparing whether or not the image quality of the restored image data has reached the image quality level;
When the image quality of the restored image data does not reach the image quality level, a quantization table for a component having a high ratio of the luminance component and the color difference component to the image data is quantized with a small quantization constant. A table for switching and selecting, the luminance means and the color difference component are quantized using the quantization table selected by switching to the quantizing means, and the quantizing means encodes the quantized image data Repetitive control means for outputting the compressed data,
The image processing apparatus according to claim 1, further comprising:
JP2008044116A 2008-02-26 2008-02-26 Image processing device Expired - Fee Related JP4939460B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008044116A JP4939460B2 (en) 2008-02-26 2008-02-26 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008044116A JP4939460B2 (en) 2008-02-26 2008-02-26 Image processing device

Publications (2)

Publication Number Publication Date
JP2009206566A JP2009206566A (en) 2009-09-10
JP4939460B2 true JP4939460B2 (en) 2012-05-23

Family

ID=41148449

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008044116A Expired - Fee Related JP4939460B2 (en) 2008-02-26 2008-02-26 Image processing device

Country Status (1)

Country Link
JP (1) JP4939460B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05211612A (en) * 1992-01-31 1993-08-20 Canon Inc Data compression and expansion device
JPH05276391A (en) * 1992-03-24 1993-10-22 Casio Comput Co Ltd Method for compressing picture and device therefor
JP2005109544A (en) * 2003-09-26 2005-04-21 Sony Corp Image processing apparatus

Also Published As

Publication number Publication date
JP2009206566A (en) 2009-09-10

Similar Documents

Publication Publication Date Title
TWI516095B (en) Video encoding and decoding using transforms
WO2018061588A1 (en) Image encoding device, image encoding method, image encoding program, image decoding device, image decoding method, and image decoding program
JP3118237B1 (en) Picture prediction decoding method
JP4365957B2 (en) Image processing method and apparatus and storage medium
JP4393875B2 (en) System and method for providing a single layer video encoded bitstream suitable for reduced complexity decoding
JP2003250157A (en) Optimal scanning method for transform coefficients in coding/decoding of still image and moving image
EP1713279A1 (en) Image data decoding apparatus and method
KR20100035104A (en) Video encoding/decoding apparatus and method of considering impulse signal
JPWO2010146772A1 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
JP7357736B2 (en) Encoding device, decoding device, and program
JPH06189290A (en) Video signal encoding device using 1d/2d dct
JP2024053019A (en) Encoding device, decoding device, and program
JP5145421B2 (en) Alternative entropy coding method
KR101710619B1 (en) Method and apparatus for successively encoding/decoding image
JP5145078B2 (en) Image processing device
JP2009010612A (en) Image compressing device and method
JP4939460B2 (en) Image processing device
JP5642105B2 (en) Image processing apparatus and image forming apparatus
JP7388900B2 (en) Encoding device, decoding device, and program
CN115567710A (en) Data encoding method and apparatus, and method and apparatus for decoding data stream
JP6402520B2 (en) Encoding apparatus, method, program, and apparatus
JP7366216B2 (en) Encoding device, decoding device, and program
KR100715512B1 (en) Apparatus for image processing and method thereof
JP2007295319A (en) Image processing apparatus and image forming apparatus equipped therewith
JP2002359852A (en) Device and method for predictive decoding of image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101122

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120117

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120131

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120224

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150302

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4939460

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150302

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees