JP2022116923A - Moving image encoding device and moving image encoding method - Google Patents

Moving image encoding device and moving image encoding method Download PDF

Info

Publication number
JP2022116923A
JP2022116923A JP2021013351A JP2021013351A JP2022116923A JP 2022116923 A JP2022116923 A JP 2022116923A JP 2021013351 A JP2021013351 A JP 2021013351A JP 2021013351 A JP2021013351 A JP 2021013351A JP 2022116923 A JP2022116923 A JP 2022116923A
Authority
JP
Japan
Prior art keywords
image
encoding
color difference
amount
buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2021013351A
Other languages
Japanese (ja)
Inventor
克彦 東
Katsuhiko Azuma
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 JP2021013351A priority Critical patent/JP2022116923A/en
Publication of JP2022116923A publication Critical patent/JP2022116923A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

To provide a moving image encoding device and a moving image encoding method capable of suppressing image quality degradation while avoiding buffer failure.SOLUTION: The moving image encoding device is for encoding a moving image configured by an image composed of one luminance component and two color difference components. The moving image encoding device includes an encoding amount control unit for controlling whether to encode and output both two color difference components or to encode and output only one of the two color difference components in accordance with whether a used amount of a decoder buffer model is below a predetermined amount.SELECTED DRAWING: Figure 2

Description

本発明は、動画像符号化装置および動画像符号化方法に関する。 The present invention relates to a video encoding device and video encoding method.

動画像を圧縮して符号化する動画像符号化に関する技術が用いられている。動画像符号化に関する国際標準規格としては、H.264/AVC(Advanced Video Coding)、H.265/HEVC(High Efficiency Video Coding)といった規格が策定されている。上述した符号化方式では、デコーダが持つ符号化データを一時的に蓄積するためのバッファ量が規定されている。エンコーダには、符号化の際にデコーダのバッファが破綻しないようにストリームを生成することが求められている。そこで、エンコーダは、デコーダのバッファを仮想的に再現した仮想バッファを用いて、デコーダのバッファの破綻を回避することを回避したストリームを生成している。 2. Description of the Related Art Techniques related to moving image encoding for compressing and encoding moving images are used. International standards for video coding include H.264/AVC (Advanced Video Coding) and H.265/HEVC (High Efficiency Video Coding). In the encoding method described above, the buffer capacity for temporarily storing encoded data held by the decoder is specified. An encoder is required to generate a stream so that the decoder's buffer does not collapse during encoding. Therefore, the encoder uses a virtual buffer that virtually reproduces the buffer of the decoder to generate a stream that avoids the collapse of the buffer of the decoder.

図1は、仮想バッファにおける符号データの占有の度合いの一例を示すグラフである。図1におけるMAXは仮想バッファの占有量の最大値を示す、MINは仮想バッファの占有量の最小値を示す。図1のグラフで、時刻T0、T1、T2、T3で、1ピクチャ分の符号データが仮想バッファから読み出されることで、バッファ占有量が減少する。仮想バッファの占用量が最大値MAXを超えた場合、オーバーフローが発生し、仮想バッファは破綻する。仮想バッファの占用量が最小値MINを下回った場合、アンダーフローが発生し、仮想バッファは破綻する。 FIG. 1 is a graph showing an example of the degree of occupancy of code data in a virtual buffer. MAX in FIG. 1 indicates the maximum value of the virtual buffer occupancy, and MIN indicates the minimum value of the virtual buffer occupancy. In the graph of FIG. 1, at times T0, T1, T2, and T3, the coded data for one picture is read from the virtual buffer, thereby reducing the buffer occupancy. If the virtual buffer occupancy exceeds the maximum value MAX, an overflow occurs and the virtual buffer fails. If the virtual buffer occupancy falls below the minimum value MIN, an underflow will occur and the virtual buffer will collapse.

図1の時刻Tnにおいて、アンダーフローが発生している。符号化が行われる際には、目標符号量が設定され、仮想バッファが破綻しないような発生符号量が調整される。しかしながら、絵柄が複雑な映像でシーンチェンジが高い頻度で発生する場合等においては、アンダーフローが生じやすくなる。アンダーフローが生じると、デコーダへの符号データの供給が間に合わなくなることに起因して、画像をデコードできなくなる。 At time Tn in FIG. 1, an underflow occurs. When encoding is performed, a target code amount is set, and the generated code amount is adjusted so as not to cause the virtual buffer to collapse. However, underflow is more likely to occur in cases such as when scene changes occur frequently in video with complex patterns. When an underflow occurs, the image cannot be decoded because the coded data cannot be supplied to the decoder in time.

以上のような仮想バッファの破綻が生じることを抑制するために、仮想バッファの占有量を監視し、アンダーフローが発生することを抑制するエンコーダが実装されている。関連する技術として、特許文献1の技術が提案されている。特許文献1の技術では、DCT係数のうち全交流(AC)成分をゼロでマスクし、直流(DC)成分のみを残している。また、JCCR(Joint Coding of Chrominance Residuals)に関する技術が非特許文献1で提案されている。JCCRは、色差成分のデータサイズの削減において、次世代の国際標準化規格のH.266/VVC(Versatile Video Coding)で策定されている。JCCRを用いることにより、色差成分UとVとのうちの片方のみを符号化することができる。 In order to prevent the virtual buffer from failing as described above, an encoder is implemented that monitors the occupancy of the virtual buffer and suppresses the occurrence of underflow. As a related technique, the technique of Patent Document 1 has been proposed. In the technique of Patent Document 1, all alternating current (AC) components of the DCT coefficients are masked with zero, leaving only direct current (DC) components. Also, Non-Patent Document 1 proposes a technology related to JCCR (Joint Coding of Chrominance Residuals). JCCR is defined by H.266/VVC (Versatile Video Coding), which is a next-generation international standardization standard, for reducing the data size of color difference components. By using JCCR, only one of the chrominance components U and V can be encoded.

特許第4532980号Patent No. 4532980

JVET-S2001 Versatile Video Coding (Draft 10)JVET-S2001 Versatile Video Coding (Draft 10)

バッファの破綻を回避するために、輝度や色差の高域成分をカットして、符号化するデータ量を削減することが考えられる。しかしながら、輝度や色差の高域成分をカットすると、オブジェクトの輪郭の色が滲む等の画質の劣化を生じる。一方、画質の劣化を回避するために符号化するデータ量の削減を行わない場合、バッファ破綻を生じる可能性が高くなる。 In order to avoid buffer failure, it is conceivable to reduce the amount of data to be encoded by cutting high-frequency components of luminance and color difference. However, when high-frequency components of luminance and color difference are cut, the image quality deteriorates, such as blurring of the color of the outline of the object. On the other hand, if the amount of data to be encoded is not reduced in order to avoid deterioration of image quality, the possibility of buffer failure increases.

そこで、本発明は、バッファ破綻の回避を行うとともに画質の劣化を抑制することを目的とする。 SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to avoid buffer failure and suppress deterioration of image quality.

上記目的を達成するために、本発明の動画像符号化装置は、1つの輝度成分と2つの色差成分とからなる画像により構成される動画像を符号化する動画像符号化装置であって、デコーダのバッファモデルの使用量が所定量を下回っているかに応じて、前記2つの色差成分の両方を符号化して出力するか、または前記2つの色差成分のうち何れか一方のみを符号化して出力するかを制御する制御手段、を備えることを特徴とする。 In order to achieve the above object, a moving picture coding apparatus of the present invention is a moving picture coding apparatus for coding a moving picture composed of an image consisting of one luminance component and two color difference components, encoding and outputting both of the two chrominance components, or encoding and outputting only one of the two chrominance components, depending on whether the amount of usage of the buffer model of the decoder is below a predetermined amount; and a control means for controlling whether to

本発明によれば、バッファ破綻の回避を行うとともに画質の劣化を抑制することができる。 ADVANTAGE OF THE INVENTION According to this invention, while avoiding buffer failure, deterioration of an image quality can be suppressed.

仮想バッファにおける符号データの占有の度合いの一例を示すグラフである。7 is a graph showing an example of the degree of occupancy of code data in a virtual buffer; デジタルカメラの構成の一例を示す図である。It is a figure which shows an example of a structure of a digital camera. 仮想バッファのバッファ占有量を例示するグラフである。4 is a graph illustrating buffer occupancy of virtual buffers; 第1実施形態の符号化処理の流れの一例を示すフローチャートである。4 is a flowchart showing an example of the flow of encoding processing according to the first embodiment; 動画像符号化における画像間の参照関係の一例を示す図である。It is a figure which shows an example of the reference relationship between the images in moving image coding. 第2実施形態の符号化処理の流れの一例を示すフローチャートである。9 is a flowchart showing an example of the flow of encoding processing according to the second embodiment; 第3実施形態の符号化処理の流れの一例を示すフローチャートである。FIG. 11 is a flowchart showing an example of the flow of encoding processing according to the third embodiment; FIG.

以下、本発明の各実施形態について図面を参照しながら詳細に説明する。しかしながら、以下の各実施形態に記載されている構成はあくまで例示に過ぎず、本発明の範囲は各実施形態に記載されている構成によって限定されることはない。 Hereinafter, each embodiment of the present invention will be described in detail with reference to the drawings. However, the configurations described in each embodiment below are merely examples, and the scope of the present invention is not limited by the configurations described in each embodiment.

<第1実施形態>
図2は、デジタルカメラ200の構成の一例を示す図である。図2の構成は、各実施形態で共通である。デジタルカメラ200は、本実施形態に係る動画像符号化装置(画像符号化回路)を有する電子機器の一例である。電子機器は、デジタルカメラ等の撮像装置には限定されず、例えば、スマートフォンやパーソナルコンピュータ等に適用可能である。図2のデジタルカメラ200は、レンズ201、撮像部202、現像処理部203、画像符号化回路204および制御部206を含む。また、デジタルカメラ200は、表示部や操作部、電源部等のデジタルカメラの一般的な構成を有している。
<First Embodiment>
FIG. 2 is a diagram showing an example of the configuration of the digital camera 200. As shown in FIG. The configuration of FIG. 2 is common to each embodiment. A digital camera 200 is an example of an electronic device having a video encoding device (image encoding circuit) according to this embodiment. Electronic devices are not limited to imaging devices such as digital cameras, and can be applied to smart phones, personal computers, and the like, for example. Digital camera 200 in FIG. Also, the digital camera 200 has a general configuration of a digital camera, such as a display section, an operation section, and a power supply section.

レンズ201は、被写体の光学像を撮像部202の撮像面に形成する撮像光学系を構成するレンズである。撮像部202は、撮像面に形成された光学像を、複数の画素を含む撮像素子により光電変換し、画像を表す電気信号(画像信号)を生成する。撮像部202は、生成した画像信号をA/D変換し、画像データとして現像処理部203に供給する。現像処理部203は、ノイズ除去や色補間(デモザイク)、欠陥画素補正、ホワイトバランス調整、手振れ補正、周辺光量補正、ガンマ補正、色調補正、拡大縮小、YUV形式への色変換等のうち予め定められた画像処理を画像データに施す。現像処理部203は、被写体検出やレンズ201のオートフォーカス制御や、自動露出制御に用いる評価値の生成等の一般的なデジタルカメラが行う各種の処理を実行できる。現像処理部203は、画像処理後に、YUV形式に変換した画像データを画像符号化回路204に供給する。 A lens 201 is a lens that constitutes an imaging optical system that forms an optical image of a subject on an imaging surface of an imaging unit 202 . The imaging unit 202 photoelectrically converts an optical image formed on an imaging surface by an imaging element including a plurality of pixels to generate an electric signal (image signal) representing an image. The imaging unit 202 A/D-converts the generated image signal and supplies it as image data to the development processing unit 203 . The development processing unit 203 performs predetermined processing such as noise removal, color interpolation (demosaicing), defective pixel correction, white balance adjustment, camera shake correction, peripheral light amount correction, gamma correction, color tone correction, scaling, color conversion to YUV format, and the like. image processing is applied to the image data. A development processing unit 203 can execute various types of processing performed by a general digital camera, such as subject detection, autofocus control of the lens 201, and generation of evaluation values used for automatic exposure control. After the image processing, the development processing unit 203 supplies the image data converted into the YUV format to the image encoding circuit 204 .

画像符号化回路204は、YUV形式の画像データを予め定められた方式で符号化し、データ量を削減した符号化データを生成する。画像符号化回路204は、例えばASICやFPGAなどのハードウェア回路により実現される。画像符号化回路204は、動画像符号化装置に対応する。画像符号化回路204は、符号化データを格納する記録ファイルを生成し、半導体メモリカード等の記録メディア205に記録する(出力する)。制御部206は、1つ以上のCPUやRAM、ROMを有する。例えば、ROMには、プログラムや各種の設定値、GUIデータ等が格納される。CPUは、ROMからプログラムを読み出して、メモリのワークエリアに展開して、展開されたプログラムを実行する。これにより、CPUは、各部の動作を制御する。 The image encoding circuit 204 encodes YUV format image data by a predetermined method to generate encoded data with a reduced data amount. The image encoding circuit 204 is implemented by a hardware circuit such as ASIC or FPGA. The image encoding circuit 204 corresponds to a moving image encoding device. The image encoding circuit 204 generates a recording file for storing encoded data, and records (outputs) it in a recording medium 205 such as a semiconductor memory card. The control unit 206 has one or more CPUs, RAMs, and ROMs. For example, the ROM stores programs, various setting values, GUI data, and the like. The CPU reads the program from the ROM, develops it in the work area of the memory, and executes the developed program. Thereby, the CPU controls the operation of each unit.

次に、画像符号化回路204について説明する。フレームバッファ207は、現像処理部203から送られてきたYUV形式の画像データを格納する。格納された画像データは、ブロック分割部208に送られる。フレームバッファ207は、デブロッキングフィルタ部218から送られてくるローカルデコード画像を格納する。格納されたローカルデコード画像は、予測部209および補償部217に送られる。フレームバッファ207は、DRAM等で構成されているものとする。ブロック分割部208は、必要とするブロックサイズの画素データを、フレームバッファ207に格納された画像データから切り出して読み出し、内部の一時記録メモリに保存する。ブロック分割部208は、一時記録メモリ内に記録したブロック画素データを、予測部209に送る。一時記録メモリはSRAM等で構成されているものとする。 Next, the image encoding circuit 204 will be explained. A frame buffer 207 stores YUV format image data sent from the development processing unit 203 . The stored image data is sent to the block dividing unit 208 . A frame buffer 207 stores the locally decoded image sent from the deblocking filter unit 218 . The stored locally decoded image is sent to prediction section 209 and compensation section 217 . It is assumed that the frame buffer 207 is composed of a DRAM or the like. The block division unit 208 extracts and reads pixel data of a required block size from the image data stored in the frame buffer 207, and stores it in an internal temporary recording memory. The block division unit 208 sends the block pixel data recorded in the temporary recording memory to the prediction unit 209 . It is assumed that the temporary recording memory is composed of an SRAM or the like.

予測部209は、ブロック分割部208から送られてきたブロックサイズの画素データに対して、予測に基づき生成される予測画素データとの差分を取り、差分データを直交変換部210に送るとともに、予測情報を補償部217に送る。本実施形態の予測としては、ブロック周辺の画素値に基づく画面内予測、またはカレントフレーム(符号化対象フレーム)とは異なる時刻のフレームに基づく画面間予測が適用される。予測部209は、H.266/VVCで規定された予測を用いて画面内予測および画面間予測を行うとともに、H.266/VVCで規定された予測情報を補償部217に送る。予測部209が行う予測は、H.266/VVCには限定されない。また、予測部209は、画面内予測を行う場合には、ブロック周辺のローカルデコード画素をフレームバッファ207から読み出す。予測部209は、画面間予測を行う場合には、カレントフレームとは異なる時刻のフレームのローカルデコード画素をフレームバッファ207から読み出す。 The prediction unit 209 finds the difference between the pixel data of the block size sent from the block division unit 208 and the predicted pixel data generated based on the prediction, sends the difference data to the orthogonal transformation unit 210, and performs prediction. The information is sent to compensator 217 . As prediction in this embodiment, intra-frame prediction based on pixel values around the block or inter-frame prediction based on a frame at a time different from the current frame (encoding target frame) is applied. The prediction unit 209 performs intra-frame prediction and inter-frame prediction using prediction defined by H.266/VVC, and sends prediction information defined by H.266/VVC to the compensation unit 217 . The prediction performed by the prediction unit 209 is not limited to H.266/VVC. Also, the prediction unit 209 reads local decoded pixels around the block from the frame buffer 207 when performing intra-frame prediction. When performing inter-frame prediction, the prediction unit 209 reads from the frame buffer 207 local decoded pixels of a frame at a time different from that of the current frame.

直交変換部210は、上記の差分データに対して直交変換(例えば、離散コサイン変換)を適用して変換係数を生成し、変換係数を量子化部211に出力する。量子化部211は、量子化制御部212が出力するブロックごとの量子化ステップサイズ(または量子化パラメータ)に従い、変換係数を量子化する。量子化部211は、量子化した変換係数を、符号化データ作成のために可変長符号化部214に出力するとともに、ローカルデコード画像作成のために逆量子化部215にも出力する。 The orthogonal transform section 210 applies orthogonal transform (for example, discrete cosine transform) to the difference data to generate transform coefficients, and outputs the transform coefficients to the quantization section 211 . The quantization section 211 quantizes the transform coefficients according to the quantization step size (or quantization parameter) for each block output by the quantization control section 212 . The quantization unit 211 outputs the quantized transform coefficients to the variable-length coding unit 214 for generating encoded data, and also outputs them to the inverse quantization unit 215 for generating a local decoded image.

