JP5873290B2 - Encoder - Google Patents

Encoder Download PDF

Info

Publication number
JP5873290B2
JP5873290B2 JP2011235309A JP2011235309A JP5873290B2 JP 5873290 B2 JP5873290 B2 JP 5873290B2 JP 2011235309 A JP2011235309 A JP 2011235309A JP 2011235309 A JP2011235309 A JP 2011235309A JP 5873290 B2 JP5873290 B2 JP 5873290B2
Authority
JP
Japan
Prior art keywords
lower limit
limit value
encoding
quantization coefficient
unit
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.)
Expired - Fee Related
Application number
JP2011235309A
Other languages
Japanese (ja)
Other versions
JP2013093774A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2011235309A priority Critical patent/JP5873290B2/en
Publication of JP2013093774A publication Critical patent/JP2013093774A/en
Application granted granted Critical
Publication of JP5873290B2 publication Critical patent/JP5873290B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

本発明は、符号化装置に関する。
The present invention relates to a code KaSo location.

近年、音声信号、映像信号など所謂マルチメディアに関連する情報のデジタル化が急進しており、これに対応して映像信号の圧縮符号化復号化技術が注目されている。圧縮符号化復号化技術により、映像信号の格納に必要な記憶容量や伝送に必要な帯域を減少させることができるため、圧縮符号化復号化技術はマルチメディア産業にとって極めて重要な技術である。   In recent years, digitalization of information related to so-called multimedia such as audio signals and video signals has been advancing rapidly, and in response to this, compression coding and decoding techniques for video signals have attracted attention. The compression encoding / decoding technology is extremely important for the multimedia industry because the storage capacity necessary for storing video signals and the bandwidth required for transmission can be reduced by the compression encoding / decoding technology.

圧縮符号化復号化技術は、多くの映像信号が有する自己相関性の高さ(即ち、冗長性)を利用して情報量(データ量)を圧縮している。映像信号が有する冗長性には、時間冗長性及び二次元の空間冗長性がある。時間冗長性は、ブロック単位の動き検出及び動き補償を用いて低減することができる。一方、空間冗長性は、離散コサイン変換(DCT)を用いて低減させることができる。   The compression coding / decoding technique compresses the amount of information (data amount) by using the high autocorrelation (that is, redundancy) of many video signals. The redundancy of the video signal includes temporal redundancy and two-dimensional spatial redundancy. Temporal redundancy can be reduced using block-by-block motion detection and motion compensation. On the other hand, spatial redundancy can be reduced using discrete cosine transform (DCT).

国際標準の1つとなっているH.264/MPEG4−AVCは、CAVLC或いはCABACと呼ばれるコンテキスト適応型符号化方式を採用しており、従来の符号化技術より符号化効率を高めている。なお、CAVLCはContext-based Adaptive-Variable-Length Codingの省略形であり、CABACはContext-Adaptive Binary Arithmetic Codingの省略形である。   H. has become one of the international standards. H.264 / MPEG4-AVC employs a context-adaptive coding method called CAVLC or CABAC, and has higher coding efficiency than conventional coding techniques. CAVLC is an abbreviation for Context-based Adaptive-Variable-Length Coding, and CABAC is an abbreviation for Context-Adaptive Binary Arithmetic Coding.

H.264/MPEG4−AVCでは1マクロブロックあたりの最大符号量(符号量の上限値)が規定されており、4:2:0カラーコンポーネント、8ビットで符号化を行う場合、符号量は3200ビットを超えてはならないことになっている。そのため、符号化の際には符号量が3200ビットを超えないように符号化制御を行うことが求められる。符号化を行った結果、符号量が上限値を超えてしまった場合には規格違反となり、予測方法や量子化係数を設定し直して再符号化を行う必要がある。その際には、再符号化処理が完了するまで次のマクロブロックの符号化処理が行えないため、ビデオカムコーダなどリアルタイムでの処理が要求される機器での処理時間の遅延が懸念される。   H. In H.264 / MPEG4-AVC, the maximum code amount per macroblock (the upper limit value of the code amount) is defined. When encoding with 4: 2: 0 color components and 8 bits, the code amount is 3200 bits. It should not be exceeded. Therefore, it is required to perform encoding control so that the code amount does not exceed 3200 bits at the time of encoding. As a result of encoding, if the amount of code exceeds the upper limit, it is a violation of the standard, and it is necessary to re-encode by setting the prediction method and quantization coefficient again. In this case, since the next macroblock cannot be encoded until the re-encoding process is completed, there is a concern about a delay in processing time in a device that requires real-time processing such as a video camcorder.

再符号化を行う方法の他に、画素値をそのまま多重化するI_PCMモードと呼ばれる予測モードを用いて符号化する方法もある。しかし、このI_PCMモードの場合、符号量が上限値を超えるか否かの判定をエントロピー符号化後でないと行えないため、I_PCMデータを予め保存しておく必要がある。こうした仕組みを利用して、1マクロブロックあたりの符号量が上限値を超えることを防止するために、エントロピー符号化前の情報からある閾値を基に符号量を予測し、I_PCMデータへ差し替える技術が提案されている(特許文献1参照)。   In addition to the re-encoding method, there is also a method of encoding using a prediction mode called I_PCM mode in which pixel values are multiplexed as they are. However, in the case of the I_PCM mode, it is necessary to store the I_PCM data in advance because it is not possible to determine whether the code amount exceeds the upper limit value after entropy coding. In order to prevent the code amount per macroblock from exceeding the upper limit value using such a mechanism, there is a technique for predicting the code amount based on a certain threshold from information before entropy coding and replacing it with I_PCM data. It has been proposed (see Patent Document 1).

特開2007−166039号公報JP 2007-166039 A

しかしながら、特許文献1に記載の技術では、エントロピー符号化部へ、マクロブロックの画像データを渡す必要がある。ピクチャ内のどのマクロブロックで符号量が上限値を超えるかは実際に符号化をしてみないと分からないので、任意のマクロブロックで上限値の超過が発生する可能性に備えるためには、ピクチャ全体の画像データを保持しておく必要がある。そのため、メモリ消費量が増大するという問題がある。   However, in the technique described in Patent Document 1, it is necessary to pass macroblock image data to the entropy encoding unit. Since it is impossible to know which macroblock in the picture the code amount exceeds the upper limit without actually encoding, in order to be prepared for the possibility that the upper limit will be exceeded in any macroblock, It is necessary to store image data of the entire picture. Therefore, there is a problem that memory consumption increases.

また、エントロピー符号化方式としてCABACが使用される場合、ビットレートに比例して処理時間が長くなるため、ビットレートが高い場合にはより多くの画像データを保持する必要性が生じる。その結果、メモリ消費量が更に増大する。   Further, when CABAC is used as the entropy encoding method, the processing time becomes longer in proportion to the bit rate, so that it is necessary to hold more image data when the bit rate is high. As a result, the memory consumption further increases.

そこで、本発明は、複数の画像を符号化する際に、メモリ消費量の増大を抑制しつつ、各ブロックの符号量が上限値を超える可能性を低減できるようにすることを目的とする。
The present invention, when encoding a plurality of images while suppressing an increase in memory consumption, the code amount of each block is intended to make it possible to reduce the possibility of exceeding the upper limit.

