JP2005045527A - Method for compressing still image and method for compressing video signal - Google Patents

Method for compressing still image and method for compressing video signal Download PDF

Info

Publication number
JP2005045527A
JP2005045527A JP2003277462A JP2003277462A JP2005045527A JP 2005045527 A JP2005045527 A JP 2005045527A JP 2003277462 A JP2003277462 A JP 2003277462A JP 2003277462 A JP2003277462 A JP 2003277462A JP 2005045527 A JP2005045527 A JP 2005045527A
Authority
JP
Japan
Prior art keywords
pixel
prediction error
signal
video signal
frame
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.)
Withdrawn
Application number
JP2003277462A
Other languages
Japanese (ja)
Inventor
Toshio Motegi
敏雄 茂出木
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2003277462A priority Critical patent/JP2005045527A/en
Publication of JP2005045527A publication Critical patent/JP2005045527A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Image Processing (AREA)
  • Color Television Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a video signal compressing method realizing not only improvement of the compression ratio but also reduction of the operation load for compression. <P>SOLUTION: In the case of compressing the signals constituted in frame groups in which still image frames are arrayed in time series as to completely reproduce the image signal, respective pixels (i,j) on each frame are processed in the reverse direction together for the scanning lines, a section in which the same pixel values are continued is extracted as a signal flat part, the section is masked, and after applying linear predictive error conversion to the pixels which are not masked, and the value of each pixel is converted in variable bit lengths. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、映像制作、映像データの素材保管、ロケ素材の中継など映像制作分野、特にNTSC以上の品質の高い高精細映像制作を行う分野、コンピュータグタフィックスを用いたCGアニメーション映像制作分野、科学技術シミュレーションにおける可視化映像制作分野、CD・DVD・半導体メモリ等のデジタル記録媒体を用いた映像記録再生装置分野、電子カルテや遠隔医療における医用静止画・動画像の保存と伝送、リモートセンシング・衛星画像解析・地図情報処理分野におけるデータの保管と伝送など、データの改変が嫌われる分野等において好適なデータの圧縮技術に関する。   The present invention relates to the field of video production such as video production, storage of video data materials, and relaying of location materials, especially the field of high-definition video production with higher quality than NTSC, the field of CG animation video using computer graphics, science Visualized video production field in technical simulation, video recording and playback device field using digital recording media such as CD, DVD, and semiconductor memory, storage and transmission of medical still images and moving images in electronic medical records and telemedicine, remote sensing and satellite images The present invention relates to a data compression technique that is suitable in fields where data modification is hated, such as data storage and transmission in the analysis / map information processing field.

従来より、映像信号の圧縮には様々な手法が用いられている。映像信号を圧縮して符号化する手法として、MPEG−1、MPEG−2、MPEG−4などが実用化されている。このような圧縮符号化方式により、映像信号を小さいデータとして扱うことが可能となり、データの記録・伝送の効率化に貢献している。   Conventionally, various methods are used for compressing video signals. MPEG-1, MPEG-2, MPEG-4, and the like have been put to practical use as methods for compressing and encoding video signals. Such a compression encoding method makes it possible to handle a video signal as small data, and contributes to the efficiency of data recording and transmission.

上述のようなMPEG−1、MPEG−2、MPEG−4等はいずれもロッシー符号化方式といわれるものであり、効率的な圧縮が可能であるが、復号化にあたって、少なからず品質の劣化を伴い、原信号を完全に再現することはできない。そのため、映像制作、素材保管、ロケ素材の中継など映像制作分野では、これらの符号化方式を適用できず、非効率ではあるが、非圧縮で保存・伝送する方式がとられている。特に最近は高精細HDTV映像を扱うプロダクションが増え、素材容量が膨大になり、ワークディスクを管理する上で問題になっていた。   The above-described MPEG-1, MPEG-2, MPEG-4, etc. are all referred to as lossy encoding methods and can be efficiently compressed, but there is a considerable quality degradation in decoding. The original signal cannot be reproduced completely. Therefore, in the video production field such as video production, material storage, and location material relaying, these encoding methods cannot be applied, and although inefficient, a method for storing and transmitting without compression is used. In particular, recently, the production of high-definition HDTV video has increased, and the material capacity has become enormous, which has become a problem in managing work disks.

このような問題を解決するため、複数のマルコフモデルで周囲の画素を予測する手法(特許文献1参照)等が提案されている。
特開平11−164303号公報
In order to solve such a problem, a method of predicting surrounding pixels with a plurality of Markov models (see Patent Document 1) has been proposed.
JP 11-164303 A

上記従来の手法では、圧縮率を高めるために膨大な計算を行わなければならないという問題がある。特に、1つのフレーム上で細かい変化が少ないCG(コンピュータグラフィックス)等で作成された映像に対して行うと、不必要に多くの計算を行うことになる。そこで、本発明は、圧縮率を高めることはもちろんのこと、圧縮のための演算負荷を減らすことが可能な静止画像の圧縮方法および映像信号の圧縮方法を提供することを課題とする。   The conventional method has a problem that enormous calculation must be performed in order to increase the compression rate. In particular, if it is performed on an image created by CG (computer graphics) or the like with little fine change on one frame, an unnecessarily large number of calculations are performed. Accordingly, an object of the present invention is to provide a still image compression method and a video signal compression method capable of reducing the computation load for compression as well as increasing the compression rate.

上記課題を解決するため、本発明では、静止画像であるフレームを時系列に配列したフレーム群として構成される映像信号に対して、当該映像信号を再現できるように情報量を圧縮する方法として、各フレーム上の各画素データが同一となる区間を走査線方向に従って検出し、検出した区間をマスク領域としてマスクすると共に、検出した区間の情報を信号平坦部データとして抽出する信号平坦部処理段階と、各フレームにおいてマスクされなかった非マスク領域に存在する各画素を対象画素とし、対象画素の画素値および、対象画素の近傍に位置する近傍画素の画素値を利用して、対象画素および近傍画素の画素値に乗じる線形係数が異なる複数の予測計算式に対して、複数の予測誤差候補を算出し、予測誤差候補の中から最適なものを対象画素の予測誤差として採用し、対象画素の値を予測誤差に置き換える予測誤差算出段階と、予測誤差に置き換えられた各画素データを可変長で符号化する可変長符号化段階を実行するようにしたことを特徴とする。   In order to solve the above problems, in the present invention, as a method of compressing the amount of information so that the video signal can be reproduced with respect to a video signal configured as a frame group in which frames that are still images are arranged in time series, A signal flat part processing stage that detects a section in which each pixel data on each frame is the same in accordance with the scanning line direction, masks the detected section as a mask area, and extracts information of the detected section as signal flat part data; The target pixel and the neighboring pixel using the pixel value of the target pixel and the pixel value of the neighboring pixel located in the vicinity of the target pixel, with each pixel existing in the non-masked area not masked in each frame as the target pixel Calculate multiple prediction error candidates for multiple prediction calculation formulas with different linear coefficients multiplied by the pixel value of, and match the optimal prediction error candidates. Adopted as a pixel prediction error, a prediction error calculation step that replaces the value of the target pixel with the prediction error, and a variable length encoding step that encodes each pixel data replaced with the prediction error with a variable length are executed. It is characterized by that.

本発明によれば、各フレーム上を走査線方向に処理して信号平坦部を抽出し、抽出された部分以外の画素について、近傍の画素を利用して複数の予測式それぞれに対して算出した値から最適なものを、その画素の予測誤差として選出した後、予測誤差で記録された画素を可変長で符号化するようにしたので、CG等に特有の同一の画素値が連続する部分は、信号平坦部として抽出され、また、他の部分は、予測誤差、可変長符号化により少ないビット数で記録することができ、全体として、演算量を抑え、かつ圧縮率の高い圧縮を行うことが可能となるという効果を奏する。   According to the present invention, each frame is processed in the scanning line direction to extract a signal flat portion, and pixels other than the extracted portion are calculated for each of a plurality of prediction formulas using neighboring pixels. Since the optimum value is selected as the prediction error of the pixel and the pixel recorded with the prediction error is encoded with a variable length, the portion where the same pixel value peculiar to CG etc. continues is Extracted as a signal flat part, and the other part can be recorded with a small number of bits due to prediction error and variable length coding, and as a whole, the amount of calculation is suppressed and compression with a high compression rate is performed. There is an effect that becomes possible.

