JP6549057B2 - Encoding apparatus and encoding method - Google Patents

Encoding apparatus and encoding method Download PDF

Info

Publication number
JP6549057B2
JP6549057B2 JP2016051278A JP2016051278A JP6549057B2 JP 6549057 B2 JP6549057 B2 JP 6549057B2 JP 2016051278 A JP2016051278 A JP 2016051278A JP 2016051278 A JP2016051278 A JP 2016051278A JP 6549057 B2 JP6549057 B2 JP 6549057B2
Authority
JP
Japan
Prior art keywords
code amount
length coding
variable
unit
encoding
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.)
Active
Application number
JP2016051278A
Other languages
Japanese (ja)
Other versions
JP2017168985A (en
Inventor
孝幸 伊東
孝幸 伊東
淳 松村
淳 松村
知也 児玉
知也 児玉
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

Description

本発明の実施形態は、符号化装置および符号化方法に関する。   Embodiments of the present invention relate to an encoding apparatus and an encoding method.

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

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

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

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

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

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

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

実施形態の符号化装置は、入力信号を量子化パラメタに基づいて量子化した量子化値に対して可変長符号化を行う符号化装置であって、選択部と、取得部と、決定部と、量子化部と、符号化部と、を備える。選択部は、入力信号の特性に基づいて、1の可変長符号化テーブルを選択する。取得部は、選択された可変長符号化テーブルに応じて、前記量子化パラメタ毎に発生しうる最大の符号量を取得する。決定部は、量子化パラメタ毎の最大の符号量と、占有符号量により求まる割り当て符号量と、に基づいて量子化パラメタを決定する。量子化部は、量子化パラメタを用いて、入力信号を量子化して量子化値を求める。符号化部は、量子化パラメタに基づいて、1の可変長符号化テーブルを選択し、量子化値に対して可変長符号化を行う。 The encoding apparatus according to the 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, and 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. An acquisition unit acquires the maximum code amount that can be generated for each of the quantization parameters according to the selected variable length coding table. The determination unit determines the quantization parameter based on the maximum code amount for each quantization parameter and the allocated code amount determined by the occupied code amount. The quantization unit quantizes the input signal using a quantization parameter to obtain a quantization value. The coding unit selects one variable-length coding table based on the quantization parameter, and performs variable-length coding on the quantized value.

第1の実施形態に係る伝送システムの全体構成の一例を示す図である。FIG. 1 is a diagram showing an example of the entire configuration of a transmission system according to a first 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 based on 1st Embodiment. 受信バッファの占有符号量の制御を説明する図である。It is a figure explaining control of the occupancy 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 apparatus 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, specific configurations should be determined in consideration of the following description.

(第1の実施形態)
図1は、第1の実施形態に係る伝送システムの全体構成の一例を示す図である。図1を参照しながら、本実施形態に係る伝送システム1の全体構成について説明する。
First Embodiment
FIG. 1 is a diagram showing an example of the entire configuration of the transmission system according to the first embodiment. The entire configuration of a 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 (code stream to be 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 device 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 device 10 to the network 40 by wireless communication. It is good also as a thing. Further, although the configuration of the transmission system 1 shown in FIG. 1 shows a configuration in which the decoding device 20 and the reception buffer 30 are separate, the present invention is not limited to this. For example, the decoding device 20 May include the reception buffer 30, and the reception buffer 30 may be disposed at the previous stage of the decoding process by the decoding device 20.

符号化装置10は、外部から入力される入力信号を符号化し、その符号を外部(例えば、ネットワーク40)に出力する装置である。具体的には、符号化装置10は、入力信号を量子化し、量子化した信号である量子化値を可変長符号化して出力する。   The encoding apparatus 10 is an apparatus 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, and performs variable-length coding on a quantized value, which is a quantized signal, and outputs the result.

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

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

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

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

復号装置20は、符号化装置10から出力された符号化された信号が蓄積された受信バッファ30から、所定時間ごとの復号タイミングに所定単位の符号を引き去り、引き去った符号を復号する装置である。   The decoding device 20 is a device that withdraws a code of a predetermined unit from the reception buffer 30 in which the encoded signal output from the encoding device 10 is accumulated, to the decoding timing for each predetermined time, and decodes the withdrawn 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. Further, the reception buffer 30 is disposed at the previous stage of the decoding function of the decoding device 20, and a predetermined unit of code is taken out for decoding by the decoding device 20 at every predetermined time of decoding timing.

ネットワーク40は、符号化装置10と受信バッファ30とを接続する無線または有線の伝送路である。   The network 40 is a wireless or wired transmission path connecting 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. The hardware configuration of the encoding device 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 device 10 according to the present embodiment includes an input I / F 501, an encoding processor 502, a cache 502a, a random access memory (RAM) 503, an output I / F 504, and an auxiliary And 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 communicably connected to each other by a bus 506 such as an address bus and a data bus.

入力I/F501は、外部から入力信号を入力するためのインターフェースである。   An 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 unit that controls the overall operation of the encoding device 10 shown in FIG. The encoding processor 502 performs an encoding process.

キャッシュ502aは、符号化プロセッサ502が処理をする際のデータをワークエリアとして一時的に記憶するメモリである。   The cache 502 a 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 and 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 for storing a variable length coding table and the like described later. The auxiliary storage device 505 is a storage device capable of storing electrically, magnetically or optically, such as a hard disk drive (HDD), a solid state drive (SSD), a flash memory or an optical disk. Although the auxiliary storage device 505 is assumed to be included in the encoding device 10, the present invention is not limited to this, 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 to the encoding device 10 via an interface. Further, the information stored in the above-described auxiliary storage device 505 may be incorporated as a processing method (logic circuit or program) instead of being stored in the auxiliary storage device 505.

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

図3は、第1の実施形態に係る符号化装置のブロック構成の一例を示す図である。図4は、受信バッファの占有符号量の制御を説明する図である。図3および4を参照しながら、本実施形態に係る符号化装置10のブロック構成および動作について説明する。   FIG. 3 is a diagram showing an example of a block configuration of the coding apparatus 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 device 10 according to the present embodiment will be described with reference to FIGS. 3 and 4.

図3に示すように、本実施形態に係る符号化装置10は、テーブル選択部101(選択部)と、符号量取得部102(取得部)と、パラメタ決定部103(決定部)と、量子化部104と、符号化部105と、符号量制御部106と、記憶部107と、を有する。   As shown 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), and a quantum. A coding unit 104, a coding unit 105, a code amount control unit 106, and a storage unit 107 are included.

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

テーブル選択部101は、選択した可変長符号化テーブルを示す情報(以下、テーブルインデックスと称する場合がある)を、符号量取得部102および符号化部105それぞれに送る。例えば、ゴロムライス符号の可変長符号化テーブルの場合、サフィックス長をテーブルインデックスとすればよい。テーブル選択部101は、図2に示す符号化プロセッサ502により実現される。   The table selection unit 101 sends information (hereinafter sometimes referred to as a table index) indicating the selected variable length coding table to each of the code amount acquisition unit 102 and the coding unit 105. For example, in the case of a variable-length coding table of Golomb rice code, 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 the correspondence between the characteristic (absolute value sum or variance) of the input signal and the variable-length coding table is determined in advance, and information (for example, a formula or a look-up table) defining this correspondence 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. For example, in the case of Golomb Rice code, since the sum of absolute values of input signals and the suffix length are in a logarithmic relationship, the table selection unit 101 calculates a suffix length from the sum of absolute values as information defining the correspondence. The variable length coding table may be selected based on the suffix length calculated from the characteristic value (absolute value sum) using

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

また、上述において、入力信号の特性として絶対値和および分散を例に挙げたが、これらに限定されるものではなく、入力信号の特性として、入力信号の平均値を用いるものとしてもよい。一般に、音声または画像等において予測符号化を行う場合、予測後の信号は0を中心に分布する傾向がある。しかし、符号化装置10に0以外を中心に分布するような入力信号が入力される場合には、入力信号の平均値に基づいて可変長符号化テーブルの選択を行うことにより、より高効率な符号化が実現される場合がある。   Further, in the above, although the sum of absolute values and the variance are taken as examples of the characteristics of the input signal, the present invention is not limited to these, and an 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 images, signals after prediction tend to be distributed around zero. However, when an input signal having a distribution other than 0 is input to the encoding device 10, selection of the variable-length coding table is performed based on the average value of the input signal to achieve higher efficiency. Encoding may be realized.

また、テーブル選択部101は、記憶部107に記憶された1以上の可変長符号化テーブルから、入力信号の特性に基づいて、1の可変長符号化テーブルを選択するものとしたが、これに限定されるものではなく、記憶部107に記憶された可変長符号化テーブルは単一のテーブルであり、これを用いるものとしてもよい。入力信号の特性がほとんど変化しないような場合、単一の可変長符号化テーブルを用いるものとしても、高効率な符号化が行える場合がある。この場合、1以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択する必要がないので、符号化装置10はテーブル選択部101を有する必要はない。この場合、符号量取得部102および符号化部105は、この単一の可変長符号化テーブルが選択されているものとみなして後述の処理を行うものとすればよい。   In addition, although the table selection unit 101 selects one variable length coding table from the 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 to a single table, and may be used. When the characteristics of the input signal hardly change, high efficiency coding may be performed even using a single variable length coding table. In this case, since it is not necessary to select one variable length coding table from among one or more variable length coding tables, the coding apparatus 10 need not 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 the single variable-length coding 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 method of acquiring the reference code amount 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 coding 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 allocated code amount from the code amount control unit 106, and determines the quantization parameter based on the reference code amount and the allocated code amount. is there. The determination method of the quantization parameter by the parameter determination unit 103 will be described later. The parameter determination unit 103 sends the determined quantization parameter to each of the quantization unit 104 and the encoding unit 105. 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, and quantizes the input signal with the quantization parameter to obtain 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 quantization value, and q represents a quantization parameter. Also, round () indicates a function that rounds off the decimal point. By performing the process using this function round (), when decoding the code encoded by the decoding device 20, it is possible to reduce the error of the decoded signal as compared to the case where rounding is not performed. Further, since the quantization value quantized by the above equation (1) becomes smaller according to the quantization width (2 q of equation (1)), the dispersion becomes smaller. The quantization unit 104 sends the quantization value obtained by the quantization to the coding unit 105. The quantization unit 104 is realized by the coding processor 502 shown in FIG.

なお、量子化部104は、上述の式(1)を用いて量子化を行うことに限定されるものではなく、その他の方式に基づいて量子化を行ってもよい。例えば、H.264/MPEG−4 AVC(Advanced Video Coding)等における量子化と同様の処理を行ってもよい。   In addition, the quantization part 104 is not limited to performing quantization using said Formula (1), You may quantize based on another system. For example, H. The same processing as quantization in H.264 / MPEG-4 AVC (Advanced Video Coding) or the like may be performed.

符号化部105は、テーブル選択部101からテーブルインデックスを受け取り、パラメタ決定部103から量子化パラメタを受け取り、量子化部104から量子化値を受け取り、量子化値に対して可変長符号化を行う機能部である。具体的には、符号化部105は、テーブルインデックスおよび量子化パラメタに基づいて、記憶部107に記憶されている1以上の可変長符号化テーブルの中から、1の可変長符号化テーブルを選択し、その可変長符号化テーブルにより量子化値に対して可変長符号化を行う。上述のように、量子化値は、量子化幅に応じて小さくなるので分散が小さくなることから、符号化部105は、入力信号よりも分散の小さくなった量子化値に対応した可変長符号化テーブルを用いて可変長符号化を行うことにより、発生する符号量を小さくすることができる。   Encoding section 105 receives a table index from table selecting section 101, receives a quantization parameter from parameter determining section 103, receives a quantization value from quantization section 104, and performs variable-length coding on the quantization value. It is a functional unit. Specifically, encoding section 105 selects one variable-length coding table from among one or more variable-length coding tables stored in storage section 107 based on the table index and the quantization parameter. Then, variable length coding is performed on the quantization value by the variable length coding table. As described above, since the quantization value is smaller according to the quantization width and the dispersion is smaller, the coding unit 105 is a variable-length code corresponding to the quantization value whose dispersion is smaller than that of the input signal. By performing variable-length coding using a coding 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, it is assumed that quantization is performed using the above-mentioned equation (1) and a variable-length coding table of Golomb's rice code is used. 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 coding table selected by the table selection unit 101 described above, that is, for example, in Equation (1), it is optimal when the quantization parameter q = 0. Since it is a variable-length coding table, if 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), since the quantization value is about half of the input signal, the dispersion is The variable-length coding table corresponding to the 1/2 signal (quantized value) is optimal. In the case of a Golomb-Rice code variable length coding table, this corresponds to a variable length coding table with a small suffix length. From this, assuming that the table index of the variable-length coding table selected by the table selection unit 101 is k, the encoding unit 105 stores the Golomb-Rise code stored in the storage unit 107 and having a suffix length k−q. Variable length coding may be performed using a variable length coding table. In addition, since the suffix length of the Golomb rice code is 0 or more, for example, when k−q is less than 0, the encoding unit 105 changes the variable length coding table of the Golomb Rice code whose suffix length is 0. It may be long coding. In addition, for example, when performing quantization by methods other than Formula (1), it is good also as what selects the variable-length coding table according to the change degree of the dispersion | distribution corresponding to each quantization parameter similarly to the above-mentioned.

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

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

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 quantization value, and x2 represents a value converted to an unsigned integer. Note that, instead of performing conversion according to the above equation (2), code bits may be separately encoded, and variable length coding may be performed on the absolute value of the quantization value using a variable length coding table of Golomb's Rice code.

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

符号化部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 result as a code stream to the outside (for example, the network 40 or the like). Also, the coding unit 105 sends the code amount (generated code amount) of the coded 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 allocated code amount. The code amount control unit 106 models the amount of code occupied in the reception buffer 30 (hereinafter referred to as “occupied code amount”), and the generated code amount in the coding unit 105 such that buffer underflow does not occur in the reception buffer 30. The allocation 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 use VBV (Video Buffer Verifier) in MPEG-2, or M.I. By assigning the same or similar modeling as a buffer model such as HRD (Hypothetical Reference Decoder) in H.264 / MPEG-4 AVC, the allocation code amount at which buffer underflow does not occur in the reception buffer 30 may be set.

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

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

また、受信バッファ30の占有符号量が一定以上である状態、すなわち、符号化部105により発生可能な符号量に余裕がある場合に、ある処理単位においてこの余裕分を一度に消費してしまうよりは、後続の複数の処理単位でこの余裕分を分割したほうが、発生符号量が安定しやすい。このことから、特に占有符号量が大きい場合に、占有符号量よりも小さい符号量を割り当て符号量として設定することによって、復号装置20により復号された信号の品質を安定化させることが可能となる。   Also, if the amount of occupied code of the reception buffer 30 is equal to or more than a certain amount, that is, if there is a margin in the amount of code that can be generated by the encoding unit 105, this margin is consumed at once in a certain processing unit It is easier to stabilize the generated code amount if this margin is divided by a plurality of subsequent processing units. 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 allocated code amount, particularly when the occupied code amount is large. .

符号量制御部106は、設定した割り当て符号量を、パラメタ決定部103へ送る。符号量制御部106は、図2に示す符号化プロセッサ502により実現される。   The code amount control unit 106 sends the set allocation code amount to the parameter determination unit 103. The code amount control unit 106 is realized by the coding 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 coding tables or the like that the table selection unit 101 and the coding unit 105 refer to. The storage unit 107 is realized by the auxiliary storage device 505 shown 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 coding unit 105, the code amount control unit 106, and the storage unit 107 shown in FIG. It is shown and it is not limited to such composition. 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 possessed by one functional unit in FIG. 3 may be divided into a plurality of parts and configured as a plurality of functional parts.

また、図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 coding unit 105, and the code amount control unit 106 shown in FIG. 3 are all the coding processor shown in FIG. Although realized by 502, it 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) of at least one of the functional units described above is executed by a CPU (Central Processing Unit) It may be realized by

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

上述したように、テーブル選択部101は、外部から受信した入力信号の絶対値和または分散等に基づいて、入力信号に対して可変長符号化を行った場合の符号量が小さくなる可変長符号化テーブルを選択するものとしている。逆に言えば、あるテーブルインデックスが示す可変長符号化テーブルが与えられた場合に、対応する入力信号の取り得る値はある有限の範囲に制限されることになる。例えば、ある可変長符号化テーブルが入力信号の絶対値和≦128に対応するテーブルである場合、この可変長符号化テーブルが与えられれば、処理単位内の入力信号が取り得る値は、その絶対値和が128以下となる任意の数値(入力信号が整数値の場合、任意の整数)群に限定される。入力信号が限定されれば、これらの入力信号を、対応する可変長符号化テーブルで符号化した場合の発生符号量が取得可能であり、例えば、総当たり等の方法によって、この可変長符号化テーブルにより入力信号を符号化した場合の最大の符号量が取得可能である。この取得した符号量は、量子化を行わない場合の最大の符号量であるが、量子化が行われた量子化値についても、同様に、符号化した場合の最大の符号量が取得可能である。この最大の符号量を、予め取得しておいてもよい。   As described above, the table selection unit 101 is a variable-length code that reduces the code amount when variable-length coding is performed on the input signal based on the absolute value sum or variance of the input signal received from the outside. Table is selected. Conversely, given a variable-length coding table indicated by a certain table index, the possible values of the corresponding input signal will be 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 a group of arbitrary numbers (in the case where the input signal is an integer value, any integer) having a value sum of 128 or less. If the input signal is limited, the generated code amount when encoding these input signals with the corresponding variable-length coding table can be obtained. For example, this variable-length coding is performed by a method such as round robin. The table can obtain the maximum code amount when encoding the input signal. The obtained code amount is the maximum code amount when quantization is not performed, but the maximum code amount when encoding is similarly obtained for the quantized value for which quantization is performed. is there. This maximum code amount may be obtained in advance.

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

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 expression, and is a negative value because the code amount decreases with the increase of the quantization parameter q. C 2 is an intercept of a linear expression. Further, WB indicates a code amount calculated by a linear expression, and hereinafter, it is referred to as a worst code amount. That is, Equation (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のみを予め記憶しておけばよい。 Then, for each table index, the inclination C 1 and the intercept C 2 of the linear expression shown in the above-mentioned equation (3) are obtained in advance. That is, if the table index is determined, a linear expression indicating the worst code amount is determined. This makes it possible to easily calculate the worst code amount for a specific quantization parameter for each table index. Further, information on the correspondence between the table index and the linear expression (i.e., the slope C 1 and the intercept C 2 ) indicating the worst code amount 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 , 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 specifies a linear expression indicating the worst code amount having the reference code amount acquired by the code amount acquisition unit 102, and the worst code amount does not exceed the allocated code amount received from the code amount control unit 106. Determine the quantization parameter. This makes it possible to suppress the occurrence of buffer underflow in the reception buffer 30. Specifically, since the worst code amount WB is modeled by the above equation (3), the following equation (4) may be satisfied for the assigned code amount B.

B≧Cxq+C ・・・(4) B C C 1 x q + 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 may determine the quantization parameter q satisfying the equation (5), for example, determines the minimum quantization parameter q satisfying the equation (5), and sends it to the quantization unit 104. In order to stabilize the quality of the decoded signal of the decoding device 20, in order to suppress the fluctuation of the quantization parameter q, the value similar to the immediately preceding quantization parameter is quantized within the range satisfying the above equation (5). It may be determined as a conversion parameter.

なお、上述の式(3)に示すワースト符号量を示す一次式は、図5に示すように、各量子化パラメタに対応する最大の符号量の全てを上回る一次式に設定するものとしたが、これに限定されるものではない。例えば、各量子化パラメタに対応する最大の符号量のうち2点を接続するグラフであって、その他の最大符号量と差分の絶対値和が最小となるグラフを示す一次式に設定するものとしてもよい。また、上述のように設定した一次式が示すグラフについて、その切片が所定範囲(例えば、元のグラフの切片の1〜2倍の範囲)でシフトさせたグラフを示す一次式であってもよい。   Note that, as shown in FIG. 5, the linear expression indicating the worst code amount shown in the above-mentioned equation (3) is set to a linear expression that exceeds all of the maximum code amounts corresponding to the respective quantization parameters. Not limited to this. For example, it is a graph connecting two points of the maximum code amount corresponding to each quantization parameter, and is set as a linear expression representing a graph in which the sum of absolute values of other maximum code amounts and differences is minimized. It is also good. In addition, the linear expression may be a linear expression showing 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) for the graph indicated by the linear expression set as described above. .

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

<ステップ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 performs, for each predetermined processing unit, one or more variables stored in advance in the storage unit 107 based on the characteristics of the input signal (for example, the sum or variance of absolute values of signal values of the input signal). Among the long coding tables, one variable length coding table is selected. The table selection unit 101 sends information (hereinafter sometimes referred to as a table index) indicating the selected variable length coding table to each of the code amount acquisition unit 102 and the coding unit 105. 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 to specify a linear expression indicating the worst code amount corresponding to the table index received from the table selection unit 101, for example, an intercept of the linear 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 allocated code amount from the code amount control unit 106, and determines the quantization parameter based on the reference code amount and the allocated code amount. Specifically, the parameter determination unit 103 specifies a linear expression indicating the worst code amount having the reference code amount acquired by the code amount acquisition unit 102, and the assignment code received from the code amount control unit 106 for the worst code amount. Determine the quantization parameter so as not to exceed the amount. The parameter determination unit 103 sends the determined quantization parameter to each of the quantization unit 104 and the encoding unit 105. 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 quantization value obtained by the quantization to the coding unit 105. Then, the process proceeds to step S16.

<ステップS16>
符号化部105は、テーブル選択部101からテーブルインデックスを受け取り、パラメタ決定部103から量子化パラメタを受け取り、量子化部104から量子化値を受け取り、量子化値に対して可変長符号化を行う。例えば、テーブル選択部101により選択された可変長符号化テーブルのテーブルインデックスをkとすると、符号化部105は、記憶部107に記憶された、サフィックス長がk−qとなるゴロムライス符号の可変長符号化テーブルにより可変長符号化を行う。そして、ステップS17へ移行する。
<Step S16>
Encoding section 105 receives a table index from table selecting section 101, receives a quantization parameter from parameter determining section 103, receives a quantization value from quantization section 104, and performs variable-length coding 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. The variable length coding is performed by the 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 an allocated code amount. The code amount control unit 106 models the occupied code amount occupied in the reception buffer 30, and allocates a code amount so as to be a generated code amount in the encoding unit 105 such that no buffer underflow occurs in the reception buffer 30. Set

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

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

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

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

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

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

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

また、上述のバッファオーバーフローの発生を抑制する方法は、上述のバッファアンダーフローの発生を抑制する方法と併用して用いられるものとしてもよい。この場合、パラメタ決定部103は、割り当て符号量および最低限の符号量と、テーブルインデックスとから量子化パラメタの上限値と下限値とを算出し、この範囲に収まる量子化パラメタを設定すればよい。   Also, the method of suppressing the occurrence of buffer overflow described above may be used in combination with the method of suppressing the occurrence of buffer underflow described above. In this case, the parameter determination unit 103 may calculate 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 set the quantization parameter within this range. .

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

(第2の実施形態)
第2の実施形態に係る符号化装置について、第1の実施形態に係る符号化装置10と相違する点を中心に説明する。第1の実施形態では、所定の処理単位毎に、可変長符号化テーブルの選択を行って可変長符号化を行う動作を説明した。本実施形態では、前回選択した可変長符号化テーブルの情報を再利用する動作について説明する。なお、本実施形態に係る伝送システムの全体構成、および符号化装置のハードウェア構成は、第1の実施形態で説明した構成と同様である。
Second Embodiment
An 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 coding by selecting a variable-length coding 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. The overall configuration of the transmission system according to the present embodiment and the hardware configuration of the encoding apparatus are the same as the configuration described in the first embodiment.

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

図7に示すように、本実施形態に係る符号化装置10aは、テーブル選択部101a(選択部)と、符号量取得部102(取得部)と、パラメタ決定部103a(決定部)と、量子化部104と、符号化部105aと、符号量制御部106と、記憶部107と、を有する。なお、符号量取得部102、量子化部104、符号量制御部106、および記憶部107の動作は、第1の実施形態で説明した内容と同様である。   As shown 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), and a quantum. A coding unit 104, a coding unit 105a, a code amount control unit 106, and a storage unit 107 are included. 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 the contents 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 for each predetermined processing unit, from among one or more variable length coding tables stored in advance in the storage unit 107, based on the characteristics of the input signal, It is a functional unit that selects a variable-length coding table of 1. The method of selecting the variable-length coding table based on the characteristics of the input signal may be the same as or similar to the operation of 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 coding table is to be used among the variable-length coding table selected in the processing unit and the variable-length coding table previously selected (for example, immediately before). It is information.

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

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

テーブル選択部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 the code amount acquisition unit 102 and the coding unit 105a, and the generated selection information to 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 the reference code amount from the code amount acquisition unit 102, receives the allocated code amount from the code amount control unit 106, receives selection information from the table selection unit 101a, and determines the quantization parameter. . The parameter determination unit 103a is realized by the coding processor 502 shown in FIG. The method of determining the quantization parameter by the parameter determination unit 103a is the operation of the parameter determination unit 103 of the first embodiment when the selection information indicates that the 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 variable-length coding table previously selected by the table selection unit 101a is selected, 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 a linear 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 coding is performed using a variable-length coding table (optimum variable-length coding table) newly selected by the table selection unit 101a. In this case, using the linear expression indicating the worst code amount shown in the above equation (3), the prediction accuracy of the worst code amount is deteriorated, and as a result, there is a problem that the coding efficiency is reduced. Therefore, as shown in the following equation (6), the worst code amount is modeled by adding an increase of the code amount due to the difference of the variable length coding table as another term.

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 equation (6), C 1 and C 2 may be the same as or similar to the corresponding values in the above equation (3). t 1 indicates a table index of a variable-length coding table corresponding to the characteristic value (absolute value sum or variance etc.) of the input signal, and t 2 indicates a variable-length coding table previously selected by the table selection unit 101 a. Indicates a table index. Then, dif [t 1 , t 2 ] indicates the difference between the encoded amount when the table index is t 1 and when the table index is t 2 . dif [t 1 , t 2 ] may be “0” when t 1 = t 2 , and becomes larger as the variances of the variable-length coding tables of t 1 and t 2 differ. The value of dif [t 1 , t 2 ] can be obtained by coding the 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, by round-robin coding etc. It can be acquired. The coding is performed round-round 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 taken as dif [t 1 , t 2 ] Become. If the worst code amount is modeled according to the above equation (6), the method of determining the quantization parameter by the parameter determining unit 103a thereafter is similar to the operation of the parameter determining unit 103 of the first embodiment. Specifically, the following equation (7) may be satisfied for the allocation code amount B.

B≧Cxq+C+dif[t,t] ・・・(7) B C C 1 x q + 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 may determine the quantization parameter q that satisfies the equation (8), for example, determines the smallest 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, although the difference between the worst code amounts when the table index is different is modeled as the difference dif [t 1 , t 2 ] for the two-dimensional table, a variable-length coding table prepared in advance is prepared. It is also possible to perform modeling with a one-dimensional table, depending on the characteristics of. For example, when using a variable-length coding table of Golomb's rice code, 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) And corresponds to an input signal whose sum of absolute values is twice or half. This relationship holds for any variable-length coding table with a suffix length of 2 or more. From this, the difference in the worst code amount when using different variable-length coding tables mostly depends on the absolute value of each suffix length It will depend heavily on the difference. From this, by performing modeling as shown in the following equation (9) instead of the equation (7), it is possible to reduce the amount of information held in the encoding device 10a.

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

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

パラメタ決定部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 the table index and the selection information from the table selection unit 101a, receives the quantization parameter from the parameter determination unit 103a, receives the quantization value from the quantization unit 104, and performs variable-length coding on the quantization value. Is a functional unit that Specifically, when the selection information indicates that the variable-length coding table previously selected by the table selection unit 101a is selected, the coding unit 105a is a variable encoded previously stored therein. The long coding table is used to perform variable length coding on the quantization value. The coding unit 105 a is a table index (a variable length coding table previously selected by the table selection unit 101 a), as in the coding unit 105 of the first embodiment, for the variable length coding table to be actually used. It is good also as what is selected based on a table index which shows, and a quantization parameter. On the other hand, when the selection information indicates that the variable-length coding table has been 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. Long encoding may be performed. The encoding unit 105a internally holds table index information so that it can be used in the subsequent processing unit. 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 encoding of the table index by a method different from the same method as the encoding unit 105 of the first embodiment. Specifically, the encoding unit 105a first encodes selection information (for example, a flag), and then, changes the variable only when the selection information selects a variable-length coding table selected in the processing unit. Encode the table index of the long encoding table. This reduces the amount of code at the time of encoding the table index. 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 result as a code 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 is a quantization parameter that suppresses the occurrence of buffer underflow in the reception buffer 30 with a small amount of processing, similarly to the encoding device 10 according to the first embodiment. 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 degradation of the SNR of the decoded signal can be suppressed.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これらの新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、および変更を行うことができる。これらの実施形態は、発明の範囲および要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   While certain embodiments of the present invention have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, substitutions, and alterations can be made without departing from the scope of the invention. These embodiments are included in the scope and the 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 バス
Reference Signs List 1 transmission system 10, 10a encoding device 20 decoding device 30 reception buffer 40 network 101, 101a table selection unit 102 code amount acquisition unit 103, 103a parameter determination unit 104 quantization unit 105, 105a encoding unit 106 code amount control unit 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の可変長符号化テーブルを選択し、該可変長符号化テーブルによって、前記量子化値に対して可変長符号化を行う符号化部と、
を備えた符号化装置。
A coding apparatus that performs variable-length coding on a quantized value obtained by quantizing an input signal based on a quantization parameter, comprising:
A selector configured to select one variable length coding table from among two or more variable length coding tables based on the characteristics of the input signal;
An acquisition unit for acquiring the maximum code amount that may occur for each of the quantization parameters according to the variable-length coding table selected by the selection unit;
A determination unit that determines the quantization parameter based on the maximum code amount for each quantization parameter and an allocated code amount determined by an occupied code amount of a reception buffer;
A quantization unit that quantizes the input signal to obtain the quantization value using the quantization parameter determined by the determination unit;
Based on the quantization parameter determined by the determination unit, one variable-length coding table is selected from the two or more variable-length coding tables, and the quantization value is determined by the variable-length coding table. An encoding unit that performs variable-length encoding on
An encoding device comprising:
前記取得部は、前記量子化パラメタ毎に発生しうる前記最大の符号量を決定する関数を取得し、The acquisition unit acquires a function that determines the maximum code amount that may occur for each of the quantization parameters,
前記決定部は、前記関数から得られる前記量子化パラメタ毎の前記最大の符号量と、前記受信バッファの占有符号量により求まる前記割り当て符号量と、に基づいて前記量子化パラメタを決定する請求項1に記載の符号化装置。The determination unit determines the quantization parameter based on the maximum code amount for each quantization parameter obtained from the function and the allocated code amount obtained from the occupied code amount of the reception buffer. The encoding device according to 1.
前記選択部は、前記入力信号の特性として、該入力信号の分散または絶対値和に基づいて、1の可変長符号化テーブルを選択する請求項1に記載の符号化装置。   The encoding apparatus according to claim 1, wherein the selection unit selects one variable-length coding table based on the variance or sum of absolute values of the input signal as the characteristic of the input signal. 前記符号化部により可変長符号化が行われる符号の符号量が、復号装置により前記受信バッファの符号が引き去られるタイミングにおける前記占有符号量よりも小さくなるように前記割り当て符号量を設定する符号量制御部を、さらに備えた請求項1に記載の符号化装置。   A code for setting the allocation code amount such that the code amount of a code for which variable length coding is performed by the coding 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. 前記符号化部が選択する可変長符号化テーブルは、ゴロムライス符号に基づくテーブルであり、
前記符号化部は、前記決定部により決定された前記量子化パラメタが大きいほど、前記選択部により選択された可変長符号化テーブルに対応する分散よりも小さい分散に対応する可変長符号化テーブルを選択し、
前記取得部が取得する関数は、一次関数である請求項に記載の符号化装置。
The variable length coding table selected by the coding unit is a table based on Golomb rice code,
The coding unit corresponds to a variable length coding table corresponding to a smaller variance than a variance corresponding to the variable length coding table selected by the selection unit as the quantization parameter determined by the determination unit is larger. selected,
The encoding device according to claim 2 , wherein the function acquired by the acquisition unit is a linear function .
前記符号化部は、前記選択部により選択された可変長符号化テーブルのサフィックス長から、前記決定部により決定された前記量子化パラメタを差し引いた値をインデックスとして示される可変長符号化テーブルを選択する請求項5に記載の符号化装置。   The encoding unit selects a variable length encoding table indicated by using a value 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 as an index. The encoding device according to claim 5. 前記選択部は、所定値より大きいサフィックス長の可変長符号化テーブルを選択する請求項6に記載の符号化装置。   The encoding apparatus according to claim 6, wherein the selection unit selects a variable-length coding table having a suffix length larger than a predetermined value. 前記量子化部による量子化の量子化幅は、前記量子化パラメタの指数関数であり、
前記関は、前記量子化パラメタの一次式で表される請求項に記載の符号化装置。
The quantization width of the quantization by the quantization unit is an exponential function of the quantization parameter,
The function number, the encoding apparatus according to claim 2 represented by a linear equation of the quantization parameter.
前記選択部は、前記入力信号の特性を示す値と、以前に選択した可変長符号化テーブルに対応する特性の値との差分が所定の閾値未満である場合、以前に選択した可変長符号化テーブルを再度選択し、
前記符号化部は、前記選択部により、以前に選択した可変長符号化テーブルが選択された場合、以前に符号化に用いた可変長符号化テーブルによって、前記量子化値に対して可変長符号化を行う請求項1に記載の符号化装置。
The selection unit may perform variable length coding previously selected when a 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. Select the table again,
If the variable length coding table previously selected is selected by the selection section, the coding section performs variable length coding on the quantized value according to the variable length coding table previously used for coding. The coding apparatus according to claim 1, wherein
前記取得部は、前記選択部により以前に選択した可変長符号化テーブルを再度選択された場合、再度選択された可変長符号化テーブルに対応する最大の符号量と、前記入力信号の特性に基づく可変長符号化テーブルに対応する最大の符号量との差分を取し、
前記決定部は、前記量子化パラメタ毎の前記最大の符号量と、前記差分と、前記受信バッファの占有符号量により求まる前記割り当て符号量と、に基づいて前記量子化パラメタを決定する請求項9に記載の符号化装置。
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 when the variable length coding table previously selected by the selection unit is selected again. and it acquired the difference between the maximum code amount corresponding to the variable length coding table,
The determination unit determines the quantization parameter on the basis of the maximum code amount for each quantization parameter, the difference, and the allocated code amount determined by the occupied code amount of the reception buffer. The encoding device according to claim 1.
入力信号を量子化パラメタに基づいて量子化した量子化値に対して可変長符号化を行う符号化装置の符号化方法であって、
前記入力信号の特性に基づいて、2以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択する選択ステップと、
選択した可変長符号化テーブルに応じて、前記量子化パラメタ毎に発生しうる最大の符号量を取得する取得ステップと、
前記量子化パラメタ毎の前記最大の符号量と、受信バッファの占有符号量により求まる割り当て符号量と、に基づいて前記量子化パラメタを決定する決定ステップと、
決定した前記量子化パラメタを用いて、前記入力信号を量子化して前記量子化値を求める量子化ステップと、
決定した前記量子化パラメタに基づいて、前記2以上の可変長符号化テーブルの中から1の可変長符号化テーブルを選択し、該可変長符号化テーブルによって、前記量子化値に対して可変長符号化を行う符号化ステップと、
を有する符号化方法。
A coding method of a coding apparatus for performing variable-length coding on a quantized value obtained by quantizing an input signal based on a quantization parameter, comprising:
A selection step of selecting one variable length coding table from among two or more variable length coding tables based on characteristics of the input signal;
An acquiring step of acquiring a maximum code amount that may be generated for each of the quantization parameters according to the selected variable length coding table;
A determination step of determining the quantization parameter based on the maximum code amount for each quantization parameter and an allocated code amount determined by an occupied code amount of the reception buffer;
Quantizing the input signal using the determined quantization parameter to obtain the quantization 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 change the variable length of the quantization value. An encoding step for performing encoding;
Encoding method.
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 JP2017168985A (en) 2017-09-21
JP6549057B2 true 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)

Family Cites Families (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
JP4264535B2 (en) * 2003-02-04 2009-05-20 ソニー株式会社 Image processing apparatus and method, recording medium, and program
JP5221430B2 (en) * 2009-03-24 2013-06-26 株式会社東芝 Image compression apparatus and image expansion apparatus

Also Published As

Publication number Publication date
JP2017168985A (en) 2017-09-21

Similar Documents

Publication Publication Date Title
JP5045950B2 (en) Video encoding method, video encoding apparatus, and video encoding program
JP5365518B2 (en) Image processing apparatus and method
US7304590B2 (en) Arithmetic decoding apparatus and method
US7688234B2 (en) Coding apparatus, coding method, program for executing the method, and recording medium storing the program
US9363517B2 (en) Indexed color history in image coding
US20120219055A1 (en) Methods and devices for data compression using offset-based adaptive reconstruction levels
JP5524072B2 (en) Video encoding device
US8374451B2 (en) Image processing device and image processing method for reducing the circuit scale
US20120250758A1 (en) Method and apparatus for frame memory compression
TWI827010B (en) Arithmetic encoders, arithmetic decoders, video encoder, video decoder, methods for encoding, methods for decoding and computer program
TWI721396B (en) Video decoder, video encoder, method for decoding a video content, method for encoding a video content, computer program and video bitstream
WO2009157579A1 (en) Image processing device and image processing method
JP6476900B2 (en) Moving picture coding apparatus, moving picture coding method, and computer program for moving picture coding
US9596462B2 (en) Image processing apparatus, method, and medium with feedback control and quantization search
JP5231243B2 (en) Encoding apparatus and encoding method
CN104125460A (en) Method and apparatus for controlling video bitrates
US20140270554A1 (en) Image encoding apparatus and image decoding apparatus
US11412241B2 (en) Decoding or encoding delta transform coefficients
JP6549057B2 (en) Encoding apparatus and encoding method
JP2011023922A (en) Image coding apparatus and program thereof
US20220109891A1 (en) Features of range asymmetric number system encoding and decoding
US20130279818A1 (en) Image encoding apparatus and method, image decoding apparatus and method, and non-transitory computer readable medium
JP5632328B2 (en) Code amount prediction apparatus and program
US9485509B2 (en) Image compression device, image compression method, image decompression device, and image decompression method
JP4911052B2 (en) Image processing apparatus, image processing method, and image processing 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 Written amendment

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