発明に係る符号化装置は、第1の画像から符号化対象ブロックを取得する取得手段と、前記第1の画像とは異なる第2の画像に基づき、前記符号化対象ブロックに対応する予測画像を生成する生成手段と、前記符号化対象ブロックと前記予測画像との間の差分情報を計算する差分情報計算手段と、前記差分情報の情報量の指標となる指標値を計算する指標値計算手段と、前記指標値に対応する下限値を下回らないように量子化係数を決定する決定手段と、前記決定された量子化係数を用いて前記差分情報を量子化する量子化手段と、前記量子化された差分情報をエントロピー符号化する符号化手段とを有し、前記指標値と前記下限値との対応関係は、前記指標値が所定の閾値以上である場合は、前記下限値が0より大きな値に対応付けられ、前記指標値が前記所定の閾値以上でない場合は、前記下限値が0に対応付けられる関係であり、前記決定手段は、前記下限値を考慮せずに暫定的な量子化係数を決定し、前記暫定的な量子化係数が前記下限値を下回る場合に前記下限値を最終的な量子化係数として決定し、当該暫定的な量子化係数が前記下限値を下回らない場合に前記暫定的な量子化係数を最終的な量子化係数として決定し、前記決定手段は、前記第1の画像から取得される符号化対象ブロックについて、前記下限値を最終的な量子化係数として決定した回数が所定回数を超える前後で、前記指標値と前記下限値との対応関係を変化させることを特徴とする
The encoding device according to the present invention is based on an acquisition unit that acquires an encoding target block from a first image, and a second image different from the first image, and a predicted image corresponding to the encoding target block Generating means for generating difference information calculating means for calculating difference information between the encoding target block and the predicted image, and index value calculating means for calculating an index value that is an index of the information amount of the difference information Determining means for determining a quantization coefficient so as not to fall below a lower limit value corresponding to the index value; quantization means for quantizing the difference information using the determined quantization coefficient; and the quantization Encoding means for entropy-encoding the difference information, and the correspondence relationship between the index value and the lower limit value is such that the lower limit value is greater than 0 when the index value is greater than or equal to a predetermined threshold value. Associated with the value When the index value is not equal to or greater than the predetermined threshold, the lower limit value is associated with 0, and the determining means determines a provisional quantization coefficient without considering the lower limit value, When the provisional quantization coefficient falls below the lower limit value, the lower limit value is determined as the final quantization coefficient, and when the provisional quantization coefficient does not fall below the lower limit value, the provisional quantization is performed. The coefficient is determined as a final quantization coefficient, and the determination means determines the predetermined number of times that the lower limit value is determined as the final quantization coefficient for the encoding target block acquired from the first image. Before and after exceeding, the correspondence relationship between the index value and the lower limit value is changed .

発明によれば、複数の画像を符号化する際に、メモリ消費量の増大を抑制しつつ、各ブロックの符号量が上限値を超える可能性を低減することができるAccording to the present invention, when encoding a plurality of images while suppressing an increase in memory consumption can code amount of each block to reduce the possibility of exceeding the upper limit.

第1の実施形態に係る撮像装置100の構成を示すブロック図1 is a block diagram illustrating a configuration of an imaging apparatus 100 according to a first embodiment. 第1の実施形態に係る、差分情報の指標値と量子化係数の下限値との特定の対応関係に関して量子化制御部115の処理の具体例を示すフローチャートThe flowchart which shows the specific example of the process of the quantization control part 115 regarding the specific corresponding | compatible relationship between the index value of difference information and the lower limit value of a quantization coefficient based on 1st Embodiment. 第1の実施形態の変形例に係る撮像装置300の構成を示すブロック図The block diagram which shows the structure of the imaging device 300 which concerns on the modification of 1st Embodiment. 第1の実施形態の変形例に係る、差分情報の指標値と量子化係数の下限値との特定の対応関係に関して量子化制御部115、置換制御部301、及び量子化係数置換部302の処理の具体例を示すフローチャートProcessing of quantization control unit 115, replacement control unit 301, and quantization coefficient replacement unit 302 regarding a specific correspondence relationship between the index value of difference information and the lower limit value of the quantization coefficient according to the modification of the first embodiment Flowchart showing a specific example 第2の実施形態に係る量子化制御部115の処理の具体例を示すフローチャートThe flowchart which shows the specific example of the process of the quantization control part 115 which concerns on 2nd Embodiment. 第3の実施形態に係る撮像装置600の構成を示すブロック図A block diagram showing a configuration of an imaging apparatus 600 according to a third embodiment. 第4の実施形態に係る撮像装置700の構成を示すブロック図A block diagram showing a configuration of an imaging apparatus 700 according to a fourth embodiment

以下、添付図面を参照して、本発明の実施形態を説明する。なお、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。また、実施形態の中で説明されている特徴の組み合わせすべてが、本発明に必須とは限らない。   Embodiments of the present invention will be described below with reference to the accompanying drawings. The technical scope of the present invention is determined by the claims, and is not limited by the following individual embodiments. In addition, not all combinations of features described in the embodiments are essential to the present invention.

[第1の実施形態]
図1を参照して、本発明の符号化装置を撮像装置に適用した実施形態について説明する。図1に示す撮像装置100において、撮像部101は、レンズやCCD等のカメラ部を含み、撮像した動画像データを入力順にフレームメモリ102に格納する。その結果、フレームメモリ102には入力画像のシーケンスが格納される。
[First Embodiment]
With reference to FIG. 1, an embodiment in which the encoding apparatus of the present invention is applied to an imaging apparatus will be described. In the imaging apparatus 100 shown in FIG. 1, the imaging unit 101 includes a camera unit such as a lens or a CCD, and stores captured moving image data in the frame memory 102 in the order of input. As a result, the frame memory 102 stores the sequence of input images.

フレームメモリ102は、順に入力された画像データを、符号化順にインター予測部103及びイントラ予測部104に出力する。インター予測部103は、符号化又は予測の単位である所定数の画素からなるブロック(例えば、マクロブロック)単位に符号化対象画像と参照画像との間の動き量を動きベクトルとして検出し、検出された動きベクトルを予測方法選択部105に送信する。本実施形態において動きベクトルを検出する具体的な方法は特に限定されないが、一例として、下記の式(1)を用いた方法を挙げる。
C = D + λR ・・・ (1)
The frame memory 102 outputs the sequentially input image data to the inter prediction unit 103 and the intra prediction unit 104 in the encoding order. The inter prediction unit 103 detects, as a motion vector, the amount of motion between the encoding target image and the reference image in units of blocks (for example, macroblocks) including a predetermined number of pixels that are units of encoding or prediction The motion vector thus transmitted is transmitted to the prediction method selection unit 105. Although a specific method for detecting a motion vector in the present embodiment is not particularly limited, a method using the following formula (1) is given as an example.
C = D + λR (1)

式(1)において、Cは動きベクトルを決定するための評価値である。Dは予測画像から符号化対象画像(符号化対象ブロック)を引いて得られる差分情報に整数変換を施した変換係数の絶対値和(以下、SATD)である。或いは、Dは予測画像から符号化対象画像を引いて得られる差分情報の絶対値和(以下、SAD)など、他の形式の差分情報であってもよい。本実施形態では、差分情報DとしてSATDを用いるものとする。また、Rは動きベクトルの符号量であり、λは係数であり一般的には量子化ステップが用いられる。また、本実施形態では、符号化又は予測の単位である所定数の画素からなるブロックは、例えば16画素×16画素からなるマクロブロックとする。動きベクトルの符号量Rは、符号化対象マクロブロックの動きベクトルと、周囲のマクロブロックの動きベクトルから求められる推定動きベクトルとの間の差分量を基に算出される。最終的な動きベクトルは、探索範囲内で評価値Cが最少となる座標に対する符号化対象マクロブロックからのずれ量として検出される。インター予測部103は、検出した動きベクトルに基づく予測画像に対応するSATDを予測方法選択部105に送信する。   In Expression (1), C is an evaluation value for determining a motion vector. D is an absolute value sum (hereinafter referred to as SATD) of transform coefficients obtained by performing integer transform on difference information obtained by subtracting a coding target image (coding target block) from a predicted image. Alternatively, D may be other types of difference information such as the sum of absolute values of difference information (hereinafter referred to as SAD) obtained by subtracting the encoding target image from the predicted image. In the present embodiment, SATD is used as the difference information D. R is a code amount of a motion vector, λ is a coefficient, and generally a quantization step is used. In this embodiment, a block composed of a predetermined number of pixels, which is a unit of encoding or prediction, is a macroblock composed of 16 pixels × 16 pixels, for example. The code amount R of the motion vector is calculated based on the difference amount between the motion vector of the encoding target macroblock and the estimated motion vector obtained from the motion vectors of the surrounding macroblocks. The final motion vector is detected as the amount of deviation from the encoding target macroblock with respect to the coordinate at which the evaluation value C is minimum within the search range. The inter prediction unit 103 transmits SATD corresponding to the predicted image based on the detected motion vector to the prediction method selection unit 105.

イントラ予測部104は、符号化対象マクロブロックの周辺画素を用いて複数のイントラ予測画像を生成し、符号化対象マクロブロックとのブロックマッチングを行う。イントラ予測部104は、SATDが最少となるイントラ予測モードを選択し、その時のSATDと共に予測方法選択部105に送信する。   The intra prediction unit 104 generates a plurality of intra-predicted images using the peripheral pixels of the encoding target macroblock, and performs block matching with the encoding target macroblock. The intra prediction unit 104 selects an intra prediction mode in which the SATD is minimized, and transmits it to the prediction method selection unit 105 together with the SATD at that time.

予測方法選択部105はインター予測部103で検出された動きベクトルとイントラ予測部104で求めたイントラ予測モードとのうち、符号化効率の良い方を選択して予測画像生成部106に送信する。符号化効率の良い予測方法を選択する選択基準は特に限定されないが、本実施形態では、予測方法選択部105は、インター予測部103で求めたSATDとイントラ予測部104で求めたSATDとを比較し、SATDが小さい方の予測モードを選択するものとする。予測方法選択部105は、選択された予測モードのSATDを量子化制御部115に送信する。   The prediction method selection unit 105 selects a motion vector detected by the inter prediction unit 103 and the intra prediction mode obtained by the intra prediction unit 104, and selects the one with the better coding efficiency and transmits it to the predicted image generation unit. Although the selection criteria for selecting a prediction method with good coding efficiency is not particularly limited, in this embodiment, the prediction method selection unit 105 compares the SATD obtained by the inter prediction unit 103 and the SATD obtained by the intra prediction unit 104. The prediction mode with the smaller SATD is selected. The prediction method selection unit 105 transmits the selected prediction mode SATD to the quantization control unit 115.

ここで、量子化制御部115へ送信されるSATDは、符号化対象マクロブロックと予測画像との間の差分情報の情報量の指標となる値(指標値)である。従って、インター予測部103、イントラ予測部104、及び予測方法選択部105は、協働して指標値算出の処理を行うことになる。   Here, the SATD transmitted to the quantization control unit 115 is a value (index value) that serves as an index of the information amount of the difference information between the encoding target macroblock and the predicted image. Accordingly, the inter prediction unit 103, the intra prediction unit 104, and the prediction method selection unit 105 cooperate to perform index value calculation processing.

予測画像生成部106は、予測方法選択部105が選択した予測モードに従って予測画像を生成する。予測画像の生成は、入力画像のシーケンスに含まれる少なくとも1つの入力画像に基づいて行われるが、具体的に使用される入力画像は予測モードに応じて異なる。例えば、イントラ予測モードが使用される場合、符号化対象マクロブロックを含む入力画像のみに基づいて予測画像の生成が行われる。予測画像生成部106は、生成した予測画像を減算器107に送信する。   The predicted image generation unit 106 generates a predicted image according to the prediction mode selected by the prediction method selection unit 105. The generation of the prediction image is performed based on at least one input image included in the sequence of input images, but the input image that is specifically used differs depending on the prediction mode. For example, when the intra prediction mode is used, the prediction image is generated based only on the input image including the encoding target macroblock. The predicted image generation unit 106 transmits the generated predicted image to the subtracter 107.

減算器107は、フレームメモリから取得した符号化対象マクロブロックと予測画像生成部106から取得した予測画像との間の差分情報(差分画像データ)を算出する(即ち、減算器107は差分情報算出の処理を行う)。減算器107、算出した差分情報を整数変換部108に送信する。   The subtractor 107 calculates difference information (difference image data) between the encoding target macroblock acquired from the frame memory and the predicted image acquired from the predicted image generation unit 106 (that is, the subtracter 107 calculates difference information). Process). The subtractor 107 transmits the calculated difference information to the integer conversion unit 108.

整数変換部108は、入力された差分情報に整数変換を施し、変換係数を量子化部109に送信する。量子化部109は、整数変換部108からの変換係数を、後述する量子化制御部115が決定した量子化係数を用いて量子化する。変換係数は差分情報に由来するため、広義には、量子化部109においては差分情報の量子化が行われる。量子化部109は、量子化された差分情報をエントロピー符号化部114及び逆量子化部110に送信する。   The integer conversion unit 108 performs integer conversion on the input difference information and transmits the conversion coefficient to the quantization unit 109. The quantization unit 109 quantizes the transform coefficient from the integer transform unit 108 using the quantization coefficient determined by the quantization control unit 115 described later. Since the transform coefficient is derived from the difference information, in a broad sense, the quantization unit 109 quantizes the difference information. The quantization unit 109 transmits the quantized difference information to the entropy encoding unit 114 and the inverse quantization unit 110.

逆量子化部110は、量子化された変換係数(差分情報)を逆量子化し、逆整数変換部111に送信する。逆整数変換部111は、逆量子化された変換係数に対して逆整数変換処理を施すことにより、整数変換されていない差分情報を生成する。逆整数変換部111は、生成した差分情報を加算器112に送信する。   The inverse quantization unit 110 inversely quantizes the quantized transform coefficient (difference information) and transmits it to the inverse integer transform unit 111. The inverse integer transform unit 111 generates difference information that has not been subjected to integer transform by performing an inverse integer transform process on the inversely quantized transform coefficient. The inverse integer conversion unit 111 transmits the generated difference information to the adder 112.

加算器112は、逆整数変換部111が生成した差分情報と、予測画像生成部106が生成した予測画像とを加算する。加算後のデータは、復号された再構成画像データとなり、前述した予測画像生成部106に入力されて、イントラ予測画像の生成に用いられる。また、再構成画像データは、ループ内フィルタ113にも送信される。ループ内フィルタ113は再構成画像データに対して符号化歪の軽減処理を施し、インター符号化の際に用いる参照画像データとしてフレームメモリ102に記憶する。   The adder 112 adds the difference information generated by the inverse integer transform unit 111 and the predicted image generated by the predicted image generation unit 106. The data after the addition becomes decoded reconstructed image data, which is input to the predicted image generation unit 106 described above and used for generating an intra predicted image. The reconstructed image data is also transmitted to the in-loop filter 113. The in-loop filter 113 performs coding distortion reduction processing on the reconstructed image data, and stores it in the frame memory 102 as reference image data used in inter coding.

エントロピー符号化部114は、量子化部109により量子化された差分情報(本実施形態では、厳密には、整数変換され量子化された差分情報)をエントロピー符号化する。エントロピー符号化部114は、エントロピー符号化の際の符号化方式として、CABAC及びCAVLCなどの複数の符号化方式の中から1つを選択する。エントロピー符号化部114は、エントロピー符号化により得られる符号データをストリームとして出力する。また、エントロピー符号化部114は、発生した符号量を量子化制御部115に通知する。   The entropy encoding unit 114 entropy encodes the difference information quantized by the quantization unit 109 (in this embodiment, strictly, the difference information quantized by integer conversion). The entropy encoding unit 114 selects one of a plurality of encoding methods such as CABAC and CAVLC as an encoding method for entropy encoding. The entropy encoding unit 114 outputs code data obtained by entropy encoding as a stream. In addition, the entropy encoding unit 114 notifies the quantization control unit 115 of the generated code amount.

量子化制御部115は、出力ストリームがCPU(不図示)により設定された記録レートに近づくように、エントロピー符号化部114からの発生符号量を監視しながら適切な量子化係数を決定し、量子化部109に通知する。   The quantization control unit 115 determines an appropriate quantization coefficient while monitoring the generated code amount from the entropy coding unit 114 so that the output stream approaches a recording rate set by a CPU (not shown). Notification to the conversion unit 109.

本実施形態では、量子化制御部115は、記録レートを考慮するだけではなく、エントロピー符号化部114の発生符号量が決められた最大符号量(上限値)を超える可能性を低減するように量子化係数を決定する。基本的な考え方として、予測方法選択部105から入力されるSATD(差分情報の情報量の指標値)が大きいほど、最終的な発生符号量が多くなる傾向がある。その際に、量子化部109が使用する量子化係数が小さいほど、量子化部109における情報量の削減量が小さいため、最終的な発生符号量が上限値を超える可能性が高くなる。そこで、量子化制御部115は、指標値に対応する下限値を下回らないように量子化係数を決定する。これにより、量子化係数が下限値以上となるため、量子化部109において符号化対象の情報量が少なくとも量子化係数の下限値に応じた程度には削減されることが期待され、最終的な発生符号量が上限値を超える可能性が低減される。   In the present embodiment, the quantization control unit 115 not only considers the recording rate, but also reduces the possibility that the generated code amount of the entropy encoding unit 114 exceeds the determined maximum code amount (upper limit value). Determine the quantization factor. As a basic idea, the greater the SATD (index value of the information amount of difference information) input from the prediction method selection unit 105, the more the final generated code amount tends to increase. At this time, the smaller the quantization coefficient used by the quantizing unit 109, the smaller the amount of information reduction in the quantizing unit 109, and thus the more likely the final generated code amount exceeds the upper limit. Therefore, the quantization control unit 115 determines the quantization coefficient so as not to fall below the lower limit value corresponding to the index value. Thereby, since the quantization coefficient becomes equal to or higher than the lower limit value, it is expected that the amount of information to be encoded is reduced at least to the extent corresponding to the lower limit value of the quantization coefficient in the quantization unit 109. The possibility that the generated code amount exceeds the upper limit value is reduced.

指標値と下限値との対応関係としては、最終的な発生符号量が上限値を超える可能性を抑制する度合いや望まれる画質などに応じて、任意の対応関係を採用可能である。例えば、比較的小さな閾値以上の指標値に対しては比較的大きな下限値を一律に対応付け、この閾値未満の指標値に対しては一律に0を対応付けて実質的に下限値を考慮しないことが考えられる。この場合、発生符号量が上限値を超える可能性が比較的強く低減されることが期待されるが、画質が大きく低下する可能性がある。或いは、比較的大きな閾値以上の指標値に対しては比較的小さな下限値を一律に対応付け、この閾値未満の指標値に対しては一律に0を対応付けて実質的に下限値を考慮しないことが考えられる。この場合、画質の低下は抑制されるが、発生符号量が上限値を超える可能性はそれほど低減されない可能性がある。或いは、指標値が大きくなるにつれて段階的に大きな下限値を対応付けることが考えられる。この場合、処理は複雑になるが、画質の低下の抑制と発生符号量が上限値を超える可能性の低減とが適当なバランスで達成されることが期待される。   As the correspondence relationship between the index value and the lower limit value, an arbitrary correspondence relationship can be adopted depending on the degree of suppressing the possibility that the final generated code amount exceeds the upper limit value, the desired image quality, and the like. For example, a relatively large lower limit value is uniformly associated with an index value that is greater than or equal to a relatively small threshold value, and 0 is uniformly associated with an index value that is less than this threshold value, and the lower limit value is not substantially considered. It is possible. In this case, it is expected that the possibility that the generated code amount exceeds the upper limit value is relatively strongly reduced, but the image quality may be greatly lowered. Alternatively, a relatively small lower limit value is uniformly associated with an index value greater than or equal to a relatively large threshold value, and 0 is uniformly associated with an index value less than this threshold value so that the lower limit value is not substantially considered. It is possible. In this case, although the deterioration of the image quality is suppressed, the possibility that the generated code amount exceeds the upper limit value may not be reduced so much. Alternatively, it is conceivable that a large lower limit value is associated stepwise as the index value increases. In this case, the processing is complicated, but it is expected that suppression of deterioration in image quality and reduction in the possibility that the generated code amount exceeds the upper limit value are achieved in an appropriate balance.

このように、指標値と下限値との間に何らかの対応関係があり、発生符号量が上限値を超える可能性が部分的にでも低減される限り、いかなる対応関係であっても本実施形態の範囲に含まれる。以下、図2を参照して、差分情報の指標値と量子化係数の下限値との特定の対応関係に関して量子化制御部115の処理の具体例を説明する。   In this way, there is some correspondence between the index value and the lower limit, and any correspondence can be used as long as the possibility that the generated code amount exceeds the upper limit is partially reduced. Included in the range. Hereinafter, with reference to FIG. 2, a specific example of processing of the quantization control unit 115 regarding a specific correspondence between the index value of the difference information and the lower limit value of the quantization coefficient will be described.

最初にS200で、量子化制御部115は、設定された記録レートとエントロピー符号化部114の発生符号量とに基づいて量子化係数Qpを決定する。この時点ではQpは暫定的な量子化係数であり、最終的な量子化係数は後述するS203又はS204において決定される。   First, in S200, the quantization control unit 115 determines the quantization coefficient Qp based on the set recording rate and the generated code amount of the entropy encoding unit 114. At this point, Qp is a provisional quantization coefficient, and the final quantization coefficient is determined in S203 or S204 described later.

S201で、量子化制御部115は、予測方法選択部105から入力されるSATDが所定の閾値Th0以上であるか否かを判定する。閾値以上(SATD≧Th0)の場合、処理はS202に進み、そうでない(SATD<Th0)場合、処理はS204に進む。   In S201, the quantization control unit 115 determines whether the SATD input from the prediction method selection unit 105 is equal to or greater than a predetermined threshold Th0. If it is equal to or greater than the threshold value (SATD ≧ Th0), the process proceeds to S202, and if not (SATD <Th0), the process proceeds to S204.

S202で、量子化制御部115は、S200で決定されたQpが下限値Qp0を下回るか否かを判定する。下回る(Qp<Qp0)場合、処理はS203に進み、そうでない(Qp≧Qp0)場合、処理はS204に進む。   In S202, the quantization control unit 115 determines whether or not Qp determined in S200 is lower than the lower limit value Qp0. If lower (Qp <Qp0), the process proceeds to S203, and if not (Qp ≧ Qp0), the process proceeds to S204.

なお、前述の通り量子化係数の下限値はSATD(指標値)に対応する値であるが、図2の例では、SATD≧Th0の場合は下限値は一律にQp0であり、SATD<Th0の場合は下限値は考慮されない(例えば、0に設定される)。   As described above, the lower limit value of the quantization coefficient is a value corresponding to SATD (index value). However, in the example of FIG. 2, when SATD ≧ Th0, the lower limit value is uniformly Qp0, and SATD <Th0. In this case, the lower limit value is not considered (for example, set to 0).

S203で、量子化制御部115は、QpをQp0に置き換え、量子化部109に対してQp0を通知する。他方、S204では、量子化制御部115は、Qpをそのまま量子化部109に通知する。これにより、最終的な量子化係数が下限値Qp0を下回らないように決定される。   In S203, the quantization control unit 115 replaces Qp with Qp0, and notifies the quantization unit 109 of Qp0. On the other hand, in S204, the quantization control unit 115 notifies the quantization unit 109 of Qp as it is. Thus, the final quantization coefficient is determined so as not to fall below the lower limit value Qp0.

以上説明したように、本実施形態によれば、量子化制御部115は、符号化対象の差分情報の情報量の指標値(例えば、SATD)に対応する下限値を下回らないように量子化係数を決定し、量子化部109に通知する。また、本実施形態の構成は、比較器などわずかな回路を追加するだけで実装可能であり、特別に大きなメモリ容量が追加的に必要となる訳ではない。従って、本実施形態によれば、入力画像のシーケンスを所定数の画素からなるブロック単位で符号化する際に、メモリ消費量の増大を抑制しつつ、各ブロックの符号量が上限値を超える可能性を低減することができる。   As described above, according to the present embodiment, the quantization control unit 115 does not lower the lower limit corresponding to the index value (for example, SATD) of the information amount of the difference information to be encoded. Is notified to the quantization unit 109. The configuration of the present embodiment can be implemented by adding a few circuits such as a comparator, and does not require an extra large memory capacity. Therefore, according to the present embodiment, when the sequence of the input image is encoded in units of blocks including a predetermined number of pixels, the code amount of each block can exceed the upper limit while suppressing an increase in memory consumption. Can be reduced.

