JP2015005903A - Compressor, decompressor and image processing apparatus - Google Patents

Compressor, decompressor and image processing apparatus Download PDF

Info

Publication number
JP2015005903A
JP2015005903A JP2013130507A JP2013130507A JP2015005903A JP 2015005903 A JP2015005903 A JP 2015005903A JP 2013130507 A JP2013130507 A JP 2013130507A JP 2013130507 A JP2013130507 A JP 2013130507A JP 2015005903 A JP2015005903 A JP 2015005903A
Authority
JP
Japan
Prior art keywords
pixel
group
prediction
residual
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013130507A
Other languages
Japanese (ja)
Inventor
敏 後藤
Satoshi Goto
敏 後藤
栗 郭
Li Guo
栗 郭
大江 周
Dajiang Zhou
大江 周
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.)
Waseda University
Original Assignee
Waseda University
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 Waseda University filed Critical Waseda University
Priority to JP2013130507A priority Critical patent/JP2015005903A/en
Publication of JP2015005903A publication Critical patent/JP2015005903A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a compressor which is suitable for multimode in an integrated compression system and capable of achieving high compressibility, a decompressor and an image processing apparatus.SOLUTION: The compressor comprises: pixel value prediction means for calculating a prediction value of each pixel in accordance with each prediction mode while preparing a plurality of prediction modes formed by combining copy prediction of neighboring pixels and average prediction of neighboring pixels with respect to the pixels within a pixel block excluding a corner origin pixel; residual calculation means for calculating a residual with respect to the pixels within the pixel block; residual encoding means for encoding the residual of the pixels; prediction mode selection means for calculating a residual bit size of the pixel block encoded by the residual encoding means and selecting a selection prediction mode minimizing the residual bit size of the encoded pixel block with respect to the prediction modes; and symbol code generation means for generating encoded frame data by formatting information of the pixel block including a pixel value of the origin pixel, the selection prediction mode and residual information.

Description

本発明は、ビデオコーディックシステム等で画像情報をバッファリングする際などで使用される画像信号のコンプレッサ、デコンプレッサ及び画像処理装置に関する。   The present invention relates to an image signal compressor, decompressor, and image processing apparatus used when buffering image information in a video codec system or the like.

HEVC,H.264/AVC,MPEG−2等のエンコーダ及びデコーダを含むビデオコーディックシステムにおいては、通常、リファレンス・フレームのような大量のデータをバッファリングするために、大容量の外部DRAMが必要とされる。その結果、メモリとの間のデータ転送に広い帯域幅が必要とされ、メモリアクセスのための消費電力がシステム全体の消費電力の多くの部分を占める。そこで、このメモリ帯域幅の問題を解決することは、重要な技術的課題である。   HEVC, H.M. In a video codec system including encoders and decoders such as H.264 / AVC and MPEG-2, a large-capacity external DRAM is usually required to buffer a large amount of data such as a reference frame. As a result, a wide bandwidth is required for data transfer to and from the memory, and power consumption for memory access accounts for a large part of the power consumption of the entire system. Thus, solving this memory bandwidth problem is an important technical challenge.

これまでに、種々のレベルに於いてオーバーコールされるリファレンス・フレームのデータを再利用する技術や、メモリ・コントローラ・アーキテクチャを最適化することによりDRAMアクセス効率を最適化する技術など、様々な観点からの研究がなされている。そのなかでも、リファレンス・フレーム再圧縮として知られている組込圧縮(Embedded compression:EC)は、上記DRAMのバンド幅問題を解決するための一手段である。ECでは、メモリ・データトラフィックを削減するため、コーディック・コアとDRAMコントローラとの間に追加のレイヤとして挿入され、リファレンス・フレームをDRAMに保存する前に圧縮すると共に、DRAMからデータをフェッチ・バックする前に展開(解凍)する。   Various viewpoints such as technology for reusing reference frame data that has been over-called at various levels, and technology for optimizing DRAM access efficiency by optimizing the memory controller architecture Research has been done. Among them, embedded compression (EC) known as reference frame recompression is a means for solving the above-mentioned DRAM bandwidth problem. In EC, to reduce memory data traffic, it is inserted as an additional layer between the codec core and the DRAM controller, compressing the reference frame before storing it in the DRAM and fetching the data back from the DRAM. Extract (decompress) before starting.

従来のECスキームは、大きく2つのカテゴリに分類できる。一つは、固定圧縮率(compression ratio:CR)による不可逆ECである。固定CRとすると、必然的に画像品質の低下が生じ、リファレンス・フレームの品質劣化により生じる誤差伝搬が大きな問題となる。もう一つは、無損失ECである。無損失ECスキームは可変圧縮率とする必要がある。そのため、専用のメモリ機構として、圧縮データのパーティション・サイズのストアとフェッチの機構が必要とされる。   Conventional EC schemes can be broadly classified into two categories. One is irreversible EC with a fixed compression ratio (CR). If the fixed CR is used, the image quality is inevitably lowered, and error propagation caused by the quality degradation of the reference frame becomes a serious problem. The other is lossless EC. The lossless EC scheme needs to have a variable compression rate. Therefore, a store and fetch mechanism for the partition size of compressed data is required as a dedicated memory mechanism.

通常、無損失ECにおけるデータ圧縮は、予測ステージとエントロピー符号化ステージとで構成される。予測ステージにおいては、空間領域予測と周波数領域予測とが広く使用されている。エントロピー符号化ステージでは、可変長符号化(variable length coding:VLC)が広く使用されているが、高スループットVLCを実現するにはハードウェア実装が非常に困難である。従って、近年のECスキームでは、2ステップ・エントロピー符号化が採用されている。これは、最初に残差をスモール・グループにグルーピングし、次に、それぞれのグループにおけるローカル残差の特徴に基づいて固定長符号化を行うというものである。   Usually, data compression in lossless EC consists of a prediction stage and an entropy coding stage. In the prediction stage, spatial domain prediction and frequency domain prediction are widely used. In the entropy coding stage, variable length coding (VLC) is widely used, but hardware implementation is very difficult to achieve high throughput VLC. Therefore, two-step entropy coding is adopted in recent EC schemes. In this method, residuals are first grouped into small groups, and then fixed-length coding is performed based on the characteristics of local residuals in each group.

組込圧縮における従来の空間領域予測のアルゴリズムにおいては、非特許文献1に記載の階層化平均・コピー予測方式(HACP:hierarchical average and copy prediction)が優れた性能を示している。図18は、8×8画素ブロックに対するHACPの原理を示した図である(非特許文献1から引用)。図18において、レベル1の各マスはオリジナルの画素を示す。レベル2の各マスは、レベル1の各画素を2×2画素の16ブロックに分割し各ブロックの平均値をとったものを表す。レベル3の各マスは、レベル2の各画素を2×2画素の4ブロックに分割し各ブロックの平均値をとったものを表す。ベースピクセル(Base pixel)は、レベル2の4画素の平均値である。   In the conventional spatial domain prediction algorithm in the embedded compression, the hierarchical average and copy prediction (HACP) described in Non-Patent Document 1 shows excellent performance. FIG. 18 is a diagram illustrating the principle of HACP for an 8 × 8 pixel block (cited from Non-Patent Document 1). In FIG. 18, each level 1 cell represents an original pixel. Each square of level 2 represents an average value of each block obtained by dividing each pixel of level 1 into 16 blocks of 2 × 2 pixels. Each square of level 3 represents an average value of each block obtained by dividing each pixel of level 2 into 4 blocks of 2 × 2 pixels. The base pixel is an average value of four pixels at level 2.

レベル3では、ベースピクセルを予測値として使用する。レベル2では、図18の101〜104の画素については、レベル3の対応する各画素の画素値を予測値として使用する。他の画素については、図18に示した矢印の基点の画素が予測ソース画素として使用される。2つの矢印が向けられた画素については、各矢印の基点の画素の平均値が予測値として使用される(これが「平均予測」と呼ばれる)。1つの矢印が向けられた画素については、各矢印の基点の画素の画素値が予測値として使用される(これが「コピー予測」と呼ばれる)。レベル1では、図18の105〜108の画素については、レベル2の対応する各画素の画素値を予測値として使用する。他の画素については、図18に示した矢印の基点の画素が予測ソース画素として使用される。レベル1においても、レベル2と同様の平均予測及びコピー予測が行われる。各階層のレベルをL(=1,2,3)とすると、レベルLにおける予測ソース画素と予測対象であるオリジナル画素との間の距離は2L−1である。尚、レベル1,2,3のそれぞれで、各マスの画素値から予測値を引いた残差を求めることで、画素データをベースピクセルの画素値と、各階層の各画素の残差とに変換してデータ圧縮がされる。 At level 3, the base pixel is used as the predicted value. At level 2, for the pixels 101 to 104 in FIG. 18, the pixel value of each corresponding pixel at level 3 is used as the predicted value. For the other pixels, the pixel at the base point of the arrow shown in FIG. 18 is used as the prediction source pixel. For a pixel to which two arrows are directed, the average value of the pixels at the base point of each arrow is used as the predicted value (this is referred to as “average prediction”). For the pixel to which one arrow is directed, the pixel value of the pixel at the base point of each arrow is used as the predicted value (this is called “copy prediction”). At level 1, the pixel values of the corresponding pixels at level 2 are used as predicted values for the pixels 105 to 108 in FIG. For the other pixels, the pixel at the base point of the arrow shown in FIG. 18 is used as the prediction source pixel. In level 1, the same average prediction and copy prediction as in level 2 are performed. When the level of each layer is L (= 1, 2, 3), the distance between the prediction source pixel at level L and the original pixel that is the prediction target is 2 L−1 . In each of the levels 1, 2, and 3, the pixel data is divided into the pixel value of the base pixel and the residual of each pixel in each layer by obtaining a residual obtained by subtracting the predicted value from the pixel value of each square. Data is compressed after conversion.

HACPでは、(1)左右の画素の平均を予測値とする水平平均予測(horizontal average prediction:HAP)、(2)上下の画素の平均を予測値とする垂直平均予測(vertical average prediction:VAP)、(3)右又は左隣接の画素の画素値を予測値とする水平コピー予測(horizontal copy prediction:HCP)、(4)上又は下隣接の画素の画素値を予測値とする垂直コピー予測(vertical copy prediction:VCP)が使用される。各平均予測及び各コピー予測による残差算出は、次式により計算される。   In HACP, (1) horizontal average prediction (HAP) using an average of left and right pixels as a predicted value, and (2) vertical average prediction (VAP) using an average of upper and lower pixels as a predicted value. (3) horizontal copy prediction (HCP) using the pixel value of the right or left adjacent pixel as a predicted value, and (4) vertical copy prediction using the pixel value of the upper or lower adjacent pixel as a predicted value ( vertical copy prediction (VCP) is used. The residual calculation by each average prediction and each copy prediction is calculated by the following equation.

ここで、pi,jは画素値、xi,jは画素pi,jの予測残差、dは予測画素と参照画素との間の距離である。 Here, p i, j is a pixel value, x i, j is a prediction residual of the pixel p i, j , and d is a distance between the prediction pixel and the reference pixel.

J. Kim and C. M. Kyung, "A lossless embedded compression using significant bit truncation for HD video coding", IEEE Trans. Circuits Syst. Video Techn., vol.20, no.6, pp. 848-860, 2010.J. Kim and C. M. Kyung, "A lossless embedded compression using significant bit truncation for HD video coding", IEEE Trans. Circuits Syst. Video Techn., Vol.20, no.6, pp. 848-860, 2010. D.Zhou, J. Zhou, X. He, J. Zhu, J. Kong, P. Liu, and S. Goto, "A 530 Mpixels/s 4096x2160@60fps H.264/AVC High Profile Video Decoder Chip," IEEE J. Solid-State Circuit, vol.6, no.4, pp.777-788, 2011.D.Zhou, J. Zhou, X. He, J. Zhu, J. Kong, P. Liu, and S. Goto, "A 530 Mpixels / s 4096x2160 @ 60fps H.264 / AVC High Profile Video Decoder Chip," IEEE J. Solid-State Circuit, vol.6, no.4, pp.777-788, 2011.

本発明者は、まず、ナチュラル・シーケンス(自然画像)において、隣接するピクセル間の空間相関について検討した。図19は、HACP方式のレベル1における予測方法(a)及びその転置(b)を表す図である。HACP方式では、主に2つの隣接画素の平均値を予測値として使用するが、隣接画素の画素値から予測できない幾つかの画素については、より遠方の画素を用いた予測がされる。例えば、レベル2において予測される画素(図19の“Predicted from level-2”)は2画素離れた画素を用いて予測が行われ、レベル3において予測される画素(図19の“Predicted from level-3”)は4画素離れた画素を用いて予測が行われる。   The inventor first examined the spatial correlation between adjacent pixels in a natural sequence (natural image). FIG. 19 is a diagram illustrating a prediction method (a) and its transposition (b) in level 1 of the HACP scheme. In the HACP method, an average value of two adjacent pixels is mainly used as a predicted value. However, for some pixels that cannot be predicted from the pixel values of adjacent pixels, prediction using a farther pixel is performed. For example, a pixel predicted at level 2 (“Predicted from level-2” in FIG. 19) is predicted using pixels that are two pixels apart, and a pixel predicted at level 3 (“Predicted from level in FIG. 19). -3 ") is predicted using pixels that are four pixels apart.

しかしながら、一般に、離れた距離にある画素の画素値の空間相関は、隣接する画素の画素値の空間相関に比べて遥かに小さい。図20は、異なる予測距離に対するHACP方式における残差の確率分布を表す図である。図20において、横軸は残差値(HAC残差)、縦軸は分布確率を表す。HAC_dist.1は隣接画素による予測、HAC_dist.2は2画素離れた画素による予測、HAC_dist.4は4画素離れた画素による予測を表す。隣接画素による予測で算出されたHAC残差のエントロピーは3.7677であるのに対し、2画素距離による予測では4.7594に増加し、4画素距離による予測では5.23まで増加する。従って、HACP方式のレベル2,3の予測は圧縮性能に大きな悪影響を及ぼすことが分かる。   However, in general, the spatial correlation between the pixel values of pixels at a distant distance is much smaller than the spatial correlation between the pixel values of adjacent pixels. FIG. 20 is a diagram illustrating a probability distribution of residuals in the HACP scheme for different prediction distances. In FIG. 20, the horizontal axis represents the residual value (HAC residual), and the vertical axis represents the distribution probability. HAC_dist.1 represents prediction based on neighboring pixels, HAC_dist.2 represents prediction based on pixels that are two pixels apart, and HAC_dist.4 represents prediction based on pixels that are four pixels apart. The entropy of the HAC residual calculated by the prediction by the adjacent pixels is 3.7677, but increases to 4.7594 in the prediction by the two-pixel distance, and increases to 5.23 in the prediction by the four-pixel distance. Therefore, it can be seen that HACP level 2 and 3 predictions have a significant adverse effect on compression performance.

また、予測距離の問題以外にも、HACP方式はマルチモード拡張に適していないという問題がある。図19(b)は、HAC転置行列(図19(a)の行・列を転置したもの)を示している。また、図19(b)には、図19(a)と異なる予測がされるピクセル(“Different prediction”)も示している。HACP方式の8×8予測ブロック(図19(a))とその転置ブロック(図19(b))の間には、異なる予測方法の画素は20画素しかない。さらに、レベル2の殆どのピクセルの予測値は同じである。従って、マルチモードとしてHAC転置モード(図19(b))を加えたとしても、圧縮率の向上が期待できない。   In addition to the problem of the predicted distance, there is a problem that the HACP method is not suitable for multimode expansion. FIG. 19B shows a HAC transpose matrix (transposition of the rows and columns in FIG. 19A). FIG. 19B also shows a pixel (“Different prediction”) that is predicted differently from FIG. There are only 20 pixels of different prediction methods between the HACP 8 × 8 prediction block (FIG. 19A) and its transposed block (FIG. 19B). Furthermore, the predicted values for most pixels at level 2 are the same. Therefore, even if the HAC transposition mode (FIG. 19B) is added as the multimode, an improvement in the compression rate cannot be expected.

そこで本発明の目的は、組込圧縮方式で用いるコンプレッサ及びデコンプレッサに於いて、マルチモードにも適し、かつ上記従来のHACP方式を用いたものよりもより高い圧縮率を達成できるコンプレッサ及びデコンプレッサ、及びそれを用いた画像処理装置を提供することにある。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a compressor and a decompressor that are suitable for multimode and can achieve a higher compression ratio than those using the conventional HACP method. And providing an image processing apparatus using the same.

本発明に係るコンプレッサの第1の構成は、画像フレームのフレーム・データを圧縮するコンプレッサであって、
入力されたフレーム・データを所定サイズの画素ブロックに分割するブロック分割手段と、
前記画素ブロックの何れか一のコーナーの起点画素を除く前記画素ブロック内の各画素に対し、何れかの一の隣接画素のコピー予測及び何れか二の隣接画素の平均予測の組み合わせから構成される予測モードを複数用意し、前記各予測モードにより前記画素ブロック内の各画素の予測値を算出する画素値予測手段と、
前記画素ブロック内の各画素に対し、当該画素の画素値から当該画素の前記予測値を引いた残差を算出する残差演算手段と、
前記画素ブロック内の各画素の前記残差を符号化する残差符号化手段と、
前記各予測モードに対して、前記残差符号化手段により符号化された前記画素ブロックの残差のビットサイズを算出し、符号化された前記画素ブロックの残差のビットサイズが最小となる前記予測モードを選択予測モードに選定する予測モード選定手段と、
前記起点画素の画素値、前記選定予測モードの情報、及び前記選定予測モードで算出され符号化された前記画素ブロックの残差情報、を含む前記画素ブロックの情報を、所定のフォーマットにより形式化した符号化フレーム・データを生成する符号コード生成手段と、
を備えたことを特徴とする。
A first configuration of a compressor according to the present invention is a compressor for compressing frame data of an image frame,
Block dividing means for dividing the input frame data into pixel blocks of a predetermined size;
Consists of a combination of copy prediction of any one adjacent pixel and average prediction of any two adjacent pixels for each pixel in the pixel block excluding the starting pixel at any one corner of the pixel block A plurality of prediction modes, and a pixel value prediction means for calculating a prediction value of each pixel in the pixel block according to each prediction mode;
For each pixel in the pixel block, residual calculation means for calculating a residual obtained by subtracting the predicted value of the pixel from the pixel value of the pixel;
Residual encoding means for encoding the residual of each pixel in the pixel block;
For each prediction mode, the residual bit size of the pixel block encoded by the residual encoding means is calculated, and the encoded residual bit block size of the pixel block is minimized. A prediction mode selection means for selecting the prediction mode as the selected prediction mode;
The information of the pixel block including the pixel value of the starting pixel, the information of the selected prediction mode, and the residual information of the pixel block calculated and encoded in the selected prediction mode is formalized in a predetermined format. Code code generating means for generating encoded frame data;
It is provided with.

この構成によれば、画素値予測手段は、隣接画素のコピー予測又は何れか二の隣接画素の平均予測によって画素ブロック内の画素値の予測を行うため、上述したように2画素距離や4画素距離による予測を含まず、データ圧縮率を高めることが可能となる。また、階層的な符号化方式ではないため、何れかの一の隣接画素のコピー予測及び何れか二の隣接画素の平均予測の種々の組み合わせからなる予測パターン(予測モード)を複数用意することで、マルチモード予測が可能となり、さらに圧縮率を向上させることが可能となる。   According to this configuration, the pixel value predicting unit predicts the pixel value in the pixel block by copy prediction of adjacent pixels or average prediction of any two adjacent pixels. It is possible to increase the data compression rate without including prediction based on distance. In addition, since it is not a hierarchical encoding method, by preparing a plurality of prediction patterns (prediction modes) consisting of various combinations of copy prediction of any one adjacent pixel and average prediction of any two adjacent pixels. Multimode prediction is possible, and the compression rate can be further improved.

ここで、「コピー予測」とは、隣接画素の画素値をそのまま予測対象画素の予測値として使用する予測方式をいう。コピー予測には、水平方向(行方向)に隣接する画素の画素値を予測値として使用する「水平コピー予測」と、垂直方向(列方向)に隣接する画素の画素値を予測値として使用する「垂直コピー予測」とがある。「平均予測」とは、予測対象画素に対し左右又は上下に隣接する画素の画素値の平均値を当該予測対象画素の予測値として使用する予測方式をいう。平均予測にも、水平方向(行方向)に隣接する2画素の画素値平均を予測値として使用する「水平平均予測」(後述の式(2a))と、垂直方向(列方向)に隣接する2画素の画素値平均を予測値として使用する「垂直平均予測」(後述の式(2b))とがある。   Here, “copy prediction” refers to a prediction method that uses the pixel value of an adjacent pixel as it is as the prediction value of a prediction target pixel. For copy prediction, “horizontal copy prediction” using the pixel values of pixels adjacent in the horizontal direction (row direction) as prediction values and the pixel values of pixels adjacent in the vertical direction (column direction) are used as prediction values. There is "vertical copy prediction". “Average prediction” refers to a prediction method that uses an average value of pixel values of pixels adjacent to the prediction target pixel in the left-right or vertical direction as a prediction value of the prediction target pixel. For the average prediction, “horizontal average prediction” (equation (2a) to be described later) using the pixel value average of two pixels adjacent in the horizontal direction (row direction) as the predicted value and adjacent in the vertical direction (column direction). There is “vertical average prediction” (formula (2b) described later) using a pixel value average of two pixels as a prediction value.

本発明に係るコンプレッサの第2の構成は、前記第1の構成において、前記ブロック分割手段は、前記フレーム・データをn×nサイズ(nは8以上の偶数)の画素ブロックに分割するものであり、
前記画素値予測手段は、第0行第0列のコーナー画素を前記起点画素とし、前記起点画素を除く前記画素ブロック内の画素を(n−1)個の縦列画素のグループであるMグループに区画するものであり、前記画素値予測手段が予測値を算出する際の前記予測モードは、少なくとも、
(a)前記画素ブロックの第0行の第1〜(n−1)列目の縦列画素からなるMグループ、及び第(n−1)列の第1〜(n−1)行目の縦列画素からなるMグループに水平コピー予測、第1〜(n−1)行の偶数列の縦列画素からなる各Mグループに垂直コピー予測、第(n−1)列を除く第1〜(n−1)行の奇数列の縦列画素からなる各Mグループに水平平均予測の予測方式を割り当てる予測モード0、
(b)前記予測モード0の転置である予測モード1、
(c)第0列の第1〜(n−1)行目の縦列画素からなるMグループに垂直コピー予測、第1〜(n−1)列の各行の縦列画素からなる各Mグループに水平コピー予測の予測方式を割り当てる予測モード2、
(d)前記予測モード2の転置である予測モード3、
の4つの予測モードを含むものであることを特徴とする。
According to a second configuration of the compressor of the present invention, in the first configuration, the block dividing unit divides the frame data into pixel blocks of n × n size (n is an even number of 8 or more). Yes,
The pixel value predicting means uses the corner pixel in the 0th row and the 0th column as the starting pixel, and the pixels in the pixel block excluding the starting pixel are grouped into an M group that is a group of (n−1) vertical pixels. And the prediction mode when the pixel value prediction means calculates the prediction value is at least:
(A) M group consisting of column pixels in the first to (n-1) th columns in the 0th row of the pixel block, and columns in the first to (n-1) th rows in the (n-1) th column. Horizontal copy prediction for the M group of pixels, vertical copy prediction for each M group of even-numbered columns of pixels in the first to (n-1) th rows, and the first to (n-) except for the (n-1) th column. 1) Prediction mode 0 in which a prediction method of horizontal average prediction is assigned to each M group of odd-numbered column pixels in a row.
(B) Prediction mode 1, which is a transpose of the prediction mode 0,
(C) Vertical copy prediction for the M group consisting of column pixels in the 1st to (n-1) th rows of the 0th column, and horizontal to each M group consisting of column pixels in each row of the 1st to (n-1) th columns. Prediction mode 2 for assigning a prediction method for copy prediction,
(D) Prediction mode 3, which is a transpose of the prediction mode 2,
These four prediction modes are included.

この構成によれば、少なくとも予測モード0〜3を使用してマルチモード予測を行えば、緩やかに変化するブロック、平坦なブロックなど様々な特徴のブロックに対して予測モード0〜3いずれかの予測モードが圧縮効率が高くなり、全体的に高い圧縮率を得ることができることが実験的に確認された(後述の表1参照)。尚、本発明においては、さらに上記4つの予測モードに加えて、さらに他の予測モードを追加することもできる。   According to this configuration, if multimode prediction is performed using at least the prediction modes 0 to 3, prediction of any one of the prediction modes 0 to 3 is performed for blocks with various characteristics such as slowly changing blocks and flat blocks. It has been experimentally confirmed that the mode has a high compression efficiency and can obtain a high compression ratio as a whole (see Table 1 described later). In the present invention, other prediction modes can be added in addition to the four prediction modes.

本発明に係るコンプレッサの第3の構成は、前記第2の構成において、前記残差符号化手段は、
前記画素ブロック内の各画素の前記残差を、前記画素値予測手段による画素値の予測方式が同じでかつ互いに画素が隣接する所定サイズのSグループに分割するSグループ分割手段と、
前記各Sグループについて、当該Sグループに属する各残差の最大値の絶対値及び最小値の絶対値を算出し、前記最大値の絶対値及び最小値の絶対値により当該Sグループの符号化モードを決定する符号化モード決定手段と、
前記各予測モードに対し、前記画素ブロックを所定サイズの複数のLグループとその半分のサイズの1つのMグループとに区画するとともに、前記各Lグループ又はMグループにおいて、当該Lグループ又はMグループに属する前記Sグループのうち前記符号化モードが同じものを結合することにより再グループ化を行い、前記各Lグループ又はMグループに対し、再グループ化後のグループパターンに応じた再グループ化モードを決定する再グループ化手段と、
前記再グループ化手段により再編された各グループの残差を、前記符号化モードに応じて予め決められた符号化テーブルに基づき符号化するSFL符号化手段と、を備え、
前記符号コード生成手段は、前記起点画素の画素値、前記選定予測モードの情報、前記各Lグループ又はMグループの前記再グループ化モード、及び前記選定予測モードで算出され符号化された前記画素ブロックの残差情報、を含む前記画素ブロックの情報を、所定のフォーマットにより形式化するものであることを特徴とする。
According to a third configuration of the compressor of the present invention, in the second configuration, the residual encoding unit includes:
S group dividing means for dividing the residual of each pixel in the pixel block into S groups of a predetermined size that have the same pixel value prediction method by the pixel value prediction means and in which pixels are adjacent to each other;
For each S group, the absolute value of the maximum value and the minimum value of each residual belonging to the S group are calculated, and the encoding mode of the S group is calculated based on the absolute value of the maximum value and the absolute value of the minimum value Encoding mode determining means for determining
For each of the prediction modes, the pixel block is partitioned into a plurality of L groups having a predetermined size and one M group having a half size, and each L group or M group is divided into the L group or M group. Regrouping is performed by combining the S groups belonging to the same encoding mode, and a regrouping mode is determined for each L group or M group according to the group pattern after regrouping Regrouping means to
SFL encoding means for encoding the residual of each group reorganized by the regrouping means based on a predetermined encoding table according to the encoding mode,
The code code generation means includes the pixel value of the origin pixel, the information of the selected prediction mode, the regrouping mode of each L group or M group, and the pixel block calculated and encoded in the selected prediction mode The pixel block information including the residual information is formalized in a predetermined format.

この構成によれば、画素ブロックを予測方式が同じでかつ互いに画素が隣接する所定サイズのSグループに分割することで、統計的に残差の類似する画素が同じグループに含まれる確率が高くなる。従って、それぞれのグループ毎に符号化テーブルに基づき符号化(エントロピー符号化)することで残差データの圧縮効率が高められる。更に、各Sグループに適用する符号化テーブルを、Sグループ内の残差の最大値の絶対値及び最小値の絶対値によって符号化モード別に分類し最適な符号割り当てを行うとともに、同じ符号化モードを結合してより大きなグループに再グループ化することで、更に残差データの圧縮効率が高められる。   According to this configuration, by dividing a pixel block into S groups of a predetermined size that have the same prediction method and pixels adjacent to each other, there is a high probability that pixels that are statistically similar in residual are included in the same group. . Therefore, the compression efficiency of the residual data can be improved by encoding (entropy encoding) based on the encoding table for each group. Further, the coding table applied to each S group is classified according to the coding mode by the absolute value of the maximum value and the absolute value of the minimum value in the S group, and optimal code allocation is performed. Are combined and regrouped into a larger group, further improving the compression efficiency of the residual data.

本発明に係るコンプレッサの第4の構成は、前記第3の構成において、前記Sグループ分割手段は、各予測モードに対して、前記Mグループを(n/2)画素及び(n/2−1)画素の2つのグループに区画してなるSグループに分割するものであり、
前記再グループ化手段は、
予測モード0に対しては、奇数列のMグループを、2つのMグループからなるMグループペアに分割して前記各Mグループペアを1つのLグループとし、偶数列のMグループを、2つのMグループからなるMグループペアに分割して前記各Mグループペアを1つのLグループとすることによって、前記各Lグループを形成し、
予測モード2に対しては、第1〜(n−1)列の各行のMグループを、互いに隣接する2つのMグループからなるMグループペアに分割して前記各Mグループペアを1つのLグループとすることによって、前記各Lグループを形成することを特徴とする。
According to a fourth configuration of the compressor of the present invention, in the third configuration, the S group dividing unit divides the M group into (n / 2) pixels and (n / 2-1) for each prediction mode. ) It is divided into S groups which are divided into two groups of pixels,
The regrouping means includes
For the prediction mode 0, the odd-numbered M group is divided into M group pairs composed of two M groups, and each M group pair is defined as one L group, and the even-numbered M group is defined as two M groups. Each L group is formed by dividing each M group pair into one L group by dividing into M group pairs consisting of groups,
For prediction mode 2, the M groups in each row of the first to (n-1) th columns are divided into M group pairs composed of two adjacent M groups, and each M group pair is divided into one L group. Thus, each L group is formed.

本発明に係るデコンプレッサは、前記第1乃至4の何れかの構成のコンプレッサにより符号化された前記符号化フレーム・データから前記フレーム・データを復元するデコンプレッサであって、
前記基点画素から順に走査する走査手段と、
前記走査手段の走査により順次指定される画素について、前記符号化フレーム・データに含まれる前記起点画素の画素値又は前記選定予測モード若しくは既に算出済みの隣接画素の画素値に基づき、当該画素の画素値の予測値を算出する予測値復号手段と、
前記予測値復号手段が算出する当該画素の予測値と、前記符号化フレーム・データに含まれる当該画素の残差情報とに基づき、当該画素の画素値を算出する残差復号手段と、
を備えたことを特徴とする。
A decompressor according to the present invention is a decompressor that restores the frame data from the encoded frame data encoded by the compressor having any one of the first to fourth configurations,
Scanning means for sequentially scanning from the base pixel;
For the pixels sequentially designated by the scanning of the scanning means, based on the pixel value of the starting pixel included in the encoded frame data or the pixel value of the selected prediction mode or the already calculated adjacent pixel, Predicted value decoding means for calculating a predicted value of the value;
Residual decoding means for calculating a pixel value of the pixel based on the predicted value of the pixel calculated by the predicted value decoding means and residual information of the pixel included in the encoded frame data;
It is provided with.

本発明に係る画像処理装置は、動画像を所定のコーディック方式により符号化又は復号するコーディック・コアと、
前記コーディック・コアが符号化又は復号演算の際に使用するフレーム・データを一時的に記憶するフレームメモリと、を備えた画像処理装置であって、
前記コーディック・コアと前記フレームメモリとの間に介設され、前記コーディック・コアが出力するフレーム・データを圧縮して符号化フレーム・データを前記フレームメモリに対し保存するとともに、前記コーディック・コアからフレーム・データの読出要求があると前記符号化フレーム・データを前記フレームメモリから読み出して前記フレーム・データに復号し、前記コーディック・コアへ出力するメモリインタフェースを備え、
前記メモリインタフェースは、
前記フレーム・データを前記符号化フレーム・データに圧縮する、前記第1乃至4の何れかの構成のコンプレッサと、
前記符号化フレーム・データを前記フレーム・データに復号する、前記本発明に係るデコンプレッサと、を備えていることを特徴とする。
An image processing apparatus according to the present invention includes a codec core that encodes or decodes a moving image by a predetermined codec method, and
A frame memory that temporarily stores frame data used by the codec core for encoding or decoding operations, and an image processing apparatus comprising:
Between the codec core and the frame memory, the frame data output from the codec core is compressed and the encoded frame data is stored in the frame memory. A memory interface that reads out the encoded frame data from the frame memory when there is a request to read out the frame data, decodes it into the frame data, and outputs the frame data to the codec core;
The memory interface is
The compressor of any one of the first to fourth configurations that compresses the frame data into the encoded frame data;
And a decompressor according to the present invention for decoding the encoded frame data into the frame data.

以上のように、本発明によれば、組込圧縮方式で用いるコンプレッサ及びデコンプレッサに於いて、マルチモードにも適し、かつ上記従来のHACP方式を用いたものよりもより高い圧縮率を達成できるコンプレッサ及びデコンプレッサ、及びそれを用いた画像処理装置を提供することができる。   As described above, according to the present invention, the compressor and the decompressor used in the built-in compression method are suitable for the multimode and can achieve a higher compression ratio than that using the conventional HACP method. A compressor and a decompressor, and an image processing apparatus using the compressor and decompressor can be provided.

MDAスキームにおいて使用する予測モード及びグループ分割を表す図である。It is a figure showing the prediction mode and group division used in a MDA scheme. PMode0において、8×8画素の1つの予測ブロックの残差をMグループ及びSグループにグループ化する例を示す図である。It is a figure which shows the example which groups the residual of one prediction block of 8x8 pixels into M group and S group in PMode0. 再グループ化モードを表す図である。(a)Mグループ内の再グループ化モード、(b)Lグループ内の再グループ化モード。It is a figure showing regroup mode. (A) Regroup mode in M group, (b) Regroup mode in L group. 実施例1に係る画像処理装置の全体構成を表す図である。1 is a diagram illustrating an overall configuration of an image processing apparatus according to a first embodiment. 図4のコンプレッサ4の内部構成を表す図である。It is a figure showing the internal structure of the compressor 4 of FIG. 図4のデコンプレッサ5の内部構成を表す図である。It is a figure showing the internal structure of the decompressor 5 of FIG. 実施例1の画像処理装置のコンプレッサ4によるフレームの圧縮動作を表すフローチャートである。6 is a flowchart illustrating a frame compression operation by the compressor 4 of the image processing apparatus according to the first exemplary embodiment. 実施例1の画像処理装置においてコンプレッサ4で圧縮した画素ブロックデータのデータフォーマットを表す図である。3 is a diagram illustrating a data format of pixel block data compressed by a compressor 4 in the image processing apparatus of Embodiment 1. FIG. ブロックデータ圧縮の他の例を示すフローチャートである。It is a flowchart which shows the other example of block data compression. 実施例1の画像処理装置のデコンプレッサ5によるフレームの展開動作を表すフローチャートである。6 is a flowchart illustrating a frame expansion operation by the decompressor 5 of the image processing apparatus according to the first exemplary embodiment. コンプレッサ4のハードウェア実装例を示す図である。It is a figure which shows the hardware mounting example of the compressor 4. FIG. 図11のコンプレッサ4のパイプライン処理サイクルのタイミングを表す図である。It is a figure showing the timing of the pipeline processing cycle of the compressor 4 of FIG. デコンプレッサ5のハードウェア実装例を示す図である。It is a figure which shows the hardware mounting example of the decompressor 5. FIG. 図13のデコンプレッサ5のパイプライン処理サイクルのタイミングを表す図である。It is a figure showing the timing of the pipeline processing cycle of the decompressor 5 of FIG. 16×16画素ブロックに対するMDAスキームにおいて使用する予測モード及びグループ分割を表す図である。It is a figure showing the prediction mode and group division | segmentation used in the MDA scheme with respect to a 16x16 pixel block. PMode0において、16×16画素の1つの予測ブロックの残差をSグループにグループ化する例を示す図である。It is a figure which shows the example which groups the residual of one prediction block of 16x16 pixels into S group in PMode0. PMode0において、8×8画素の1つの予測ブロックの残差をSグループにグループ化する場合の他の例を示す図である。In PMode0, it is a figure which shows the other example in the case of grouping the residual of one prediction block of 8x8 pixel into S group. 8×8画素ブロックに対するHACPの原理を示した図である。It is the figure which showed the principle of HACP with respect to an 8x8 pixel block. HACP方式のレベル1における予測方法(a)及びその転置(b)を表す図である。It is a figure showing the prediction method (a) in the level 1 of a HACP system, and its transposition (b). 異なる予測距離に対するHACP方式における残差の確率分布を表す図である。It is a figure showing the probability distribution of the residual in a HACP system with respect to different prediction distance.

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

〔1〕基本的な予測・符号化方式
(1)マルチモードDPCM(差分パルス変調)及び平均化予測
2つの隣接画素の平均値を予測値とする平均予測は、隣接する1個の画素の平均値を予測値とするコピー予測(directly replicate prediction)よりは予測精度が優れている。しかし、上述したようにHACP方式では、幾つかの画素については、必然的に2画素距離又は4画素距離離れた画素の画素値を用いて予測がされ、これらの画素値は圧縮性能の低下の原因となっている。すなわち、より良い予測モードを採るか、より短い予測距離を採るかで相剋が生じる。そこで、本発明では、今回新たに考案するMDA(multi-mode DPCM scanning and averaging:マルチモードDPCM走査及び平均化)スキームを使用する。以下、MDAスキームについて説明する。
[1] Basic prediction / coding scheme (1) Multi-mode DPCM (differential pulse modulation) and averaged prediction Average prediction using an average value of two adjacent pixels as a predicted value is an average of one adjacent pixel. The prediction accuracy is superior to copy prediction (directly replicate prediction) in which the value is a predicted value. However, as described above, in the HACP method, for some pixels, prediction is necessarily performed using pixel values of pixels that are two or four pixel distances apart, and these pixel values may cause a decrease in compression performance. It is the cause. In other words, there is a conflict between taking a better prediction mode or taking a shorter prediction distance. Therefore, in the present invention, an MDA (multi-mode DPCM scanning and averaging) scheme newly devised this time is used. Hereinafter, the MDA scheme will be described.

図1は、MDAスキームにおいて使用する予測モード及びグループ分割を表す図である。図1(a),(b),(c),(d)は、それぞれ予測モードPMode0,PMode1,PMode2,PMode3を表している。   FIG. 1 is a diagram illustrating a prediction mode and group division used in an MDA scheme. FIGS. 1A, 1B, 1C, and 1D represent prediction modes PMode0, PMode1, PMode2, and PMode3, respectively.

PMode0は、MDAスキームにおける予測方式の基本形である。左上の1画素には、オリジナルの画素値が与えられる。左上の1画素を除く第0行目の画素の予測は、水平DPCM(水平コピー予測)により行われる。1〜7行目の偶数カラムの28画素の予測は垂直DPCM(垂直コピー予測)により行われる。1〜7行目のカラム1,3,5の画素の予測は、左右の隣接画素の水平平均予測により行われる。1〜7行目の最後のカラム7の画素の予測は、左隣接画素の値を複製すること(即ち、水平コピー予測)によって行われる。このように、PMode0は、予測を行う際に隣接画素の画素値のみを使用するため、HACP方式における2画素距離又は4画素距離の画素による予測性能の低下の問題が回避される。   PMode0 is a basic form of the prediction method in the MDA scheme. The original pixel value is given to the upper left pixel. The prediction of the pixels in the 0th row excluding the upper left one pixel is performed by horizontal DPCM (horizontal copy prediction). Prediction of 28 pixels in even columns in the first to seventh rows is performed by vertical DPCM (vertical copy prediction). Prediction of pixels in columns 1, 3, and 5 in the first to seventh rows is performed by horizontal average prediction of left and right adjacent pixels. The prediction of the pixel in the last column 7 in the first to seventh rows is performed by duplicating the value of the left adjacent pixel (that is, horizontal copy prediction). Thus, since PMode 0 uses only the pixel values of adjacent pixels when performing prediction, the problem of deterioration in prediction performance due to pixels of 2 pixel distance or 4 pixel distance in the HACP method is avoided.

ここで、水平平均予測,垂直平均予測は、それぞれ次式(2a),(2b)によって定義されている。pi,jは画素(i,j)の画素値、Pri,jは画素(i,j)の予測値である。 Here, the horizontal average prediction and the vertical average prediction are defined by the following expressions (2a) and (2b), respectively. p i, j is the pixel value of the pixel (i, j), and Pr i, j is the predicted value of the pixel (i, j).

ナチュラル・シーケンスでは、緩やかに変化するブロック、平坦なブロックなど様々な特徴のブロックを含んでいるため、一般に、1つの予測モードだけではこれら様々な特徴のブロックに適しているものとすることはできない。そこで、様々な画像特徴に対応するため、MDAスキームではマルチモード予測(PMode0〜PMode3)を適用する。   Natural sequences include blocks with various features, such as slowly changing blocks and flat blocks, so generally one prediction mode cannot be suitable for these various feature blocks. . Therefore, in order to deal with various image features, multi-mode prediction (PMode0 to PMode3) is applied in the MDA scheme.

図1(b)に示したPMode1はPMode0の転置であり、PMode0に対して43の異なる予測方式の画素を有している。PMode1では、垂直平均予測と水平DPCMが用いられている。   PMode1 shown in FIG. 1B is a transposition of PMode0, and has 43 pixels with different prediction schemes with respect to PMode0. In PMode1, vertical average prediction and horizontal DPCM are used.

しかしながら、PMode0とPMode1での平均予測とDPCMの方向は直交しているため、これら2つのモードは緩やかに変化するブロックに対しては適していない。そこで、MDAスキームではPMode2,PMode3のような、単純な水平DPCM及び垂直DPCM走査モードが追加されている(図1(c),(d))。マルチモードでは、各ブロックに対して、これら4つの予測モードのうち、圧縮率が最小となる予測モードが選択される。   However, since the average prediction in PMode0 and PMode1 and the direction of DPCM are orthogonal, these two modes are not suitable for slowly changing blocks. Therefore, in the MDA scheme, simple horizontal DPCM and vertical DPCM scanning modes such as PMode2 and PMode3 are added (FIGS. 1C and 1D). In the multi-mode, a prediction mode with the minimum compression rate is selected from the four prediction modes for each block.

図1に示したマルチモードの妥当性を検証するため、18のテスト・シーケンスを使用して上記4つの予測モードが選択される確率を調査した。表1に、4つのMDA予測モードの選択された確率を示す。表1においてQpは量子化パラメータを表す。また、表中の確率値は、18のテスト・シーケンスのすべてのフレームの平均値である。   In order to verify the validity of the multimode shown in FIG. 1, the probability of the above four prediction modes being selected using 18 test sequences was investigated. Table 1 shows the selected probabilities for the four MDA prediction modes. In Table 1, Qp represents a quantization parameter. The probability value in the table is an average value of all frames of the 18 test sequences.

上記実験結果から、PMode0〜PMode3の各予測モードはおよそ20%〜30%の確率で選択されたおり、PMode0〜PMode3の4つの予測モードを採用することが合理的であることが分かる。そこで、MDAスキームにおいては、これら4つの予測モードの組み合わせを採用する。   From the above experimental results, it is understood that each prediction mode of PMode0 to PMode3 is selected with a probability of approximately 20% to 30%, and it is reasonable to adopt four prediction modes of PMode0 to PMode3. Therefore, in the MDA scheme, a combination of these four prediction modes is adopted.

(2)MDAにおける残差のグループ化
予測によって得られる各画素の残差の圧縮率を向上させるためには、残差の有効ビット以下の切り捨て(SBT:significant bits truncation)及び半固定長(SFL)符号化を行う前に、残差を分類する必要がある。効率的な残差グルーピング・スキームを採用することで、より高い圧縮性能を得ることができる。そこで、SFL符号化及びSBT符号化の特徴に適応させるため、類似の分布を示すものを1つのグループとしてグループ化を行う。そのためには、通常、同じ予測方法で予測された残差を同じグループに分類するのがよいと考えられる。
(2) Grouping of residuals in MDA In order to improve the compression ratio of the residual of each pixel obtained by prediction, truncation (SBT: significant bits truncation) and semi-fixed length (SFL) It is necessary to classify the residuals before encoding. By adopting an efficient residual grouping scheme, higher compression performance can be obtained. Therefore, in order to adapt to the characteristics of SFL coding and SBT coding, those showing similar distributions are grouped as one group. For this purpose, it is generally considered that the residuals predicted by the same prediction method should be classified into the same group.

例えば、図1(a)のPMode0における平均化予測及びDPCMの割り当てに従えば、8×8画素の1つの予測ブロックを図2(a)に示した9つのグループに分割することができる。この9つのグループを「ミドルサイズ・グループ」(Mグループ)と呼ぶ。グループサイズを同じとするため、すべてのMグループは7画素からなる。   For example, according to the averaged prediction and DPCM assignment in PMode 0 in FIG. 1A, one prediction block of 8 × 8 pixels can be divided into nine groups shown in FIG. These nine groups are referred to as “middle size groups” (M groups). To make the group size the same, all M groups are composed of 7 pixels.

しかし、実際のシーケンスでは、1つのMグループの中でも1,2個の画素の残差のみが非以上に大きい(又は非常に小さい)場合がある。このような場合、1つのMグループで残差をグループ化するよりも、3画素及び4画素からなる2つのスモールサイズ・グループ(Sグループ)にグループ化した場合が効率的である。PMode0において、このようなSグループへのグループ化した例を図2(b)に示す。   However, in an actual sequence, there are cases where only the residual of one or two pixels in one M group is not larger than (or very small). In such a case, it is more efficient to group into two small size groups (S group) consisting of 3 pixels and 4 pixels than to group the residuals into one M group. FIG. 2B shows an example of grouping into S groups in PMode0.

逆に、画素値がスムーズに変化するブロックにおいては、SFL符号化における符号化モードCMは該ブロック内で類似している。かかる場合、2つのMグループを結合して1つのラージサイズ・グループ(Lグループ)としたほうが効率的である。図1(a)〜(d)に、各予測モードにおけるLグループのグループ化の方法を示す。図1(a)〜(d)において、同じ色が付された画素が同じLグループに属する。図1の各モードにおいて、ブロックは1つのMグループ(group 0)と4つのLグループ(group 1〜4)とにグループ化されている。   On the contrary, in a block in which the pixel value changes smoothly, the encoding mode CM in SFL encoding is similar in the block. In such a case, it is more efficient to combine two M groups into one large size group (L group). 1A to 1D show a method for grouping L groups in each prediction mode. 1A to 1D, pixels with the same color belong to the same L group. In each mode of FIG. 1, the blocks are grouped into one M group (group 0) and four L groups (groups 1 to 4).

以上のような3つの基本的な残差グループ(Sグループ,Mグループ,Lグループ)を様々に組み合わせてグループ化を行うことにより、残差の圧縮効率を向上させることができる。   Residual compression efficiency can be improved by variously combining the three basic residual groups (S group, M group, and L group) as described above.

(2)残差の再グループ化
Sグループを使用すれば、当然、Mグループ又はLグループを使用する場合に比べ、残差を表すためのビット数を低減することができる。しかしながら、Sグループを使用した場合、符号化モードCMのオーバーヘッドは、Mグループの2倍以上、Lグループの3.6倍となる。従って、Sグループの付加ビットを減少させるために、本発明では1つのLグループの中の4つのSグループを再グループ化するスキームを採用する。
(2) Regrouping of residuals If the S group is used, the number of bits for representing the residual can be reduced as compared with the case where the M group or the L group is used. However, when the S group is used, the overhead of the encoding mode CM is twice or more that of the M group and 3.6 times that of the L group. Therefore, in order to reduce the additional bits of the S group, the present invention employs a scheme for regrouping four S groups in one L group.

殆どの場合では、1つのLグループ(又はMグループ)内において4つのSグループ(又は2つのSグループ)の符号化モードは類似するか又は同一となる。そこで、同じ符号化モードのSグループを結合させて再グループ化を行う。   In most cases, the coding modes of four S groups (or two S groups) within one L group (or M group) are similar or identical. Therefore, regrouping is performed by combining S groups of the same coding mode.

図1(a)−(d)に示した通り、1つの8×8ブロックは4つのLグループ(large group 1〜4)と1つのMグループ(group 0)とに分割される。このうち、Mグループ(group 0)は、図2(b)に示したように3画素のSグループと4画素のSグループとの2つのSグループに分割される。再グループ化では、この2つのSグループの符号化モードが同じであれば、それらを結合して1つのグループとする。従って、Mグループに関しては、再グループ化によって図3(a)の2つのモード(M,2S)が生じる。従って、Mグループに関しては、再グループ化モード(RGM:ReGrouping Mode)の情報を表すためには1ビットの追加フラグで十分である。同様に、Lグループ(large group 1〜4)は、再グループ化によって図3(b)の15のモード(RG0〜RG14)が生じる。図3(b)において、同じ色の画素は同じ符号化モードであることを表している。従って、Lグループに関しては、再グループ化モード(RGM)を表すのに、RG0では3ビット、それ以外は4ビットの追加フラグが必要である。   As shown in FIGS. 1A to 1D, one 8 × 8 block is divided into four L groups (large groups 1 to 4) and one M group (group 0). Among these, the M group (group 0) is divided into two S groups of a 3-pixel S group and a 4-pixel S group as shown in FIG. 2B. In regrouping, if the coding modes of the two S groups are the same, they are combined into one group. Therefore, for the M group, the two modes (M, 2S) of FIG. Therefore, for the M group, a 1-bit additional flag is sufficient to represent information on the regrouping mode (RGM). Similarly, in the L group (large group 1 to 4), 15 modes (RG0 to RG14) in FIG. 3B are generated by regrouping. In FIG. 3B, pixels of the same color represent the same encoding mode. Therefore, for the L group, an additional flag of 3 bits is required for RG0 and 4 bits otherwise for representing the regrouping mode (RGM).

(3)半固定長符号化
残差のエントロピー符号化においては、非特許文献2に記載の半固定長(SFL)符号化方式を使用する。各グループにおいて、最小残差値及び最大残差値に基づいて符号化モード(CM:coding mode)が決定される。そして、表2に示した準固定長符号化テーブルに従って残差が符号化される。
(3) Semi-fixed length coding In the residual entropy coding, the semi-fixed length (SFL) coding method described in Non-Patent Document 2 is used. In each group, a coding mode (CM) is determined based on the minimum residual value and the maximum residual value. Then, the residual is encoded according to the semi-fixed length encoding table shown in Table 2.

表2において、mmはグループ内の残差値の最小値p・最大値qの絶対値から次式によって求められる。   In Table 2, mm is obtained from the absolute value of the minimum value p and the maximum value q of the residual values in the group by the following equation.

Mは符号化モード(CM)の番号である。Mはmmの値により一意的に決定される。Dは符号化されたシーケンスである。表2のDの欄において、Sは残差の符号ビット(残差が負の場合は1、正の場合は0)である。上線付のSはSの論理反転値である。また、下線が付された値は、追加のトレーリングビットTを必要とすることを表し、グループ内の残差値に2M−1又は−2M−1(Mは符号化モード番号)が存在する場合にその符号を表すために使用される。尚、グループ内の残差値に2M−1又は−2M−1が存在しない場合にはトレーリングビットTは付加されない。トレーリングビットTが加えられているため、符号化モードMが1〜6の場合、当該符号化モードにおいて与えられる残差範囲は[−2M−1+1,2M−1]又は[2M−1,2M−1−1]となる。 M is a coding mode (CM) number. M is uniquely determined by the value of mm. D is an encoded sequence. In the column D of Table 2, S is a sign bit of the residual (1 if the residual is negative, 0 if positive). S with an overline is a logical inversion value of S. The underlined value indicates that an additional trailing bit T is required, and 2 M−1 or −2 M−1 (M is an encoding mode number) is added to the residual value in the group. Used to represent its sign when present. If 2 M−1 or −2 M−1 does not exist in the residual value in the group, the trailing bit T is not added. Since the trailing bit T is added, when the encoding mode M is 1 to 6, the residual range given in the encoding mode is [−2 M−1 +1, 2 M−1 ] or [2 M −1 , 2 M−1 −1].

(例1) グループ内の残差がr={5,0,−4}の場合、残差の最大値はp=5,最小値はq=−4なので、式(3)及び表2より、mm=5,M=4である。従って、符号化シーケンスは、
D={0101,0000,1100}
となり、どの残差も8(=2M-1)又は−8(=−2M-1)ではないので、この場合にはトレーリングビットTは付加されない。
(Example 1) When the residual in the group is r = {5, 0, −4}, the maximum value of the residual is p = 5 and the minimum value is q = −4. , Mm = 5, M = 4. Therefore, the encoding sequence is
D = {0101,0000,1100}
Since no residual is 8 (= 2 M-1 ) or -8 (= -2 M-1 ), no trailing bit T is added in this case.

(例2) グループ内の残差がr={8,0,−4}の場合、残差の最大値はp=8,最小値はq=−4なので、式(3)及び表2より、mm=8,M=4である。従って、符号化シーケンスは、
D={1000,0000,1100}
となる。この場合、r(1)=8なので、トレーリングビットT=0が付加される。
(Example 2) When the residual in the group is r = {8, 0, −4}, the maximum value of the residual is p = 8 and the minimum value is q = −4. Mm = 8 and M = 4. Therefore, the encoding sequence is
D = {1000, 0000, 1100}
It becomes. In this case, since r (1) = 8, the trailing bit T = 0 is added.

(例3) グループ内の残差がr={−8,0,−4}の場合、残差の最大値はp=0,最小値はq=−8なので、式(3)及び表2より、mm=8,M=4である。従って、符号化シーケンスは、
D={1000,0000,1100}
となる。この場合、r(1)=−8なので、トレーリングビットT=1が付加される。
(Example 3) When the residual in the group is r = {− 8, 0, −4}, the maximum value of the residual is p = 0 and the minimum value is q = −8. Therefore, mm = 8 and M = 4. Therefore, the encoding sequence is
D = {1000, 0000, 1100}
It becomes. In this case, since r (1) = − 8, the trailing bit T = 1 is added.

(例4) グループ内の残差がr={8,0,−8}の場合、残差の最大値はp=8,最小値はq=−8なので、式(3)及び表2より、mm=9,M=5である。従って、符号化シーケンスは、
D={01000,00000,11000}
となる。この場合、どの残差も16(=2M-1)又は−16(=−2M-1)ではないので、トレーリングビットTは付加されない。
(Example 4) When the residual in the group is r = {8, 0, −8}, the maximum value of the residual is p = 8 and the minimum value is q = −8. Mm = 9 and M = 5. Therefore, the encoding sequence is
D = {01,000,00000,11000}
It becomes. In this case, since no residual is 16 (= 2 M-1 ) or -16 (= -2 M-1 ), the trailing bit T is not added.

〔2〕画像処理装置の構成
(1)全体構成
図4は、本実施例に係る画像処理装置の全体構成を表す図である。図4において、画像処理装置は、コーディック・コア1,DRAM2,及びDRAMインタフェース部3の3つの部分から構成されている。コーディック・コア1は、HEVC,H.264/AVC,MPEG−2等のエンコーダ及びデコーダを含むビデオコーディックを行う部分である。本発明ではコーディック・コア1については特に限定する必要はなく、種々のもの(例えば、HEVC,H.264/AVC,MPEG−2等のコーディック・コア)を使用することができるので、ここでは説明を省略する。また、DRAM2は、コーディック・コア1においてビデオコーディックの際に使用されるリファレンス・フレームなどの画像データをバッファリングするためのメモリである。DRAMインタフェース部3は、コーディック・コア1とDRAM2との間に追加のレイヤとして設けられ、コーディック・コア1から出力されるリファレンス・フレーム等の画像データをDRAM2に保存する前に圧縮すると共に、DRAM2からコーディック・コア1へ画像データをフェッチ・バックする際に展開(解凍)する。DRAMインタフェース部3は、コンプレッサ4、デコンプレッサ5、キャッシュ・メモリ6及びDRAMコントローラ7を備えている。コンプレッサ4により、DRAM2に書き込む画像データの無損失圧縮が行われる。デコンプレッサ5によりDRAM2から読み出される画像データの展開が行われる。キャッシュ・メモリ6は、DRAM2に書き込む又はDRAM2から読み出される圧縮された画像データを一時的に記憶するためのメモリである。DRAMコントローラ7は、DRAM2へのデータの書き込み及びDRAM2からのデータの読み出しを制御するコントローラである。
[2] Configuration of Image Processing Device (1) Overall Configuration FIG. 4 is a diagram illustrating the overall configuration of the image processing device according to the present embodiment. In FIG. 4, the image processing apparatus is composed of three parts: a codec core 1, a DRAM 2, and a DRAM interface unit 3. Cordic Core 1 is HEVC, H. This is a part that performs video codec including encoders and decoders such as H.264 / AVC and MPEG-2. In the present invention, the codec core 1 is not particularly limited, and various types (for example, codec cores such as HEVC, H.264 / AVC, and MPEG-2) can be used. Is omitted. The DRAM 2 is a memory for buffering image data such as a reference frame used in the video codec in the codec core 1. The DRAM interface unit 3 is provided as an additional layer between the codec core 1 and the DRAM 2. The DRAM interface unit 3 compresses image data such as a reference frame output from the codec core 1 before storing it in the DRAM 2. When the image data is fetched back to the codec core 1, it is expanded (decompressed). The DRAM interface unit 3 includes a compressor 4, a decompressor 5, a cache memory 6, and a DRAM controller 7. The compressor 4 performs lossless compression of the image data written to the DRAM 2. The decompressor 5 develops the image data read from the DRAM 2. The cache memory 6 is a memory for temporarily storing compressed image data that is written to or read from the DRAM 2. The DRAM controller 7 is a controller that controls data writing to the DRAM 2 and data reading from the DRAM 2.

なお、DRAMインタフェース部3は、マイコンや再構成可能論理回路(FPGA等)を用いてソフトウェア的に構成してもよいし、高速化のための専用回路を作りハードウェア的に構成し実装してもよい。   The DRAM interface unit 3 may be configured in software using a microcomputer or a reconfigurable logic circuit (FPGA or the like), or a dedicated circuit for speeding up is configured and implemented in hardware. Also good.

(2)コンプレッサ
図5は、図4のコンプレッサ4の内部構成を表す図である。尚、図5は、コンプレッサ4の機能を分かりやすく説明するために便宜的に機能要素毎にブロック化して表したものであり、実際のハードウェア実装では必ずしも図4のとおりに構成されるものとは限られない(例えば、図11参照)。コンプレッサ4は、予測モードテーブル11、残差メモリ12、残差演算部13、フレーム入力部14、フレームバッファ14a、ブロック分割部15、ブロックバッファ15a、MDA予測部16、予測モード選定部17、コード生成部18、残差符号化部19、及び出力部20を備えている。
(2) Compressor FIG. 5 is a diagram illustrating the internal configuration of the compressor 4 of FIG. Note that FIG. 5 is a block diagram for each functional element for the sake of convenience in order to explain the functions of the compressor 4 in an easy-to-understand manner. In actual hardware implementation, it is not necessarily configured as shown in FIG. Is not limited (see, for example, FIG. 11). The compressor 4 includes a prediction mode table 11, a residual memory 12, a residual calculation unit 13, a frame input unit 14, a frame buffer 14a, a block division unit 15, a block buffer 15a, an MDA prediction unit 16, a prediction mode selection unit 17, a code A generation unit 18, a residual encoding unit 19, and an output unit 20 are provided.

予測モードテーブル11は、図1に示した4つの予測モードPMode0〜PMode3のパターンを記憶している。残差メモリ12は、入力される各画像ブロック(8×8画素の画像ブロック)の各画素から当該画素の予測値を引いて算出される残差を一時的に記憶する部分である。フレーム入力部14は、コーディック・コア1から出力されるフレーム・データ(リファレンス・フレーム等の画像データ)が入力されるインタフェース部分である。フレームバッファ14aは、フレーム入力部14から入力されるフレーム・データを一時的に記憶するメモリである。ブロック分割部15は、フレーム入力部14から入力されるフレーム・データを所定サイズ(8×8画素)の画素ブロックに分割する。ブロックバッファ15aは、ブロック分割部15により切り出された画素ブロックを一時的に記憶するメモリである。MDA予測部16は、上述したMDA(マルチモードDPCM及び平均化予測)方式によって、予測モードPMode0〜PMode3の各予測モードにより画素ブロックの各画素の予測値を算出する。予測モード選定部17は、予測モードPMode0〜PMode3での予測モードを用いて画素ブロックを圧縮した際に最も圧縮効率の高い予測モードを選定する。残差演算部13は、MDA予測部16により予測された予測値を用いて、画素ブロックの残差を算出し残差メモリ12に格納する。コード生成部18は、予測モード選定部17で選定された予測モードにより、符号化された画素ブロックのフォーマット整形を行う。残差符号化部19は、残差メモリ12から画素ブロックの残差値を読み出して、上述の残差のグループ化処理、再グループ化処理及び半固定長符号化処理を行う。出力部20は、コード生成部18が出力する符号化された画素ブロックのデータをキャッシュ・メモリ6へ出力する。   The prediction mode table 11 stores patterns of the four prediction modes PMode0 to PMode3 shown in FIG. The residual memory 12 is a part that temporarily stores a residual calculated by subtracting the predicted value of the pixel from each pixel of each input image block (8 × 8 pixel image block). The frame input unit 14 is an interface part to which frame data (image data such as a reference frame) output from the codec core 1 is input. The frame buffer 14 a is a memory that temporarily stores frame data input from the frame input unit 14. The block dividing unit 15 divides the frame data input from the frame input unit 14 into pixel blocks of a predetermined size (8 × 8 pixels). The block buffer 15a is a memory that temporarily stores the pixel block cut out by the block dividing unit 15. The MDA prediction unit 16 calculates a prediction value of each pixel of the pixel block in each prediction mode of the prediction modes PMode0 to PMode3 by the above-described MDA (multimode DPCM and averaged prediction) method. The prediction mode selection unit 17 selects the prediction mode with the highest compression efficiency when the pixel block is compressed using the prediction modes in the prediction modes PMode0 to PMode3. The residual calculation unit 13 calculates the residual of the pixel block using the prediction value predicted by the MDA prediction unit 16 and stores it in the residual memory 12. The code generation unit 18 performs format shaping of the encoded pixel block according to the prediction mode selected by the prediction mode selection unit 17. The residual encoding unit 19 reads out the residual value of the pixel block from the residual memory 12, and performs the above-described residual grouping process, regrouping process, and semi-fixed length encoding process. The output unit 20 outputs the encoded pixel block data output from the code generation unit 18 to the cache memory 6.

また、図5の残差符号化部19は、グルーピングテーブル21、スモール・グループ分割部22、CM&T決定部23、再グルーピング部24、及びSFL符号化部25を備えている。グルーピングテーブル21には、Sグループ,Mグループ,Lグループへのグループ化を行う際の結合パターン(例えば、図1,図2参照)が記憶されている。スモール・グループ分割部22は、各予測モードによる残差をSグループに分割する。CM&T決定部23は、各Sグループの符号化モード(CM)及びトレーリングビット(T)を決定する。再グルーピング部24は、スモール・グループ分割部22で分割された各Sグループに対し、前述した残差の再グループ化処理により、Sグループの再グループ化を行う。SFL符号化部25は、再グルーピング部24により再グループ化された各グループの残差を上述のSFL符号化方式によってエントロピー符号化を行う。   5 includes a grouping table 21, a small group dividing unit 22, a CM & T determining unit 23, a regrouping unit 24, and an SFL encoding unit 25. The grouping table 21 stores a coupling pattern (for example, see FIGS. 1 and 2) when grouping into an S group, an M group, and an L group. The small group dividing unit 22 divides the residual according to each prediction mode into S groups. The CM & T determination unit 23 determines the encoding mode (CM) and trailing bit (T) of each S group. The regrouping unit 24 regroups the S groups by the above-described residual regrouping process for each S group divided by the small group dividing unit 22. The SFL encoding unit 25 performs entropy encoding on the residual of each group regrouped by the regrouping unit 24 by the above-described SFL encoding method.

(3)デコンプレッサ
図6は、図4のデコンプレッサ5の内部構成を表す図である。尚、図6は、デコンプレッサ5の機能を分かりやすく説明するために便宜的に機能要素毎にブロック化して表したものであり、実際のハードウェア実装では必ずしも図6のとおりに構成されるものとは限られない(例えば、図13参照)。デコンプレッサ5は、予測モードテーブル30、グルーピングテーブル31、入力部32、予測値復号部33、残差復号部34、フレーム復元部35、及び出力部36を備えている。尚、予測モードテーブル30及びグルーピングテーブル31は、図5の予測モードテーブル11及びグルーピングテーブル21と同様であり、図5と共通のものとすることができる。入力部32は、DRAM2から読み出される符号化された画素ブロックのデータが入力される。予測値復号部33は、入力部32から入力されたデータのうち、符号化された予測値のデータを復号する。残差復号部34は、入力部32から入力されたデータのうち、符号化された残差のデータを復号する。フレーム復元部35は、予測値復号部33及び残差復号部34により復号された予測値と残差から、各画素ブロックを復元し、フレーム・データを合成する。出力部36は、フレーム復元部35により生成されるフレーム・データをコーディック・コア1へ出力する。
(3) Decompressor FIG. 6 is a diagram showing the internal configuration of the decompressor 5 of FIG. Note that FIG. 6 is a block diagram for each functional element for the sake of convenience in order to explain the functions of the decompressor 5 in an easy-to-understand manner. In actual hardware implementation, it is not necessarily configured as shown in FIG. (For example, refer to FIG. 13). The decompressor 5 includes a prediction mode table 30, a grouping table 31, an input unit 32, a predicted value decoding unit 33, a residual decoding unit 34, a frame restoration unit 35, and an output unit 36. Note that the prediction mode table 30 and the grouping table 31 are the same as the prediction mode table 11 and the grouping table 21 in FIG. 5, and can be the same as those in FIG. The input unit 32 receives data of encoded pixel blocks read from the DRAM 2. The predicted value decoding unit 33 decodes encoded predicted value data among the data input from the input unit 32. The residual decoding unit 34 decodes encoded residual data among the data input from the input unit 32. The frame restoration unit 35 restores each pixel block from the prediction value and the residual decoded by the prediction value decoding unit 33 and the residual decoding unit 34, and synthesizes frame data. The output unit 36 outputs the frame data generated by the frame restoration unit 35 to the codec core 1.

(4)データ圧縮動作
以上のように構成された本実施例の画像処理装置について、以下そのデータ圧縮動作を説明する。図7は、本実施例の画像処理装置のコンプレッサ4によるフレームの圧縮動作を表すフローチャートである。図8は、本実施例の画像処理装置においてコンプレッサ4で圧縮した画素ブロックデータのデータフォーマットを表す図である。
(4) Data compression operation The data compression operation of the image processing apparatus of the present embodiment configured as described above will be described below. FIG. 7 is a flowchart showing the frame compression operation by the compressor 4 of the image processing apparatus of this embodiment. FIG. 8 is a diagram illustrating the data format of the pixel block data compressed by the compressor 4 in the image processing apparatus of the present embodiment.

(4.1)全体動作
まず、コーディック・コア1からコンプレッサ4にフレーム・データFLが入力される(S100)。
(4.1) Overall Operation First, frame data FL is input from the codec core 1 to the compressor 4 (S100).

コンプレッサ4のブロック分割部15は、入力されたフレーム・データFLをN個の8×8画素の画素ブロック{B}に分割する(S101)。 Compressor block dividing unit 15 of the 4 divides the frame data FL entered into pixel blocks {B k} of N B number of 8 × 8 pixels (S101).

次に、コンプレッサ4は、それぞれの画素ブロックBに対して、ブロックデータ圧縮を行い、圧縮された画素ブロックデータB’を生成する(S102,S103)。 Next, the compressor 4, for each pixel block B k, performs block data compression to produce a compressed pixel block data B 'k (S102, S103) .

最後に、コンプレッサ4は、圧縮された画素ブロックデータB’を図8のフォーマットに整形して、キャッシュ・メモリ6へ出力する。 Finally, the compressor 4 shapes the compressed pixel block data B ′ k into the format of FIG. 8 and outputs it to the cache memory 6.

(4.2)ブロックデータ圧縮
上記ステップS103におけるブロックデータ圧縮は、図7(a)のフローに従って、以下のように実行される。
(4.2) Block Data Compression Block data compression in step S103 is performed as follows according to the flow of FIG.

まず、図1のPMode0〜PMode3の各予測モードに対し、MDA予測演算、残差演算、残差の再グループ化、及びブロックコストの演算を実行する(S200〜S206)。すなわち、予測モードPMode i(i=0,1,2,3)について、まず、MDA予測部16は、予測モードテーブル11に記憶された図1に示した予測パターンに従って、左上の1画素を除く各画素に対して画素値の予測値を算出する(S201)。残差演算部13は、算出された予測値を用いて、各画素の残差を算出する(S202)。ここで、残差は、スモール・グループ分割部22によって、図2(b)に例示されたように、3画素又は4画素のSグループにグループ化される。次いで、CM&T決定部23は、各Sグループに対して式(3)によりmmを算出し、表2に従って各Sグループの符号化モードMを決定する(S203)。そして、再グルーピング部24は、同じLグループ又はMグループに属するSグループのうち、符号化モードMが同じSグループを結合することにより再グループ化を実行し、Lグループについては図3(b)のRG0〜RG14のいずれかの再グループ化モード(RGM)を決定し、Mグループについては図3(a)のM,2Sのいずれかの再グループ化モード(RGM)を決定する(S204)。そして、再グループ化された残差に対してSFL符号化部25はSFL符号化を行い、符号化された画素ブロックの残差データ(符号化残差データ)D(PMode i)を生成する(S205)。ここで、予測モード選定部17は、符号化された画素ブロックのブロックコストBCを算出する(S206)。ここで、ブロックコストBCは、具体的には次式に従って算出される。 First, MDA prediction calculation, residual calculation, residual regrouping, and block cost calculation are executed for each prediction mode of PMode0 to PMode3 in FIG. 1 (S200 to S206). That is, for the prediction mode PMode i (i = 0, 1, 2, 3), the MDA prediction unit 16 first removes the upper left pixel according to the prediction pattern shown in FIG. 1 stored in the prediction mode table 11. A predicted pixel value is calculated for each pixel (S201). The residual calculation unit 13 calculates the residual of each pixel using the calculated predicted value (S202). Here, the residuals are grouped into S-groups of 3 pixels or 4 pixels by the small group dividing unit 22 as illustrated in FIG. Next, the CM & T determining unit 23 calculates mm for each S group by the equation (3), and determines the encoding mode M of each S group according to Table 2 (S203). Then, the regrouping unit 24 performs regrouping by combining the S groups belonging to the same L group or M group and having the same encoding mode M, and FIG. 3B illustrates the L group. The regrouping mode (RGM) of any of RG0 to RG14 is determined, and for the M group, the regrouping mode (RGM) of either M or 2S of FIG. 3A is determined (S204). Then, the SFL encoding unit 25 performs SFL encoding on the regrouped residuals, and generates residual data (encoded residual data) D (PMode i) of the encoded pixel block ( S205). Here, the prediction mode selection unit 17 calculates the block cost BC i of the encoded pixel block (S206). Here, the block cost BC i is specifically calculated according to the following equation.

ここで、F,PM,RGM,CM,D,Tは、それぞれ、ブロックの左上コーナー画素の画素値,予測モード,再グループ化モード,符号化モード,符号化残差データ,トレーリングビットを表す。‖X‖はXのビット・コスト(ビット数)を表している。ここでは、各画素の画素値は8ビットとしているので‖F‖=8である。予測モードは図1より0〜3の範囲なので‖PM‖=2である。再グループ化モードRGMは、図3よりLグループが0〜14、Mグループが0〜1の範囲をとり1ブロック当たり4つのLグループと1つのMグループがあるので、‖RGM‖は最大17ビットが必要となる。但し、図3のRG0については3ビットのフラグ(000)を割り当て、RG1〜RG14には4ビットのフラグ(0010〜1111)を割り当てればよいので、‖RGM‖は13〜17ビットの間の値となる。‖CM‖はブロック全体のグループ数Nに依存する。グループ数Nは、Mグループ及び各Lグループの再グループ化モードにより変化する。表2より1グループ当たりのCMは3ビットで表されるので、‖CM‖=3Nとなり15〜54の範囲の値をとる。‖D‖はブロック内のSグループのビットコスト‖D(S-group)‖の合計である。図2より、1つのSグループ内の画素数は3又は4であり、表2より1画素当たりの符号化残差データは、符号化モードMが7未満の場合にはMビット、M=7の場合は8ビットなので、‖D(S-group)‖は式(4)のように計算できる。トレーリングビットは、1グループ当たり0又は1ビットなので、‖T‖は0〜18の間の値をとる。 Here, F, PM, RGM, CM, D, and T represent the pixel value of the upper left corner pixel of the block, the prediction mode, the regrouping mode, the encoding mode, the encoding residual data, and the trailing bit, respectively. . ‖X‖ represents the bit cost (number of bits) of X. Here, since the pixel value of each pixel is 8 bits, ‖F‖ = 8. Since the prediction mode ranges from 0 to 3 as shown in FIG. 1, ‖PM‖ = 2. The regrouping mode RGM has a range of 0 to 14 for L group and 0 to 1 for M group as shown in FIG. 3, and there are 4 L groups and 1 M group per block. Is required. However, since RG0 in FIG. 3 is assigned a 3-bit flag (000) and RG1-RG14 is assigned a 4-bit flag (0010-1111), ‖RGM‖ is between 13-17 bits. Value. ‖CM‖ depends on the total number of block groups N g. The number of groups N g will vary with the M group and regrouping mode of each L group. According to Table 2, the CM per group is represented by 3 bits, so ‖CM‖ = 3N g and takes a value in the range of 15 to 54. ‖D‖ is the sum of the bit costs ‖D (S-group) ‖ of the S group in the block. From FIG. 2, the number of pixels in one S group is 3 or 4, and from Table 2, the encoding residual data per pixel is M bits when the encoding mode M is less than 7, M = 7 In this case, since it is 8 bits, ‖D (S-group) ‖ can be calculated as shown in Equation (4). Since trailing bits are 0 or 1 bit per group, ‖T‖ takes a value between 0 and 18.

すべての予測モードに対し、上記S200〜S206の演算処理が終了すると、予測モード選定部17は、予測モードPMode0〜PMode3のうちブロックコストBCが最小のものを選出し、これを選択された予測モードPMとして決定する(S207)。 When the arithmetic processing of S200 to S206 is completed for all prediction modes, the prediction mode selection unit 17 selects the prediction mode PMode0 to PMode3 having the smallest block cost BC i and selects the selected prediction mode. The mode PM is determined (S207).

次に、コード生成部18は、画素ブロックBの左上画素の画素値、予測モードPM、再グループ化モードRGM、各画素グループの符号化モードCM、予測モードPMで符号化された画素ブロックの残差データD及びトレーリングビットTを、図8に示したデータフォーマットに整形し、符号化ブロックcBを生成する(S208)。図8において、Fは画素ブロックBの左上画素の画素値(8ビット)、PMは予測モード(2ビット)、RGMは、各Lブロック(4個)又はMブロック(1個)の再グループ化モード(17ビット)、CMは各画素グループ(5〜18個)の符号化モード(15〜54ビット)、Dは画素ブロックBの左上画素を除く各画素の残差の符号化シーケンス、Tは各画素グループのトレーリングビット(0〜18ビット)を表す。 Next, the code generation unit 18, the pixel values of the upper left pixel of the pixel block B k, the prediction mode PM, regrouping mode RGM, for each pixel group encoding mode CM, in the prediction mode PM coded pixel blocks Residual data D and trailing bit T are shaped into the data format shown in FIG. 8 to generate a coded block cB k (S208). In FIG. 8, F is the pixel value of the upper left pixel of the pixel block Bk (8 bits), PM is the prediction mode (2 bits), and RGM is a regroup of each L block (4) or M block (1). modes (17-bit), CM coding mode (15-54 bits) of each pixel group (5 to 18 pieces), D coding sequence of the residual of each pixel except the upper left pixel of the pixel block B k, T represents a trailing bit (0 to 18 bits) of each pixel group.

最後に、コード生成部18は、生成された符号化ブロックcBのサイズsize(cBk)と元の非符号化ブロックBのサイズsize(Bk)(= 512 bit)とを比較し(S209)、size(cBk)<size(Bk)ならば符号化ブロックcBを圧縮ブロックB’として出力し(S210)、size(cBk)≧size(Bk)ならば非符号化ブロックBを圧縮ブロックB’として出力する(S211)。これは、符号化によってかえって圧縮ブロックB’のサイズが符号化前よりも大きくなる場合があるため、かかる場合、データサイズの増加を防止するための処理である。尚、出力の際には、圧縮ブロックB’が符号化ブロックか非符号化ブロックかを判別するための識別フラグが付加される。 Finally, the code generation unit 18 compares the size size (cB k ) of the generated encoded block cB k with the size size (B k ) (= 512 bit) of the original non-encoded block B k ( S209), if size (cB k ) <size (B k ), the encoded block cB k is output as the compressed block B ′ k (S210), and if size (cB k ) ≧ size (B k ), uncoded The block B k is output as the compressed block B ′ k (S211). This is because there are cases where the size of the rather compressed block B 'k by the encoding becomes larger than the previous encoding, such a case is a process for preventing an increase in data size. At the time of output, an identification flag for determining whether the compressed block B ′ k is an encoded block or a non-encoded block is added.

(4.3)ブロックデータ圧縮の他の例
図7(b)では、予測モードPMの選択を行う前に、各予測モードに対して、それぞれ残差のSFL符号化(S205)を行う方法を示したが、残差のSFL符号化は計算複雑度が大きいためこの方法は演算コストが大きくなる。そこで、他の方法として、予測モードPMの選択を行った後に残差のSFL符号化を行う方法についても説明する。図9は、ブロックデータ圧縮の他の例を示すフローチャートである。図9において、図7(b)と同じ処理部分については同符号を附している。図9の方法では、残差のSFL符号化(S205)は予測モードPMの選択(S207)を行った後に行われるため、予測モードPMの選択(S207)を行う前に、各予測モードPModeiにおけるブロックコストBCの推定計算(S206’)を行う必要がある。
(4.3) Another example of block data compression In FIG. 7B, before selecting the prediction mode PM, a method of performing SFL encoding (S205) of each residual for each prediction mode. As shown, since the SFL encoding of the residual has a high calculation complexity, this method has a high calculation cost. Therefore, as another method, a method of performing SFL encoding of the residual after selecting the prediction mode PM will be described. FIG. 9 is a flowchart illustrating another example of block data compression. In FIG. 9, the same processing parts as those in FIG. 7B are denoted by the same reference numerals. In the method of FIG. 9, since the SFL encoding of the residual (S205) is performed after the selection of the prediction mode PM (S207), before the selection of the prediction mode PM (S207), in each prediction mode PModei The block cost BC i needs to be estimated (S206 ′).

式(4)より、‖F‖=8,‖PM‖=2は定数である。各SグループにおけるCM,Tは、当該グループにおける残差の最大値及び最小値によって定まる。従って、まず各SグループにおけるCM,Tを計算する。これは最大値及び最小値を求め、その値からテーブル参照によりCM,Tを決定するだけなので計算コストは小さい。次に、ブロック内の4つのLグループ(及び1つのMグループ)のそれぞれに対し、当該Lグループ(Mグループ)内のSグループのCMの値から、RGMが決定される。これにより、‖RGM‖が決定される。このとき、ブロック内のグループ数Nも決定するため、‖CM‖,‖T‖も決定する。最後に、それぞれのSグループの画素数とCMから、各Sグループの残差の符号量‖D(S-group)‖が決定され(式(4)の下の括弧内の式)、その総和から‖D‖が決定される。そして、式(4)の和算によってブロックコストBCの推定をすることができる。 From equation (4), ‖F‖ = 8 and ‖PM‖ = 2 are constants. CM and T in each S group are determined by the maximum value and the minimum value of the residual in the group. Therefore, first, CM and T in each S group are calculated. Since the maximum value and the minimum value are obtained and CM and T are simply determined from the values by referring to the table, the calculation cost is small. Next, for each of the four L groups (and one M group) in the block, the RGM is determined from the CM value of the S group in the L group (M group). Thereby, ‖RGM‖ is determined. At this time, since the determining group number N g of the block, ‖CM‖, also determines ‖T‖. Finally, the code amount ‖D (S-group) ‖ of the residual of each S group is determined from the number of pixels and CM of each S group (the equation in parentheses below Equation (4)), and the sum ‖D‖ is determined. Then, the block cost BC i can be estimated by the summation of Equation (4).

(4)データ展開動作
図10は、本実施例の画像処理装置のデコンプレッサ5によるフレームの展開動作を表すフローチャートである。コーディック・コア1からフレーム・データの読み出し信号がデコンプレッサ5に入力されると、DRAMコントローラ7はDRAM2から圧縮されたフレーム・データを読み出してキャッシュ・メモリ6に格納する(S300)。次いで、デコンプレッサ5は、フレーム内の8×8画素の各画素ブロックB(k=0,1,…,N−1)の圧縮ブロックB’について、以下のS302〜S308の処理を実行する(S301)。
(4) Data Expansion Operation FIG. 10 is a flowchart showing the frame expansion operation by the decompressor 5 of the image processing apparatus of this embodiment. When a frame data read signal is input from the codec core 1 to the decompressor 5, the DRAM controller 7 reads the compressed frame data from the DRAM 2 and stores it in the cache memory 6 (S300). Next, the decompressor 5 performs the following processes of S302 to S308 on the compression block B ′ k of each pixel block B k (k = 0, 1,..., N B −1) of 8 × 8 pixels in the frame. Execute (S301).

予測値復号部33は、圧縮ブロックB’が符号化ブロックか否かを判定し(S302)、符号化ブロックの場合、以下のS303〜S306の処理で符号化ブロックを復号して画素ブロックBを復元する。一方、圧縮ブロックB’が非符号化ブロックの場合、読み出した圧縮ブロックB’をそのまま画素ブロックBとする(S306)。 The prediction value decoding unit 33 determines whether or not the compressed block B ′ k is an encoded block (S302). If the compressed block B ′ k is an encoded block, the encoded block is decoded by the following processes of S303 to S306 to generate a pixel block B. Restore k . On the other hand, when the compressed block B ′ k is an uncoded block, the read compressed block B ′ k is used as it is as the pixel block B k (S306).

圧縮ブロックB’が符号化ブロックの場合において、まず、残差復号部34は、圧縮ブロックB’のデータ(図8)を左上コーナー画素の画素値F,予測モードPM,再グループ化モードRGM,符号化モードCM,符号化残差データD及びトレーリングビットTの各部に分離する。そして符号化モードCM及びトレーリングビットTに基づき、符号化残差データDから画素ブロックB内のすべての残差値を復号する(S303)。これは、まず、再グループ化モードRGMから画素ブロックB内の画素グループの分割を決定し、次に、各画素グループに対して符号化モードCMから表2(グルーピングテーブル31に記憶されている)の符号化規則を決定し、この符号化規則及びトレーリングビットTにより符号化シーケンスDを元の残差値に復号するという手順で実行される。 In the case where the compressed block B ′ k is an encoded block, first, the residual decoding unit 34 converts the data of the compressed block B ′ k (FIG. 8) to the pixel value F of the upper left corner pixel, the prediction mode PM, and the regroup mode. RGM, encoding mode CM, encoded residual data D, and trailing bit T are separated. And based on the coding mode CM and the trailing bits T, decode all residual value in the encoding residual data D from the pixel block B k (S303). We first determine the division of the pixel groups in regrouping mode RGM from the pixel block B k, then stored in Table 2 (grouping table 31 from the encoding mode CM for each pixel group ) Is determined, and the encoded sequence D is decoded into the original residual value based on the encoding rule and the trailing bit T.

次に、それぞれの画素pについて、予測値復号部33は、まず、画素ブロックBの符号化データ(図8)から、左上コーナー画素の画素値F及び予測モードPMを取得し、予測モードテーブル30に記憶された予測モードPMの予測パターン(図1)により、各画素pの予測値を算出する(S304)。そして、フレーム復元部35は、各画素pの予測値に残差値を加えて画素値を算出し画素pを復元する(S305)。これにより、符号化ブロックから画素ブロックBが復元される。 Next, for each pixel p i, the predicted value decoding unit 33 first pixel block B k from the encoded data (FIG. 8), and obtains the pixel value F and the prediction mode PM in the upper left corner pixel, the prediction mode the predicted pattern of prediction mode PM stored in the table 30 (FIG. 1), calculates the predicted value of each pixel p i (S304). The frame recovery unit 35, in addition to residual values to restore the calculated pixel p i the pixel value to the predicted values of the pixels p i (S305). Thereby, the pixel block Bk is restored from the encoded block.

以上のS302〜S306の処理の後、出力部36は復元された画素ブロックBをコーディック・コア1へ出力する(S307)。 After the processing of above S302 to S306, the output unit 36 outputs the pixel block B k restored to the codec core 1 (S307).

〔3〕具体的なハードウェア実装の例
次に、本実施例のコンプレッサ4及びデコンプレッサ5を具体的にハードウェアに実装した例について説明する。
[3] Specific Example of Hardware Mounting Next, an example in which the compressor 4 and the decompressor 5 of the present embodiment are specifically mounted on hardware will be described.

(1)コンプレッサ
図11は、コンプレッサ4のハードウェア実装例を示す図である。図11において、図5の構成部に対応する構成部には同符号を附した。図11に示したコンプレッサ4は、図9のフローを並列処理化してハードウェア実装したものであり、画素ブロックの符号化演算処理をSTAGE1〜STAGE3の3段階に分けて実行し、各ステージを並行して行うことでパイプライン処理を可能としている。STAGE1では、各予測モードの各Sグループの符号化モードCM及びトレーリングビットTの演算処理が実行される。STAGE2では、再グループ化と予測モードの決定が行われる。STAGE3では、再グループ化モードの決定、残差演算、SFL符号化及びフォーマット化が実行される。
(1) Compressor FIG. 11 is a diagram illustrating a hardware implementation example of the compressor 4. In FIG. 11, the same reference numerals are given to the components corresponding to the components in FIG. The compressor 4 shown in FIG. 11 is a hardware implementation of the flow of FIG. 9 that is processed in parallel. The pixel block encoding operation process is divided into three stages, STAGE 1 to STAGE 3, and each stage is executed in parallel. By doing so, pipeline processing is possible. In STAGE 1, calculation processing of the encoding mode CM and trailing bit T of each S group in each prediction mode is executed. In STAGE 2, regrouping and prediction mode determination are performed. In STAGE 3, regrouping mode determination, residual calculation, SFL encoding and formatting are executed.

まず、コーディック・コア1から出力されるフレーム・データは、Buffer0(フレームバッファ14a)に一時的に格納される。そして、8×8画素ブロックごとに順次読み出されてされ、画素ブロックがBuffer1(ブロックバッファ15a)に一時的に格納される。   First, the frame data output from the codec core 1 is temporarily stored in Buffer0 (frame buffer 14a). Then, it is sequentially read out every 8 × 8 pixel block, and the pixel block is temporarily stored in Buffer 1 (block buffer 15a).

STAGE1においては、各予測モードにおけるそれぞれのMグループごとに、MDA予測部16により予測演算走査(DPCM走査又は平均予測演算走査)が実行され、Mグループに含まれる各Sグループの符号化モードの決定が行われる。図1より、PMode0〜PMode3には、合計36のMグループが含まれるため予測演算走査をすべき画素数は7×36=252画素であるが、各予測モードには同じMグループが重複して含まれている。重複するMグループの予測演算走査は1回だけ行えばよいため、実際に予測演算走査をすべき画素数は7×24=168画素である。このうち、DPCM走査のMグループが18グループ、予測演算走査のMグループが6グループなので、図11ではDPCM演算器(DPCM)を3つ、平均予測演算器(Avg)を1つ並列に設けている。DPCM及びAvgは、各予測モードの各Mグループの各画素に対して画素値の予測により得られる残差値を出力する。符号化モード検出器CMDは、それぞれのMグループ内のSグループごとに、DPCM又はAvgが出力する残差の最大値・最小値を求め、式(3)及び表2に従ってそれぞれの予測モードにおける各Sグループの符号化モードを検出して前段のレジスタCMに出力するとともに、トレーリングビットTを前段のレジスタTeへ出力する。また、パイプライン処理のため、オリジナルの画素ブロックの画素値は、Buffer1から前段のレジスタOriginalへ転写される。   In STAGE 1, prediction calculation scanning (DPCM scanning or average prediction calculation scanning) is performed by the MDA prediction unit 16 for each M group in each prediction mode, and determination of the coding mode of each S group included in the M group is performed. Is done. As shown in FIG. 1, since PMode0 to PMode3 include a total of 36 M groups, the number of pixels to be subjected to prediction calculation scanning is 7 × 36 = 252 pixels. However, the same M group is duplicated in each prediction mode. include. Since the overlapping M group prediction calculation scans need only be performed once, the number of pixels to be actually subjected to the prediction calculation scan is 7 × 24 = 168 pixels. Among them, there are 18 groups for DPCM scanning and 6 groups for prediction calculation scanning, so in FIG. 11, three DPCM computing units (DPCM) and one average prediction computing unit (Avg) are provided in parallel. Yes. DPCM and Avg output a residual value obtained by pixel value prediction for each pixel of each M group in each prediction mode. The encoding mode detector CMD obtains the maximum value and the minimum value of the residuals output by the DPCM or Avg for each S group in each M group, and determines each of the prediction modes in each prediction mode according to Equation (3) and Table 2. The encoding mode of the S group is detected and output to the preceding register CM, and the trailing bit T is output to the preceding register Te. Also, for pipeline processing, the pixel value of the original pixel block is transferred from Buffer 1 to the previous register Original.

STAGE2においては、まず再グループ化判定器RGM及び3つの再グループ化判定器RGLにより、各予測モードにおける各Lグループ又はMグループの再グループ化モードの判定が並列で実行される。そして、予測モード決定器(予測モード選定部17)により、上述した式(4)による各予測モードのブロックコストの推定が実行され、最もブロックコストの小さい予測モードが選択される。選択予測モードは、次段のレジスタPMに出力される。また、選択予測モードにおける各Sグループの符号化モードCM及びトレーリングビットTが、後段のレジスタCM,Teにそれぞれ出力される。また、パイプライン処理のため、オリジナルの画素ブロックの画素値は、前段のレジスタOriginalから後段のレジスタOriginalへ転写される。   In STAGE 2, first, the regrouping determination unit RGM and the three regrouping determination units RGL perform determination of the regrouping mode of each L group or M group in each prediction mode in parallel. Then, the prediction mode determiner (prediction mode selection unit 17) estimates the block cost of each prediction mode by the above-described equation (4), and selects the prediction mode with the lowest block cost. The selection prediction mode is output to the register PM at the next stage. In addition, the encoding mode CM and trailing bit T of each S group in the selected prediction mode are output to the subsequent registers CM and Te, respectively. Further, for pipeline processing, the pixel value of the original pixel block is transferred from the previous register Original to the subsequent register Original.

STAGE3においては、選択予測モードにおける各Sグループの再グループ化とSFL符号化が並列で実行される。再グループ化モード検出器RGMDは、後段のレジスタCMから、各L又はMグループ内の各Sグループの符号化モードCMを読み出し、それらの符号化モードCMの関係性に基づいて図3に従って各L又はMグループの再グループ化モードRGMを決定する。例えば、もし、Lグループ内のすべてのSグループの符号化モードCMが同じ関係であれば、当該Lグループの再グループ化モードRGMはRGM0に決定される。また、もし、Lグループの最初のSグループの符号化モードCMのみが他の3つのSグループの符号化モードCMと異なる関係の場合には、当該Lグループの再グループ化モードRGMはRGM1に決定される。   In STAGE 3, the regrouping of each S group and the SFL encoding in the selected prediction mode are executed in parallel. The regrouping mode detector RGMD reads the encoding mode CM of each S group in each L or M group from the register CM at the subsequent stage, and determines each L according to FIG. 3 based on the relationship between these encoding modes CM. Alternatively, the M group regrouping mode RGM is determined. For example, if the coding mode CMs of all S groups in the L group have the same relationship, the regrouping mode RGM of the L group is determined to be RGM0. Also, if only the coding mode CM of the first S group of the L group is different from the coding modes CM of the other three S groups, the regrouping mode RGM of the L group is determined as RGM1. Is done.

一方、残差演算器RC(図11の3RC,4RC,3/4RC)は、後段のレジスタPMに保存された選択予測モードに従って、後段のレジスタOriginalに保存された画素値から、各Sグループに対する各画素値の予測値からの残差を計算する。ここで、3RCが3画素の残差演算器、4RCは4画素の残差演算器、3/4RCは3又は4画素の残差演算器を表す。SFL符号化器(SFL符号化部25)は、後段のレジスタCM,Teに保存された各Sグループの符号化モード及びトレーリングビットに基づき、各残差演算器RCが出力する各Sグループの残差を表2に従って符号化し、符号化残差データDを出力する。最後に、コード生成器(コード生成部18)は、画素ブロックの左上コーナーの画素値F,予測モードPM,再グループ化モードRGM,符号化モードCM,符号化残差データD,及びトレーリングビットTを、図8のようにフォーマット化した符号化画素ブロックデータに整形し、先頭に符号化画素ブロックデータのデータ長CDLを付加して、キャッシュ・メモリ6へ出力する。   On the other hand, the residual calculator RC (3RC, 4RC, 3 / 4RC in FIG. 11) performs the operation for each S group from the pixel value stored in the subsequent register Original according to the selection prediction mode stored in the subsequent register PM. The residual from the predicted value of each pixel value is calculated. Here, 3RC represents a residual calculator of 3 pixels, 4RC represents a residual calculator of 4 pixels, and 3 / 4RC represents a residual calculator of 3 or 4 pixels. The SFL encoder (SFL encoder 25) is configured to output each S group output from each residual calculator RC based on the encoding mode and trailing bits of each S group stored in the subsequent registers CM and Te. The residual is encoded according to Table 2 and encoded residual data D is output. Finally, the code generator (code generation unit 18) includes the pixel value F at the upper left corner of the pixel block, the prediction mode PM, the regrouping mode RGM, the encoding mode CM, the encoding residual data D, and the trailing bit. T is shaped into encoded pixel block data formatted as shown in FIG. 8, the data length CDL of the encoded pixel block data is added to the head, and output to the cache memory 6.

図12は、図11のコンプレッサ4のパイプライン処理サイクルのタイミングを表す図である。STAGE1における18個のMグループのDPCM走査と6個のMグループの予測演算走査は、3つのDPCM演算器(DPCM)と1つの平均予測演算器(Avg)により6サイクルで実行される。STAGE1から1サイクル遅れて、STAGE2の再グループ化及び予測モードの決定が6サイクルで実行される。STAGE3の再グループ化モードの決定、残差演算、SFL符号化及びフォーマット化はSTAGE2の完了後に6サイクルで実行される。従って、1つの画素ブロックあたり13サイクルの時間で符号化処理が実行される。また、次の画素ブロックに対する符号化処理は、先の画素ブロックに対するSTAGE1が完了した時点から続けて開始される。従って、次の画素ブロックに対する符号化処理は、先の画素ブロックに対する符号化処理の開始時刻から6サイクル遅れた時点から開始することができる。   FIG. 12 is a diagram illustrating the timing of the pipeline processing cycle of the compressor 4 in FIG. The 18 M-group DPCM scans and the 6 M-group prediction calculation scans in STAGE 1 are executed in six cycles by three DPCM calculators (DPCM) and one average prediction calculator (Avg). Delaying one cycle from STAGE1, the regrouping of STAGE2 and the determination of the prediction mode are performed in six cycles. Determination of the regrouping mode of STAGE3, residual calculation, SFL encoding and formatting are performed in six cycles after completion of STAGE2. Therefore, the encoding process is executed in a time of 13 cycles per pixel block. Also, the encoding process for the next pixel block is continuously started from the point in time when STAGE1 for the previous pixel block is completed. Therefore, the encoding process for the next pixel block can be started from a point of delay of 6 cycles from the start time of the encoding process for the previous pixel block.

(2)デコンプレッサ
図13は、デコンプレッサ5のハードウェア実装例を示す図である。図13に示したデコンプレッサ5は、図10のフローを並列処理化してハードウェア実装したものであり、画素ブロックの復号演算処理をSTAGE1〜STAGE3の3段階に分けて実行し、各ステージを並行して行うことでパイプライン処理を可能としている。STAGE1では、DRAM2から読み出されたフォーマット化された符号化データを、F,PM,RGM,CM,D&Tのそれぞれの部分に分離して前段のレジスタに格納する処理が実行される。STAGE2では、符号化された残差をバレルシフタ(BS)によりMグループに分離した後、さらにそれらを分離して個々の残差に復号する処理が実行される。その間に、D&Tからトレーリングビットが分離され、復号後の残差の符号の決定に使用される。STAGE3では、DPCM予測又は平均予測により各画素の予測値を算出して残差と加えて各画素の画素値が復元される。
(2) Decompressor FIG. 13 is a diagram illustrating a hardware implementation example of the decompressor 5. The decompressor 5 shown in FIG. 13 is a hardware implementation of the flow of FIG. 10 that is processed in parallel. The decoding operation of the pixel block is executed in three stages, STAGE 1 to STAGE 3, and each stage is executed in parallel. By doing so, pipeline processing is possible. In STAGE 1, a process of separating the encoded data read from the DRAM 2 into F, PM, RGM, CM, and D & T parts and storing them in the preceding register is executed. In STAGE 2, after the encoded residuals are separated into M groups by a barrel shifter (BS), a process of further separating them and decoding them into individual residuals is executed. Meanwhile, trailing bits are separated from D & T and used to determine the sign of the residual after decoding. In STAGE 3, the predicted value of each pixel is calculated by DPCM prediction or average prediction, and the pixel value of each pixel is restored in addition to the residual.

DRAM2からキャッシュ・メモリ6に読み出された符号化画素ブロックは、図8に示したフォーマットのデータである。STAGE1においては、このデータを分離する。まず、先頭の画素値F,予測モードPMは固定サイズ(それぞれ、8ビット,2ビット)なので、それぞれのビット長のデータを前段のレジスタF,PMに格納する。それに続く再グループ化モードRGMは、13〜17ビットの間の長さである。Mグループの再グループ化モードは1ビットの固定長なので、バレルシフタBSはそのまま1ビット読み出して前段のレジスタRGMに格納する。一方、Lグループの再グループ化モードは3ビット又は4ビットの可変長なので、以下の(i)(ii)の読み出し動作をLグループの個数分(4回)だけ反復して実行する。
(i)まずバレルシフタBSは3ビット読み出して読み出したビットがRG0(“000”)であればこの3ビットに0を付加した4ビット(“0000”)を前段のレジスタRGMに格納する。
(ii)読み出したビットがRG0(“000”)以外であれば、バレルシフタBSはさらに1ビットを読み出し、この4ビットを前段のレジスタRGMに格納する。
The encoded pixel block read from the DRAM 2 to the cache memory 6 is data in the format shown in FIG. In STAGE 1, this data is separated. First, since the first pixel value F and the prediction mode PM are fixed sizes (respectively 8 bits and 2 bits, respectively), data of each bit length is stored in the registers F and PM in the previous stage. The subsequent regrouping mode RGM is between 13 and 17 bits long. Since the regrouping mode of the M group has a fixed length of 1 bit, the barrel shifter BS reads 1 bit as it is and stores it in the register RGM in the previous stage. On the other hand, since the regrouping mode of the L group is a variable length of 3 bits or 4 bits, the following read operations (i) and (ii) are repeatedly executed by the number of L groups (4 times).
(I) First, the barrel shifter BS reads 3 bits, and if the read bit is RG0 (“000”), 4 bits (“0000”) obtained by adding 0 to the 3 bits are stored in the preceding register RGM.
(Ii) If the read bit is other than RG0 (“000”), the barrel shifter BS reads 1 bit, and stores these 4 bits in the register RGM in the preceding stage.

上記再グループ化モードRGMの読み出しから1サイクル遅れて並行して、各グループの符号化モードCMの読み出しが行われる。1つの符号化モードCMは固定長(3ビット)であるが、再グループ化モードによって符号化モードCMの個数が異なる。従って、まず1つのMグループ又はLグループの再グループ化モードRGMの読み出しが行われた後、IRGは、その再グループ化モードRGMに応じて所定数の符号化モードCMの読み出しを行う。読み出された符号化モードCMのビット数は、Mブロックが3,6ビット、Lブロックが3,6,9,12ビットである。後段の処理のため、IRGは、図3の再グループ化モードRGMに従って、当該Mグループ又はLグループ内のSグループ毎に符号化モードCMを割り当て、各Mグループ又はLグループに対し18ビットの固定長データとして前段のレジスタCMに格納する。   The encoding mode CM of each group is read in parallel with a delay of one cycle from the reading of the regrouping mode RGM. One encoding mode CM has a fixed length (3 bits), but the number of encoding modes CM differs depending on the regrouping mode. Therefore, after first reading out the regrouping mode RGM of one M group or L group, the IRG reads out a predetermined number of encoding modes CM according to the regrouping mode RGM. The number of bits of the read coding mode CM is 3, 6 bits for the M block and 3, 6, 9, 12 bits for the L block. For subsequent processing, the IRG assigns a coding mode CM to each S group in the M group or L group in accordance with the regrouping mode RGM in FIG. 3 and fixes 18 bits to each M group or L group. It is stored in the previous register CM as long data.

上記符号化モードCMの読み出しの後、符号化残差データD,及びトレーリングビットTの読み出しが行われる。符号化画素ブロックの長さは先頭のデータ長CDL(Cdata length)で指定されているため、読み出すデータの長さは定まる。読み出したデータは前段のレジスタD&Tに格納する。   After reading out the encoding mode CM, the encoding residual data D and the trailing bit T are read out. Since the length of the encoded pixel block is specified by the head data length CDL (Cdata length), the length of the data to be read is determined. The read data is stored in the previous register D & T.

STAGE2においては、符号化残差データDを復号し残差データを復元する処理が行われる。前段のレジスタD&Tに格納されたデータの内、符号化残差データDの全ビット数は、前段のレジスタCMに格納されている各Sグループの符号化モードCMから計算することができる。従って、符号化残差データDの全ビット数分だけシフトしたアドレスがトレーリングビットTの先頭位置である。図13のSTAGE2の左側のバレルシフタBSは、当該Sグループの符号化モードCMから決定される符号化残差データDのビット長に従って、各Sグループの符号化残差データDを順次読み出す。各Sグループにおいて読み出された符号化残差データDの中に、先頭1ビットが‘1’それ以外が‘0’のデータが存在した場合(すなわち、1つのSグループの符号化残差データDの中に、−2M−1又は2M−1の値(Mは符号化モードCM)の符号化残差が存在した場合)(表2参照)、図13のSTAGE2の右側のバレルシフタBSが1ビットのトレーリングビットTを読み出し、レジスタTに格納する。読み出されたSグループ内の符号化残差データDは、残差復号器SS&TCにより、トレーリングビットTを参照して、表2の符号テーブルに従い元の残差データに復元される。 In STAGE 2, a process of decoding the encoded residual data D and restoring the residual data is performed. Of the data stored in the preceding register D & T, the total number of bits of the encoded residual data D can be calculated from the encoding mode CM of each S group stored in the preceding register CM. Therefore, the address shifted by the total number of bits of the encoded residual data D is the leading position of the trailing bit T. The barrel shifter BS on the left side of STAGE 2 in FIG. 13 sequentially reads the encoding residual data D of each S group according to the bit length of the encoding residual data D determined from the encoding mode CM of the S group. In the encoded residual data D read out in each S group, there is data in which the first 1 bit is “1” and the other is “0” (that is, encoded residual data of one S group) D in the case where there is an encoding residual of −2 M−1 or 2 M−1 (M is an encoding mode CM) (see Table 2), barrel shifter BS on the right side of STAGE 2 in FIG. Reads one trailing bit T and stores it in register T. The read encoded residual data D in the S group is restored to the original residual data according to the code table of Table 2 by referring to the trailing bit T by the residual decoder SS & TC.

(例1)Sグループの符号化モードCMがM=4,符号化残差データがD={0010,0000,1100}のとき、Dの中に符号化残差1000(8又は−8)が存在しないためトレーリングビットTの読み出しは行われない。この場合、残差データは表2よりr={2,0,−4}に復元される。   (Example 1) When the encoding mode CM of the S group is M = 4 and the encoding residual data is D = {0010, 0000, 1100}, the encoding residual 1000 (8 or -8) is included in D. The trailing bit T is not read because it does not exist. In this case, the residual data is restored to r = {2, 0, −4} from Table 2.

(例2)Sグループの符号化モードCMがM=4,符号化残差データがD={1000,0000,1100}のとき、Dの中に符号化残差1000(8又は−8)が存在するのでトレーリングビットTが読み出される。読み出されたトレーリングビットTがT=0であれば、符号化残差1000は残差8を表すことになるので、当該Sグループの各残差データは表2よりr={8,0,−4}に復元される。一方、読み出されたトレーリングビットTがT=1であれば、符号化残差1000は残差−8を表すことになるので、当該Sグループの各残差データは表2よりr={−8,0,−4}に復元される。   (Example 2) When the encoding mode CM of the S group is M = 4 and the encoding residual data is D = {1000,0000,1100}, the encoding residual 1000 (8 or -8) is included in D. Since it exists, the trailing bit T is read out. If the trailing bit T read out is T = 0, the encoding residual 1000 represents the residual 8. Therefore, each residual data of the S group is represented by r = {8, 0 from Table 2. , −4}. On the other hand, if the trailing bit T read out is T = 1, the encoding residual 1000 represents the residual −8, so that each residual data of the S group is represented by r = { Restored to -8, 0, -4}.

(例3)Sグループの符号化モードCMがM=5,符号化残差データがD={01000,00000,11000}のとき、Dの中に符号化残差10000(16又は−16)が存在しないためトレーリングビットTの読み出しは行われない。この場合、残差データは表2よりr={8,0,−8}に復元される。   (Example 3) When the encoding mode CM of the S group is M = 5 and the encoding residual data is D = {01000,00000,11000}, the encoding residual 10000 (16 or -16) is included in D. The trailing bit T is not read because it does not exist. In this case, the residual data is restored to r = {8, 0, −8} from Table 2.

復元された残差データは後段のレジスタd0〜d2に格納される。また、パイプライン処理を行うため、前段のレジスタPMの値は後段のレジスタPMに複写される。   The restored residual data is stored in the subsequent registers d0 to d2. Further, in order to perform pipeline processing, the value of the register PM at the previous stage is copied to the register PM at the subsequent stage.

STAGE3においては、DPCM復号器(Inv.DPCM)により、後段のレジスタPMに格納された予測モードPM及び前段のレジスタFに格納された左上コーナーの画素の画素値Fから、各画素の予測値が算出され、これにレジスタd0〜d2に格納された残差を加算して元の画素値が復元される。復元された画素値は、記録器(Recording)によってラスタ走査順に整列して最終段のレジスタ(8*8 samples)に書き込まれる。画素ブロック全体が復元された時点で、画素ブロックのデータは最終段のレジスタ(8*8 samples)からコーディック・コア1へ出力される。   In STAGE 3, the prediction value of each pixel is calculated from the prediction mode PM stored in the subsequent register PM and the pixel value F of the upper left corner pixel stored in the previous register F by the DPCM decoder (Inv.DPCM). The original pixel value is restored by adding the residuals calculated and added to the registers d0 to d2. The restored pixel values are arranged in the raster scan order by the recorder (Recording) and written to the final stage register (8 * 8 samples). When the entire pixel block is restored, the pixel block data is output to the codec core 1 from the final stage register (8 * 8 samples).

図14は、図13のデコンプレッサ5のパイプライン処理サイクルのタイミングを表す図である。1画素ブロックあたり、1つのSTAGEは3サイクルで実行され、STAGE2はSTAGE1から1サイクル遅れて実行され、STAGE3はSTAGE2から1サイクル遅れて実行される。   FIG. 14 is a diagram illustrating the timing of the pipeline processing cycle of the decompressor 5 of FIG. One STAGE is executed in three cycles per pixel block, STAGE2 is executed with a delay of one cycle from STAGE1, and STAGE3 is executed with a delay of one cycle from STAGE2.

実施例1では、8×8画素の画素ブロックに対して本発明を適用した例を示したが、実施例2では、8×8画素以上の画素ブロックに本発明の適用を拡張する一例として、16×16画素の画素ブロックに対して本発明を適用した例を示す。   In the first embodiment, an example in which the present invention is applied to a pixel block of 8 × 8 pixels is shown. In the second embodiment, as an example of extending the application of the present invention to a pixel block having 8 × 8 pixels or more, An example in which the present invention is applied to a pixel block of 16 × 16 pixels will be shown.

図15は、16×16画素ブロックに対するMDAスキームにおいて使用する予測モード及びグループ分割を表す図である。図15(a),(b),(c),(d)は、それぞれ予測モードPMode0,PMode1,PMode2,PMode3を表している。図1の場合と比較して、1つのMグループ内の画素数が7画素から15画素に増加し、Lグループの数が増加したことを除き、基本的には図1の場合と同様である。   FIG. 15 is a diagram illustrating a prediction mode and group division used in the MDA scheme for a 16 × 16 pixel block. FIGS. 15A, 15B, 15C, and 15D represent prediction modes PMode0, PMode1, PMode2, and PMode3, respectively. Compared to the case of FIG. 1, the number of pixels in one M group is increased from 7 pixels to 15 pixels and the number of L groups is increased. .

図15において、第0行第0列のコーナー画素が起点画素である。起点画素を除く画素ブロック内の画素を(n−1)個(n=16)の縦列画素のグループであるMグループに区画する。PMode0では、画素ブロックの第0行の第1〜(n−1)列目の縦列画素からなるMグループ、及び第(n−1)列の第1〜(n−1)行目の縦列画素からなるMグループに水平コピー予測、第1〜(n−1)行の偶数列の縦列画素からなる各Mグループに垂直コピー予測、第(n−1)列を除く第1〜(n−1)行の奇数列の縦列画素からなる各Mグループに水平平均予測の予測方式を割り当てる。PMode1は、PMode0の転置である。PMode2では、第0列の第1〜(n−1)行目の縦列画素からなるMグループに垂直コピー予測、第1〜(n−1)列の各行の縦列画素からなる各Mグループに水平コピー予測の予測方式を割り当てる。PMode3は、PMode2の転置である。   In FIG. 15, the corner pixel in the 0th row and the 0th column is the starting pixel. The pixels in the pixel block excluding the starting pixel are partitioned into M groups, which are groups of (n−1) (n = 16) column pixels. In PMode0, the M group including the first to (n-1) th column pixels in the 0th row of the pixel block, and the first to (n-1) th column pixels in the (n-1) th column. Horizontal copy prediction for the M group consisting of, vertical copy prediction for each M group of even-numbered column pixels of the first to (n-1) th rows, and the first to (n-1) excluding the (n-1) th column. ) A prediction method of horizontal average prediction is assigned to each M group of odd-numbered columns of rows. PMode1 is a transpose of PMode0. In PMode2, vertical copy prediction is performed on the M group including the first to (n-1) th column pixels in the 0th column, and the M group including the column pixels on each of the first to (n-1) th columns is horizontal. Assign a prediction method for copy prediction. PMode3 is a transpose of PMode2.

Lグループについては、図15のように8つのLグループにグループ化する方法の他に、図15の8つのLグループを更に上下に2分して16つのLグループにグループ化する方法も考えられる。何れを採用することもできる。   For the L group, in addition to the method of grouping into eight L groups as shown in FIG. 15, a method of grouping the eight L groups of FIG. . Any of them can be adopted.

図16は、PMode0において、16×16画素の1つの予測ブロックの残差をSグループにグループ化する例を示す図である。図16(a)は、7画素又は8画素のSグループにグループ化した例である。この場合、画素数及びLグループの数が増加した点を除き、図2(b)と同様であるため、残差の再グループ化及び残差のSFL符号化は、実施例1と全く同様にして実行することができる。図16(b)は、3画素又は4画素のSグループにグループ化した例である。この場合、1つのLグループ内のSグループの数を実施例1の場合と同じ4つとすれば、Lグループの数は実施例1の場合の4倍となるが、再グループ化及び残差のSFL符号化は、実施例1と全く同様に実行することができる。一方、1つのLグループ内のSグループの数を8つとすれば、再グループ化モードの数は15×15=225となり、再グループ化モードを表すために8ビットの符号が必要である。   FIG. 16 is a diagram illustrating an example of grouping residuals of one prediction block of 16 × 16 pixels into S groups in PMode0. FIG. 16A shows an example of grouping into an S group of 7 pixels or 8 pixels. In this case, except for the increase in the number of pixels and the number of L groups, the process is the same as in FIG. 2B. Can be executed. FIG. 16B shows an example of grouping into S groups of 3 pixels or 4 pixels. In this case, if the number of S groups in one L group is set to four, which is the same as in the first embodiment, the number of L groups is four times that in the first embodiment. SFL encoding can be executed in the same manner as in the first embodiment. On the other hand, if the number of S groups in one L group is 8, the number of regrouping modes is 15 × 15 = 225, and an 8-bit code is necessary to represent the regrouping mode.

実施例3では、実施例1の場合(8×8画素の画素ブロックに対して本発明を適用した場合)において、Sグループのグループ化の他の例について説明する。   In the third embodiment, another example of grouping of S groups in the case of the first embodiment (when the present invention is applied to an 8 × 8 pixel pixel block) will be described.

図17は、PMode0において、8×8画素の1つの予測ブロックの残差をSグループにグループ化する場合の他の例を示す図である。図17(a)は、図2(b)に示したSグループのうち、第1〜7行目の16個のSグループうち、上段のSグループの画素数を4画素に、下段のSグループの画素数を3画素に変更したにすぎない。従って、実施例1で説明した残差の再グループ化及び残差のSFL符号化の手法をそのまま適用することができる。図17(b)(c)は、異なる予測方法の画素に跨ってSグループを設定した場合の例を表している。この場合、Lグループの取り方も、図17(b)(c)に示したように、実施例1の場合とは異なってくる。しかし、再グループ化及び残差のSFL符号化の手法については、実施例1と同様に行うことができる。   FIG. 17 is a diagram illustrating another example in which the residuals of one prediction block of 8 × 8 pixels are grouped into S groups in PMode0. FIG. 17A shows the S group in the upper row of four S pixels in the first row to the seventh row among the S groups shown in FIG. The number of pixels is simply changed to 3 pixels. Therefore, the residual regrouping and residual SFL encoding methods described in the first embodiment can be applied as they are. FIGS. 17B and 17C show examples in which the S group is set across pixels of different prediction methods. In this case, as shown in FIGS. 17B and 17C, the method of taking the L group is also different from that in the first embodiment. However, regrouping and residual SFL encoding can be performed in the same manner as in the first embodiment.

1 コーディック・コア
2 DRAM
3 DRAMインタフェース部
4 コンプレッサ
5 デコンプレッサ
6 キャッシュ・メモリ
7 DRAMコントローラ
11 予測モードテーブル
12 残差メモリ
13 残差演算部
14 フレーム入力部
15 ブロック分割部
16 MDA予測部
17 予測モード選定部
18 コード生成部
19 残差符号化部
20 出力部
21 グルーピングテーブル
22 スモール・グループ分割部
23 CM&T決定部
24 再グルーピング部
25 SFL符号化部
30 予測モードテーブル
31 グルーピングテーブル
32 入力部
33 予測値復号部
34 残差復号部
35 フレーム復元部
36 出力部
1 Cordic core 2 DRAM
DESCRIPTION OF SYMBOLS 3 DRAM interface part 4 Compressor 5 Decompressor 6 Cache memory 7 DRAM controller 11 Prediction mode table 12 Residual memory 13 Residual calculation part 14 Frame input part 15 Block division part 16 MDA prediction part 17 Prediction mode selection part 18 Code generation part DESCRIPTION OF SYMBOLS 19 Residual encoding part 20 Output part 21 Grouping table 22 Small group division part 23 CM & T determination part 24 Regrouping part 25 SFL encoding part 30 Prediction mode table 31 Grouping table 32 Input part 33 Predictive value decoding part 34 Residual decoding Part 35 frame restoration part 36 output part

Claims (6)

画像フレームのフレームデータを圧縮するコンプレッサであって、
入力されたフレームデータを所定サイズの画素ブロックに分割するブロック分割手段と、
前記画素ブロックの何れか一のコーナーの起点画素を除く前記画素ブロック内の各画素に対し、何れかの一の隣接画素のコピー予測及び何れか二の隣接画素の平均予測の組み合わせから構成される予測モードを複数用意し、前記各予測モードにより前記画素ブロック内の各画素の予測値を算出する画素値予測手段と、
前記画素ブロック内の各画素に対し、当該画素の画素値から当該画素の前記予測値を引いた残差を算出する残差演算手段と、
前記画素ブロック内の各画素の前記残差を符号化する残差符号化手段と、
前記各予測モードに対して、前記残差符号化手段により符号化された前記画素ブロックの残差のビットサイズを算出し、符号化された前記画素ブロックの残差のビットサイズが最小となる前記予測モードを選択予測モードに選定する予測モード選定手段と、
前記起点画素の画素値、前記選定予測モードの情報、及び前記選定予測モードで算出され符号化された前記画素ブロックの残差情報、を含む前記画素ブロックの情報を、所定のフォーマットにより形式化した符号化フレームデータを生成する符号コード生成手段と、
を備えたコンプレッサ。
A compressor for compressing frame data of an image frame,
Block dividing means for dividing the input frame data into pixel blocks of a predetermined size;
Consists of a combination of copy prediction of any one adjacent pixel and average prediction of any two adjacent pixels for each pixel in the pixel block excluding the starting pixel at any one corner of the pixel block A plurality of prediction modes, and a pixel value prediction means for calculating a prediction value of each pixel in the pixel block according to each prediction mode;
For each pixel in the pixel block, residual calculation means for calculating a residual obtained by subtracting the predicted value of the pixel from the pixel value of the pixel;
Residual encoding means for encoding the residual of each pixel in the pixel block;
For each prediction mode, the residual bit size of the pixel block encoded by the residual encoding means is calculated, and the encoded residual bit block size of the pixel block is minimized. A prediction mode selection means for selecting the prediction mode as the selected prediction mode;
The information of the pixel block including the pixel value of the starting pixel, the information of the selected prediction mode, and the residual information of the pixel block calculated and encoded in the selected prediction mode is formalized in a predetermined format. Code code generating means for generating encoded frame data;
Compressor with
前記ブロック分割手段は、前記フレームデータをn×nサイズ(nは8以上の偶数)の画素ブロックに分割するものであり、
前記画素値予測手段は、第0行第0列のコーナーの画素を前記起点画素とし、前記起点画素を除く前記画素ブロック内の画素を(n−1)個の縦列画素のグループであるMグループに区画するものであり、前記画素値予測手段が予測値を算出する際の前記予測モードは、少なくとも、
(a)前記画素ブロックの第0行の第1〜(n−1)列目の縦列画素からなるMグループ、及び第(n−1)列の第1〜(n−1)行目の縦列画素からなるMグループに水平コピー予測、第1〜(n−1)行の偶数列の縦列画素からなる各Mグループに垂直コピー予測、第(n−1)列を除く第1〜(n−1)行の奇数列の縦列画素からなる各Mグループに水平平均予測の予測方式を割り当てる予測モード0、
(b)前記予測モード0の転置である予測モード1、
(c)第0列の第1〜(n−1)行目の縦列画素からなるMグループに垂直コピー予測、第1〜(n−1)列の各行の縦列画素からなる各Mグループに水平コピー予測の予測方式を割り当てる予測モード2、
(d)前記予測モード2の転置である予測モード3、
の4つの予測モードを含むものであることを特徴とする請求項1記載のコンプレッサ。
The block dividing means divides the frame data into pixel blocks of n × n size (n is an even number of 8 or more),
The pixel value predicting means uses the pixel at the corner of the 0th row and the 0th column as the starting pixel, and the pixels in the pixel block excluding the starting pixel as a group of (n−1) vertical pixels. And the prediction mode when the pixel value prediction means calculates the predicted value is at least:
(A) M group consisting of column pixels in the first to (n-1) th columns in the 0th row of the pixel block, and columns in the first to (n-1) th rows in the (n-1) th column. Horizontal copy prediction for the M group of pixels, vertical copy prediction for each M group of even-numbered columns of pixels in the first to (n-1) th rows, and the first to (n-) except for the (n-1) th column. 1) Prediction mode 0 in which a prediction method of horizontal average prediction is assigned to each M group of odd-numbered column pixels in a row.
(B) Prediction mode 1, which is a transpose of the prediction mode 0,
(C) Vertical copy prediction for the M group consisting of column pixels in the 1st to (n-1) th rows of the 0th column, and horizontal to each M group consisting of column pixels in each row of the 1st to (n-1) th columns. Prediction mode 2 for assigning a prediction method for copy prediction,
(D) Prediction mode 3, which is a transpose of the prediction mode 2,
The compressor according to claim 1, wherein the compressor includes four prediction modes.
前記残差符号化手段は、
前記画素ブロック内の各画素の前記残差を、前記画素値予測手段による画素値の予測方式が同じでかつ互いに画素が隣接する所定サイズのSグループに分割するSグループ分割手段と、
前記各Sグループについて、当該Sグループに属する各残差の最大値の絶対値及び最小値の絶対値を算出し、前記最大値の絶対値及び最小値の絶対値により当該Sグループの符号化モードを決定する符号化モード決定手段と、
前記各予測モードに対し、前記画素ブロックを所定サイズの複数のLグループとその半分のサイズの1つのMグループとに区画するとともに、前記各Lグループ又はMグループにおいて、当該Lグループ又はMグループに属する前記Sグループのうち前記符号化モードが同じものを結合することにより再グループ化を行い、前記各Lグループ又はMグループに対し、再グループ化後のグループパターンに応じた再グループ化モードを決定する再グループ化手段と、
前記再グループ化手段により再編された各グループの残差を、前記符号化モードに応じて予め決められた符号化テーブルに基づき符号化するSFL符号化手段と、を備え、
前記符号コード生成手段は、前記起点画素の画素値、前記選定予測モードの情報、前記各Lグループ又はMグループの前記再グループ化モード、及び前記選定予測モードで算出され符号化された前記画素ブロックの残差情報、を含む前記画素ブロックの情報を、所定のフォーマットにより形式化するものであることを特徴とする請求項2記載のコンプレッサ。
The residual encoding means includes
S group dividing means for dividing the residual of each pixel in the pixel block into S groups of a predetermined size that have the same pixel value prediction method by the pixel value prediction means and in which pixels are adjacent to each other;
For each S group, the absolute value of the maximum value and the minimum value of each residual belonging to the S group are calculated, and the encoding mode of the S group is calculated based on the absolute value of the maximum value and the absolute value of the minimum value. Encoding mode determining means for determining
For each of the prediction modes, the pixel block is partitioned into a plurality of L groups having a predetermined size and one M group having a half size, and each L group or M group is divided into the L group or M group. Regrouping is performed by combining the S groups belonging to the same encoding mode, and a regrouping mode is determined for each L group or M group according to the group pattern after regrouping Regrouping means to
SFL encoding means for encoding the residual of each group reorganized by the regrouping means based on a predetermined encoding table according to the encoding mode,
The code code generation means includes the pixel value of the origin pixel, the information of the selected prediction mode, the regrouping mode of each L group or M group, and the pixel block calculated and encoded in the selected prediction mode 3. The compressor according to claim 2, wherein the pixel block information including the residual information is formalized in a predetermined format.
前記Sグループ分割手段は、各予測モードに対して、前記Mグループを(n/2)画素及び(n/2−1)画素の2つのグループに区画してなるSグループに分割するものであり、
前記再グループ化手段は、
予測モード0に対しては、奇数列のMグループを、2つのMグループからなるMグループペアに分割して前記各Mグループペアを1つのLグループとし、偶数列のMグループを、2つのMグループからなるMグループペアに分割して前記各Mグループペアを1つのLグループとすることによって、前記各Lグループを形成し、
予測モード2に対しては、第1〜(n−1)列の各行のMグループを、互いに隣接する2つのMグループからなるMグループペアに分割して前記各Mグループペアを1つのLグループとすることによって、前記各Lグループを形成することを特徴とする請求項3記載のコンプレッサ。
The S group dividing means divides the M group into S groups that are divided into two groups of (n / 2) pixels and (n / 2-1) pixels for each prediction mode. ,
The regrouping means includes
For the prediction mode 0, the odd-numbered M group is divided into M group pairs composed of two M groups, and each M group pair is defined as one L group, and the even-numbered M group is defined as two M groups. Each L group is formed by dividing each M group pair into one L group by dividing into M group pairs consisting of groups,
For prediction mode 2, the M groups in each row of the first to (n-1) th columns are divided into M group pairs composed of two adjacent M groups, and each M group pair is divided into one L group. The compressor according to claim 3, wherein the L groups are formed.
請求項1乃至4の何れか一に記載のコンプレッサにより符号化された前記符号化フレームデータから前記フレームデータを復元するデコンプレッサであって、
前記基点画素から順に走査する走査手段と、
前記走査手段の走査により順次指定される画素について、前記符号化フレームデータに含まれる前記起点画素の画素値又は前記選定予測モード若しくは既に算出済みの隣接画素の画素値に基づき、当該画素の画素値の予測値を算出する予測値復号手段と、
前記予測値復号手段が算出する当該画素の予測値と、前記符号化フレームデータに含まれる当該画素の残差情報とに基づき、当該画素の画素値を算出する残差復号手段と、
を備えたデコンプレッサ。
A decompressor for restoring the frame data from the encoded frame data encoded by the compressor according to any one of claims 1 to 4,
Scanning means for sequentially scanning from the base pixel;
For the pixels sequentially designated by the scanning of the scanning means, the pixel value of the pixel based on the pixel value of the starting pixel included in the encoded frame data or the pixel value of the selected prediction mode or the already calculated adjacent pixel Prediction value decoding means for calculating a prediction value of
Residual decoding means for calculating a pixel value of the pixel based on the predicted value of the pixel calculated by the predicted value decoding means and residual information of the pixel included in the encoded frame data;
Decompressor with
動画像を所定のコーディック方式により符号化又は復号するコーディック・コアと、
前記コーディック・コアが符号化又は復号演算の際に使用するフレームデータを一時的に記憶するフレームメモリと、を備えた画像処理装置であって、
前記コーディック・コアと前記フレームメモリとの間に介設され、前記コーディック・コアが出力するフレームデータを圧縮して符号化フレームデータを前記フレームメモリに対し保存するとともに、前記コーディック・コアからフレームデータの読出要求があると前記符号化フレームデータを前記フレームメモリから読み出して前記フレームデータに復号し、前記コーディック・コアへ出力するメモリインタフェースを備え、
前記メモリインタフェースは、
前記フレームデータを前記符号化フレームデータに圧縮する、請求項1乃至4の何れか一記載のコンプレッサと、
前記符号化フレームデータを前記フレームデータに復号する、請求項5記載のデコンプレッサと、
を備えていることを特徴とする画像処理装置。
A codec core that encodes or decodes a moving image according to a predetermined codec method;
A frame memory that temporarily stores frame data used by the codec core for encoding or decoding operations, and an image processing apparatus comprising:
It is interposed between the codec core and the frame memory, compresses the frame data output from the codec core and stores the encoded frame data in the frame memory, and transmits the frame data from the codec core. A memory interface that reads out the encoded frame data from the frame memory and decodes it into the frame data when output is requested, and outputs the frame data to the codec core;
The memory interface is
The compressor according to any one of claims 1 to 4, wherein the frame data is compressed into the encoded frame data.
The decompressor according to claim 5, wherein the encoded frame data is decoded into the frame data.
An image processing apparatus comprising:
JP2013130507A 2013-06-21 2013-06-21 Compressor, decompressor and image processing apparatus Pending JP2015005903A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013130507A JP2015005903A (en) 2013-06-21 2013-06-21 Compressor, decompressor and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013130507A JP2015005903A (en) 2013-06-21 2013-06-21 Compressor, decompressor and image processing apparatus

Publications (1)

Publication Number Publication Date
JP2015005903A true JP2015005903A (en) 2015-01-08

Family

ID=52301454

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013130507A Pending JP2015005903A (en) 2013-06-21 2013-06-21 Compressor, decompressor and image processing apparatus

Country Status (1)

Country Link
JP (1) JP2015005903A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866519A (en) * 2019-04-30 2020-10-30 上海富瀚微电子股份有限公司 Coding method
WO2024022356A1 (en) * 2022-07-26 2024-02-01 杭州海康威视数字技术股份有限公司 Encoding and decoding method, apparatus and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866519A (en) * 2019-04-30 2020-10-30 上海富瀚微电子股份有限公司 Coding method
WO2024022356A1 (en) * 2022-07-26 2024-02-01 杭州海康威视数字技术股份有限公司 Encoding and decoding method, apparatus and device

Similar Documents

Publication Publication Date Title
CN110024392B (en) Low complexity symbol prediction for video coding
WO2020253831A1 (en) Method and device for coding and decoding, and storage medium
JP6023095B2 (en) Image encoding and decoding method, encoding and decoding device, and computer program corresponding thereto
Guo et al. A new reference frame recompression algorithm and its VLSI architecture for UHDTV video codec
CN103931197A (en) Method of determining binary codewords for transform coefficients
CN103918273A (en) Method of determining binary codewords for transform coefficients
CN109936742B (en) Method for encoding a video sequence, encoding device and storage medium
US20180199058A1 (en) Video encoding and decoding method and device
JP7448558B2 (en) Methods and devices for image encoding and decoding
US10659785B2 (en) Apparatus, system and method of video compression using smart coding tree unit scanning and corresponding computer program and medium
RU2624464C1 (en) Scan orders for non-conversion encoding
US20110103469A1 (en) Entropy encoding/decoding method and apparatus for accelerating video decoding
Li et al. Lossless image compression algorithm and hardware architecture for bandwidth reduction of external memory
JP2015005903A (en) Compressor, decompressor and image processing apparatus
CN110035288B (en) Method for encoding a video sequence, encoding device and storage medium
JP7093152B2 (en) Encoding device, decoding device and program
KR101688085B1 (en) Video coding method for fast intra prediction and apparatus thereof
CN106686380B (en) Enhanced data processing apparatus employing multi-block based pipeline and method of operation
WO2019067907A1 (en) Method and apparatus for encoding a picture block
JP2014187473A (en) Image compression device and image processing system
JP2023024721A (en) Coding device, decoding device, and program
WO2022191947A1 (en) State based dependent quantization and residual coding in video coding
Lian et al. Pixel-grain prediction and K-order UEG-rice entropy coding oriented lossless frame memory compression for motion estimation in HEVC
JP2018157571A (en) Scanning orders for non-transform coding