[go: up one dir, main page]

JP2006324944A - Encoder - Google Patents

Encoder Download PDF

Info

Publication number
JP2006324944A
JP2006324944A JP2005146211A JP2005146211A JP2006324944A JP 2006324944 A JP2006324944 A JP 2006324944A JP 2005146211 A JP2005146211 A JP 2005146211A JP 2005146211 A JP2005146211 A JP 2005146211A JP 2006324944 A JP2006324944 A JP 2006324944A
Authority
JP
Japan
Prior art keywords
encoding
data
predetermined number
search result
bits
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
JP2005146211A
Other languages
Japanese (ja)
Inventor
Tetsushi Koide
哲士 小出
Hansjuergen Matthew
ハンスユルゲン マタウシュ
Takeshi Kumaki
武志 熊木
Yasuto Kuroda
泰斗 黒田
Hideyuki Noda
英行 野田
Katsumi Dosaka
勝己 堂阪
Kazutami Arimoto
和民 有本
Kazunori Saito
和則 齊藤
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.)
Renesas Technology Corp
Hiroshima University NUC
Original Assignee
Renesas Technology Corp
Hiroshima University NUC
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 Renesas Technology Corp, Hiroshima University NUC filed Critical Renesas Technology Corp
Priority to JP2005146211A priority Critical patent/JP2006324944A/en
Publication of JP2006324944A publication Critical patent/JP2006324944A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

【課題】符号化処理の高速化を達成するとともに、高い圧縮効率を維持することのできるハフマン符号化に適した符号化装置を得る。
【解決手段】 テーブル作成部2は、生起確率算出回路21及び最大値検出/符号割り当てモジュール22を有し、符号化処理部1による符号化テーブル13a,あるいは13bを用いた符号化処理と並行して、更新用符号化テーブルを作成する。生起確率算出回路21は、符号化処理部1のCAM11より提供される符号化処理情報S1aに基づき、符号データ毎に出現回数をカウントすることにより、最新の符号化前データD0に関する生起確率算出処理を行う。さらに、テーブル作成部2は、圧縮効率があらかじめ設定したしきい値を下回った場合に、符号化テーブル13a,13b間における使用対象符号化テーブルと更新用符号化テーブルとの交換処理制御を行う。
【選択図】図2
An encoding apparatus suitable for Huffman encoding capable of achieving high-speed encoding processing and maintaining high compression efficiency is provided.
A table creation unit (2) includes an occurrence probability calculation circuit (21) and a maximum value detection / code allocation module (22), and is performed in parallel with an encoding process using an encoding table (13a) or (13b) by an encoding processing unit (1). Thus, an update coding table is created. The occurrence probability calculation circuit 21 counts the number of appearances for each piece of code data based on the encoding process information S1a provided from the CAM 11 of the encoding processing unit 1, thereby generating the occurrence probability for the latest pre-encoding data D0. I do. Furthermore, when the compression efficiency falls below a preset threshold value, the table creation unit 2 controls exchange processing between the encoding table to be used and the update encoding table between the encoding tables 13a and 13b.
[Selection] Figure 2

Description

ハフマン符号化は,データ圧縮で主流となっている方式の一つであり、音声、画像及び動画等のマルチメディアにおいてISOにより標準化されているJPEGやMPEG、ファイル圧縮形式の標準となっているZIP及びLHA等、ソフトウェアやハードウェアで幅広く実装されている効果的なロスレス圧縮手法である。   Huffman coding is one of the mainstream methods for data compression, and JPEG and MPEG standardized by ISO for multimedia such as audio, image and video, and ZIP which is the standard for file compression format. It is an effective lossless compression method widely implemented in software and hardware such as LHA.

具体的には、JPEGやMPEGにおいて、画素の冗長なデータを削除した後に総データ量を圧縮するのに用いられ、LHAではデータ内に存在する同様の文字列を圧縮するのにハフマン符号化が用いられている。ハフマン符号化処理を行うハフマン符号化器及び画像処理装置として、例えば特許文献1に開示された符号化装置、特許文献2に開示された画像処理装置がある。   Specifically, in JPEG and MPEG, it is used to compress the total amount of data after deleting redundant data of pixels. In LHA, Huffman coding is used to compress similar character strings existing in data. It is used. As a Huffman encoder and an image processing apparatus that perform Huffman encoding processing, for example, there are an encoding apparatus disclosed in Patent Document 1 and an image processing apparatus disclosed in Patent Document 2.

特開平8−51370号公報JP-A-8-51370 特開2005−12495号公報JP 2005-12495 A

一般的なハフマン符号化のアルゴリズムは、符号化に用いる出現頻度表(符号化テーブル)を作成する必要があるため、圧縮前に一度全符号化前データを走査する必要があり、その後圧縮を行う仕組みになっている。そのためオンラインでの圧縮が難しい。   In general Huffman coding algorithm, it is necessary to create an appearance frequency table (coding table) used for coding. Therefore, it is necessary to scan all pre-coding data once before compression, and then perform compression. It is structured. Therefore, online compression is difficult.

また、出現頻度を調べる処理を省くために既存の符号化テーブルを用いる方法やアルゴリズムの改良でその都度非符号化データと符号化したデータを混在して送る方法も提案されている。しかしながら、これらの方法は、前者の場合、既存の符号化テーブルが存在しないときには圧縮が不可能であり、後者の場合には圧縮効率(符号化前データに対する符号化後データのデータ量の比)が悪化し、実装が複雑になる等の問題がある。そのためハフマン符号化を様々なアプリケーションに適用したり、コンパクトに実装することが困難であるという問題点がある。以下、これらの問題点について詳述する。   In order to omit the process of checking the appearance frequency, a method using an existing coding table and a method of sending a mixture of uncoded data and coded data each time by improving the algorithm have been proposed. However, in these methods, in the former case, compression is not possible when there is no existing coding table, and in the latter case, compression efficiency (ratio of data amount of post-encoding data to pre-encoding data). There are problems such as worsening and complicated implementation. Therefore, there is a problem that it is difficult to apply Huffman coding to various applications or to implement it in a compact manner. Hereinafter, these problems will be described in detail.

(静的ハフマン符号化方式の問題点)
静的ハフマン符号化は最も広く実装されている形態である。現れる記号列を基にして、はじめに符号化テーブルを作成し、再び同様の記号列に対し作成した符号化テーブルを用いて圧縮を行う。しかしながらこの方法では、圧縮を行うためにデータを2回スキャンする必要があるため、オンラインでのリアルタイム圧縮は困難となる。
(Problems of static Huffman coding)
Static Huffman coding is the most widely implemented form. Based on the appearing symbol string, an encoding table is first created, and compression is again performed using the encoding table created for the similar symbol string. However, in this method, since it is necessary to scan data twice in order to perform compression, online real-time compression becomes difficult.

そのため実際はその都度符号化テーブルを作成することは少なく、標準的なデータを基に作成した既存のテーブル等を用意して符号化することが多い。この既存のテーブル(「静的テーブル」と呼ばれる)を用いた方法には、マイクロプロセッサベース、SRAMベース、PLA (Programmable Logic Array)ベース、並びにCAM(Content Addresable Memory)ベースのアーキテクチャが提案されている。マイクロプロセッサベースのアーキテクチャはソフトウェアで符号化が実現されるため、ハードウェアと比較して処理効率は低い。またSRAMベースアーキテクチャでは符号化する際、符号化テーブルから変換データを見つけるためのアドレスを計算することに数クロックサイクル必要となる。PLAベースアーキテクチャは、符号化テーブルの規模が大きくなるにつれてハードウエア量が増大する傾向にある。また、従来のCAMベースアーキテクチャは符号化テーブルを用いて単純に一致検索機能を行うだけなので、高速であるが柔軟性に欠ける。   Therefore, in practice, it is rare that an encoding table is created each time, and an existing table created based on standard data is often prepared and encoded. Microprocessor-based, SRAM-based, PLA (Programmable Logic Array) -based, and CAM (Content Addresable Memory) -based architectures have been proposed for methods using this existing table (called "static table") . Since the microprocessor-based architecture is encoded by software, the processing efficiency is low compared to hardware. In the SRAM-based architecture, several clock cycles are required to calculate an address for finding conversion data from the encoding table when encoding. The PLA-based architecture tends to increase the amount of hardware as the size of the encoding table increases. In addition, the conventional CAM-based architecture simply performs a matching search function using a coding table, so it is fast but lacks flexibility.

これらの実装方法はいずれも、標準的なデータに基づく既存の符号化テーブルを利用するため、画像の傾向が急激に変化するような動画等のコンテンツの場合、圧縮効率が減少する恐れがあり、更に既存の符号化テーブルが存在しないようなアプリケーションには適用できない等の問題点があった。   All of these implementation methods use existing coding tables based on standard data, so in the case of content such as moving images where the tendency of the image changes rapidly, compression efficiency may decrease. Furthermore, there is a problem that it cannot be applied to an application in which an existing encoding table does not exist.

(適応型ハフマン符号化方式の問題点)
静的ハフマン符号化の問題点である、オンラインでの圧縮、及び既存のテーブルが存在しない任意の記号列にあわせた圧縮を改善するために考えられたのが適応型ハフマン符号化である。
(Problems of adaptive Huffman coding)
Adaptive Huffman coding has been considered to improve on-line compression, which is a problem of static Huffman coding, and compression according to an arbitrary symbol string for which no existing table exists.

その特徴は記号を処理するごとにハフマン木を更新し、その時点で構成されたツリーによって符号化を行うものである。すなわち、符号化前の記号列全体を見て符号化を行わないため、オンラインでの処理が可能となり、符号化テーブルも作成する必要がない。   The feature is that each time a symbol is processed, the Huffman tree is updated, and encoding is performed using the tree constructed at that time. That is, since encoding is not performed by looking at the entire symbol string before encoding, online processing is possible, and it is not necessary to create an encoding table.

しかしながら、圧縮効率及びリアルタイム性についていくつかの問題も存在している。すなわち、アルゴリズムの特性上、符号化データに加えて初出現の記号は符号化せずに送らなければならないため、その分データ量が増加することになる。   However, there are also some problems with compression efficiency and real-time properties. In other words, because of the characteristics of the algorithm, since the first appearance symbol must be sent without being encoded in addition to the encoded data, the amount of data increases accordingly.

更にデータの局所性により、集中的に出現した記号に短い符号が割り当てられたとしても、それ以降出現しない場合にはデータ量が大きくなるにつれて静的ハフマン符号化よりも圧縮効率が下がる場合があるという問題がある。   Furthermore, due to the locality of data, even if a short code is assigned to a symbol that appears intensively, if it does not appear thereafter, the compression efficiency may be lower than that of static Huffman coding as the amount of data increases. There is a problem.

これに対しては符号化テーブルの定期的なリフレッシュという技法が取られることもあるが、過去のデータの生起確率を破棄することは逆に圧縮効率を悪化させることにもなる。   For this, a technique of periodically refreshing the coding table may be used. However, discarding the past occurrence probability of data also deteriorates the compression efficiency.

また、符号化の際にその都度ハフマン木を更新するため、処理により多くの時間を必要とする。これによりオンラインでの処理が可能だとしてもリアルタイムアプリケーションへの適用は向かない場合がある。   Further, since the Huffman tree is updated every time encoding is performed, more time is required for processing. Even if online processing is possible, this may not be applicable to real-time applications.

このハフマン木の更新処理時間を改善するためにアルゴリズムを改良する研究や木の更新にCAMを用いた高速化に関する研究が行われているが、適応型ハフマン符号化のハードウェアでの実装は難しく、その圧縮効果と比較してメリットが少ないという問題点があった。   Research on improving the algorithm to improve the Huffman tree update processing time and research on speeding up using CAM to update the tree have been conducted, but it is difficult to implement adaptive Huffman coding in hardware. There was a problem that there were few merits compared with the compression effect.

この発明は上記問題点を解決するためになされたもので、符号化処理の高速化を達成するとともに、高い圧縮効率を維持することのできるハフマン符号化に適した符号化装置を得ることを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to obtain an encoding apparatus suitable for Huffman encoding capable of achieving high speed encoding processing and maintaining high compression efficiency. And

この発明に係る請求項1記載の符号化装置は、符号化前データを受け、該符号化前データを使用対象符号化テーブルを用いて符号化処理を行い符号化後データを生成するとともに、前記符号化前データの出現状況を含む符号化処理情報を出力する符号化処理部と、前記符号化処理部による前記符号化処理と並行して、前記符号化処理情報に基づき、前記符号化前データの生起確率算出処理を行い、その算出結果に基づき更新用符号化テーブルを作成するテーブル作成部とを備え、前記テーブル作成部は、前記符号化処理における圧縮効率が所定の基準を満足しない場合、前記使用対象符号化テーブルを前記更新用符号化テーブルに置き換えている。   The encoding apparatus according to claim 1 of the present invention receives pre-encoding data, encodes the pre-encoding data using a use target encoding table, generates post-encoding data, and An encoding processing unit that outputs encoding processing information including the appearance status of the pre-encoding data, and the pre-encoding data based on the encoding processing information in parallel with the encoding processing by the encoding processing unit A table creation unit that creates an update encoding table based on the calculation result, and the table creation unit, when the compression efficiency in the encoding process does not satisfy a predetermined criterion, The use target coding table is replaced with the update coding table.

この発明における請求項1記載の符号化装置のテーブル作成部は、符号化処理部による符号化処理と並行して、更新用符号化テーブルを作成しているため、符号化処理の高速性を妨げることなく、最新の符号化前データに基づく更新用符号化テーブルを作成することができる。   According to the first aspect of the present invention, the table creation unit of the coding apparatus creates the update coding table in parallel with the coding process by the coding processing unit, and therefore hinders the high speed of the coding process. Therefore, an update encoding table based on the latest pre-encoding data can be created.

さらに、テーブル作成部は、符号化処理における圧縮効率が所定の基準を満足しない場合、使用対象符号化テーブルを更新用符号化テーブルに置き換えるため、常に高い圧縮効率を維持できる。   Furthermore, since the table creation unit replaces the use target coding table with the update coding table when the compression efficiency in the coding process does not satisfy a predetermined standard, it is possible to always maintain a high compression efficiency.

<CAMの概要>
本発明に係る符号化装置は、CAM(Content Addressable Memory)を用いたハフマン符号化アーキテクチャを有している。まず、CAMの一般的な概要について説明する。
<Overview of CAM>
The encoding apparatus according to the present invention has a Huffman encoding architecture using CAM (Content Addressable Memory). First, a general outline of CAM will be described.

図18はCAMの概念を示す説明図である。CAMは連想メモリと呼ばれる機能メモリの一種である。図18(a) に示す一般的なRAM (Random Access Memory)等のメモリは、アドレスを用いて格納している各データを参照するのに対して、CAMは同図(b) に示すように、CAMは格納しているデータの内容に基づいて、比較データとの比較結果(一致信号及び一致したデータの格納アドレス)を出力する機能を有してるため、各格納データを参照することができる、「内容番地付けメモリ」とみなすことができる。   FIG. 18 is an explanatory diagram showing the concept of CAM. CAM is a kind of functional memory called associative memory. A memory such as a general RAM (Random Access Memory) shown in FIG. 18 (a) refers to each data stored using an address, whereas a CAM is shown in FIG. 18 (b). The CAM has a function of outputting a comparison result (a match signal and a storage address of the matched data) with the comparison data based on the contents of the stored data, so that each stored data can be referred to. , “Content addressing memory”.

そのため通常のメモリは、内部にデータを格納する際、各々に固有の番号であるアドレスを付加している。そのためアドレスが入力されたならば、それに応じて格納しているデータを出力することができる。従って、ある比較データに一致するデータをRAM内で検索する場合には、順にアドレスを入力し、そこに格納されているデータを順に確認していかなければならない。   For this reason, when storing data inside a normal memory, an address, which is a unique number, is added to each memory. Therefore, if an address is input, the stored data can be output accordingly. Therefore, when searching for data that matches certain comparison data in the RAM, it is necessary to input addresses in order and to check the data stored there in order.

これに対し、CAMは、内部のメモリ領域に格納している参照 (比較対照)データに対し、検索データとなる比較データが入力された場合、内部に有する比較器によって全参照データを一定のクロックサイクルで全て一致検索し、一致しているものがあれば該当するデータに対して一致信号を出力することができる。また、同時に一致した参照データのアドレスを出力することもできる。その他の機能としては、マスクを用いて特定のビットのみを一致検索することも可能である。   On the other hand, when comparison data serving as search data is input to reference (comparison) data stored in an internal memory area, the CAM transfers all reference data to a constant clock by an internal comparator. All the matches are searched in a cycle, and if there is a match, a match signal can be output for the corresponding data. It is also possible to output the address of the reference data that coincides at the same time. As another function, it is also possible to search for a specific bit only using a mask.

CAMの一致検索は、本質的に並列に行われるため、メモリ内の参照データ数が増加するにつれて、通常のRAMと比較して非常に高速かつ効率的に検索結果を得ることができる利点を有する。   Since the CAM matching search is essentially performed in parallel, it has an advantage that the search result can be obtained very quickly and efficiently as the number of reference data in the memory increases as compared with a normal RAM. .

<基本構成>
図1は、この発明に発明に係るCAMベースのハフマン符号化アーキテクチャを有する符号化装置の内部構成の概略を示すブロック図である。同図において、符号化処理部1は内部に現在の符号化に用いる使用対象符号化テーブル(図1では図示せず)と次に置き換えるべき更新用符号化テーブル(図1では図示せず)を少なくも有していることを前提としている。
<Basic configuration>
FIG. 1 is a block diagram showing an outline of the internal configuration of an encoding apparatus having a CAM-based Huffman encoding architecture according to the present invention. In the figure, the encoding processing unit 1 internally uses a target encoding table (not shown in FIG. 1) used for current encoding and an update encoding table (not shown in FIG. 1) to be replaced next. It is assumed that they have at least.

同図に示すように、符号化処理部1は符号化前データD0を入力し、内部の使用対象符号化テーブルを用いて符号化前データD0をハフマン符号化して得られる符号化後データD1を出力処理部3に出力するとともに、同時に得られる符号化前データD0の出現情報を含む符号化処理情報S1をテーブル作成部2に出力する。そして、出力処理部3は符号化後データD1に基づき出力データD3を出力する。   As shown in the figure, the encoding processing unit 1 inputs pre-encoding data D0, and uses post-encoding data D1 obtained by Huffman encoding the pre-encoding data D0 using an internal use target encoding table. While outputting to the output process part 3, the encoding process information S1 containing the appearance information of the pre-encoding data D0 obtained simultaneously is output to the table preparation part 2. FIG. The output processing unit 3 outputs output data D3 based on the encoded data D1.

テーブル作成部2は、符号化処理部1の符号化処理と並行して、符号化処理情報S1に基づき、符号化前データD0の生起確率算出処理を行い、その算出結果に基づきハフマン木を更新して更新用符号化テーブルの更新処理を行う。上記更新処理の内容はテーブル更新情報S2として符号化処理部1に適宜与えられる。   The table creation unit 2 performs the occurrence probability calculation process of the pre-encoding data D0 based on the encoding process information S1 in parallel with the encoding process of the encoding processing unit 1, and updates the Huffman tree based on the calculation result Then, the update coding table is updated. The contents of the update process are appropriately given to the encoding processing unit 1 as table update information S2.

そして、テーブル作成部2は、圧縮効率が所定の基準を満足しない場合、符号化テーブル変更の必要性があると判断し、図示しない符号化テーブル更新指令を符号化処理部1に与え、符号化処理部1内部の使用対象符号化テーブルを更新用符号化テーブルに置き換えさせる。   Then, if the compression efficiency does not satisfy the predetermined standard, the table creation unit 2 determines that there is a need to change the coding table, and gives a coding table update command (not shown) to the coding processing unit 1 for coding. The use target coding table in the processing unit 1 is replaced with the update coding table.

<(逐次符号化方式)>
アプリケーションによっては,符号化前のデータが逐次的に次々送られてくる状況が考えられる。このようなアプリケーションに対して設けられたのが、逐次符号化方式を採用したCAMベースの符号化アーキテクチャを有する、実施の形態1の符号化装置である。
<(Sequential encoding method)>
Depending on the application, it can be considered that the data before encoding is sequentially sent one after another. A coding apparatus according to the first embodiment having a CAM-based coding architecture that employs a sequential coding scheme is provided for such an application.

図2は実施の形態1の符号化装置の全体構成の示す説明図である。同図に示すように、符号化前データD0を取り込む符号化処理部1は内部にCAM11、スイッチ17、符号化テーブル13a,13b(RAM13)を有している。   FIG. 2 is an explanatory diagram showing the overall configuration of the encoding apparatus according to the first embodiment. As shown in the figure, the encoding processing unit 1 for taking in the pre-encoding data D0 includes a CAM 11, a switch 17, and encoding tables 13a and 13b (RAM 13).

符号化処理部1内のCAM11は、逐次的に送られてくる符号化前データD0を比較データとして逐次取り込み、一致検索処理を実行する。CAM11には符号化テーブル13a,13b(RAM13)に対応すべく符号化前データの全パターンが参照データとして格納されているため、検索結果によって得られる、比較データとの一致を指示する一致信号のアドレス(一致信号アドレス)を含む一致検出結果信号S11をスイッチ17に出力することができる。   The CAM 11 in the encoding processing unit 1 sequentially fetches the pre-encoding data D0 sent sequentially as comparison data, and executes a matching search process. Since all patterns of pre-encoding data are stored as reference data in the CAM 11 so as to correspond to the encoding tables 13a and 13b (RAM 13), a match signal that indicates the match with the comparison data obtained from the search result is displayed. A match detection result signal S11 including an address (match signal address) can be output to the switch 17.

さらに、符号化処理部1は上記一致検索処理時に得られた符号化処理情報S1aをテーブル作成部2に出力する。   Further, the encoding processing unit 1 outputs the encoding processing information S1a obtained during the matching search process to the table creating unit 2.

また、符号化処理部1は内部に2つの符号化テーブル13a,13bを有しており、スイッチ17によって符号化テーブル13a,13bのうち、一方が使用対象符号化テーブルとなり、他方が更新用符号化テーブルとして選択される。したがって、一致検出結果信号S11はスイッチ17によって符号化テーブル13a,13bのうち使用対象符号化テーブルとなっているテーブルに選択的に出力される。   Also, the encoding processing unit 1 has two encoding tables 13a and 13b therein, and one of the encoding tables 13a and 13b becomes a use target encoding table by the switch 17, and the other is an update code. Selected as the conversion table. Therefore, the coincidence detection result signal S11 is selectively output by the switch 17 to the table that is the use target coding table among the coding tables 13a and 13b.

テーブル作成部2は、符号化処理部1による符号化テーブル13a,あるいは13bを用いた符号化処理と並行して、更新用符号化テーブルを作成する処理部である。テーブル作成部2は内部に生起確率算出回路21及び最大値検出/符号割り当てモジュール22を有している。   The table creation unit 2 is a processing unit that creates an update coding table in parallel with the coding process using the coding table 13a or 13b by the coding processing unit 1. The table creation unit 2 includes an occurrence probability calculation circuit 21 and a maximum value detection / code allocation module 22 inside.

生起確率算出回路21は、符号化処理部1のCAM11より提供される符号化処理情報S1aに基づき、符号データ毎に出現回数をカウントすることにより、最新の符号化前データD0に関する生起確率算出処理を行う。そして、生起確率算出回路21により算出された生起確率算出処結果は最大値検出/符号割り当てモジュール22に入力される。   The occurrence probability calculation circuit 21 counts the number of appearances for each piece of code data based on the encoding process information S1a provided from the CAM 11 of the encoding processing unit 1, thereby generating the occurrence probability for the latest pre-encoding data D0. I do. Then, the occurrence probability calculation processing result calculated by the occurrence probability calculation circuit 21 is input to the maximum value detection / code allocation module 22.

最大値検出/符号割り当てモジュール22は、符号データ毎の出現回数があらかじめ決めた設定値になるか,カウント可能な最大値(MAX)になるか,もしくは圧縮効率がしきい値を下回った場合に、頻度の大きいものから順にビット長の短いハフマン符号の割り当てを行い,新規な更新用符号化テーブル作成用の符号テーブル作成用データS22を作成する。   The maximum value detection / code allocation module 22 determines whether the number of appearances for each code data is a predetermined setting value, the maximum value (MAX) that can be counted, or when the compression efficiency falls below a threshold value. Then, Huffman codes with shorter bit lengths are assigned in order from the highest frequency, and code table creation data S22 for creating a new update coding table is created.

テーブル作成部2による更新用符号化テーブル作成処理は、符号化処理部1による符号化処理と並行に実行され,最近の符号化前データD0の出現頻度に基づいた,新規の更新用符号化テーブル作成用の符号テーブル作成用データS22が得られる。   The update coding table creation processing by the table creation unit 2 is executed in parallel with the coding processing by the coding processing unit 1, and is based on the appearance frequency of the latest pre-coding data D0. The code table creation data S22 for creation is obtained.

さらに、テーブル作成部2は、圧縮効率があらかじめ設定したしきい値を下回った場合に、符号化テーブル13a,13b間における使用対象符号化テーブルと更新用符号化テーブルとの交換処理制御を行う。例えば、使用対象符号化テーブルが符号化テーブル13a、更新用符号化テーブルが符号化テーブル13bの場合に、使用対象符号化テーブルを符号化テーブル13bに、更新用符号化テーブルを符号化テーブル13aに置き換える指令をスイッチ17に与える。その結果、符号化処理部1は常に圧縮効率がしきい値を下回るこのなく、高い圧縮効率を維持することができる。   Furthermore, when the compression efficiency falls below a preset threshold value, the table creation unit 2 controls exchange processing between the encoding table to be used and the update encoding table between the encoding tables 13a and 13b. For example, when the target encoding table is the encoding table 13a and the update encoding table is the encoding table 13b, the target encoding table is the encoding table 13b, and the update encoding table is the encoding table 13a. A command for replacement is given to the switch 17. As a result, the encoding processing unit 1 can always maintain a high compression efficiency without the compression efficiency falling below the threshold value.

テーブル作成部2による圧縮効率がしきい値を下回るか否かは、符号長が長い符号前データのカウント値が大きくなったことをロジックで判定する等により行うことができる。   Whether the compression efficiency by the table creation unit 2 is below the threshold value can be determined by, for example, determining by logic that the count value of pre-code data having a long code length has increased.

符号化テーブル13a,13bより出力される符号化後データD1は、出力処理部3に取り込まれる。出力処理部3は、内部にシフタ31、バッファ32a,32b、及びスイッチ33を有し、符号化後データD1をシフタ31及びバッファ32a,32bにてバファリング処理して、出力データD3として出力する。   The encoded data D1 output from the encoding tables 13a and 13b is taken into the output processing unit 3. The output processing unit 3 includes a shifter 31, buffers 32a and 32b, and a switch 33 therein, and buffers the encoded data D1 by the shifter 31 and the buffers 32a and 32b and outputs it as output data D3. .

図3は実施の形態1の符号化装置の詳細構成を示す説明図である。同図に示すように、CAM11は、アドレスデコーダ14、比較レジスタRC、マスクレジスタRM、参照データ格納領域RG1、第1の検索結果格納レジスタである検索結果格納レジスタR1、プライオリティエンコーダ15、一致信号及びアドレス生成回路16から構成される。スイッチ17はセレクタ17a,17bにより構成され、符号化テーブル13a,13bの後段にはセレクタ18が設けられる。   FIG. 3 is an explanatory diagram showing a detailed configuration of the encoding apparatus according to the first embodiment. As shown in the figure, the CAM 11 includes an address decoder 14, a comparison register RC, a mask register RM, a reference data storage area RG1, a search result storage register R1, which is a first search result storage register, a priority encoder 15, a match signal, The address generation circuit 16 is configured. The switch 17 is composed of selectors 17a and 17b, and a selector 18 is provided at the subsequent stage of the encoding tables 13a and 13b.

比較レジスタRCは符号化前データD0を取り込み、マスクレジスタRMはマスクするビットを指示するマスクデータを格納する。参照データ格納領域RG1には記号等を指示する符号化前データの全パターンが参照データDR1〜DRnとして格納されている。   The comparison register RC takes in the pre-encoding data D0, and the mask register RM stores mask data indicating the bits to be masked. In the reference data storage area RG1, all patterns of pre-encoding data indicating symbols and the like are stored as reference data DR1 to DRn.

アドレスデコーダ14は読み出し/書き込みアドレスAdをデコードして選択アドレスを決定し、符号化処理部1から選択アドレスi(i=1〜n)に対応する参照データDRiにアクセスし、読み出し時には参照データDRとして出力することができる。検索結果格納レジスタR1は参照データ格納領域RG1内に格納された参照データDR1〜DRnに対応して検索結果ビットDB1〜DBnを格納するレジスタである。検索結果格納レジスタR1は、内部の検索結果ビットDB1〜DBnを読み出し可能にプライオリティエンコーダ15に接続される。   The address decoder 14 decodes the read / write address Ad to determine a selection address, accesses the reference data DRi corresponding to the selection address i (i = 1 to n) from the encoding processing unit 1, and reads the reference data DR at the time of reading. Can be output as The search result storage register R1 is a register that stores the search result bits DB1 to DBn corresponding to the reference data DR1 to DRn stored in the reference data storage area RG1. The search result storage register R1 is connected to the priority encoder 15 so that the internal search result bits DB1 to DBn can be read.

プライオリティエンコーダ15は検索結果ビットDB1〜DBnの情報に基づき、セット状態(“1”格納)の一致検索結果ビットDBiに対応するアドレスを一致信号アドレスとして一致信号及びアドレス生成回路16に出力する。一致信号及びアドレス生成回路16は、検索結果が一致したことを示す一致信号S11aと、一致信号アドレスを指示する一致アドレス信号S11bをセレクタ17a,17bに出力する。   Based on the information of the search result bits DB1 to DBn, the priority encoder 15 outputs the address corresponding to the match search result bit DBi in the set state (stored “1”) to the match signal and address generation circuit 16 as a match signal address. The match signal and address generation circuit 16 outputs a match signal S11a indicating that the search results match and a match address signal S11b indicating the match signal address to the selectors 17a and 17b.

セレクタ17a,17bは活性状態時に符号化テーブル13a,13bに対し、活性/非活性を指示するイネーブル信号ENa,ENb、書き込み/読み出しを指示する書き込み信号WRa,WRb、選択アドレスを指示する選択アドレス信号SAa,SAb、書き込みデータを指示する符号データDHa,DHbを出力する。セレクタ17a,17bの活性/非活性は制御回路23からの制御信号S25によって制御される。   In the active state, the selectors 17a and 17b provide enable signals ENa and ENb for instructing activation / inactivation, write signals WRa and WRb for instructing writing / reading, and a selection address signal for instructing a selection address. SAa and SAb, and code data DHa and DHb indicating write data are output. The activation / inactivation of the selectors 17a and 17b is controlled by a control signal S25 from the control circuit 23.

符号化テーブル13a,13bはセレクタ17a,17bからの上述した各種信号に基づき、読み出しデータD13a,D13bをセレクタ18に出力する。セレクタ18は制御回路23からの制御信号S32に基づき、読み出しデータD13a,D13bのうちの一方を符号化後データD1として出力する。   The encoding tables 13a and 13b output read data D13a and D13b to the selector 18 based on the various signals described above from the selectors 17a and 17b. Based on the control signal S32 from the control circuit 23, the selector 18 outputs one of the read data D13a and D13b as the encoded data D1.

生起確率算出回路21は内部にカウンタCT1〜CTnを有し、これらのカウンタCT1〜CTnは検索結果格納レジスタR1の検索結果ビットDB1〜DBnに対応して設けられ、対応する検索結果ビットDBが一致検索結果ビットDBiとして“1”(セット状態)になる度にカウントアップする。したがって、検索結果ビットDB1〜DBnが図2の符号化処理情報S1aとなる。   The occurrence probability calculation circuit 21 has counters CT1 to CTn inside, and these counters CT1 to CTn are provided corresponding to the search result bits DB1 to DBn of the search result storage register R1, and the corresponding search result bits DB match. Each time the search result bit DBi becomes “1” (set state), the count is incremented. Therefore, the search result bits DB1 to DBn become the encoding process information S1a of FIG.

最大値検出/符号割り当てモジュール22は、カウンタCT1〜CTnそれぞれのカウント値である生起確率算出結果に基づき、カウント値の大きいカウンタCTに対応するアドレスから順にハフマン符号を割り当てることにより、ハフマン符号による符号化テーブルを新たに作成するための符号用アドレス信号S22a、符号用データ信号S22bをセレクタ17a,17bに出力する。   The maximum value detection / code assignment module 22 assigns a Huffman code in order from an address corresponding to the counter CT having a large count value, based on the occurrence probability calculation results that are the count values of the counters CT1 to CTn. A code address signal S22a and a code data signal S22b for creating a new conversion table are output to the selectors 17a and 17b.

制御回路23は符号化後データD1、閾値データD21、設定値データD22を受けるとともに、最大値検出/符号割り当てモジュール22から制御信号S22cを受け、これらの信号に基づき、最大値検出/符号割り当てモジュール22に情報伝達信号S23を、プライオリティエンコーダ15に制御信号S24を、セレクタ17a,17bに制御信号S25を、セレクタ20に制御信号S32を与える。なお、情報伝達信号S23には閾値データD21、設定値データD22及び符号化後データD1等の情報が含まれる。   The control circuit 23 receives the encoded data D1, the threshold data D21, and the set value data D22, and also receives the control signal S22c from the maximum value detection / code allocation module 22, and based on these signals, the maximum value detection / code allocation module 22, the information transmission signal S23, the control signal S24 to the priority encoder 15, the control signal S25 to the selectors 17a and 17b, and the control signal S32 to the selector 20 are given. The information transmission signal S23 includes information such as threshold data D21, set value data D22, and encoded data D1.

セレクタ17a,17bは制御信号S25に基づき、一方は一致信号及びアドレス生成回路16からの一致信号S11a及び一致アドレス信号S11bに基づく符号化処理用に機能し、他方は最大値検出/符号割り当てモジュール22からの符号用アドレス信号S22a及び符号用データ信号S22aに基づく符号化テーブル更新処理用に機能する。   The selectors 17a and 17b function based on the control signal S25, one functions for encoding processing based on the coincidence signal and the coincidence signal S11a and the coincidence address signal S11b from the address generation circuit 16, and the other functions as the maximum value detection / code allocation module 22. Functions for an encoding table update process based on the encoding address signal S22a and the encoding data signal S22a.

図4は実施の形態1の符号化装置における符号化処理及び符号化テーブル作成処理を示すフローチャートである。以下、同図を参照して、実施の形態1の動作について詳述する。なお、説明の都合上、現在の使用対象符号化テーブルを符号化テーブル13a、更新用符号化テーブルを符号化テーブル13bと仮定する。なお、図4で述べる処理は、全体的な制御は制御回路23によって行われ、個々の動作は符号化処理部1、テーブル作成部2及び出力処理部3によってそれぞれ実行される。また、図4において、各構成部1〜3の実行として便宜上分類していているが、実際には他の構成部が行う場合もある。   FIG. 4 is a flowchart showing an encoding process and an encoding table creation process in the encoding apparatus according to the first embodiment. Hereinafter, the operation of the first embodiment will be described in detail with reference to FIG. For convenience of explanation, it is assumed that the current use target encoding table is the encoding table 13a and the update encoding table is the encoding table 13b. In the processing described in FIG. 4, overall control is performed by the control circuit 23, and individual operations are executed by the encoding processing unit 1, the table creation unit 2, and the output processing unit 3, respectively. In FIG. 4, the execution of each of the constituent units 1 to 3 is classified for convenience, but other constituent units may actually perform.

図4のステップST1において、符号化前データD0を逐次入力する。符号化前データD0はCAM11の比較レジスタRC内に取り込まれる。図3の例では、比較レジスタRCに符号化前データD0である“000…001”が比較データDCとして格納され、マスクレジスタRMはマスクをかけていない状態である全て“0”のマスクデータが設定されている場合を示している。   In step ST1 of FIG. 4, pre-encoding data D0 is sequentially input. The pre-encoding data D0 is taken into the comparison register RC of CAM11. In the example of FIG. 3, “000... 001” that is the pre-encoding data D0 is stored as the comparison data DC in the comparison register RC, and the mask register RM stores all “0” mask data that is not masked. The case where it is set is shown.

次に、ステップST2において、セレクタ17a,17bは、最大値検出/符号割り当てモジュール22からの制御信号S22c及び制御回路23からの制御信号S25を介して、「圧縮効率≦しきい値」である(YES)か否か(NO)を認識し、YESの場合はステップST3に移行し、NOの場合はステップST7で符号化テーブルの交換処理(使用対象符号化テーブルである符号化テーブル13aと更新用符号化テーブルである符号化テーブル13bとを置き換える理)を行った後、ステップST3に移行する。   Next, in step ST2, the selectors 17a and 17b satisfy “compression efficiency ≦ threshold” via the control signal S22c from the maximum value detection / code allocation module 22 and the control signal S25 from the control circuit 23 ( (YES), whether or not (NO) is recognized. If YES, the process proceeds to step ST3. If NO, the encoding table exchange process (encoding table 13a, which is the encoding table to be used, and update) is updated in step ST7. After replacing the encoding table 13b which is the encoding table), the process proceeds to step ST3.

ステップST3において、CAM11内で符号化前データD0と参照データ格納領域RG1の参照データDR1〜DRnとの一致検索を行う。一致検索において、参照データ格納領域RG1内の参照データのいずれかと符号化前データD0とは必ず一致し、一致した参照データ(一致参照データDRi(i=1〜nのいずれか))に対応する検索結果格納レジスタR1の一致検索結果ビットDBiが“1”(セット状態)に設定される。図3では比較データDCである“000…001”に対応する検索結果ビットDBが“1”にセットされている。   In step ST3, a match search between the pre-encoding data D0 and the reference data DR1 to DRn in the reference data storage area RG1 is performed in the CAM 11. In the match search, any of the reference data in the reference data storage area RG1 and the pre-encoding data D0 always match and correspond to the matched reference data (matched reference data DRi (i = 1 to n)). The match search result bit DBi of the search result storage register R1 is set to “1” (set state). In FIG. 3, the search result bit DB corresponding to the comparison data DC “000... 001” is set to “1”.

その後、ステップST4において、符号化テーブル13aへの一致信号アドレスへの送信処理を行う。以下、この処理について詳述する。   Thereafter, in step ST4, transmission processing to the coincidence signal address to the encoding table 13a is performed. Hereinafter, this process will be described in detail.

前述したように、プライオリティエンコーダ15が検索結果格納レジスタR1内の検索結果ビットDB1〜DBnの情報に基づき、一致検索結果ビットDBiに対応するアドレスを一致信号アドレスとして一致信号及びアドレス生成回路16に出力する。一致信号及びアドレス生成回路16は、検索結果が一致したことを示す一致信号S11aと、一致信号アドレスを指示する一致アドレス信号S11bをセレクタ17a,17bに出力する。   As described above, the priority encoder 15 outputs the address corresponding to the match search result bit DBi to the match signal and address generation circuit 16 as the match signal address based on the information of the search result bits DB1 to DBn in the search result storage register R1. To do. The match signal and address generation circuit 16 outputs a match signal S11a indicating that the search results match and a match address signal S11b indicating the match signal address to the selectors 17a and 17b.

このとき、制御信号S25によって、符号化テーブル13aに対応するセレクタ17aが有効状態とされているため、セレクタ17aはイネーブル信号ENaを活性状態、書き込み信号WRaを非活性状態(読み出し状態)にし、一致信号S11a及び一致アドレス信号S11bに基づき、一致信号アドレスを指示する選択アドレス信号SAaを符号化テーブル13aに出力する。   At this time, since the selector 17a corresponding to the encoding table 13a is enabled by the control signal S25, the selector 17a sets the enable signal ENa in the active state and the write signal WRa in the inactive state (read state), and matches. Based on the signal S11a and the coincidence address signal S11b, a selection address signal SAa for instructing the coincidence signal address is output to the encoding table 13a.

その結果、ステップST5において、符号化処理部1は、符号化テーブル13aを参照し、選択アドレス信号SAaで指示されたアドレスに格納された符号データを読み出しデータD13aとしてセレクタ18に出力する。そして、セレクタ18は制御回路23からの制御信号S32に従い、読み出しデータD13aを符号化後データD1として出力する。   As a result, in step ST5, the encoding processing unit 1 refers to the encoding table 13a and outputs the code data stored at the address indicated by the selection address signal SAa to the selector 18 as read data D13a. The selector 18 outputs the read data D13a as the encoded data D1 in accordance with the control signal S32 from the control circuit 23.

そして、ステップS6において、最終的に出力処理部3から出力データD3が出力される。すなわち、出力処理部3は、符号化後データD1をシフタ31によってバッファ32a,32bの一方に出力し、フル状態になれば他方のバッファに出力先を切り換え、この間、スイッチ33の制御下でフル状態となった一方のバッファから出力データD3として出力する。   In step S6, output data D3 is finally output from the output processing unit 3. In other words, the output processing unit 3 outputs the encoded data D1 to one of the buffers 32a and 32b by the shifter 31, and when it becomes full, switches the output destination to the other buffer. During this time, the output destination is full under the control of the switch 33. Output as output data D3 from one of the buffers in the state.

図5はステップST5の処理におけるCAM11とRAM13との関係を示す概念図である。説明の都合上、CAM11及びRAM13のアドレスを2ビットで示し、CAM11が格納する参照データ、RAM13が格納する符号データをそれぞれ3ビットで示している。   FIG. 5 is a conceptual diagram showing the relationship between the CAM 11 and the RAM 13 in the process of step ST5. For convenience of explanation, the addresses of the CAM 11 and the RAM 13 are indicated by 2 bits, the reference data stored by the CAM 11 and the code data stored by the RAM 13 are respectively indicated by 3 bits.

図5に示すように、符号化前データD0として“111”が入力された場合、CAM11の参照データ格納領域RG1内における“111”と一致し、この“111”はアドレス35の“10”に相当する。図3の構成で説明すれば、検索結果ビットDB1〜DBnのうち“1”を格納したビットについて、プライオリティエンコーダ15よってエンコードされたアドレスが“10”となる。このアドレス“10”を規定した信号が一致アドレス信号S11bとなる。   As shown in FIG. 5, when “111” is input as the pre-encoding data D0, it matches “111” in the reference data storage area RG1 of the CAM 11, and this “111” is set to “10” of the address 35. Equivalent to. In the configuration of FIG. 3, the address encoded by the priority encoder 15 is “10” for the bit storing “1” among the search result bits DB1 to DBn. A signal defining this address “10” becomes the coincidence address signal S11b.

一致アドレス信号S11bを受けたRAM13(符号化テーブル13a,13b)は、一致アドレス信号S11bに基づき、格納符号データ37中のデータから、符号データ用アドレス36における“10”に対応するデータ“010”を読み出し、このデータ“010”を符号化後データD1として出力する。   The RAM 13 (encoding tables 13a and 13b) that has received the match address signal S11b, based on the match address signal S11b, from the data in the stored code data 37, data “010” corresponding to “10” in the code data address 36. The data “010” is output as encoded data D1.

このように、一致アドレス信号S11bに基づくCAM11とRAM13とによる連携によって高速に符号化後データD1を得ることができる。   Thus, the encoded data D1 can be obtained at high speed by the cooperation between the CAM 11 and the RAM 13 based on the coincidence address signal S11b.

図6は、CAM11とRAM13との接続例を示す説明図である。同図に示すように、CAM11の一致信号線CL1〜CLnとRAM13のワード線WL1〜WLnとを結線部49により結線している。   FIG. 6 is an explanatory diagram showing a connection example between the CAM 11 and the RAM 13. As shown in the figure, the coincidence signal lines CL1 to CLn of the CAM 11 and the word lines WL1 to WLn of the RAM 13 are connected by a connecting portion 49.

CAM11の一致信号線CL1〜CLnは、参照データDR1〜DRnに対応して設けられ、参照データDR1〜DRnそれぞれに対応して所定ビット数のメモリセルMC11が設けられ、メモリセルMC11毎に比較器CP1〜CPn(参照データDR1〜DRnに対応)が設けられる。   The coincidence signal lines CL1 to CLn of the CAM 11 are provided corresponding to the reference data DR1 to DRn, a memory cell MC11 having a predetermined number of bits is provided corresponding to each of the reference data DR1 to DRn, and a comparator is provided for each memory cell MC11. CP1 to CPn (corresponding to reference data DR1 to DRn) are provided.

一方、RAM13のワード線WL1〜WLnは、符号データDH1〜DHnに対応して設けられ、符号データDH1〜DHnそれぞれに対応して所定ビット数のメモリセルMC13が設けられる。   On the other hand, word lines WL1 to WLn of RAM 13 are provided corresponding to code data DH1 to DHn, and memory cells MC13 having a predetermined number of bits are provided corresponding to code data DH1 to DHn.

このような接続関係のCAM11,RAM13において、一致参照データDRi(i=1〜nのいずれか)に対応する一致信号線CLiのみが、所定ビット数の比較器CPiによって活性状態に設定される。   In the CAM 11 and the RAM 13 having such a connection relationship, only the coincidence signal line CLi corresponding to the coincidence reference data DRi (i = 1 to n) is set in an active state by the comparator CPi having a predetermined number of bits.

その結果、一致信号線CLiに接続されるワード線WLiのみが活性状態となり、当該ワード線WLiに接続されたメモリセルMC13の格納データである符号データDHiが読み出しデータD13として読み出される。   As a result, only the word line WLi connected to the coincidence signal line CLi is activated, and the code data DHi which is the storage data of the memory cell MC13 connected to the word line WLi is read as the read data D13.

このように、CAM11の一致信号線CL1〜CLnとRAM13のワード線WL1〜WLnとを結線部49により結線することにより、図5で示すCAM11のアドレス35、RAM13の符号データ用アドレス36の設定を不要にできる分、より小さい面積に集積することが可能となる効果を奏する。   In this way, the coincidence signal lines CL1 to CLn of the CAM 11 and the word lines WL1 to WLn of the RAM 13 are connected by the connection unit 49, thereby setting the address 35 of the CAM 11 and the code data address 36 of the RAM 13 shown in FIG. Since it can be made unnecessary, it is possible to accumulate in a smaller area.

図3及び図4に戻って、テーブル作成部2は、符号化処理部1によるステップST3の一致検索処理に並行して、ステップST8において、参照データDR1〜DRn毎の一致回数をカウントする処理を行う。以下、この処理内容ついて詳述する。   3 and 4, the table creation unit 2 performs a process of counting the number of matches for each of the reference data DR1 to DRn in step ST8 in parallel with the match search process of step ST3 by the encoding process unit 1. Do. Hereinafter, the details of this process will be described.

生起確率算出回路21の内部のカウンタCT1〜CTnは、対応する検索結果ビットDB1〜DBnが“1”になる度にカウントアップする。したがって、逐次入力される符号化前データD0において、検索結果ビットDB1〜DBn、すなわち、参照データDR1〜DRnそれぞれの一致回数をカウンタCT1〜CTnによってカウントする。   The counters CT1 to CTn in the occurrence probability calculation circuit 21 count up each time the corresponding search result bits DB1 to DBn become “1”. Therefore, in the pre-encoding data D0 input sequentially, the number of matches of the search result bits DB1 to DBn, that is, the reference data DR1 to DRn is counted by the counters CT1 to CTn.

そして、ステップST9で、カウンタCT1〜CTnのカウント値のいずれかが設定値(設定値データD22で規定)に達するか(YES)否か(NO)、ステップST10でカウンタCT1〜CTnのいずれかがカウント可能な最大値(MAX)に達するか(YES)否か(NO)、ステップST11で圧縮効率がしきい値(閾値データD21で規定)を下回っているか(YES)否か(NO)がチェックされる。   In step ST9, whether any of the count values of the counters CT1 to CTn reaches a set value (specified by the set value data D22) (YES) or not (NO), and in step ST10, any of the counters CT1 to CTn is set. Whether the countable maximum value (MAX) is reached (YES) or not (NO), and whether or not the compression efficiency is below a threshold value (specified by threshold data D21) (YES) or not (NO) is checked in step ST11. Is done.

そして、ステップST9でYES,ST10でYES、あるいはステップST11でNOと判定されると、ステップST12の処理に移行する。   If YES in step ST9, YES in ST10, or NO in step ST11, the process proceeds to step ST12.

ステップST12において、最大値検出/符号割り当てモジュール22は、カウンタCT1〜CTnそれぞれのカウント値に基づき、カウント値の大きいカウンタCTに対応するアドレス(符号前データ)から順にハフマン符号を割り当てることにより、更新用符号化テーブルに必要なハフマン符号による新規符号化テーブルを作成する。   In step ST12, the maximum value detection / sign assignment module 22 updates the Huffman code in order from the address (pre-code data) corresponding to the counter CT having a large count value, based on the count values of the counters CT1 to CTn. A new encoding table using a Huffman code necessary for the encoding table is created.

そして、ステップST13に移行し、ステップST12で作成された新規符号化テーブルに基づきアドレスを規定する符号用アドレス信号S22aと、アドレスに対応する符号データを規定する符号用データ信号S22aとをセレクタ17a,17bに出力することにより、符号化テーブル更新処理を実行する。   Then, the process proceeds to step ST13, where the code address signal S22a for defining the address based on the new coding table created in step ST12 and the code data signal S22a for defining the code data corresponding to the address are selected by the selectors 17a, By outputting to 17b, a coding table update process is executed.

現在の更新用符号化テーブルは符号化テーブル13bであるため、制御信号S25の制御下でセレクタ17bは活性状態を指示するイネーブル信号ENb、書き込みを指示する書き込み信号WRbにするとともに、符号用アドレス信号S22aにより規定されたアドレスを指示する選択アドレス信号SAb、及び符号用データ信号S22aにより規定された符号データを指示する符号データDHbを、符号化テーブル13bに順次出力することにより、符号化テーブル13bの内容を更新する。   Since the current update coding table is the coding table 13b, under the control of the control signal S25, the selector 17b uses the enable signal ENb for instructing the active state, the write signal WRb for instructing writing, and the address signal for coding. By sequentially outputting the selection address signal SAb indicating the address defined by S22a and the code data DHb indicating the code data defined by the code data signal S22a to the coding table 13b, the coding table 13b Update the contents.

その後、ステップST7に移行し、ステップST12の実行原因がステップST11がNOの場合(圧縮効率がしきい値を下回っていた場合)、使用対象の符号化テーブルを符号化テーブル13aから符号化テーブル13bに切り換える。なお、ステップST13後にステップST7が実行される場合は、ステップST7で終了し、ステップST2に移行することはない。ステップST2に移行するのはステップST1でNOと判断され後にステップST7が実行された場合のみである。   Thereafter, the process proceeds to step ST7. When the cause of execution of step ST12 is NO in step ST11 (when the compression efficiency is lower than the threshold value), the encoding table to be used is changed from the encoding table 13a to the encoding table 13b. Switch to. In addition, when step ST7 is performed after step ST13, it complete | finishes at step ST7 and does not transfer to step ST2. The process proceeds to step ST2 only when NO is determined in step ST1 and step ST7 is subsequently executed.

このように、実施の形態1の符号化装置においては、逐次的に入力される符号化前データD0に対し、リアルタイムに符号化処理部1によって符号化を行いながら,圧縮効率を維持するために,常に最適な更新用符号化テーブルをテーブル作成部2によって用意することが可能となる。   As described above, in the encoding apparatus according to the first embodiment, in order to maintain the compression efficiency while the encoding processing unit 1 encodes the pre-encoding data D0 that is sequentially input in real time. Thus, it is possible to always prepare an optimal update coding table by the table creation unit 2.

そして、テーブル作成部2の生起確率算出回路21は、検索結果格納レジスタR1に検索結果ビットDB1〜DBnの内容に基づくことにより、最新の符号化前データD0の出現情報を正確かつ高速に認識可能な生起確率算出処理を行うことができる。   The occurrence probability calculation circuit 21 of the table creation unit 2 can recognize the appearance information of the latest pre-encoding data D0 accurately and at high speed based on the contents of the search result bits DB1 to DBn in the search result storage register R1. It is possible to perform an occurrence probability calculation process.

その結果、静的ハフマン符号化や適応型ハフマン符号化の問題点を解決し、ハフマン符号化処理の高速化を達成するとともに、高い圧縮効率を維持することのできるハフマン符号化に適した符号化装置を得ることができる。   As a result, coding suitable for Huffman coding that solves the problems of static Huffman coding and adaptive Huffman coding, achieves high-speed Huffman coding processing, and maintains high compression efficiency. A device can be obtained.

<実施の形態2(格納符号化方式)>
符号化前のデータが事前にメモリ等に格納されている,もしくは格納してから符号化処理を行うようなアプリケーションに対して設けられたのが、格納符号化方式を採用したCAMベースの符号化アーキテクチャを有する、実施の形態2の符号化装置である。
<Embodiment 2 (Storage Coding System)>
CAM-based encoding using a storage encoding method is provided for applications in which data before encoding is stored in a memory or the like in advance or encoding processing is performed after the data is stored. 4 is an encoding apparatus according to a second embodiment having an architecture.

図7は実施の形態2の符号化装置の全体構成の示す説明図である。同図に示すように、符号化前データD0を取り込む符号化処理部5は内部にCAM19、スイッチ17、符号化テーブル13a,13b(RAM13)を有している。   FIG. 7 is an explanatory diagram showing the overall configuration of the encoding apparatus according to the second embodiment. As shown in the figure, the encoding processing unit 5 for taking in the pre-encoding data D0 has a CAM 19, a switch 17, and encoding tables 13a and 13b (RAM 13).

符号化処理部5内のCAM19は、順次入力される符号化前データD0を所定数分を所定数の格納データとして内部に符号化前データ格納領域RG2(後に示す図8参照)に取り込んだ後、一括して一致検索処理を実行する。CAM19には、実施の形態1のCAM11と同様、符号化テーブル13a,13bに対応すべく符号化前データの全パターンが参照データ格納領域RG1に格納されているため、検索結果によって得られる、比較データとの一致を指示する一致信号のアドレス(一致信号アドレス)を含む一致検出結果信号S19をスイッチ17に出力する。   After the CAM 19 in the encoding processing unit 5 takes in the pre-encoding data D0 that is sequentially input into the pre-encoding data storage area RG2 (see FIG. 8 described later) as a predetermined number of stored data. Execute the matching search process in a batch. Similar to the CAM 11 of the first embodiment, the CAM 19 stores all patterns of pre-encoding data in the reference data storage area RG1 so as to correspond to the encoding tables 13a and 13b. The coincidence detection result signal S19 including the coincidence signal address (coincidence signal address) instructing coincidence with the data is output to the switch 17.

さらに、符号化処理部5は上記一致検索処理時に得られた符号化処理情報S1bをテーブル作成部6に出力する。   Further, the encoding processing unit 5 outputs the encoding processing information S1b obtained during the matching search process to the table creating unit 6.

また、符号化処理部5は内部に2つの符号化テーブル13a,13bを有しており、スイッチ17によって符号化テーブル13a,13bのうち、一方が使用対象符号化テーブルとなり、他方が更新用符号化テーブルとして選択される。したがって、一致検出結果信号S19はスイッチ17によって符号化テーブル13a,13bのうち使用対象符号化テーブルとなっているテーブルに選択的に出力される。   Also, the encoding processing unit 5 has two encoding tables 13a and 13b therein, and one of the encoding tables 13a and 13b becomes a use target encoding table by the switch 17, and the other is an update code. Selected as the conversion table. Therefore, the coincidence detection result signal S19 is selectively output by the switch 17 to the table that is the use target coding table among the coding tables 13a and 13b.

なお、CAM19、RAM13(符号化テーブル13a,13b)間は、実施の形態1における図6の例と同様、CAM19の一致信号線とRAM13のワード線をスイッチ17を介して結線するように構成し、集積度の向上を図ることができる。   The CAM 19 and the RAM 13 (encoding tables 13a and 13b) are configured so that the coincidence signal line of the CAM 19 and the word line of the RAM 13 are connected via the switch 17 as in the example of FIG. Therefore, the integration degree can be improved.

符号化テーブル13a,13bより出力される符号化後データD1は、出力処理部3に取り込まれる。出力処理部3は、符号化後データD1をシフタ31によってバッファ32a,32bの一方に出力し、フル状態になれば他方のバッファに出力先を切り換え、この間、スイッチ33の制御下でフル状態となった一方のバッファから出力データD3として出力する。   The encoded data D1 output from the encoding tables 13a and 13b is taken into the output processing unit 3. The output processing unit 3 outputs the encoded data D1 to one of the buffers 32a and 32b by the shifter 31, and when it becomes full, switches the output destination to the other buffer. During this time, the full state is controlled under the control of the switch 33. The data is output as output data D3 from the one buffer.

テーブル作成部6は、実施の形態1のテーブル作成部2と同様、符号化処理部5の処理と並行し更新用符号化テーブルを作成する処理部である。テーブル作成部6は内部に生起確率算出回路24及び最大値検出/符号割り当てモジュール22を有する。   The table creation unit 6 is a processing unit that creates an update coding table in parallel with the processing of the coding processing unit 5, similarly to the table creation unit 2 of the first embodiment. The table creation unit 6 includes an occurrence probability calculation circuit 24 and a maximum value detection / code assignment module 22 therein.

さらに、テーブル作成部6は、実施の形態1のテーブル作成部2と同様、圧縮効率があらかじめ設定したしきい値を下回った場合に、符号化テーブル13a,13b間における使用対象符号化テーブルと更新用符号化テーブルとの交換処理制御を行う。   Further, as with the table creation unit 2 of the first embodiment, the table creation unit 6 updates the target coding table between the coding tables 13a and 13b when the compression efficiency falls below a preset threshold value. Exchange processing control with the encoding table is performed.

テーブル作成部6内の生起確率算出回路24は、符号化処理部5のCAM19より提供される符号化処理情報S1bに基づき、符号化前データ格納領域RG2(後に示す図8参照)の格納データ(符号化前データD0)の生起確率算出処理を行う。そして、生起確率算出回路24の生起確率算出結果は最大値検出/符号割り当てモジュール22に入力される。   The occurrence probability calculation circuit 24 in the table creation unit 6 stores the data stored in the pre-encoding data storage area RG2 (see FIG. 8 described later) based on the encoding processing information S1b provided from the CAM 19 of the encoding processing unit 5. An occurrence probability calculation process of the pre-encoding data D0) is performed. The occurrence probability calculation result of the occurrence probability calculation circuit 24 is input to the maximum value detection / sign assignment module 22.

最大値検出/符号割り当てモジュール22は、生起確率算出結果に基づき、(符号化前データの内容に対応する)アドレス単位の出現回数(一致回数)を認識し、当該出現回数があらかじめ決めた設定値になるか,カウント可能な最大値(MAX)になるか,もしくは圧縮効率がしきい値を下回った場合に、頻度の大きいものから順にビット長の短いハフマン符号の割り当てを行い,新規の更新用符号化テーブルを作成する。   Based on the occurrence probability calculation result, the maximum value detection / code allocation module 22 recognizes the number of appearances (corresponding number) of the address unit (corresponding to the content of the pre-encoding data) and sets the number of appearances determined in advance. When the maximum countable value (MAX) is reached, or the compression efficiency falls below the threshold value, Huffman codes with shorter bit lengths are assigned in order from the highest frequency to the new update Create an encoding table.

テーブル作成部6による新規符号化テーブル作成処理は、符号化処理部5による符号化処理と並行に実行される。   The new coding table creation processing by the table creation unit 6 is executed in parallel with the coding processing by the coding processing unit 5.

また、参照データ書き換え処理部4は内部にフィードバック回路41を有し、符号化後データD1受け、CAM19に書き換え制御信号S41を与え、CAM19の符号化前データ格納領域RG2(後に示す図8参照)内に符号化前データD0が複数格納されている場合に、一括して符号化後データD1に書き換える書き換え処理を符号化前データ格納領域RG2(後に示す図8参照)内の格納データに対して行う。   The reference data rewrite processing unit 4 has a feedback circuit 41 therein, receives the encoded data D1, gives a rewrite control signal S41 to the CAM 19, and stores the pre-encoding data storage area RG2 of the CAM 19 (see FIG. 8 shown later). When a plurality of pre-encoding data D0 are stored in the storage unit, rewrite processing for rewriting all of the pre-encoding data D1 to the post-encoding data D1 is performed on the storage data in the pre-encoding data storage area RG2 (see FIG. 8 described later). Do.

図8は実施の形態2の符号化装置の詳細構成を示す説明図である。同図に示すように、CAM19は、アドレスデコーダ14、比較レジスタRC、マスクレジスタRM、参照データ格納領域RG1、符号化前データ格納領域RG2、検索結果格納レジスタR1、第2の検索結果格納レジスタである検索結果格納レジスタR2、及びフラグビット格納レジスタR4、一致信号及びアドレス生成回路16から構成される。スイッチ17はセレクタ17a,17bにより構成され、符号化テーブル13a,13bの後段にはセレクタ20が設けられる。   FIG. 8 is an explanatory diagram showing a detailed configuration of the encoding apparatus according to the second embodiment. As shown in the figure, the CAM 19 includes an address decoder 14, a comparison register RC, a mask register RM, a reference data storage area RG1, a pre-encoding data storage area RG2, a search result storage register R1, and a second search result storage register. A search result storage register R2, a flag bit storage register R4, and a coincidence signal and address generation circuit 16 are included. The switch 17 is composed of selectors 17a and 17b, and a selector 20 is provided after the encoding tables 13a and 13b.

比較レジスタRCは、アドレスデコーダ14によって選択された符号化前データ格納領域RG2内の符号処理選択アドレスに格納された符号化前データを取り込み、マスクレジスタRMはマスクするビットを指示するマスクデータを格納する。参照データ格納領域RG1には、符号化前データの全パターンが参照データDR1〜DRnとして格納されている。   The comparison register RC takes in the pre-encoding data stored in the pre-encoding data storage area RG2 selected by the address decoder 14, and the mask register RM stores the mask data indicating the bit to be masked. To do. In the reference data storage area RG1, all patterns of pre-encoding data are stored as reference data DR1 to DRn.

アドレスデコーダ14は読み出し/書き込みアドレスAdをデコードして参照データ格納領域RG1あるいは符号化前データ格納領域RG2用の符号処理選択アドレスを決定する。CAM19は、符号化処理時には符号化前データ格納領域RG2内に格納された符号化前データを比較レジスタRCに順次出力され、比較レジスタRCの比較データDCと参照データ格納領域RG1内の参照データDR1〜DRnとの一致検索処理を行い、書き換え処理時に、比較データDCに一致する符号化前データ格納領域RG2内の格納データを全て符号化後データD1に書き換える。   The address decoder 14 decodes the read / write address Ad to determine a code processing selection address for the reference data storage area RG1 or the pre-encoding data storage area RG2. During the encoding process, the CAM 19 sequentially outputs the pre-encoding data stored in the pre-encoding data storage area RG2 to the comparison register RC, and the comparison data DC of the comparison register RC and the reference data DR1 in the reference data storage area RG1. A match search process with -DRn is performed, and all the stored data in the pre-encoding data storage area RG2 that matches the comparison data DC are rewritten to the encoded data D1 during the rewriting process.

検索結果格納レジスタR1は参照データ格納領域RG1内に格納された参照データDR1〜DRnに対応して、第1の検索結果ビットである検索結果ビットDB1〜DBnを格納するレジスタである。検索結果格納レジスタR1は、内部の検索結果ビットDB1〜DBnを読み出し可能に一致信号及びアドレス生成回路16に接続される。   The search result storage register R1 is a register that stores search result bits DB1 to DBn, which are first search result bits, corresponding to the reference data DR1 to DRn stored in the reference data storage area RG1. The search result storage register R1 is connected to the match signal and address generation circuit 16 so that the internal search result bits DB1 to DBn can be read.

検索結果格納レジスタR2は符号化前データ格納領域RG2(アドレスに対応してm個格納可能と仮定)内に格納された格納データDS1〜DSmに対応して第2の検索結果ビットである検出結果ビットCD1〜CDmを格納するレジスタである。検索結果格納レジスタR2は、内部の検出結果ビットCD1〜CDmを読み出し可能に生起確率算出回路24に接続される。   The search result storage register R2 is a detection result which is a second search result bit corresponding to the storage data DS1 to DSm stored in the pre-encoding data storage area RG2 (assuming that m can be stored corresponding to the address). It is a register for storing bits CD1 to CDm. The search result storage register R2 is connected to the occurrence probability calculation circuit 24 so that the internal detection result bits CD1 to CDm can be read.

一致信号及びアドレス生成回路16は検索結果ビットDB1〜DBnの情報に基づき、一致検索結果ビットDBiに対応するアドレスを一致信号アドレスとし、検索結果が一致したことを示す一致信号S11aと、一致信号アドレスを指示する一致アドレス信号S11bをセレクタ17a,17bに出力する。   Based on the information of the search result bits DB1 to DBn, the match signal and address generation circuit 16 uses the address corresponding to the match search result bit DBi as a match signal address, and a match signal S11a indicating that the search results match, and a match signal address Is output to the selectors 17a and 17b.

セレクタ17a,17bは符号化テーブル13a,13bに対し、活性/非活性を指示するイネーブル信号ENa,ENb、書き込み/読み出しを指示する書き込み信号WRa,WRb、選択アドレスを指示する選択アドレス信号SAa,SAb、書き込みデータを指示する符号データDHa,DHbを出力する。セレクタ17a,17bの活性/非活性は制御回路25からの制御信号S25によって制御される。   The selectors 17a and 17b provide the encoding tables 13a and 13b with enable signals ENa and ENb for instructing activation / inactivation, write signals WRa and WRb for instructing writing / reading, and selection address signals SAa and SAb for instructing selection addresses. The code data DHa and DHb for instructing write data are output. The activation / inactivation of the selectors 17a and 17b is controlled by a control signal S25 from the control circuit 25.

符号化テーブル13a,13bはセレクタ17a,17bからの各種信号に基づき、読み出しデータD13a,D13bをセレクタ20に出力する。セレクタ20は制御回路25からの制御信号S32に基づき、読み出しデータD13a,D13bのうちの一方を符号化後データD1として出力する。   The encoding tables 13a and 13b output read data D13a and D13b to the selector 20 based on various signals from the selectors 17a and 17b. Based on the control signal S32 from the control circuit 25, the selector 20 outputs one of the read data D13a and D13b as the encoded data D1.

生起確率算出回路24は検索結果格納レジスタR2の検出結果ビットCD1〜CDm及び一致アドレス信号S11bに基づき、参照データDR1〜DRnのうち一致アドレス信号S11bの指示する参照データ(符号化前データ)の一致回数(出現回数)をカウントする生起確率算出処理を行う。したがって、符号化処理情報S1bは、検出結果ビットCD1〜CDm及び一致アドレス信号S11bとなる。なお、一致アドレス信号S11bの代わりに比較データDCやセット状態の格納データDS等を取り込んでもよい。   The occurrence probability calculation circuit 24 matches the reference data (pre-encoding data) indicated by the match address signal S11b among the reference data DR1 to DRn based on the detection result bits CD1 to CDm and the match address signal S11b of the search result storage register R2. An occurrence probability calculation process for counting the number of times (number of appearances) is performed. Therefore, the encoding process information S1b is the detection result bits CD1 to CDm and the coincidence address signal S11b. Note that the comparison data DC, the stored data DS in the set state, or the like may be fetched instead of the coincidence address signal S11b.

最大値検出/符号割り当てモジュール22は、生起確率算出回路24より得られる生起確率算出結果に基づき、カウント値の大きいカウンタCTに対応するアドレス(符号前データ)から順にハフマン符号を割り当てることにより、ハフマン符号による新たな更新用符号化テーブルを作成し、当該更新用符号化テーブル作成用の符号用アドレス信号S22a、符号用データ信号S22bをセレクタ17a,17bに出力する。   The maximum value detection / code assignment module 22 assigns a Huffman code in order from the address (pre-code data) corresponding to the counter CT having a large count value based on the occurrence probability calculation result obtained from the occurrence probability calculation circuit 24. A new update coding table is created using codes, and the code address signal S22a and code data signal S22b for creating the update coding table are output to the selectors 17a and 17b.