なお、本実施形態では指標値の例としてSATDを使用したが、代わりに、SADや分散などを使用してもよい。即ち、符号化対象の差分情報の情報量の指標となるものであれば、いかなる種類の情報を使用してもよい。   In the present embodiment, SATD is used as an example of the index value, but SAD, variance, or the like may be used instead. That is, any kind of information may be used as long as it is an index of the information amount of the difference information to be encoded.

また、前述の通り指標値と下限値との対応関係は上述のものに限定されない。別の例として、SATDに関する3種類の閾値、及び対応する3種類の下限値を有する対応関係を説明する。SATDに関する閾値をSATD_Th0、SATD_Th1、SATD_Th2(SATD_Th0>SATD_Th1>SATD_Th2)とし、下限値をQp0、Qp1、Qp2(Qp0>Qp1>Qp2)とする。SATD_Th0はQp0と、SATD_Th1はQp1と、SATD_Th2はQp2と、それぞれ対応する。従って、SATD>SATD_Th2且つQp<Qp2の場合、QpはQp2に置き換えられる。同様に、SATD>SATD_Th1且つQp<Qp1の場合にQpはQp1に置き換えられ、SATD>SATD_Th0且つQp<Qp0の場合にQpはQp0に置き換えられる。このように指標値に応じて下限値を段階的に変化させることにより、量子化係数が大きくなり過ぎることを防止し、画質の劣化を抑えることができる。   Further, as described above, the correspondence relationship between the index value and the lower limit value is not limited to the above. As another example, a correspondence relationship including three types of threshold values related to SATD and three types of corresponding lower limit values will be described. The threshold values related to SATD are SATD_Th0, SATD_Th1, and SATD_Th2 (SATD_Th0> SATD_Th1> SATD_Th2), and the lower limit values are Qp0, Qp1, Qp2 (Qp0> Qp1> Qp2). SATD_Th0 corresponds to Qp0, SATD_Th1 corresponds to Qp1, and SATD_Th2 corresponds to Qp2. Therefore, when SATD> SATD_Th2 and Qp <Qp2, Qp is replaced with Qp2. Similarly, when SATD> SATD_Th1 and Qp <Qp1, Qp is replaced with Qp1, and when SATD> SATD_Th0 and Qp <Qp0, Qp is replaced with Qp0. In this way, by changing the lower limit value stepwise according to the index value, it is possible to prevent the quantization coefficient from becoming too large and to suppress deterioration in image quality.

また、符号化対象マクロブロックのタイプに応じて指標値と下限値との対応関係を変化させてもよい。例えば、符号化対象マクロブロックがイントラマクロブロックであるか否か(即ち、予測画像生成部106において符号化対象マクロブロックが所属する入力画像にのみ基づいて予測画像が生成されたか否か)に応じて対応関係を変化させることができる。どのように対応関係を変化させるかは任意であり、望まれる画質などを考慮して適宜変化させればよい。   Further, the correspondence relationship between the index value and the lower limit value may be changed according to the type of the encoding target macroblock. For example, depending on whether or not the encoding target macroblock is an intra macroblock (that is, whether or not the prediction image is generated based on only the input image to which the encoding target macroblock belongs in the prediction image generation unit 106). Can change the correspondence. How the correspondence is changed is arbitrary, and may be changed as appropriate in consideration of the desired image quality.

同様に、エントロピー符号化部114において選択された符号化方式(例えば、CABAC又はCAVLC)に応じて指標値と下限値との対応関係を変化させてもよい。これにより、符号化方式に応じた指標値(例えばSATD)と発生符号量との相関性の相違をも考慮することができ、より正確に量子化係数の下限値を設定することができる。その結果、画質の劣化を抑えたり、発生符号量が上限値を超える可能性を低減したりすることができる。この場合も、どのように対応関係を変化させるかは任意であり、望まれる画質などを考慮して適宜変化させればよい。   Similarly, the correspondence between the index value and the lower limit value may be changed according to the encoding method (for example, CABAC or CAVLC) selected by the entropy encoding unit 114. Thereby, the difference in correlation between the index value (for example, SATD) according to the encoding method and the generated code amount can be taken into consideration, and the lower limit value of the quantization coefficient can be set more accurately. As a result, it is possible to suppress degradation of image quality and to reduce the possibility that the generated code amount exceeds the upper limit value. Also in this case, how to change the correspondence is arbitrary, and may be changed as appropriate in consideration of the desired image quality.

(変形例)
図3及び図4を参照して、符号化対象の差分情報の情報量の指標値(例えば、SATD)に対応する下限値を下回らないように量子化係数を決定可能な、他の構成について説明する。
(Modification)
With reference to FIG. 3 and FIG. 4, another configuration in which the quantization coefficient can be determined so as not to fall below the lower limit value corresponding to the information amount index value (for example, SATD) of the difference information to be encoded will be described. To do.

図3は、第1の実施形態の変形例に係る撮像装置300の構成を示すブロック図である。図3において、図1と同一又は同様の構成要素には同一の符号を付し、その説明を省略する。   FIG. 3 is a block diagram illustrating a configuration of an imaging apparatus 300 according to a modification example of the first embodiment. 3, the same or similar components as those in FIG. 1 are denoted by the same reference numerals, and the description thereof is omitted.

撮像装置300は、撮像装置100の構成に加えて、置換制御部301及び量子化係数置換部302を備える。また、予測方法選択部105は、量子化制御部115ではなく置換制御部301に対してSATDを送信する。   The imaging device 300 includes a replacement control unit 301 and a quantization coefficient replacement unit 302 in addition to the configuration of the imaging device 100. In addition, the prediction method selection unit 105 transmits SATD to the replacement control unit 301 instead of the quantization control unit 115.

次に図4を参照して、差分情報の指標値と量子化係数の下限値との特定の対応関係に関して量子化制御部115、置換制御部301、及び量子化係数置換部302の処理の具体例を説明する。図4において、図2と同一又は同様の処理が行われるステップには同一の符号を付し、その説明を省略する。   Next, referring to FIG. 4, specific processing of the quantization control unit 115, the replacement control unit 301, and the quantization coefficient replacement unit 302 regarding a specific correspondence between the index value of the difference information and the lower limit value of the quantization coefficient An example will be described. In FIG. 4, steps in which the same or similar processes as those in FIG.

図4においては、S201とS202及びS204との間に、S401乃至S403が追加される。また、図2の場合と異なり、S201の処理は置換制御部301が実行し、S202乃至S204の処理は量子化係数置換部302が実行する。   In FIG. 4, S401 to S403 are added between S201 and S202 and S204. Also, unlike the case of FIG. 2, the processing of S201 is executed by the replacement control unit 301, and the processing of S202 to S204 is executed by the quantization coefficient replacement unit 302.

S201においてSATD≧Th0であると判定された場合、S401で、置換制御部301は、量子化係数置換部302が保持する置換フラグをonにセットする。他方、S201においてSATD<Th0であると判定された場合、S402で、置換制御部301は、量子化係数置換部302が保持する置換フラグをoffにセットする。   When it is determined in S201 that SATD ≧ Th0, in S401, the replacement control unit 301 sets the replacement flag held by the quantization coefficient replacement unit 302 to on. On the other hand, if it is determined in S201 that SATD <Th0, the replacement control unit 301 sets the replacement flag held by the quantized coefficient replacement unit 302 to off in S402.

S403で、量子化係数置換部302は、置換フラグがonにセットされているか否かを判定する。onにセットされている場合、処理はS202に進み、そうでない場合、処理はS204に進む。これにより、SATD≧Th0の場合にのみ量子化係数の下限値Qp0が考慮され、必要に応じてS200で決定されたQpがQp0に置き換えられる。従って、図2の場合と同様、SATDに対応する下限値を下回らないように最終的な量子化係数が決定される。   In S403, the quantization coefficient replacement unit 302 determines whether the replacement flag is set to on. If it is set to on, the process proceeds to S202; otherwise, the process proceeds to S204. Thereby, the lower limit value Qp0 of the quantization coefficient is considered only when SATD ≧ Th0, and Qp determined in S200 is replaced with Qp0 as necessary. Therefore, as in FIG. 2, the final quantization coefficient is determined so as not to fall below the lower limit corresponding to SATD.

[第2の実施形態]
第2の実施形態では、所定のピクチャ(入力画像)に関して量子化係数の置換が発生した(即ち、下限値が最終的な量子化係数として決定された)回数が所定回数を超える前後で、指標値と下限値との対応関係が変化する。本実施形態では、撮像装置100の構成は第1の実施形態と同様であるが(図1参照)、量子化制御部115の動作が第1の実施形態と異なる。
[Second Embodiment]
In the second embodiment, before and after the number of times that the quantization coefficient replacement has occurred for a predetermined picture (input image) (that is, the lower limit value is determined as the final quantization coefficient) exceeds the predetermined number, the index The correspondence between the value and the lower limit value changes. In the present embodiment, the configuration of the imaging apparatus 100 is the same as that of the first embodiment (see FIG. 1), but the operation of the quantization control unit 115 is different from that of the first embodiment.

図5は、第2の実施形態に係る量子化制御部115の処理の具体例を示すフローチャートである。図5において、図2と同一又は同様の処理が行われるステップには同一の符号を付し、その説明を省略する。   FIG. 5 is a flowchart illustrating a specific example of processing of the quantization control unit 115 according to the second embodiment. In FIG. 5, steps in which the same or similar processing as in FIG.

S501で、量子化制御部115は、変数MBNumが閾値Th未満であるか否かを判定する。MBNumは、符号化対象ピクチャが切り替わる度に0に初期化され、特定の符号化対象ピクチャに関してQpの置換が発生した回数を示す。MBNumがTh未満の場合、処理はS201に進み、そうでない場合、処理はS503に進む。   In S501, the quantization control unit 115 determines whether or not the variable MBNum is less than the threshold value Th. MBNum is initialized to 0 each time the encoding target picture is switched, and indicates the number of times Qp replacement has occurred for a specific encoding target picture. If MBNum is less than Th, the process proceeds to S201; otherwise, the process proceeds to S503.

S502の処理は図2のS203と同様であるが、量子化制御部115は、QpをQp0に置き換えることに加えて、MBNumに1を加算する。これにより、Qpの置換が発生した回数がカウントされる。   The process of S502 is the same as that of S203 of FIG. 2, but the quantization control unit 115 adds 1 to MBNum in addition to replacing Qp with Qp0. As a result, the number of times Qp replacement has occurred is counted.

MBNumがTh以上となった後に符号化される符号化対象マクロブロックについては、S503乃至S505及びS204の処理が実行される。S503乃至S505の処理はS201、S202、及びS502と同様であるが、Th0の代わりにTh1が、Qp0の代わりにQp1が用いられる。従って、指標値(この例ではSATD)と下限値との対応関係が変化する。   For the encoding target macroblock to be encoded after MBNum is equal to or greater than Th, the processing of S503 to S505 and S204 is executed. The processing from S503 to S505 is the same as S201, S202, and S502, except that Th1 is used instead of Th0, and Qp1 is used instead of Qp0. Accordingly, the correspondence between the index value (in this example, SATD) and the lower limit value changes.

Qpの置換の発生回数が多いということは、SATDが大きく発生符号量が多い可能性が高いということである。従って、本実施形態の処理によれば、ピクチャがSATDの大きいマクロブロックを多く含むか否かを判定することができ、多く含むことが分かった時点で、SATDと下限値との対応関係を変化させることにより最終的なQpの決定方法を変化させることができる。具体的にどのような対応関係を使用するかは望まれる画質などに応じて適宜決定可能である。従って、例えばTh0>Th1であってもよいし、Th0<Th1であってもよい。或いは、例えばTh0=Th1でありQp0とQp1とを異ならせてもよい。   The large number of occurrences of Qp substitution means that there is a high possibility that the SATD is large and the amount of generated codes is large. Therefore, according to the processing of the present embodiment, it is possible to determine whether or not a picture includes many macroblocks having a large SATD. When it is found that the picture includes many macroblocks, the correspondence between the SATD and the lower limit value is changed. By doing so, the final determination method of Qp can be changed. The specific correspondence to be used can be appropriately determined according to the desired image quality. Therefore, for example, Th0> Th1 may be satisfied, or Th0 <Th1 may be satisfied. Alternatively, for example, Th0 = Th1, and Qp0 and Qp1 may be different.

[第3の実施形態]
第3の実施形態では、符号化対象の差分情報の指標値(例えば、SATD)に対応する発生符号量の予測値を利用する。図6は、第3の実施形態に係る撮像装置600の構成を示すブロック図である。図6において、第1の実施形態の変形例(図3参照)と同一又は同様の構成要素には同一の符号を付し、その説明を省略する。
[Third Embodiment]
In the third embodiment, a predicted value of a generated code amount corresponding to an index value (for example, SATD) of difference information to be encoded is used. FIG. 6 is a block diagram illustrating a configuration of an imaging apparatus 600 according to the third embodiment. In FIG. 6, the same or similar components as those of the modification of the first embodiment (see FIG. 3) are denoted by the same reference numerals, and the description thereof is omitted.

撮像装置600は、撮像装置300の構成に加えて、閾値変更部601を備える。また、予測方法選択部105は、置換制御部301に加えて閾値変更部601に対してSATDを送信する。更に、エントロピー符号化部114は、量子化制御部115に加えて閾値変更部601に対して発生符号量(実際の発生符号量)を通知する。本実施形態では、この発生符号量を「CODE」と呼ぶ。   The imaging apparatus 600 includes a threshold value changing unit 601 in addition to the configuration of the imaging apparatus 300. In addition to the replacement control unit 301, the prediction method selection unit 105 transmits SATD to the threshold value changing unit 601. Furthermore, the entropy encoding unit 114 notifies the threshold change unit 601 of the generated code amount (actual generated code amount) in addition to the quantization control unit 115. In the present embodiment, this generated code amount is referred to as “CODE”.

閾値変更部601は、複数のSATDの各々に対応する符号化対象マクロブロックについての発生符号量の予測値を格納するテーブルを予め保持している。本実施形態では、予測方法選択部105から受信したSATDに対応する予測値を「CODE0」と呼ぶ。   The threshold value changing unit 601 holds in advance a table that stores the predicted value of the generated code amount for the encoding target macroblock corresponding to each of the plurality of SATDs. In the present embodiment, the prediction value corresponding to the SATD received from the prediction method selection unit 105 is referred to as “CODE0”.

閾値変更部601は、CODE0とCODEとを比較する。CODEがCODE0より大きい場合、実際の発生符号量(即ち、CODE)が上限値を超える可能性が高い。そこで、閾値変更部601は、置換制御部301が図4のS201において使用する閾値Th0を小さくするように置換制御部301に対して指示する。その結果、Qpの置換が発生し易くなり、CODEが上限値を超える可能性が低減される。   The threshold value changing unit 601 compares CODE0 and CODE. When CODE is larger than CODE0, there is a high possibility that the actual generated code amount (that is, CODE) exceeds the upper limit. Therefore, the threshold value changing unit 601 instructs the replacement control unit 301 to decrease the threshold value Th0 used by the replacement control unit 301 in S201 of FIG. As a result, substitution of Qp is likely to occur, and the possibility that CODE exceeds the upper limit value is reduced.

反対に、CODEがCODE0より小さい場合、実際の発生符号量(即ち、CODE)と上限値との間には余裕がある可能性が高い。そこで、閾値変更部601は、閾値Th0を大きくするように置換制御部301に対して指示する。その結果、Qpの置換が発生し難くなり、画質が向上する。   On the other hand, when CODE is smaller than CODE0, there is a high possibility that there is a margin between the actual generated code amount (that is, CODE) and the upper limit value. Therefore, the threshold value changing unit 601 instructs the replacement control unit 301 to increase the threshold value Th0. As a result, Qp substitution hardly occurs and the image quality is improved.

また、CODEがCODE0と同程度である場合、閾値変更部601は、閾値Th0を変更しない。   When CODE is approximately the same as CODE0, the threshold value changing unit 601 does not change the threshold value Th0.

上記の処理により、例えばSATD=1000の時のCODE0が200なのに対してCODE=250であればTh0は小さくなり、SATD=1000の時のCODE0が200なのに対してCODE=150であればThは大きくなる。また、SATD=1000の時のCODE0が200なのに対してCODE=205であればThは変化しない。   By the above processing, for example, if CODE = 250 when CODE0 is 200 when SATD = 1000, Th0 is small, and if CODE0 is 200 when SATD = 1000, Th is large. Become. Also, if CODE0 is 200 when SATD = 1000, and CODE = 205, Th does not change.

なお、ここで説明した閾値Th0の変更は、一例に過ぎない。閾値Th0を変更するということは、実質的には、指標値と下限値との対応関係を変更することを意味する。従って、本実施形態を一般化すると、CODE>CODE0の場合、より小さな指標値がより大きな下限値に対応するように指標値と下限値との対応関係が変化する。また、CODE<CODE0の場合、より大きな指標値がより小さな下限値に対応するように指標値と下限値との対応関係が変化する。これにより、発生符号量が上限値を超える可能性が低減され、画質が向上する。   Note that the change of the threshold Th0 described here is only an example. Changing the threshold Th0 substantially means changing the correspondence between the index value and the lower limit value. Therefore, when this embodiment is generalized, when CODE> CODE0, the correspondence relationship between the index value and the lower limit value changes so that the smaller index value corresponds to the larger lower limit value. When CODE <CODE0, the correspondence relationship between the index value and the lower limit value changes so that the larger index value corresponds to the smaller lower limit value. Thereby, the possibility that the generated code amount exceeds the upper limit is reduced, and the image quality is improved.

[第4の実施形態]
第4の実施形態では、量子化係数の下限値を設定する代わりに、符号化対象の差分情報の直流成分(DC成分)及び交流成分(AC成分)のうちの少なくとも一方を削減することにより、発生符号量が上限値を超える可能性を低減する。
[Fourth Embodiment]
In the fourth embodiment, instead of setting the lower limit value of the quantization coefficient, by reducing at least one of the DC component (DC component) and AC component (AC component) of the difference information to be encoded, The possibility that the generated code amount exceeds the upper limit is reduced.

図7は、第4の実施形態に係る撮像装置700の構成を示すブロック図である。図7において、第1の実施形態(図1参照)と同一又は同様の構成要素には同一の符号を付し、その説明を省略する。   FIG. 7 is a block diagram illustrating a configuration of an imaging apparatus 700 according to the fourth embodiment. In FIG. 7, the same or similar components as those in the first embodiment (see FIG. 1) are denoted by the same reference numerals, and description thereof is omitted.

撮像装置700は、撮像装置100の構成に加えて、最大符号量超過防止部701及びDC/AC成分切り捨て部702を備える。また、予測方法選択部105は、量子化制御部115の代わりに最大符号量超過防止部701に対して指標値(例えば、SATD)を送信する。また、量子化制御部115は、量子化部109に加えて最大符号量超過防止部701に対して量子化係数を通知する。   The imaging apparatus 700 includes a maximum code amount excess prevention unit 701 and a DC / AC component truncation unit 702 in addition to the configuration of the imaging apparatus 100. Also, the prediction method selection unit 105 transmits an index value (for example, SATD) to the maximum code amount excess prevention unit 701 instead of the quantization control unit 115. Further, the quantization control unit 115 notifies the quantization coefficient to the maximum code amount excess prevention unit 701 in addition to the quantization unit 109.

最大符号量超過防止部701は、複数の量子化係数の各々に対応するSATDの閾値(SATD0)を格納するテーブルを保持する。そして、最大符号量超過防止部701は、量子化制御部115から通知された量子化係数に対応するSATD0を識別し、予測方法選択部105から受信したSATDに関して下記の比較を行う。最大符号量超過防止部701は、比較結果に基づいて下記の通り決定したフラグをDC/AC成分切り捨て部702に通知する。   The maximum code amount excess prevention unit 701 maintains a table that stores a SATD threshold (SATD0) corresponding to each of a plurality of quantization coefficients. Then, the maximum code amount excess prevention unit 701 identifies SATD0 corresponding to the quantization coefficient notified from the quantization control unit 115, and performs the following comparison regarding the SATD received from the prediction method selection unit 105. Maximum code amount excess prevention unit 701 notifies DC / AC component truncation unit 702 of the flag determined as follows based on the comparison result.

(1)SATD0>SATDの時
フラグを立てない
(2)SATD0≦SATD<SATD0+αの時
フラグ1を立てる
(3)SATD0+α≦SATD<SATD0+βの時
フラグ2を立てる
(4)SATD0+β≦SATD<SATD0+γの時
フラグ3を立てる
(5)SATD0+γ≦SATDの時
フラグ4を立てる
なおα、β、γは自然数であり、α<β<γである。
(1) When SATD0> SATD, no flag is set (2) When SATD0 ≦ SATD <SATD0 + α, flag 1 is set (3) When SATD0 + α ≦ SATD <SATD0 + β, flag 2 is set (4) When SATD0 + β ≦ SATD <SATD0 + γ Set flag 3 (5) When SATD0 + γ ≦ SATD Set flag 4 Note that α, β, and γ are natural numbers, and α <β <γ.

DC/AC成分切り捨て部702は、周波数変換され量子化された差分情報(変換係数)を量子化部109から受信し、最大符号量超過防止部701から通知されたフラグに基づいて、下記の通り情報量の削減を行う。   The DC / AC component truncation unit 702 receives the difference information (transform coefficient) frequency-converted and quantized from the quantization unit 109, and based on the flag notified from the maximum code amount excess prevention unit 701, as follows. Reduce the amount of information.

(1)フラグが立っていない時
削減を行わない
(2)フラグ1が立っている時
色差のAC成分の一部をカットする
(3)フラグ2が立っている時
色差のAC成分及び輝度のAC成分の一部をカットする
(4)フラグ3が立っている時
色差のAC成分及びDC成分、及び輝度のAC成分の一部をカットする
(5)フラグ4が立っている時
色差のAC成分及びDC成分、及び輝度のAC成分及びDC成分の一部をカットする
(1) When the flag is not set No reduction is performed (2) When the flag 1 is set Cut a part of the AC component of the color difference (3) When the flag 2 is set The AC component and luminance of the color difference Cut a part of AC component (4) When flag 3 is set AC part and DC component of color difference and part of AC component of luminance are cut (5) When flag 4 is set AC of color difference Cut a part of the component and DC component, and the AC component and DC component of luminance.

AC/DC成分をカットすると、発生符号量が上限値を超える可能性は低下するが、画質は劣化する。そこで、本実施形態では、上記のようにカットするAC/DC成分に優先順位を設け、SATDに応じて、画質に与える影響が小さい成分から段階的にカットしていくことで、画質劣化を最小限に抑えつつ、発生符号量が上限値を超える可能性を低減する。即ち、フラグ1が立っている場合のようにSATDが比較的小さい場合は色差のAC成分のみをカットする。また、フラグ4が立っている場合のようにSATDが比較的大きい場合には色差のAC成分だけでなく色差のDC成分、輝度のAC成分、及び輝度のDC成分までカットする。   When the AC / DC component is cut, the possibility that the generated code amount exceeds the upper limit value decreases, but the image quality deteriorates. Therefore, in this embodiment, priority is given to the AC / DC component to be cut as described above, and image quality degradation is minimized by gradually cutting from the component that has little influence on the image quality according to SATD. The possibility that the generated code amount exceeds the upper limit value is reduced while limiting to the limit. That is, when the SATD is relatively small as in the case where the flag 1 is set, only the AC component of the color difference is cut. When the SATD is relatively large as in the case where the flag 4 is set, not only the color difference AC component but also the color difference DC component, the luminance AC component, and the luminance DC component are cut.

なお、上述の情報量の削減方法は、一例に過ぎない。一般化すると、本実施形態では、DC/AC成分切り捨て部702は、周波数変換された差分情報(変換係数)の直流成分及び交流成分のうちの少なくとも一方の情報量を削減する。その際に、DC/AC成分切り捨て部702は、指標値(例えば、SATD)が大きいほど多くの情報量を削減する。これにより、画質の低下を抑制しつつ、各マクロブロックの符号量が上限値を超える可能性が低減することができる。   Note that the information amount reduction method described above is merely an example. When generalized, in this embodiment, the DC / AC component truncation unit 702 reduces the information amount of at least one of the direct current component and the alternating current component of the frequency-converted difference information (conversion coefficient). At this time, the DC / AC component truncation unit 702 reduces the amount of information as the index value (eg, SATD) increases. As a result, it is possible to reduce the possibility that the code amount of each macroblock exceeds the upper limit value while suppressing the deterioration of the image quality.

なお、第1の実施形態と同様、指標値としてはSATDだけでなく、SADや分散などを使用することもできる。   As in the first embodiment, not only SATD but also SAD or variance can be used as an index value.

[その他の実施形態]
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
[Other Embodiments]
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

Claims (3)

第1の画像から符号化対象ブロックを取得する取得手段と、
前記第1の画像とは異なる第2の画像に基づき、前記符号化対象ブロックに対応する予測画像を生成する生成手段と、
前記符号化対象ブロックと前記予測画像との間の差分情報を計算する差分情報計算手段と、
前記差分情報の情報量の指標となる指標値を計算する指標値計算手段と、
前記指標値に対応する下限値を下回らないように量子化係数を決定する決定手段と、
前記決定された量子化係数を用いて前記差分情報を量子化する量子化手段と、
前記量子化された差分情報をエントロピー符号化する符号化手段
を有し、
前記指標値と前記下限値との対応関係は、前記指標値が所定の閾値以上である場合は、前記下限値が0より大きな値に対応付けられ、前記指標値が前記所定の閾値以上でない場合は、前記下限値が0に対応付けられる関係であり、
前記決定手段は、前記下限値を考慮せずに暫定的な量子化係数を決定し、前記暫定的な量子化係数が前記下限値を下回る場合に前記下限値を最終的な量子化係数として決定し、当該暫定的な量子化係数が前記下限値を下回らない場合に前記暫定的な量子化係数を最終的な量子化係数として決定し、
前記決定手段は、前記第1の画像から取得される符号化対象ブロックについて、前記下限値を最終的な量子化係数として決定した回数が所定回数を超える前後で、前記指標値と前記下限値との対応関係を変化させる
ことを特徴とする符号化装置。
Obtaining means for obtaining a block to be encoded from the first image;
Generating means for generating a predicted image corresponding to the encoding target block based on a second image different from the first image;
Difference information calculating means for calculating difference information between the encoding target block and the predicted image;
Index value calculating means for calculating an index value that is an index of the information amount of the difference information;
Determining means for determining a quantization coefficient so as not to fall below a lower limit corresponding to the index value;
Quantization means for quantizing the difference information using the determined quantization coefficient;
Encoding means for entropy encoding the quantized difference information ;
Have
The correspondence relationship between the index value and the lower limit value is that the lower limit value is associated with a value greater than 0 when the index value is greater than or equal to a predetermined threshold, and the index value is not greater than or equal to the predetermined threshold. Is a relationship in which the lower limit value is associated with 0,
The determining means determines a provisional quantization coefficient without considering the lower limit value, and determines the lower limit value as a final quantization coefficient when the provisional quantization coefficient falls below the lower limit value. And determining the provisional quantization coefficient as a final quantization coefficient when the provisional quantization coefficient does not fall below the lower limit value,
The determination means, for the encoding target block acquired from the first image, before and after the number of times when the lower limit value is determined as a final quantization coefficient exceeds a predetermined number of times, the index value and the lower limit value, An encoding device characterized by changing a correspondence relationship between the two .
前記決定手段は、前記生成手段が前記第1の画像のみに基づいて前記予測画像を生成したか否かに応じて、前記指標値と前記下限値との対応関係を変化させることを特徴とする請求項1に記載の符号化装置。 The determining unit changes a correspondence relationship between the index value and the lower limit value according to whether or not the generating unit has generated the predicted image based only on the first image. The encoding device according to claim 1. 前記符号化手段は、CABAC及びCAVLCを含む複数の符号化方式の中から選択された符号化方式により、前記量子化された差分情報をエントロピー符号化し、
前記決定手段は、前記選択された符号化方式に応じて前記指標値と前記下限値との対応関係を変化させることを特徴とする請求項1または2に記載の符号化装置。
The encoding means entropy encodes the quantized difference information by an encoding method selected from a plurality of encoding methods including CABAC and CAVLC,
It said determining means, the encoding apparatus according to claim 1 or 2, characterized in that changing the relationship between the lower limit value and the index value according to the selected coding scheme.
JP2011235309A 2011-10-26 2011-10-26 Encoder Expired - Fee Related JP5873290B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011235309A JP5873290B2 (en) 2011-10-26 2011-10-26 Encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011235309A JP5873290B2 (en) 2011-10-26 2011-10-26 Encoder

Publications (2)

Publication Number Publication Date
JP2013093774A JP2013093774A (en) 2013-05-16
JP5873290B2 true JP5873290B2 (en) 2016-03-01

Family

ID=48616562

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011235309A Expired - Fee Related JP5873290B2 (en) 2011-10-26 2011-10-26 Encoder

Country Status (1)

Country Link
JP (1) JP5873290B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10356405B2 (en) * 2013-11-04 2019-07-16 Integrated Device Technology, Inc. Methods and apparatuses for multi-pass adaptive quantization

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4769392B2 (en) * 2001-09-25 2011-09-07 キヤノン株式会社 Signal processing device
JP2007142637A (en) * 2005-11-16 2007-06-07 Matsushita Electric Ind Co Ltd Image information encoder
EP2169962A4 (en) * 2007-07-17 2012-04-11 Nippon Telegraph & Telephone Video encoding device and method, video encoding program, and recording medium containing the program
KR20120030537A (en) * 2009-06-19 2012-03-28 미쓰비시덴키 가부시키가이샤 Image encoding device, image decoding device, image encoding method, and image decoding method

Also Published As

Publication number Publication date
JP2013093774A (en) 2013-05-16

Similar Documents

Publication Publication Date Title
KR102165340B1 (en) Methods of determination for chroma quantization parameter and apparatuses for using the same
JP6508554B2 (en) Image processing apparatus and method, and program
JP5893002B2 (en) Rate control in video coding.
US8331449B2 (en) Fast encoding method and system using adaptive intra prediction
CN110460849B (en) System for video encoding
JP4927207B2 (en) Encoding method, decoding method and apparatus
US20190098310A1 (en) Adaptive skip or zero block detection combined with transform size decision
US20110090955A1 (en) Predictive Adaptive Scan Ordering for Video Coding
US20120027092A1 (en) Image processing device, system and method
JP2014520493A (en) Lossless coding and related signaling methods for composite video
JP2014082639A (en) Image encoder and method of the same
KR101924088B1 (en) Apparatus and method for video encoding and decoding using adaptive prediction block filtering
JP7343817B2 (en) Encoding device, encoding method, and encoding program
JP2013115583A (en) Moving image encoder, control method of the same, and program
JP5649296B2 (en) Image encoding device
US9930352B2 (en) Reducing noise in an intraframe appearance cycle
JP6253406B2 (en) Image encoding apparatus, imaging apparatus, image encoding method, and program
JP2009081830A (en) Encoding processing method and device in moving image compression encoding
JPWO2016194380A1 (en) Moving picture coding apparatus, moving picture coding method, and recording medium storing moving picture coding program
JP5873290B2 (en) Encoder
JP2008271213A (en) Image encoding device
JP6677230B2 (en) Video encoding device, video decoding device, video system, video encoding method, and video encoding program
KR101307406B1 (en) Encoding/decoding apparatus with reference frame compression
JP2011077721A (en) Image encoding device, image decoding device, image encoding method, and image decoding method
JP2008153802A (en) Moving picture encoding device and moving picture encoding program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141021

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150819

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150924

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151124

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: 20151218

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160115

R151 Written notification of patent or utility model registration

Ref document number: 5873290

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees