JP6966936B2 - Image coding device and its control method and program - Google Patents

Image coding device and its control method and program Download PDF

Info

Publication number
JP6966936B2
JP6966936B2 JP2017246403A JP2017246403A JP6966936B2 JP 6966936 B2 JP6966936 B2 JP 6966936B2 JP 2017246403 A JP2017246403 A JP 2017246403A JP 2017246403 A JP2017246403 A JP 2017246403A JP 6966936 B2 JP6966936 B2 JP 6966936B2
Authority
JP
Japan
Prior art keywords
code amount
region
target code
interest
frame
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
JP2017246403A
Other languages
Japanese (ja)
Other versions
JP2019114911A (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 JP2017246403A priority Critical patent/JP6966936B2/en
Publication of JP2019114911A publication Critical patent/JP2019114911A/en
Application granted granted Critical
Publication of JP6966936B2 publication Critical patent/JP6966936B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

本発明は画像データの符号化技術に関するものである。 The present invention relates to an image data coding technique.

現在、デジタルビデオカメラ等、動画像を記録するデジタルの撮像装置が普及しており、近年ではRAW画像を記録する方式が、静止画のみならず動画にも適用されている。RAW画像は記録に必要なデータ量が膨大になるものの、オリジナル画像に対する補正や劣化を最低限に抑えることができ、撮影後の画像編集の自由度が高い。そのため、RAW画像記録は、撮像装置を使用する者の中でも上級者によって好んで使われている。 Currently, digital image pickup devices for recording moving images such as digital video cameras have become widespread, and in recent years, a method for recording RAW images has been applied not only to still images but also to moving images. Although the amount of data required for recording a RAW image is enormous, correction and deterioration of the original image can be minimized, and the degree of freedom in image editing after shooting is high. Therefore, RAW image recording is preferred by advanced users among those who use image pickup devices.

RAW画像の動画記録時は、所定の記録媒体に一定時間の動画像が記録できるよう、データ量を所望の符号量へ圧縮する圧縮符号化が必要となる。RAW画像は、R, G, B 各色がモザイク状に配置されたベイヤー配列で構成される。ベイヤー配列における隣接する画素は、異なる色成分色のため、隣接画素間の相関が低い。故に、そのまま符号化しても高い圧縮効率を得ることは難しい。そこで、RAW画像から同じ色成分の画素のみを抜出して複数のプレーンを生成する。そして、プレーン毎に符号化を行うことで、プレーン内の画素間の相関を高めて圧縮効率を向上させる、プレーン変換技術が圧縮符号化の手法の一つとして一般的に利用される。 When recording a moving image of a RAW image, compression coding is required to compress the amount of data to a desired code amount so that a moving image for a certain period of time can be recorded on a predetermined recording medium. A RAW image is composed of a Bayer array in which each color of R, G, and B is arranged in a mosaic pattern. Since the adjacent pixels in the Bayer array have different color components, the correlation between the adjacent pixels is low. Therefore, it is difficult to obtain high compression efficiency even if it is encoded as it is. Therefore, only the pixels having the same color component are extracted from the RAW image to generate a plurality of planes. Then, a plane conversion technique that enhances the correlation between pixels in the plane and improves the compression efficiency by performing coding for each plane is generally used as one of the compression coding methods.

また、従来の代表的な圧縮符号化方式として、H.264(H.264/ MPEG-4 Part10 : Advanced Video Coding)が知られている。この圧縮符号化方式では、1フレーム内の所定画素数から成るブロック毎に、動画像が有する時間冗長性と空間冗長性を利用したデータ量の圧縮が行われる。 Further, H.264 (H.264 / MPEG-4 Part10: Advanced Video Coding) is known as a conventional typical compression coding method. In this compression coding method, the amount of data is compressed by utilizing the time redundancy and the spatial redundancy of the moving image for each block consisting of a predetermined number of pixels in one frame.

上記H.264では、時間冗長性に対する動き検出及び動き補償、空間冗長性に対する周波数変換として離散コサイン変換(Descrete Cosine Transform;DCT) 、更に量子化やエントロピー符号化といった技術を組み合わせることで圧縮符号化を実現している。ただし、ある程度以上圧縮率を上げると、DCT変換特有のブロック歪みが顕著になり、主観的に画像劣化が目立つようになる。 In the above H.264, motion detection and motion compensation for time redundancy, discrete cosine transform (DCT) as frequency conversion for spatial redundancy, and compression coding by combining technologies such as quantization and entropy coding. Has been realized. However, if the compression ratio is increased to some extent or more, the block distortion peculiar to the DCT transform becomes remarkable, and the image deterioration becomes noticeable subjectively.

そこで、水平及び垂直方向に低域と高域フィルタリングをそれぞれ適用し、サブバンドと呼ばれる周波数帯に分解する離散ウェーブレット変換(Discrete Wavelet Transform; DWT)を用いるサブバンド符号化技術がJPEG2000方式等で採用されている。このサブバンド符号化は、DCTを用いた符号化技術に比べ、ブロック歪みが生じにくく、高圧縮時の圧縮特性が良いといった特徴を有する。 Therefore, a subband coding technology that uses the Discrete Wavelet Transform (DWT), which applies low-frequency and high-frequency filtering in the horizontal and vertical directions and decomposes into frequency bands called subbands, has been adopted in the JPEG2000 system and the like. Has been done. Compared with the coding technique using DCT, this sub-band coding is characterized in that block distortion is less likely to occur and the compression characteristics at the time of high compression are good.

以上のような技術に加えて、所望の符号量へ符号量を圧縮するためには、圧縮符号化において符号量制御を行う。一般的な符号量制御は、符号化が完了しているフレームの情報を元に、次に符号化するフレームの目標符号量を決定する。そして、1フレームあたりの目標符号量へ発生符号量を収束させるため、符号量差分(発生符号量から目標符号量を減じることで算出される値)の絶対値が小さくなるように、量子化に利用する量子化パラメータQpを、画像の所定の単位毎に変更する量子化制御を行うことで符号量の制御を行う。量子化パラメータQpが大きい程、発生する符号量を少なくするできるものの、画質劣化の度合いが大きくなる。そのため、量子化パラメータQpは、可能な限り小さく、且つ、画面内で一定であることが望ましいパラメータと言うことができる。 In addition to the above techniques, in order to compress the code amount to a desired code amount, the code amount is controlled in the compression coding. In general code amount control, the target code amount of the frame to be coded next is determined based on the information of the frame for which coding is completed. Then, in order to converge the generated code amount to the target code amount per frame, the absolute value of the code amount difference (value calculated by subtracting the target code amount from the generated code amount) is quantized so as to be small. The amount of code is controlled by performing quantization control that changes the quantization parameter Qp to be used for each predetermined unit of the image. The larger the quantization parameter Qp, the smaller the amount of code generated, but the greater the degree of image quality deterioration. Therefore, it can be said that the quantization parameter Qp is preferably as small as possible and constant in the screen.

この量子化パラメータQpの値は、上述の各プレーンや、各サブバンド間で所定の比率にすることで画質を向上させることができる。例えば、プレーン変換により生成されたR, G, B各プレーンは、視覚的重要度が同等であるという観点から、同じQpであることが望ましく、更に、各サブバンド間のQpの関係は、高域サブバンドほど量子化パラメータを大きく設定することが望ましい。上述のサブバンド間のQp設定の関係式は、JPEG2000で暗示的な量子化としても規定されている。 The image quality can be improved by setting the value of this quantization parameter Qp to a predetermined ratio between each of the above-mentioned planes and each subband. For example, the R, G, and B planes generated by plane transformation should have the same Qp from the viewpoint of equal visual importance, and the Qp relationship between each subband is high. It is desirable to set the quantization parameter larger for the region subband. The above-mentioned relational expression of Qp setting between subbands is also specified as implicit quantization in JPEG2000.

一方で、上述の目標符号量は、画面に対して細かく設定するほどその制御性は高まる。例えば、画面の目標符号量だけでなく、画面を複数の領域の集合体とみなして、領域毎に目標符号量を設定し、各領域の符号化が完了する毎に未符号化領域へ符号化結果をフィードバックすることで、符号量の制御性は向上する。 On the other hand, the controllability of the above-mentioned target code amount increases as the target code amount is set more finely with respect to the screen. For example, not only the target code amount of the screen but also the screen is regarded as an aggregate of a plurality of areas, the target code amount is set for each area, and each time the coding of each area is completed, the uncoded area is coded. By feeding back the result, the controllability of the code amount is improved.

特許文献1には、符号化対象フレームの未符号化領域の符号量を、近接する符号化済みフレームにおける、該当フレームの符号化済み領域と未符号化領域に対応する領域の符号量の比率に基づいて、未符号化領域の符号量を推定することが開示されている。そして、特許文献1では、その推定量と割り当て可能符号量に基づき未符号化領域の量子化パラメータQpを決定することで、符号量制御性を向上させるとしている。 In Patent Document 1, the code amount of the uncoded area of the coded target frame is set to the ratio of the code amount of the coded area of the corresponding frame and the code amount of the area corresponding to the uncoded area in the adjacent coded frames. Based on this, it is disclosed to estimate the code amount in the uncoded region. Then, Patent Document 1 states that the code amount controllability is improved by determining the quantization parameter Qp of the uncoded region based on the estimated amount and the assignable code amount.

特開2012−253516号公報Japanese Unexamined Patent Publication No. 2012-253516

特許文献1によれば、未符号化領域の符号量を符号化済みフレームの符号化結果により予測して量子化パラメータQpを調整できるため、1フレーム当たりの発生符号量を精度高く目標符号量に近付けることができる。 According to Patent Document 1, since the code amount in the uncoded region can be predicted from the coding result of the coded frame and the quantization parameter Qp can be adjusted, the generated code amount per frame can be set to the target code amount with high accuracy. You can get closer.

しかしながら、特許文献1に記載された技術では、符号量制御性は向上するものの、画面内の量子化パラメータQpの関係が大きく乖離することが起こり得る。例えば、ラスタ順に符号化を実施する場合、画面下部の未符号化領域において、割り当て可能符号量が限りなく小さくなっていると、画面上部と比較し、画面下部の量子化パラメータQpは大きくなり、画面下部ほど画質が劣化したバランスの悪い画像になってしまう。 However, in the technique described in Patent Document 1, although the code amount controllability is improved, the relationship between the quantization parameters Qp in the screen may greatly deviate. For example, when coding is performed in raster order, if the amount of code that can be assigned is extremely small in the uncoded area at the bottom of the screen, the quantization parameter Qp at the bottom of the screen becomes larger than that at the top of the screen. The image quality deteriorates toward the bottom of the screen, resulting in an unbalanced image.

本発明はかかる問題に鑑みなされたものであり、目標符号量となるように、且つ、1フレームの画像において、領域毎の画質の差が発生しにくい符号化データを生成する技術を提供しようとするものである。 The present invention has been made in view of such a problem, and an object of the present invention is to provide a technique for generating coded data so as to have a target code amount and in which a difference in image quality for each region is unlikely to occur in a one-frame image. It is something to do.

この課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
撮像手段で撮像された動画像を符号化する画像符号化装置であって、
予め設定されたブロックを単位に、前記動画像におけるフレームが表す画像データを、設定された量子化パラメータを用いて量子化する量子化手段と、
該量子化手段の量子化で得られたデータを符号化する符号化手段と、
前記画像データが複数の領域で構成されるものとし、各領域に対して目標符号量を設定すると共に、前記複数の領域における着目領域の符号化データの符号量が当該着目領域の目標符号量となるように、前記ブロックを単位に前記量子化パラメータを更新する制御手段とを有し、
前記制御手段は、
符号化する着目フレームより前のフレームの各領域の符号量の比率に従ってフレーム目標符号量を分配することで、前記着目フレームの各領域の初期の目標符号量を設定する設定手段と、
前記着目領域の符号化を開始する場合、前記フレーム目標符号量のうち未消費となっている符号量残量と、前記着目領域及び当該着目領域に後続する領域それぞれの前記初期の目標符号量に基づいて、前記着目領域の前記目標符号量を補正する補正手段とを有することを特徴とする。
In order to solve this problem, for example, the image coding apparatus of the present invention has the following configuration. That is,
An image coding device that encodes a moving image captured by an imaging means.
A quantization means that quantizes the image data represented by the frame in the moving image using the set quantization parameters in units of preset blocks.
A coding means that encodes the data obtained by the quantization of the quantization means, and
It is assumed that the image data is composed of a plurality of regions, a target code amount is set for each region, and the code amount of the coded data of the region of interest in the plurality of regions is the target code amount of the region of interest. It has a control means for updating the quantization parameter in units of the block so as to be.
The control means is
A setting means for setting an initial target code amount for each region of the frame of interest by distributing the frame target code amount according to the ratio of the code amount of each region of the frame before the frame of interest to be encoded.
When the coding of the region of interest is started, the remaining amount of the unconsumed code amount in the frame target code amount and the initial target code amount of each of the region of interest and the region following the region of interest are set. Based on this, it is characterized by having a correction means for correcting the target code amount in the region of interest.

本発明によれば、目標符号量となるように、且つ、1フレームの画像において、領域毎の画質の差が発生しにくい符号化データを生成することが可能になる。 According to the present invention, it is possible to generate coded data so as to have a target code amount and in which a difference in image quality for each region is unlikely to occur in a one-frame image.

第1の実施形態に係る画像符号化装置の構成例を示すブロック図。The block diagram which shows the structural example of the image coding apparatus which concerns on 1st Embodiment. 第1の実施形態に係るベイヤー配列をRGBから成る4プレーンへ分離したときのプレーン形成図である。It is a plane formation figure when the Bayer array which concerns on 1st Embodiment is separated into 4 planes composed of RGB. 第1の実施形態に係る離散ウェーブレット変換(DWT)の垂直、水平フィルタリングをそれぞれ三回施した場合のサブバンド形成図。FIG. 3 is a subband formation diagram when vertical and horizontal filtering of the discrete wavelet transform (DWT) according to the first embodiment is performed three times each. 第1の実施形態に係る領域分割方法と、サブブロックにおける対応ブロックラインの関係を示す図。The figure which shows the relationship between the area division method which concerns on 1st Embodiment, and the corresponding block line in a subblock. 第1の実施形態に係るQp固定時の発生符号量に関する概念図。The conceptual diagram about the generated code amount at the time of fixing Qp which concerns on 1st Embodiment. 第1の実施形態に係る目標符号量算出部の処理フローチャート。The processing flowchart of the target code amount calculation part which concerns on 1st Embodiment. 第1の実施形態における各領域に設定する目標符号量を説明するための図。The figure for demonstrating the target code amount set in each area in 1st Embodiment. 第2の実施形態に係る第1の実施形態を適応した場合の、各領域目標符号量の算出結果を示す図。The figure which shows the calculation result of each area target code amount when the 1st embodiment which concerns on the 2nd Embodiment is applied. 第2の実施形態に係る画像符号化装置の構成例を示すブロック図。The block diagram which shows the structural example of the image coding apparatus which concerns on 2nd Embodiment. 第2の実施形態に係る目標符号量算出部の処理フローチャート。The processing flowchart of the target code amount calculation part which concerns on 2nd Embodiment. 第2の実施形態に係る第2の実施形態を適応した場合の、各領域目標符号量の算出結果を示す図The figure which shows the calculation result of each area target code amount when the 2nd Embodiment which concerns on the 2nd Embodiment is applied. 第2の実施形態に係る第2の実施形態を適応した場合の、各領域目標符号量の推移を示す図。The figure which shows the transition of each area target code amount at the time of applying 2nd Embodiment which concerns on 2nd Embodiment.

以下添付図面に従って本発明に係る実施形態を詳細に説明する。 Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

[第1の実施形態]
図1は、第1の実施形態に係る画像符号化装置の構成例を示すブロック図である。なお、実施形態の画像符号化装置はデジタルビデオカメラ等に代表される撮像装置に搭載されるものとして説明するが符号化対象のRAW動画像は記憶媒体に格納されていても良く、ネットワークからダウンロードしても構わず、RAW画像の発生源は特に問わない。すなわち、撮像装置はあくまで例示であるものと理解されたい。以下、図1における各構成要素について説明する。
[First Embodiment]
FIG. 1 is a block diagram showing a configuration example of an image coding device according to the first embodiment. Although the image coding device of the embodiment will be described as being mounted on an image pickup device typified by a digital video camera or the like, the RAW moving image to be encoded may be stored in a storage medium and downloaded from the network. However, the source of the RAW image is not particularly limited. That is, it should be understood that the image pickup apparatus is merely an example. Hereinafter, each component in FIG. 1 will be described.

[プレーン変換部]
プレーン変換部101は、不図示の撮像部で撮像してベイヤ配列のRAW画像データを入力し、複数のプレーン分離する。図2は、入力画像データであるベイヤー配列のRAW画像データにおけるRGB成分から、4プレーンへ分離したときのプレーン形成図である。ベイヤ配列における隣接する2×2画素に着目すると、1個の赤成分(R)、1個の青成分(B)、2個の緑成分(G1、G2)で構成される。プレーン変換部101は、RAW画像データから、R成分のみで構成されるRプレーン、G1成分のみで構成されるG1プレーン、G2成分のみで構成されるG2プレーン、B成分のみで構成されるBプレーンを分離する。なお、RAW画像データの水平方向画素数をW,垂直方向画素数をHと表すと、これら4つのプレーンは水平W/2画素、垂直H/2画素のサイズとなる。上記の結果、1つのプレーンに着目すると、隣接する画素間の相関が高くなり、圧縮効率の向上が容易になる。
[Plain converter]
The plane conversion unit 101 takes an image with an image pickup unit (not shown), inputs RAW image data of a Bayer array, and separates a plurality of planes. FIG. 2 is a plane formation diagram when the RGB components in the RAW image data of the Bayer array, which is the input image data, are separated into four planes. Focusing on the adjacent 2 × 2 pixels in the Bayer array, it is composed of one red component (R), one blue component (B), and two green components (G1, G2). From the RAW image data, the plane conversion unit 101 includes an R plane composed of only the R component, a G1 plane composed of only the G1 component, a G2 plane composed of only the G2 component, and a B plane composed of only the B component. To separate. When the number of horizontal pixels of the RAW image data is W and the number of vertical pixels is H, these four planes have the sizes of horizontal W / 2 pixels and vertical H / 2 pixels. As a result of the above, when focusing on one plane, the correlation between adjacent pixels becomes high, and it becomes easy to improve the compression efficiency.

[離散ウェーブレット変換(Discrete Wavelet Transform; DWT)部]
離散ウェーブレット変換部102は、プレーン変換部101から順次出力されるプレーンに対して周波数変換を行い、変換係数を生成する。
[Discrete Wavelet Transform (DWT) part]
The discrete wavelet transforming unit 102 performs frequency conversion on the planes sequentially output from the plane transforming unit 101, and generates conversion coefficients.

DWTは、一般に画像全体に対してフィルタリングを行うが、フィルタタップ数分の画素データがバッファメモリに溜まったタイミングで、垂直方向及び水平方向のフィルタリングを行うことが可能である。そのため、DWTをプレーンデータの1ライン単位に行い、更に生成された低域サブバンドLLに対して再帰的にDWTを適用することで、各サブバンドを並列に処理することが可能である。 The DWT generally filters the entire image, but it is possible to perform vertical and horizontal filtering at the timing when pixel data corresponding to the number of filter taps is accumulated in the buffer memory. Therefore, it is possible to process each subband in parallel by performing DWT in units of one line of plain data and recursively applying DWT to the generated low-frequency subband LL.

図3は、垂直、水平フィルタリング処理を1セットとするDWTを3回実行した場合に得られるサブバンド形成図である。図示において“L”,“H”はそれぞれ低域、高域を示し、その順序は、前側が水平フィルタリングを行った結果の帯域、後側が垂直フィルタリングを行った結果の帯域を示す。“Lv”の後の数字はDWTの分解レベルを示す。DWTを2回以上行う場合、1つ前の変換で得られた低域周波数帯域であるサブバンドLLが変換対象となる。それ故、DWTの実行回数を重ねるにしたがって、直前の変換のサブバンドの水平、垂直とも1/2のサイズとなっていく。また、この理由で、サブバンドLLは最終回のDWTで残るので、図示のように分解レベルを表す表記は行わないのが普通である。 FIG. 3 is a subband formation diagram obtained when DWT with a set of vertical and horizontal filtering processes is executed three times. In the figure, "L" and "H" indicate low frequencies and high frequencies, respectively, and the order thereof indicates the band resulting from horizontal filtering on the front side and the band resulting from vertical filtering on the rear side. The number after "Lv" indicates the decomposition level of DWT. When DWT is performed twice or more, the subband LL, which is the low frequency band obtained in the previous conversion, is the conversion target. Therefore, as the number of DWT executions increases, the size of the subband of the immediately preceding conversion becomes halved both horizontally and vertically. Further, for this reason, since the subband LL remains in the final DWT, it is usual not to indicate the decomposition level as shown in the figure.

なお、実施形態における離散プレーン変換部101は、符号化対象の着目フレーム(RAW画像)から生成された4つのプレーンを順にDWTを実行するが、処理時間短縮のために離散ウェーブレット変換部102を複数設けるようにしても良い。例えば、離散プレーン変換部101を2つ並列に設ける場合には、1つの場合と比較し、DWTに係る負担は1/2にとなり、変換に係る時間も1/2とすることができる。また、離散プレーン変換部101を並列に4つ設ける場合には、1つの場合と比較してDWTに係る時間を1/4とすることが可能である。 The discrete wavelet transforming unit 101 in the embodiment executes DWT in order for four planes generated from the frame of interest (RAW image) to be encoded, but a plurality of discrete wavelet transforming units 102 are used to shorten the processing time. It may be provided. For example, when two discrete plane conversion units 101 are provided in parallel, the burden on the DWT can be halved and the time on the conversion can be halved as compared with the case of one. Further, when four discrete plane conversion units 101 are provided in parallel, the time related to DWT can be reduced to 1/4 as compared with the case of one.

本実施形態では、離散ウェーブレット変換部102は各サブバンドで1ライン分の変換係数が生成される度に、各サブバンドの1ライン分の変換係数を順次量子化部103へ出力するものとして説明する。 In the present embodiment, it is assumed that the discrete wavelet transform unit 102 sequentially outputs the conversion coefficient for one line of each subband to the quantization unit 103 each time the conversion coefficient for one line is generated in each subband. do.

[量子化部]
量子化部103は、量子化制御部105で生成した量子化パラメータQpを利用し、変換係数を1係数毎に量子化する。なお、量子化パラメータQpは、その値が大きいほど、量子化後の値が小さくなって符号量の削減が可能になるものの、画質劣化が顕著になるパラメータである。また、4プレーンの変換係数の量子化はプレーン毎に行っても、全プレーンについて並列して行っても良いが、量子化部103は、各プレーンにおける同じサブバンド、同じ位置の変換係数を、共通な量子化パラメータQpで量子化し、その量子化結果を符号化部104に供給するものとする。
[Quantization unit]
The quantization unit 103 uses the quantization parameter Qp generated by the quantization control unit 105 to quantize the conversion coefficient for each coefficient. The quantization parameter Qp is a parameter in which the larger the value is, the smaller the value after quantization becomes and the amount of code can be reduced, but the deterioration of image quality becomes remarkable. Further, the conversion coefficients of the four planes may be quantized for each plane or in parallel for all planes, but the quantization unit 103 performs the conversion coefficients of the same subband and the same position in each plane. It is assumed that the quantum is quantized by the common quantization parameter Qp and the quantization result is supplied to the coding unit 104.

[符号化部]
符号化部104は、量子化部103による量子化後の各プレーンの変換係数をエントロピー符号化して符号化データを生成し、出力する。
[Code-coded part]
The coding unit 104 entropy-codes the conversion coefficient of each plane after the quantization by the quantization unit 103 to generate and output the coded data.

[初期設定]
初期目標符号量設定部111は、着目フレーム(着目RAW画像)を構成する複数の領域の符号化開始時の領域目標符号量を設定する(領域の分割に関しては後述する)。初期量子化値設定部112は、着目フレーム符号化開始時の量子化パラメータQpを設定する。なお、符号化開始時の各種設定値は、前のプレーンの符号化情報を元にフィードバック制御で算出することが一般的である。
[Initial setting]
The initial target code amount setting unit 111 sets the area target code amount at the start of coding of a plurality of regions constituting the frame of interest (the RAW image of interest) (the division of the region will be described later). The initial quantization value setting unit 112 sets the quantization parameter Qp at the start of coding of the frame of interest. It should be noted that various setting values at the start of coding are generally calculated by feedback control based on the coding information of the previous plane.

[量子化制御部]
次に、実施形態における量子化制御部105について説明する。量子化制御部105は、着目フレームの発生符号量が着目フレームの目標符号量に収束するように、量子化パラメータQpを制御する。
[Quantization control unit]
Next, the quantization control unit 105 in the embodiment will be described. The quantization control unit 105 controls the quantization parameter Qp so that the generated code amount of the frame of interest converges to the target code amount of the frame of interest.

実施形態では、1フレームのRAW画像から4つのプレーンを分離し、それぞれに対して離散ウェーブレット変換を行い、量子化、符号化が行われる。4つのプレーンについて量子化する際に用いる量子化パラメータQpは、サブバンドの種類が同じであれば共通であり、量子化パラメータQpの更新する位置も同じである。これは、着目フレーム(4プレーン分)の符号量に基づき、共通に用いる量子化パラメータQpを更新するからである。 In the embodiment, four planes are separated from one frame of RAW image, discrete wavelet transform is performed on each, and quantization and coding are performed. The quantization parameter Qp used for quantization for the four planes is the same as long as the subband type is the same, and the position where the quantization parameter Qp is updated is also the same. This is because the commonly used quantization parameter Qp is updated based on the code amount of the frame of interest (4 planes).

<制御単位>
図4は、量子化制御の量子化制御の単位を示す図である。図4を元に、前述した本実施形態の領域及びQpの制御単位を説明する。
<Control unit>
FIG. 4 is a diagram showing a unit of quantization control of quantization control. With reference to FIG. 4, the region of the present embodiment and the control unit of Qp described above will be described.

まず、本実施形態では、着目フレームを構成するR,G1、G2,Bプレーンそれぞれを図4(a)のように垂直方向を4等分する。なお、この分割数は特に制限はなく、4以外であっても構わない。そして、実施形態では、4領域それぞれに目標符号量を設定する。また、符号化済み領域の符号化結果を用いて後続する未符号化領域の目標符号量を算出する(詳細は後述する)。 First, in the present embodiment, each of the R, G1, G2, and B planes constituting the frame of interest is divided into four equal parts in the vertical direction as shown in FIG. 4A. The number of divisions is not particularly limited and may be other than 4. Then, in the embodiment, the target code amount is set in each of the four regions. In addition, the target code amount of the subsequent uncoded region is calculated using the coding result of the coded region (details will be described later).

次に、量子化パラメータQpの制御単位を説明する。前述のように、入力画像はベイヤー配列のRAW画像であり、プレーン分離部101で4プレーンに分離する。更に、各プレーンに対してDWTを施す。前述のように符号化単位をサブバンド毎のラインとしているが、量子化制御単位は、同一画素位置の各サブバンドの符号化結果の集合体とする。即ち、図4(b)に示すように、分解レベル3のサブバンド{Lv3HL,Lv3LH,Lv3HH}及びサブバンド{LL}の1ライン、分解レベル2のサブバンド{Lv2HL,Lv2LH,Lv3HH}の2ライン、分解レベル1のサブバンド{Lv1HL,Lv1LH,Lv1HH}の4ラインを、一回Qpによる制御単位とする。そして、この制御単位である各サブバンド内の対応する変換係数の集合を、以降ブロックラインと呼ぶ。 Next, the control unit of the quantization parameter Qp will be described. As described above, the input image is a RAW image of the Bayer array, and is separated into four planes by the plane separation unit 101. Further, DWT is applied to each plane. As described above, the coding unit is a line for each subband, but the quantization control unit is a set of coding results of each subband at the same pixel position. That is, as shown in FIG. 4 (b), one line of the decomposition level 3 subband {Lv3HL, Lv3LH, Lv3HH} and the subband {LL}, and the decomposition level 2 subband {Lv2HL, Lv2LH, Lv3HH} 2 The four lines of the line and the subband {Lv1HL, Lv1LH, Lv1HH} of decomposition level 1 are used as the control unit by Qp once. Then, the set of the corresponding conversion coefficients in each subband which is the control unit is hereinafter referred to as a block line.

なお、1ブロックラインは、入力フレームであるRAW画像の16ライン分に相当するため、上記4つの領域の境界を跨ぐ可能性があるが、本実施形態では領域内全ての符号化が完了したときに領域の更新を行うものとする。 Since one block line corresponds to 16 lines of the RAW image which is an input frame, there is a possibility of straddling the boundary of the above four regions, but in the present embodiment, when all the coding in the region is completed. The area shall be updated.

発生符号量保持部106は、符号化部104から通知される各ブロックラインを符号化した際の符号化データの符号量を保持する。 The generated code amount holding unit 106 holds the code amount of the coded data when each block line notified from the coded unit 104 is coded.

領域判定部109は、予め設定した領域の先頭のブロックラインの量子化パラメータQpを制御するタイミングかどうかを判定する。 The area determination unit 109 determines whether or not it is the timing to control the quantization parameter Qp of the block line at the head of the preset area.

目標符号量算出部110は、領域判定部109が領域の先頭ブロックラインのQpを制御するタイミングと判断した場合に、ブロックライン目標符号量を算出する。従って、各領域毎に目標符号量を算出し、同一領域では同一のブロックライン目標符号量を利用する。目標符号量算出方法の詳細は後述する。なお、領域の目標符号量から、その領域に含まれるブロックラインの個数に基づいて、ブロックライン目標符号量を算出しても構わない。 The target code amount calculation unit 110 calculates the block line target code amount when the area determination unit 109 determines that it is the timing to control the Qp of the head block line of the area. Therefore, the target code amount is calculated for each area, and the same blockline target code amount is used in the same area. The details of the target code amount calculation method will be described later. The block line target code amount may be calculated from the target code amount of the area based on the number of block lines included in the area.

差分算出部107は、ブロックライン毎に発生符号量と目標符号量の差分を算出し、差分の積算値である積算差分量を更に算出する。 The difference calculation unit 107 calculates the difference between the generated code amount and the target code amount for each block line, and further calculates the integrated difference amount which is the integrated value of the difference.

また、1つの領域の先頭ブロックラインのQpを制御するタイミングで、積算差分量は0に初期化する。これは、領域毎に生じた積算差分量を、未符号化領域へ分配するためである。分配方法に関しては後述する。 Further, the integrated difference amount is initialized to 0 at the timing of controlling the Qp of the head block line of one area. This is to distribute the integrated difference amount generated for each region to the uncoded region. The distribution method will be described later.

量子化値算出部108は、差分算出部107から通知される積算差分量に基づき、Qpを算出(更新)する。詳細は後述する。以上により符号量を制御する。 The quantized value calculation unit 108 calculates (updates) Qp based on the integrated difference amount notified from the difference calculation unit 107. Details will be described later. The code amount is controlled by the above.

[量子化値算出]
量子化パラメータ算出方法の一つに、MPEG2 Test Model 5に示された公知技術がある。Test Model 5によれば、初期量子化パラメータQiniと、着目画素ブロックが第i番目としたとき、先頭画素ブロックから第i−1番目までの各画素ブロックにおける符号量と1画素ブロック当たりの目標符号量の差の積算を表すΣE(i-1)から、次式(1)を用いて、着目画素ブロックの量子化パラメータQp[i]を算出する。
Qp[i] = Qini + r ×ΣE[i-1] …(1)
ここで、rは量子化パラメータの制御感度を示す。制御感度rは、大きいほど急峻にQpを変動させる一方、符号量の制御性が向上するパラメータである。
[Quantization value calculation]
As one of the methods for calculating the quantization parameter, there is a known technique shown in MPEG2 Test Model 5. According to Test Model 5, when the initial quantization parameter Qini and the pixel block of interest are the i-th, the code amount in each pixel block from the first pixel block to the i-1th and the target code per pixel block. From ΣE (i-1), which represents the integration of the difference in quantity, the quantization parameter Qp [i] of the pixel block of interest is calculated using the following equation (1).
Qp [i] = Qini + r × ΣE [i-1]… (1)
Here, r indicates the control sensitivity of the quantization parameter. The control sensitivity r is a parameter that improves the controllability of the code amount while the Qp fluctuates sharply as it is larger.

本実施形態では、4分割した各領域のブロックラインを符号化単位としているので、着目領域の着目ブロックラインの量子化パラメータQp[i]を、
Qp[i] = Qp_ref + r ×ΣE[i-1] …(2)
として算出することができる。
ここで、Qp_refは、領域0では初期量子化値設定部112で設定した初期量子化パラメータQp_iniであり、それ以外の領域では、直前領域の最終ブロックラインのQpである。
In the present embodiment, since the block line of each region divided into four is used as the coding unit, the quantization parameter Qp [i] of the block line of interest in the region of interest is set.
Qp [i] = Qp_ref + r × ΣE [i-1]… (2)
Can be calculated as.
Here, Qp_ref is the initial quantization parameter Qp_ini set by the initial quantization value setting unit 112 in the region 0, and is the Qp of the final block line in the immediately preceding region in the other regions.

実施形態では、ベイヤ配列のRAW画像をR、G1,G2,Bプレーンに分離している。各プレーンを識別するための値0、1、2、3を各プレーンに割り当て、この値を変数plとして表す。そして、色プレーンpの第i番目のブロックラインをBL(pl,i)と表す。そして、ブロックラインBL(pl,i)の符号量をC(BL(pl,i))とし、着目領域のブロックライン目標符号量をTCとしたとき、式(2)のΣE[i-1]は次式の意味を持つ。
ΣE[i-1]=ΣΣ{TC-C(BL(pl,k))}
ここで、ΣΣは、pl=0,1,2,3、及び、k=0,1,2,…,i-1の合算を表す。
In the embodiment, the RAW image of the Bayer array is separated into R, G1, G2, and B planes. Values 0, 1, 2, and 3 for identifying each plane are assigned to each plane, and this value is expressed as the variable pl. Then, the i-th block line of the color plane p is represented as BL (pl, i). Then, when the code amount of the block line BL (pl, i) is C (BL (pl, i)) and the block line target code amount of the region of interest is TC, ΣE [i-1] in Eq. (2). Has the meaning of the following equation.
ΣE [i-1] = ΣΣ {TC-C (BL (pl, k))}
Here, ΣΣ represents the sum of pl = 0,1,2,3 and k = 0,1,2, ..., I-1.

量子化値算出部108は、符号化対象のブロックラインに対する量子化パラメータQpを式(2)に従って算出し、その量子化パラメータQpを、実際の各サブバンドの量子化パラメータQp(Qp[pl][sb])に更に変換した上で量子化部103に通知する。なお、pl,sbはそれぞれ、該当プレーン、該当サブバンドを示す。量子化値算出部108は、式(3)に示すように、予め設定したプレーンやサブバンド毎に有するマトリクスmtxに、式(2)で決定したブロックラインの量子化パラメータQpを適用することで、サブバンドの量子化パラメータQp(Qp[pl][sb])を算出する。
Qp[pl][sb] = Qp[i] × mtx[pl][sb] …(3)
ここで、sbは、サブバンドの種類と分解レベルを特定する変数とする。
The quantization value calculation unit 108 calculates the quantization parameter Qp for the block line to be encoded according to the equation (2), and calculates the quantization parameter Qp as the actual quantization parameter Qp (Qp [pl]) of each subband. After further conversion to [sb]), the quantization unit 103 is notified. Note that pl and sb indicate the corresponding plane and the corresponding subband, respectively. As shown in Eq. (3), the quantization value calculation unit 108 applies the blockline quantization parameter Qp determined in Eq. (2) to the matrix mtx possessed for each of the preset planes and subbands. , Calculate the subband quantization parameter Qp (Qp [pl] [sb]).
Qp [pl] [sb] = Qp [i] × mtx [pl] [sb]… (3)
Here, sb is a variable that specifies the type of subband and the decomposition level.

一般的に、高周波域のサブバンドほどQpを大きく、低域のサブバンドほどQpを小さく設定し符号量制御を行うことで、人間の視覚特性上視認しづらい、画像データの高域成分ほど発生符号量を圧縮し、符号化効率を向上させる。そのため、マトリクスは、高域サブバンドほど量子化パラメータQpが大きく、低域サブバンドほど量子化パラメータQpが小さくなるように設定する。 Generally, by setting the Qp larger for the high frequency subband and the Qp smaller for the low frequency subband and controlling the code amount, it is difficult to see due to human visual characteristics, and the higher frequency component of the image data is generated. The amount of code is compressed and the coding efficiency is improved. Therefore, the matrix is set so that the higher subband has a larger quantization parameter Qp and the lower subband has a smaller quantization parameter Qp.

<初期目標符号量設定>
前述のように、画質観点では量子化パラメータQpの変動を極力小さくするほど望ましい。実現するためには、符号化難易度の高い領域ほど目標符号量を多く割り当て、符号化難易度の低い領域ほど目標符号量を小さく割り当てることが求められる。
<Initial target code amount setting>
As mentioned above, from the viewpoint of image quality, it is desirable to minimize the fluctuation of the quantization parameter Qp. In order to realize this, it is required to allocate a larger target code amount to a region having a higher coding difficulty level and to allocate a smaller target code amount to a region having a lower coding difficulty level.

図5に、量子化パラメータQp固定時の発生符号量に関する概念図を示す。図5は、1フレームの画像の下部になるにつれて難易度が大きくなっている例を示している。 FIG. 5 shows a conceptual diagram regarding the amount of code generated when the quantization parameter Qp is fixed. FIG. 5 shows an example in which the difficulty level increases toward the bottom of the image of one frame.

量子化パラメータQp固定のときに発生する符号量が図5のような関係にある場合、各領域の目標符号量を図5に示す発生符号量の比率で割り当てることで、量子化パラメータQpの画面内での変動を限りなく小さくすることができる。初期目標符号量設定部111では、上述の概念の下、符号化済みフレームの符号化結果に基づき、各領域の初期目標符号量を設定する。 When the code amount generated when the quantization parameter Qp is fixed has the relationship as shown in FIG. 5, the target code amount of each region is assigned by the ratio of the generated code amount shown in FIG. 5, and the screen of the quantization parameter Qp is displayed. The fluctuation within can be reduced as much as possible. Under the above concept, the initial target code amount setting unit 111 sets the initial target code amount of each region based on the coding result of the coded frame.

<目標符号量算出>
<処理フロー>
図6は、本実施形態における目標符号量算出部110の処理内容を示すフローチャートである。以下、同図を参照して、本実施形態の特徴である、目標符号量算出部110による目標符号量の算出方法について説明する。なお、目標符号量算出部110は、前述の通り、領域の先頭のQpを決定するタイミングでのみ駆動し、その領域のブロックライン目標符号量を算出する。
<Calculation of target code amount>
<Processing flow>
FIG. 6 is a flowchart showing the processing contents of the target code amount calculation unit 110 in the present embodiment. Hereinafter, a method of calculating the target code amount by the target code amount calculation unit 110, which is a feature of the present embodiment, will be described with reference to the figure. As described above, the target code amount calculation unit 110 is driven only at the timing of determining the Qp at the beginning of the region, and calculates the block line target code amount of the region.

S601にて、目標符号量算出部110は符号量残量を算出する。符号量残量とは、着目フレーム(RAW画像データ)のフレーム目標符号量から、符号化済みブロックラインの発生符号量の総和を減じた値である。フレーム目標符号量における未消費量ということもできる。 In S601, the target code amount calculation unit 110 calculates the remaining amount of code amount. The remaining code amount is a value obtained by subtracting the sum of the generated code amounts of the coded block lines from the frame target code amount of the frame of interest (RAW image data). It can also be said that the amount of unconsumed amount in the frame target code amount.

S602で、符号量残量が0以下であれば、目標符号量算出部110は符号量残量を0にクリップして以降の処理を実施する。なお、この処理は、目標符号量が負になることを避けるためのものである。 In S602, if the remaining amount of code amount is 0 or less, the target code amount calculation unit 110 clips the remaining amount of code amount to 0 and performs the subsequent processing. It should be noted that this process is for avoiding that the target code amount becomes negative.

S603で、目標符号量算出部110は領域目標符号量を算出する。領域目標符号量は、着目領域以降の各領域の初期の目標符号量の総和に対する、着目領域の初期の目標符号量の比を符号量残量に乗算した値として求めることができる。
着目領域の目標符号量=符号量残量×着目領域初期目標符号量/未符号化領域初期目標符号量総和
In S603, the target code amount calculation unit 110 calculates the area target code amount. The region target code amount can be obtained as a value obtained by multiplying the remaining amount of the code amount by the ratio of the initial target code amount of the region of interest to the sum of the initial target code amounts of each region after the region of interest.
Target code amount in the region of interest = remaining amount of code amount × initial target code amount in the region of interest / total initial target code amount in the uncoded region

S604で、目標符号量算出部110はブロックライン目標符号量を算出する。ブロックライン目標符号量は、領域目標符号量を着目領域に含まれるブロックラインの個数で除算して算出する。以上によりブロックライン目標符号量が決定する。 In S604, the target code amount calculation unit 110 calculates the block line target code amount. The block line target code amount is calculated by dividing the area target code amount by the number of block lines included in the region of interest. From the above, the block line target code amount is determined.

<効果>
図7(a)乃至(c)を用いて本実施形態における目標符号量算出方法の動作例を説明する。
<Effect>
An operation example of the target code amount calculation method in the present embodiment will be described with reference to FIGS. 7 (a) to 7 (c).

図7(a)乃至(c)では、図5と同様に初期目標符号量の比率が1:1:2:3の割合で設定され、この設定値で直前のフレームを符号化すれば、Qpの変動が限りなく抑え込める設定値であるとする。着目フレームにおいては、直前のフレームとの時間的な相関が高いため、上記の設定により、或る程度Qpの変動は抑えられる。故に、直前のフレームの各領域の符号量の比に基づき、着目フレームの各領域の初期目標符号量を求める。しかし、相関性が100%でない限り、Qpは変動し、各ブロックラインでは発生符号量と目標符号量の間に差分量が発生するため、各領域では積算差分量が生じることになる。 In FIGS. 7 (a) to 7 (c), the ratio of the initial target code amount is set at a ratio of 1: 1: 2: 3 as in FIG. 5, and if the immediately preceding frame is encoded with this set value, Qp It is assumed that the fluctuation of is a set value that can be suppressed as much as possible. Since the frame of interest has a high temporal correlation with the immediately preceding frame, the fluctuation of Qp can be suppressed to some extent by the above setting. Therefore, the initial target code amount of each region of the frame of interest is obtained based on the ratio of the code amount of each region of the immediately preceding frame. However, unless the correlation is 100%, Qp fluctuates and a difference amount is generated between the generated code amount and the target code amount in each block line, so that an integrated difference amount is generated in each region.

また、図7(a)乃至(c)は、領域1符号化開始時の領域目標符号量の一例を示しており、領域0において、領域0の初期領域目標符号量に対して2倍の発生符号量が生じた場合を示している。 Further, FIGS. 7A to 7C show an example of the region target code amount at the start of region 1 coding, and in region 0, the generation is twice as much as the initial region target code amount of region 0. The case where the code amount occurs is shown.

図7(a)に本実施形態を適応した場合の領域目標符号量の算出例を示しているが、比較のため、簡易的な領域目標符号量の再算出例を図7(b)、(c)に合わせて示す。 FIG. 7 (a) shows a calculation example of the region target code amount when the present embodiment is applied, but for comparison, a simple recalculation example of the region target code amount is shown in FIGS. 7 (b) and 7 (a). Shown according to c).

図7(b)は、領域0の積算差分量を領域1で回収する方法である。このように処理すると、領域1の目標符号量が十分に与えられないため、領域1のQpが急峻に大きくなり、画質劣化を引き起こす恐れがある。 FIG. 7B is a method of collecting the integrated difference amount in the region 0 in the region 1. When this process is performed, the target code amount of the region 1 is not sufficiently given, so that the Qp of the region 1 becomes steeply large, which may cause deterioration of the image quality.

次に図7(c)は、領域0の積算差分量を未符号化領域に等分配して回収する方法である。このように処理すると、初期目標符号量が小さい領域の目標符号量は当初の設定に対して割合的に大きく減少してしまうため、領域1のQpが急峻に大きくなり、同じく画質劣化を引き起こしてしまう。 Next, FIG. 7C is a method of equally distributing and recovering the integrated difference amount in the region 0 to the uncoded region. When processed in this way, the target code amount in the region where the initial target code amount is small decreases relatively significantly with respect to the initial setting, so that the Qp in the region 1 sharply increases, which also causes image quality deterioration. It ends up.

一方、本実施形態で実施する目標符号量算出方法を適用すると、図7(a)のように領域0の積算差分量を後続の領域に初期目標符号量の割合である、領域1:領域2:領域3=1:2:3で割り当てられるため、領域1の符号化開始時の領域目標符号量は、領域1:領域2:領域3=1:2:3となり、前フレームとの相関性が高い場合にQpの変動を画面内で限りなく抑え込める目標符号量の比率を保つことができる。 On the other hand, when the target code amount calculation method implemented in the present embodiment is applied, as shown in FIG. 7A, the integrated difference amount in the area 0 is the ratio of the initial target code amount to the subsequent area, that is, area 1: area 2. : Since it is allocated in region 3 = 1: 2: 3, the region target code amount at the start of coding in region 1 is region 1: region 2: region 3 = 1: 2: 3, which correlates with the previous frame. When is high, the ratio of the target code amount that can suppress the fluctuation of Qp in the screen as much as possible can be maintained.

なお、図6のフローチャートの通り処理を行えば、領域2以降の符号化開始時においても図7(a)で示した領域0の積算差分量の分配と同様に、直前の符号化済み領域の積算差分量を未符号化領域の初期目標符号量の比率で分配する相当の領域目標符号量が算出されるため、未符号化領域の目標符号量は、符号量残量が0にならない限り、常に初期目標符号量の比率を維持することができる。 If the processing is performed according to the flowchart of FIG. 6, even at the start of coding in the region 2 and subsequent regions, the immediately preceding encoded region can be distributed in the same manner as the distribution of the integrated difference amount in the region 0 shown in FIG. 7 (a). Since a considerable area target code amount for distributing the integrated difference amount by the ratio of the initial target code amount in the uncoded area is calculated, the target code amount in the uncoded area is the target code amount in the uncoded area unless the remaining amount of the code amount becomes 0. The ratio of the initial target code amount can always be maintained.

なお、各領域の積算差分量を未符号化領域に分配しない方法も選択肢の一つに考えられる。この場合、Qpの変化は緩やかになる可能性もあるが、符号量制御性では第1の実施形態で示す方法に対し著しく低下するため、比較対象としていない。 A method of not distributing the integrated difference amount of each region to the uncoded region is also considered as one of the options. In this case, the change in Qp may be gradual, but the code amount controllability is significantly lower than that shown in the first embodiment, and is not included in the comparison.

以上のように、領域の符号化が完了する度に、積算差分量を初期目標符号量の比率で未符号化領域に割り振り、領域目標符号量を算出することで、符号量制御性を保ちつつ画質を向上することができる。 As described above, each time the coding of the region is completed, the integrated difference amount is allocated to the uncoded region at the ratio of the initial target code amount, and the region target code amount is calculated to maintain the code amount controllability. Image quality can be improved.

なお、プレーン変換やDWTを施さない場合も本実施形態の範疇であり、その場合、プレーン変換部は入力画像をスルーで後段に通し、DWT分解レベルが0とみなすことに相当する。また、実施形態ではDWTの回数(分解数)を3として説明したが、回数に制限は無く、例えば4回もしくはそれ以上であっても構わない。また、入力する画像の領域分割数も特に制限はなく、分割数は2以上の複数であれば適用できる。また、量子化制御単位はこの限りではなく、ラインを更に水平に分割することや、各ブロックラインに含まれるサブバンドが、ブロックライン毎に異なることも、本実施形態の範疇である。 It should be noted that the case where plane conversion or DWT is not performed is also within the scope of this embodiment, and in that case, the plane conversion unit passes the input image through to the subsequent stage, and corresponds to the case where the DWT decomposition level is regarded as 0. Further, in the embodiment, the number of DWTs (number of decompositions) has been described as 3, but the number of times is not limited, and may be, for example, 4 times or more. Further, the number of area divisions of the image to be input is not particularly limited, and can be applied as long as the number of divisions is two or more. Further, the quantization control unit is not limited to this, and it is also a category of this embodiment that the line is further divided horizontally and the subband included in each block line is different for each block line.

また、プレーン変換は、べイヤーRAW画像の各色要素であるR,G1,G2,Bへ分離せずとも、R,G1,G2,B各色要素を利用して、輝度情報、色差情報などから成る複数プレーンへ変換することも本実施例の範疇である。その場合、輝度プレーンの量子化パラメータは、色差プレーンよりも小さい値となるように式(3)に示すMtxを設定することで、人間の視覚特性上劣化が視認しやすい輝度成分の画質を保護することも本実施例の範疇である。 In addition, the plane conversion consists of luminance information, color difference information, etc. using each color element of R, G1, G2, B without separating into R, G1, G2, B, which are each color element of the Bayer RAW image. Converting to multiple planes is also a category of this embodiment. In that case, by setting Mtx shown in Eq. (3) so that the quantization parameter of the luminance plane is smaller than that of the color difference plane, the image quality of the luminance component that is easily deteriorated due to human visual characteristics is protected. Doing is also a category of this embodiment.

[第2の実施形態]
次に第2の実施形態を説明する。第1の実施形態と異なる点は、未符号化領域で生じるであろう、発生符号量と目標符号量の間の統計的な差分量を加味し、着目領域の目標符号量を決定する点である。
[Second Embodiment]
Next, the second embodiment will be described. The difference from the first embodiment is that the target code amount in the region of interest is determined by taking into account the statistical difference between the generated code amount and the target code amount that will occur in the uncoded region. be.

図8に、第1の実施形態で示した目標符号量算出方法を利用した際の、最終領域符号化時に確定する各領域目標符号量の算出結果の一例を示す。 FIG. 8 shows an example of the calculation result of each region target code amount determined at the time of final region coding when the target code amount calculation method shown in the first embodiment is used.

本第1の実施形態では、先頭領域から順に、積算差分量を未符号化領域に割り振るため、後続の領域ほど積算差分量の分配量が多い。図8の場合、積算差分量が積み上がることで、後続の領域ほど画質が劣化していく可能性が高くなる。 In the first embodiment, since the integrated difference amount is allocated to the uncoded region in order from the head region, the distribution amount of the integrated difference amount is larger in the subsequent regions. In the case of FIG. 8, there is a high possibility that the image quality deteriorates in the subsequent area due to the accumulation of the accumulated difference amount.

そこで、本第2の実施形態では、後続の領域の積算差分量と前方の領域の積算差分量の積み上がり易さを平準化することで、画質劣化を抑制する。 Therefore, in the second embodiment, deterioration of image quality is suppressed by leveling the stackability of the integrated difference amount in the succeeding region and the integrated difference amount in the front region.

<構成>
本第2の実施形態のブロック構成図を図9に示す。図示において、参照符号100〜112は、第1の実施形態の構成(図1)と同じである。見込み差分量設定部913は、直前フレームにおいて各領域で発生した積算差分量を見込み差分量として目標符号量算出部に設定する。このため、見込み差分量設定部913は、着目フレームの符号化が完了したタイミングで、次に符号化することになるフレームに備えて見込み差分量を決定する。
<Structure>
FIG. 9 shows a block configuration diagram of the second embodiment. In the illustration, reference numerals 100 to 112 are the same as the configuration of the first embodiment (FIG. 1). The expected difference amount setting unit 913 sets the integrated difference amount generated in each region in the immediately preceding frame as the estimated difference amount in the target code amount calculation unit. Therefore, the expected difference amount setting unit 913 determines the expected difference amount in preparation for the next frame to be encoded at the timing when the coding of the frame of interest is completed.

<目標符号量算出>
<処理フロー>
図10は、本第2の実施形態における目標符号量算出部110のフローチャートである。以下、同図を参照して、本第2の実施形態の特徴である、目標符号量の算出方法について説明する。
<Calculation of target code amount>
<Processing flow>
FIG. 10 is a flowchart of the target code amount calculation unit 110 in the second embodiment. Hereinafter, a method of calculating the target code amount, which is a feature of the second embodiment, will be described with reference to the figure.

なお、目標符号量算出部110は、前述の通り、領域の先頭のQpを決定するタイミングでのみ駆動し、その領域の目標符号量を算出する。 As described above, the target code amount calculation unit 110 is driven only at the timing of determining the Qp at the beginning of the region, and calculates the target code amount of the region.

S1001にて、目標符号量算出部110は着目フレームの符号量残量を算出する。 In S1001, the target code amount calculation unit 110 calculates the remaining amount of code amount of the frame of interest.

S1002にて、目標符号量算出部110は、符号化済み領域の積算差分量積算量と符号化済み領域の積算差分量との差分絶対値と、予め設定した閾値Errthとを比較する。差分絶対値が閾値Errthより小さい場合、目標符号量算出部110は処理をS1003に進め、そうでなければ、S1004に処理を進める。 In S1002, the target code amount calculation unit 110 compares the absolute difference value between the integrated difference amount integrated amount in the coded area and the integrated difference amount in the coded area with the preset threshold value Errth. If the difference absolute value is smaller than the threshold value Errth, the target code amount calculation unit 110 advances the processing to S1003, and if not, advances the processing to S1004.

S1003にて、目標符号量算出部110は、有効残量を、符号量残量−未符号化領域見込み差分量積算量とする。 In S1003, the target code amount calculation unit 110 sets the effective remaining amount as the code amount remaining amount-uncoded region expected difference amount integrated amount.

S1004にて、目標符号量算出部110は、有効残量を符号量残量とする。 In S1004, the target code amount calculation unit 110 sets the effective remaining amount as the code amount remaining amount.

S1005にて、目標符号量算出部110は有効残量が0以下であれば、有効残量を0にクリップして以降の処理を実施する。この処理は、目標符号量が負になることを避けるためである。 In S1005, if the effective remaining amount is 0 or less, the target code amount calculation unit 110 clips the effective remaining amount to 0 and performs the subsequent processing. This process is to prevent the target code amount from becoming negative.

S1006で、目標符号量算出部110は、着目領域の領域目標符号量を算出する。領域目標符号量は、有効残量×着目領域初期目標符号量/未符号化領域初期目標符号量総和により算出する。 In S1006, the target code amount calculation unit 110 calculates the area target code amount of the region of interest. The area target code amount is calculated by multiplying the effective remaining amount by the total of the initial target code amount of the region of interest / the initial target code amount of the uncoded area.

S1007にて、目標符号量算出部110は、着目領域の領域目標符号量を着目領域に含まれるブロックライン数で除算することで、着目領域のブロックライン目標符号量を決定する。 In S1007, the target code amount calculation unit 110 determines the block line target code amount of the region of interest by dividing the region target code amount of the region of interest by the number of block lines included in the region of interest.

<効果>
図11を参照して、本第2の実施形態における目標符号量算出方法の動作例を説明する。同図では、直前フレームが図9と同様の符号化結果であった場合に、着目フレームがどのように各領域の目標符号量を設定するかを示している。なお、直前フレームでは、初期目標符号量が100:100:200:300(フレーム目標符号量が700)、各領域の積算差分量が、100,100,100,0であったとする。
<Effect>
An operation example of the target code amount calculation method in the second embodiment will be described with reference to FIG. The figure shows how the frame of interest sets the target code amount in each region when the immediately preceding frame has the same coding result as in FIG. In the immediately preceding frame, it is assumed that the initial target code amount is 100: 100: 200: 300 (frame target code amount is 700) and the integrated difference amount of each region is 100,100,100,0.

また、図11は、符号化済み領域の積算差分量積算量と符号化済み領域の積算差分量との差分絶対値が、予め設定した閾値Errthよりも小さい場合を示している。Errthよりも大きい場合は、第1の実施形態と同様の処理となる。 Further, FIG. 11 shows a case where the integrated difference absolute value between the integrated difference amount integrated amount in the coded region and the integrated difference amount in the coded region is smaller than the preset threshold value Errth. If it is larger than Errth, the process is the same as that of the first embodiment.

図12は、図11の条件における各領域目標符号量が決定する過程を示している。なお、一般に、時間的に隣接する2フレーム間の相関性は高いため、直前フレームの各領域の積算差分量は、着目フレームの各領域の積算差分量に近似する可能性が高い。そこで、本実施形態では簡単のため直前フレームと着目フレームの領域毎の積算差分量が等しい場合を想定していることに注意されたい。 FIG. 12 shows a process of determining each region target code amount under the conditions of FIG. In general, since the correlation between two temporally adjacent frames is high, it is highly possible that the integrated difference amount in each region of the immediately preceding frame is close to the integrated difference amount in each region of the frame of interest. Therefore, it should be noted that in this embodiment, for the sake of simplicity, it is assumed that the integrated difference amount for each region of the immediately preceding frame and the frame of interest is equal.

領域0では初期目標符号量である100が領域目標符号量として設定され、発生符号量が200となっている。領域1以降の見込み差分量積算量は200であるため、有効残量は、300となる。そして、領域目標符号量は、有効残量×領域1初期目標符号量/未符号化領域初期目標符号量総和により、50と確定する。 In region 0, the initial target code amount of 100 is set as the region target code amount, and the generated code amount is 200. Since the estimated difference amount integrated amount after the area 1 is 200, the effective remaining amount is 300. Then, the area target code amount is determined to be 50 by the sum of the effective remaining amount × the area 1 initial target code amount / the uncoded area initial target code amount.

領域2以降も同様に計算することで、各領域目標符号量は、領域1:領域2:領域3 = 50:100:150と確定し、各領域の目標符号量は、有効残量が0にならない限り、初期目標符号量の比率に近い関係を維持することができる。なお、図11, 図12のように直前フレームと着目フレームの初期領域目標符号量及び領域毎の積算差分量が等しい場合は、各領域で積算差分量が発生しても、初期目標符号量の比率に等しい比率で領域1以降の各領域の目標符号量を設定可能である。 By calculating the area 2 and subsequent areas in the same way, the target code amount for each area is determined as area 1: area 2: area 3 = 50: 100: 150, and the effective remaining amount of the target code amount for each area is 0. As long as it does not, the relationship close to the ratio of the initial target code amount can be maintained. When the initial area target code amount of the immediately preceding frame and the frame of interest and the integrated difference amount for each area are equal as in FIGS. 11 and 12, even if the integrated difference amount is generated in each area, the initial target code amount is The target code amount for each region after region 1 can be set at a ratio equal to the ratio.

以上のように、領域の符号化が完了する度に、符号量見込み差分量を初期目標符号量の比率で未符号化領域に割り振り、領域目標符号量を算出することで、符号量制御性を保ちつつ、特に後続の領域の画質を向上することができる。 As described above, each time the coding of the region is completed, the code amount expected difference amount is allocated to the uncoded region at the ratio of the initial target code amount, and the region target code amount is calculated to improve the code amount controllability. It is possible to improve the image quality of the subsequent area in particular while maintaining the image quality.

なお、設定する見込み差分量は、必ずしも直前の符号化結果を利用する必要はない。符号化済みの複数のフレームで生じた積算差分量の平均を取ることで、画像間の相関度が低い場合でも統計的に目標符号量を補正することが可能である。例えば、直前5フレームの各領域の積算差分量を、領域毎に平均化した値を見込み差分量として設定することも、本実施形態の範疇である。 It should be noted that the expected difference amount to be set does not necessarily have to use the immediately preceding coding result. By taking the average of the integrated difference amounts generated in a plurality of encoded frames, it is possible to statistically correct the target code amount even when the degree of correlation between the images is low. For example, it is also a category of the present embodiment to set a value obtained by averaging the integrated difference amount of each area of the immediately preceding 5 frames for each area as the expected difference amount.

以上、各実施形態について詳述したが、特定の実施形態に限定されるものではなく、特許請求の範囲に記載された範囲内において、種々の変形及び変更が可能である。また、前述した実施形態の構成要素を全部又は複数を組み合わせることも可能である。 Although each embodiment has been described in detail above, the present invention is not limited to a specific embodiment, and various modifications and changes can be made within the scope of the claims. It is also possible to combine all or a plurality of the components of the above-described embodiment.

(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

101…プレーン変換部、102…離散ウェーブレット変換部、103…量子化部、104…符号化部、105…量子化制御部、106…発生符号量保持部、107…差分算出部、108…量子化値算出部、109…領域判定部、110…目標符号量算出部、111…初期目標符号量設定部、112…初期量子化値設定部、913…見込み差分量設定部 101 ... plane conversion unit, 102 ... discrete wavelet conversion unit, 103 ... quantization unit, 104 ... coding unit, 105 ... quantization control unit, 106 ... generated code amount holding unit, 107 ... difference calculation unit, 108 ... quantization unit. Value calculation unit, 109 ... Area determination unit, 110 ... Target code amount calculation unit, 111 ... Initial target code amount setting unit, 112 ... Initial quantized value setting unit, 913 ... Expected difference amount setting unit

Claims (8)

撮像手段で撮像された動画像を符号化する画像符号化装置であって、
予め設定されたブロックを単位に、前記動画像におけるフレームが表す画像データを、設定された量子化パラメータを用いて量子化する量子化手段と、
該量子化手段の量子化で得られたデータを符号化する符号化手段と、
前記画像データが複数の領域で構成されるものとし、各領域に対して目標符号量を設定すると共に、前記複数の領域における着目領域の符号化データの符号量が当該着目領域の目標符号量となるように、前記ブロックを単位に前記量子化パラメータを更新する制御手段とを有し、
前記制御手段は、
符号化する着目フレームより前のフレームの各領域の符号量の比率に従ってフレーム目標符号量を分配することで、前記着目フレームの各領域の初期の目標符号量を設定する設定手段と、
前記着目領域の符号化を開始する場合、前記フレーム目標符号量のうち未消費となっている符号量残量と、前記着目領域及び当該着目領域に後続する領域それぞれの前記初期の目標符号量に基づいて、前記着目領域の前記目標符号量を補正する補正手段とを有する
ことを特徴とする画像符号化装置。
An image coding device that encodes a moving image captured by an imaging means.
A quantization means that quantizes the image data represented by the frame in the moving image using the set quantization parameters in units of preset blocks.
A coding means that encodes the data obtained by the quantization of the quantization means, and
It is assumed that the image data is composed of a plurality of regions, a target code amount is set for each region, and the code amount of the coded data of the region of interest in the plurality of regions is the target code amount of the region of interest. It has a control means for updating the quantization parameter in units of the block so as to be.
The control means is
A setting means for setting an initial target code amount for each region of the frame of interest by distributing the frame target code amount according to the ratio of the code amount of each region of the frame before the frame of interest to be encoded.
When the coding of the region of interest is started, the remaining amount of the unconsumed code amount in the frame target code amount and the initial target code amount of each of the region of interest and the region following the region of interest are set. Based on this, an image coding device comprising a correction means for correcting the target code amount in the region of interest.
前記補正手段は、前記符号量残量に、前記着目領域以降の各領域の前記初期の目標符号量の総和に対する前記着目領域の前記初期の目標符号量の比を乗じた値を、前記着目領域の目標符号量する
ことを特徴とする請求項1に記載の画像符号化装置。
The correction means multiplies the remaining amount of the code amount by the ratio of the initial target code amount of the area of interest to the total sum of the initial target code amounts of each area after the area of interest. The image coding apparatus according to claim 1, wherein the target code amount is measured.
前記制御手段は、
前記着目フレームより前のフレームの前記着目領域に対応する領域以降に分配された、目標符号量と実際の符号量との差の積算量が、前記着目フレームにおける前記着目領域以降にも発生するものと推定して、前記符号量残量を算出する算出手段を更に有する
ことを特徴とする請求項1又は2に記載の画像符号化装置。
The control means is
The integrated amount of the difference between the target code amount and the actual code amount distributed after the region corresponding to the region of interest in the frame prior to the frame of interest also occurs after the region of interest in the frame of interest. The image coding apparatus according to claim 1 or 2, further comprising a calculation means for calculating the remaining amount of the code amount.
前記動画像におけるフレームが表す画像データを周波数変換し、変換係数を生成する変換手段を更に有し、
前記量子化手段は、前記変換係数を、予め設定されたブロックを単位に量子化することを特徴とする請求項1乃至3のいずれか1項に記載の画像符号化装置。
Further, it has a conversion means for frequency-converting the image data represented by the frame in the moving image and generating a conversion coefficient.
The image coding apparatus according to any one of claims 1 to 3, wherein the quantization means quantizes the conversion coefficient in units of preset blocks.
前記撮像手段から供給されたベイヤ配列の画像データを複数のプレーンに分離する分離手段を更に有し、
前記変換手段は、各プレーンについて予め設定された分解レベルまでウェーブレット変換を実行し、
前記量子化手段は、各プレーンから得た同じ種類のサブバンド内の同じ位置の変換係数に対しては、共通な量子化パラメータを用いて量子化する
ことを特徴とする請求項4に記載の画像符号化装置。
Further having a separation means for separating the image data of the Bayer array supplied from the image pickup means into a plurality of planes.
The transform means performs a wavelet transform to a preset resolution level for each plane.
The fourth aspect of claim 4, wherein the quantization means quantizes a conversion coefficient at the same position in a subband of the same type obtained from each plane using a common quantization parameter. Image encoder.
前記分離手段は、R成分のみのプレーン、G1成分のみのプレーン、G2成分のみのプレーン、及び、B成分のみのプレーンに分離することを特徴とする請求項5に記載の画像符号化装置。 The image coding apparatus according to claim 5, wherein the separation means separates into a plane having only an R component, a plane having only a G1 component, a plane having only a G2 component, and a plane having only a B component. 撮像手段で撮像された動画像を符号化する画像符号化装置の制御方法であって、
予め設定されたブロックを単位に、前記動画像におけるフレームが表す画像データを、設定された量子化パラメータを用いて量子化する量子化工程と、
該量子化工程の量子化で得られたデータを符号化する符号化工程と、
前記画像データが複数の領域で構成されるものとし、各領域に対して目標符号量を設定すると共に、前記複数の領域における着目領域の符号化データの符号量が当該着目領域の目標符号量となるように、前記ブロックを単位に前記量子化パラメータを更新する制御工程とを有し、
前記制御工程は、
符号化する着目フレームより前のフレームの各領域の符号量の比率に従ってフレーム目標符号量を分配することで、前記着目フレームの各領域の初期の目標符号量を設定する設定工程と、
前記着目領域の符号化を開始する場合、前記フレーム目標符号量のうち未消費となっている符号量残量と、前記着目領域及び当該着目領域に後続する領域それぞれの前記初期の目標符号量に基づいて、前記着目領域の前記目標符号量を補正する補正工程とを有する
ことを特徴とする画像符号化装置の制御方法。
It is a control method of an image coding device that encodes a moving image captured by an imaging means.
A quantization step in which the image data represented by the frame in the moving image is quantized using the set quantization parameters in units of preset blocks.
A coding step that encodes the data obtained by the quantization of the quantization step, and
It is assumed that the image data is composed of a plurality of regions, a target code amount is set for each region, and the code amount of the coded data of the region of interest in the plurality of regions is the target code amount of the region of interest. It has a control step of updating the quantization parameter in units of the block so as to be.
The control step is
A setting step of setting an initial target code amount of each region of the frame of interest by distributing the frame target code amount according to the ratio of the code amount of each region of the frame before the frame of interest to be encoded.
When the coding of the region of interest is started, the remaining amount of the unconsumed code amount in the frame target code amount and the initial target code amount of each of the region of interest and the region following the region of interest are set. Based on this, a control method for an image coding apparatus, which comprises a correction step of correcting the target code amount in the region of interest.
コンピュータが読み込み実行することで、前記コンピュータに、請求項7に記載の方法の各工程を実行させるためのプログラム。 A program for causing the computer to execute each step of the method according to claim 7, which is read and executed by the computer.
JP2017246403A 2017-12-22 2017-12-22 Image coding device and its control method and program Active JP6966936B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017246403A JP6966936B2 (en) 2017-12-22 2017-12-22 Image coding device and its control method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017246403A JP6966936B2 (en) 2017-12-22 2017-12-22 Image coding device and its control method and program

Publications (2)

Publication Number Publication Date
JP2019114911A JP2019114911A (en) 2019-07-11
JP6966936B2 true JP6966936B2 (en) 2021-11-17

Family

ID=67223870

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017246403A Active JP6966936B2 (en) 2017-12-22 2017-12-22 Image coding device and its control method and program

Country Status (1)

Country Link
JP (1) JP6966936B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114424549B (en) * 2019-10-31 2024-06-11 株式会社索思未来 Moving image encoding method, encoding processing method, moving image encoding device, and encoding processing device

Also Published As

Publication number Publication date
JP2019114911A (en) 2019-07-11

Similar Documents

Publication Publication Date Title
JP5180294B2 (en) Buffer-based rate control that utilizes frame complexity, buffer level, and intra-frame location in video encoding
JP4111351B2 (en) Apparatus and method for optimizing rate control in a coding system
CN112913237A (en) Artificial intelligence encoding and decoding method and apparatus using deep neural network
JP7015183B2 (en) Image coding device and its control method and program
WO1999003279A1 (en) Apparatus and method for object based rate control in a coding system
EP1012778A1 (en) Apparatus and method for macroblock based rate control in a coding system
JPH0595536A (en) High efficiency coded signal processor
JP2008527827A (en) Method of processing a video signal using a quantization step size dynamically based on normal flow
JP6857973B2 (en) Image coding device and its control method
CN112840650B (en) Artificial Intelligence (AI) encoding apparatus and operating method thereof, and AI decoding apparatus and operating method thereof
US10776956B2 (en) Image coding apparatus, image decoding apparatus, image coding method, image decoding method, and non-transitory computer-readable storage medium
US10897615B2 (en) Image encoding apparatus and control method therefor
JP2017216630A5 (en)
US7616825B2 (en) Method for compression of image data and corresponding apparatus and computer-program product
JP6966936B2 (en) Image coding device and its control method and program
JP6806466B2 (en) Image coding device and its control method
JP2007028598A (en) Compression coding apparatus and compression coding method
US20230133895A1 (en) Image encoding apparatus and method for controlling the same and non-transitory computer-readable storage medium
US20190387228A1 (en) Image encoding apparatus, image decoding apparatus, control methods thereof, and non-transitory computer-readable storage medium
JP2020058017A (en) Image processing method and system
JP3902948B2 (en) Video encoding device
JPH07203430A (en) Image coding device
JP6916618B2 (en) Image coding device and its control method and program
US20190110051A1 (en) Coding apparatus capable of recording raw image, control method therefor, and storage medium storing control program therefor
JP2004056677A (en) Device and method for encoding picture information

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201112

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20210103

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210113

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210915

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211022

R151 Written notification of patent or utility model registration

Ref document number: 6966936

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151