JPH04183171A - Image coding and decoding method - Google Patents

Image coding and decoding method

Info

Publication number
JPH04183171A
JPH04183171A JP2313451A JP31345190A JPH04183171A JP H04183171 A JPH04183171 A JP H04183171A JP 2313451 A JP2313451 A JP 2313451A JP 31345190 A JP31345190 A JP 31345190A JP H04183171 A JPH04183171 A JP H04183171A
Authority
JP
Japan
Prior art keywords
block
pixels
picture elements
scanning direction
picture
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.)
Granted
Application number
JP2313451A
Other languages
Japanese (ja)
Other versions
JP3032281B2 (en
Inventor
Yoshimichi Kanda
好道 神田
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP31345190A priority Critical patent/JP3032281B2/en
Publication of JPH04183171A publication Critical patent/JPH04183171A/en
Application granted granted Critical
Publication of JP3032281B2 publication Critical patent/JP3032281B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PURPOSE:To make it possible to carry out coding and decoding using two-dimensional discrete cosine transformation by adding, to picture elements that could not be processed for preparation of a nXn picture element block, a block of picture elements that has been coded once to form and code a nXn picture element block, and, for decoding of picture element, using only the picture elements that could not be processed for preparation of block as picture elements. CONSTITUTION:First, coding of a 8X8 picture element block is carried out sequentially in the main scanning direction, and when the block coding in the main scanning direction is completed, setting of a 8X8 picture element block including the remaining 8X4 picture elements is carried out, followed by its coding. When the block preparation in the subscanning direction is completed, since 4X8 picture elements remain in the subscanning direction, the preceding picture elements are added to the remaining 4X8 picture elements to form a 8X8 picture element block, and processed for coding sequentially in the main scanning direction. In a way similar to the coding, when picture elements are decoded sequentially in the main scanning direction, since the last 8X4 picture elements remain undecoded, preceded decoding regenerated 8X4 picture elements are added to the last 8X4 picture elements left undecoded to decode one block of 8X8 picture elements, and of one block of these decoded picture elements, 4X8 picture elements left unregenerated are regenerated as a picture image. With this, coding/decoding using two-dimensional discrete cosine transformation can be performed.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、画像ファイリング装置や画像伝送装置等に適
用される画像データ圧縮のための画像符号化方法及び画
像復号化方法に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to an image encoding method and an image decoding method for compressing image data, which are applied to image filing devices, image transmission devices, and the like.

従来の技術 従来、階調性のあるデジタル画像データのデータ圧縮技
術として、コサイン変換、アダマール変換等の直交変換
を用いた変換符号化が広く知られている。この変換符号
化は、画像をn×n画素の小さなブロックに分割し、ブ
ロック毎に直交変換を施して変換係数行列を求め、行列
の各成分毎に量子化レベルを決定する方法である。これ
は、例えば特開昭63−109662号公報において示
されている。
2. Description of the Related Art Conventionally, transform encoding using orthogonal transforms such as cosine transform and Hadamard transform has been widely known as a data compression technology for digital image data having gradation. This transform encoding is a method in which an image is divided into small blocks of n×n pixels, orthogonal transform is performed for each block to obtain a transform coefficient matrix, and a quantization level is determined for each component of the matrix. This is shown, for example, in Japanese Unexamined Patent Publication No. 109662/1983.

発明が解決しようとする課題 ところが、2次元離散コサイン変換(DCT)を用いて
符号化を行うとき、n×n画素のブロック毎に処理を行
うため、対象とする画像が縦横(主・副走査方向)にn
の倍数のものに限られてしまう。
Problems to be Solved by the Invention However, when encoding is performed using two-dimensional discrete cosine transform (DCT), processing is performed for each n×n pixel block, so the target image is direction) n
It is limited to multiples of .

この点を、詳細に説明する。DCTを用いた符号化方式
のブロック図を第4図に示す。まず、入力される画像に
対してDCT変換部lで8×8画素のブロック単位でD
CTを行ってDCT係数を求める。ここに、8×8の2
次元DCT変換は、原画素をX1□、変換係数をyu、
とすると、次式で定義される。
This point will be explained in detail. FIG. 4 shows a block diagram of the encoding method using DCT. First, the input image is converted into DCT transform unit l in block units of 8×8 pixels.
Perform CT to find DCT coefficients. Here, 8×8 2
In the dimensional DCT transformation, the original pixel is X1□, the transformation coefficient is yu,
Then, it is defined by the following formula.

ただし、u、vは0,1.〜,7なる整数であり、C(
w)はW=Oの時はC(w)= 2−”” 、w=1.
2.〜,7の時はC(w)=1である。
However, u, v are 0, 1. ~,7 is an integer, and C(
w) is C(w)=2−”” when W=O, w=1.
2. , 7, C(w)=1.

ついで、各係数毎に大きさの異なった量子化のステップ
サイズを設定した量子化マトリクス記憶部2中の量子化
マトリクスを用いて、量子化部3でI)CT係数を線形
量子化し、量子化係数を求める。このとき、量子化マト
リクスは、例えば第5図に示すように、人間の視覚特性
に合わせ低次の係数を細かく量子化するようになってい
る。符号量或いは復号画像品質を制御できるようにする
ため、外部から指定するスケーリングファクタ記憶部4
中のスケーリングファクタを乗算器5で量子化マトリク
スに乗じた値をステップサイズとして量子化を行う。量
子化係数は、出現頻度の高い係数は短いコードが割当て
られ、出現頻度の低い係数には長いコードが割当てられ
ることにより、全体的に符号量を少なくする方式のハフ
マン符号化がハフマン符号化部6で行われ、符号データ
が送出される。
Next, the quantization unit 3 linearly quantizes the CT coefficients using the quantization matrix in the quantization matrix storage unit 2 in which different quantization step sizes are set for each coefficient. Find the coefficient. At this time, the quantization matrix finely quantizes the low-order coefficients in accordance with human visual characteristics, as shown in FIG. 5, for example. In order to control the amount of code or decoded image quality, a scaling factor storage unit 4 is specified from the outside.
Quantization is performed using the value obtained by multiplying the quantization matrix by the scaling factor in the multiplier 5 as the step size. For quantization coefficients, the Huffman encoding unit uses Huffman encoding, which reduces the overall amount of code by assigning short codes to coefficients that appear frequently and long codes to coefficients that appear less frequently. 6, and code data is sent out.

また、復号のときには、符号化の逆の処理を行えばよく
、ハフマン復号化、逆量子化、逆DCTの順で処理する
ことにより画像を再生できる。
Furthermore, during decoding, the reverse processing of encoding may be performed, and the image can be reproduced by processing in the order of Huffman decoding, inverse quantization, and inverse DCT.

ところが、このように符号化を行う場合、第6図に示す
ように画像の主走査方向、副走査方向の画素数がn=8
の倍数でないと、画像の端部に斜線を施して示すような
余りの画素が生じ、8X8のブロックにできないものと
なる。
However, when encoding in this way, the number of pixels in the main scanning direction and sub-scanning direction of the image is n=8, as shown in FIG.
If it is not a multiple of , there will be surplus pixels as shown by diagonal lines at the edges of the image, and the image cannot be made into an 8×8 block.

ちなみに、前述した公報では、このような場合のことは
一切考慮されていない。
Incidentally, the above-mentioned publication does not take such cases into consideration at all.

課題を解決するための手段 画像をn×n画素のブロックに分割し、各々のブロック
に対して2次元離散コサイン変換を行い、求めた係数に
対して量子化をして符号化する画像符号化方法において
、主走査方向、副走査方向の画素数がnの倍数でないと
き、ブロックに分割できない余りの画素に対して、一度
符号化を行ったブロックの画素を加えてn×nの画素の
ブロックを形成して、符号化を行うようにした。
Means for solving the problem Image encoding divides an image into blocks of n×n pixels, performs two-dimensional discrete cosine transform on each block, and quantizes and encodes the obtained coefficients. In this method, when the number of pixels in the main scanning direction and the sub-scanning direction is not a multiple of n, the pixels of the block that has been encoded once are added to the remaining pixels that cannot be divided into blocks to create a block of n × n pixels. was formed and encoded.

対応する復号化方法としては、符号をn×n画素のブロ
ック毎に逆量子化して、逆2次元離散コサイン変換を行
って復号化する画像復号化方法において、再生すべき主
走査方向、副走査方向の画素数がnの倍数でないとき、
主走査方向にとれるブロック数よりも1ブロック多く復
号化して、主走査方向の未復号画素を前記1ブロック多
く復号したブロックの画素で補うとともに、副走査方向
にとれるブロック数よりもlブロック多く復号化して、
副走査方向の未復号画素を前記1ブロック多く復号した
ブロックの画素で補うようにした。
A corresponding decoding method is an image decoding method in which the code is dequantized for each n×n pixel block and decoded by performing an inverse two-dimensional discrete cosine transform. When the number of pixels in the direction is not a multiple of n,
Decode one block more than the number of blocks that can be taken in the main scanning direction, compensate for the undecoded pixels in the main scanning direction with the pixels of the block that has been decoded one block more, and decode l blocks more than the number of blocks that can be taken in the sub-scanning direction. turned into
The undecoded pixels in the sub-scanning direction are supplemented with the pixels of the decoded block that is one block larger.

作用 主・副走査方向の画像サイズがnの倍数でないため、n
xnの画素ブロックにできなかった画素については一度
符号化を行ったブロックの画素を加えてn×nの画素ブ
ロックを形成して符号化を行い、復号に際しては、ブロ
ック化できなかった画素のみを画像とすることにより、
主・副走査方向の画像サイズがnの倍数でない場合であ
っても2次元離散コサイン変換を用いた符号化及び復号
化が可能となる。
Since the image size in the main and sub-scanning directions is not a multiple of n,
For pixels that could not be made into xn pixel blocks, pixels from the previously encoded block are added to form an n×n pixel block and encoded. During decoding, only the pixels that could not be made into blocks are By making it an image,
Even when the image size in the main and sub-scanning directions is not a multiple of n, encoding and decoding using two-dimensional discrete cosine transformation are possible.

実施例 本発明の一実施例を第1図ないし第3図に基づいて説明
する。第4図ないし第6図で示した部分と同一部分は同
一符号を用いて示す。
Embodiment An embodiment of the present invention will be described with reference to FIGS. 1 to 3. Components that are the same as those shown in FIGS. 4 to 6 are indicated using the same reference numerals.

まず、第2図により本実施例方式の概念を説明する。第
6図に示したようにn=8の倍数でなく、余りの画素が
生じた場合、8×8画素のブロックにブロック化可能な
分について一度符号化を行った後、8×8の画素にブロ
ック化できなかった画素については、第2図に斜線を施
して示すように一度符号化を行ったブロックの画素を加
えて8×8画素のブロックを形成し、符号化を行わせる
ものである。このようなブロックを復号するときは、ブ
ロックにできなかった画素(即ち、第6図中に斜線を施
して示す画素)のみを画像として再生することにより、
主・副走査方向の画像サイズが8の倍数でない場合でも
DCTを用いた符号化を可能としたものである。
First, the concept of the system of this embodiment will be explained with reference to FIG. As shown in Figure 6, if n=8 is not a multiple of 8 and there are surplus pixels, after encoding the number of pixels that can be divided into 8x8 pixel blocks, the 8x8 pixels are For pixels that could not be converted into blocks, as shown by diagonal lines in Figure 2, the pixels of the block that has been encoded once are added to form an 8 x 8 pixel block, and then encoded. be. When decoding such a block, only the pixels that could not be made into a block (i.e., the pixels shown with diagonal lines in FIG. 6) are reproduced as an image.
This enables encoding using DCT even when the image size in the main and sub-scanning directions is not a multiple of 8.

このような処理は第1図及び第3図に示すフローチャー
トに従い行われる。
Such processing is performed according to the flowcharts shown in FIGS. 1 and 3.

第1図は符号化処理を示すもので、まず、8×8画素ブ
ロックの符号化を主走査方向に順次行い、主走査方向の
ブロックが終わったら、主走査方向に8×4画素分が余
るので、この余りの8×4画素を含んで8×8画素ブロ
ック化を行い、その符号化を行う。このような走査を順
次主走査ラインブロック毎に同様に行っていく。副走査
方向のブロックが終わったら、副走査方向に4×8画素
分が余るので、この余りの4×8画素に既に符号化処理
を終えた副走査方向に先行する画素を加えて8×8画素
ブロックを形成し、主走査方向に順次符号化を行う。こ
の場合も、主走査方向のブロックが終了すると、主走査
方向に8×4画素分が余るので、この8×4画素に先行
する符号化済みの画素を加えて8×8画素ブロックを形
成し、その符号化を行う。
Figure 1 shows the encoding process. First, 8x8 pixel blocks are encoded sequentially in the main scanning direction, and when the blocks in the main scanning direction are completed, 8x4 pixels remain in the main scanning direction. Therefore, the remaining 8×4 pixels are formed into an 8×8 pixel block and then encoded. Such scanning is sequentially performed for each main scanning line block. When the block in the sub-scanning direction is completed, there will be 4 x 8 pixels left in the sub-scanning direction, so add the preceding pixels in the sub-scanning direction that have already been encoded to the remaining 4 x 8 pixels to create 8 x 8 pixels. Pixel blocks are formed and sequentially encoded in the main scanning direction. In this case as well, when a block in the main scanning direction is completed, there will be 8 x 4 pixels left in the main scanning direction, so the preceding encoded pixels are added to these 8 x 4 pixels to form an 8 x 8 pixel block. , performs its encoding.

第3図はこのように符号化された画像を復号する処理を
示すフローチャートである。まず、符号を復号し、8×
8画素ブロックを再生する。符号化のときと同様に、主
走査方向に順に復号していくと、最後の8×4画素分が
復号されないので、先行した復号再生済みの8×4画素
分を加えた1ブロック分の8×8画素を復号し、その内
の、未再生の4×8画素分だけを画像として再生する。
FIG. 3 is a flowchart showing the process of decoding an image encoded in this manner. First, decode the code and 8×
Regenerate an 8 pixel block. As with encoding, when decoding is performed sequentially in the main scanning direction, the last 8x4 pixels are not decoded, so the 8x4 pixels for one block are added to the previous 8x4 pixels that have been decoded and reproduced. ×8 pixels are decoded, and only the unregenerated 4×8 pixels are reproduced as an image.

このような手順で主走査ラインブロック毎に副走査方向
に処理していく。副走査方向のブロックが終わったら、
副走査方向に4×8画素分が再生されないので、副走査
方向に先行して復号再生済みの4ライン分の画像を加え
た1ブロック分の8×8画崇を復号し、その内の、未再
生の4×8画素分だけを画像として再生する。主走査方
向のブロックが終了すると、右下の2×2画素分が余る
ので、これに主・副走査方向に先行する復号再生済みの
画素を加えた1ブロック分の8×8画素を復号し、その
内の、未再生の2×2画素分だけを画像として再生する
In this manner, each main scanning line block is processed in the sub scanning direction. When the block in the sub-scanning direction is finished,
Since 4 x 8 pixels are not reproduced in the sub-scanning direction, one block of 8 x 8 pixels is decoded by adding the 4 lines of decoded and reproduced images in advance in the sub-scanning direction, and among them, Only the unreproduced 4×8 pixels are reproduced as an image. When a block in the main scanning direction is completed, 2 x 2 pixels at the bottom right remain, so add the decoded and reproduced pixels that precede it in the main and sub scanning directions to decode one block of 8 x 8 pixels. , among which only the unregenerated 2×2 pixels are reproduced as an image.

発明の効果 本発明は、上述したように主・副走査方向の画像サイズ
がnの倍数でないため、n×nの画素ブロックにできな
かった画素については一度符号化を行ったブロックの画
素を加えてn×nの画素ブロックを形成して符号化を行
い、復号に際しては、ブロック化できなかった画素のみ
を画像とすることにより、主・副走査方向の画像サイズ
がnの倍数でない場合であっても2次元離散コサイン変
換を用いた符号化及び復号化を可能とすることができる
Effects of the Invention In the present invention, as described above, since the image size in the main and sub-scanning directions is not a multiple of n, for pixels that cannot be made into an n×n pixel block, pixels from a block that has been encoded once are added. By forming n×n pixel blocks and encoding them, and decoding, only the pixels that could not be made into blocks are used as images, even if the image size in the main and sub-scanning directions is not a multiple of n. However, it is possible to perform encoding and decoding using two-dimensional discrete cosine transform.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図ないし第3図は本発明の一実施例を示すもので、
第1図は符号化処理を示すフローチャート、第2図は本
実施例方式を概念的に示す説明図、第3図は復号化処理
を示すフローチャート、第4図は従来のDCT符号化方
式を示すブロック図、第5図は量子化マトリクスの説明
図、第6図はブロック化できない場合を示す説明図であ
る。 ]71  図 主走査 印        4 王走萱
1 to 3 show an embodiment of the present invention,
Figure 1 is a flowchart showing the encoding process, Figure 2 is an explanatory diagram conceptually showing the method of this embodiment, Figure 3 is a flowchart showing the decoding process, and Figure 4 shows the conventional DCT encoding method. A block diagram, FIG. 5 is an explanatory diagram of a quantization matrix, and FIG. 6 is an explanatory diagram showing a case where it cannot be divided into blocks. ]71 Figure main scanning mark 4 King-scanning

Claims (1)

【特許請求の範囲】 1、画像をn×n画素のブロックに分割し、各々のブロ
ックに対して2次元離散コサイン変換を行い、求めた係
数に対して量子化をして符号化する画像符号化方法にお
いて、主走査方向、副走査方向の画素数がnの倍数でな
いとき、ブロックに分割できない余りの画素に対して、
一度符号化を行ったブロックの画素を加えてn×nの画
素のブロックを形成して、符号化を行うようにしたこと
を特徴とする画像符号化方法。 2、符号をn×n画素のブロック毎に逆量子化して、逆
2次元離散コサイン変換を行って復号化する画像復号化
方法において、再生すべき主走査方向、副走査方向の画
素数がnの倍数でないとき、主走査方向にとれるブロッ
ク数よりも1ブロック多く復号化して、主走査方向の未
復号画素を前記1ブロック多く復号したブロックの画素
で補うとともに、副走査方向にとれるブロック数よりも
1ブロック多く復号化して、副走査方向の未復号画素を
前記1ブロック多く復号したブロックの画素で補うよう
にしたことを特徴とする画像復号化方法。
[Claims] 1. An image code that divides an image into blocks of n×n pixels, performs two-dimensional discrete cosine transformation on each block, and quantizes and encodes the obtained coefficients. In the method, when the number of pixels in the main scanning direction and the sub-scanning direction is not a multiple of n, for the remaining pixels that cannot be divided into blocks,
An image encoding method characterized in that pixels of a block that has been encoded once are added to form a block of n×n pixels, and encoding is performed. 2. In an image decoding method in which the code is dequantized for each block of n×n pixels and decoded by performing inverse two-dimensional discrete cosine transformation, the number of pixels in the main scanning direction and the sub-scanning direction to be reproduced is n. If the number is not a multiple of , one block more than the number of blocks that can be taken in the main scanning direction is decoded, and the undecoded pixels in the main scanning direction are supplemented with the pixels of the decoded block that is one block more than the number of blocks that can be taken in the sub-scanning direction. An image decoding method characterized in that one additional block is decoded, and undecoded pixels in the sub-scanning direction are supplemented with pixels of the one block more decoded.
JP31345190A 1990-11-19 1990-11-19 Image encoding method and image decoding method Expired - Fee Related JP3032281B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31345190A JP3032281B2 (en) 1990-11-19 1990-11-19 Image encoding method and image decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31345190A JP3032281B2 (en) 1990-11-19 1990-11-19 Image encoding method and image decoding method

Publications (2)

Publication Number Publication Date
JPH04183171A true JPH04183171A (en) 1992-06-30
JP3032281B2 JP3032281B2 (en) 2000-04-10

Family

ID=18041462

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31345190A Expired - Fee Related JP3032281B2 (en) 1990-11-19 1990-11-19 Image encoding method and image decoding method

Country Status (1)

Country Link
JP (1) JP3032281B2 (en)

Also Published As

Publication number Publication date
JP3032281B2 (en) 2000-04-10

Similar Documents

Publication Publication Date Title
US7095448B2 (en) Image processing circuit and method for modifying a pixel value
EP1751982A1 (en) Method and device for encoding blocks of values
EP0519995B1 (en) Digital image processing including block edges filtering
JP3234807B2 (en) Decoding method
JP2839943B2 (en) Image data restoration method and apparatus
JPH04229382A (en) Method and device for resolution conversion of digital image data
JP3032281B2 (en) Image encoding method and image decoding method
JPH04220081A (en) Method and device for picture data decoding
JPH02122767A (en) Encoding/decoding system for picture signal
JP3197425B2 (en) Encoding and decoding apparatus and method
JP3590648B2 (en) Method of compressing original image data and method of expanding original image data
JP2946833B2 (en) Quantization method in image coding
JP2887843B2 (en) Image data restoration method and apparatus
JP3234830B2 (en) Decoding method
JP2710135B2 (en) Adaptive coding between frames / intra-frame
JPH0730889A (en) Picture data encoder
JPH04215385A (en) Method and device for encoding/decoding image data
JP3175324B2 (en) Image compression device
JPH08116538A (en) Image coding system
JPH0746407A (en) Picture data compressing device and picture data restoring device
JPH02171084A (en) System and device for coding picture signal
JPH11331844A (en) Fixed length block encoder and decoder
JPH03243066A (en) Image coding system
JPH05284363A (en) Device and method for restoring image data
JPH05316356A (en) Picture signal decoder

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080210

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090210

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100210

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees