JP2017168985A - Encoding device and encoding method - Google Patents

Encoding device and encoding method Download PDF

Info

Publication number
JP2017168985A
JP2017168985A JP2016051278A JP2016051278A JP2017168985A JP 2017168985 A JP2017168985 A JP 2017168985A JP 2016051278 A JP2016051278 A JP 2016051278A JP 2016051278 A JP2016051278 A JP 2016051278A JP 2017168985 A JP2017168985 A JP 2017168985A
Authority
JP
Japan
Prior art keywords
encoding
unit
variable length
code amount
quantization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2016051278A
Other languages
Japanese (ja)
Other versions
JP6549057B2 (en
Inventor
孝幸 伊東
Takayuki Ito
孝幸 伊東
淳 松村
Atsushi Matsumura
淳 松村
知也 児玉
Tomoya Kodama
知也 児玉
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2016051278A priority Critical patent/JP6549057B2/en
Publication of JP2017168985A publication Critical patent/JP2017168985A/en
Application granted granted Critical
Publication of JP6549057B2 publication Critical patent/JP6549057B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an encoding device and an encoding method that can suppress buffer underflow with small processing amount.SOLUTION: An encoding device according to an embodiment is an encoding device that performs variable length encoding on a quantization value quantized on the basis of a quantization parameter of an input signal, the encoding device comprising a selection unit, an acquisition unit, a determination unit, a quantization unit, and an encoding unit. The selection unit selects a variable length encoding table of 1 on the basis of a characteristic of the input signal. The acquisition unit acquires a constant term of an equation which makes a function of a value based on the maximum code amount for any quantization parameter for the selected variable length encoding table as a reference code amount. The determination unit determines the quantization parameter on the basis of the reference code amount and an allocation code amount obtained by an occupied code amount. The quantization unit obtains a quantization value by quantizing using the quantization parameter. The encoding unit selects the variable length encoding table of 1 on the basis of the quantization parameter, and performs variable length encoding on the quantization value.SELECTED DRAWING: Figure 3

Description

本発明の実施形態は、符号化装置および符号化方法に関する。   Embodiments described herein relate generally to an encoding device and an encoding method.

例えば、画像、音声、映像、センサデータ、およびその他1次元または多次元のデジタル信号等の各種の信号を伝送する際、所定の伝送路の通信容量に対して信号の情報量が大きい場合、一般にこれらの信号を符号化することにより情報量を削減して伝送が行われる。この場合に符号化の方法としては、例えば、予測符号化、変換符号化、量子化、もしくは可変長符号化等の各種処理、またはこれらのいずれか2以上を併用した処理が一般に用いられる。このうち可変長符号化の手法を用いた場合、所定の処理単位を符号化した場合に発生する符号量が一定とはならない場合がある。この場合、復号装置の前段に受信バッファを設け、符号化装置から伝送路を介して入力される符号化された信号(符号)を一時的に蓄積するような構成が一般に用いられる。このような構成では、符号化装置が出力する符号の符号量の変動幅に対して十分大きな容量を有する受信バッファを用意し、受信バッファに蓄積された符号の符号量が、受信バッファの容量の所定の割合まで蓄積された後に復号処理を開始する。これによって、復号装置が復号を開始するタイミングにおいて、受信バッファに蓄積された符号が不足する状態、すなわちバッファアンダーフローが発生することを抑制することが可能となる。   For example, when transmitting various signals such as images, audio, video, sensor data, and other one-dimensional or multi-dimensional digital signals, generally, if the amount of signal information is larger than the communication capacity of a predetermined transmission path, By encoding these signals, transmission is performed while reducing the amount of information. In this case, as a coding method, for example, various processes such as predictive coding, transform coding, quantization, or variable length coding, or a process using any two or more of these is generally used. Among these, when the variable length coding method is used, the amount of code generated when a predetermined processing unit is coded may not be constant. In this case, a configuration is generally used in which a reception buffer is provided in the preceding stage of the decoding device, and an encoded signal (code) input from the encoding device via a transmission path is temporarily stored. In such a configuration, a reception buffer having a sufficiently large capacity with respect to the fluctuation range of the code amount of the code output from the encoding device is prepared, and the code amount of the code accumulated in the reception buffer is equal to the capacity of the reception buffer. Decoding processing is started after accumulation to a predetermined ratio. As a result, it is possible to suppress a situation in which the code accumulated in the reception buffer is insufficient, that is, the occurrence of buffer underflow, at the timing when the decoding apparatus starts decoding.

また、一般に受信バッファの容量が大きくなると、符号化装置が出力する符号の符号量の変動幅が大きくなってもバッファアンダーフローを抑制することが可能である。一方、受信バッファを容量の所定の割合まで最初に蓄積するまでの時間(初期遅延時間)が長くなることから、伝送システム全体としての遅延時間が大きくなるという問題がある。したがって、初期遅延時間の観点からみると、受信バッファの容量は可能な限り小さいことが望ましい。   In general, when the capacity of the reception buffer increases, buffer underflow can be suppressed even if the fluctuation range of the code amount of the code output from the encoding apparatus increases. On the other hand, since the time (initial delay time) until the reception buffer is first stored up to a predetermined ratio of the capacity becomes long, there is a problem that the delay time of the entire transmission system becomes large. Therefore, from the viewpoint of the initial delay time, the capacity of the reception buffer is desirably as small as possible.

以上の観点に基づき、受信バッファの容量を抑えつつバッファアンダーフローの発生を抑制する方法として、符号化装置が出力する符号量を制御することにより符号量の変動幅を抑え、バッファアンダーフローの発生を防ぐ方法が知られている。そのような方法の一例として、例えば、ビデオの符号化において、符号化対象となるフレーム群を2回符号化する方法が知られている。この方法では、1回目の符号化で収集した統計値を用いて2回目の符号化で用いる量子化パラメタを決定することにより出力される符号量を制御し、バッファアンダーフローの発生を抑制している。また、別の方法の例として、ある処理単位を符号化したときの符号量が割り当てられた符号量を上回った場合に、上回った部分の符号化をスキップすることにより発生符号量を抑えるという方法も知られている。   Based on the above viewpoint, as a method of suppressing the occurrence of buffer underflow while reducing the capacity of the reception buffer, the fluctuation amount of the code amount is controlled by controlling the code amount output by the encoding device, and the occurrence of buffer underflow. There are known ways to prevent this. As an example of such a method, for example, in video encoding, a method of encoding a frame group to be encoded twice is known. In this method, the amount of code output is controlled by determining the quantization parameter used in the second encoding using the statistical values collected in the first encoding, and the occurrence of buffer underflow is suppressed. Yes. As another example of the method, when the amount of code when a certain processing unit is encoded exceeds the allocated amount of code, the generated amount of code is suppressed by skipping the encoding of the portion that exceeded the amount. Is also known.

しかしながら、上述のフレーム群を2回符号化する方法では、符号化処理を2回行う必要があることから、符号化処理にかかる処理量が大きいという問題がある。また、符号量の推定値に基づいて、量子化パラメタを決定して符号化を行うことから、推定値と、実際に発生する符号量との間に乖離が生じる可能性があり、受信バッファが小さい場合にバッファアンダーフローの発生を抑制しきれない可能性が存在する。   However, the above-described method of encoding the frame group twice has a problem that the amount of processing required for the encoding process is large because the encoding process needs to be performed twice. Also, since encoding is performed by determining the quantization parameter based on the estimated value of the code amount, there is a possibility that a divergence may occur between the estimated value and the actually generated code amount. If it is small, there is a possibility that the occurrence of buffer underflow cannot be suppressed.

また、上述の符号化をスキップすることにより発生符号量を抑えるという方法では、符号化をスキップした部分において復号した信号の品質の大幅な劣化が発生するという問題がある。   In addition, in the method of suppressing the generated code amount by skipping the above-described encoding, there is a problem that the quality of the decoded signal is greatly deteriorated in the portion where the encoding is skipped.

特許第5096342号公報Japanese Patent No. 5096342 特開2001−169281号公報JP 2001-169281 A

本発明は、上記に鑑みてなされたものであって、少ない処理量でバッファアンダーフローを抑制することができる符号化装置および符号化方法を提供することを目的とする。   The present invention has been made in view of the above, and an object of the present invention is to provide an encoding device and an encoding method that can suppress buffer underflow with a small amount of processing.

実施形態の符号化装置は、入力信号を量子化パラメタに基づいて量子化した量子化値に対して可変長符号化を行う符号化装置であって、選択部と、取得部と、決定部と、量子化部と、符号化部と、を備える。選択部は、入力信号の特性に基づいて、1の可変長符号化テーブルを選択する。取得部は、選択された可変長符号化テーブルについて、任意の量子化パラメタについての最大の符号量に基づく値を関数化した式の定数項を基準符号量として取得する。決定部は、基準符号量と、占有符号量により求まる割り当て符号量と、に基づいて量子化パラメタを決定する。量子化部は、量子化パラメタを用いて、入力信号を量子化して量子化値を求める。符号化部は、量子化パラメタに基づいて、1の可変長符号化テーブルを選択し、量子化値に対して可変長符号化を行う。   An encoding apparatus according to an embodiment is an encoding apparatus that performs variable length encoding on a quantized value obtained by quantizing an input signal based on a quantization parameter, and includes a selection unit, an acquisition unit, a determination unit, A quantization unit and an encoding unit. The selection unit selects one variable length coding table based on the characteristics of the input signal. The acquisition unit acquires, as the reference code amount, a constant term of an expression obtained by functionalizing a value based on the maximum code amount for an arbitrary quantization parameter for the selected variable length encoding table. The determination unit determines the quantization parameter based on the reference code amount and the allocated code amount obtained from the occupied code amount. The quantization unit quantizes the input signal using the quantization parameter to obtain a quantization value. The encoding unit selects one variable length encoding table based on the quantization parameter, and performs variable length encoding on the quantized value.

第1の実施形態に係る伝送システムの全体構成の一例を示す図である。It is a figure which shows an example of the whole structure of the transmission system which concerns on 1st Embodiment. 第1の実施形態に係る符号化装置のハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of the encoding apparatus which concerns on 1st Embodiment. 第1の実施形態に係る符号化装置のブロック構成の一例を示す図である。It is a figure which shows an example of the block configuration of the encoding apparatus which concerns on 1st Embodiment. 受信バッファの占有符号量の制御を説明する図である。It is a figure explaining control of the occupation code amount of a receiving buffer. 各量子化パラメタに対するワースト符号量を示すグラフの一例を示す図である。It is a figure which shows an example of the graph which shows the worst code amount with respect to each quantization parameter. 第1の実施形態に係る符号化装置の符号化処理の一例を示すフローチャートである。It is a flowchart which shows an example of the encoding process of the encoding apparatus which concerns on 1st Embodiment. 第2の実施形態に係る符号化装置のブロック構成の一例を示す図である。It is a figure which shows an example of the block configuration of the encoding apparatus which concerns on 2nd Embodiment.

以下に、図面を参照しながら、本発明の各実施形態に係る符号化装置および符号化方法を詳細に説明する。ただし、図面は模式的なものであるため、具体的な構成は以下の説明を参酌して判断すべきものである。   Hereinafter, an encoding device and an encoding method according to each embodiment of the present invention will be described in detail with reference to the drawings. However, since the drawings are schematic, a specific configuration should be determined in consideration of the following description.

(第1の実施形態)
図1は、第1の実施形態に係る伝送システムの全体構成の一例を示す図である。図1を参照しながら、本実施形態に係る伝送システム1の全体構成について説明する。
(First embodiment)
FIG. 1 is a diagram illustrating an example of the overall configuration of the transmission system according to the first embodiment. The overall configuration of the transmission system 1 according to the present embodiment will be described with reference to FIG.

図1に示すように、本実施形態に係る伝送システム1は、符号化装置10と、復号装置20と、受信バッファ30と、を含む。符号化装置10から出力される信号(後述する符号ストリーム)は、ネットワーク40を介して、受信バッファ30に蓄積される。なお、符号化装置10から受信バッファ30へ送信される伝送路は、ネットワーク40のような有線の伝送路に限定されるものではなく、符号化装置10から無線通信により信号がネットワーク40に送信されるものとしてもよい。また、図1に示す伝送システム1の構成では、復号装置20と、受信バッファ30とが別体となっている構成を示しているが、これに限定されるものではなく、例えば、復号装置20は、受信バッファ30を含むものとし、復号装置20による復号処理の前段に受信バッファ30が配置されるものとしてもよい。   As shown in FIG. 1, the transmission system 1 according to the present embodiment includes an encoding device 10, a decoding device 20, and a reception buffer 30. A signal (a code stream described later) output from the encoding device 10 is accumulated in the reception buffer 30 via the network 40. The transmission path transmitted from the encoding apparatus 10 to the reception buffer 30 is not limited to a wired transmission path such as the network 40, and a signal is transmitted from the encoding apparatus 10 to the network 40 by wireless communication. It is good also as a thing. In addition, the configuration of the transmission system 1 illustrated in FIG. 1 illustrates a configuration in which the decoding device 20 and the reception buffer 30 are separate from each other. However, the configuration is not limited thereto. May include the reception buffer 30, and the reception buffer 30 may be arranged before the decoding process by the decoding device 20.

符号化装置10は、外部から入力される入力信号を符号化し、その符号を外部(例えば、ネットワーク40)に出力する装置である。具体的には、符号化装置10は、入力信号を量子化し、量子化した信号である量子化値を可変長符号化して出力する。   The encoding device 10 is a device that encodes an input signal input from the outside and outputs the code to the outside (for example, the network 40). Specifically, the encoding device 10 quantizes the input signal, performs variable length encoding on the quantized value that is the quantized signal, and outputs the result.

ここで、入力信号としては、例えば、音声、画像、映像、3次元ボリュームデータ、各種センサの出力信号(1次元または多次元の信号)、無線または有線の伝送路における伝送信号(ベースバンド信号)等が挙げられる。なお、入力信号は上述のいずれかの信号に限定されるものではなく、例えば、入力ビット数に対しエントロピーの小さい各種信号、または、後述する予測符号化もしくは変換符号化によりエントロピーが削減された信号を入力信号としてもよい。   Here, examples of the input signal include voice, image, video, three-dimensional volume data, output signals from various sensors (one-dimensional or multi-dimensional signals), and transmission signals (baseband signals) in a wireless or wired transmission path. Etc. Note that the input signal is not limited to any of the above signals. For example, various signals having a small entropy with respect to the number of input bits, or a signal whose entropy has been reduced by predictive coding or transform coding described later. May be used as an input signal.

例えば、符号化装置10は、入力信号に対する前処理として、入力信号を近接サンプルに基づき予測し、その予測値との差分値(予測残差)を求め(予測処理)、この予測残差を入力信号として量子化および可変長符号化するものとしてもよい(いわゆる、予測符号化)。例えば、温度センサ等の出力信号の場合、時間的に近接する信号同士は類似の値を持っている可能性が高く、予測処理により情報量(エントロピー)を削減することが可能となる。   For example, as a preprocessing for the input signal, the encoding apparatus 10 predicts the input signal based on adjacent samples, obtains a difference value (prediction residual) from the predicted value (prediction process), and inputs the prediction residual. The signal may be quantized and variable-length coded (so-called predictive coding). For example, in the case of an output signal from a temperature sensor or the like, it is highly possible that signals that are close in time have similar values, and the amount of information (entropy) can be reduced by prediction processing.

また、符号化装置10は、入力信号または上述の予測残差に対して離散フーリエ変換、離散コサイン変換または離散ウェーブレット変換等の変換処理を行い、その変換後の信号を入力信号として量子化および可変長符号化するものとしてもよい(いわゆる、変換符号化)。例えば、画像信号、特に自然画像においては、空間周波数の低い領域に信号が集中する傾向があり、周波数変換処理を行うことにより、空間周波数が高い領域のエントロピーを削減することが可能である。画像信号の場合では、予測処理および変換処理の併用によってさらに高効率にエントロピーを削減する方法が一般に知られている。   Also, the encoding device 10 performs a conversion process such as discrete Fourier transform, discrete cosine transform, or discrete wavelet transform on the input signal or the above-described prediction residual, and the converted signal is quantized and variable as an input signal. Long coding may be used (so-called transform coding). For example, in an image signal, particularly a natural image, the signal tends to concentrate in a region having a low spatial frequency. By performing frequency conversion processing, it is possible to reduce entropy in a region having a high spatial frequency. In the case of an image signal, a method for further reducing entropy with higher efficiency by using a combination of prediction processing and conversion processing is generally known.

このように、入力信号に応じた適切な予測処理または変換処理を行うことによりエントロピーを削減し、この信号(またはその量子化値)を可変長符号化することによって高効率な符号化が実現される。本実施形態においては、便宜上、入力ビット数に対しエントロピーの低い入力信号(例えば、予測残差等)を想定し、これを量子化および可変長符号化して出力する符号化装置について説明する。   In this way, entropy is reduced by performing appropriate prediction processing or conversion processing according to the input signal, and highly efficient coding is realized by variable-length coding this signal (or its quantized value). The In the present embodiment, for the sake of convenience, an encoding device that assumes an input signal (for example, a prediction residual) having a low entropy with respect to the number of input bits and outputs the signal after quantization and variable length encoding will be described.

復号装置20は、符号化装置10から出力された符号化された信号が蓄積された受信バッファ30から、所定時間ごとの復号タイミングに所定単位の符号を引き去り、引き去った符号を復号する装置である。   The decoding device 20 is a device that subtracts a predetermined unit of code at a decoding timing every predetermined time from the reception buffer 30 in which the encoded signal output from the encoding device 10 is accumulated, and decodes the extracted code. is there.

受信バッファ30は、符号化装置10から出力された符号化された信号を一定のレートで蓄積する記憶装置である。また、受信バッファ30は、復号装置20の復号機能の前段に配置されており、復号装置20によって、所定時間ごとの復号タイミングに所定単位の符号が復号のために引き去られる。   The reception buffer 30 is a storage device that accumulates the encoded signal output from the encoding device 10 at a constant rate. In addition, the reception buffer 30 is arranged in the preceding stage of the decoding function of the decoding device 20, and a predetermined unit of code is pulled out for decoding by the decoding device 20 at a decoding timing every predetermined time.

ネットワーク40は、符号化装置10と受信バッファ30とを接続する無線または有線の伝送路である。   The network 40 is a wireless or wired transmission path that connects the encoding device 10 and the reception buffer 30.

図2は、第1の実施形態に係る符号化装置のハードウェア構成の一例を示す図である。図2を参照しながら、本実施形態に係る符号化装置10のハードウェア構成について説明する。   FIG. 2 is a diagram illustrating an example of a hardware configuration of the encoding device according to the first embodiment. A hardware configuration of the encoding apparatus 10 according to the present embodiment will be described with reference to FIG.

図2に示すように、本実施形態に係る符号化装置10は、入力I/F501と、符号化プロセッサ502と、キャッシュ502aと、RAM(Random Access Memory)503と、出力I/F504と、補助記憶装置505と、を備えている。入力I/F501、符号化プロセッサ502、RAM503、出力I/F504、および補助記憶装置505は、アドレスバスおよびデータバス等のバス506によって互いに通信可能に接続されている。   As shown in FIG. 2, the encoding apparatus 10 according to the present embodiment includes an input I / F 501, an encoding processor 502, a cache 502a, a RAM (Random Access Memory) 503, an output I / F 504, and an auxiliary device. A storage device 505. The input I / F 501, the encoding processor 502, the RAM 503, the output I / F 504, and the auxiliary storage device 505 are connected to each other via a bus 506 such as an address bus and a data bus.

入力I/F501は、外部から入力信号を入力するためのインターフェースである。   The input I / F 501 is an interface for inputting an input signal from the outside.

符号化プロセッサ502は、図1に示す符号化装置10の全体の動作を制御する演算装置である。符号化プロセッサ502は、符号化処理を実行する。   The encoding processor 502 is an arithmetic device that controls the overall operation of the encoding device 10 shown in FIG. The encoding processor 502 executes an encoding process.

キャッシュ502aは、符号化プロセッサ502が処理をする際のデータをワークエリアとして一時的に記憶するメモリである。   The cache 502a is a memory that temporarily stores data when the encoding processor 502 performs processing as a work area.

RAM503は、符号化プロセッサ502の符号化処理により生成した符号ストリーム等を一時記憶する揮発性記憶装置である。RAM503は、例えば、SRAM(Static RAM)またはDRAM(Dynamic RAM)である。   The RAM 503 is a volatile storage device that temporarily stores a code stream or the like generated by the encoding process of the encoding processor 502. The RAM 503 is, for example, an SRAM (Static RAM) or a DRAM (Dynamic RAM).

出力I/F504は、符号化プロセッサ502の符号化処理により生成した符号ストリームを外部に出力するためのインターフェースである。   The output I / F 504 is an interface for outputting the code stream generated by the encoding process of the encoding processor 502 to the outside.

補助記憶装置505は、後述する可変長符号化テーブル等を記憶する記憶装置である。補助記憶装置505は、HDD(Hard Disk Drive)、SSD(Solid State Drive)、フラッシュメモリまたは光ディスク等の電気的、磁気的または光学的に記憶可能な記憶装置である。なお、補助記憶装置505は、符号化装置10が備えるものとしているが、これに限定されるものではなく、符号化装置10の外部に設置されているのとしてもよく、この場合、補助記憶装置505に記憶されたデータは、インターフェースを介して符号化装置10と通信されるものとすればよい。また、上述の補助記憶装置505に記憶される情報は、補助記憶装置505に記憶する代わりに処理方法(論理回路またはプログラム)として組み込むものとしてもよい。   The auxiliary storage device 505 is a storage device that stores a variable-length coding table and the like to be described later. The auxiliary storage device 505 is a storage device capable of electrical, magnetic, or optical storage such as an HDD (Hard Disk Drive), an SSD (Solid State Drive), a flash memory, or an optical disk. The auxiliary storage device 505 is included in the encoding device 10, but is not limited thereto, and may be installed outside the encoding device 10, and in this case, the auxiliary storage device The data stored in 505 may be communicated with the encoding device 10 via the interface. Further, the information stored in the auxiliary storage device 505 described above may be incorporated as a processing method (logic circuit or program) instead of being stored in the auxiliary storage device 505.

なお、図2に示す符号化装置10のハードウェア構成は一例であり、その他の構成によって実現されるものとしてもよい。   Note that the hardware configuration of the encoding device 10 illustrated in FIG. 2 is an example, and may be realized by other configurations.

図3は、第1の実施形態に係る符号化装置のブロック構成の一例を示す図である。図4は、受信バッファの占有符号量の制御を説明する図である。図3および4を参照しながら、本実施形態に係る符号化装置10のブロック構成および動作について説明する。   FIG. 3 is a diagram illustrating an example of a block configuration of the encoding device according to the first embodiment. FIG. 4 is a diagram for explaining control of the occupied code amount of the reception buffer. The block configuration and operation of the encoding apparatus 10 according to this embodiment will be described with reference to FIGS.

図3に示すように、本実施形態に係る符号化装置10は、テーブル選択部101(選択部)と、符号量取得部102(取得部)と、パラメタ決定部103(決定部)と、量子化部104と、符号化部105と、符号量制御部106と、記憶部107と、を有する。   As illustrated in FIG. 3, the encoding device 10 according to the present embodiment includes a table selection unit 101 (selection unit), a code amount acquisition unit 102 (acquisition unit), a parameter determination unit 103 (determination unit), a quantum A coding unit 104, a coding unit 105, a code amount control unit 106, and a storage unit 107.

テーブル選択部101は、外部から入力信号を受信し、所定の処理単位毎に、入力信号の特性に基づいて、記憶部107に予め記憶されている1以上の可変長符号化テーブルの中から、1の可変長符号化テーブルを選択する機能部である。ここで、入力信号の特性としては、例えば、入力信号の信号値の絶対値和または分散等であればよい。また、可変長符号化テーブルとは、入力信号を、例えば、ゴロムライス符号、または指数ゴロム符号等の既知の符号に変換(可変長符号化)するためテーブルである。テーブル選択部101は、記憶部107に予め記憶されている1以上の可変長符号化テーブルから、入力信号に対して可変長符号化を行った場合の符号量が小さくなる可変長符号化テーブルを選択する。例えば、ゴロムライス符号の可変長符号化テーブルの場合、テーブル選択部101は、入力信号の分散が小さい場合には、ゴロムライス符号の可変長符号化テーブルを特定するパラメタであるサフィックス長が短い可変長符号化テーブルを選択することにより、その可変長符号化テーブルにより符号化した場合の符号量を削減することが出来る。一方、テーブル選択部101は、入力信号の分散が大きい場合には、サフィックス長が長い可変長符号化テーブルを選択することにより、その可変長符号化テーブルにより符号化した場合の符号量を削減することが出来る。   The table selection unit 101 receives an input signal from the outside and, based on the characteristics of the input signal for each predetermined processing unit, from one or more variable length coding tables stored in advance in the storage unit 107, This is a functional unit that selects one variable length coding table. Here, the characteristics of the input signal may be, for example, the absolute value sum or variance of the signal values of the input signal. The variable length coding table is a table for converting (variable length coding) an input signal into a known code such as a Golomb-Rice code or an exponential Golomb code. The table selection unit 101 is a variable length coding table that reduces the code amount when variable length coding is performed on an input signal from one or more variable length coding tables stored in advance in the storage unit 107. select. For example, in the case of a variable-length coding table of Golomb-Rice codes, the table selection unit 101, when the variance of the input signal is small, is a variable-length code having a short suffix length that is a parameter for specifying the variable-length coding table of Golo-Mrice codes By selecting a coding table, it is possible to reduce the amount of code when coding is performed using the variable length coding table. On the other hand, when the variance of the input signal is large, the table selection unit 101 selects a variable length coding table having a long suffix length, thereby reducing the amount of codes when coding is performed using the variable length coding table. I can do it.

テーブル選択部101は、選択した可変長符号化テーブルを示す情報(以下、テーブルインデックスと称する場合がある)を、符号量取得部102および符号化部105それぞれに送る。例えば、ゴロムライス符号の可変長符号化テーブルの場合、サフィックス長をテーブルインデックスとすればよい。テーブル選択部101は、図2に示す符号化プロセッサ502により実現される。   The table selection unit 101 sends information indicating the selected variable-length coding table (hereinafter sometimes referred to as a table index) to the code amount acquisition unit 102 and the coding unit 105, respectively. For example, in the case of a variable length coding table of Golomb-Rice codes, the suffix length may be used as a table index. The table selection unit 101 is realized by the encoding processor 502 shown in FIG.

なお、入力信号の特性(絶対値和または分散)と可変長符号化テーブルとの対応関係を予め定めておき、この対応関係を規定する情報(例えば、数式またはルックアップテーブル等)を記憶部107に記憶させておき、テーブル選択部101は、この対応関係を規定する情報を参照することによって、可変長符号化テーブルを選択するものとしてもよい。例えば、ゴロムライス符号の場合、入力信号の絶対値和とサフィックス長とは対数の関係にあることから、テーブル選択部101は、対応関係を規定する情報として、絶対値和からサフィックス長を算出する数式を用い、特性値(絶対値和)から算出したサフィックス長により可変長符号化テーブルを選択するものとすればよい。   Note that a correspondence relationship between the characteristics (absolute value sum or variance) of the input signal and the variable-length coding table is determined in advance, and information (for example, a mathematical expression or a lookup table) that defines the correspondence relationship is stored in the storage unit 107. The table selection unit 101 may select the variable-length coding table by referring to the information defining the correspondence relationship. For example, in the case of the Golomb-Rice code, since the absolute value sum of the input signal and the suffix length are in a logarithmic relationship, the table selection unit 101 uses the mathematical formula for calculating the suffix length from the absolute value sum as information defining the correspondence relationship. And the variable length coding table may be selected based on the suffix length calculated from the characteristic value (absolute value sum).

また、上述では、1以上の可変長符号化テーブルが予め記憶部107に記憶されているものとしたが、これに限定されるものではなく、テーブル選択部101は、入力信号を特性(絶対値和あるいは分散)に基づいて分類し、各グループに分類された入力信号の出現頻度に基づいて、特定の符号(例えば、ハフマン符号)に符号化する可変長符号化テーブルを作成するものとしてもよい。これによって、入力信号に最適な可変長符号化テーブルを作成することができ、高効率な符号化を実現することができる。また、上述において、1以上の可変長符号化テーブルは、予め記憶部107に記憶されるものとしてが、これに限定されるものではなく、1以上の可変長符号化の処理方法を予め用意しておいてもよい。例えば、ゴロムライス符号の場合、入力信号からプレフィックス長およびサフィックス値の各パラメタを算出し、これら値に基づいて可変長符号を構成することにより、可変長符号化を行うことが可能である。このように所定の演算処理として規定可能な可変長符号化方法を用いる場合、この演算ロジックを符号化装置に用意しておくことにより、記憶部107に可変長符号化テーブルを記憶することの代わりとすることができる。   In the above description, one or more variable-length coding tables are stored in the storage unit 107 in advance. However, the present invention is not limited to this, and the table selection unit 101 determines the input signal as a characteristic (absolute value). Based on the appearance frequency of the input signal classified into each group, a variable length coding table for coding into a specific code (for example, Huffman code) may be created. . This makes it possible to create a variable-length coding table that is optimal for the input signal, and to realize highly efficient coding. In the above description, the one or more variable length coding tables are stored in the storage unit 107 in advance. However, the present invention is not limited to this, and one or more variable length coding processing methods are prepared in advance. You may keep it. For example, in the case of a Golomb-Rice code, variable length coding can be performed by calculating each parameter of a prefix length and a suffix value from an input signal and constructing a variable length code based on these values. When using a variable-length encoding method that can be defined as the predetermined arithmetic processing in this way, instead of storing the variable-length encoding table in the storage unit 107 by preparing this arithmetic logic in the encoding device. It can be.

また、上述において、入力信号の特性として絶対値和および分散を例に挙げたが、これらに限定されるものではなく、入力信号の特性として、入力信号の平均値を用いるものとしてもよい。一般に、音声または画像等において予測符号化を行う場合、予測後の信号は0を中心に分布する傾向がある。しかし、符号化装置10に0以外を中心に分布するような入力信号が入力される場合には、入力信号の平均値に基づいて可変長符号化テーブルの選択を行うことにより、より高効率な符号化が実現される場合がある。   In the above description, the sum of absolute values and the variance are exemplified as the characteristics of the input signal. However, the present invention is not limited to these, and the average value of the input signal may be used as the characteristics of the input signal. In general, when predictive coding is performed on speech or an image, the predicted signal tends to be distributed around 0. However, when an input signal that is distributed around the center other than 0 is input to the encoding device 10, the variable length encoding table is selected based on the average value of the input signal, so that higher efficiency can be achieved. Encoding may be realized.

また、テーブル選択部101は、記憶部107に記憶された1以上の可変長符号化テーブルから、入力信号の特性に基づいて、1の可変長符号化テーブルを選択するものとしたが、これに限定されるものではなく、記憶部107に記憶された可変長符号化テーブルは単一のテーブルであり、これを用いるものとしてもよい。入力信号の特性がほとんど変化しないような場合、単一の可変長符号化テーブルを用いるものとしても、高効率な符号化が行える場合がある。この場合、1以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択する必要がないので、符号化装置10はテーブル選択部101を有する必要はない。この場合、符号量取得部102および符号化部105は、この単一の可変長符号化テーブルが選択されているものとみなして後述の処理を行うものとすればよい。   The table selection unit 101 selects one variable length coding table from one or more variable length coding tables stored in the storage unit 107 based on the characteristics of the input signal. The variable length coding table stored in the storage unit 107 is not limited, and may be a single table. When the characteristics of the input signal hardly change, even if a single variable length coding table is used, highly efficient coding may be performed. In this case, since it is not necessary to select one variable length coding table from one or more variable length coding tables, the encoding device 10 does not need to have the table selection unit 101. In this case, the code amount acquisition unit 102 and the encoding unit 105 may perform the processing described later on the assumption that this single variable-length encoding table is selected.

符号量取得部102は、テーブル選択部101からテーブルインデックスを受け取り、このテーブルインデックスに基づいて、基準符号量を取得する機能部である。符号量取得部102による基準符号量の取得方法については、後述する。符号量取得部102は、取得した基準符号量をパラメタ決定部103へ送る。符号量取得部102は、図2に示す符号化プロセッサ502により実現される。   The code amount acquisition unit 102 is a functional unit that receives a table index from the table selection unit 101 and acquires a reference code amount based on the table index. The reference code amount acquisition method by the code amount acquisition unit 102 will be described later. The code amount acquisition unit 102 sends the acquired reference code amount to the parameter determination unit 103. The code amount acquisition unit 102 is realized by the encoding processor 502 shown in FIG.

パラメタ決定部103は、符号量取得部102から基準符号量を受け取り、符号量制御部106から割り当て符号量を受け取り、基準符号量および割り当て符号量に基づいて、量子化パラメタを決定する機能部である。パラメタ決定部103による量子化パラメタの決定方法については、後述する。パラメタ決定部103は、決定した量子化パラメタを量子化部104および符号化部105それぞれに送る。パラメタ決定部103は、図2に示す符号化プロセッサ502により実現される。   The parameter determination unit 103 is a functional unit that receives the reference code amount from the code amount acquisition unit 102, receives the assigned code amount from the code amount control unit 106, and determines the quantization parameter based on the reference code amount and the assigned code amount. is there. A method for determining the quantization parameter by the parameter determination unit 103 will be described later. The parameter determination unit 103 sends the determined quantization parameter to the quantization unit 104 and the encoding unit 105, respectively. The parameter determination unit 103 is realized by the encoding processor 502 shown in FIG.

量子化部104は、外部から入力信号を受信し、パラメタ決定部103から量子化パラメタを受け取り、入力信号を量子化パラメタにより量子化を行って量子化値を得る機能部である。例えば、量子化部104は、以下の式(1)に基づいて、量子化を行う。   The quantization unit 104 is a functional unit that receives an input signal from the outside, receives a quantization parameter from the parameter determination unit 103, quantizes the input signal with the quantization parameter, and obtains a quantization value. For example, the quantization unit 104 performs quantization based on the following equation (1).

x1=round(x0/2) ・・・(1) x1 = round (x0 / 2 q ) (1)

上述の式(1)において、x0は入力信号を示し、x1は量子化値を示し、qは量子化パラメタを示す。また、round()は小数点以下を四捨五入する関数を示す。この関数round()による処理を行うことによって、復号装置20により符号化された符号を復号する場合に、四捨五入を行わない場合と比較して、復号した信号の誤差を低減することができる。また、上述の式(1)により量子化された量子化値は、量子化幅(式(1)の2)に応じて小さくなるので分散が小さくなる。量子化部104は、量子化によって得た量子化値を、符号化部105へ送る。量子化部104は、図2に示す符号化プロセッサ502により実現される。 In the above equation (1), x0 represents an input signal, x1 represents a quantized value, and q represents a quantization parameter. In addition, round () indicates a function that rounds off after the decimal point. By performing the process using the function round (), it is possible to reduce the error of the decoded signal when decoding the code encoded by the decoding device 20 as compared with the case where rounding is not performed. Further, since the quantized value quantized by the above equation (1) becomes small according to the quantization width (2 q in the equation (1)), the dispersion becomes small. The quantization unit 104 sends the quantized value obtained by the quantization to the encoding unit 105. The quantization unit 104 is realized by the encoding processor 502 shown in FIG.

なお、量子化部104は、上述の式(1)を用いて量子化を行うことに限定されるものではなく、その他の方式に基づいて量子化を行ってもよい。例えば、H.264/MPEG−4 AVC(Advanced Video Coding)等における量子化と同様の処理を行ってもよい。   Note that the quantization unit 104 is not limited to performing quantization using the above equation (1), and may perform quantization based on other methods. For example, H.M. Processing similar to quantization in H.264 / MPEG-4 AVC (Advanced Video Coding) may be performed.

符号化部105は、テーブル選択部101からテーブルインデックスを受け取り、パラメタ決定部103から量子化パラメタを受け取り、量子化部104から量子化値を受け取り、量子化値に対して可変長符号化を行う機能部である。具体的には、符号化部105は、テーブルインデックスおよび量子化パラメタに基づいて、記憶部107に記憶されている1以上の可変長符号化テーブルの中から、1の可変長符号化テーブルを選択し、その可変長符号化テーブルにより量子化値に対して可変長符号化を行う。上述のように、量子化値は、量子化幅に応じて小さくなるので分散が小さくなることから、符号化部105は、入力信号よりも分散の小さくなった量子化値に対応した可変長符号化テーブルを用いて可変長符号化を行うことにより、発生する符号量を小さくすることができる。   The encoding unit 105 receives a table index from the table selection unit 101, receives a quantization parameter from the parameter determination unit 103, receives a quantization value from the quantization unit 104, and performs variable length encoding on the quantization value. It is a functional part. Specifically, the encoding unit 105 selects one variable length encoding table from one or more variable length encoding tables stored in the storage unit 107 based on the table index and the quantization parameter. Then, the variable length coding is performed on the quantized value by the variable length coding table. As described above, since the quantized value becomes smaller in accordance with the quantization width, the variance becomes smaller. Therefore, the encoding unit 105 uses the variable length code corresponding to the quantized value whose variance is smaller than that of the input signal. By performing variable length encoding using the conversion table, the amount of generated code can be reduced.

ここで、上述の式(1)を用いて量子化を行い、ゴロムライス符号の可変長符号化テーブルを用いる場合を考える。また、上述のように、ゴロムライス符号のサフィックス長を、可変長符号化テーブルのテーブルインデックスとして考える。符号化部105は、上述のテーブル選択部101により選択された可変長符号化テーブルは、量子化を行わない、すなわち、例えば、式(1)においては、量子化パラメタq=0の場合に最適な可変長符号化テーブルであるので、受け取った量子化パラメタqが「0」である場合、テーブル選択部101が選択した可変長符号化テーブルにより可変長符号化を行うものとすればよい。また、パラメタ決定部103により決定された量子化パラメタqが「1」である場合、上述の式(1)によれば、量子化値は入力信号の約1/2になることから、分散が1/2の信号(量子化値)に対応する可変長符号化テーブルが最適となる。ゴロムライス符号の可変長符号化テーブルの場合、これはサフィックス長が1小さい可変長符号化テーブルに対応する。このことから、テーブル選択部101により選択された可変長符号化テーブルのテーブルインデックスをkとすると、符号化部105は、記憶部107に記憶された、サフィックス長がk−qとなるゴロムライス符号の可変長符号化テーブルにより可変長符号化を行えばよい。なお、ゴロムライス符号のサフィックス長は0以上であることから、例えば、k−qが0未満となる場合、符号化部105は、サフィックス長が0のゴロムライス符号の可変長符号化テーブルを用いて可変長符号化を行うものとすればよい。なお、例えば、式(1)以外の方法によって量子化を行う場合、上述と同様に、各量子化パラメタに対応する分散の変化度合に応じた可変長符号化テーブルを選択するものとしてもよい。   Here, a case where quantization is performed using the above-described equation (1) and a variable length coding table of Golomb-Rice codes is used will be considered. Further, as described above, the suffix length of the Golomb-Rice code is considered as a table index of the variable length coding table. The encoding unit 105 does not perform quantization on the variable-length encoding table selected by the table selection unit 101 described above. That is, for example, in the equation (1), it is optimal when the quantization parameter q = 0. Therefore, when the received quantization parameter q is “0”, variable length coding may be performed using the variable length coding table selected by the table selection unit 101. Further, when the quantization parameter q determined by the parameter determination unit 103 is “1”, according to the above equation (1), the quantized value is approximately ½ of the input signal, and thus the variance is A variable-length coding table corresponding to a 1/2 signal (quantized value) is optimal. In the case of the variable length coding table of the Golomb-Rice code, this corresponds to a variable length coding table whose suffix length is 1 smaller. From this, assuming that the table index of the variable-length coding table selected by the table selection unit 101 is k, the coding unit 105 stores the Golomb-Rice code stored in the storage unit 107 and having a suffix length kq. Variable length encoding may be performed using a variable length encoding table. Since the suffix length of the Golomb-Rice code is greater than or equal to 0, for example, when k-q is less than 0, the encoding unit 105 is variable using the variable-length encoding table of the Golomb-Rice code with a suffix length of 0. What is necessary is just to perform long encoding. For example, when quantization is performed by a method other than Equation (1), a variable-length coding table corresponding to the degree of change in variance corresponding to each quantization parameter may be selected as described above.

なお、ハフマン符号の可変長符号化テーブルにより可変長符号化を行う場合も、同様の方法により可変長符号化テーブルを選択して符号化を行ってよい。ハフマン符号の可変長符号化テーブルを利用する場合、予め複数の特性値(信号の絶対値和または分散)に対応するテーブルを用意しておき、テーブル選択部101がいずれかを選択する。符号化部105は、ゴロムライス符号の可変長符号化テーブルを用いる場合と同様、ハフマン符号の可変長符号化テーブルのテーブルインデックスと、量子化パラメタとに基づいて、量子化値の分散(または絶対値和)を取得し、これに対応する、または最も近い可変長符号化テーブルを用いて、量子化値に対して可変長符号化を行うものとすればよい。ここで用いるハフマン符号の可変長符号化テーブルについては、分散または絶対値和ごとに分類された信号の出現頻度に基づいて予め作成されたものであってもよい。   Note that when variable length coding is performed using the variable length coding table of the Huffman code, the variable length coding table may be selected and encoded by the same method. When using a variable length coding table of Huffman codes, a table corresponding to a plurality of characteristic values (absolute value sum or variance of signals) is prepared in advance, and the table selection unit 101 selects one of them. Similar to the case of using the variable length coding table of the Golomb-Rice code, the encoding unit 105 distributes the quantized value (or the absolute value) based on the table index of the variable length coding table of the Huffman code and the quantization parameter. Sum) is obtained, and variable length coding may be performed on the quantized value using a variable length coding table corresponding to or closest to this. The Huffman code variable-length coding table used here may be created in advance based on the frequency of appearance of signals classified for each variance or absolute value sum.

また、例えば、ゴロムライス符号等の符号無し整数を想定した可変長符号化テーブルによる可変長符号化を行う場合、かつ、量子化値が符号付き整数である場合に、符号化部105は、以下の式(2)によって、量子化値を符号無し整数へと変換した後に可変長符号化を行うものとしてもよい。   Also, for example, when performing variable-length encoding using a variable-length encoding table that assumes an unsigned integer such as a Golomb-Rice code, and when the quantized value is a signed integer, the encoding unit 105 is: It is also possible to perform variable length coding after converting the quantized value to an unsigned integer according to equation (2).

x2=−2・x1 (if x1≦0)
x2=2・x1+1 (if x1>0) ・・・(2)
x2 = −2 · x1 (if x1 ≦ 0)
x2 = 2 · x1 + 1 (if x1> 0) (2)

上述の式(2)において、x1は符号付きの量子化値を示し、x2は符号無し整数に変換された値を示す。なお、上述の式(2)による変換を行う代わりに、符号ビットを別途符号化し、量子化値の絶対値についてゴロムライス符号の可変長符号化テーブルによる可変長符号化を行ってもよい。   In the above equation (2), x1 represents a signed quantized value, and x2 represents a value converted to an unsigned integer. Instead of performing the conversion according to the above equation (2), the code bit may be separately encoded, and the absolute value of the quantized value may be subjected to variable length encoding using the variable length encoding table of the Golomb-Rice code.

符号化部105は、さらに、復号装置20による復号処理に用いるため、テーブルインデックスおよび量子化パラメタについても符号化する。この場合、テーブルインデックスおよび量子化パラメタは、例えば、予め定められたビット数により固定長で符号化されてもよいし、予め定められた可変長符号化テーブルを用いて可変長符号化を行ってもよい。また、テーブルインデックスおよび量子化パラメタは、予測符号化を行ってもよい。テーブルインデックスおよび量子化パラメタの特性が大きく変化しない場合に、過去に符号化した値(例えば、直前に符号化した値)を用いてこれらの値を予測(例えば、0次予測または1次予測等)し、その予測残差を符号化することにより発生する符号量を削減することが可能である。   The encoding unit 105 also encodes the table index and the quantization parameter for use in the decoding process by the decoding device 20. In this case, the table index and the quantization parameter may be encoded with a fixed length by, for example, a predetermined number of bits, or may be variable length encoded using a predetermined variable length encoding table. Also good. The table index and the quantization parameter may be subjected to predictive encoding. When the characteristics of the table index and the quantization parameter do not change significantly, these values are predicted using values encoded in the past (for example, the values encoded immediately before) (for example, 0th-order prediction or primary prediction). The amount of code generated by encoding the prediction residual can be reduced.

符号化部105は、以上のように、テーブルインデックス、量子化パラメタおよび量子化値を符号化し、符号ストリームとして外部(例えば、ネットワーク40等)へと出力する。また、符号化部105は、符号化した符号の符号量(発生符号量)を、符号量制御部106へ送る。符号化部105は、図2に示す符号化プロセッサ502により実現される。   As described above, the encoding unit 105 encodes the table index, the quantization parameter, and the quantization value, and outputs the encoded code stream to the outside (for example, the network 40 or the like). In addition, the encoding unit 105 sends the code amount (generated code amount) of the encoded code to the code amount control unit 106. The encoding unit 105 is realized by the encoding processor 502 shown in FIG.

符号量制御部106は、符号化部105から発生符号量を受け取り、割り当て符号量を設定する機能部である。符号量制御部106は、受信バッファ30において占有している符号の量(以下、占有符号量という)をモデル化し、受信バッファ30においてバッファアンダーフローが発生しないような符号化部105における発生符号量となるように、割り当て符号量を設定する。   The code amount control unit 106 is a functional unit that receives the generated code amount from the encoding unit 105 and sets the assigned code amount. The code amount control unit 106 models the amount of code occupied in the reception buffer 30 (hereinafter referred to as the occupied code amount), and the generated code amount in the encoding unit 105 so that no buffer underflow occurs in the reception buffer 30. The assigned code amount is set so that

例えば、符号量制御部106は、MPEG−2におけるVBV(Video Buffer Verifier)、または、M.264/MPEG−4 AVCにおけるHRD(Hypothetical Reference Decoder)等のバッファモデルと同一または類似のモデル化を行うことによって、受信バッファ30においてバッファアンダーフローが発生しない割り当て符号量を設定するものとしてもよい。   For example, the code amount control unit 106 may be a VBV (Video Buffer Verifier) in MPEG-2 or M.264. An allocation code amount that does not cause buffer underflow in the reception buffer 30 may be set by performing modeling that is the same as or similar to a buffer model such as HRD (Hypothetical Reference Decoder) in H.264 / MPEG-4 AVC.

具体的には、例えば、図4に示すような受信バッファ30の占有符号量のモデル化を行ってもよい。図4において、縦軸は受信バッファ30で占有する符号量(占有符号量)を示し、横軸は時間を示している。図4に示すように、受信バッファ30は、初期状態において占有符号量が「0」の状態にあり、ここから、一定のビットレートで符号化装置10から出力された符号が蓄積される。その後、所定の初期遅延時間が経過すると、復号装置20が復号を開始し、最初の処理単位における符号量に相当する符号が復号装置20によって受信バッファ30から引き去られる。以降は、所定の処理単位毎に、符号化装置10から出力される符号の蓄積と、復号装置20による符号の引き去りとが繰り返される。このような図4に示すモデルにおいて、占有符号量が「0」を下回った場合にバッファアンダーフローが発生する。すなわち、各処理単位において、復号装置20による符号の引き去りのタイミングにおける占有符号量よりも、符号化部105が出力する符号の符号量(発生符号量)が大きい場合に、バッファアンダーフローが発生する。   Specifically, for example, the occupation code amount of the reception buffer 30 as shown in FIG. 4 may be modeled. In FIG. 4, the vertical axis represents the code amount occupied by the reception buffer 30 (occupied code amount), and the horizontal axis represents time. As shown in FIG. 4, the reception buffer 30 is in a state where the occupied code amount is “0” in the initial state, and from this, the code output from the encoding device 10 at a constant bit rate is accumulated. Thereafter, when a predetermined initial delay time elapses, the decoding device 20 starts decoding, and a code corresponding to the code amount in the first processing unit is pulled out of the reception buffer 30 by the decoding device 20. Thereafter, the accumulation of the code output from the encoding device 10 and the removal of the code by the decoding device 20 are repeated for each predetermined processing unit. In the model shown in FIG. 4, a buffer underflow occurs when the occupied code amount falls below “0”. That is, in each processing unit, a buffer underflow occurs when the code amount (generated code amount) of the code output from the encoding unit 105 is larger than the occupied code amount at the timing of code removal by the decoding device 20. .

そこで、符号量制御部106は、各処理単位における符号の引き去りのタイミングでの占有符号量と同一または小さい符号量を、割り当て符号量として設定する。符号化装置10は、ある処理単位の入力信号の量子化値を、割り当て符号量よりも小さい符号量となるように可変長符号化を行うことによって、バッファアンダーフローの発生を抑制することが可能となる。ここで、割り当て符号量は、各処理単位における符号の引き去りのタイミングでの占有符号量と同一の符号量として設定されてもよいが、これに限定されるものではなく、これよりも小さい符号量として設定されてもよい。   Therefore, the code amount control unit 106 sets a code amount that is the same as or smaller than the occupied code amount at the timing of code removal in each processing unit as the assigned code amount. The encoding device 10 can suppress the occurrence of buffer underflow by performing variable length encoding on the quantized value of an input signal in a certain processing unit so that the code amount is smaller than the allocated code amount. It becomes. Here, the allocated code amount may be set as the same code amount as the occupied code amount at the time of code removal in each processing unit, but is not limited thereto, and the code amount smaller than this May be set as

また、受信バッファ30の占有符号量が一定以上である状態、すなわち、符号化部105により発生可能な符号量に余裕がある場合に、ある処理単位においてこの余裕分を一度に消費してしまうよりは、後続の複数の処理単位でこの余裕分を分割したほうが、発生符号量が安定しやすい。このことから、特に占有符号量が大きい場合に、占有符号量よりも小さい符号量を割り当て符号量として設定することによって、復号装置20により復号された信号の品質を安定化させることが可能となる。   Further, when the amount of code occupied by the reception buffer 30 is greater than a certain value, that is, when there is a margin in the amount of code that can be generated by the encoding unit 105, this margin is consumed at a time in a certain processing unit. If the margin is divided by a plurality of subsequent processing units, the generated code amount is more stable. From this, it is possible to stabilize the quality of the signal decoded by the decoding device 20 by setting the code amount smaller than the occupied code amount as the assigned code amount, particularly when the occupied code amount is large. .

符号量制御部106は、設定した割り当て符号量を、パラメタ決定部103へ送る。符号量制御部106は、図2に示す符号化プロセッサ502により実現される。   The code amount control unit 106 sends the set assigned code amount to the parameter determination unit 103. The code amount control unit 106 is realized by the encoding processor 502 shown in FIG.

記憶部107は、テーブル選択部101および符号化部105が参照する1以上の可変長符号化テーブル等を記憶する機能部である。記憶部107は、図2に示す補助記憶装置505により実現される。   The storage unit 107 is a functional unit that stores one or more variable-length encoding tables and the like that are referenced by the table selection unit 101 and the encoding unit 105. The storage unit 107 is realized by the auxiliary storage device 505 illustrated in FIG.

なお、図3に示したテーブル選択部101、符号量取得部102、パラメタ決定部103、量子化部104、符号化部105、符号量制御部106、および記憶部107は、機能を概念的に示したものであって、このような構成に限定されるものではない。例えば、図3で独立した機能部として図示した複数の機能部を、1つの機能部として構成してもよい。一方、図3の1つの機能部が有する機能を複数に分割し、複数の機能部として構成するものとしてもよい。   The table selection unit 101, the code amount acquisition unit 102, the parameter determination unit 103, the quantization unit 104, the encoding unit 105, the code amount control unit 106, and the storage unit 107 illustrated in FIG. It is shown and it is not limited to such a configuration. For example, a plurality of functional units illustrated as independent functional units in FIG. 3 may be configured as one functional unit. On the other hand, the function of one functional unit in FIG. 3 may be divided into a plurality of units and configured as a plurality of functional units.

また、図3に示したテーブル選択部101、符号量取得部102、パラメタ決定部103、量子化部104、符号化部105、および符号量制御部106は、いずれも図2に示す符号化プロセッサ502により実現されるものとしたが、これに限定されるものではない。すなわち、上述の各機能部のうち少なくともいずれかが、記憶装置(例えば、図2に示す補助記憶装置505)等の記憶媒体に記憶されているプログラムがCPU(Central Processing Unit)により実行されることによって実現されるものとしてもよい。   Also, the table selection unit 101, the code amount acquisition unit 102, the parameter determination unit 103, the quantization unit 104, the encoding unit 105, and the code amount control unit 106 illustrated in FIG. However, the present invention is not limited to this. That is, a program stored in a storage medium such as a storage device (for example, the auxiliary storage device 505 shown in FIG. 2) is executed by a CPU (Central Processing Unit) at least one of the functional units described above. It is good also as what is realized by.

図5は、各量子化パラメタに対するワースト符号量を示すグラフの一例を示す図である。図3および5を参照しながら、符号量取得部102による基準符号量の取得方法、およびパラメタ決定部103による量子化パラメタの決定方法の詳細について説明する。   FIG. 5 is a diagram illustrating an example of a graph indicating the worst code amount for each quantization parameter. Details of the reference code amount acquisition method by the code amount acquisition unit 102 and the quantization parameter determination method by the parameter determination unit 103 will be described with reference to FIGS.

上述したように、テーブル選択部101は、外部から受信した入力信号の絶対値和または分散等に基づいて、入力信号に対して可変長符号化を行った場合の符号量が小さくなる可変長符号化テーブルを選択するものとしている。逆に言えば、あるテーブルインデックスが示す可変長符号化テーブルが与えられた場合に、対応する入力信号の取り得る値はある有限の範囲に制限されることになる。例えば、ある可変長符号化テーブルが入力信号の絶対値和≦128に対応するテーブルである場合、この可変長符号化テーブルが与えられれば、処理単位内の入力信号が取り得る値は、その絶対値和が128以下となる任意の数値(入力信号が整数値の場合、任意の整数)群に限定される。入力信号が限定されれば、これらの入力信号を、対応する可変長符号化テーブルで符号化した場合の発生符号量が取得可能であり、例えば、総当たり等の方法によって、この可変長符号化テーブルにより入力信号を符号化した場合の最大の符号量が取得可能である。この取得した符号量は、量子化を行わない場合の最大の符号量であるが、量子化が行われた量子化値についても、同様に、符号化した場合の最大の符号量が取得可能である。この最大の符号量を、予め取得しておいてもよい。   As described above, the table selection unit 101 is a variable length code that reduces the amount of code when variable length coding is performed on an input signal based on the absolute value sum or variance of the input signal received from the outside. Select a conversion table. In other words, when a variable length coding table indicated by a certain table index is given, possible values of the corresponding input signal are limited to a certain finite range. For example, when a variable length coding table is a table corresponding to the sum of absolute values of input signals ≦ 128, if this variable length coding table is given, the values that can be taken by the input signal in the processing unit are the absolute values. It is limited to an arbitrary numerical value group whose value sum is 128 or less (an arbitrary integer when the input signal is an integer value). If the input signals are limited, it is possible to obtain the generated code amount when these input signals are encoded by the corresponding variable length encoding table. For example, this variable length encoding can be performed by a brute force method or the like. The maximum code amount when the input signal is encoded by the table can be acquired. This acquired code amount is the maximum code amount when quantization is not performed, but the maximum code amount when encoded can be acquired in the same manner for the quantized value. is there. This maximum code amount may be acquired in advance.

また、量子化パラメタと量子化幅とが単調増加の関係にある場合、量子化パラメタが大きくなるほど、その量子化パラメタで量子化した量子化値を符号化した際の符号量は小さくなる。例えば、上述の式(1)のように、量子化幅が量子化パラメタの指数関数として表現される場合、符号化された符号量は、量子化パラメタに対する一次式で近似することができる。この性質は、上述の最大の符号量についても同様である。そこで、図5に示すように、予め、一次式によって最大の符号量のモデル化を行う。具体的には、あるテーブルインデックスが示す可変長符号化テーブルで符号化する場合に、任意の量子化パラメタを用いた場合の最大の符号量を取得(例えば、総当たりによる)し、図5に示すように、これらの最大の符号量のすべてを上回る一次式を設定する(下記の式(3))。   When the quantization parameter and the quantization width are in a monotonically increasing relationship, the larger the quantization parameter, the smaller the code amount when the quantized value quantized with the quantization parameter is encoded. For example, when the quantization width is expressed as an exponential function of the quantization parameter as in the above equation (1), the encoded code amount can be approximated by a linear expression for the quantization parameter. This property is the same for the maximum code amount described above. Therefore, as shown in FIG. 5, the maximum code amount is modeled in advance by a linear expression. Specifically, when encoding is performed using a variable-length encoding table indicated by a certain table index, the maximum code amount when an arbitrary quantization parameter is used is acquired (for example, by brute force), and FIG. As shown, a linear expression exceeding all of these maximum code amounts is set (the following expression (3)).

WB=Cxq+C (C<0、C>0) ・・・(3) WB = C 1 xq + C 2 (C 1 <0, C 2 > 0) (3)

上述の式(3)において、Cは、一次式の傾きであり、量子化パラメタqの増加と共に符号量は減少するので負値である。また、Cは、一次式の切片である。そして、WBは、一次式で算出される符号量を示し、以下、ワースト符号量という。すなわち、式(3)は、各量子化パラメタに対するワースト符号量を示す一次式となる。 In the above equation (3), C 1 is the slope of the linear equation and is a negative value because the amount of code decreases as the quantization parameter q increases. C 2 is an intercept of a linear expression. WB indicates a code amount calculated by a linear expression, and is hereinafter referred to as a worst code amount. That is, Expression (3) is a linear expression indicating the worst code amount for each quantization parameter.

そして、テーブルインデックス毎に、上述の式(3)に示す一次式の傾きCおよび切片Cを予め取得しておく。すなわち、テーブルインデックスが決まれば、ワースト符号量を示す一次式が決定されることになる。これによって、各テーブルインデックスについて、特定の量子化パラメタに対するワースト符号量が容易に算出できる。また、このテーブルインデックスと、ワースト符号量を示す一次式(すなわち、傾きCおよび切片C)との対応関係の情報は、例えば、予め記憶部107に記憶されているものとすればよい。そして、符号量取得部102は、記憶部107を参照して、テーブル選択部101から受け取ったテーブルインデックスに対応するワースト符号量を示す一次式を特定し、例えば、その一次式の切片Cを、基準符号量として取得する。なお、一次式の傾きCについてはテーブルインデックス間で共通としてもよく、この場合はテーブルインデックス毎に切片Cのみを予め記憶しておけばよい。 For each table index, the slope C 1 and the intercept C 2 of the linear expression shown in the above equation (3) are acquired in advance. That is, when the table index is determined, a linear expression indicating the worst code amount is determined. Thereby, the worst code amount for a specific quantization parameter can be easily calculated for each table index. Further, the information on the correspondence between the table index and the linear expression indicating the worst code amount (that is, the gradient C 1 and the intercept C 2 ) may be stored in the storage unit 107 in advance, for example. Then, code amount obtaining unit 102 refers to the storage unit 107 to identify the primary expression showing the worst amount of codes corresponding to the table index received from the table selection unit 101, for example, sections C 2 of the linear expression And obtained as a reference code amount. Incidentally, may be common between the table index for the slope C 1 of the primary type, this case may be previously stored only sections C 2 each table index.

パラメタ決定部103は、符号量取得部102により取得された基準符号量を有するワースト符号量を示す一次式を特定し、ワースト符号量が符号量制御部106から受け取った割り当て符号量を超えないように量子化パラメタを決定する。これによって、受信バッファ30におけるバッファアンダーフローの発生を抑制することが可能になる。具体的には、ワースト符号量WBが、上述の式(3)でモデル化されていることから、割り当て符号量Bについて、下記の式(4)が満たされていればよい。   The parameter determination unit 103 identifies a primary expression indicating the worst code amount having the reference code amount acquired by the code amount acquisition unit 102, so that the worst code amount does not exceed the allocated code amount received from the code amount control unit 106. Determine the quantization parameter. As a result, the occurrence of buffer underflow in the reception buffer 30 can be suppressed. Specifically, since the worst code amount WB is modeled by the above equation (3), the following equation (4) only needs to be satisfied for the allocated code amount B.

B≧Cxq+C ・・・(4) B ≧ C 1 xq + C 2 (4)

また、この式(4)から量子化パラメタqについて整理すると、下記の式(5)が得られる。   Further, when the quantization parameter q is arranged from the equation (4), the following equation (5) is obtained.

q≧(B−C)/C ・・・(5) q ≧ (B−C 2 ) / C 1 (5)

パラメタ決定部103は、この式(5)を満たす量子化パラメタqを決定すればよく、例えば、式(5)を満たす最小の量子化パラメタqを決定して、量子化部104に送る。なお、復号装置20の復号信号の品質の安定化を目的として、量子化パラメタqの変動を抑えるため、上述の式(5)を満たす範囲で、直前までの量子化パラメタに類似する値を量子化パラメタとして決定するものとしてもよい。   The parameter determination unit 103 only needs to determine the quantization parameter q that satisfies the equation (5). For example, the parameter determination unit 103 determines the minimum quantization parameter q that satisfies the equation (5) and sends the determined quantization parameter q to the quantization unit 104. For the purpose of stabilizing the quality of the decoded signal of the decoding apparatus 20, in order to suppress the fluctuation of the quantization parameter q, a value similar to the previous quantization parameter is quantized within a range that satisfies the above-described equation (5). It may be determined as a parameter.

なお、上述の式(3)に示すワースト符号量を示す一次式は、図5に示すように、各量子化パラメタに対応する最大の符号量の全てを上回る一次式に設定するものとしたが、これに限定されるものではない。例えば、各量子化パラメタに対応する最大の符号量のうち2点を接続するグラフであって、その他の最大符号量と差分の絶対値和が最小となるグラフを示す一次式に設定するものとしてもよい。また、上述のように設定した一次式が示すグラフについて、その切片が所定範囲(例えば、元のグラフの切片の1〜2倍の範囲)でシフトさせたグラフを示す一次式であってもよい。   The primary expression indicating the worst code amount shown in the above equation (3) is set to a linear expression exceeding all of the maximum code amounts corresponding to each quantization parameter, as shown in FIG. However, the present invention is not limited to this. For example, it is a graph that connects two points of the maximum code amount corresponding to each quantization parameter, and is set to a linear expression indicating a graph in which the absolute value sum of the difference between the other maximum code amount and the difference is minimum. Also good. Further, the graph represented by the linear equation set as described above may be a linear equation indicating a graph in which the intercept is shifted within a predetermined range (for example, a range of 1 to 2 times the intercept of the original graph). .

図6は、第1の実施形態に係る符号化装置の符号化処理の一例を示すフローチャートである。図6を参照しながら、本実施形態に係る符号化装置10の符号化処理の流れを総括的に説明する。   FIG. 6 is a flowchart illustrating an example of the encoding process of the encoding device according to the first embodiment. With reference to FIG. 6, the flow of the encoding process of the encoding apparatus 10 according to the present embodiment will be generally described.

<ステップS11>
テーブル選択部101は、外部から入力信号を受信する。そして、ステップS12へ移行する。
<Step S11>
The table selection unit 101 receives an input signal from the outside. Then, the process proceeds to step S12.

<ステップS12>
テーブル選択部101は、所定の処理単位毎に、入力信号の特性(例えば、入力信号の信号値の絶対値和または分散等)に基づいて、記憶部107に予め記憶されている1以上の可変長符号化テーブルの中から、1の可変長符号化テーブルを選択する。テーブル選択部101は、選択した可変長符号化テーブルを示す情報(以下、テーブルインデックスと称する場合がある)を、符号量取得部102および符号化部105それぞれに送る。そして、ステップS13へ移行する。
<Step S12>
The table selection unit 101 has one or more variables stored in advance in the storage unit 107 on the basis of the characteristics of the input signal (for example, the absolute value sum or variance of the signal values of the input signal) for each predetermined processing unit. One variable length coding table is selected from the long coding table. The table selection unit 101 sends information indicating the selected variable-length coding table (hereinafter sometimes referred to as a table index) to the code amount acquisition unit 102 and the coding unit 105, respectively. Then, the process proceeds to step S13.

<ステップS13>
符号量取得部102は、テーブル選択部101からテーブルインデックスを受け取り、このテーブルインデックスに基づいて、基準符号量を取得する。具体的には、符号量取得部102は、記憶部107を参照して、テーブル選択部101から受け取ったテーブルインデックスに対応するワースト符号量を示す一次式を特定し、例えば、その一次式の切片Cを、基準符号量として取得する。符号量取得部102は、取得した基準符号量をパラメタ決定部103へ送る。そして、ステップS14へ移行する。
<Step S13>
The code amount acquisition unit 102 receives a table index from the table selection unit 101, and acquires a reference code amount based on the table index. Specifically, the code amount acquisition unit 102 refers to the storage unit 107, identifies a primary expression indicating the worst code amount corresponding to the table index received from the table selection unit 101, and, for example, an intercept of the primary expression the C 2, to obtain as the reference code amount. The code amount acquisition unit 102 sends the acquired reference code amount to the parameter determination unit 103. Then, the process proceeds to step S14.

<ステップS14>
パラメタ決定部103は、符号量取得部102から基準符号量を受け取り、符号量制御部106から割り当て符号量を受け取り、基準符号量および割り当て符号量に基づいて、量子化パラメタを決定する。具体的には、パラメタ決定部103は、符号量取得部102により取得された基準符号量を有するワースト符号量を示す一次式を特定し、ワースト符号量が符号量制御部106から受け取った割り当て符号量を超えないように量子化パラメタを決定する。パラメタ決定部103は、決定した量子化パラメタを量子化部104および符号化部105それぞれに送る。そして、ステップS15へ移行する。
<Step S14>
The parameter determination unit 103 receives the reference code amount from the code amount acquisition unit 102, receives the assigned code amount from the code amount control unit 106, and determines the quantization parameter based on the reference code amount and the assigned code amount. Specifically, the parameter determination unit 103 specifies a primary expression indicating the worst code amount having the reference code amount acquired by the code amount acquisition unit 102, and the assigned code received by the worst code amount from the code amount control unit 106 The quantization parameter is determined so as not to exceed the amount. The parameter determination unit 103 sends the determined quantization parameter to the quantization unit 104 and the encoding unit 105, respectively. Then, the process proceeds to step S15.

<ステップS15>
量子化部104は、外部から入力信号を受信し、パラメタ決定部103から量子化パラメタを受け取り、入力信号を量子化パラメタにより量子化を行って量子化値を得る。量子化部104は、量子化によって得た量子化値を、符号化部105へ送る。そして、ステップS16へ移行する。
<Step S15>
The quantization unit 104 receives an input signal from the outside, receives a quantization parameter from the parameter determination unit 103, quantizes the input signal with the quantization parameter, and obtains a quantization value. The quantization unit 104 sends the quantized value obtained by the quantization to the encoding unit 105. Then, the process proceeds to step S16.

<ステップS16>
符号化部105は、テーブル選択部101からテーブルインデックスを受け取り、パラメタ決定部103から量子化パラメタを受け取り、量子化部104から量子化値を受け取り、量子化値に対して可変長符号化を行う。例えば、テーブル選択部101により選択された可変長符号化テーブルのテーブルインデックスをkとすると、符号化部105は、記憶部107に記憶された、サフィックス長がk−qとなるゴロムライス符号の可変長符号化テーブルにより可変長符号化を行う。そして、ステップS17へ移行する。
<Step S16>
The encoding unit 105 receives a table index from the table selection unit 101, receives a quantization parameter from the parameter determination unit 103, receives a quantization value from the quantization unit 104, and performs variable length encoding on the quantization value. . For example, assuming that the table index of the variable length coding table selected by the table selection unit 101 is k, the coding unit 105 stores the variable length of the Golomb-Rice code stored in the storage unit 107 and having a suffix length k−q. Variable length coding is performed using a coding table. Then, the process proceeds to step S17.

<ステップS17>
符号量制御部106は、符号化部105から発生符号量を受け取り、割り当て符号量を設定する。符号量制御部106は、受信バッファ30において占有している占有符号量をモデル化し、受信バッファ30においてバッファアンダーフローが発生しないような符号化部105における発生符号量となるように、割り当て符号量を設定する。
<Step S17>
The code amount control unit 106 receives the generated code amount from the encoding unit 105 and sets the allocated code amount. The code amount control unit 106 models the occupied code amount occupied in the reception buffer 30 and assigns the assigned code amount so that the generated code amount in the encoding unit 105 does not cause a buffer underflow in the reception buffer 30. Set.

以上のステップS11〜S17に示したように、符号化装置10は、入力した入力信号に対して符号化処理を行う。   As shown in steps S11 to S17 above, the encoding apparatus 10 performs an encoding process on the input signal that has been input.

以上のように、本実施形態に係る符号化装置10では、可変長符号化テーブルを示すテーブルインデックス毎に、ワースト符号量をモデル化することにより、割り当て符号量以下の符号量となる量子化パラメタを、少ない処理量で取得して符号化を行うことができる。これによって、少ない処理量で受信バッファ30のバッファアンダーフローの発生を抑制した信号の符号化を実現することができる。また、バッファアンダーフローの発生が抑制されることから、符号化処理においてスキップ等のバッファアンダーフローの回避手段を含む必要がなく、これによる局所的なSNR(Signal−to−Noise Ratio)の低下を抑制することができる。   As described above, in the encoding device 10 according to the present embodiment, the quantization parameter that becomes the code amount equal to or less than the allocated code amount by modeling the worst code amount for each table index indicating the variable-length encoding table. Can be obtained and encoded with a small amount of processing. As a result, it is possible to realize signal encoding that suppresses the occurrence of buffer underflow in the reception buffer 30 with a small amount of processing. In addition, since occurrence of buffer underflow is suppressed, it is not necessary to include means for avoiding buffer underflow such as skip in the encoding process, thereby reducing local SNR (Signal-to-Noise Ratio). Can be suppressed.

なお、符号化部105は、上述のように、量子化のほかに、テーブルインデックスおよび量子化パラメタについても符号化を行っている。この場合、パラメタ決定部103は、これらの符号量を考慮して量子化パラメタを決定するものとしてもよい。具体的には、例えば、これらのパラメタを固定のビット数により符号化する場合、処理単位毎に、当該ビット数を上述の式(4)における右辺に加算した上で、量子化パラメタの算出を行ってもよい。または、例えば、テーブルインデックスおよび量子化パラメタを予測符号化する場合、処理単位毎に、テーブルインデックスおよび量子化パラメタそれぞれの値における符号量を算出して上述の式(4)に反映してもよく、または、より簡単に、予測符号化した場合の発生しうる最大符号量を予め求めておき、この最大符号量を加算した上で量子化パラメタの算出を行ってもよい。   Note that the encoding unit 105 performs encoding on the table index and the quantization parameter in addition to the quantization as described above. In this case, the parameter determination unit 103 may determine the quantization parameter in consideration of these code amounts. Specifically, for example, when encoding these parameters with a fixed number of bits, the quantization parameter is calculated for each processing unit after adding the number of bits to the right side in the above equation (4). You may go. Alternatively, for example, when predictively encoding a table index and a quantization parameter, the code amount in each value of the table index and the quantization parameter may be calculated for each processing unit and reflected in the above equation (4). Or, more simply, the maximum code amount that can be generated in the case of predictive encoding is obtained in advance, and the quantization parameter may be calculated after adding the maximum code amount.

また、本実施形態に係る符号化装置10は、量子化パラメタが大きくなるほど、分散の小さい信号に対応する可変長符号化テーブルを利用して符号化を行うものとしている。しかし、量子化パラメタが所定値以上の場合、量子化パラメタが大きくなっても符号が削減されにくくなる場合がある。例えば、ゴロムライス符号を用いる場合において、量子化パラメタが、テーブル選択部101により選択された可変長符号化テーブルのテーブルインデックスとしてのサフィックス長を上回る場合、それ以上分散の小さいテーブルが用意されていないことにより、量子化パラメタが大きくなっても符号が削減されにくくなる。そこで、テーブル選択部101により選択された可変長符号化テーブル(すなわち、量子化を行わない場合に利用される可変長符号化テーブル)は、予め定められた複数の可変長符号化テーブルのうち、分散の大きい信号に対応する可変長符号化テーブルに限定してもよい。例えば、ゴロムライス符号の可変長符号化テーブルを用いる場合、テーブル選択部101は、サフィックス長が予め定められた所定値より大きい可変長符号化テーブルのみを選択する。この場合、テーブル選択部101は、所定値k0より大きいサフィックス長kを選択する。符号化部105は、量子化パラメタをqとした場合に、サフィックス長k−qの可変長符号化テーブルで符号化を行うが、ここでk−qはk0未満となっても問題ない。このようなテーブル選択部101による可変長符号化テーブルの選択によって、符号化部105が符号化に用いる可変長符号化テーブルが用意されていないような場合(すなわち、k−q<0となるような場合)が発生しにくくなり、ワースト符号量のモデル化がより正確に行えるようになる。   Also, the encoding apparatus 10 according to the present embodiment performs encoding using a variable length encoding table corresponding to a signal having a small variance as the quantization parameter increases. However, if the quantization parameter is greater than or equal to a predetermined value, it may be difficult to reduce the code even if the quantization parameter increases. For example, in the case of using the Golomb-Rice code, if the quantization parameter exceeds the suffix length as the table index of the variable length coding table selected by the table selection unit 101, a table with a smaller variance is not prepared. Therefore, even if the quantization parameter is increased, the code is not easily reduced. Therefore, the variable length coding table selected by the table selection unit 101 (that is, the variable length coding table used when quantization is not performed) is a plurality of predetermined variable length coding tables. You may limit to the variable-length encoding table corresponding to a signal with big dispersion | distribution. For example, when using a variable length coding table of Golomb-Rice codes, the table selection unit 101 selects only a variable length coding table whose suffix length is larger than a predetermined value. In this case, the table selection unit 101 selects a suffix length k that is greater than the predetermined value k0. The encoding unit 105 performs encoding using a variable length encoding table with a suffix length kq when the quantization parameter is q, but there is no problem even if kq is less than k0. When the variable length coding table used for coding by the coding unit 105 is not prepared by the selection of the variable length coding table by the table selection unit 101 (that is, k−q <0. The worst code amount can be modeled more accurately.

また、上述の式(3)に示すワースト符号量のモデル化の際、各量子化パラメタに対応する最大の符号量をすべて上回る一次式を設定するものとしたが、ワースト符号量が必ずしも直線で正確にモデル化できない場合がある。このような場合に、一部の量子化パラメタに対応する最大の符号量を外れ値とみなし、これを下回るような一次式でモデル化を行うものとしてもよい。この場合、外れ値とみなされた最大の符号量に対応する量子化パラメタを用いた場合、受信バッファ30においてバッファアンダーフローが発生してしまう可能性があるが、他の部分について正確にモデル化していれば、全体として符号化効率を向上させることが可能となる。なお、この場合、バッファアンダーフローの発生を完全に回避することができなくなるため、バッファアンダーフローが発生した場合には、以降の符号化をスキップする等の処理を行う必要がある。ここで、上述のワースト符号量のモデルの外れ値と見なした部分において、モデルに対する最大の符号量のはみ出し部分が十分に小さければ、バッファアンダーフローの発生時の不足ビット数は十分小さい(例えば、数ビット)と見込むことができる。例えば、符号化部105が符号化を行う際、最初に、量子化パラメタおよびテーブルインデックスを符号化し、その後、量子化値を符号化するようにすれば、バッファアンダーフローが発生する部分は、その処理単位の最後の数ビットに相当するため、バッファアンダーフローが発生してもその影響は処理単位内のごく一部(例えば、最後の数シンボル)にとどめることができる。さらに、量子化値の符号化方法についても、最初に処理単位内の各量子化値の符号情報または上位ビット部分の情報を符号化し、その後に下位ビットの情報を符号化すれば、バッファアンダーフローの影響範囲が下位ビット部分にとどまるため、信号の完全な欠落を防ぎ、ある程度まで復号することが可能となる。例えば、ゴロムライス符号の可変長符号化テーブルを用いる場合、信号の符号情報、符号のプレフィックス部分、サフィックス部分の順に符号化を行えばよい。この場合、符号のプレフィックス部分の長さから復号信号の絶対値の値域が制限されるため、この情報からある程度の精度での復号が行える。このような符号化方法により、バッファアンダーフローが発生した場合のSNRの大幅な低下を防ぐことができる。   Further, when modeling the worst code amount shown in the above equation (3), a linear expression that exceeds all the maximum code amounts corresponding to each quantization parameter is set. However, the worst code amount is not necessarily a straight line. It may not be modeled correctly. In such a case, the maximum code amount corresponding to a part of the quantization parameters may be regarded as an outlier, and modeling may be performed using a linear expression that is less than this. In this case, when a quantization parameter corresponding to the maximum code amount regarded as an outlier is used, a buffer underflow may occur in the reception buffer 30, but other parts are accurately modeled. As a result, the coding efficiency can be improved as a whole. In this case, since it is impossible to completely avoid the occurrence of buffer underflow, when buffer underflow occurs, it is necessary to perform processing such as skipping subsequent encoding. Here, in the portion regarded as the outlier of the above-mentioned worst code amount model, if the protruding portion of the maximum code amount for the model is sufficiently small, the number of insufficient bits when the buffer underflow occurs is sufficiently small (for example, , Several bits). For example, when the encoding unit 105 performs encoding, if the quantization parameter and the table index are encoded first, and then the quantized value is encoded, the portion where the buffer underflow occurs is Since this corresponds to the last few bits of the processing unit, even if a buffer underflow occurs, the influence can be limited to a small part (for example, the last few symbols) in the processing unit. Further, with regard to the quantization value encoding method, if the code information of each quantization value or the information of the upper bit part in the processing unit is first encoded and then the information of the lower bit is encoded, the buffer underflow Therefore, it is possible to prevent the signal from being completely lost and decode it to a certain extent. For example, when a variable length coding table of Golomb-Rice codes is used, encoding may be performed in the order of signal code information, code prefix portion, and suffix portion. In this case, since the range of the absolute value of the decoded signal is limited based on the length of the prefix portion of the code, decoding can be performed with a certain degree of accuracy from this information. Such an encoding method can prevent a significant decrease in SNR when a buffer underflow occurs.

また、バッファアンダーフローが発生した場合、符号化部105は、受信バッファ30においてバッファアンダーフローがちょうど発生する符号量まで符号化を行い、処理単位内におけるそれ以降の符号を破棄してもよい。その後、符号化部105は、次の処理単位から符号化を再開する。復号装置20は、受信バッファ30内のすべての符号を読み込み、処理単位内で復号可能な部分まで復号を行う。復号不可能な信号については、予め定められた値(例えば、「0」等)で置き換えを行ってもよい。その後、復号装置20は、次の処理単位において、受信バッファ30の先頭から符号を読み込み、復号を再開することができる。   Further, when a buffer underflow occurs, the encoding unit 105 may perform encoding up to a code amount at which the buffer underflow just occurs in the reception buffer 30 and discard the subsequent codes in the processing unit. Thereafter, the encoding unit 105 restarts encoding from the next processing unit. The decoding device 20 reads all codes in the reception buffer 30 and decodes up to a portion that can be decoded within the processing unit. A signal that cannot be decoded may be replaced with a predetermined value (for example, “0” or the like). Thereafter, the decoding device 20 can read the code from the head of the reception buffer 30 and resume decoding in the next processing unit.

また、上述の符号化部105による符号化については、受信バッファ30におけるバッファアンダーフローの発生を抑制する方法について説明してきたが、バッファオーバーフローについても同一または類似の方法により、その発生を抑制することが可能である。具体的には、符号量制御部106は割り当て符号量の代わりに、バッファオーバーフローが発生しない最低限の符号量を出力する。符号化装置10はワースト符号量の代わりに、処理単位ごとに各可変長符号化テーブルで最低限発生する符号量を予めモデル化しておく。パラメタ決定部103は、このモデルに基づき、テーブルインデックスと符号量制御部106が出力した符号量とに基づいて、量子化パラメタを設定する。バッファオーバーフローの発生を抑制する場合、上述の式(4)の不等号を反転させた形の数式を満たせばよいことから、量子化パラメタの上限値を得ることができ、この範囲で任意の量子化パラメタを選択すればよい。なお、量子化パラメタの上限値が、予め定められた最低値(上述の式(1)の量子化を行う場合、例えば「0」)を下回る可能性があるが、これは最低値を用いた場合でもバッファオーバーフローが発生する可能性が残ることを意味する。実際に発生する符号量が不足してバッファオーバーフローが発生しそうな場合、処理単位の符号の最後に余剰符号を付加することによって、発生符号量を水増しさせ、バッファオーバーフローの発生を抑制するものとしてもよい(いわゆる、ビット・スタッフィング処理)。   In addition, with regard to the encoding by the encoding unit 105 described above, the method for suppressing the occurrence of buffer underflow in the reception buffer 30 has been described. However, the occurrence of buffer overflow can also be suppressed by the same or similar method. Is possible. Specifically, the code amount control unit 106 outputs a minimum code amount that does not cause a buffer overflow, instead of the allocated code amount. Instead of the worst code amount, the encoding device 10 models in advance a code amount that is generated at the minimum in each variable-length encoding table for each processing unit. Based on this model, the parameter determination unit 103 sets a quantization parameter based on the table index and the code amount output from the code amount control unit 106. In order to suppress the occurrence of the buffer overflow, the upper limit value of the quantization parameter can be obtained because the mathematical expression in the form obtained by inverting the inequality sign in the above equation (4) can be obtained. Select a parameter. Note that the upper limit value of the quantization parameter may be lower than a predetermined minimum value (for example, “0” in the case of performing the quantization of the above formula (1)). This means that there is still a possibility of buffer overflow. If the amount of code actually generated is insufficient and buffer overflow is likely to occur, adding a surplus code to the end of the code of the processing unit can increase the amount of generated code and suppress the occurrence of buffer overflow Good (so-called bit stuffing process).

また、上述のバッファオーバーフローの発生を抑制する方法は、上述のバッファアンダーフローの発生を抑制する方法と併用して用いられるものとしてもよい。この場合、パラメタ決定部103は、割り当て符号量および最低限の符号量と、テーブルインデックスとから量子化パラメタの上限値と下限値とを算出し、この範囲に収まる量子化パラメタを設定すればよい。   Further, the method for suppressing the occurrence of the buffer overflow described above may be used in combination with the method for suppressing the occurrence of the buffer underflow described above. In this case, the parameter determination unit 103 calculates the upper limit value and the lower limit value of the quantization parameter from the allocated code amount, the minimum code amount, and the table index, and sets the quantization parameter that falls within this range. .

また、本実施形態に係る符号化装置10においては、テーブルインデックスおよび量子化パラメタは、処理単位ごとに決定することとしているが、これに限定されるものではない。例えば、量子化パラメタについては第1の処理単位ごとに決定し、テーブルインデックスについては第1の処理単位よりも小さい第2の処理単位ごとに選択するようにしてもよい。例えば、変換符号化を行う場合、変換係数の位置ごとに符号の分散は異なり得る。このような場合に、例えば、前半の係数(例えば、画像の場合における空間周波数が低い信号)と、後半の係数(例えば、画像の場合における空間周波数が高い信号)とで異なるテーブルインデックスを選択することにより、符号化効率を高めることが可能である。この場合、パラメタ決定部103は、第1の処理単位内のそれぞれの第2の処理単位についてワースト符号量をモデル化し、その量子化パラメタに対応するワースト符号量の和が割り当て符号量を下回るように量子化パラメタを設定すればよい。   In the encoding device 10 according to the present embodiment, the table index and the quantization parameter are determined for each processing unit, but are not limited thereto. For example, the quantization parameter may be determined for each first processing unit, and the table index may be selected for each second processing unit that is smaller than the first processing unit. For example, when transform coding is performed, the code variance may be different for each transform coefficient position. In such a case, for example, different table indexes are selected for the first half coefficient (for example, a signal having a low spatial frequency in the case of an image) and the latter half coefficient (for example, a signal having a high spatial frequency in the case of an image). Thus, it is possible to increase the encoding efficiency. In this case, the parameter determination unit 103 models the worst code amount for each second processing unit in the first processing unit so that the sum of the worst code amounts corresponding to the quantization parameter is less than the allocated code amount. The quantization parameter may be set in.

(第2の実施形態)
第2の実施形態に係る符号化装置について、第1の実施形態に係る符号化装置10と相違する点を中心に説明する。第1の実施形態では、所定の処理単位毎に、可変長符号化テーブルの選択を行って可変長符号化を行う動作を説明した。本実施形態では、前回選択した可変長符号化テーブルの情報を再利用する動作について説明する。なお、本実施形態に係る伝送システムの全体構成、および符号化装置のハードウェア構成は、第1の実施形態で説明した構成と同様である。
(Second Embodiment)
The encoding apparatus according to the second embodiment will be described focusing on differences from the encoding apparatus 10 according to the first embodiment. In the first embodiment, the operation of performing variable length encoding by selecting a variable length encoding table for each predetermined processing unit has been described. In the present embodiment, an operation of reusing information of the previously selected variable length coding table will be described. Note that the overall configuration of the transmission system according to the present embodiment and the hardware configuration of the encoding device are the same as those described in the first embodiment.

図7は、第2の実施形態に係る符号化装置のブロック構成の一例を示す図である。図7を参照しながら、本実施形態に係る符号化装置10aのブロック構成および動作について説明する。   FIG. 7 is a diagram illustrating an example of a block configuration of an encoding device according to the second embodiment. The block configuration and operation of the encoding device 10a according to this embodiment will be described with reference to FIG.

図7に示すように、本実施形態に係る符号化装置10aは、テーブル選択部101a(選択部)と、符号量取得部102(取得部)と、パラメタ決定部103a(決定部)と、量子化部104と、符号化部105aと、符号量制御部106と、記憶部107と、を有する。なお、符号量取得部102、量子化部104、符号量制御部106、および記憶部107の動作は、第1の実施形態で説明した内容と同様である。   As illustrated in FIG. 7, the encoding device 10a according to the present embodiment includes a table selection unit 101a (selection unit), a code amount acquisition unit 102 (acquisition unit), a parameter determination unit 103a (determination unit), a quantum The encoding unit 104, the encoding unit 105 a, the code amount control unit 106, and the storage unit 107. The operations of the code amount acquisition unit 102, the quantization unit 104, the code amount control unit 106, and the storage unit 107 are the same as those described in the first embodiment.

テーブル選択部101aは、外部から入力信号を受信し、所定の処理単位毎に、入力信号の特性に基づいて、記憶部107に予め記憶されている1以上の可変長符号化テーブルの中から、1の可変長符号化テーブルを選択する機能部である。なお、入力信号の特性に基づいて、可変長符号化テーブルを選択する方法は、第1の実施形態のテーブル選択部101と同一または類似の動作であってよい。テーブル選択部101aは、さらに、選択情報を生成する。ここで、選択情報とは、その処理単位で選択した可変長符号化テーブル、および以前(例えば、直前)に選択した可変長符号化テーブルのうち、いずれの可変長符号化テーブルを用いるかを示す情報である。   The table selection unit 101a receives an input signal from the outside and, based on the characteristics of the input signal for each predetermined processing unit, from one or more variable length coding tables stored in advance in the storage unit 107, This is a functional unit that selects one variable length coding table. Note that the method for selecting the variable-length coding table based on the characteristics of the input signal may be the same or similar operation as the table selection unit 101 of the first embodiment. The table selection unit 101a further generates selection information. Here, the selection information indicates which variable-length encoding table is used among the variable-length encoding table selected in the processing unit and the variable-length encoding table selected before (for example, immediately before). Information.

入力信号の特性(分散または絶対値和等)が以前と同一または類似であった場合、以前に選択した可変長符号化テーブルを用いることにより、符号化部105aにおいてテーブルインデックスを符号化する必要がなくなり符号量を低減することができる。一方、入力信号の特性が以前と異なる場合には、テーブル選択部101aは、新たに可変長符号化テーブルを選択することにより、符号化効率を向上させることができる。   When the characteristics (such as variance or sum of absolute values) of the input signal are the same as or similar to the previous one, it is necessary to encode the table index in the encoding unit 105a by using the previously selected variable length encoding table. It is possible to reduce the amount of codes. On the other hand, when the characteristics of the input signal are different from the previous ones, the table selection unit 101a can improve the encoding efficiency by selecting a new variable length encoding table.

また、テーブル選択部101aによる選択情報の設定は、例えば以下のように行う。まず、テーブル選択部101aは、各処理単位において、可変長符号化テーブルを選択するために入力信号の特性値(分散値または絶対値和等)を取得する。テーブル選択部101aは、取得した特性値と、以前に選択した可変長符号化テーブルに対応する特性値とを比較し、その差が所定の閾値未満である場合、以前に選択した可変長符号化テーブルを再度選択する。差が所定の閾値より大きい場合、テーブル選択部101aは、その処理単位において、入力信号の特性値に基づき、新たに可変長符号化テーブルを選択する。なお、特性値の比較処理にあたっては、特性値そのものの比較をおこなう代わりに、その対数値の差分について閾値判定をおこなってもよい。一般に符号化時の発生符号量は、特性値の対数に相関することから、このように比較を行うことにより符号化効率の高い可変長符号化テーブルの選択が可能となる。   The selection information is set by the table selection unit 101a as follows, for example. First, the table selection unit 101a acquires a characteristic value (a variance value or an absolute value sum) of an input signal in order to select a variable length coding table in each processing unit. The table selection unit 101a compares the acquired characteristic value with the characteristic value corresponding to the previously selected variable length coding table, and if the difference is less than a predetermined threshold, the previously selected variable length coding Select the table again. When the difference is larger than the predetermined threshold, the table selection unit 101a newly selects a variable length coding table based on the characteristic value of the input signal in the processing unit. In the characteristic value comparison process, instead of comparing the characteristic values themselves, threshold determination may be performed for the difference between the logarithmic values. In general, the amount of generated code at the time of encoding correlates with the logarithm of the characteristic value, so that it becomes possible to select a variable-length encoding table with high encoding efficiency by performing comparison in this way.

テーブル選択部101aは、選択した可変長符号化テーブルを示すテーブルインデックスを、符号量取得部102および符号化部105aそれぞれに送り、生成した選択情報を、パラメタ決定部103aおよび符号化部105aそれぞれに送る。テーブル選択部101aは、図2に示す符号化プロセッサ502により実現される。   The table selection unit 101a sends a table index indicating the selected variable-length coding table to each of the code amount acquisition unit 102 and the coding unit 105a, and sends the generated selection information to each of the parameter determination unit 103a and the coding unit 105a. send. The table selection unit 101a is realized by the encoding processor 502 shown in FIG.

パラメタ決定部103aは、符号量取得部102から基準符号量を受け取り、符号量制御部106から割り当て符号量を受け取り、テーブル選択部101aから選択情報を受け取り、量子化パラメタを決定する機能部である。パラメタ決定部103aは、図2に示す符号化プロセッサ502により実現される。パラメタ決定部103aによる量子化パラメタの決定方法は、選択情報がテーブル選択部101aにより新たに可変長符号化テーブルが選択されたことを示す場合、第1の実施形態のパラメタ決定部103の動作と同一または類似の方法によって、量子化パラメタを決定すればよい。一方、選択情報がテーブル選択部101aにより以前に選択した可変長符号化テーブルが選択されたことを示す場合、パラメタ決定部103aは、以下のような動作によって、量子化パラメタを決定する。   The parameter determination unit 103a is a functional unit that receives a reference code amount from the code amount acquisition unit 102, receives an assigned code amount from the code amount control unit 106, receives selection information from the table selection unit 101a, and determines a quantization parameter. . The parameter determination unit 103a is realized by the encoding processor 502 shown in FIG. The quantization parameter determination method by the parameter determination unit 103a includes the operation of the parameter determination unit 103 according to the first embodiment when the selection information indicates that a variable length coding table is newly selected by the table selection unit 101a. The quantization parameter may be determined by the same or similar method. On the other hand, when the selection information indicates that the previously selected variable length coding table has been selected by the table selection unit 101a, the parameter determination unit 103a determines the quantization parameter by the following operation.

第1の実施形態では、パラメタ決定部103は、符号量取得部102により取得された基準符号量を有する、上述の式(3)に示すワースト符号量を示す一次式を特定するものとしているが、選択情報がテーブル選択部101aにより以前に選択した可変長符号化テーブルが選択されたことを示す場合、パラメタ決定部103aは、テーブル選択部101aにより以前に選択された可変長符号化テーブルを用いる。この場合、テーブル選択部101aにより新たに選択された可変長符号化テーブル(最適な可変長符号化テーブル)を用いて符号化を行う場合よりも符号量が大きくなる場合がある。この場合、上述の式(3)に示すワースト符号量を示す一次式を利用すると、ワースト符号量の予測精度が悪くなり、その結果、符号化効率が低下するという問題がある。そこで、以下の式(6)に示すように、可変長符号化テーブルの差異による符号量の増加分を別の項として付加して、ワースト符号量のモデル化を行う。   In the first embodiment, the parameter determination unit 103 specifies the primary expression indicating the worst code amount shown in the above equation (3), which has the reference code amount acquired by the code amount acquisition unit 102. If the selection information indicates that the variable length coding table previously selected by the table selection unit 101a is selected, the parameter determination unit 103a uses the variable length coding table previously selected by the table selection unit 101a. . In this case, the code amount may be larger than when encoding is performed using the variable length coding table (optimal variable length coding table) newly selected by the table selection unit 101a. In this case, when the linear expression indicating the worst code amount shown in the above equation (3) is used, there is a problem that the prediction accuracy of the worst code amount is deteriorated, and as a result, the encoding efficiency is lowered. Therefore, as shown in the following formula (6), the increase in the code amount due to the difference in the variable-length coding table is added as another term to model the worst code amount.

WB=Cxq+C+dif[t,t] (C<0、C>0)・・・(6) WB = C 1 xq + C 2 + dif [t 1 , t 2 ] (C 1 <0, C 2 > 0) (6)

上述の式(6)において、CおよびCは、上述の式(3)で対応する値と同一または類似の値でよい。tは、入力信号の特性値(絶対値和または分散等)に対応した可変長符号化テーブルのテーブルインデックスを示し、tは、テーブル選択部101aにより以前選択された可変長符号化テーブルのテーブルインデックスを示す。そして、dif[t,t]は、テーブルインデックスがtである場合と、tである場合とで符号化された符号量の差分を示す。dif[t,t]は、t=tのとき、「0」であってよく、tおよびtの可変長符号化テーブルの分散が異なるほど、大きくなっていく。dif[t,t]の値は、任意のテーブルインデックスtに対応する入力信号を、テーブルインデックスtに対応する可変長符号化テーブルで、例えば、総当たりで符号化を行う等により取得することができる。各t、tについて総当たりで符号化を行ってワースト符号量を取得し、t=tの場合のワースト符号量との差分をとったものがdif[t,t]となる。上述の式(6)によりワースト符号量のモデル化を行えば、その後のパラメタ決定部103aによる量子化パラメタの決定方法については、第1の実施形態のパラメタ決定部103の動作と類似である。具体的には、割り当て符号量Bについて、下記の式(7)が満たされていればよい。 In the above formula (6), C 1 and C 2 may be the same or similar values as the corresponding values in the above formula (3). t 1 represents a table index of the variable length coding table corresponding to the characteristic value (absolute value sum or variance) of the input signal, and t 2 represents the variable length coding table previously selected by the table selection unit 101a. Indicates the table index. Then, dif [t 1 , t 2 ] indicates a difference in code amount encoded between the case where the table index is t 1 and the case where the table index is t 2 . dif [t 1 , t 2 ] may be “0” when t 1 = t 2 , and increases as the variances of the variable length coding tables of t 1 and t 2 differ. The value of dif [t 1 , t 2 ] is obtained by encoding an input signal corresponding to an arbitrary table index t 1 with a variable length coding table corresponding to the table index t 2 , for example, brute force coding. Can be acquired. Encoding is performed brute force for each t 1 and t 2 to obtain the worst code amount, and the difference from the worst code amount in the case of t 1 = t 2 is obtained as dif [t 1 , t 2 ]. Become. If the worst code amount is modeled by the above equation (6), the subsequent method of determining the quantization parameter by the parameter determination unit 103a is similar to the operation of the parameter determination unit 103 of the first embodiment. Specifically, for the allocated code amount B, the following equation (7) may be satisfied.

B≧Cxq+C+dif[t,t] ・・・(7) B ≧ C 1 xq + C 2 + dif [t 1 , t 2 ] (7)

また、この式(7)から量子化パラメタqについて整理すると、下記の式(8)が得られる。   Further, when the quantization parameter q is arranged from the equation (7), the following equation (8) is obtained.

q≧(B−C−dif[t,t])/C ・・・(8) q ≧ (B−C 2 −dif [t 1 , t 2 ]) / C 1 (8)

パラメタ決定部103aは、この式(8)を満たす量子化パラメタqを決定すればよく、例えば、式(8)を満たす最小の量子化パラメタqを決定して、量子化部104に送る。   The parameter determination unit 103a only needs to determine the quantization parameter q that satisfies the equation (8). For example, the parameter determination unit 103a determines the minimum quantization parameter q that satisfies the equation (8) and sends it to the quantization unit 104.

なお、上述のように、テーブルインデックスが異なる場合のワースト符号量の差分を、2次元のテーブルについての差分dif[t,t]としてモデル化していたが、予め用意した可変長符号化テーブルの特性によっては、1次元のテーブルでモデル化を行うことも可能である。例えば、ゴロムライス符号の可変長符号化テーブルを用いる場合、ある可変長符号化テーブル(例えば、サフィックス長=k)と、その隣接する可変長符号化テーブル(例えば、サフィックス長=k+1、k−1)とは、ちょうど絶対値和が2倍または1/2倍の入力信号に対応する。この関係はサフィックス長が2以上の任意の可変長符号化テーブルについて成立し、このことから異なる可変長符号化テーブルを用いた場合のワースト符号量の差分は、各サフィックス長の絶対値にほとんど依存せず、その差分に大きく依存することになる。このことから、式(7)の代わりに、以下の式(9)のようにモデル化を行うことにより、符号化装置10a内部に保持する情報量を削減することができる。 As described above, the difference in the worst code amount when the table indexes are different is modeled as the difference dif [t 1 , t 2 ] for the two-dimensional table. However, a variable length coding table prepared in advance is used. Depending on the characteristics, it is possible to model with a one-dimensional table. For example, when a variable length coding table of Golomb-Rice codes is used, a certain variable length coding table (for example, suffix length = k) and its adjacent variable length coding table (for example, suffix length = k + 1, k−1). Corresponds to an input signal whose absolute value sum is double or ½ times. This relationship holds for any variable-length coding table with a suffix length of 2 or more. Therefore, the difference in the worst code amount when using a different variable-length coding table is almost dependent on the absolute value of each suffix length. Without relying on that difference. From this, it is possible to reduce the amount of information held in the encoding device 10a by modeling as in the following expression (9) instead of the expression (7).

B≧Cxq+C+dif[t−t] ・・・(9) B ≧ C 1 xq + C 2 + dif [t 1 −t 2 ] (9)

また、ゴロムライス符号以外の符号の可変長符号化テーブルを用いる場合においても、用意する可変長符号化テーブルによっては、上述の式(9)と同様のモデル化を行うことができる。例えば、ハフマン符号に基づく可変長符号化テーブルを用意する場合、可変長符号化テーブルの元となる確率分布を、テーブルインデックスごとに所定の割合で変化させた分布とすればよい。具体的には、例えば、テーブルインデックスが「1」増える毎に分散が2倍となる正規分布を用意し、この分布に基づいてハフマン符号の可変長符号化テーブルを構成しておけば、式(9)のようなモデル化を行うことが可能となる。   Even when a variable length coding table for codes other than the Golomb-Rice code is used, modeling similar to the above equation (9) can be performed depending on the prepared variable length coding table. For example, when a variable-length coding table based on a Huffman code is prepared, the probability distribution that is the basis of the variable-length coding table may be a distribution that is changed at a predetermined rate for each table index. Specifically, for example, if a normal distribution is prepared in which the variance is doubled every time the table index increases by “1”, and a variable length coding table of Huffman codes is configured based on this distribution, the formula ( 9) can be modeled.

パラメタ決定部103aは、決定した量子化パラメタを量子化部104および符号化部105aそれぞれに送る。   The parameter determination unit 103a sends the determined quantization parameter to each of the quantization unit 104 and the encoding unit 105a.

符号化部105aは、テーブル選択部101aからテーブルインデックスおよび選択情報を受け取り、パラメタ決定部103aから量子化パラメタを受け取り、量子化部104から量子化値を受け取り、量子化値に対して可変長符号化を行う機能部である。具体的には、選択情報がテーブル選択部101aにより以前に選択した可変長符号化テーブルが選択されたことを示す場合、符号化部105aは、内部に保持しておいた以前に符号化した可変長符号化テーブルを用いて、量子化値を可変長符号化する。なお、符号化部105aは、実際に用いる可変長符号化テーブルについて、第1の実施形態の符号化部105と同様に、テーブルインデックス(テーブル選択部101aにより以前に選択した可変長符号化テーブルを示すテーブルインデックス)と、量子化パラメタとに基づき選択するものとしてもよい。一方、選択情報がテーブル選択部101aにより新たに可変長符号化テーブルが選択されたことを示す場合、符号化部105aは、第1の実施形態の符号化部105と同一または類似の動作により可変長符号化を行えばよい。符号化部105aは、後続の処理単位で利用できるようにテーブルインデックスの情報を内部に保持する。符号化部105aは、図2に示す符号化プロセッサ502により実現される。   The encoding unit 105a receives a table index and selection information from the table selection unit 101a, receives a quantization parameter from the parameter determination unit 103a, receives a quantization value from the quantization unit 104, and receives a variable length code for the quantization value It is a functional part that performs the conversion. Specifically, when the selection information indicates that the variable-length coding table previously selected by the table selection unit 101a has been selected, the encoding unit 105a can change the previously encoded variable stored therein. The quantization value is variable-length encoded using the long encoding table. Note that the encoding unit 105a uses the table index (the variable length encoding table previously selected by the table selection unit 101a) for the variable length encoding table that is actually used, as in the encoding unit 105 of the first embodiment. The table index may be selected based on the quantization parameter. On the other hand, when the selection information indicates that the variable length coding table is newly selected by the table selection unit 101a, the coding unit 105a is variable by the same or similar operation as the coding unit 105 of the first embodiment. What is necessary is just to perform long encoding. The encoding unit 105a internally stores information on the table index so that it can be used in subsequent processing units. The encoding unit 105a is realized by the encoding processor 502 shown in FIG.

符号化部105aは、テーブルインデックスの符号化方法について、第1の実施形態の符号化部105の同方法と異なる方法により符号化を行う。具体的には、符号化部105aは、まず、選択情報(例えば、フラグ)を符号化し、その後、選択情報がその処理単位で選択した可変長符号化テーブルを選択している場合のみ、その可変長符号化テーブルのテーブルインデックスを符号化する。これによって、テーブルインデックスを符号化する際の符号量が削減される。その他の動作において、符号化部105aは、第1の実施形態の符号化部105と同一または類似の動作を行う。符号化部105aは、以上のように、選択情報、テーブルインデックス(必要がある場合)、量子化パラメタおよび量子化値を符号化し、符号ストリームとして外部(例えば、ネットワーク40等)へ出力する。   The encoding unit 105a performs the encoding of the table index by a method different from the same method of the encoding unit 105 of the first embodiment. Specifically, the encoding unit 105a first encodes selection information (for example, a flag), and then changes only when the selection information selects a variable-length encoding table selected in the processing unit. Encode the table index of the long encoding table. As a result, the amount of code when the table index is encoded is reduced. In other operations, the encoding unit 105a performs the same or similar operation as the encoding unit 105 of the first embodiment. As described above, the encoding unit 105a encodes the selection information, the table index (if necessary), the quantization parameter, and the quantization value, and outputs the encoded stream to the outside (for example, the network 40 or the like).

以上のように、本実施形態に係る符号化装置10aは、第1の実施形態に係る符号化装置10と同様に、少ない処理量で受信バッファ30のバッファアンダーフローの発生を抑制する量子化パラメタを設定し、符号化を行うことができる。これによって、符号化処理に要する処理量を低減できるとともに、スキップ等によるバッファアンダーフローの回避手段を含む必要がなく、復号信号の局所的なSNRの低下を抑制することができる。   As described above, the encoding device 10a according to the present embodiment, like the encoding device 10 according to the first embodiment, is a quantization parameter that suppresses the occurrence of buffer underflow in the reception buffer 30 with a small amount of processing. Can be set and encoding can be performed. As a result, the amount of processing required for the encoding process can be reduced, and it is not necessary to include means for avoiding buffer underflow due to skipping or the like, and local SNR degradation of the decoded signal can be suppressed.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これらの新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、および変更を行うことができる。これらの実施形態は、発明の範囲および要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

1 伝送システム
10、10a 符号化装置
20 復号装置
30 受信バッファ
40 ネットワーク
101、101a テーブル選択部
102 符号量取得部
103、103a パラメタ決定部
104 量子化部
105、105a 符号化部
106 符号量制御部
107 記憶部
501 入力I/F
502 符号化プロセッサ
502a キャッシュ
503 RAM
504 出力I/F
505 補助記憶装置
506 バス
DESCRIPTION OF SYMBOLS 1 Transmission system 10, 10a Encoding apparatus 20 Decoding apparatus 30 Reception buffer 40 Network 101, 101a Table selection part 102 Code amount acquisition part 103, 103a Parameter determination part 104 Quantization part 105, 105a Encoding part 106 Code quantity control part 107 Storage unit 501 Input I / F
502 Encoding processor 502a Cache 503 RAM
504 Output I / F
505 Auxiliary storage device 506 Bus

Claims (11)

入力信号を量子化パラメタに基づいて量子化した量子化値に対して可変長符号化を行う符号化装置であって、
前記入力信号の特性に基づいて、2以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択する選択部と、
前記選択部により選択された可変長符号化テーブルについて、任意の前記量子化パラメタについての最大の符号量に基づく値を関数化した式の定数項を基準符号量として取得する取得部と、
前記基準符号量と、受信バッファの占有符号量により求まる割り当て符号量と、に基づいて前記量子化パラメタを決定する決定部と、
前記決定部により決定された前記量子化パラメタを用いて、前記入力信号を量子化して前記量子化値を求める量子化部と、
前記決定部により決定された前記量子化パラメタに基づいて、前記2以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択し、該可変長符号化テーブルによって、前記量子化値に対して可変長符号化を行う符号化部と、
を備えた符号化装置。
An encoding device that performs variable length encoding on a quantized value obtained by quantizing an input signal based on a quantization parameter,
A selection unit that selects one variable-length coding table from two or more variable-length coding tables based on the characteristics of the input signal;
An acquisition unit that acquires, as a reference code amount, a constant term of an expression obtained by functionalizing a value based on the maximum code amount for any of the quantization parameters for the variable length coding table selected by the selection unit;
A determination unit that determines the quantization parameter based on the reference code amount and an assigned code amount determined by an occupied code amount of a reception buffer;
Using the quantization parameter determined by the determination unit, a quantization unit that quantizes the input signal to obtain the quantization value;
Based on the quantization parameter determined by the determination unit, one variable length encoding table is selected from the two or more variable length encoding tables, and the quantization value is determined by the variable length encoding table. An encoding unit for performing variable length encoding on
An encoding device comprising:
前記選択部は、前記入力信号の特性として、該入力信号の分散または絶対値和に基づいて、1の可変長符号化テーブルを選択する請求項1に記載の符号化装置。   The encoding apparatus according to claim 1, wherein the selection unit selects one variable-length encoding table based on a variance or a sum of absolute values of the input signal as a characteristic of the input signal. 前記符号化部により可変長符号化が行われる符号の符号量が、復号装置により前記受信バッファの符号が引き去られるタイミングにおける前記占有符号量よりも小さくなるように前記割り当て符号量を設定する符号量制御部を、さらに備えた請求項1に記載の符号化装置。   A code that sets the allocated code amount so that the code amount of the variable-length encoded code by the encoding unit is smaller than the occupied code amount at the timing when the code of the reception buffer is removed by the decoding device The encoding device according to claim 1, further comprising a quantity control unit. 前記符号化部は、前記決定部により決定された前記量子化パラメタが大きいほど、前記選択部により選択された可変長符号化テーブルに対応する分散よりも小さい分散に対応する可変長符号化テーブルを選択する請求項1に記載の符号化装置。   The encoding unit has a variable length encoding table corresponding to a variance smaller than a variance corresponding to the variable length encoding table selected by the selection unit, as the quantization parameter determined by the determination unit is larger. The encoding device according to claim 1 to select. 前記選択部および前記符号化部により選択される可変長符号化テーブルは、ゴロムライス符号に基づくテーブルである請求項4に記載の符号化装置。   The encoding apparatus according to claim 4, wherein the variable length encoding table selected by the selection unit and the encoding unit is a table based on a Golomb-Rice code. 前記符号化部は、前記選択部により選択された可変長符号化テーブルのサフィックス長から、前記決定部により決定された前記量子化パラメタを差し引いた値をインデックスとして示される可変長符号化テーブルを選択する請求項5に記載の符号化装置。   The encoding unit selects a variable length encoding table indicated by an index obtained by subtracting the quantization parameter determined by the determination unit from the suffix length of the variable length encoding table selected by the selection unit. The encoding device according to claim 5. 前記選択部は、所定値より大きいサフィックス長の可変長符号化テーブルを選択する請求項6に記載の符号化装置。   The encoding device according to claim 6, wherein the selection unit selects a variable-length encoding table having a suffix length larger than a predetermined value. 前記量子化部による量子化の量子化幅は、前記量子化パラメタの指数関数であり、
前記関数化した式は、前記量子化パラメタの一次式で表される請求項1に記載の符号化装置。
The quantization width of the quantization by the quantization unit is an exponential function of the quantization parameter,
The encoding apparatus according to claim 1, wherein the function expression is expressed by a linear expression of the quantization parameter.
前記選択部は、前記入力信号の特性を示す値と、以前に選択した可変長符号化テーブルに対応する特性の値との差分が所定の閾値未満である場合、以前に選択した可変長符号化テーブルを再度選択し、
前記符号化部は、前記選択部により、以前に選択した可変長符号化テーブルが選択された場合、以前に符号化に用いた可変長符号化テーブルによって、前記量子化値に対して可変長符号化を行う請求項1に記載の符号化装置。
The selection unit, when the difference between the value indicating the characteristic of the input signal and the value of the characteristic corresponding to the previously selected variable length coding table is less than a predetermined threshold, the previously selected variable length coding Select the table again,
When the previously selected variable length coding table is selected by the selection unit, the encoding unit may change the variable length code for the quantized value using the variable length coding table previously used for encoding. The encoding apparatus according to claim 1, wherein the encoding is performed.
前記取得部は、前記選択部により以前に選択した可変長符号化テーブルを再度選択された場合、再度選択された可変長符号化テーブルに対応する最大の符号量と、前記入力信号の特性に基づく可変長符号化テーブルに対応する最大の符号量との差分を、前記関数化した式の定数項に加算した値を前記基準符号量として取得する請求項9に記載の符号化装置。   When the selection unit reselects the variable length coding table previously selected by the selection unit, the acquisition unit is based on the maximum code amount corresponding to the reselected variable length coding table and the characteristics of the input signal. The encoding apparatus according to claim 9, wherein a value obtained by adding a difference from a maximum code amount corresponding to a variable-length encoding table to a constant term of the function expression is acquired as the reference code amount. 入力信号を量子化パラメタに基づいて量子化した量子化値に対して可変長符号化を行う符号化装置の符号化方法であって、
前記入力信号の特性に基づいて、2以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択する選択ステップと、
選択した可変長符号化テーブルについて、任意の前記量子化パラメタについての最大の符号量に基づく値を関数化した式の定数項を基準符号量として取得する取得ステップと、
前記基準符号量と、受信バッファの占有符号量により求まる割り当て符号量と、に基づいて前記量子化パラメタを決定する決定ステップと、
決定した前記量子化パラメタを用いて、前記入力信号を量子化して前記量子化値を求める量子化ステップと、
決定した前記量子化パラメタに基づいて、前記2以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択し、該可変長符号化テーブルによって、前記量子化値に対して可変長符号化を行う符号化ステップと、
を有する符号化方法。
An encoding method of an encoding device that performs variable length encoding on a quantized value obtained by quantizing an input signal based on a quantization parameter,
A selection step of selecting one variable length coding table from two or more variable length coding tables based on the characteristics of the input signal;
An acquisition step of acquiring, as a reference code amount, a constant term of an expression obtained by functionalizing a value based on the maximum code amount for any of the quantization parameters for the selected variable length coding table;
A determination step of determining the quantization parameter based on the reference code amount and an assigned code amount determined by an occupied code amount of a reception buffer;
Using the determined quantization parameter, a quantization step for quantizing the input signal to obtain the quantized value;
Based on the determined quantization parameter, one variable length coding table is selected from the two or more variable length coding tables, and the variable length coding table is used to select a variable length for the quantized value. An encoding step for encoding;
An encoding method comprising:
JP2016051278A 2016-03-15 2016-03-15 Encoding apparatus and encoding method Active JP6549057B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016051278A JP6549057B2 (en) 2016-03-15 2016-03-15 Encoding apparatus and encoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016051278A JP6549057B2 (en) 2016-03-15 2016-03-15 Encoding apparatus and encoding method

Publications (2)

Publication Number Publication Date
JP2017168985A true JP2017168985A (en) 2017-09-21
JP6549057B2 JP6549057B2 (en) 2019-07-24

Family

ID=59913564

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016051278A Active JP6549057B2 (en) 2016-03-15 2016-03-15 Encoding apparatus and encoding method

Country Status (1)

Country Link
JP (1) JP6549057B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63284974A (en) * 1987-05-15 1988-11-22 Matsushita Electric Works Ltd Picture compression system
JPH0541860A (en) * 1991-08-05 1993-02-19 Oki Electric Ind Co Ltd Picture compression coder
JPH08205150A (en) * 1995-01-26 1996-08-09 Nippon Telegr & Teleph Corp <Ntt> Image signal encoding device
JP2004241879A (en) * 2003-02-04 2004-08-26 Sony Corp Apparatus and method for image processing, recording medium, and program
JP2010226532A (en) * 2009-03-24 2010-10-07 Toshiba Corp Image compression apparatus and image decompression apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63284974A (en) * 1987-05-15 1988-11-22 Matsushita Electric Works Ltd Picture compression system
JPH0541860A (en) * 1991-08-05 1993-02-19 Oki Electric Ind Co Ltd Picture compression coder
JPH08205150A (en) * 1995-01-26 1996-08-09 Nippon Telegr & Teleph Corp <Ntt> Image signal encoding device
JP2004241879A (en) * 2003-02-04 2004-08-26 Sony Corp Apparatus and method for image processing, recording medium, and program
JP2010226532A (en) * 2009-03-24 2010-10-07 Toshiba Corp Image compression apparatus and image decompression apparatus

Also Published As

Publication number Publication date
JP6549057B2 (en) 2019-07-24

Similar Documents

Publication Publication Date Title
US11039142B2 (en) Encoding and decoding of significant coefficients in dependence upon a parameter of the significant coefficients
US11290751B2 (en) Data encoding and decoding
US7304590B2 (en) Arithmetic decoding apparatus and method
JP5045950B2 (en) Video encoding method, video encoding apparatus, and video encoding program
US9282329B2 (en) Methods and devices for data compression using offset-based adaptive reconstruction levels
KR102617187B1 (en) Video decoder, video encoder, method for decoding a video content, method for encoding a video content, computer program and video bitstream
JP2014523186A (en) Entropy encoding / decoding method and apparatus
KR102486026B1 (en) Method and apparatus for parallel entropy encoding/decoding
JP2007166039A (en) Image coding equipment
US8582898B2 (en) Method and apparatus for encoding and decoding image based on code table selection adapted to residual value distribution
JP2008022383A (en) Image encoding apparatus
KR100796857B1 (en) Moving image encoding method and apparatus
JP5231243B2 (en) Encoding apparatus and encoding method
KR20110070823A (en) Method for video codeing and decoding and apparatus for video coding and deconding by using the same
JP6549057B2 (en) Encoding apparatus and encoding method
US11234023B2 (en) Features of range asymmetric number system encoding and decoding
JP5632328B2 (en) Code amount prediction apparatus and program
US11979584B2 (en) Arithmetic encoders and decoders, video encoders and decoders, methods for encoding or decoding symbols, and methods for encoding or decoding video content
US10034011B2 (en) Video coding apparatus
JP2005045515A (en) Encoding apparatus and method for encoding, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190226

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190507

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190528

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190626

R151 Written notification of patent or utility model registration

Ref document number: 6549057

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151