以下、本発明の実施形態について図面を参照して詳細に説明する。
(デジタル映像信号の構造)
まず、本発明に係る映像信号の圧縮方法において可逆圧縮対象とするデジタル映像信号について説明しておく。本実施形態では、映像信号として三原色の色信号から構成されるカラー映像信号を適用した場合を例にとって説明していく。図1(a)は、本発明において扱うデジタル映像信号を模式化して示した図である。図1において、左右方向は時系列方向であり、右側に行く程、時間が進むことになる。図1(a)に示した映像信号は1フレームが光の三原色であるR・G・Bの3プレーンで構成されている。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
(Structure of digital video signal)
First, a digital video signal to be subjected to lossless compression in the video signal compression method according to the present invention will be described. In this embodiment, a case where a color video signal composed of three primary color signals is applied as a video signal will be described as an example. FIG. 1A is a diagram schematically showing a digital video signal handled in the present invention. In FIG. 1, the left-right direction is a time-series direction, and the time progresses as it goes to the right. The video signal shown in FIG. 1A is composed of three planes of R, G, and B in which one frame is the three primary colors of light.

図1(a)に示したようなデジタル映像信号を得るには、まず、映像をTVカメラ等で撮影してデジタル化する。CG等の場合は、カメラを通さず、データそのものを入力する。このようにして、デジタル映像信号が得られる。このようなデジタル映像信号は、1秒間に複数フレーム(静止画像)を有し、各フレームがR、G、Bの3色の輝度値を有するものとなっている。なお、本実施形態では、1秒間に30フレーム、各画素の各色に8ビットが割り当てられているものとして説明する。例えば、10秒間に渡って記録したデジタル映像信号は、300フレーム、900プレーンで構成されるフレーム群となる。
(本発明の圧縮方法)
続いて、本発明に係る映像信号の圧縮方法の概要について説明する。本発明の圧縮方法は、コンピュータ、およびコンピュータに搭載される専用のソフトウェアプログラムにより実行される。図2は、本発明に係る映像信号の圧縮方法の概要を示すフローチャートである。まず、図1(a)に示したようなデジタル映像信号を、圧縮するための装置(専用のソフトウェアを搭載したコンピュータ等)に読み込ませる。すると、圧縮用の装置が処理を開始する。まず、デジタル映像信号の各フレームの各プレーンについて、色信号間の相関演算処理を行う(ステップS1)。具体的には、R、G、Bの各プレーンの各画素の値を基に、以下の〔数式1〕に従って計算し、R、G、Bの各プレーンを、新たなX、Y、Zの各プレーンに再構成する。この結果、図1(b)に示すように、各フレームは、X、Y、Zプレーンにより構成されることになる。
〔数式1〕
X=R−G
Z=B−G
Y=G+X/3+Z/3
〔数式1〕において、Xは、GとRの差分演算、Zは、GとBの差分演算により得られるものであることを示している。なお、Yを求めるための第三式の右辺の要素にX、Zが含まれているため、第三式による演算以前に、Xを求めるための第一式、Zを求めるための第二式を演算処理を行っておかなければならない。ここで、いずれにおいても、Gを基準としているのは、輝度信号はGを主体としており、R−G、B−Gの色差信号の空間分解能はG信号に対して1/2程度になるためである。すなわち、R、Bの2プレーンを差分信号X、Zにすると、隣接画素間の輝度差が小さくなり、圧縮に適したデータとなる。なお、入力映像が、モノクロである場合は、X、Zの値は共に「0」となる。
In order to obtain a digital video signal as shown in FIG. 1A, first, a video is photographed with a TV camera or the like and digitized. In the case of CG or the like, the data itself is input without passing through the camera. In this way, a digital video signal is obtained. Such a digital video signal has a plurality of frames (still images) per second, and each frame has luminance values of three colors of R, G, and B. In this embodiment, it is assumed that 30 frames per second and 8 bits are assigned to each color of each pixel. For example, a digital video signal recorded for 10 seconds becomes a frame group composed of 300 frames and 900 planes.
(Compression method of the present invention)
Next, an outline of a video signal compression method according to the present invention will be described. The compression method of the present invention is executed by a computer and a dedicated software program installed in the computer. FIG. 2 is a flowchart showing an outline of a video signal compression method according to the present invention. First, a digital video signal as shown in FIG. 1A is read by a device for compression (such as a computer equipped with dedicated software). Then, the compression device starts processing. First, correlation processing between color signals is performed for each plane of each frame of the digital video signal (step S1). Specifically, based on the value of each pixel in each of the R, G, and B planes, calculation is performed according to the following [Equation 1], and each of the R, G, and B planes is converted into new X, Y, and Z planes. Reconfigure to each plane. As a result, as shown in FIG. 1B, each frame is configured by X, Y, and Z planes.
[Formula 1]
X = R−G
Z = BG
Y = G + X / 3 + Z / 3
In [Formula 1], X indicates that it is obtained by the difference calculation between G and R, and Z indicates that it is obtained by the difference calculation between G and B. In addition, since X and Z are included in the element on the right side of the third equation for obtaining Y, the first equation for obtaining X and the second equation for obtaining Z before the calculation by the third equation. Must be processed. Here, in any case, G is based on G because the luminance signal is mainly G, and the spatial resolution of the RG and BG color difference signals is about ½ of the G signal. It is. That is, when the two planes R and B are used as the difference signals X and Z, the luminance difference between adjacent pixels is reduced, and the data is suitable for compression. When the input video is monochrome, both X and Z values are “0”.

続いて、信号平坦部の処理を行う(ステップS2)。信号平坦部とは、信号レベルが均一な値になっている箇所をいう。コンピュータグラフィックス映像等を除き、均一な値として信号レベルの最小値「0」または信号レベルの最大値(例えば255)が通常候補になる。実写映像では、一般にこのような箇所はまれであるが、照明が全暗になりA/D変換器入力が零校正レベル以下であったり(カメラの校正により全暗時にはカメラ信号出力が負値になる場合もある)、映像が逆光照明になってA/D変換器が飽和したりすると、このような箇所が生じる。信号レベルが「0」および信号レベルが最大値のいずれであっても、信号平坦部は、同一の信号レベルが所定の領域(所定の画素数)連続して記録される。このため、この部分は圧縮し易いデータになっている。すなわち、ステップS2においては、隣接する画素との値の差が「0」である画素が連続する部分を、信号平坦部データとして別途記録することになる。画素の差分演算の方向は、画素の走査線方向に行う。具体的には、隣接する画素と画素値の差が「0」である限り、次の画素との比較を行っていき、差が「1」以上となる画素が存在した場合に、その直前の画素までを信号平坦部として抽出する。信号平坦部データが記録された場合、プレーン上のその領域はマスク領域としてマスクされることになる。   Subsequently, the signal flat portion is processed (step S2). The signal flat portion is a portion where the signal level is a uniform value. Except for computer graphics images, the minimum value “0” of the signal level or the maximum value (eg, 255) of the signal level is a normal candidate as a uniform value. In a live-action image, such a part is generally rare, but the illumination becomes dark and the A / D converter input is below the zero calibration level (the camera signal output becomes negative when dark due to camera calibration). This may occur when the image is backlit and the A / D converter is saturated. Regardless of whether the signal level is “0” and the signal level is the maximum value, the same signal level is continuously recorded in a predetermined area (a predetermined number of pixels) in the signal flat portion. For this reason, this portion is easily compressed data. That is, in step S2, a portion where pixels having a value difference of “0” from adjacent pixels continues is separately recorded as signal flat portion data. The direction of pixel difference calculation is performed in the pixel scanning line direction. Specifically, as long as the difference between the adjacent pixel and the pixel value is “0”, the comparison with the next pixel is performed, and when there is a pixel whose difference is “1” or more, the immediately preceding pixel is compared. Up to the pixels are extracted as signal flat portions. When the signal flat portion data is recorded, the area on the plane is masked as a mask area.

ここで、信号平坦部処理の様子を図3を用いて説明する。例えば、画像が横720画素×縦480画素で構成されている場合、左上端の画素(1,1)から右下端の画素(720,480)まで順次処理していくが、左上端の画素(1,1)から右上端の画素(720,1)まで右方向に向かって処理した後、右端2行目の画素(720,2)から左端2行目の画素(1,2)まで左方向に向かって処理し、さらに、左端3行目の画素(1,3)から右端3行目の画素(720,3)まで左方向に向かって処理する、という具合にジグザグに処理し、右端479行目の画素(720,479)から右端最下行の画素(720,480)を通って、左端最下行の画素(1,480)まで処理していく。この処理方向において、連続する画素の値が同一である場合に、信号平坦部データとして記録する。このようにして、奇数番目と偶数番目の処理方向を逆にするのは、処理する画素値の変動を抑えるためである。例えば、図3の例で、画素(720,1)の画素値に着目すると、画素(720,2)の画素値とは大きく変わらないと予想されるが、画素(1,2)の画素値とは大きく変わることが予想される。ステップS2および後述するステップS3の処理においては、画素値の差が「0」である場合にデータ圧縮が可能となるので、画素値の変動を抑えるため、奇数番目と偶数番目の処理方向を逆にしているのである。   Here, the state of the signal flat portion processing will be described with reference to FIG. For example, if the image is composed of 720 pixels wide × 480 pixels long, the processing is sequentially performed from the upper left pixel (1, 1) to the lower right pixel (720, 480). 1,1) to the right uppermost pixel (720,1), and then processing in the right direction, then the rightmost second row pixel (720,2) to the leftmost second row pixel (1,2) leftward Further, the processing is performed in a zigzag manner from the pixel (1, 3) in the third row on the left end to the pixel (720, 3) in the third row on the right end, and the right end 479. The processing is performed from the pixel (720, 479) on the row through the pixel (720, 480) on the bottom rightmost row to the pixel (1, 480) on the bottom leftmost row. When the values of consecutive pixels are the same in this processing direction, they are recorded as signal flat portion data. The reason for reversing the odd-numbered and even-numbered processing directions in this way is to suppress fluctuations in pixel values to be processed. For example, in the example of FIG. 3, when attention is paid to the pixel value of the pixel (720, 1), it is expected that the pixel value of the pixel (720, 2) is not significantly different from the pixel value of the pixel (720, 2). Is expected to change significantly. In the processing of step S2 and step S3, which will be described later, data compression is possible when the difference between pixel values is “0”. Therefore, the odd-numbered and even-numbered processing directions are reversed in order to suppress variations in pixel values. It is.

信号平坦部データの作成は、信号平坦部の先頭画素の座標値を記録すると共に、同一画素値が連続する画素数、画素値を信号平坦部テーブルに記録していくことにより行われる。信号平坦部テーブルの一例を図4(a)に示す。本実施形態では、信号平坦部データは、先頭画素のij座標、連続する画素数、信号平坦部に共通となる画素値で構成されている。図4(a)の1段目に示す信号平坦部は、(5,10)から85個(すなわち(5,94)まで)の画素の値が「136」で同一であることを示している。図4の2段目に示す信号平坦部は、(681,25)から106個の画素の値が「88」で同一であることを示している。(681,25)から106個となると、右端の(720,25)に達するので、その下の行の(720,26)から(655,26)までが信号平坦部となる。   The signal flat portion data is created by recording the coordinate value of the first pixel of the signal flat portion and recording the number of pixels and pixel values having the same pixel value in succession in the signal flat portion table. An example of the flat signal portion table is shown in FIG. In the present embodiment, the signal flat portion data is composed of the ij coordinate of the first pixel, the number of consecutive pixels, and a pixel value common to the signal flat portion. The signal flat part shown in the first row in FIG. 4A indicates that the values of (5, 10) to 85 (that is, (5, 94)) pixels are “136” and are the same. . The signal flat portion shown in the second row of FIG. 4 indicates that the values of 106 pixels from (681, 25) are “88” and are the same. When the number is 106 from (681, 25), it reaches (720, 25) at the right end, and (720, 26) to (655, 26) in the lower row are signal flat portions.

なお、図4(a)に示した信号平坦部テーブルは、フレーム番号およびプレーン種別毎に用意されており、復号時に、信号平坦部データを、どのフレームのどのプレーンに戻せば良いかがわかるようになっている。   Note that the signal flat part table shown in FIG. 4A is prepared for each frame number and plane type, so that it can be understood to which plane of which frame the signal flat part data should be returned at the time of decoding. It has become.

次に、信号平坦部処理されたデジタル映像信号に対して、時間的に隣接するフレーム間の演算処理を行う(ステップS3)。具体的には、まず、隣接するフレーム間の同一色プレーン同士で同一座標の画素同士の差分演算を行う。その結果、差分が「0」、すなわち画素の値が同一となる画素の集合をフレーム間同一データとして別途記録する。ステップS3における隣接フレーム間の画素の差分演算も、上記ステップS2と同様に、画素の走査線方向に行う。具体的には、隣接するフレーム間の同一座標の画素との差が「0」である限り、次の画素についても比較を行っていき、差が「1」以上となる区間が存在した場合に、その直前の画素までの画素をフレーム間同一データとして抽出する。なお、この際、既に信号平坦部処理でマスクされた領域は、比較対象の画素から除外する。フレーム間同一データが記録された場合、後続するフレームのその領域はマスク領域としてマスクされることになる。なお、隣接するフレーム間とは、例えば、図1(b)の例ではフレームF1とフレームF2のことであり、フレームF2が後続するフレームとなる。フレームF1とフレームF2間で相関演算を行う場合、フレームF1のXプレーンとフレームF2のXプレーン、フレームF1のYプレーンとフレームF2のYプレーン、フレームF1のZプレーンとフレームF2のZプレーンの3つの相関演算が行われる。   Next, a computation process between temporally adjacent frames is performed on the digital video signal subjected to the signal flattening process (step S3). Specifically, first, a difference calculation is performed between pixels having the same coordinates on the same color planes between adjacent frames. As a result, a set of pixels having a difference of “0”, that is, having the same pixel value is separately recorded as the same data between frames. The pixel difference calculation between adjacent frames in step S3 is also performed in the pixel scanning line direction, similar to step S2. Specifically, as long as the difference between adjacent frames with the same coordinate pixel is “0”, the next pixel is also compared, and there is a section where the difference is “1” or more. The pixels up to the pixel just before are extracted as the same data between frames. At this time, the region already masked by the signal flat portion process is excluded from the comparison target pixels. When the same data is recorded between frames, the area of the subsequent frame is masked as a mask area. In addition, between the adjacent frames is, for example, the frame F1 and the frame F2 in the example of FIG. 1B, and the frame F2 is a subsequent frame. When the correlation calculation is performed between the frames F1 and F2, 3 of the X plane of the frame F1 and the X plane of the frame F2, the Y plane of the frame F1 and the Y plane of the frame F2, the Z plane of the frame F1 and the Z plane of the frame F2 Two correlation operations are performed.

フレーム間の差分演算は、同一プレーンの同一座標の画素同士を比較することにより行う。すなわち、画素(1,1)同士を比較した後、画素(2,1)同士を比較し、図3に示した信号平坦部の場合と同様に、各行ごとに処理方向を逆にして、画素(1,480)まで処理を行うことになる。この結果、画素同士の差分が「0」となる区間を、マスク領域としてマスクすると共に、フレーム間同一データとして記録する。   Difference calculation between frames is performed by comparing pixels having the same coordinates on the same plane. That is, after comparing the pixels (1, 1), the pixels (2, 1) are compared, and the processing direction is reversed for each row, as in the case of the signal flat portion shown in FIG. Processing is performed up to (1,480). As a result, the section where the difference between the pixels is “0” is masked as a mask area and recorded as the same data between frames.

フレーム間同一データの作成は、差分が「0」となった先頭画素の座標値を記録すると共に、差分が「0」となる画素が連続する画素数をフレーム間テーブルに記録していくことにより行われる。フレーム間テーブルの一例を図4(b)に示す。本実施形態では、フレーム間同一データは、先頭画素のij座標、連続する画素数で構成されている。   To create the same data between frames, the coordinate value of the first pixel with a difference of “0” is recorded, and the number of consecutive pixels with a difference of “0” is recorded in the table between frames. Done. An example of the interframe table is shown in FIG. In this embodiment, the same data between frames is composed of the ij coordinate of the first pixel and the number of continuous pixels.

なお、図4(b)に示したフレーム間テーブルは、フレーム間およびプレーン種別毎に用意されており、復号時に、フレーム間同一データを、どのフレームのどのプレーンに戻せば良いかがわかるようになっている。   Note that the inter-frame table shown in FIG. 4B is prepared for each inter-frame and for each plane type, so that it can be seen which plane of which frame the same inter-frame data should be returned at the time of decoding. It has become.

このように、隣接する両フレーム間において、画素の差分演算を行うと、動きが早い部分については、当然画素値の差分が大きくなる。例えば、ある風景の中の特定の位置で物体が激しく動いているシーンなどでは、物体が存在する位置では、相関が低いことがあらかじめわかっているので、相関演算の処理を行うだけ無駄になる。このような場合、動きの速い部分だけをフレーム間演算の非適用領域として設定しておき、その他の領域についてのみフレーム間演算を行うようにすれば良い。そのため、本発明では、画像のフレームを表示手段などに表示させ、非適用領域のフレーム上の位置と、フレーム番号(時刻)をあらかじめ利用者に設定させるようにしている。このように、非適用領域が設定されたフレームについては、非適用領域を除いた領域について相関演算を行う。   As described above, when the pixel difference calculation is performed between both adjacent frames, the difference in pixel value naturally increases in a portion where the movement is fast. For example, in a scene where an object is moving violently at a specific position in a certain landscape, it is known in advance that the correlation is low at the position where the object exists, and therefore, only the correlation calculation process is wasted. In such a case, it is only necessary to set only a fast-moving part as a non-application area for the inter-frame calculation and perform the inter-frame calculation only for the other areas. Therefore, in the present invention, the frame of the image is displayed on the display means or the like, and the position of the non-application area on the frame and the frame number (time) are set in advance by the user. As described above, for the frame in which the non-application area is set, the correlation calculation is performed on the area excluding the non-application area.

以上のようにして、デジタル映像信号のフレーム群から信号平坦部データ、フレーム間同一データが分離され、分離された各データの画素は、いわゆるランレングス形式により、各テーブルに少ないデータ量で記録される。また、各プレーン上には、信号平坦部データ、フレーム間同一データとして抽出された画素に対応する領域は、マスク領域としてマスクされる。   As described above, the signal flat portion data and the same data between frames are separated from the frame group of the digital video signal, and the pixels of each separated data are recorded in each table with a small amount of data in a so-called run length format. The On each plane, areas corresponding to pixels extracted as signal flat portion data and identical data between frames are masked as mask areas.

なお、マスク領域は、各フレーム各プレーンにおいて、マスクされた区間の座標を、マスクデータに記録することにより行われる。後述する非マスク領域に対する処理は、コンピュータが、マスクデータを参照してマスク領域を認識し、マスク領域以外を非マスク領域として認識することにより、処理すべき画素が決定される。   The mask area is performed by recording the coordinates of the masked section in each plane of each frame in the mask data. In the processing for a non-mask area to be described later, the computer recognizes the mask area by referring to the mask data, and recognizes the area other than the mask area as the non-mask area, thereby determining the pixel to be processed.

続いて、非マスク領域の画素について、近傍の画素を基に各画素の予測値と予測誤差の算出を行う(ステップS4)。本実施形態では、算出対象とする対象画素(i,j)の予測誤差値e(i,j)を算出するために、対象画素の元の画素値x(i,j)、および図5に示すような近傍3画素(i−1,j−1)、(i,j−1)、(i−1,j)の値x(i−1,j−1)、x(i,j−1)、x(i−1,j)を利用する。   Subsequently, for the pixels in the non-mask area, the prediction value and the prediction error of each pixel are calculated based on the neighboring pixels (step S4). In the present embodiment, in order to calculate the prediction error value e (i, j) of the target pixel (i, j) to be calculated, the original pixel value x (i, j) of the target pixel and FIG. The values x (i−1, j−1) and x (i, j−) of three neighboring pixels (i−1, j−1), (i, j−1), (i−1, j) as shown in FIG. 1), x (i-1, j) is used.

以下に、このような近傍3画素を利用した予測誤差変換について説明する。予測誤差変換の処理概要を図6のフローチャートに示す。まず、あらかじめ準備された複数の予測計算式を用いて、各予測計算式に対応した線形予測誤差を算出する(ステップS11)。具体的には、画素(i,j)の予測誤差を算出する予測計算式として、以下の〔数式2〕〜〔数式8〕を用意している。
〔数式2〕
e0=x(i,j)−x(i−1,j)
〔数式3〕
e1=x(i,j)−x(i,j−1)
〔数式4〕
e2=x(i,j)−x(i−1,j−1)
〔数式5〕
e3=x(i,j)−x(i−1,j)−x(i,j−1)+x(i−1,j−1)
〔数式6〕
e4=x(i,j)−x(i−1,j)−{x(i,j−1)−x(i−1,j−1)}/2
〔数式7〕
e5=x(i,j)−x(i,j−1)−{x(i−1,j)−x(i−1,j−1)}/2
〔数式8〕
e6=x(i,j)−{x(i−1,j)+x(i,j−1)}/2
上記〔数式2〕〜〔数式8〕において、e0〜e6は各予測計算式による画素(i,j)の予測誤差であり、x(i,j)、x(i,j−1)、x(i−1,j)、x(i−1,j−1)は画素(i,j)、(i,j−1)、(i−1,j)、(i−1,j−1)における画素値である。
Hereinafter, prediction error conversion using such three neighboring pixels will be described. A processing outline of the prediction error conversion is shown in the flowchart of FIG. First, a linear prediction error corresponding to each prediction calculation formula is calculated using a plurality of prediction calculation formulas prepared in advance (step S11). Specifically, the following [Formula 2] to [Formula 8] are prepared as prediction calculation formulas for calculating the prediction error of the pixel (i, j).
[Formula 2]
e0 = x (i, j) -x (i-1, j)
[Formula 3]
e1 = x (i, j) -x (i, j-1)
[Formula 4]
e2 = x (i, j) -x (i-1, j-1)
[Formula 5]
e3 = x (i, j) -x (i-1, j) -x (i, j-1) + x (i-1, j-1)
[Formula 6]
e4 = x (i, j) -x (i-1, j)-{x (i, j-1) -x (i-1, j-1)} / 2
[Formula 7]
e5 = x (i, j) -x (i, j-1)-{x (i-1, j) -x (i-1, j-1)} / 2
[Formula 8]
e6 = x (i, j)-{x (i-1, j) + x (i, j-1)} / 2
In the above [Equation 2] to [Equation 8], e0 to e6 are prediction errors of the pixel (i, j) by each prediction calculation equation, and x (i, j), x (i, j-1), x (I-1, j) and x (i-1, j-1) are pixels (i, j), (i, j-1), (i-1, j), (i-1, j-1). ).

続いて、上記各予測計算式別の予測誤差値の絶対値の累積である累積誤差が最小となる線形予測誤差をその画素の予測誤差として選出する(ステップS12)。ここでは、累積誤差という考え方を用いている。具体的には、各予測計算式〔数式2〕〜〔数式8〕により算出された予測誤差の過去の画素についての累積値をA0〜A6として設定する。そして、この累積誤差A0〜A6のうち、最小となるものに対応する予測誤差を選出する。例えば、A0〜A6のうち、A3が最小であったとする。この場合、〔数式5〕で算出された予測誤差e3を符号化対象とする予測誤差e(i,j)として選出することになる。選出された予測誤差e(i,j)は、画素(i,j)の元の値x(i,j)と置き換えられて以降処理が行われることになる。   Subsequently, the linear prediction error that minimizes the cumulative error, which is the cumulative absolute value of the prediction error value for each prediction calculation formula, is selected as the prediction error of the pixel (step S12). Here, the concept of cumulative error is used. Specifically, the cumulative values of past pixels of the prediction error calculated by the respective prediction calculation formulas [Formula 2] to [Formula 8] are set as A0 to A6. Then, a prediction error corresponding to the smallest one of the accumulated errors A0 to A6 is selected. For example, it is assumed that A3 is the smallest among A0 to A6. In this case, the prediction error e3 calculated by [Formula 5] is selected as the prediction error e (i, j) to be encoded. The selected prediction error e (i, j) is replaced with the original value x (i, j) of the pixel (i, j), and the subsequent processing is performed.

続いて、累積誤差A0〜A6に各予測誤差e0〜e6の絶対値を加算する(ステップS13)。具体的には、以下の〔数式9〕に示すように、累積誤差値となる変数A0〜A6を更新していく。同時に、各サンプルの処理を行う度に、カウンタを1つづつ加算していく処理を行う。
〔数式9〕
A0←A0+|e0| A1←A1+|e1|
A2←A2+|e2| A3←A3+|e3|
A4←A4+|e4| A5←A5+|e5|
A6←A6+|e6|
続いて、カウンタが所定回数を超えたかどうかの判定を行う(ステップS14)。本実施形態では、この所定回数を100回として設定している。すなわち、カウンタが100を超えたかどうかの判定を行う。
Subsequently, the absolute values of the prediction errors e0 to e6 are added to the accumulated errors A0 to A6 (step S13). Specifically, as shown in [Formula 9] below, the variables A0 to A6 that are accumulated error values are updated. At the same time, each time the processing of each sample is performed, a process of incrementing the counter by one is performed.
[Formula 9]
A0 ← A0 + | e0 | A1 ← A1 + | e1 |
A2 ← A2 + | e2 | A3 ← A3 + | e3 |
A4 ← A4 + | e4 | A5 ← A5 + | e5 |
A6 ← A6 + | e6 |
Subsequently, it is determined whether the counter has exceeded a predetermined number of times (step S14). In this embodiment, this predetermined number is set as 100 times. That is, it is determined whether or not the counter exceeds 100.