制御回路25は符号化後データD1、閾値データD21、設定値データD22を受けるとともに、最大値検出/符号割り当てモジュール22から制御信号S22cを受け、これらの信号に基づき、最大値検出/符号割り当てモジュール22に情報伝達信号S23を、セレクタ17a,17bに制御信号S25を、セレクタ20に制御信号S32を、生起確率算出回路24に制御信号S20を、フラグビット格納レジスタR4及び生起確率算出回路24にリセット信号S26を与える。なお、情報伝達信号S23には閾値データD21、設定値データD22及び符号化後データD1等の情報が含まれる。   The control circuit 25 receives the encoded data D1, the threshold data D21, and the set value data D22, and also receives the control signal S22c from the maximum value detection / code allocation module 22, and based on these signals, the maximum value detection / code allocation module 22, the information transmission signal S 23, the control signals S 25 to the selectors 17 a and 17 b, the control signal S 32 to the selector 20, the control signal S 20 to the occurrence probability calculation circuit 24, and the flag bit storage register R 4 and the occurrence probability calculation circuit 24 to reset. Signal S26 is provided. The information transmission signal S23 includes information such as threshold data D21, set value data D22, and encoded data D1.

さらに、制御回路25及び符号化後データD1がCAM19に帰還する信号線50と共に、参照データ書き換え処理部4内のフィードバック回路41として機能し、書き換えを指示する書き換え制御信号S41をCAM19に与え、符号化前データ格納領域RG2内に比較レジスタRC内の比較データDCと同一値をとる格納データDSが複数存在する場合、当該格納データを符号化後データD1に置き換える書き換え処理を実行させる。   Further, it functions as a feedback circuit 41 in the reference data rewrite processing unit 4 together with the control circuit 25 and the signal line 50 through which the encoded data D1 is fed back to the CAM 19, and gives a rewrite control signal S41 instructing rewrite to the CAM 19, When there are a plurality of storage data DS having the same value as the comparison data DC in the comparison register RC in the pre-encoding data storage area RG2, a rewrite process is executed to replace the stored data with the encoded data D1.

セレクタ17a,17bは制御信号S25に基づき、一方は一致信号及びアドレス生成回路16からの一致信号S11a及び一致アドレス信号S11bに基づく符号化処理用に機能し、他方は最大値検出/符号割り当てモジュール22からの符号用アドレス信号S22a及び符号用データ信号S22bに基づく符号化テーブル更新処理用に機能する。   The selectors 17a and 17b function based on the control signal S25, one functions for encoding processing based on the coincidence signal and the coincidence signal S11a and the coincidence address signal S11b from the address generation circuit 16, and the other functions as the maximum value detection / code allocation module 22. Functions for an encoding table update process based on the encoding address signal S22a and the encoding data signal S22b.

図9は実施の形態2の符号化装置における符号化処理及び符号化テーブル作成処理を示すフローチャートである。以下、同図を参照して、実施の形態2の動作について詳述する。なお、説明の都合上、現在の使用対象符号化テーブルを符号化テーブル13a、更新用符号化テーブルを符号化テーブル13bと仮定する。なお、図9で述べる処理は、全体的な制御は制御回路25によって行われ、個々の動作は符号化処理部5、テーブル作成部6、出力処理部3及び参照データ書き換え処理部4によってそれぞれ実行される。また、図9において、各構成部3〜6の実行として便宜上分類していているが、実際には他の構成部が行う場合もある。   FIG. 9 is a flowchart showing an encoding process and an encoding table creation process in the encoding apparatus according to the second embodiment. Hereinafter, the operation of the second embodiment will be described in detail with reference to FIG. For convenience of explanation, it is assumed that the current use target encoding table is the encoding table 13a and the update encoding table is the encoding table 13b. 9, the overall control is performed by the control circuit 25, and each operation is executed by the encoding processing unit 5, the table creation unit 6, the output processing unit 3, and the reference data rewrite processing unit 4, respectively. Is done. In FIG. 9, the execution of each of the components 3 to 6 is classified for convenience, but other components may actually be performed in practice.

図9のステップST21において、符号化前データD0を順次取り込み、符号化前データ格納領域RG2内にアドレスに対応させて格納データDS1〜DSmを格納するするデータセット処理を行う。   In step ST21 in FIG. 9, pre-encoding data D0 is sequentially fetched, and data set processing is performed for storing the storage data DS1 to DSm in association with addresses in the pre-encoding data storage area RG2.

次に、ステップST22において、セレクタ17a,17bは、最大値検出/符号割り当てモジュール22からの制御信号S22c及び制御回路25からの制御信号S25を介して、「圧縮効率≦しきい値」である(YES)か否か(NO)を認識し、YESの場合はステップST23に移行し、NOの場合はステップST32で符号化テーブルの交換処理(使用対象の符号化テーブルが符号化テーブル13aを符号化テーブル13bに変更する処理)を行った後、ステップST23に移行する。   Next, in step ST22, the selectors 17a and 17b satisfy “compression efficiency ≦ threshold” via the control signal S22c from the maximum value detection / code allocation module 22 and the control signal S25 from the control circuit 25 ( YES or NO (NO). If YES, the process proceeds to step ST23. If NO, the encoding table exchange process (the encoding table to be used encodes the encoding table 13a) in step ST32. After performing the process of changing to the table 13b, the process proceeds to step ST23.

そして、ステップST23において、CAM19を読み出し/書き込みアドレスAdに基づく符号化前データ格納領域RG2からのデータ読み出しモードに設定した後、読み出し/書き込みアドレスAdのアドレスを初期値“0”に設定する。   In step ST23, the CAM 19 is set to the data read mode from the pre-encoding data storage area RG2 based on the read / write address Ad, and then the address of the read / write address Ad is set to the initial value “0”.

そして、ステップST24において、読み出し/書き込みアドレスAd(=“0”)に対応するフラグビット格納レジスタR4内のビットが“1”であるか(YES)否か(NO)をチェックし、NOであれば符号化後データD1への置き換え前と判断しステップST25に移行し、YESであれば符号化後データD1への置き換え後と判断しステップST27に移行する。   In step ST24, it is checked whether the bit in the flag bit storage register R4 corresponding to the read / write address Ad (= “0”) is “1” (YES) or not (NO). For example, it is determined that the data is not replaced with the encoded data D1, and the process proceeds to step ST25.

ステップST25において、CAM19内で読み出し/書き込みアドレスAdで指定された符号化前データ格納領域RG2内の格納データDSを比較レジスタRCの比較データDCとして読み出し、この比較データDCと参照データ格納領域RG1の参照データDR1〜DRnとの一致検索を行う。   In step ST25, the storage data DS in the pre-encoding data storage area RG2 designated by the read / write address Ad in the CAM 19 is read as the comparison data DC of the comparison register RC, and the comparison data DC and the reference data storage area RG1 are read. A match search with reference data DR1 to DRn is performed.

一致検索において、参照データ格納領域RG1内の参照データのいずれかと比較データDCとは必ず一致し、一致した参照データ(一致参照データDRi(i=1〜nのいずれか))に対応する検索結果格納レジスタR1の一致検索結果ビットDBiが“1”(セット状態)に設定される。図8では比較データDCである“000…001”に対応する検索結果格納レジスタR1内の検索結果ビット(DB)が“1”に設定されている。   In the match search, any of the reference data in the reference data storage area RG1 and the comparison data DC always match, and the search result corresponding to the matched reference data (matched reference data DRi (any of i = 1 to n)). The match search result bit DBi of the storage register R1 is set to “1” (set state). In FIG. 8, the search result bit (DB) in the search result storage register R1 corresponding to the comparison data DC “000... 001” is set to “1”.

同時に、符号化前データ格納領域RG2内に“000…001”が少なくとも一つ存在し、“000…001”に対応する検索結果格納レジスタR2内の格納データDSに対応する検索結果ビットCDが全て“1”(セット状態)に設定される。図8の例では、符号化前データ格納領域RG2内に格納データDSして“000…001”を示す同一データが2つ格納され、検索結果格納レジスタR2が2箇所で“1”にセットされている例を示している。   At the same time, there is at least one “000... 001” in the pre-encoding data storage area RG2, and all the search result bits CD corresponding to the stored data DS in the search result storage register R2 corresponding to “000. Set to “1” (set state). In the example of FIG. 8, two identical data indicating “000... 001” are stored as the stored data DS in the pre-encoding data storage area RG2, and the search result storage register R2 is set to “1” at two locations. An example is shown.

その後、ステップST26において、実施の形態1のステップST4と同様に、符号化テーブル13aへの一致信号アドレスへの送信処理を行う。   Thereafter, in step ST26, as in step ST4 of the first embodiment, transmission processing to the coincidence signal address to the encoding table 13a is performed.

その後、ステップST31において、符号化テーブル13aを参照して、選択アドレス信号SAaで指示されたアドレスに格納された符号データが読み出しデータD13aとしてセレクタ20に出力され、セレクタ20は制御回路25からの制御信号S32に従い、読み出しデータD13aを符号化後データD1として出力する。そして、最終的に出力処理部3から出力データD3が出力される。   Thereafter, in step ST31, referring to the encoding table 13a, the encoded data stored at the address indicated by the selection address signal SAa is output to the selector 20 as read data D13a, and the selector 20 is controlled by the control circuit 25. In accordance with the signal S32, the read data D13a is output as the encoded data D1. Finally, output data D3 is output from the output processing unit 3.

また、ステップST26後のステップST30において、出力処理部3によるステップST31の処理と並行してフィードバック回路41として機能する制御回路25及び信号線50による書き換え処理が実行される。   Further, in step ST30 after step ST26, rewriting processing by the control circuit 25 and the signal line 50 functioning as the feedback circuit 41 is executed in parallel with the processing of step ST31 by the output processing unit 3.

すなわち、制御回路25はCAM19に書き換え制御信号S41を与えることにより、信号線50を介してCAM19に符号化後データD1を与え、符号化前データ格納領域RG2内において符号処理選択アドレス以外に“000…001”を格納している格納データDS(比較データDCと一致するデータ)が存在する場合、符号化後データD1に書き換える書き換え処理を実行させ、対応する参照データ書き換え処理部4のフラグビットを“1”(セット状態)に設定する。   That is, the control circuit 25 gives the rewritten control signal S41 to the CAM 19 to give the encoded data D1 to the CAM 19 via the signal line 50, and “000” in addition to the code processing selection address in the pre-encoding data storage area RG2. When there is storage data DS (data matching the comparison data DC) storing... 001 ”, a rewrite process for rewriting the encoded data D1 is executed, and the flag bit of the corresponding reference data rewrite processing unit 4 is set. Set to “1” (set state).

以下、図8を例にして具体例を説明する、読み出し/書き込みアドレスAdで規定される符号処理選択アドレスがアドレスADpがある場合に、他のアドレスADqも“000…001”を格納している(検索結果格納レジスタR2内の検索結果ビットCDにより認識可能)ため、符号化後データD1に書き換え、当該アドレスADp及びアドレスADqに対応するフラグビット格納レジスタR4のビットを“1”に設定する。   Hereinafter, a specific example will be described using FIG. 8 as an example. When the code processing selection address defined by the read / write address Ad is the address ADp, the other addresses ADq also store “000... 001”. (Recognized by the search result bit CD in the search result storage register R2) Therefore, it is rewritten to the encoded data D1, and the bit of the flag bit storage register R4 corresponding to the address ADp and the address ADq is set to “1”.

ステップST24でYESと判定された場合に実行されるステップST27において、符号処理選択アドレスは符号化後データD1への書き換え処理(前述したステップST30の処理)が既になされているため、符号化前データ格納領域RG2内における符号処理選択アドレスに対応する格納データDSをそのままレジスタ26に読み出し、レジスタ26に格納されたレジスタ格納符号化後データD26をセレクタ20を介して符号化後データD1として読み出す。   In step ST27, which is executed when YES is determined in step ST24, the encoding process selection address has already been rewritten to the encoded data D1 (the process in step ST30 described above). The storage data DS corresponding to the code processing selection address in the storage area RG2 is read as it is into the register 26, and the register storage encoded data D26 stored in the register 26 is read out as the encoded data D1 via the selector 20.

この際、図8では図示しないが、レジスタ26からレジスタ格納符号化後データD26を出力した旨の情報が制御回路25に与えられることにより、制御回路25によってセレクタ20はレジスタ格納符号化後データD26を符号化後データD1として出力する。   At this time, although not shown in FIG. 8, information indicating that the register storage encoded data D26 is output from the register 26 is given to the control circuit 25, whereby the control circuit 25 causes the selector 20 to register the register storage encoded data D26. Is output as encoded data D1.

その後、ステップST28において符号処理選択アドレスが最終アドレス(m−1)に到達したか(YES)否か(NO)をチェックし、YESであれば、制御回路25からリセット信号S26を与えることにより、フラグビット格納レジスタR4の全フラグを“0”にリセットした後、ステップST21に戻る。   Thereafter, in step ST28, it is checked whether the code processing selection address has reached the final address (m-1) (YES) or not (NO). If YES, a reset signal S26 is given from the control circuit 25, After all the flags of the flag bit storage register R4 are reset to “0”, the process returns to step ST21.

ステップST28においてNOであれば、ステップST29で符号処理選択アドレスを1インクリメントした後、ステップST24に戻る。   If “NO” in the step ST28, the code processing selection address is incremented by 1 in a step ST29, and then the process returns to the step ST24.

一方、テーブル作成部6の生起確率算出回路24は、符号化処理部5によるステップST25の一致検索処理に並行して、ステップST33において、ステップST25の比較データDCと同一値をとる符号化前データ格納領域RG2内の格納データDSの数(一致データ数)をカウントしてカウント値(生起確率算出結果)を最大値検出/符号割り当てモジュール22に出力する。   On the other hand, the occurrence probability calculation circuit 24 of the table creation unit 6 performs pre-encoding data that takes the same value as the comparison data DC of step ST25 in step ST33 in parallel with the matching search process of step ST25 by the encoding processing unit 5. The number of stored data DS (number of coincidence data) in the storage area RG 2 is counted and the count value (occurrence probability calculation result) is output to the maximum value detection / code allocation module 22.

そして、ステップST34において、最大値検出/符号割り当てモジュール22は、生起確率算出回路24からのカウント値と一致信号及びアドレス生成回路16からの一致アドレス信号S11bとに基づき、一致信号アドレス(に規定される符号化前データ)に対応するカウント数を認識する。このように、最大値検出/符号割り当てモジュール22は、生起確率算出回路24からのカウント結果と一致アドレス信号S11bとに基づき、参照データ格納領域RG1のアドレスに対応するカウント数を順次認識することができる。   Then, in step ST34, the maximum value detection / code allocation module 22 is defined as a match signal address (based on the count value from the occurrence probability calculation circuit 24 and the match signal and the match address signal S11b from the address generation circuit 16). The number of counts corresponding to the data before encoding). As described above, the maximum value detection / sign assignment module 22 sequentially recognizes the count number corresponding to the address of the reference data storage region RG1 based on the count result from the occurrence probability calculation circuit 24 and the coincidence address signal S11b. it can.

そして、ステップST35で、参照データ格納領域RG1内の各アドレスに対応するカウント値のいずれかが設定値(設定値データD22で規定)に達するか(YES)否か(NO)、ステップST36で参照データ格納領域RG1のアドレスに対応するカウント値のいずれかカウント可能な最大値(MAX)に達するか(YES)否か(NO)、ステップST37で圧縮効率がしきい値(閾値データD21で規定)を下回っているか(YES)否か(NO)がチェックされる。   Then, in step ST35, whether or not any of the count values corresponding to each address in the reference data storage area RG1 reaches the set value (specified by the set value data D22) (YES) or not (NO). Whether the count value corresponding to the address of the data storage area RG1 reaches the maximum countable value (MAX) (YES) or not (NO), the compression efficiency is a threshold value (specified by the threshold data D21) in step ST37. It is checked whether it is below (YES) or not (NO).

そして、ステップST35,あるいはST36でYES、又はステップST37でNOと判定されると、ステップST38の処理に移行する。   If YES is determined in step ST35 or ST36, or NO is determined in step ST37, the process proceeds to step ST38.

ステップST38において、最大値検出/符号割り当てモジュール22は、生起確率算出回路24より得られる生起確率算出結果(カウント値)に基づき、カウント値の大きいカウンタCTに対応するアドレスから順にハフマン符号を割り当てることにより、更新用符号化テーブル用のハフマン符号による符号化テーブルを新たに作成する。   In step ST38, the maximum value detection / sign assignment module 22 assigns the Huffman codes in order from the address corresponding to the counter CT having a large count value, based on the occurrence probability calculation result (count value) obtained from the occurrence probability calculation circuit 24. Thus, a new encoding table using the Huffman code for the update encoding table is created.

そして、ステップST39に移行し、ステップST38で作成された新規符号化テーブルに基づき、アドレスを規定する符号用アドレス信号S22aと、アドレスに対応する符号データを規定する符号用データ信号S22bとをセレクタ17a,17bに出力することにより、符号化テーブル更新処理を実行する。   Then, the process proceeds to step ST39, and on the basis of the new coding table created in step ST38, the code address signal S22a for defining the address and the code data signal S22b for defining the code data corresponding to the address are selected by the selector 17a. , 17b, the encoding table update process is executed.

現在の更新用符号化テーブルは符号化テーブル13bであるため、セレクタ17bは活性状態を指示するイネーブル信号ENb、書き込みを指示する書き込み信号WRbにするとともに、符号用アドレス信号S22aにより規定されたアドレスを指示する選択アドレス信号SAb、及び符号用データ信号S22bにより規定された符号データを指示する符号データDHbを、符号化テーブル13bに順次出力することにより、符号化テーブル13bの内容を更新する。   Since the current update coding table is the coding table 13b, the selector 17b uses the enable signal ENb for instructing the active state and the write signal WRb for instructing the writing, and the address defined by the coding address signal S22a. The contents of the encoding table 13b are updated by sequentially outputting to the encoding table 13b the code data DHb indicating the code data defined by the selection address signal SAb and the code data signal S22b.

その後、ステップST32に移行し、ステップST38の実行原因がステップST37がNOの場合(圧縮効率がしきい値を下回っていた場合)、使用対象の符号化テーブルを符号化テーブル13aから符号化テーブル13bに切り換える。なお、ステップST39後にステップST32が実行される場合は、ステップST32で終了し、ステップST23に移行することはない。ステップST23に移行するのはステップST22でNOと判断され後にステップST32が実行された場合のみである。   Thereafter, the process proceeds to step ST32, and when the cause of execution of step ST38 is NO in step ST37 (when the compression efficiency is lower than the threshold value), the encoding table to be used is changed from the encoding table 13a to the encoding table 13b. Switch to. In addition, when step ST32 is performed after step ST39, it complete | finishes at step ST32 and does not transfer to step ST23. The process moves to step ST23 only when step ST32 is executed after NO is determined in step ST22.

このように、実施の形態2の符号化装置においては、CAM19内に一旦格納される符号化前データD0に対し、リアルタイムに符号化処理部5によって符号化を行いながら,圧縮効率を維持するために,常に最適な符号化テーブルをテーブル作成部6によって用意することが可能となる。   As described above, in the encoding apparatus according to the second embodiment, the pre-encoding data D0 temporarily stored in the CAM 19 is encoded by the encoding processing unit 5 in real time to maintain the compression efficiency. In addition, it is possible to always prepare an optimal encoding table by the table creation unit 6.

その結果、静的ハフマン符号化や適応型ハフマン符号化の問題点を解決し、ハフマン符号化処理の高速化を達成するとともに、高い圧縮効率を維持することのできるハフマン符号化に適した符号化装置を得ることができる。   As a result, coding suitable for Huffman coding that solves the problems of static Huffman coding and adaptive Huffman coding, achieves high-speed Huffman coding processing, and maintains high compression efficiency. A device can be obtained.

さらに、参照データ書き換え処理部4によって、既に符号化後データD1に符号化された符号化前データD0と同一値のデータが符号化前データ格納領域RG2に複数存在する場合に、符号化前データ格納領域RG2内の符号化前データD0を符号化後データD1に書き換えることにより、符号化処理部5による符号化処理を不要にできる分、より高速な符号処理が実現可能となる。   Furthermore, when the reference data rewrite processing unit 4 includes a plurality of data having the same value as the pre-encoding data D0 that has already been encoded into the post-encoding data D1, the pre-encoding data By rewriting the pre-encoding data D0 in the storage area RG2 to the post-encoding data D1, the encoding process by the encoding processing unit 5 can be made unnecessary, so that a higher-speed encoding process can be realized.

(生起確率算出回路の詳細)
(第1の態様)
図10は生起確率算出回路24の第1の態様を示す回路図である。同図に示すように、生起確率算出回路24は、クロックCLKを共通に入力し、制御回路25からのリセット信号S26を共通にリセット入力に受ける、m段の直列接続のフリップフロップFF1〜FFmより構成される。
(Details of occurrence probability calculation circuit)
(First aspect)
FIG. 10 is a circuit diagram showing a first mode of the occurrence probability calculation circuit 24. As shown in the figure, the occurrence probability calculation circuit 24 is input from m stages of serially connected flip-flops FF1 to FFm that receive the clock CLK in common and receive the reset signal S26 from the control circuit 25 in common at the reset input. Composed.

フリップフロップFF1〜FFmは、符号化処理情報S1bとして検索結果格納レジスタR2内の検出結果ビットCD1〜CDmを入力し、外部より受けるクロックCLKの入力により取り込んだビットデータを次段のフリップフロップに出力し、フリップフロップFFmの出力がカウンタ27に与えられる。   The flip-flops FF1 to FFm receive the detection result bits CD1 to CDm in the search result storage register R2 as the encoding processing information S1b, and output the bit data received by the input of the clock CLK received from the outside to the flip-flop of the next stage. Then, the output of the flip-flop FFm is given to the counter 27.

したがって、m回分のクロックCLKをフリップフロップFF1〜FFmに与え、フリップフロップFFmの出力データに現れる“1”をカウンタ27がカウントすることにより、フリップフロップFF1〜FFmに取り込まれた検出結果ビットCD1〜CDmにおける“1”(セット状態)の個数をカウントすることができる。   Therefore, when m clocks CLK are supplied to the flip-flops FF1 to FFm, and the counter 27 counts “1” appearing in the output data of the flip-flop FFm, the detection result bits CD1 to CD1 taken into the flip-flops FF1 to FFm are obtained. The number of “1” (set state) in CDm can be counted.

このように、生起確率算出回路24の第1の態様は、一致信号アドレスに対応する参照データDRに一致する格納データDSが符号化前データ格納領域RG2内に幾つ存在するかを示す一致データ数をカウント値として得ることができるため、最新の符号化前データD0の出現情報を正確かつ高速に認識可能な生起確率算出処理を行うことができる。   As described above, the first aspect of the occurrence probability calculation circuit 24 is the number of coincidence data indicating how many storage data DS matching the reference data DR corresponding to the coincidence signal address exist in the pre-encoding data storage area RG2. Can be obtained as the count value, and the occurrence probability calculation process capable of accurately and rapidly recognizing the appearance information of the latest pre-encoding data D0 can be performed.

このカウンタ27によりカウント値が最大値検出/符号割り当てモジュール22に与えられる。図10で示す第1の態様は、1単位のシフトレジスタを構成するフリップフロップFF1〜FFmとカウンタ27のみで実現できるため、実装が単純という利点があり,リソースの消費をできるだけ抑え削減する場合や,より小さい実装を目指す場合に有効である。   The counter 27 provides the count value to the maximum value detection / sign assignment module 22. The first mode shown in FIG. 10 can be realized only by the flip-flops FF1 to FFm and the counter 27 that constitute one unit of shift register. Therefore, there is an advantage that the implementation is simple. This is effective when aiming for a smaller implementation.

(第2の態様)
図11は生起確率算出回路24の第2の態様を示す回路図である。同図に示すように、k個のシフトレジスタSR1〜SRkを設けている。シフトレジスタSR1〜SRkはそれぞれ図10で示すフリップフロップFF1〜FFmと等価な回路で構成され、シフトレジスタSR1〜SRkはそれぞれ符号化処理情報S1bを受ける。
(Second aspect)
FIG. 11 is a circuit diagram showing a second mode of the occurrence probability calculation circuit 24. As shown in the figure, k shift registers SR1 to SRk are provided. Shift registers SR1 to SRk are each configured by a circuit equivalent to flip-flops FF1 to FFm shown in FIG. 10, and shift registers SR1 to SRk receive encoding process information S1b, respectively.

シフトレジスタSR1〜SRkの出力を選択的カウント部であるサブカウンタSCT1〜SCTkが受け、サブカウンタSCT1〜SCTkの出力をセレクタ28を受け、セレクタ28の出力が最大値検出/符号割り当てモジュール22に付与される。   The outputs of the shift registers SR1 to SRk are received by the subcounters SCT1 to SCTk which are selective counting units, the outputs of the subcounters SCT1 to SCTk are received by the selector 28, and the output of the selector 28 is given to the maximum value detection / sign assignment module 22 Is done.

シフトレジスタSR1〜SRkは制御回路25の制御信号S20aによって動作(格納動作、シフト動作)制御され、セレクタ28は制御信号S20bによってサブカウンタSCT1〜SCTkのうち、選択すべきサブカウンタSCTの内容が制御される。制御信号S20a及び20bは図8の制御信号S20に相当する。   The shift registers SR1 to SRk are controlled by the control signal S20a of the control circuit 25 (storage operation, shift operation), and the selector 28 controls the contents of the subcounter SCT to be selected among the subcounters SCT1 to SCTk by the control signal S20b. Is done. The control signals S20a and 20b correspond to the control signal S20 in FIG.

このような構成において、第2の態様は、シフトレジスタSR1〜SRkに対しパイプライン処理を実行させ、符号化処理情報S1bを入力する一のシフトレジスタSRと、シフト動作を行う他のシフトレジスタSRとをそれぞれ独立に動作させる。例えば、シフトレジスタSR1,SR3〜SRkがカウント処理(シフト動作)を行っているときに、シフトレジスタSR2に符号化処理情報S1bを取り込ませる。そして、シフトレジスタSR2についてカウント処理動作を始めると、他のカウント処理が終了しているシフトレジスタSRに符号化処理情報S1bを取り込ませる。   In such a configuration, in the second mode, the shift registers SR1 to SRk are subjected to pipeline processing, and one shift register SR that receives the encoding processing information S1b and the other shift register SR that performs the shift operation. And are operated independently. For example, when the shift registers SR1, SR3 to SRk are performing the count process (shift operation), the shift register SR2 is caused to capture the encoding process information S1b. When the count processing operation is started with respect to the shift register SR2, the encoding processing information S1b is taken into the shift register SR that has completed other count processing.

そして、サブカウンタSCT1〜SCTkのうち、対応するシフトレジスタSRからのカウント処理が終了したサブカウンタSCTを、セレクタ28により選択させ、カウント処理が終了したサブカウンタSCTのカウント値が順次最大値検出/符号割り当てモジュール22に与えられる。   Then, among the sub-counters SCT1 to SCTk, the selector 28 selects the sub-counter SCT for which the counting process from the corresponding shift register SR has been completed, and the count value of the sub-counter SCT for which the counting process has been completed is Is provided to the code allocation module 22.

この様に,シフトレジスタSR1〜SRk間において、符号化処理情報S1bの格納とカウント処理とを重複することなくパインラインカウンティング処理を実行させることにより、第1の態様に比べ処理時間を短縮することができる。   In this way, the processing time can be shortened compared to the first mode by executing the pineline counting process between the shift registers SR1 to SRk without overlapping the storing of the encoding process information S1b and the counting process. Can do.

(第3の態様)
図12は生起確率算出回路24の第3の態様を示す回路図である。同図に示すように部分シフトレジスタSSR1〜SSRj(2≦j<m)及び並列カウント部である部分カウンタPCT1〜PCTjにより構成され、部分シフトレジスタSSR1〜SSRjは符号化処理情報S1bがj分割されたビット検出結果群CDG1〜CDGjを受ける。部分カウンタPCT1〜PCTjは部分シフトレジスタSSR1〜SSRjの出力側に設けられる。
(Third aspect)
FIG. 12 is a circuit diagram showing a third mode of the occurrence probability calculation circuit 24. As shown in the figure, it is composed of partial shift registers SSR1 to SSRj (2 ≦ j <m) and partial counters PCT1 to PCTj which are parallel count units. In the partial shift registers SSR1 to SSRj, encoding processing information S1b is divided into j. Bit detection result groups CDG1 to CDGj are received. Partial counters PCT1 to PCTj are provided on the output side of partial shift registers SSR1 to SSRj.

ALU29は部分カウンタPCT1〜PCTjの出力を受け、その合計値をカウント値として最大値検出/符号割り当てモジュール22に付与する。   The ALU 29 receives the outputs of the partial counters PCT1 to PCTj, and gives the total value to the maximum value detection / sign assignment module 22 as a count value.

第3の態様では、部分シフトレジスタSSR1〜SSRj及び部分カウンタPCT1〜PCTjがそれぞれカウントすべきビット数は(m/j)であり、それぞれ並列動作可能である。したがって、第3の態様では、第1の態様のフリップフロップFF1〜FFmをj分割することにより、レイテンシを1/jに削減することができ、高速なカウントが可能となる効果を奏する。   In the third mode, the number of bits to be counted by the partial shift registers SSR1 to SSRj and the partial counters PCT1 to PCTj is (m / j), respectively, and can be operated in parallel. Therefore, in the third mode, by dividing the flip-flops FF1 to FFm of the first mode into j, the latency can be reduced to 1 / j and the high-speed counting can be achieved.

第3の態様は、符号化前データD0の内容によっては圧縮効率の変化が急であったり,既存の符号化テーブルとデータの傾向が合わない場合等に特に有効である。   The third aspect is particularly effective when the compression efficiency changes suddenly depending on the content of the pre-encoding data D0, or when the data tendency does not match the existing encoding table.

(第4の態様)
図13は生起確率算出回路24の第4の態様を示す回路図である。同図に示すように、検出結果ビットCD1〜CDmに対応してレジスタCR1〜CRmを設け、レジスタCR1〜CRmにおいて隣接する2つのレジスタCR間の出力を加算可能に複数の加算器群AD1からなる第1の加算器群を設ける、さらに、第1の加算器1群において隣接する2つの加算器AD1,AD1の出力を加算可能に接続した二段目の加算器AD2からなる第2の加算器群を設ける、以降同様に、p段のADp(2p≧m)を設ける。なお、第1〜第pの加算器群を構成する加算器AD1〜ADpは段数が増えることに加算可能ビット数を1ビットずつ増やす必要がある。
(Fourth aspect)
FIG. 13 is a circuit diagram showing a fourth mode of the occurrence probability calculation circuit 24. As shown in the figure, registers CR1 to CRm are provided corresponding to the detection result bits CD1 to CDm, and the registers CR1 to CRm are composed of a plurality of adder groups AD1 that can add outputs between two adjacent registers CR. A second adder comprising a second adder AD2 provided with a first adder group and further connected so that the outputs of two adders AD1 and AD1 adjacent in the first adder group 1 can be added; A group is provided, and thereafter, similarly, p-stage ADp (2 p ≧ m) is provided. The adders AD1 to ADp constituting the first to pth adder groups need to increase the number of bits that can be added by one bit as the number of stages increases.

そして、加算器ADpの出力がカウント値として最大値検出/符号割り当てモジュール22に付与される。なお、レジスタCR1〜CRm及び加算器(群)AD1〜ADpは制御回路25のリセット信号S26よって適宜リセット制御される。   Then, the output of the adder ADp is given to the maximum value detection / sign assignment module 22 as a count value. The registers CR1 to CRm and the adders (groups) AD1 to ADp are appropriately reset by a reset signal S26 of the control circuit 25.

このように、加算器AD1〜ADpからなる第1〜第pの加算器群をツリー上に配置した組み合わせ回路を用いて、符号化処理情報S1b(検出結果ビットCD1〜CDm)に基づくカウント値を得ることができる。また、第1〜第pの加算器群の各段の間にレジスタを挿入することにより、パイプライン処理を行いスループットを向上することも可能である。   As described above, the count value based on the encoding processing information S1b (detection result bits CD1 to CDm) is calculated using a combinational circuit in which the first to pth adder groups including the adders AD1 to ADp are arranged on the tree. Obtainable. Further, by inserting a register between each stage of the first to pth adder groups, it is possible to perform pipeline processing and improve throughput.

(第5の態様)
図14及び図15は生起確率算出回路24の第5の態様を示す説明図及びブロック図である。第5の態様では、図14で示すように取り込まれた符号化前データ格納領域RG2内の格納データを、図15に示すように、降順にソーティングした後に、カウント値を求めている。なお、CAM19による最大値検索は,マスクを用いて格納データの一番左のビット (MSB: Most Significant Bit)から比較を始めて,右へ順々に検索データを“1”にして検索していくことにより行えるため、降順のソーティングを比較的容易に実現することができる。
(5th aspect)
14 and 15 are an explanatory diagram and a block diagram showing a fifth mode of the occurrence probability calculation circuit 24. FIG. In the fifth aspect, the count value is obtained after the stored data in the pre-encoding data storage area RG2 fetched as shown in FIG. 14 is sorted in descending order as shown in FIG. In the maximum value search by the CAM 19, a comparison is started from the leftmost bit (MSB: Most Significant Bit) of stored data using a mask, and the search data is sequentially set to “1” to the right. Therefore, sorting in descending order can be realized relatively easily.

図15に示すよう符号化前データ格納領域RG2内をソーティングすると、一致検索時において、検索結果格納レジスタR2内のデータは、検索結果格納レジスタR2内において比較データDCと同一データに関しては“1”が連続してアドレス順に配置されることとなる。   When the pre-encoding data storage area RG2 is sorted as shown in FIG. 15, the data in the search result storage register R2 is “1” for the same data as the comparison data DC in the search result storage register R2 at the time of matching search. Are successively arranged in the order of addresses.

最大及び最小一致アドレス生成回路30は検索結果格納レジスタR2内において“1”を示すビット検出結果CDに対応する最大アドレスをスイッチ38を介してレジスタ39に出力し、“1”を示すビット検出結果CDに対応する最小アドレスをスイッチ38を介して減算器40に出力する。減算器40は、最大アドレスと最小アドレスとの差分値に基づき、“1”を示すビット検出結果CDの個数であるカウント値を求め、最大値検出/符号割り当てモジュール22に出力する。   The maximum and minimum coincidence address generation circuit 30 outputs the maximum address corresponding to the bit detection result CD indicating “1” in the search result storage register R2 to the register 39 via the switch 38, and the bit detection result indicating “1”. The minimum address corresponding to the CD is output to the subtracter 40 via the switch 38. The subtractor 40 obtains a count value that is the number of bit detection results CD indicating “1” based on the difference value between the maximum address and the minimum address, and outputs the count value to the maximum value detection / code allocation module 22.

このように、第5の態様は、カウント部を構成する一致信号及びアドレス生成回路30、スイッチ38、レジスタ39及び減算器40によって、データ比較時における“1”が設定された検出結果ビットCD1〜CDmの最大/最小アドレスに基づき、検出結果ビットCD1〜CDmの“1”(セット状態)数を迅速にカウントすることができる。   As described above, the fifth mode is such that the detection result bits CD1 to CD1 in which “1” is set in the data comparison by the coincidence signal and address generation circuit 30, the switch 38, the register 39, and the subtractor 40 constituting the count unit. Based on the maximum / minimum address of CDm, the number of detection result bits CD1 to CDm “1” (set state) can be quickly counted.

なお、検索結果格納レジスタR2、最大及び最小一致アドレス生成回路30、スイッチ38、レジスタ39、及び減算器40は制御回路25からの制御信号S20によって動作制御される。   Note that the search result storage register R2, the maximum and minimum matching address generation circuit 30, the switch 38, the register 39, and the subtractor 40 are controlled in operation by a control signal S20 from the control circuit 25.

第5の態様は符号化前データの順番に依存しないアプリケーションに有効である。なお、図15では図8のセレクタ17a,17b及び符号化テーブル13a,13bを簡略化してセレクタ及び符号化テーブル34として示している。   The fifth aspect is effective for applications that do not depend on the order of pre-encoding data. In FIG. 15, the selectors 17 a and 17 b and the encoding tables 13 a and 13 b in FIG. 8 are simplified and shown as a selector and an encoding table 34.

(第6の態様)
図16は生起確率算出回路24の第6の態様を示す回路図である。同図に示すように、検索結果格納レジスタR2の検出結果ビットCD1〜CDmが全て取り込み可能なソーティング回路42を設け、ソーティング回路42は検出結果ビットCD1〜CDmを取り込んだ後、内部で“1”が上位、“0”が下位になるようにソーティングする。すなわち、ソーティング回路42は、“1”の有無に基づき分類するビットソーティング処理を実行する。
(Sixth aspect)
FIG. 16 is a circuit diagram showing a sixth mode of the occurrence probability calculation circuit 24. As shown in the figure, there is provided a sorting circuit 42 capable of fetching all the detection result bits CD1 to CDm of the search result storage register R2, and the sorting circuit 42 internally captures the detection result bits CD1 to CDm and then internally “1”. Sort so that “0” is higher and “0” is lower. That is, the sorting circuit 42 executes a bit sorting process for classifying based on the presence or absence of “1”.

そして、ソーティング回路42の格納ビット群のうち、隣接するビット間を入力する(m−1)個のEXORゲートG43からなるEXORゲート群43を設け、EXORゲート群43の出力をアドレス生成回路44が入力する。   Then, an EXOR gate group 43 including (m−1) EXOR gates G43 for inputting adjacent bits among the stored bit groups of the sorting circuit 42 is provided, and the output of the EXOR gate group 43 is output by the address generation circuit 44. input.

アドレス生成回路44は(m−1)個のEXORゲートG43の出力を受け、“1”を示すEXORゲートG43の出力に対応するアドレスに基づき、カウント値を得て最大値検出/符号割り当てモジュール22に出力する。すなわち、EXORゲート群43及びアドレス生成回路44がカウント部して機能する。   The address generation circuit 44 receives the outputs of the (m−1) EXOR gates G43, obtains the count value based on the address corresponding to the output of the EXOR gate G43 indicating “1”, and detects the maximum value / code allocation module 22. Output to. That is, the EXOR gate group 43 and the address generation circuit 44 function as a counting unit.

図16の例では、EXORゲート群43における上から3段目のEXORゲートG43の出力のみ“1”となるため、アドレス生成回路44は上記3段目のEXORゲートG43を認識することにより、カウント値を最大値検出/符号割り当てモジュール22に出力することができる。   In the example of FIG. 16, since only the output of the third EXOR gate G43 from the top in the EXOR gate group 43 is “1”, the address generation circuit 44 counts by recognizing the third EXOR gate G43. The value can be output to the maximum value detection / sign assignment module 22.

なお、検索結果格納レジスタR2、ソーティング回路42、及びアドレス生成回路44は、制御回路25の制御信号S20によって動作制御される。   Note that the search result storage register R2, the sorting circuit 42, and the address generation circuit 44 are controlled in operation by the control signal S20 of the control circuit 25.

第6の態様は、ソーティング回路42におけるソーティング後のビットに基づく、EXORゲート群43及びアドレス生成回路44によってカウント値を算出することにより、検出結果ビットCD1〜CDmの“1”の個数を迅速にカウントすることができる。   In the sixth aspect, the count value is calculated by the EXOR gate group 43 and the address generation circuit 44 based on the bits after sorting in the sorting circuit 42, so that the number of “1” of the detection result bits CD1 to CDm can be quickly obtained. Can be counted.

このような構成の第6の態様は、高速にカウント値を得ることが可能である。なお、図16では図8のセレクタ17a,17b及び符号化テーブル13a,13bを簡略化してセレクタ及び符号化テーブル34として示している。   In the sixth aspect having such a configuration, the count value can be obtained at high speed. In FIG. 16, the selectors 17 a and 17 b and the encoding tables 13 a and 13 b in FIG. 8 are simplified and shown as a selector and an encoding table 34.

(第7の態様)
通常、CAMは,複数ビットが一致状態(“1”)を示す検索結果ビット群の中から1つのデータを選択・出力するプライオリティエンコーダを備えている。第7の態様のプライオリティエンコーダ方式はCAMのプライオリティエンコーダを用いることにより、検索結果格納レジスタR2内で“1”を示すビット検出結果CDをカウントする方法を用いている。
(Seventh aspect)
In general, the CAM includes a priority encoder that selects and outputs one data from a search result bit group in which a plurality of bits indicate a matching state (“1”). The priority encoder system according to the seventh aspect uses a method of counting the bit detection result CD indicating “1” in the search result storage register R2 by using a CAM priority encoder.

図17は生起確率算出回路24の第7の態様を示すブロック図である。同図に示すように、検索結果格納レジスタR2の検出結果ビットCD1〜CDmをプライオリティエンコーダ45が受け、検出結果ビットCD1〜CDmが複数の“1”を示す場合に最小アドレスの“1”のみを有効したビット群を検索結果格納レジスタR5に出力する。このように、プライオリティエンコーダ45及び検索結果格納レジスタR5によってプライオリティエンコーダ部を構成する。   FIG. 17 is a block diagram showing a seventh mode of the occurrence probability calculation circuit 24. As shown in the figure, when the priority encoder 45 receives the detection result bits CD1 to CDm of the search result storage register R2 and the detection result bits CD1 to CDm indicate a plurality of “1” s, only the minimum address “1” is received. The valid bit group is output to the search result storage register R5. In this manner, the priority encoder 45 and the search result storage register R5 constitute a priority encoder unit.

検索結果格納レジスタR5の内容はリセット回路47によってフィードバックされ、検索結果格納レジスタR5内で“1”を格納するビット位置に対応する検索結果格納レジスタR2内のビットを“1”から“0”にリセットする。   The contents of the search result storage register R5 are fed back by the reset circuit 47, and the bit in the search result storage register R2 corresponding to the bit position storing “1” in the search result storage register R5 is changed from “1” to “0”. Reset.

一方、多入力ORゲート46は検索結果格納レジスタR5の全格納ビットを入力し、その出力をカウンタ48に出力する。カウンタ48は多入力ORゲート46の出力のから“1”が出力される回数をカウントし、そのカウント結果をカウント値として最大値検出/符号割り当てモジュール22に出力する。このように、多入力ORゲート46及びカウンタ48によってカウント部を構成する。なお、検索結果格納レジスタR2及びカウンタ48はリセット信号S26によってリセット制御される。   On the other hand, the multi-input OR gate 46 receives all the stored bits of the search result storage register R 5 and outputs the output to the counter 48. The counter 48 counts the number of times “1” is output from the output of the multi-input OR gate 46, and outputs the count result to the maximum value detection / sign assignment module 22 as a count value. As described above, the multi-input OR gate 46 and the counter 48 constitute a count unit. The search result storage register R2 and the counter 48 are reset by a reset signal S26.

このような構成において、多入力ORゲート46から“1”が出力され、カウンタ48によりカウントされると同時に,リセット回路47からのリセット信号S47によって検索結果格納レジスタR2内の一の“1”が“0”にリセットされる。上記の一連の処理を1サイクルとして実施すると、検索結果格納レジスタR2内の検出結果ビットCD1〜CDmの“1”の数に相当する回数分、多入力ORゲート46から“1”が出力されることになるため、カウンタ48は検出結果ビットCD1〜CDmにおける“1”の個数を正確にカウントすることができる。   In such a configuration, “1” is output from the multi-input OR gate 46 and counted by the counter 48. At the same time, one “1” in the search result storage register R2 is set by the reset signal S47 from the reset circuit 47. Reset to “0”. When the above-described series of processing is performed as one cycle, “1” is output from the multi-input OR gate 46 for the number of times corresponding to the number of detection result bits CD1 to CDm in the search result storage register R2. Therefore, the counter 48 can accurately count the number of “1” s in the detection result bits CD1 to CDm.

第7の態様は既存のCAMマクロに検索結果格納レジスタR5、多入力ORゲート46、リセット回路47及びカウンタ48に相当するカウンタ機能を追加することにより実現することが可能であるため,適用範囲が広く,新たに付加する回路を少なく抑えることができる利点を奏する。   The seventh aspect can be realized by adding a counter function corresponding to the search result storage register R5, the multi-input OR gate 46, the reset circuit 47, and the counter 48 to the existing CAM macro. Widely, there is an advantage that the number of newly added circuits can be reduced.

第7の態様は、サイクル数が検索結果格納レジスタR2内の“1”を示すビット数分必要となるが,符号化処理と並行して作業するには充分高速なレイテンシであると考えられる。なお、図17では図8のセレクタ17a,17b及び符号化テーブル13a,13bを簡略化してセレクタ及び符号化テーブル34として示している。   In the seventh aspect, although the number of cycles is required for the number of bits indicating “1” in the search result storage register R2, it is considered that the latency is sufficiently fast to work in parallel with the encoding process. In FIG. 17, the selectors 17 a and 17 b and the encoding tables 13 a and 13 b in FIG. 8 are simplified and shown as a selector and an encoding table 34.

<その他>
上記した実施の形態1及び実施の形態2の符号化装置は、様々なアプリケーションに対する柔軟な適応,リアルタイム処理,及び圧縮効率の維持を改善したアーキテクチャとなっている。
<Others>
The encoding apparatuses according to the first and second embodiments described above have an architecture in which flexible adaptation to various applications, real-time processing, and maintenance of compression efficiency are improved.

このアーキテクチャはハイビジョン等の超高精細画像の静止画像符号化や,ブロードバンドの普及に伴う音声・動画等のマルチメディアデータ圧縮,及びデジタル通信回線を利用したテレビ電話・テレビ会議システム等のリアルタイムオンラインシステムやCD,DVD及びデジタルカメラ装置等の単体で使用されるシステムのハフマン符号化を高速・高効率に行える符号化装置として有効に機能するものと考えられる。   This architecture is a real-time online system such as still image coding for high-definition images such as high-definition images, multimedia data compression such as voice and moving images with the spread of broadband, and videophone and videoconferencing systems using digital communication lines. It is considered that it effectively functions as an encoding device that can perform Huffman encoding of a system used alone, such as a CD, a DVD, and a digital camera device, at high speed and high efficiency.

この発明に発明に係るCAMベースのハフマン符号化アーキテクチャを有する符号化装置の内部構成の概略を示すブロック図である。It is a block diagram which shows the outline of the internal structure of the encoding apparatus which has a CAM based Huffman encoding architecture based on this invention. 実施の形態1の符号化装置の全体構成の示す説明図である。1 is an explanatory diagram illustrating an overall configuration of a coding apparatus according to Embodiment 1. FIG. 実施の形態1の符号化装置の詳細構成を示す説明図である。3 is an explanatory diagram showing a detailed configuration of the encoding apparatus according to Embodiment 1. FIG. 実施の形態1の符号化装置における符号化処理及び符号化テーブル作成処理を示すフローチャートである。6 is a flowchart illustrating an encoding process and an encoding table creation process in the encoding apparatus according to the first embodiment. 図4で示した符号化データ読み出しステップにおけるCAM11とRAM13との関係を示す概念図である。FIG. 5 is a conceptual diagram showing a relationship between a CAM 11 and a RAM 13 in the encoded data reading step shown in FIG. CAMとRAMとの接続例を示す説明図である。It is explanatory drawing which shows the example of a connection of CAM and RAM. 実施の形態2の符号化装置の全体構成の示す説明図である。FIG. 10 is an explanatory diagram illustrating an overall configuration of a coding apparatus according to a second embodiment. 実施の形態2の符号化装置の詳細構成を示す説明図である。12 is an explanatory diagram showing a detailed configuration of a coding apparatus according to Embodiment 2. FIG. 実施の形態2の符号化装置における符号化処理及び符号化テーブル作成処理を示すフローチャートである。10 is a flowchart illustrating an encoding process and an encoding table creation process in the encoding apparatus according to the second embodiment. 実施の形態2の生起確率算出回路の第1の態様を示す回路図である。6 is a circuit diagram showing a first mode of an occurrence probability calculation circuit according to Embodiment 2. FIG. 実施の形態2の生起確率算出回路の第2の態様を示す回路図である。FIG. 10 is a circuit diagram showing a second mode of the occurrence probability calculation circuit according to the second embodiment. 実施の形態2の生起確率算出回路の第3の態様を示す回路図である。FIG. 10 is a circuit diagram showing a third aspect of the occurrence probability calculation circuit according to the second embodiment. 実施の形態2の生起確率算出回路の第4の態様を示すブロック図である。FIG. 10 is a block diagram illustrating a fourth aspect of the occurrence probability calculation circuit according to the second embodiment. 実施の形態2の生起確率算出回路の第5の態様の説明用の説明図である。FIG. 10 is an explanatory diagram for explaining a fifth aspect of the occurrence probability calculation circuit according to the second embodiment. 実施の形態2の生起確率算出回路の第5の態様を示すフロック図である。FIG. 10 is a flock diagram illustrating a fifth aspect of the occurrence probability calculation circuit according to the second embodiment. 実施の形態2の生起確率算出回路の第6の態様を示すブロック図である。FIG. 10 is a block diagram illustrating a sixth aspect of the occurrence probability calculation circuit according to the second embodiment. 実施の形態2の生起確率算出回路の第7の態様を示すブロック図である。FIG. 10 is a block diagram illustrating a seventh aspect of the occurrence probability calculation circuit according to the second embodiment. CAMの概念を示す説明図である。It is explanatory drawing which shows the concept of CAM.

符号の説明Explanation of symbols

1,5 符号化処理部、2,6 テーブル作成部、3 出力処理部、4 参照データ書き換え処理部、11,19 CAM、13a,13b 符号化テーブル、17 スイッチ、21,24 生起確率算出回路、22 最大値検出/符号割り当てモジュール、23,25 制御回路、41 フィードバック回路。
1, 5 encoding processing unit, 2, 6 table creation unit, 3 output processing unit, 4 reference data rewrite processing unit, 11, 19 CAM, 13a, 13b encoding table, 17 switch, 21, 24 occurrence probability calculation circuit, 22 Maximum value detection / sign assignment module, 23, 25 control circuit, 41 feedback circuit.

Claims (12)

符号化前データを受け、該符号化前データを使用対象符号化テーブルを用いて符号化処理を行い符号化後データを生成するとともに、前記符号化前データの出現状況を含む符号化処理情報を出力する符号化処理部と、
前記符号化処理部による前記符号化処理と並行して、前記符号化処理情報に基づき、前記符号化前データの生起確率算出処理を行い、その算出結果に基づき更新用符号化テーブルを作成するテーブル作成部とを備え、
前記テーブル作成部は、前記符号化処理における圧縮効率が所定の基準を満足しない場合、前記使用対象符号化テーブルを前記更新用符号化テーブルに置き換えることを特徴とする、
符号化装置。
Receiving pre-encoding data, encoding the pre-encoding data using a target encoding table to generate post-encoding data, and encoding processing information including the appearance status of the pre-encoding data An encoding processing unit to output;
A table for performing occurrence probability calculation processing of the pre-encoding data based on the encoding processing information and creating an update encoding table based on the calculation result in parallel with the encoding processing by the encoding processing unit With a creation department,
The table creation unit, when the compression efficiency in the encoding process does not satisfy a predetermined standard, the use target encoding table is replaced with the update encoding table,
Encoding device.
請求項1記載の符号化装置であって、
前記使用対象符号化テーブル及び更新用符号化テーブルは、それぞれアドレスに対応させて読み出しデータを格納する形式のテーブルを含み、
前記符号化処理部は、符号化前データの全パターンをアドレスに対応させて複数の参照データとして格納した参照データ格納領域を有するCAMを含み、
前記CAMは、一致検索時に、所定の前記符号化前データを符号化対象データとし、前記複数の参照データのうち前記符号化対象データに一致する前記参照データのアドレスである一致信号アドレスを生成し、
前記符号化処理部は、前記使用対象符号化テーブルを参照し、前記一致信号アドレスに対応する読み出しデータを前記符号化後データとして出力する、
符号化装置。
The encoding device according to claim 1, comprising:
The use target encoding table and the update encoding table each include a table of a format for storing read data in association with addresses,
The encoding processing unit includes a CAM having a reference data storage area in which all patterns of pre-encoding data are stored as a plurality of reference data in association with addresses,
At the time of matching search, the CAM uses predetermined data before encoding as data to be encoded, and generates a match signal address that is an address of the reference data that matches the data to be encoded among the plurality of reference data. ,
The encoding processing unit refers to the use target encoding table and outputs read data corresponding to the coincidence signal address as the encoded data.
Encoding device.
請求項2記載の符号化装置であって、
前記CAMは、前記複数の参照データに対応した複数の第1の検索結果ビットを格納する第1の検索結果格納レジスタをさらに有し、前記複数の第1の検索結果ビットは、前記一致検索時に対応する前記参照データと前記符号化対象データとの一致時にセット状態に設定され、
前記テーブル作成部は、前記複数の第1の検索結果ビットの内容に基づき、前記複数の参照データ単位の出現数をカウントすることにより前記生起確率算出処理を行う生起確率算出回路を有する、
符号化装置。
The encoding device according to claim 2, wherein
The CAM further includes a first search result storage register for storing a plurality of first search result bits corresponding to the plurality of reference data, and the plurality of first search result bits are stored in the match search. Set in a set state when the corresponding reference data and the encoding target data match,
The table creation unit has an occurrence probability calculation circuit that performs the occurrence probability calculation process by counting the number of appearances of the plurality of reference data units based on the contents of the plurality of first search result bits.
Encoding device.
請求項2記載の符号化装置であって、
前記CAMは、所定数の符号化前データを所定数の格納データとして格納する符号化前データ格納領域と、前記所定数の格納データに対応した所定数の第2の検索結果ビットを格納する第2の検索結果格納レジスタとをさらに有し、
前記CAMは、前記一致検索時に、前記符号化前データ格納領域に格納された前記所定数の格納データのうち一のデータを前記符号化対象データとして読み出し、前記符号化対象データと前記所定数の格納データそれぞれとが比較され、前記第2の検索結果格納レジスタにおける前記所定数の第2の検索結果ビットは対応する前記格納データの前記符号化対象データとの一致時にセット状態に設定され、
前記テーブル作成部は、前記所定数の第2の検索結果ビットのうちセット状態のビット数をカウントすることにより前記生起確率算出処理を行う生起確率算出回路を有する、
符号化装置。
The encoding device according to claim 2, wherein
The CAM stores a pre-encoding data storage area for storing a predetermined number of pre-encoding data as a predetermined number of stored data and a predetermined number of second search result bits corresponding to the predetermined number of stored data. 2 search result storage registers,
The CAM reads, as the encoding target data, one data among the predetermined number of stored data stored in the pre-encoding data storage area during the match search, and the encoding target data and the predetermined number of data Each stored data is compared, and the predetermined number of second search result bits in the second search result storage register is set to a set state when the corresponding stored data matches the encoding target data,
The table creation unit includes an occurrence probability calculation circuit that performs the occurrence probability calculation process by counting the number of bits in a set state among the predetermined number of second search result bits.
Encoding device.
請求項4記載の符号化装置であって、
前記一致検索時において、前記所定数の格納データのうち、前記符号化対象データと同一値のデータが複数存在する場合、前記符号処理部による前記符号化対象データに対応する符号化後データの生成後に、前記符号化前データ格納領域内の前記所定数の格納データのうち、前記符号化対象データと同一値のデータを、前記符号化後データに書き換える書き換え処理を行う書き換え処理部をさらに備え、
前記CAMは、前記所定数の格納データに対応して設けられ、各々が前記書き換え処理の実行の有無を指示する所定数の書き換えフラグを格納するフラグビット格納レジスタをさらに有し、前記書き換え処理時に、前記書き換え処理対象となった前記格納データに対応する前記書き換えフラグをセット状態に設定し、
前記符号化処理部は、前記格納データを前記符号化対象データとして読み出す際、対応の前記書き換えフラグがセット状態のとき、前記格納データを符号化処理することなくそのまま符号化後データとして出力する、
符号化装置。
The encoding device according to claim 4, comprising:
When there is a plurality of data having the same value as the encoding target data among the predetermined number of stored data during the matching search, generation of encoded data corresponding to the encoding target data by the encoding processing unit A rewrite processing unit for performing a rewrite process of rewriting data having the same value as the data to be encoded among the predetermined number of stored data in the pre-encoding data storage area later with the encoded data,
The CAM further includes a flag bit storage register provided corresponding to the predetermined number of stored data, each storing a predetermined number of rewrite flags indicating whether or not the rewrite processing is executed, , Setting the rewrite flag corresponding to the stored data that is the target of the rewrite processing to a set state,
When the corresponding rewrite flag is in the set state when the storage processing unit reads the storage data as the encoding target data, the storage processing data is directly output as encoded data without being encoded.
Encoding device.
請求項4あるいは請求項5記載の符号化装置であって、
前記生起確率算出回路は、
前記所定数の第2の検索結果ビットを一括して受ける少なくとも一つのシフトレジスタと、
前記少なくとも一つのシフトレジスタ内に取り込んだ前記所定数の第2の検索結果ビットの前記セット状態数をカウントするカウント部とを備える、
符号化装置。
An encoding device according to claim 4 or claim 5, wherein
The occurrence probability calculation circuit includes:
At least one shift register that collectively receives the predetermined number of second search result bits;
A counting unit that counts the number of set states of the predetermined number of second search result bits fetched into the at least one shift register.
Encoding device.
請求項6記載の符号化装置であって、
前記少なくとも一つのシフトレジスタは、各々が前記所定数の第2の検索結果ビットを一括して取り込み可能な複数のシフトレジスタを含み、
前記複数のシフトレジスタは、順次得られる前記所定数の第2の検索結果ビットに対し、前記複数のシフトレジスタのうち一のシフトレジスタが前記所定数の第2の検索結果ビットを取り込み、他のシフトレジスタがシフト動作を行うパイプライン処理が可能であり、
前記カウント部は前記複数のシフトレジスタの出力を選択的にカウントする選択的カウント部を含む、
符号化装置。
The encoding device according to claim 6, comprising:
The at least one shift register includes a plurality of shift registers each capable of fetching the predetermined number of second search result bits at once;
The plurality of shift registers, with respect to the predetermined number of second search result bits obtained sequentially, one shift register among the plurality of shift registers captures the predetermined number of second search result bits, Pipeline processing in which the shift register performs a shift operation is possible,
The counting unit includes a selective counting unit that selectively counts the outputs of the plurality of shift registers.
Encoding device.
請求項6記載の符号化装置であって、
前記少なくとも一つのシフトレジスタは、前記所定数の第2の検索結果ビットの一部を各々が取り込む複数の部分シフトレジスタを含み、
前記カウント部は、前記複数の部分シフトレジスタそれぞれ内に取り込んだ前記所定数の第2の検索結果ビットの一部のセット状態数を並列にカウントし、その総計を得る並列カウント部を含む、
符号化装置。
The encoding device according to claim 6, comprising:
The at least one shift register includes a plurality of partial shift registers each capturing a part of the predetermined number of second search result bits;
The counting unit includes a parallel counting unit that counts in parallel the number of set states of a part of the predetermined number of second search result bits fetched into each of the plurality of partial shift registers, and obtains a total thereof.
Encoding device.
請求項4あるいは請求項5記載の符号化装置であって、
前記生起確率算出回路は、
前記所定数の第2の検索結果ビットをビット単位に順次ツリー状に加算することにより前記生起確率算出処理を行う加算器群を含む、
符号化装置。
An encoding device according to claim 4 or claim 5, wherein
The occurrence probability calculation circuit includes:
An adder group that performs the occurrence probability calculation process by sequentially adding the predetermined number of second search result bits in a tree-like manner in units of bits;
Encoding device.
請求項4あるいは請求項5記載の符号化装置であって、
前記CAMにおける前記符号化前データ格納領域はデータの大小関係に基づき前記所定数の格納データをソーティングするソーティング機能を有し、
前記生起確率算出回路は、
ソーティング後の符号化前データ格納領域に対する前記一致検索時における前記所定数の第2の検索結果ビットの対応アドレスに基づき、前記所定数の第2の検索結果ビットのセット状態数をカウントするカウント部を含む、
符号化装置。
An encoding device according to claim 4 or claim 5, wherein
The pre-encoding data storage area in the CAM has a sorting function for sorting the predetermined number of stored data based on the magnitude relationship of data,
The occurrence probability calculation circuit includes:
A counting unit that counts the number of set states of the predetermined number of second search result bits based on the corresponding addresses of the predetermined number of second search result bits at the time of matching search for the pre-encoding data storage area after sorting including,
Encoding device.
請求項4あるいは請求項5記載の符号化装置であって、
前記生起確率算出回路は、
前記所定数の第2の検索結果ビットを前記所定数の格納ビットとして取り込み、前記所定数の格納ビットのセット状態の有無に基づき分類するビットソーティング処理を行うソーティング回路と、
前記ビットソーティング処理後の前記ソーティング回路における前記所定数の格納ビットに基づき、前記所定数の格納ビットのセット状態数をカウントするカウント部とを含む、
符号化装置。
An encoding device according to claim 4 or claim 5, wherein
The occurrence probability calculation circuit includes:
A sorting circuit that takes in the predetermined number of second search result bits as the predetermined number of stored bits and performs a bit sorting process for classifying based on the presence / absence of a set state of the predetermined number of stored bits;
A counting unit that counts the number of set states of the predetermined number of stored bits based on the predetermined number of stored bits in the sorting circuit after the bit sorting process.
Encoding device.
請求項4あるいは請求項5記載の符号化装置であって、
前記生起確率算出回路は、
前記所定数の第2の検索結果ビットを受け、前記所定数の第2の検索結果ビットのうち複数のビットがセット状態の場合に一のビットのみを有効するエンコード処理を行いプライオリティ処理後ビットデータを出力するプライオリティエンコード部と、
前記プライオリティ処理後ビットデータ中にセット状態のビット有無を認識可能なカウント部と、
前記所定数の第2の検索結果ビットのうち、前記プライオリティ処理後ビットデータにおいて一致を指示するビットに対応するビットのセット状態をリセットするリセット回路とを備え、
前記プライオリティエンコード部は、前記所定数の第2の検索結果ビット中にセット状態のビットが存在しなくなるまで前記エンコード処理を繰り返し行い、
前記カウント部はセット状態のビットを含む前記プライオリティ処理後ビットデータの受信回数に基づき、前記一致検索直後の前記所定数の第2の検索結果ビット中のセット状態数をカウントする、
符号化装置。
An encoding device according to claim 4 or claim 5, wherein
The occurrence probability calculation circuit includes:
Bit data after priority processing is performed by receiving the predetermined number of second search result bits and performing an encoding process for validating only one bit when a plurality of bits among the predetermined number of second search result bits are set. A priority encoding unit that outputs
A counting unit capable of recognizing the presence or absence of a set bit in the bit data after the priority processing;
A reset circuit that resets a set state of a bit corresponding to a bit indicating a match in the bit data after priority processing among the predetermined number of second search result bits,
The priority encoding unit repeatedly performs the encoding process until there is no set bit in the predetermined number of second search result bits,
The counting unit counts the number of set states in the predetermined number of second search result bits immediately after the match search based on the number of times the priority-processed bit data including the set state bits is received.
Encoding device.
JP2005146211A 2005-05-19 2005-05-19 Encoder Pending JP2006324944A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005146211A JP2006324944A (en) 2005-05-19 2005-05-19 Encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005146211A JP2006324944A (en) 2005-05-19 2005-05-19 Encoder

Publications (1)

Publication Number Publication Date
JP2006324944A true JP2006324944A (en) 2006-11-30

Family

ID=37544289

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005146211A Pending JP2006324944A (en) 2005-05-19 2005-05-19 Encoder

Country Status (1)

Country Link
JP (1) JP2006324944A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010177847A (en) * 2009-01-28 2010-08-12 Nippon Telegr & Teleph Corp <Ntt> Wireless network system, node, data collection method and program
KR101023536B1 (en) 2008-07-17 2011-03-21 고려대학교 산학협력단 Data Lossless Compression Method
JP2012090021A (en) * 2010-10-19 2012-05-10 Mitsubishi Electric Corp Data processing device, variable length encoding device, and variable length decoding device
CN110311679A (en) * 2019-07-25 2019-10-08 中北大学 An analog-to-digital converter for probabilistic calculation sequence generation

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06343168A (en) * 1993-03-19 1994-12-13 Sony Corp Encoding method for digital signal, method for generating table for encoding, encoding device and encoding method
JPH07212243A (en) * 1994-01-13 1995-08-11 Fuji Photo Film Co Ltd Method and device for encoding variable length code
JPH08205169A (en) * 1995-01-20 1996-08-09 Matsushita Electric Ind Co Ltd Video encoding device and decoding device
JPH1051771A (en) * 1996-08-06 1998-02-20 Matsushita Electric Ind Co Ltd Image compression method and image compression device
JPH10107645A (en) * 1996-09-26 1998-04-24 Ricoh Co Ltd Coder and coding system
JP2003087789A (en) * 2001-09-13 2003-03-20 Mitsubishi Electric Corp Image encoder and image decoder
JP2003521190A (en) * 2000-01-25 2003-07-08 ビーティージー・インターナショナル・リミテッド Data compression with improved compression speed
JP2005051406A (en) * 2003-07-31 2005-02-24 Ishikawajima Harima Heavy Ind Co Ltd Compression encoding method, apparatus, and program, and decoding method, apparatus, and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06343168A (en) * 1993-03-19 1994-12-13 Sony Corp Encoding method for digital signal, method for generating table for encoding, encoding device and encoding method
JPH07212243A (en) * 1994-01-13 1995-08-11 Fuji Photo Film Co Ltd Method and device for encoding variable length code
JPH08205169A (en) * 1995-01-20 1996-08-09 Matsushita Electric Ind Co Ltd Video encoding device and decoding device
JPH1051771A (en) * 1996-08-06 1998-02-20 Matsushita Electric Ind Co Ltd Image compression method and image compression device
JPH10107645A (en) * 1996-09-26 1998-04-24 Ricoh Co Ltd Coder and coding system
JP2003521190A (en) * 2000-01-25 2003-07-08 ビーティージー・インターナショナル・リミテッド Data compression with improved compression speed
JP2003087789A (en) * 2001-09-13 2003-03-20 Mitsubishi Electric Corp Image encoder and image decoder
JP2005051406A (en) * 2003-07-31 2005-02-24 Ishikawajima Harima Heavy Ind Co Ltd Compression encoding method, apparatus, and program, and decoding method, apparatus, and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101023536B1 (en) 2008-07-17 2011-03-21 고려대학교 산학협력단 Data Lossless Compression Method
JP2010177847A (en) * 2009-01-28 2010-08-12 Nippon Telegr & Teleph Corp <Ntt> Wireless network system, node, data collection method and program
JP2012090021A (en) * 2010-10-19 2012-05-10 Mitsubishi Electric Corp Data processing device, variable length encoding device, and variable length decoding device
CN110311679A (en) * 2019-07-25 2019-10-08 中北大学 An analog-to-digital converter for probabilistic calculation sequence generation
CN110311679B (en) * 2019-07-25 2022-11-01 中北大学 Analog-to-digital converter for probability calculation sequence generation

Similar Documents

Publication Publication Date Title
US11604687B2 (en) Programmable device, hierarchical parallel machines, and methods for providing state information
JP5945291B2 (en) Parallel device for high speed and high compression LZ77 tokenization and Huffman encoding for deflate compression
CN106852185B (en) Dictionary-Based Parallel Compression Encoder
JP6181074B2 (en) Detection method and system in state machine
US6819271B2 (en) Parallel compression and decompression system and method having multiple parallel compression and decompression engines
CN101449462A (en) High Speed Data Compression Based on Set Associative Cache Mapping Technology
US20020101367A1 (en) System and method for generating optimally compressed data from a plurality of data compression/decompression engines implementing different data compression algorithms
US11120867B2 (en) Hardware compression with search string matching
JPH06231234A (en) Compression method of image frame and data processing system
US20070115154A1 (en) Method of decoding bin values using pipeline architecture and decoding device therefor
CN105187845B (en) Apparatus for decoding video data and coding/decoding method
US7714753B2 (en) Scalable context adaptive binary arithmetic coding
CN100508604C (en) Arithmetic coding circuit and arithmetic coding control method
Lee et al. Bundle-updatable SRAM-based TCAM design for openflow-compliant packet processor
JP2010268146A (en) Device and method for selecting location with data stored thereat
CN112328306B (en) Isolation method and prediction method of branch predictor and branch predictor
JP4865662B2 (en) Entropy encoding apparatus, entropy encoding method, and computer program
JPH1013693A (en) Digital information encoding device, digital information decoding device, digital information encoding/decoding device, digital information encoding method and digital information decoding method
JP2006324944A (en) Encoder
CN104731519A (en) Cache memory management device and dynamic image system and method using the cache memory management device
JP4191053B2 (en) Memory management algorithm for trellis decoder
US8378861B2 (en) Storage of probability values for contexts used in arithmetic coding
Kumaki et al. CAM-based VLSI architecture for Huffman coding with real-time optimization of the code word table [image coding example]
US7652903B2 (en) Hit ahead hierarchical scalable priority encoding logic and circuits
JPS63165922A (en) Input/output timing generator for subscreen

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080509

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20080509

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100309

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100629