量子化制御部212は、可変長符号化部214から送られてくる直前に処理したブロックの発生符号量と、符号量制御部213が設定した目標符号量からブロックごとの量子化ステップサイズを決定し、量子化部211に出力する。符号量制御部213は、デコーダのバッファを仮想化した仮想バッファ(バッファモデル)に基づいて目標符号量を算出し、量子化制御部212に設定する。符号量制御部213は、制御手段に対応する。画像符号化回路204のうち符号量制御部213以外の他の要素も制御手段に対応する場合もある。また、符号量制御部213は、画像を符号化するごとに仮想バッファへの符号データの入出力をシミュレートしながら符号量の制御を行う。そして、符号量制御部213は、仮想バッファの破綻を予測した場合、補償部217とストリーム生成部219とに破綻回避命令を送る。 The quantization control unit 212 determines the quantization step size for each block from the generated code amount of the block processed immediately before sent from the variable length encoding unit 214 and the target code amount set by the code amount control unit 213. and output to quantization section 211 . The code amount control unit 213 calculates a target code amount based on a virtual buffer (buffer model) obtained by virtualizing the buffer of the decoder, and sets the target code amount in the quantization control unit 212 . The code amount control unit 213 corresponds to control means. Elements other than the code amount control unit 213 in the image encoding circuit 204 may also correspond to the control means. Further, the code amount control unit 213 controls the code amount while simulating input/output of code data to the virtual buffer each time an image is encoded. When the code amount control unit 213 predicts a virtual buffer failure, it sends a failure avoidance command to the compensating unit 217 and the stream generating unit 219 .

ここで、仮想バッファへの符号データの入出力とバッファ占有量との関係について説明する。図3は、仮想バッファのバッファ占有量(バッファの使用量)を例示するグラフである。図3(A)は、画像(画像#0~#5)ごとの符号データサイズを棒グラフで示している。図3(A)の各画像の棒グラフは、輝度成分(Y)と2つの色差成分(U/V)とで分割されている。棒グラフで示したサイズのデータが、実際に仮想バッファに入力され、またデコード時間に基づき仮想バッファから出力される。量子化制御部212は、破綻回避処理を行う際に、JCCRを適用して色差成分Vを破棄する。このため、色差成分Vの分だけ仮想バッファへの入出力のデータサイズが小さくなる。量子化制御部212は、破綻回避処理を行う際に、JCCRを適用して色差成分Uを破棄してもよい。この場合、色差成分Uの分だけ仮想バッファへの入出力のデータサイズが小さくなる。 Here, the relationship between the input/output of code data to/from the virtual buffer and the buffer occupancy will be described. FIG. 3 is a graph illustrating buffer occupancy (buffer usage) of virtual buffers. FIG. 3A shows a bar graph of the encoded data size for each image (images #0 to #5). The bar graph of each image in FIG. 3A is divided into a luminance component (Y) and two color difference components (U/V). Data of the size indicated by the bar graph is actually input to the virtual buffer and output from the virtual buffer based on the decoding time. The quantization control unit 212 discards the color difference component V by applying JCCR when performing the corruption avoidance process. Therefore, the size of data input/output to/from the virtual buffer is reduced by the amount of the color difference component V. FIG. The quantization control unit 212 may discard the color difference component U by applying JCCR when performing the corruption avoidance process. In this case, the size of data input/output to/from the virtual buffer is reduced by the color difference component U. FIG.

図3(B)は、破綻回避処理を行わない場合の仮想バッファの入出力関係を示している。符号化処理時において、符号量制御部213は、図3(B)のグラフで示すような仮想バッファへの符号データの入出力をシミュレートしながら符号量の制御を行う。仮想バッファには、画像#0から#2までの符号データが入力される。このため、画像#0から画像#2の符号データの分だけ仮想バッファのバッファ占有量が増大する。仮想バッファへの画像#2の入力が終了したタイミングで、画像#0のデコード時刻T0として、仮想バッファから画像#0の符号データが出力される。このため、仮想バッファから、画像#0の分だけ符号データの占有量が減少する。 FIG. 3B shows the input/output relationship of the virtual buffer when the corruption prevention process is not performed. During the encoding process, the code amount control unit 213 controls the code amount while simulating input/output of code data to and from the virtual buffer as shown in the graph of FIG. 3(B). Coded data of images #0 to #2 are input to the virtual buffer. For this reason, the buffer occupancy of the virtual buffer increases by the coded data of image #0 to image #2. At the timing when the input of image #2 to the virtual buffer ends, the code data of image #0 is output from the virtual buffer as the decoding time T0 of image #0. For this reason, the occupied amount of encoded data is reduced from the virtual buffer by the amount of image #0.

デコード時刻T0から、画像#1のデコード時刻T1までの時間で、画像#3の符号データが仮想バッファに入力される。ここで、仮想バッファへの符号データの入力速度は固定速度であるとする。この場合、画像#3の符号データは、画像#1のデコード時刻T1の時点では途中までしか入力されない。デコード時刻T1となる時点で、仮想バッファから画像#1の符号データが出力される。このため、画像#1の分だけ仮想バッファの占有量が減少する。その後、画像#2のデコード時刻T2までの時間で、画像#3の符号データの残り、および画像#4の符号データの一部が仮想バッファに入力される。 During the time from decode time T0 to decode time T1 of image #1, coded data of image #3 is input to the virtual buffer. Here, it is assumed that the input speed of code data to the virtual buffer is fixed. In this case, the code data of image #3 is input only halfway at the decoding time T1 of image #1. At the decoding time T1, the coded data of image #1 is output from the virtual buffer. Therefore, the occupancy of the virtual buffer is reduced by the amount of image #1. Thereafter, until decoding time T2 of image #2, the rest of the coded data of image #3 and part of the coded data of image #4 are input to the virtual buffer.

デコード時刻T2となる時点で、仮想バッファから画像#2の符号データが出力される。このため、画像#2の分だけ仮想バッファの占有量が減少する。その後、画像#3のデコード時刻T3までの時間で、画像#4の符号データの一部が仮想バッファに入力される。デコード時刻T3となる時点で、仮想バッファから画像#3の符号データが出力される。このため、画像#3の分だけ仮想バッファの占有量が減少する。その後、画像#4のデコード時刻T4までの時間で、画像#4の符号データの残り、および画像#5の符号データの一部が仮想バッファに入力される。 At the decoding time T2, the coded data of image #2 is output from the virtual buffer. Therefore, the occupancy of the virtual buffer is reduced by the amount of image #2. After that, part of the code data of image #4 is input to the virtual buffer until decoding time T3 of image #3. At decode time T3, the coded data of image #3 is output from the virtual buffer. Therefore, the occupancy of the virtual buffer is reduced by the amount of image #3. Thereafter, the rest of the coded data of image #4 and part of the coded data of image #5 are input to the virtual buffer until decoding time T4 of image #4.

デコード時刻T4となる時点で、仮想バッファから画像#4の符号データが出力される。このため、画像#4の分だけ仮想バッファの占有量が減少する。その後、画像#5のデコード時刻T5までの時間で、画像#5の符号データの一部が仮想バッファに入力される。デコード時刻T5となる時点で、仮想バッファは画像#5の符号データから出力されるが、この時点では画像#5の符号データが全て仮想バッファに入力されていない。従って、デコードを実施することができないことに起因して、仮想バッファのアンダーフローが生じる。これにより、仮想バッファが破綻する。 At decode time T4, the coded data of image #4 is output from the virtual buffer. Therefore, the occupancy of the virtual buffer is reduced by the amount of image #4. Thereafter, part of the encoded data of image #5 is input to the virtual buffer until time T5 of decoding image #5. At the decoding time T5, the coded data of image #5 is output from the virtual buffer, but at this time, all the coded data of image #5 has not been input to the virtual buffer. Therefore, a virtual buffer underflow occurs due to the inability to perform decoding. This corrupts the virtual buffer.

図3(C)は、破綻回避ラインと仮想バッファの入出力との関係を示している。図3(C)の例は、画像#3の符号化時における、仮想バッファへの符号データの入出力をシミュレートした結果として、バッファ占有量が破綻回避ラインを下回ることが検知される。破綻回避ラインは、仮想バッファの占有量や当該占有量の遷移に基づき、仮想バッファに破綻が生じると予測されるデータ量(所定量)である。当該所定量は、任意に設定可能である。画像#3のデコード時刻T3までの内容については、図3(B)と同様であるため、説明を省略する。デコード時刻T3となる時点で、仮想バッファから画像#3の符号データが出力され、画像#3の分だけ仮想バッファの占有量が減少する。符号量制御部213は、デコード時刻T3の時点で、バッファ占有量が破綻回避ラインを下回っているため、仮想バッファの破綻を予測する。 FIG. 3C shows the relationship between the corruption avoidance line and the input/output of the virtual buffer. In the example of FIG. 3C, it is detected that the buffer occupancy falls below the corruption avoidance line as a result of simulating input/output of coded data to the virtual buffer during encoding of image #3. The bankruptcy avoidance line is the amount of data (predetermined amount) predicted to cause bankruptcy in the virtual buffer based on the occupancy of the virtual buffer and the transition of the occupancy. The predetermined amount can be arbitrarily set. The contents up to decoding time T3 of image #3 are the same as those in FIG. At decode time T3, the coded data of image #3 is output from the virtual buffer, and the occupancy of the virtual buffer is reduced by the amount of image #3. The code amount control unit 213 predicts that the virtual buffer will fail because the buffer occupancy is below the failure avoidance line at the decoding time T3.

図3(D)以降の説明では、画像#3の符号化処理で仮想バッファの破綻が予測された後、画像#4、画像#5、および後の時間の画像については、JCCRによる破綻回避処理として色差成分Vの符号データが破棄されるものとする。ここで、本実施形態の画像符号化回路204は、ブロック分割部208が分割したブロックごとに符号化処理を行う。このため、画像符号化回路204は、画像内の途中のブロックでバッファ破綻を予測した場合に、次のブロックからJCCRによる破綻回避を適用できる。つまり、画像符号化回路204は、ブロックごとに、バッファ破綻が生じるかを予測した結果に応じて、JCCRによる破綻回避処理を適用するかを切り替える。 In the description after FIG. 3D, after the virtual buffer corruption is predicted in the encoding process of image #3, image #4, image #5, and subsequent images are subjected to the corruption avoidance process by JCCR. , the code data of the color difference component V is discarded. Here, the image encoding circuit 204 of this embodiment performs encoding processing for each block divided by the block division unit 208 . Therefore, when the image encoding circuit 204 predicts a buffer failure in a block in the middle of an image, the failure avoidance by JCCR can be applied from the next block. In other words, the image encoding circuit 204 switches whether to apply the JCCR breakdown avoidance process for each block according to the result of predicting whether or not a buffer breakdown will occur.

図3(D)に、画像#4および画像#5のそれぞれで色差成分Vを破棄した場合の仮想バッファの入出力関係の変化を示す。図3(D)は、画像#4の符号データが仮想バッファに入力され始めるタイミングから切り出したグラフである。また、画像#4、および画像#5の仮想バッファからの入出力を表す線分は太線で示される。図3(D)において、仮想バッファから出力される符号データの内訳を、ブロック31およびブロック32を用いて示している。ブロック31は画像#4の符号データのサイズを、ブロック32は画像#5の符号データのサイズを示している。各画像において、Y/U/Vがそれぞれ異なる態様で示されている。この点については、図3(A)の棒グラフと同じである。 FIG. 3D shows changes in the input/output relationship of the virtual buffer when the color difference component V is discarded for each of the images #4 and #5. FIG. 3D is a graph extracted from the timing when the code data of image #4 starts to be input to the virtual buffer. Also, the line segments representing input/output from the virtual buffer of image #4 and image #5 are indicated by bold lines. In FIG. 3D, block 31 and block 32 are used to show the breakdown of code data output from the virtual buffer. A block 31 indicates the size of the encoded data of the image #4, and a block 32 indicates the size of the encoded data of the image #5. In each image, Y/U/V are shown in different manners. This point is the same as the bar graph in FIG.

線分33は、ブロック31の中のV成分のサイズを示しており、JCCRによる破綻回避処理により画像#4の色差成分Vが破棄される場合、線分33の分だけ仮想バッファから出力される符号データが小さくなる。また、ブロック31の内のV成分のデータサイズは、ブロック34および線分35でも示される。JCCRによる破綻回避処理により、画像#4の色差成分Vを破棄される場合、線分35の分だけ仮想バッファに入力される符号データのデータ量が小さくなる。同様に、線分36は、ブロック32の中のV成分のサイズを示しており、JCCRによる破綻回避処理により、画像#5の色差成分Vが破棄される場合、線分36の分だけ仮想バッファから出力される符号データのデータ量が小さくなる。また、ブロック32のうちのV成分のデータサイズはブロック37および線分38でも示される。JCCRによる破綻回避処理により、画像#5の色差成分Vが破棄される場合、線分38の分だけ仮想バッファに入力される符号データが小さくなる。 A line segment 33 indicates the size of the V component in the block 31, and when the color difference component V of the image #4 is discarded by the JCCR corruption avoidance process, the line segment 33 is output from the virtual buffer. Code data becomes smaller. The data size of the V component in block 31 is also indicated by block 34 and line segment 35 . When the color difference component V of the image #4 is discarded by the JCCR breakdown avoidance process, the data amount of the code data input to the virtual buffer is reduced by the line segment 35 . Similarly, a line segment 36 indicates the size of the V component in the block 32. When the color difference component V of image #5 is discarded by the JCCR corruption avoidance process, the line segment 36 corresponds to the size of the virtual buffer. The amount of code data output from is reduced. The data size of the V component in block 32 is also indicated by block 37 and line segment 38 . When the color difference component V of the image #5 is discarded by the JCCR breakdown avoidance processing, the code data input to the virtual buffer is reduced by the line segment 38 .

図3(E)は、上述したJCCRによる破綻回避処理を行う場合の変化を加味した際の仮想バッファの入出力関係を示している。画像#3のデコード時刻T3までは、上述した図3(B)と同様であるため、説明を省略する。デコード時刻T3となる時点で、仮想バッファから画像#3の符号データが出力され、画像#3の分だけ仮想バッファの占有量が減少することで、バッファ占有量が破綻回避ラインを下回る。このため、JCCRによる破綻回避処理が実施される。画像#4のデコード時刻T4までの時間で、画像#4の符号データの残り、および画像#5の符号データの一部が仮想バッファに入力される。デコード時刻T4となる時点で、仮想バッファから画像#4の符号データが出力される。このとき、画像#4の分だけ仮想バッファの占有量が減少する。その後、画像#5のデコード時刻T5までの時間で、画像#5の符号データの残りと、その後の画像の符号データの一部が仮想バッファに入力される。 FIG. 3(E) shows the input/output relationship of the virtual buffer when considering the change in the case of performing the above-described JCCR-based corruption avoidance processing. The process up to decoding time T3 of image #3 is the same as in FIG. At decoding time T3, the coded data of image #3 is output from the virtual buffer, and the virtual buffer occupancy decreases by the amount of image #3, and the buffer occupancy falls below the corruption avoidance line. Therefore, bankruptcy avoidance processing by JCCR is implemented. The remainder of the code data of image #4 and part of the code data of image #5 are input to the virtual buffer until decoding time T4 of image #4. At decode time T4, the coded data of image #4 is output from the virtual buffer. At this time, the occupancy of the virtual buffer is reduced by the amount of image #4. After that, until decoding time T5 of image #5, the remaining coded data of image #5 and part of the coded data of subsequent images are input to the virtual buffer.

デコード時刻T5となる時点で、仮想バッファから画像#5の符号データが出力される。図3(B)の例では符号データが全て揃っていないことに起因して仮想バッファが破綻していたのに対して、図3(E)の例では符号データが全て揃っているため、正常にデコード処理を行うことができる。破綻回避処理の解除タイミングとしては、仮想バッファから符号データが出力された後に、仮想バッファのバッファ占有量が破綻回避ラインよりも上回っている場合であってもよい。また、破綻回避処理の解除タイミングとしては、別途の解除ラインが設定された状態で、仮想バッファのバッファ占有量が解除ラインを上回っている場合であってもよい。 At decode time T5, the coded data of image #5 is output from the virtual buffer. In the example of FIG. 3(B), the virtual buffer was broken due to the lack of all encoded data, whereas in the example of FIG. can be decoded. The timing of canceling the corruption avoidance process may be when the virtual buffer occupancy exceeds the corruption avoidance line after the code data is output from the virtual buffer. Further, the cancellation timing of the corruption avoidance process may be when a separate cancellation line is set and the buffer occupancy of the virtual buffer exceeds the cancellation line.

図2の可変長符号化部214は、量子化された変換係数に対してジグザグスキャンやオルタネートスキャン等を行い、変換係数を可変長符号化し、生成した符号化データをストリーム生成部219に送る。また、可変長符号化部214は、ブロックごとの発生符号量を算出して、算出したブロックごとの発生符号量を量子化制御部212および符号量制御部213に出力する。逆量子化部215は、量子化部211が出力する変換係数を逆量子化し、ローカルデコード用の変換係数を生成する。そして、逆量子化部215は、生成した変換係数を逆直交変換部216に出力する。逆直交変換部216は、変換係数に直交変換部210が適用した直交変換の逆変換(逆離散コサイン変換)を適用して差分画像を生成する。そして、逆直交変換部216は、生成した差分画像を補償部217に出力する。 The variable-length coding unit 214 in FIG. 2 performs zigzag scanning, alternate scanning, or the like on the quantized transform coefficients, variable-length-codes the transform coefficients, and sends the generated coded data to the stream generating unit 219 . The variable-length coding unit 214 also calculates the generated code amount for each block and outputs the calculated generated code amount for each block to the quantization control unit 212 and the code amount control unit 213 . The inverse quantization unit 215 inversely quantizes the transform coefficients output from the quantization unit 211 to generate transform coefficients for local decoding. The inverse quantization section 215 then outputs the generated transform coefficients to the inverse orthogonal transform section 216 . The inverse orthogonal transform unit 216 applies the inverse transform (inverse discrete cosine transform) of the orthogonal transform applied by the orthogonal transform unit 210 to the transform coefficients to generate a difference image. The inverse orthogonal transform unit 216 then outputs the generated difference image to the compensation unit 217 .

補償部217は、フレームバッファ207に格納された復号済みのローカルデコード画像を読み出し、予測部209から送られた予測情報に従い予測画像を生成し、逆直交変換部216から送られた差分画像と加算し、補償済み画像を生成する。補償済み画像はデブロッキングフィルタ部218に送られる。また、補償部217は、色差成分VについてはJCCRを適用した補償処理と、JCCRを適用しない補償処理との2つの処理のうちのいずれか一方を行う。補償部217は、符号量制御部213から破綻回避命令を受けた場合には、JCCRを適用した補償処理を行い、破綻回避命令を受けていない場合には、JCCRを適用しない補償処理を行う。 The compensation unit 217 reads the decoded local decoded image stored in the frame buffer 207, generates a predicted image according to the prediction information sent from the prediction unit 209, and adds the difference image sent from the inverse orthogonal transform unit 216. to generate the compensated image. The compensated image is sent to deblocking filter unit 218 . Also, the compensator 217 performs either one of two types of processing for the color difference component V: compensation processing to which JCCR is applied and compensation processing to which JCCR is not applied. The compensator 217 performs compensation processing applying JCCR when receiving a bankruptcy avoidance command from the code amount control unit 213, and performs compensation processing not applying JCCR when not receiving a bankruptcy avoidance command.

補償部217は、JCCRを適用する補償処理を行う場合は、ローカルデコード画像の色差成分Vを用いた予測画像と、逆直交変換部216から受けた色差成分Uについての差分画像とを加算する。これにより、補償部217は、色差成分Vの補償済み画像を生成する。補償部217は、JCCRを適用しない補償処理を行う場合は、ローカルデコード画像の色差成分Vを用いた予測画像と、逆直交変換部216から受けた色差成分Vについての差分画像とを加算する。これにより、補償部217は、色差成分Vの補償済み画像を生成する。 The compensation unit 217 adds the predicted image using the color difference component V of the locally decoded image and the difference image for the color difference component U received from the inverse orthogonal transform unit 216 when performing the compensation process applying JCCR. As a result, the compensator 217 generates a color difference component V compensated image. When performing compensation processing that does not apply JCCR, the compensation unit 217 adds the prediction image using the color difference component V of the locally decoded image and the difference image for the color difference component V received from the inverse orthogonal transformation unit 216 . As a result, the compensator 217 generates a color difference component V compensated image.

デブロッキングフィルタ部218は、補償部217から受けた補償済み画像に対してデブロッキングフィルタを適用してローカルデコード画像を生成し、フレームバッファ207に送る。デブロッキングフィルタは、対象ブロックの境界における不連続な歪みを平滑化するためのフィルタである。ストリーム生成部219は、可変長符号化部214から送られた符号化データに、復号のために必要なパラメータを付加し、記録ストリームを生成する。生成された記録ストリームは、記録メディア205に書き込まれる。また、ストリーム生成部219は、符号量制御部213から破綻回避命令が送られたか否かに基づき、色差成分Vの符号化データを記録ストリームに含めるか否かを選択する。また、ストリーム生成部219は、符号量制御部213から破綻回避命令が送られたか否かに基づき、色差成分Vをストリームに含めたか否かのフラグ情報を記録ストリームに付加する。 The deblocking filter unit 218 applies a deblocking filter to the compensated image received from the compensating unit 217 to generate a local decoded image and sends it to the frame buffer 207 . A deblocking filter is a filter for smoothing discontinuous distortion at the boundary of a target block. The stream generator 219 adds parameters necessary for decoding to the encoded data sent from the variable-length encoder 214 to generate a recording stream. The generated recording stream is written to the recording medium 205 . Also, the stream generation unit 219 selects whether or not to include the encoded data of the color difference component V in the recording stream based on whether or not the code amount control unit 213 has sent a corruption avoidance command. Further, the stream generation unit 219 adds flag information indicating whether or not the color difference component V is included in the stream to the recording stream based on whether or not a corruption avoidance command has been sent from the code amount control unit 213 .

次に、第1実施形態の画像符号化回路204が実行する符号化処理の流れについて説明する。図4は、第1実施形態の符号化処理の流れの一例を示すフローチャートである。S401で、符号量制御部213は、仮想バッファからカレントフレームの符号データを出力する際の、初期位置となるバッファ占有量を算出する。S402で、符号量制御部213は、バッファ占有量が破綻回避ラインを下回っているか判定する。カレントフレームの符号化開始時であれば、初期位置は、S401で算出された初期位置であるし、符号化中であればブロックの符号化処理ごとに更新されるバッファ位置になる。 Next, the flow of encoding processing executed by the image encoding circuit 204 of the first embodiment will be described. FIG. 4 is a flowchart showing an example of the flow of encoding processing according to the first embodiment. In S401, the code amount control unit 213 calculates the buffer occupancy that is the initial position when the code data of the current frame is output from the virtual buffer. In S402, the code amount control unit 213 determines whether the buffer occupancy is below the corruption avoidance line. At the start of encoding of the current frame, the initial position is the initial position calculated in S401.

符号量制御部213は、バッファ占有量が破綻回避ラインを下回っていないと判定した場合(S402でNo)、フローをS403に進める。S403で、画像符号化回路204は、カレントブロックに対して通常の符号化処理を行う。このとき、画像符号化回路204は、カレントフレームの輝度成分(Y)および2つの色差成分(U/V)の両方を符号化し、記録する。符号量制御部213は、バッファ占有量が破綻回避ラインを下回っていると判定した場合(S402でYes)、フローをS404に進める。S404で、画像符号化回路204は、JCCRを適用した符号化処理を行う。このとき、画像符号化回路204は、カレントフレームの輝度成分(Y)、および2つの色差成分(U/V)のうち一方の色差成分(U)を符号化し、記録するともに、他方の色差成分(V)を破棄する。 When the code amount control unit 213 determines that the buffer occupation amount is not below the corruption avoidance line (No in S402), the flow proceeds to S403. In S403, the image encoding circuit 204 performs normal encoding processing on the current block. At this time, the image encoding circuit 204 encodes and records both the luminance component (Y) and the two color difference components (U/V) of the current frame. When the code amount control unit 213 determines that the buffer occupancy is below the corruption avoidance line (Yes in S402), the flow proceeds to S404. In S404, the image encoding circuit 204 performs encoding processing using JCCR. At this time, the image encoding circuit 204 encodes and records the luminance component (Y) of the current frame and one of the two color difference components (U/V), and records the other color difference component. Discard (V).

S405で、画像符号化回路204は、カレントブロックの符号データのサイズに基づいて仮想バッファの占有量を更新する。S406で、画像符号化回路204は、カレントフレーム内の全てのブロックについての処理を完了したかを判定する。画像符号化回路204は、全てのブロックについての処理が完了していないと判定した場合(S406でNo)、フローをS402に戻す。画像符号化回路204は、全てのブロックについての処理が完了していると判定した場合(S406でYes)、フローをS407に進める。画像符号化回路204は、全てのフレームの処理を完了したかを判定する。画像符号化回路204は、全てのフレームの処理を完了していないと判定した場合(S407でNo)、フローをS401に戻す。一方、画像符号化回路204は、全てのフレームの処理を完了したと判定した場合(S407でYes)、図4のフローチャートを終了させる。 In S405, the image encoding circuit 204 updates the occupancy of the virtual buffer based on the size of the encoded data of the current block. In S406, the image encoding circuit 204 determines whether or not all blocks in the current frame have been processed. When the image encoding circuit 204 determines that processing for all blocks has not been completed (No in S406), the flow returns to S402. When the image encoding circuit 204 determines that processing for all blocks has been completed (Yes in S406), the flow advances to S407. The image encoding circuit 204 determines whether all frames have been processed. When the image encoding circuit 204 determines that the processing of all frames has not been completed (No in S407), the flow returns to S401. On the other hand, when the image encoding circuit 204 determines that the processing of all frames has been completed (Yes in S407), the flowchart of FIG. 4 ends.

以上説明したように、本実施形態によれば、画像符号化回路204は、仮想バッファの破綻を回避する際、仮想バッファのバッファ占有量に応じて、JCCRを適用して色差成分のデータを削減するかを制御する。これにより、色差成分の交流成分が削除されるによる色滲みなどの問題を解消し、画質劣化を抑制できるとともに、仮想バッファの破綻の発生を抑制することができる。 As described above, according to the present embodiment, the image encoding circuit 204 applies JCCR according to the buffer occupancy of the virtual buffer to reduce color difference component data when avoiding virtual buffer failure. control what to do. As a result, it is possible to solve problems such as color bleeding due to the removal of the AC component of the color difference components, suppress image quality deterioration, and suppress the occurrence of virtual buffer failure.

<第2実施形態>
次に、第2実施形態について説明する。第1実施形態では、画像符号化回路204は、バッファ占有量が破綻回避ラインを下回っている場合、一律でJCCRによる破綻回避処理を行うかを制御している。第2実施形態では、画像符号化回路204は、所定条件を満たした場合に、JCCRによる破綻回避処理を行うか、従来の破綻回避処理を行うかを制御する。例えば、画像の特徴や、目標とするビットレート等の要因によっては、JCCRによる破綻回避処理ではデータ削減量が小さいことに起因して、仮想バッファの破綻を回避できないケースがある。このようなケースの場合、第2実施形態が適用されると効果的である。
<Second embodiment>
Next, a second embodiment will be described. In the first embodiment, the image encoding circuit 204 controls whether to uniformly perform the JCCR-based corruption avoidance process when the buffer occupancy is below the corruption avoidance line. In the second embodiment, the image encoding circuit 204 controls whether to perform the JCCR corruption avoidance process or the conventional corruption avoidance process when a predetermined condition is satisfied. For example, depending on factors such as image features and a target bit rate, there are cases where virtual buffer corruption cannot be avoided due to a small amount of data reduction in the JCCR corruption avoidance process. In such cases, it is effective to apply the second embodiment.

従来の破綻回避処理としては、例えば、周波数変換係数に対して、高周波成分(所定周波成分より高い周波成分)を削除して符号データサイズを大幅に削減する手法が適用され得る。高周波成分を削除した場合に削減される符号データサイズは、JCCRを適用した処理を行った場合に削減される符号データサイズよりも大きい。また、JCCRによる破綻回避処理を行わないケースとしては、モノクロやセピア調といった色味が少ない画像等において、色差成分の符号データが輝度成分の符号データに対して小さすぎる場合等がある。このような場合、JCCRによる破綻回避処理が行われたとしても、データ削減量が大幅に低下し、データの削減効果が低くなる。 As a conventional corruption avoidance process, for example, a method of deleting high-frequency components (frequency components higher than a predetermined frequency component) from frequency transform coefficients to significantly reduce the code data size can be applied. The code data size that is reduced when high frequency components are deleted is larger than the code data size that is reduced when JCCR is applied. Further, as a case where the JCCR-based corruption avoidance processing is not performed, there is a case where the coded data of the color difference component is too small for the coded data of the luminance component in an image such as monochrome or sepia tone which has little color. In such a case, even if the bankruptcy avoidance process by JCCR is performed, the amount of data reduction will be greatly reduced, and the data reduction effect will be low.

そこで、第2実施形態の画像符号化回路204は、バッファ占有量が破綻回避ラインを下回っている場合でも、所定条件を満たしているかに応じて、JCCRによる破綻回避処理を行うかを制御する。当該所定条件としては、カレントフレーム(画像)の符号データの2つの色差成分のうちの1つの色差成分のデータサイズが輝度成分のデータサイズよりも小さすぎることを条件とすることができる。例えば、画像符号化回路204は、バッファ占有量が破綻回避ラインを下回っており、且つ以下の式(1)を満たしている場合に、JCCRを適用する。一方、画像符号化回路204は、バッファ占有量が破綻回避ラインを下回っていたとしても、以下の式(1)を満たしていない場合、JCCRによるデータの削減効果が低くなるため、JCCRを適用しない。 Therefore, the image encoding circuit 204 of the second embodiment controls whether to perform the JCCR corruption avoidance process depending on whether a predetermined condition is satisfied even when the buffer occupancy is below the corruption avoidance line. The predetermined condition may be that the data size of one of the two color difference components of the encoded data of the current frame (image) is too smaller than the data size of the luminance component. For example, the image encoding circuit 204 applies JCCR when the buffer occupancy is below the corruption avoidance line and the following formula (1) is satisfied. On the other hand, even if the buffer occupancy is below the corruption avoidance line, the image encoding circuit 204 does not apply JCCR because the data reduction effect by JCCR is low if the following formula (1) is not satisfied. .

以下の式(1)における係数αは、プリセットされた値であってもよいし、設定レジスタに設定された値であってもよい。また、以下の式(1)の色差データサイズは、カレントフレームの符号データの2つの色差成分のうちの一方の色差成分のデータサイズであってもよいし、両方の色差成分のデータサイズであってもよい。
「輝度データサイズ×α<色差データサイズ」・・・(1)
A coefficient α in the following equation (1) may be a preset value or a value set in a setting register. The chrominance data size in the following equation (1) may be the data size of one of the two chrominance components of the code data of the current frame, or the data size of both of the chrominance components. may
“Luminance data size×α<color difference data size” (1)

上述した所定条件としては、動画符号化の所定の参照関係を適用できる。この場合、動画符号化の所定の参照関係において、下位に位置する画像を符号化するときに、JCCRは適用されない。図5は、動画像符号化における画像間の参照関係の一例を示す図である。画像間の参照関係としては、図5(A)に示されるI/P/Bピクチャを組み合わせた参照関係や、図5(B)に示される複数のBピクチャで階層的に構成された参照関係等がある。 As the predetermined condition described above, a predetermined reference relationship for video encoding can be applied. In this case, JCCR is not applied when encoding an image positioned at a lower level in a predetermined reference relationship for video encoding. FIG. 5 is a diagram showing an example of a reference relationship between images in video encoding. Reference relationships between images include reference relationships combining I/P/B pictures shown in FIG. etc.

図5(A)においては、I/Pピクチャが上位の階層に、Bピクチャが下位の階層に、それぞれ位置する。図5(B)においては、Tid0およびTid1が上位の階層に、Tid2およびTid3が下位の階層に、それぞれ位置する。上位の階層に属するピクチャは目標符号量を小さく設定することが一般的であり、画質への要求も高くはないため、従来の破綻回避処理でデータを大幅に削減したとしても、画質への影響は小さいと考えられる。そこで、第2実施形態の画像符号化回路204は、所定の条件を動画符号化の所定の参照関係において、所定階層よりも下位の階層に位置する画像を符号化するかという条件を設定することができる。この場合、画像符号化回路204は、動画符号化の所定の参照関係において、所定階層と同じか、それよりも上位の階層に位置する1以上の画像を符号化するときに、JCCRによる破綻回避処理を行わず、符号データサイズを大幅に削減する処理を行う。当該処理としては、例えば、高周波成分を削除する手法が適用される。一方、画像符号化回路204は、所定階層よりも下位の階層に位置する1以上の画像を符号化する場合に、JCCRによる破綻回避処理を行う。 In FIG. 5A, the I/P pictures are located in the upper hierarchy, and the B pictures are located in the lower hierarchy. In FIG. 5B, Tid0 and Tid1 are located in the upper hierarchy, and Tid2 and Tid3 are located in the lower hierarchy. It is common to set a small target code amount for pictures belonging to higher layers, and the demand for image quality is not high. is considered to be small. Therefore, the image encoding circuit 204 of the second embodiment sets a condition as to whether or not to encode an image located in a hierarchy lower than a prescribed hierarchy in a prescribed reference relationship for video encoding. can be done. In this case, the image encoding circuit 204 encodes one or more images located in the same or higher hierarchy as the predetermined hierarchy in a predetermined reference relationship for video encoding. No processing is performed, and processing is performed to significantly reduce the code data size. As the processing, for example, a method of removing high frequency components is applied. On the other hand, the image encoding circuit 204 performs corruption avoidance processing according to JCCR when encoding one or more images located in a hierarchy lower than the predetermined hierarchy.

また、第2実施形態の画像符号化回路204は、所定条件を、色差フォーマットがYUV420であるか否かという条件としてもよい。YUV420は、動画フォーマットの1つの方式であり、水平および垂直の2×2ピクセルのうち、Cb信号を2ピクセルから上1ピクセル取り、Cr信号を下2ピクセルから1ピクセル取る方式である。YUV420は、2つの色差成分のうち一方または両方の色差成分のデータサイズが輝度成分のデータサイズの4分の1であるため、JCCRによるデータ削減効果が低い。従って、画像符号化回路204は、所定条件として、色差フォーマットがYUV420である場合、JCCRによる破綻回避処理を行わない。一方、画像符号化回路204は、色差フォーマットがYUV420ではない場合、JCCRによる破綻回避処理を行う。 In the image encoding circuit 204 of the second embodiment, the predetermined condition may be whether the color difference format is YUV420. YUV420 is one of the moving picture formats, and is a system in which, of horizontal and vertical 2×2 pixels, 1 pixel above the Cb signal is obtained from 2 pixels and 1 pixel from the lower 2 pixels is obtained for the Cr signal. In YUV420, the data size of one or both of the two color difference components is a quarter of the data size of the luminance component, so the data reduction effect by JCCR is low. Accordingly, the image encoding circuit 204 does not perform the JCCR breakdown avoidance process when the color difference format is YUV420 as a predetermined condition. On the other hand, if the color difference format is not YUV420, the image encoding circuit 204 performs a JCCR-based breakdown avoidance process.

図6は、第2実施形態の符号化処理の流れの一例を示すフローチャートである。S401~S407の各処理は、図4と同様であるため、説明を省略する。符号量制御部213は、S401でYesと判定した場合、フローをS601に進める。S601で、符号量制御部213は、上述した所定条件を満たすかを判定する。符号量制御部213は、所定条件を満たすと判定した場合(S601でYes)、フローをS404に進める。一方、符号量制御部213は、所定条件を満たさないと判定した場合(S601でNo)、フローをS403に進める。符号量制御部213は、上述した式(1)を満たしている場合、動画符号化の所定の参照関係において上位の階層に位置する画像を符号化する場合、または色差フォーマットがYUV420である場合、S601でYesと判定する。 FIG. 6 is a flowchart showing an example of the flow of encoding processing according to the second embodiment. Since each process of S401 to S407 is the same as that of FIG. 4, description thereof is omitted. If the code amount control unit 213 determines Yes in S401, the flow advances to S601. In S601, the code amount control unit 213 determines whether the above-described predetermined condition is satisfied. If the code amount control unit 213 determines that the predetermined condition is satisfied (Yes in S601), the flow advances to S404. On the other hand, when the code amount control unit 213 determines that the predetermined condition is not satisfied (No in S601), the flow advances to S403. The code amount control unit 213 satisfies the above-described formula (1), encodes an image positioned at a higher layer in a predetermined reference relationship for video encoding, or if the color difference format is YUV420, It is determined as Yes in S601.

以上のように、第2実施形態では、JCCRによる破綻回避処理ではデータ削減効果が低く、十分なバッファ回復が望めないようなケースにおいて、従来の破綻回避処理が行われる。これにより、第1実施形態の効果を得つつ、仮想バッファの破綻が回避されることが抑制される。 As described above, in the second embodiment, the conventional corruption avoidance process is performed in a case where the JCCR corruption avoidance process has a low data reduction effect and sufficient buffer recovery cannot be expected. As a result, the effects of the first embodiment can be obtained, and the avoidance of virtual buffer failure is suppressed.

<第3実施形態>
次に、第3実施形態について説明する。第3実施形態の画像符号化回路204は、JCCRによる破綻回避処理を実施したとしても、仮想バッファが回復しない場合、さらに強力な破綻回避処理を行う。図3(E)を用いて説明したように、第1実施形態の画像符号化回路204は、破綻回避ラインを下回ると、JCCRによる破綻回避処理を行う。この点、JCCRによる破綻回避処理を行ったとしても、バッファ占有量がさらに減少してしまう場合がある。そこで、第3実施形態の画像符号化回路204は、第1実施形態の破綻回避ラインよりも厳しい緊急破綻回避ライン(破綻回避ラインに対応する所定量を小さくした他の所定量)を設定する。そして、第3実施形態の画像符号化回路204は、バッファ占有量が緊急破綻回避ラインを下回った場合、他の破綻回避処理を適用し、削減するデータ量を大きくする。
<Third embodiment>
Next, a third embodiment will be described. The image encoding circuit 204 of the third embodiment performs a more powerful corruption avoidance process when the virtual buffer does not recover even if the JCCR breakdown avoidance process is executed. As described with reference to FIG. 3(E), the image encoding circuit 204 of the first embodiment performs the JCCR-based corruption avoidance process when the image falls below the corruption avoidance line. In this regard, even if the JCCR failure prevention process is performed, the buffer occupancy may be further reduced. Therefore, the image encoding circuit 204 of the third embodiment sets an emergency bankruptcy avoidance line (another predetermined amount obtained by reducing the predetermined amount corresponding to the bankruptcy avoidance line) that is stricter than the bankruptcy avoidance line of the first embodiment. Then, when the buffer occupancy falls below the urgent corruption avoidance line, the image encoding circuit 204 of the third embodiment applies another corruption avoidance process to increase the amount of data to be reduced.

他の破綻回避処理としては、例えば、周波数変換係数に対して、高周波成分を削除するといった従来の手法を適用できる。これにより、JCCRを適用するデータ削減処理より高いデータ削減効果を得ることができる。また、他の破綻回避処理として、量子化制御部212による量子化パラメータ設定の際に、最大の量子化パラメータを用いることで、データの削減量を大きくすることも考えられる。この場合も、JCCRを適用するデータ削減処理より高いデータ削減効果を得ることができる。以下、他の破綻回避処理として、最大の量子化パラメータを用いる場合について説明する。 As other corruption avoidance processing, for example, a conventional method of deleting high frequency components from frequency transform coefficients can be applied. As a result, it is possible to obtain a higher data reduction effect than the data reduction processing that applies JCCR. Further, as another corruption avoidance process, it is conceivable to use the maximum quantization parameter when setting the quantization parameter by the quantization control unit 212, thereby increasing the amount of data reduction. Also in this case, it is possible to obtain a higher data reduction effect than the data reduction processing that applies JCCR. A case of using the maximum quantization parameter as another corruption avoidance process will be described below.

図7は、第3実施形態の符号化処理の流れの一例を示すフローチャートである。S401~S407の各処理は、図4と同様であるため、説明を省略する。符号量制御部213は、S401でYesと判定した場合、フローをS701に進める。S701で、符号量制御部213は、バッファ占有量が緊急破綻回避ラインを下回っているかを判定する。 FIG. 7 is a flowchart showing an example of the flow of encoding processing according to the third embodiment. Since each process of S401 to S407 is the same as that of FIG. 4, description thereof is omitted. If the code amount control unit 213 determines Yes in S401, the flow advances to S701. In S701, the code amount control unit 213 determines whether the buffer occupancy is below the emergency bankruptcy avoidance line.

符号量制御部213は、バッファ占有量が緊急破綻回避ラインを下回っていない場合(S701でNo)、フローをS702に進める。S702で、量子化制御部212は、通常制御による量子化パラメータ設定を量子化部211に行う。このとき、量子化制御部212は、少なくとも最大値よりも低い通常の設定値を量子化部211に設定する。符号量制御部213は、バッファ占有量が緊急破綻回避ラインを下回っている場合(S701でYes)、フローをS703に進める。S703で、量子化制御部212は、最大の量子化パラメータ設定(最大値)を量子化部211に設定する。 If the buffer occupancy is not below the emergency bankruptcy avoidance line (No in S701), the code amount control unit 213 advances the flow to S702. In S702, the quantization control unit 212 performs quantization parameter setting for the quantization unit 211 by normal control. At this time, the quantization control section 212 sets the quantization section 211 to a normal set value that is at least lower than the maximum value. If the buffer occupancy is below the emergency bankruptcy avoidance line (Yes in S701), the code amount control unit 213 advances the flow to S703. In S<b>703 , the quantization control unit 212 sets the maximum quantization parameter setting (maximum value) to the quantization unit 211 .

以上のように、第3実施形態では、JCCRによる破綻回避処理だけでは仮想バッファの回復が間に合わない場合において、より強力な破綻回避処理が行われる。これにより、バッファ占有量が大きく減少するような場合でも、仮想バッファの破綻を回避することができる。 As described above, in the third embodiment, a stronger corruption avoidance process is performed when the recovery of the virtual buffer cannot be kept up with the JCCR corruption avoidance process alone. As a result, it is possible to avoid virtual buffer failure even when the buffer occupancy decreases significantly.

以上、本発明の好ましい実施の形態について説明したが、本発明は上述した各実施の形態に限定されず、その要旨の範囲内で種々の変形および変更が可能である。本発明は、上述の各実施の形態の1以上の機能を実現するプログラムを、ネットワークや記憶媒体を介してシステムや装置に供給し、そのシステム又は装置のコンピュータの1つ以上のプロセッサーがプログラムを読み出して実行する処理でも実現可能である。また、本発明は、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 Although preferred embodiments of the present invention have been described above, the present invention is not limited to the above-described embodiments, and various modifications and changes are possible within the scope of the gist thereof. The present invention supplies a program that implements one or more functions of each of the above-described embodiments to a system or device via a network or a storage medium, and one or more processors of the computer of the system or device executes the program. It can also be realized by reading and executing processing. The invention can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.

200 デジタルカメラ
204 画像符号化回路
207 フレームバッファ
208 ブロック分割部
212 量子化制御部
200 digital camera 204 image encoding circuit 207 frame buffer 208 block division unit 212 quantization control unit

Claims (11)

1つの輝度成分と2つの色差成分とからなる画像により構成される動画像を符号化する動画像符号化装置であって、
デコーダのバッファモデルの使用量が所定量を下回っているかに応じて、前記2つの色差成分の両方を符号化して出力するか、または前記2つの色差成分のうち何れか一方のみを符号化して出力するかを制御する制御手段、を備えることを特徴とする動画像符号化装置。
A moving image encoding device for encoding a moving image composed of an image consisting of one luminance component and two color difference components,
encoding and outputting both of the two chrominance components, or encoding and outputting only one of the two chrominance components, depending on whether the amount of usage of the buffer model of the decoder is below a predetermined amount; A moving picture coding apparatus, comprising: control means for controlling whether to
前記制御手段は、前記バッファモデルの使用量が前記所定量を下回っている場合、前記2つの色差成分のうち何れか一方のみを符号化して出力し、他方を破棄する制御を行うことを特徴とする請求項1に記載の動画像符号化装置。 When the amount of use of the buffer model is less than the predetermined amount, the control means encodes and outputs only one of the two color difference components and discards the other. The moving picture encoding device according to claim 1. 前記制御手段は、前記バッファモデルの使用量が前記所定量を下回っており、且つ所定条件を満たす場合に、前記2つの色差成分のうち何れか一方のみを符号化して出力する制御を行うことを特徴とする請求項2に記載の動画像符号化装置。 The control means performs control to encode and output only one of the two color difference components when the usage amount of the buffer model is below the predetermined amount and a predetermined condition is satisfied. 3. The moving picture encoding device according to claim 2. 前記所定条件は、前記2つの色差成分のうち一方の色差成分のデータサイズが前記輝度成分の符号量に所定の係数を乗じたデータサイズより大きい場合に満たされることを特徴とする請求項3に記載の動画像符号化装置。 4. The predetermined condition is satisfied when the data size of one of the two chrominance components is larger than the data size obtained by multiplying the code amount of the luminance component by a predetermined coefficient. A video encoding device as described. 前記所定条件は、前記動画像を構成する複数の画像についての参照関係のうち所定階層よりも下位の階層に位置する1以上の画像を符号化する場合に満たされることを特徴とする請求項3に記載の動画像符号化装置。 4. The predetermined condition is satisfied when encoding one or more images located in a hierarchy lower than a predetermined hierarchy in a reference relationship of a plurality of images constituting the moving image. 2. The video encoding device according to . 前記所定条件は、前記2つの色差成分うち一方の色差成分のデータサイズが前記輝度成分のデータサイズの4分の1でない場合に満たされることを特徴とする請求項3に記載の動画像符号化装置。 4. The moving image encoding according to claim 3, wherein the predetermined condition is satisfied when the data size of one of the two chrominance components is not a quarter of the data size of the luminance component. Device. 前記制御手段は、前記バッファモデルの使用量が前記所定量を下回っており、且つ前記所定条件を満たさない場合、前記画像から高周波成分を削除する処理を行うことを特徴とする請求項3乃至6のうち何れか1項に記載の動画像符号化装置。 7. When the usage amount of the buffer model is less than the predetermined amount and the predetermined condition is not satisfied, the control means performs processing for deleting high frequency components from the image. The video encoding device according to any one of . 前記制御手段は、前記バッファモデルの使用量が前記所定量よりも小さい他の所定量よりも下回った場合、前記画像から高周波成分を削除する処理、または量子化パラメータを最大値に設定する処理を行うことを特徴とする請求項1乃至7のうち何れか1項に記載の動画像符号化装置。 When the usage amount of the buffer model falls below another predetermined amount smaller than the predetermined amount, the control means performs processing of deleting high frequency components from the image or processing of setting a quantization parameter to a maximum value. 8. The moving picture coding apparatus according to any one of claims 1 to 7, characterized in that: 前記制御手段は、前記画像を分割したブロックごとに、前記2つの色差成分の両方を符号化して出力するか、または前記2つの色差成分のうち何れか一方のみを符号化して出力するかを切り替える制御を行うことを特徴とする請求項1乃至8のうち何れか1項に記載の動画像符号化装置。 The control means switches between encoding and outputting both of the two color difference components or encoding and outputting only one of the two color difference components for each block obtained by dividing the image. 9. The moving picture coding apparatus according to any one of claims 1 to 8, wherein control is performed. 前記2つの色差成分の両方を符号化して出力するか、または前記2つの色差成分のうち何れか一方のみを符号化して出力するかを示すフラグ情報を符号化データに付加する付加手段をさらに備えることを特徴とする請求項1乃至9のいずれか1項に記載の動画像符号化装置。 further comprising addition means for adding to the encoded data flag information indicating whether to encode and output both of the two color difference components or to encode and output only one of the two color difference components. 10. The moving picture coding apparatus according to any one of claims 1 to 9, characterized by: 1つの輝度成分と2つの色差成分とからなる画像により構成される動画像を符号化する動画像符号化方法であって、
デコーダのバッファモデルの使用量が所定量を下回っているかに応じて、前記2つの色差成分の両方を符号化して出力するか、または前記2つの色差成分のうち何れか一方のみを符号化して出力するかを制御する工程、
を備えることを特徴とする動画像符号化方法。
A moving image encoding method for encoding a moving image composed of an image consisting of one luminance component and two color difference components,
encoding and outputting both of the two chrominance components, or encoding and outputting only one of the two chrominance components, depending on whether the amount of usage of the buffer model of the decoder is below a predetermined amount; controlling whether to
A video encoding method, comprising:
JP2021013351A 2021-01-29 2021-01-29 Moving image encoding device and moving image encoding method Pending JP2022116923A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021013351A JP2022116923A (en) 2021-01-29 2021-01-29 Moving image encoding device and moving image encoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021013351A JP2022116923A (en) 2021-01-29 2021-01-29 Moving image encoding device and moving image encoding method

Publications (1)

Publication Number Publication Date
JP2022116923A true JP2022116923A (en) 2022-08-10

Family

ID=82749703

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021013351A Pending JP2022116923A (en) 2021-01-29 2021-01-29 Moving image encoding device and moving image encoding method

Country Status (1)

Country Link
JP (1) JP2022116923A (en)

Similar Documents

Publication Publication Date Title
JP4372197B2 (en) Image encoding apparatus and image decoding apparatus
JP5470405B2 (en) Image coding apparatus and method
JP7401666B2 (en) Cross component adaptive loop filter
JP2006114979A (en) Image coding apparatus and method thereof
JP4643437B2 (en) Information processing device
JP6253406B2 (en) Image encoding apparatus, imaging apparatus, image encoding method, and program
JP2022116923A (en) Moving image encoding device and moving image encoding method
JP4492777B2 (en) Video encoding device
US12028521B2 (en) Encoder, method, and non-transitory computer-readable storage medium
JP7468882B2 (en) Filtering Method
JP6942504B2 (en) Coding device, imaging device, coding method, and program
JP2015019319A (en) Encoding apparatus, encoding method, and program
TW202418806A (en) Image encoding device, image decoding device, image encoding method, image decoding method, and program
JP2019097030A (en) Image coding apparatus, imaging apparatus, image coding method, and program
JP2006166103A (en) Moving picture encoder, method thereof, program thereof, and storage medium thereof