この結果、カウンタが100を超えていたら、累積誤差を半分にする(ステップS15)。具体的には、以下の〔数式10〕に示すように、累積誤差となる変数A0〜A6を2で除算する。同時に、カウンタを0にリセットする。すなわち、ここでのA0〜A6は純粋な意味での累積誤差ではなく、累積誤差の移動平均となっている。本実施形態では、直前の最大100画素までは累積されるが、それ以前のものは半分になるように処理する。これにより、距離的に離れた画素の影響が小さくなるようにしている。
〔数式10〕
A0←(A0)/2 A1←(A1)/2
A2←(A2)/2 A3←(A3)/2
A4←(A4)/2 A5←(A5)/2
A6←(A6)/2
上記ステップS11〜ステップS15の処理を全フレーム、全プレーンの非マスク領域における全画素に対して実行することにより、非マスク領域の全画素の値が元の値x(i,j)から対象誤差e(i,j)に置き換えられることになる。なお、プレーン上の各画素データの中には、上記ステップS2の信号平坦部処理、ステップS3のフレーム間演算においてマスクされたマスク領域が存在する。このマスク領域上の各画素については、予測誤差算出の対象画素とはしないが、マスク領域に属さない対象画素の予測誤差算出のために利用される。例えば、図5に示すようなプレーンにおいて、マスク領域に属さない画素(i,j)を対象画素として予測誤差を求める際、画素(i−1,j−1)、画素(i,j−1)、画素(i−1,j)のいずれかがマスク領域に存在するか否かに関わらず、画素(i−1,j−1)、画素(i,j−1)、画素(i−1,j)の値を利用して画素(i,j)の予測誤差の算出を行う。
As a result, if the counter exceeds 100, the accumulated error is halved (step S15). Specifically, as shown in the following [Formula 10], variables A0 to A6, which are accumulated errors, are divided by two. At the same time, the counter is reset to zero. That is, A0 to A6 here are not cumulative errors in a pure sense, but are moving averages of cumulative errors. In the present embodiment, processing is performed so that the previous maximum 100 pixels are accumulated, but the previous one is halved. As a result, the influence of pixels that are distant from each other is reduced.
[Formula 10]
A0 ← (A0) / 2 A1 ← (A1) / 2
A2 ← (A2) / 2 A3 ← (A3) / 2
A4 ← (A4) / 2 A5 ← (A5) / 2
A6 ← (A6) / 2
By executing the processing of step S11 to step S15 for all pixels in the non-mask area of all frames and all planes, the value of all pixels in the non-mask area changes from the original value x (i, j) to the target error. It will be replaced by e (i, j). In each pixel data on the plane, there is a mask area masked in the signal flat portion processing in step S2 and the inter-frame calculation in step S3. Each pixel on the mask area is not a target pixel for prediction error calculation, but is used to calculate a prediction error for a target pixel that does not belong to the mask area. For example, in a plane as shown in FIG. 5, when obtaining a prediction error using a pixel (i, j) that does not belong to the mask area as a target pixel, the pixel (i−1, j−1), the pixel (i, j−1) ), Pixel (i-1, j), pixel (i-1, j-1), pixel (i, j-1), pixel (i- 1, j) is used to calculate the prediction error of pixel (i, j).

上記のようにして予測符号化が行われたら、続いて、各画素データの正負極性処理を行う(ステップS5)。上記ステップS1〜ステップS4までの処理により各画素の値は、R,G,B値から、X,Y,Z値の予測誤差に置き換えられたが、各画素のビット形式は、当初のままである。通常、コンピュータ等の計算機で演算される場合は、各データは32ビット単位で処理され、2の補数表現を用いて表現されている。これを、正負の符号付き絶対値表現に変換し、なおかつ、その絶対値部分を上位に1ビット移動させ、正負の符号ビットをLSB(最下位ビット)に移動させる。ステップS5におけるビット構成の変換の様子を模式的に示すと図7のようになる。図7(a)は処理前のビット構成であり、図7(b)は処理後のビット構成である。このように正負の符号ビットをLSBに移動させるのは、後のステップS6における可変長符号化処理で、各画素のビット長を検出し易くするためである。   When predictive encoding is performed as described above, the positive / negative processing of each pixel data is subsequently performed (step S5). Although the value of each pixel has been replaced by the prediction error of the X, Y, and Z values from the R, G, and B values by the processing from step S1 to step S4, the bit format of each pixel remains unchanged. is there. Normally, when being calculated by a computer such as a computer, each data is processed in units of 32 bits and expressed using a two's complement expression. This is converted into a positive / negative signed absolute value expression, and the absolute value portion is moved one bit higher, and the positive / negative sign bit is moved to LSB (least significant bit). FIG. 7 schematically shows how the bit structure is converted in step S5. FIG. 7A shows a bit configuration before processing, and FIG. 7B shows a bit configuration after processing. The reason why the positive and negative code bits are moved to the LSB in this way is to make it easier to detect the bit length of each pixel in the variable length encoding process in the subsequent step S6.

次に、各画素を可変長に変換する処理を行っていく(ステップS6)。本実施形態における可変長符号化は、一般にゴロム符号化と呼ばれる方式を採用している。具体的には、1画素を構成するビット成分を上位ビット成分と下位ビット成分に分け、下位ビット成分は変更を加えずそのままとし、上位ビット成分は、上位ビットだけを十進数変換した数値分のビット「0」を並べ、最後にセパレータビット「1」を加えた配列とする。例えば、8ビットのビット成分「00101000」を考えてみる。このとき、下位ビット成分を4ビットとすると、下位ビット成分は「1000」となる。上位ビットは「0010」であるため、これを十進数変換した「2」個分の「0」を配列して最後に「1」を加えた「001」に変換される。この結果、8ビットのビット列「00101000」は、7ビットのビット列「0011000」に変換されることになる。本実施形態では、変換の前後でビット成分を不変とする下位ビット成分のビット長を各画素で可変とするようにしている。   Next, a process of converting each pixel to a variable length is performed (step S6). The variable length coding in this embodiment employs a method generally called Golomb coding. Specifically, the bit component constituting one pixel is divided into an upper bit component and a lower bit component, the lower bit component is left unchanged, and the upper bit component is a numerical value obtained by decimal conversion of only the upper bit. It is an array in which bit “0” is arranged and separator bit “1” is added at the end. For example, consider an 8-bit bit component “00101000”. At this time, if the lower bit component is 4 bits, the lower bit component is “1000”. Since the upper bits are “0010”, “2” pieces of “0” obtained by decimal conversion are arranged and converted to “001” by adding “1” at the end. As a result, the 8-bit bit string “00101000” is converted into a 7-bit bit string “0011000”. In the present embodiment, the bit length of the lower-order bit component that makes the bit component unchanged before and after conversion is made variable in each pixel.

以下、ステップS6における可変長符号化処理を具体的に説明していく。図8は可変長符号化の概要を示すフローチャートである。まず、処理済みの画素のビット長の移動平均である平均ビット長Bfを算出する(ステップS21)。平均ビット長Bfは、処理済みのビット長の累積値である累積ビット長RBを、処理済みの画素数を基にしたカウンタCで除算することにより求められる。すなわち、Bf=RB/Cで算出される。累積ビット長RBは、初期状態では0であるので、(i,j)=(1,1)の画素を処理する場合には、(i,j)=(1,1)の画素のビット長Bd(i,j)を初期値として設定しておく。また、初期のカウンタC=1と設定する。   Hereinafter, the variable length encoding process in step S6 will be specifically described. FIG. 8 is a flowchart showing an outline of variable length coding. First, an average bit length Bf, which is a moving average of the bit lengths of processed pixels, is calculated (step S21). The average bit length Bf is obtained by dividing the cumulative bit length RB, which is the cumulative value of the processed bit length, by a counter C based on the number of processed pixels. That is, Bf = RB / C. Since the accumulated bit length RB is 0 in the initial state, when the pixel of (i, j) = (1, 1) is processed, the bit length of the pixel of (i, j) = (1, 1) Bd (i, j) is set as an initial value. The initial counter C = 1 is set.

続いて、座標(i,j)における画素のビット長Bd(i,j)を算出する(ステップS22)。(i,j)=(2,1)以降の画素については、平均ビット長Bfの算出後、画素のビット長Bd(i,j)を算出する。このビット長Bd(i,j)は、上記ステップS5においてビット構成の変換を行ったことにより算出し易くなっている。図7(b)に示したようなビット構成に変換したことにより、各画素のビット構成において先頭にビット「1」が出現したところからがビット長となる。次に、変更部のビット長Bvを算出する(ステップS23)。これは、上記画素のビット長Bd(i,j)から平均ビット長Bfを減じることにより算出される。続いて、データの符号出力を行う(ステップS24)。具体的には、上位Bvビットを十進数変換した数値分だけ「0」を出力した後、セパレータビット「1」を出力し、下位Bfビットを不変部として出力する。符号出力は、ハードディスク、CD−R等の外部記憶装置への記録として行われることになる。次に、累積ビット長RBにビット長Bd(t)を加算する(ステップS25)。同時に、各画素の処理を行う度に、カウンタCを1つずつ加算していく処理を行う。続いて、カウンタCが所定の数を超えたかどうかを判定する(ステップS26)。所定の数としては、ここでも100程度を設定している。そのため、カウンタが100を超えたかどうかを判断することになる。この結果、カウンタが100を超えていたら、累積ビット長RBを半分にする(ステップS27)。具体的には、累積ビット長となる変数RBを2で除算する。同時に、カウンタCを半分に1/2にする。   Subsequently, the bit length Bd (i, j) of the pixel at the coordinates (i, j) is calculated (step S22). For pixels after (i, j) = (2, 1), after calculating the average bit length Bf, the bit length Bd (i, j) of the pixel is calculated. This bit length Bd (i, j) is easily calculated by converting the bit configuration in step S5. By converting to the bit configuration as shown in FIG. 7B, the bit length starts from the point where the bit “1” appears at the head in the bit configuration of each pixel. Next, the bit length Bv of the changing unit is calculated (step S23). This is calculated by subtracting the average bit length Bf from the bit length Bd (i, j) of the pixel. Subsequently, the data code is output (step S24). Specifically, “0” is output for the numerical value obtained by decimal conversion of the upper Bv bits, then the separator bit “1” is output, and the lower Bf bits are output as the unchanged part. The code output is performed as recording to an external storage device such as a hard disk or a CD-R. Next, the bit length Bd (t) is added to the cumulative bit length RB (step S25). At the same time, every time processing of each pixel is performed, processing of incrementing the counter C one by one is performed. Subsequently, it is determined whether or not the counter C exceeds a predetermined number (step S26). Here, about 100 is set as the predetermined number. Therefore, it is determined whether or not the counter exceeds 100. As a result, if the counter exceeds 100, the cumulative bit length RB is halved (step S27). Specifically, the variable RB that is the cumulative bit length is divided by two. At the same time, the counter C is halved.

上記のようにして、各画素について可変ビット長での符号化が行われて行く。符号化により得られた可変ビット長で表現された画素の集合は、可変長予測誤差データとして出力される。
(符号データの記録)
以上のようにして得られた符号データは、フレーム単位で記録される。ここで、フレーム単位で記録された符号データの様子を図9に示す。すなわち、各フレームごとに、信号平坦部データ、フレーム間同一データ、可変長予測誤差データが記録されることになる。これらのデータを記録すべき記録媒体に合わせたフォーマットで記録する。
(復号方法)
次に、上記圧縮方法により圧縮された符号データを復号解凍する方法について説明する。復号は、コンピュータ、およびコンピュータに搭載される専用のソフトウェアプログラムにより実行される。復号方法の概要を図10のフローチャートに示す。
As described above, encoding with variable bit length is performed for each pixel. A set of pixels expressed by variable bit length obtained by encoding is output as variable length prediction error data.
(Recording of code data)
The code data obtained as described above is recorded in units of frames. Here, the state of the code data recorded in units of frames is shown in FIG. That is, for each frame, the signal flat portion data, the same data between frames, and the variable length prediction error data are recorded. These data are recorded in a format suitable for the recording medium to be recorded.
(Decryption method)
Next, a method for decoding and decompressing code data compressed by the compression method will be described. Decoding is executed by a computer and a dedicated software program installed in the computer. An outline of the decoding method is shown in the flowchart of FIG.

まず、図9に示したような符号データを記録した記録媒体を、復号するための装置(専用のソフトウェアを搭載したコンピュータ)に読み込ませる。読み込みは、フレーム単位で順次行われる。まず、信号平坦部データを読み込み、信号平坦部の画素値を各プレーンに配置すると共に、マスクデータを作成し、信号平坦部領域の画素をマスクする(ステップS31)。続いて、フレーム間同一データを読み込み、各プレーンの該当する領域に対して、直前フレームにおいて該当する画素値を配置すると共に、ステップS31において作成したマスクデータに、配置した画素の領域をマスクするように追記する(ステップS32)。なお、ステップS32の処理は、先頭のフレームに対しては行われない。先頭のフレームには、対応するフレーム間同一データが存在しないからである。次に、可変長予測誤差データを読み込み、可変長予測誤差データを各画素が固定長で表現されたデータに復元していく(ステップS33)。これは、上記ステップS6における処理と逆の処理を行えば良い。続いて、各画素ごとに復元されたデータの極性を復元する(ステップS34)。これは、上記ステップS5における処理と逆の処理を行えば良い。次に、極性が復元された各画素のデータを、マスクデータを参照して、各プレーンに配置していく(ステップS35)。具体的には、マスクデータに記録されているマスク領域以外の非マスク領域に該当する座標に、符号化時と同様に画素データを配置していく。すなわち、図3に示した矢印の方向に、画素(1,1)から順に画素(1,480)まで配置していくことになる。   First, a recording medium on which code data as shown in FIG. 9 is recorded is read by an apparatus for decoding (computer equipped with dedicated software). Reading is sequentially performed in units of frames. First, the signal flat part data is read, the pixel values of the signal flat part are arranged in each plane, mask data is created, and the pixels in the signal flat part region are masked (step S31). Subsequently, the same data between frames is read, and the corresponding pixel value is arranged in the previous frame for the corresponding area of each plane, and the arranged pixel area is masked in the mask data created in step S31. (Step S32). Note that the process in step S32 is not performed on the first frame. This is because there is no identical data between corresponding frames in the first frame. Next, the variable length prediction error data is read, and the variable length prediction error data is restored to data in which each pixel is expressed in a fixed length (step S33). This may be the reverse of the process in step S6. Subsequently, the polarity of the data restored for each pixel is restored (step S34). This may be the reverse of the process in step S5. Next, the data of each pixel whose polarity has been restored is arranged on each plane with reference to the mask data (step S35). Specifically, the pixel data is arranged at the coordinates corresponding to the non-mask area other than the mask area recorded in the mask data as in the encoding. That is, pixels (1, 1) to pixels (1, 480) are sequentially arranged in the direction of the arrow shown in FIG.

この時点で、各座標(i,j)の各画素の値は、予測誤差e(i,j)で記録されているので、元の画素値x(i,j)に復元する(ステップS36)。これは、上記ステップS4における処理と逆の処理を行えば良い。   At this time, since the value of each pixel at each coordinate (i, j) is recorded with the prediction error e (i, j), it is restored to the original pixel value x (i, j) (step S36). . This may be the reverse of the process in step S4.

この時点で、フレーム群は、図1(b)に示したように、各フレームが、X、Y、Zプレーンで構成された状態となっているので、R、G、Bプレーンで構成される元のフレームに復元する(ステップS37)。これは、上記〔数式1〕を利用することにより復元できる。ステップS31からステップS37の処理を、全フレームに対して繰り返し行うことにより、デジタル映像信号が復元されることになる。本実施形態で説明した圧縮方法は、ロスレス型(可逆型)であるので、復元された映像信号は、欠落なく、圧縮前の映像信号と全く同じものとなる。   At this point, the frame group is configured with R, G, and B planes because each frame is configured with X, Y, and Z planes as shown in FIG. The original frame is restored (step S37). This can be restored by using the above [Equation 1]. By repeating the processing from step S31 to step S37 for all frames, the digital video signal is restored. Since the compression method described in the present embodiment is a lossless type (reversible type), the restored video signal is not lost and is exactly the same as the video signal before compression.

なお、上記実施形態では、圧縮対象の原デジタル映像信号としてRGBのカラー映像信号を入力した場合を例にとって説明したが、原デジタル映像信号としてモノクロ映像信号を入力し、圧縮を行なうことも可能である。この場合、上記〔数式1〕において、X、Zプレーンの画素値が全て「0」となるため、Yプレーンについての処理だけを行えば良いことになる。   In the above embodiment, the case where an RGB color video signal is input as an original digital video signal to be compressed has been described as an example. However, it is also possible to input a monochrome video signal as an original digital video signal and perform compression. is there. In this case, since the pixel values of the X and Z planes are all “0” in the above [Equation 1], only the process for the Y plane needs to be performed.

以上、本発明の好適な実施形態について説明したが、本発明は、上記実施形態に限定されず、種々の変形が可能である。以下に、変形例について説明する。
(ロッシー型)
上記実施形態では、ロスレス型で完全に元の状態に戻せる方式で圧縮を行ったが、不可逆ではあるが可逆圧縮に近い画質が得られるニアロスレス型の方式とすることも可能である。この場合、上記ステップS1における色信号間の演算処理が異なることになる。具体的には、図1に示したように、R,G,Bの信号をX,Y,Zに変換するのではなく、以下の〔数式11〕を利用して、Y2、U、Vに変換する。
〔数式11〕
2=0.299R+0.587G+0.114B
U=−0.1684R−0.3316G+0.5B
V=0.5R−0.4187G−0.0813B
上記〔数式11〕は、小数点演算を伴うため、整数値化されたY2、U、Vから、元のR、G、Bの値を復元することはできず、この状態で基本的にロッシー型になる。さらに、Uプレーン、Vプレーンについては、縦方向、横方向に画素を1/2に間引きする。例えば、720×480画素の画像の場合、360×240画素の画像となり、画素数が1/4に減少することになる。R,G,Bの信号からY2、U、Vの信号への変換の様子を図11に示す。図11(a)は、図1(a)と全く同じであり、入力されたデジタル映像信号を示している。図11(b)に示すように、Uプレーン、Vプレーンは画素数が縦方向、横方向それぞれ半分になっている。このようにして得られたY2、U、Vプレーンについて、上記ステップS3からステップS6の処理が施され、不可逆圧縮が行われることになり、Y2プレーンについてはほとんどロスは無いが、U、Vプレーンの解像度は1/4に低下する。ただし、ヒトの視覚系は、輝度信号Y2プレーンに比べ色差信号U、Vプレーンに対しては認識能力が鈍感であることが知られているため、全体的に画質の劣化を認識することが難しく、可逆圧縮された画像とほぼ同等な画質を得ることができる(ニアロスレス符号化と呼ばれる)。
The preferred embodiment of the present invention has been described above. However, the present invention is not limited to the above embodiment, and various modifications can be made. Hereinafter, modified examples will be described.
(Lossy type)
In the above-described embodiment, the compression is performed by the lossless type that can be completely restored to the original state. However, it is also possible to adopt a near lossless type that is irreversible but obtains an image quality close to lossless compression. In this case, the arithmetic processing between the color signals in step S1 is different. Specifically, as shown in FIG. 1, instead of converting R, G, and B signals into X, Y, and Z, the following [Formula 11] is used to obtain Y 2 , U, V, Convert to
[Formula 11]
Y 2 = 0.299R + 0.587G + 0.114B
U = -0.1684R-0.3316G + 0.5B
V = 0.5R-0.4187G-0.0813B
Since the above [Formula 11] involves a decimal point operation, the original values of R, G, and B cannot be restored from Y 2 , U, and V converted to integer values. Become a mold. Further, for the U plane and the V plane, the pixels are thinned out in half in the vertical direction and the horizontal direction. For example, in the case of an image of 720 × 480 pixels, an image of 360 × 240 pixels is obtained, and the number of pixels is reduced to ¼. FIG. 11 shows the state of conversion from R, G, B signals to Y 2 , U, V signals. FIG. 11A is exactly the same as FIG. 1A and shows an input digital video signal. As shown in FIG. 11B, the U plane and the V plane have half the number of pixels in the vertical and horizontal directions. The Y 2 , U, and V planes thus obtained are subjected to the processing from step S 3 to step S 6, and irreversible compression is performed. Although there is almost no loss for the Y 2 plane, The resolution of the V plane is reduced to ¼. However, since the human visual system is known to be insensitive to the color difference signals U and V planes compared to the luminance signal Y 2 plane, it can recognize the deterioration of image quality as a whole. It is difficult to obtain an image quality almost equivalent to a reversibly compressed image (referred to as near lossless coding).

以上、本発明は、複数の静止画像で構成される映像信号に対して行われるため、入力データが静止画像である場合は、静止画像の圧縮方法としても利用することができる。この場合、上記ステップS1〜ステップS6のうち、ステップS3の処理以外を実行することにより、静止画像の圧縮が可能となる。   As described above, since the present invention is performed on a video signal composed of a plurality of still images, when the input data is a still image, it can also be used as a still image compression method. In this case, the still image can be compressed by executing steps S1 to S6 other than step S3.

本発明の映像信号の圧縮方法で圧縮対象とするデジタル映像信号の構造を示す模式図である。It is a schematic diagram which shows the structure of the digital video signal made into compression object by the compression method of the video signal of this invention. 本発明に係る映像信号の圧縮方法の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the compression method of the video signal which concerns on this invention. フレーム上における画素の処理順序を示す図である。It is a figure which shows the process order of the pixel on a flame | frame. 信号平坦部テーブル、フレーム間テーブルの様子を示す図である。It is a figure which shows the mode of a signal flat part table and an inter-frame table. 予測誤差算出処理を行う際の各画素の位置関係を示す図である。It is a figure which shows the positional relationship of each pixel at the time of performing a prediction error calculation process. 予測誤差算出の詳細を示すフローチャートである。It is a flowchart which shows the detail of prediction error calculation. 極性処理の処理の様子を示す図である。It is a figure which shows the mode of the process of a polarity process. 可変長符号化の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of variable length coding. 本発明に係る映像信号の圧縮方法により得られる符号データを示す図である。It is a figure which shows the code data obtained by the compression method of the video signal which concerns on this invention. 圧縮された映像信号の復号処理の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the decoding process of the compressed video signal. 不可逆圧縮を行う場合の、色信号間演算の様子を示す模式図である。It is a schematic diagram which shows the mode of the calculation between color signals in the case of performing lossy compression.

Claims (10)

静止画像であるフレームを時系列に配列したフレーム群として構成される映像信号に対して、当該映像信号を再現できるように情報量を圧縮する方法であって、
前記各フレーム上の各画素データが同一となる区間を走査線方向に従って検出し、当該検出した区間をマスク領域としてマスクすると共に、当該検出した区間の情報を信号平坦部データとして抽出する信号平坦部処理段階と、
前記各フレームにおいてマスクされなかった非マスク領域に存在する各画素を対象画素とし、前記対象画素の画素値および、前記対象画素の近傍に位置する近傍画素の画素値を利用して、前記対象画素および前記近傍画素の画素値に乗じる線形係数が異なる複数の予測計算式に対して、複数の予測誤差候補を算出し、前記予測誤差候補の中から最適なものを前記対象画素の予測誤差として採用し、前記対象画素の値を前記予測誤差に置き換える予測誤差算出段階と、
前記予測誤差に置き換えられた各画素データを可変長で符号化する可変長符号化段階と、
を有することを特徴とする映像信号の圧縮方法。
A method of compressing an information amount so that a video signal configured as a frame group in which frames that are still images are arranged in time series can be reproduced,
A signal flat part for detecting a section in which each pixel data on each frame is the same in accordance with the scanning line direction, masking the detected section as a mask area, and extracting information of the detected section as signal flat part data Processing stage;
Using each pixel existing in a non-masked area that has not been masked in each frame as a target pixel, and using the pixel value of the target pixel and the pixel value of a neighboring pixel located in the vicinity of the target pixel, the target pixel And calculating a plurality of prediction error candidates for a plurality of prediction calculation formulas having different linear coefficients to be multiplied by pixel values of the neighboring pixels, and adopting an optimum one of the prediction error candidates as a prediction error of the target pixel A prediction error calculating step of replacing the value of the target pixel with the prediction error;
A variable length encoding step of encoding each pixel data replaced with the prediction error with a variable length;
A method for compressing a video signal, comprising:
請求項1において、
前記信号平坦部処理段階における各フレーム上の各画素データの処理方向は、奇数番目の走査線と偶数番目の走査線で逆方向に行うことを特徴とする映像信号の圧縮方法。
In claim 1,
A method of compressing video signals, wherein the processing direction of each pixel data on each frame in the signal flat part processing step is performed in the opposite direction between the odd-numbered scanning lines and the even-numbered scanning lines.
請求項1において、
前記映像信号が、RGBの3原色成分で構成されている場合、X=R−G、Z=B−G、Y=G+(X+Z)/3なる変換式によりXYZ成分に変換する色信号間演算段階を、前記信号平坦部処理段階の直前に設け、前記信号平坦部処理段階、前記予測誤差算出段階、前記可変長符号化段階がX、Y、Z成分別に処理されるものであることを特徴とする映像信号の圧縮方法。
In claim 1,
When the video signal is composed of the three primary color components of RGB, the calculation between the color signals is converted into the XYZ component by the conversion formula of X = RG, Z = BG, Y = G + (X + Z) / 3 The step is provided immediately before the signal flat portion processing step, and the signal flat portion processing step, the prediction error calculation step, and the variable length coding step are processed separately for X, Y, and Z components. A compression method of the video signal.
請求項1において、
前記映像信号が、RGBの3原色成分で構成されている場合、輝度信号成分Y2、第1色信号成分U、第2色信号成分Vに変換し、前記第1色信号成分Uと前記第2色信号成分Vに対して、所定の比率で画素を間引く処理を行う色信号間演算段階を、前記信号平坦部処理段階の直前に設け、前記信号平坦部処理段階、前記予測誤差算出段階、前記可変長符号化段階がY2、U、V成分別に処理されるものであることを特徴とする映像信号の圧縮方法。
In claim 1,
When the video signal is composed of RGB three primary color components, the video signal is converted into a luminance signal component Y 2 , a first color signal component U, and a second color signal component V, and the first color signal component U and the first color signal component U are converted. An inter-color signal calculation step for thinning out pixels at a predetermined ratio for the two-color signal component V is provided immediately before the signal flat portion processing step, and the signal flat portion processing step, the prediction error calculation step, A method of compressing a video signal, wherein the variable length coding step is processed for each of Y 2 , U, and V components.
請求項1において、
前記フレーム群を構成する各フレームについて、直前のフレームの同一位置の画素と値が同一である画素が連続する区間をマスク領域としてマスクすると共に、当該区間の情報をフレーム間同一データとして抽出するフレーム間演算段階を、前記予測誤差算出段階の前に設けたことを特徴とする映像信号の圧縮方法。
In claim 1,
For each frame constituting the frame group, a frame in which a pixel having the same value as a pixel at the same position in the immediately preceding frame is masked as a mask region, and information on the interval is extracted as the same data between frames. A method for compressing a video signal, characterized in that an intermediate calculation step is provided before the prediction error calculation step.
請求項1において、
前記予測誤差算出段階における前記近傍画素は、前記対象画素の8近傍範囲に含まれると共に、走査線の処理上前方に位置する3つの画素であって、走査線の処理上前方に位置する各対象画素において算出された予測誤差候補の絶対値の累積値を、各予測計算式について算出し、前記累積値が最小となる予測計算式で算出された予測誤差候補を、前記対象画素の予測誤差として採用するものであることを特徴とする映像信号の圧縮方法。
In claim 1,
The neighboring pixels in the prediction error calculation stage are included in the eight neighboring ranges of the target pixel, and are three pixels positioned forward in the scanning line process, and each target positioned forward in the scanning line process Accumulated absolute values of the prediction error candidates calculated in the pixel are calculated for each prediction calculation formula, and the prediction error candidate calculated by the prediction calculation formula that minimizes the cumulative value is used as the prediction error of the target pixel. A video signal compression method characterized by being adopted.
請求項1において、
前記可変長符号化段階の前段に、前記予測誤差値の絶対値に対して全体を1ビット上位にずらし、正負極性ビットを最下位ビットに挿入する極性処理段階を有することを特徴とする映像信号の圧縮方法。
In claim 1,
A video signal characterized by having a polarity processing step that shifts the whole to the upper one bit with respect to the absolute value of the prediction error value and inserts positive / negative polarity bits into the least significant bit before the variable length encoding step. Compression method.
請求項1において、
前記可変長符号化段階は、前記予測誤差値に変換された各画素のビット成分のうち、下位のビット成分をそのままのビット成分で符号化し、残りの上位ビット成分に対してビット成分を変更して符号化を行うものであることを特徴とする映像信号の圧縮方法。
In claim 1,
The variable length encoding step encodes the lower bit component of the bit component of each pixel converted into the prediction error value with the bit component as it is, and changes the bit component with respect to the remaining upper bit component. And a video signal compression method characterized in that encoding is performed.
画素の集合である静止画像に対して、当該静止画像を再現できるように情報量を圧縮する方法であって、
前記静止画像上の各画素データが同一となる区間を走査線方向に従って検出し、当該検出した区間をマスク領域としてマスクすると共に、当該検出した区間の情報を信号平坦部データとして抽出する信号平坦部処理段階と、
前記各フレームにおいてマスクされなかった非マスク領域に存在する各画素を対象画素とし、前記対象画素の画素値および、前記対象画素の近傍に位置する近傍画素の画素値を利用して、前記対象画素および前記近傍画素の画素値に乗じる線形係数が異なる複数の予測計算式に対して、複数の予測誤差候補を算出し、前記予測誤差候補の中から最適なものを前記対象画素の予測誤差として採用し、前記対象画素の値を前記予測誤差に置き換える予測誤差算出段階と、
前記予測誤差に置き換えられた各画素データを可変長で符号化する可変長符号化段階と、
を有することを特徴とする静止画像の圧縮方法。
A method of compressing the amount of information for a still image that is a set of pixels so that the still image can be reproduced,
A signal flat part that detects a section in which each pixel data on the still image is the same in accordance with a scanning line direction, masks the detected section as a mask area, and extracts information of the detected section as signal flat part data Processing stage;
Using each pixel existing in a non-masked area that has not been masked in each frame as a target pixel, and using the pixel value of the target pixel and the pixel value of a neighboring pixel located in the vicinity of the target pixel, the target pixel And calculating a plurality of prediction error candidates for a plurality of prediction calculation formulas having different linear coefficients to be multiplied by pixel values of the neighboring pixels, and adopting an optimum one of the prediction error candidates as a prediction error of the target pixel A prediction error calculating step of replacing the value of the target pixel with the prediction error;
A variable length encoding step of encoding each pixel data replaced with the prediction error with a variable length;
A method of compressing a still image, comprising:
前記映像信号に対して、請求項1から請求項9に記載のいずれかの方法により出力された符号データを記録した記録媒体。

The recording medium which recorded the code | cord | chord data output by the method in any one of Claims 1-9 with respect to the said video signal.

JP2003277462A 2003-07-22 2003-07-22 Method for compressing still image and method for compressing video signal Withdrawn JP2005045527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003277462A JP2005045527A (en) 2003-07-22 2003-07-22 Method for compressing still image and method for compressing video signal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003277462A JP2005045527A (en) 2003-07-22 2003-07-22 Method for compressing still image and method for compressing video signal

Publications (1)

Publication Number Publication Date
JP2005045527A true JP2005045527A (en) 2005-02-17

Family

ID=34264183

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003277462A Withdrawn JP2005045527A (en) 2003-07-22 2003-07-22 Method for compressing still image and method for compressing video signal

Country Status (1)

Country Link
JP (1) JP2005045527A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006270326A (en) * 2005-03-23 2006-10-05 Fuji Xerox Co Ltd Coder, coding method and program
JP2007295170A (en) * 2006-04-24 2007-11-08 Fujitsu Ltd Device, program, and method for compression image
KR100781833B1 (en) 2006-03-29 2007-12-03 주식회사 팬택 Method for compressing color data
JP2008257474A (en) * 2007-04-04 2008-10-23 Oki Electric Ind Co Ltd Data compression device, data merge device, data arrangement device, data integration system, radio tag data integration system, data compression program, data merge program, and data arrangement program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006270326A (en) * 2005-03-23 2006-10-05 Fuji Xerox Co Ltd Coder, coding method and program
KR100781833B1 (en) 2006-03-29 2007-12-03 주식회사 팬택 Method for compressing color data
JP2007295170A (en) * 2006-04-24 2007-11-08 Fujitsu Ltd Device, program, and method for compression image
JP2008257474A (en) * 2007-04-04 2008-10-23 Oki Electric Ind Co Ltd Data compression device, data merge device, data arrangement device, data integration system, radio tag data integration system, data compression program, data merge program, and data arrangement program

Similar Documents

Publication Publication Date Title
JP5490287B2 (en) Method and apparatus for effectively compressing and restoring edge regions
US8351692B2 (en) Method, medium, and system effectively compressing and/or restoring binary images
EP2094018A1 (en) Encoding apparatus for high frame rate videos, method and program
JP6614417B2 (en) Video processing system with high dynamic range sensor mechanism and method of operating the same
JP2007189276A (en) Image compression apparatus and image compression program
JP4709155B2 (en) Motion detection device
JP2009194760A (en) Image coding device, image decoding device, program for coding image, and program for decoding image
KR20050117727A (en) Sub pixel motion estimation method and apparatus reducing a bit precision
JP4537348B2 (en) MPEG image quality correction apparatus and MPEG image quality correction method
US8520742B2 (en) Moving image compression-coding device, method of compression-coding moving image, and H.264 moving image compression-coding device
KR20180041441A (en) Apparatus for writing information on defect pixels, apparatus for correcting defect pixels, and method thereof
JP4892869B2 (en) Image compression apparatus, image compression program, electronic camera, image expansion apparatus, and image expansion program
JP5178616B2 (en) Scene change detection device and video recording device
JP2005045527A (en) Method for compressing still image and method for compressing video signal
JP2011035863A (en) Imaging apparatus
JP4235209B2 (en) Motion vector detection apparatus and motion vector detection method
JP2008187694A (en) Image encoder and method thereof
CN100592778C (en) Recording and playback apparatus, and recording and playback method, recording apparatus and recording method, playback apparatus and playback method
JP2005130345A (en) Encoding method of video signal and static image
JP4139657B2 (en) Video signal encoding apparatus and decoding apparatus
JP2013093745A (en) Image compression apparatus, imaging apparatus and image compression method
JP2000244744A (en) Image data compression method and image data management method
JP2004222142A (en) Method for compressing and decoding video signal
JP2009038740A (en) Image encoding device
JP2013201562A (en) Image compression device, image processing system, and image compression method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20061003