JP2011109216A - Encoding method, and encoding program - Google Patents

Encoding method, and encoding program Download PDF

Info

Publication number
JP2011109216A
JP2011109216A JP2009259621A JP2009259621A JP2011109216A JP 2011109216 A JP2011109216 A JP 2011109216A JP 2009259621 A JP2009259621 A JP 2009259621A JP 2009259621 A JP2009259621 A JP 2009259621A JP 2011109216 A JP2011109216 A JP 2011109216A
Authority
JP
Japan
Prior art keywords
encoding
image
correlation
quantization parameter
picture
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
JP2009259621A
Other languages
Japanese (ja)
Inventor
Kazuhiro Wake
一博 和気
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.)
Panasonic Corp
Original Assignee
Panasonic Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp filed Critical Panasonic Corp
Priority to JP2009259621A priority Critical patent/JP2011109216A/en
Publication of JP2011109216A publication Critical patent/JP2011109216A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve the following problem: when a feature of an image significantly varies like a scene change in moving image encoding, large increase of a calculation volume occurs. <P>SOLUTION: The encoding method includes: a correlation calculation step (S201) of calculating a correlation value related to an image of an encoding object; a quantization parameter determination step (S202) of determining a quantization parameter in performing encoding by using the correlation value calculated in the correlation calculation step (S201) based on a correspondence relation between the correlation value and a quantization parameter in performing encoding; and an encoding step (S203) of encoding the image using the quantization parameter determined in the quantization parameter determination step (S202). <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、動画像の符号化に係り、特に、効率的な並列処理を可能とする動画像の符号化方法、および符号化プログラムに関するものである。   The present invention relates to moving image encoding, and more particularly to a moving image encoding method and encoding program that enable efficient parallel processing.

近年、AV情報のデジタル化が進み、映像信号をデジタル化して取り扱うことのできる機器が広く普及しつつある。映像信号は膨大な情報量を有するので、記録容量や伝送効率を考慮して情報量を削減しつつ符号化することが一般的である。映像信号の符号化技術として、H.264という国際規格が定められており、実験結果によると、H.264規格は他の既存の符号化技術に比べ、約2倍の圧縮効率をもたらす。従って、H.264規格は、レコーダ記録、インターネットストリーミング等に非常に適した符号化方式である。   In recent years, digitalization of AV information has progressed and devices capable of digitizing and handling video signals are becoming widespread. Since a video signal has an enormous amount of information, encoding is generally performed while reducing the amount of information in consideration of recording capacity and transmission efficiency. As a video signal encoding technique, H.264 is used. An international standard called H.264 has been established. The H.264 standard provides approximately twice the compression efficiency compared to other existing coding technologies. Therefore, H.I. The H.264 standard is an encoding method that is very suitable for recorder recording, Internet streaming, and the like.

映像信号を符号化して、磁気テープや半導体メモリに記録するビデオレコーダでは、編集や変速再生等を考慮すると1フレームあるいは1フィールド(以降、ピクチャと表記する)の発生符号量が一定(固定長)であることが望ましい。発生符号量を固定長に収めるための従来技術として、特許文献1には、系が有する全ての量子化パラメータ(以降、Qpと表記する)のうち、任意のQpを候補として選択し、実際に候補Qpで符号化を行い、ある特定の目標符号量を超えない最大の符号量を実現する量子化パラメータを選択する技術が開示されている。しかしながら、特許文献1に開示の技術では非常に大きな演算量が必要となる。演算量を削減する従来技術として、図7に示す手法が広く知られている。   In a video recorder that encodes a video signal and records it on a magnetic tape or a semiconductor memory, the amount of generated code in one frame or one field (hereinafter referred to as a picture) is constant (fixed length) in consideration of editing, variable speed playback, etc. It is desirable that As a conventional technique for keeping the generated code amount at a fixed length, Patent Document 1 selects an arbitrary Qp as a candidate from all the quantization parameters (hereinafter referred to as Qp) of the system, and actually A technique is disclosed in which encoding is performed using a candidate Qp and a quantization parameter that realizes a maximum code amount that does not exceed a specific target code amount is selected. However, the technique disclosed in Patent Document 1 requires a very large amount of calculation. A technique shown in FIG. 7 is widely known as a conventional technique for reducing the amount of calculation.

図7において、ステップS600は、シーケンスに対して1度だけ実行される。ステップS602〜S606はフレーム画像、またはフィールド画像ごとに繰り返し実行される。   In FIG. 7, step S600 is performed only once for the sequence. Steps S602 to S606 are repeatedly executed for each frame image or field image.

まず、ステップS600でQp_prevの初期値として、(系が有する最大のQp)/2を設定する。この例では、Qp_prev=31とする。ステップS602で、Qp=Qp_prevとし、ステップS603で、当該ピクチャに対し、量子化パラメータQpを用いて符号化する。符号化対象ピクチャの符号化が終了した後、ステップS605において、ピクチャ符号量が目標符号量以下であるか否かが判定される。   First, in step S600, (the maximum Qp that the system has) / 2 is set as the initial value of Qp_prev. In this example, Qp_prev = 31. In step S602, Qp = Qp_prev, and in step S603, the picture is encoded using the quantization parameter Qp. After the encoding of the encoding target picture is completed, it is determined in step S605 whether or not the picture code amount is equal to or less than the target code amount.

ピクチャ符号量が目標符号量を超えていると判定されると、ステップS604でQp=Qp+1とし、ステップS603で再度、符号化を行う。以降、ステップS605でピクチャ符号量が目標符号量以下であると判定されるまで、同様の処理を繰り返す。   If it is determined that the picture code amount exceeds the target code amount, Qp = Qp + 1 is set in step S604, and encoding is performed again in step S603. Thereafter, the same processing is repeated until it is determined in step S605 that the picture code amount is equal to or less than the target code amount.

ピクチャ符号量が目標符号量以下であると判定されると、ステップS606でQp_prev=Qpとし、当該ピクチャの符号化処理を終了する。   If it is determined that the picture code amount is equal to or less than the target code amount, Qp_prev = Qp is set in step S606, and the encoding process of the picture is ended.

この手法において、発生符号量が目標符号量に対し著しく小さい場合には、Qp=Qp−1として、ステップ603で再符号化を行う分岐も考えられるが、説明の都合上省略する。   In this method, when the generated code amount is remarkably small with respect to the target code amount, a branch in which re-encoding is performed in step 603 with Qp = Qp−1 can be considered, but this is omitted for convenience of explanation.

特開平7−322203号公報JP 7-322203 A

しかしながら、これらの従来技術では、最終Qpを決定するための演算量が大きいという問題点がある。   However, these conventional techniques have a problem that the amount of calculation for determining the final Qp is large.

従来技術では、ピクチャ符号量が固定の符号量内に収まるまでQpを変化させて符号化処理を繰り返す事で固定長符号化を保証していた。当該ピクチャは、直前のピクチャの最終Qpを用いて符号化を開始するため、時間的相関が高い通常画像においては符号量が大きく変動する可能性は低く、最終Qp決定までの演算量の削減が期待できる。しかしながら、シーンチェンジのように画像の特徴が大きく変化する場合、ピクチャ符号量が固定の符号量内に収まるまで符号化を繰り返すことによる弊害が顕著になる。   In the prior art, fixed-length encoding is guaranteed by repeating the encoding process by changing Qp until the picture code amount falls within the fixed code amount. Since the picture starts to be encoded using the final Qp of the immediately preceding picture, it is unlikely that the code amount will fluctuate greatly in a normal image with a high temporal correlation, and the amount of computation until the final Qp determination is reduced. I can expect. However, when the image characteristics change greatly as in the case of a scene change, the adverse effect of repeating the encoding until the picture code amount falls within a fixed code amount becomes significant.

例えば、Qp_prev=26で、対象ピクチャがシーンチェンジ後の画像であり、最適なQpが35であったとする。これはQpが35以上になって初めて発生符号量が固定の符号量内に収まる事を意味している。従来例では、1回目の符号化でQp=26で符号化を行うが、発生符号量が目標符号量を超えているため、Qp=27に更新し、2回目の符号化を行う。2回目の符号化でQp=27で符号化を行うが、発生符号量が目標符号量を超えているため、Qp=28に更新して、3回目の符号化を行う。以降、Qp=35まで符号化を繰り返し、当該ピクチャのストリームを生成する。この場合、1枚のピクチャを符号化するために10回の符号化を繰り返したことになる。   For example, it is assumed that Qp_prev = 26, the target picture is an image after a scene change, and the optimum Qp is 35. This means that the generated code amount falls within the fixed code amount only when Qp becomes 35 or more. In the conventional example, encoding is performed with Qp = 26 in the first encoding, but since the generated code amount exceeds the target code amount, it is updated to Qp = 27 and the second encoding is performed. In the second encoding, encoding is performed with Qp = 27. However, since the generated code amount exceeds the target code amount, it is updated to Qp = 28 and the third encoding is performed. Thereafter, encoding is repeated until Qp = 35, and a stream of the picture is generated. In this case, the encoding is repeated 10 times to encode one picture.

以上のことから、従来技術ではシーンチェンジなどのように画像の特徴が大きく変化した場合、大きな演算量の増加が発生する課題がある。   From the above, the conventional technique has a problem that a large increase in the amount of calculation occurs when the image characteristics change greatly, such as a scene change.

上記従来の課題を解決するために、本発明の符号化方法は、画像を符号化する符号化方法であって、符号化対象の画像に関する相関値を算出する相関算出工程と、相関値と符号化を行う際の量子化パラメータとの対応関係を基に、前記相関算出工程で算出した相関値を用いて、符号化を行う際の量子化パラメータを決定する量子化パラメータ決定工程と、前記量子化パラメータ決定工程で決定した量子化パラメータを用いて、画像を符号化する符号化工程と、を含む。   In order to solve the above conventional problems, an encoding method of the present invention is an encoding method for encoding an image, a correlation calculating step for calculating a correlation value for an image to be encoded, a correlation value and a code A quantization parameter determining step for determining a quantization parameter for encoding using the correlation value calculated in the correlation calculating step based on a correspondence relationship with a quantization parameter for encoding; An encoding step of encoding an image using the quantization parameter determined in the encoding parameter determination step.

本発明の符号化方法によれば、シーンチェンジのような画像の統計的特徴が大きく変わった場合においても演算量の増加を極力抑えることができる。   According to the encoding method of the present invention, an increase in the amount of calculation can be suppressed as much as possible even when the statistical characteristics of an image such as a scene change change greatly.

実施の形態1に係る符号化プログラムが動作するPCの構成を表すブロック図A block diagram showing the configuration of a PC on which the encoding program according to Embodiment 1 operates 実施の形態1に係る符号化方法の処理の流れを示すフローチャートFlowchart showing a processing flow of the encoding method according to the first embodiment. 実施の形態1に係る相関値と量子化パラメータとの関係を示す図The figure which shows the relationship between the correlation value which concerns on Embodiment 1, and a quantization parameter 実施の形態1、2に係るスライス分割を示す図The figure which shows the slice division which concerns on Embodiment 1,2. 実施の形態2に係る符号化方法の処理の流れを示すフローチャートThe flowchart which shows the flow of a process of the encoding method which concerns on Embodiment 2. FIG. 実施の形態2に係る量子化パラメータの変化を説明する図The figure explaining the change of the quantization parameter which concerns on Embodiment 2. FIG. 従来の符号化方法の処理の流れを示すフローチャートThe flowchart which shows the flow of a process of the conventional encoding method

以下、実施の形態について、図面を参照しながら説明する。   Hereinafter, embodiments will be described with reference to the drawings.

(実施の形態1)
図1は、実施の形態1に係る符号化方法を実行する符号化プログラムが動作するPC(パーソナルコンピュータ)100の構成を表すブロック図である。図1において、CPU101はシステム制御部であり、装置全体を制御する。ROM102は、CPU101上で動作する符号化プログラムを格納するメモリである。CPU101は、ROM102に格納された符号化プログラムを読み出し、読み出した符号化プログラムを動作させる。ROM102は、他の制御プログラムや各種固定データが格納される。RAM103は、SRAM、DRAMなどで構成され、プログラム制御変数などを格納するためのメモリである。また、各種設定パラメータ、各種ワーク用バッファもRAM103に格納される。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of a PC (personal computer) 100 on which an encoding program for executing an encoding method according to Embodiment 1 operates. In FIG. 1, a CPU 101 is a system control unit and controls the entire apparatus. The ROM 102 is a memory that stores an encoding program that runs on the CPU 101. The CPU 101 reads the encoding program stored in the ROM 102 and operates the read encoding program. The ROM 102 stores other control programs and various fixed data. The RAM 103 is composed of SRAM, DRAM, etc., and is a memory for storing program control variables. Various setting parameters and various work buffers are also stored in the RAM 103.

操作部104はキーボードやマウス、タッチパネルなどで構成され、オペレータが各種入力操作を行うための指示入力装置である。表示部105は、画像を含む各種情報を表示するディスプレイ装置である。   The operation unit 104 includes a keyboard, a mouse, a touch panel, and the like, and is an instruction input device for an operator to perform various input operations. The display unit 105 is a display device that displays various types of information including images.

記録媒体107は、符号化すべき画像データが格納されており、また符号化した結果、生成される画像データが格納される。記録媒体107は、ハードディスクや、半導体メモリカード等で構成される。記録媒体107は、PC100に内蔵されていてもよいし、PC100から着脱自在であってもよい。   The recording medium 107 stores image data to be encoded, and stores image data generated as a result of encoding. The recording medium 107 is composed of a hard disk, a semiconductor memory card, or the like. The recording medium 107 may be built in the PC 100 or detachable from the PC 100.

記録媒体制御部106は、記録媒体107に記録された画像データを含む各種情報の読み出し、記録媒体107への情報の書き込みを制御する制御部である。記録媒体制御部106は、CPU101の制御に基づき、記録媒体107に記録された符号化すべき画像データを読み出し、また、符号化後の画像データを記録媒体107に書き込む。   The recording medium control unit 106 is a control unit that controls reading of various information including image data recorded on the recording medium 107 and writing of information to the recording medium 107. The recording medium control unit 106 reads out the image data to be encoded recorded on the recording medium 107 based on the control of the CPU 101, and writes the encoded image data into the recording medium 107.

外部i/f部108は、外部装置との間で画像データを含む各種情報をやりとりするインタフェース部である。符号化すべき画像データは、記録媒体107に格納されている形態に加えて、外部i/f部108を介して、外部装置から入力される。符号化後の画像データは、記録媒体107に格納される形態に加えて、外部i/f部108を介して、外部装置に出力してもよい。外部i/f部108として、例えばSDI(Serial Digital Interface)や、LAN等が用いられる。   The external i / f unit 108 is an interface unit that exchanges various types of information including image data with an external device. The image data to be encoded is input from an external device via the external i / f unit 108 in addition to the form stored in the recording medium 107. The encoded image data may be output to an external device via the external i / f unit 108 in addition to the form stored in the recording medium 107. As the external i / f unit 108, for example, SDI (Serial Digital Interface), LAN, or the like is used.

次に、実施の形態1に係る動画像の符号化方法について、図2に示すフローチャートを用いて、その動作を説明する。   Next, the operation of the moving picture coding method according to Embodiment 1 will be described using the flowchart shown in FIG.

同図において、まず、ステップS201で、符号化対象ピクチャに関する相関値valを検出する。相関値としては、符号化対象ピクチャの複雑度を示す指標となるものが望ましく、本実施の形態1では、動き補償により算出された差分画像の画素の絶対値和を用いる。この他にも差分画像に直交変換を行い、変換係数の絶対値和を相関値として用いても構わない。   In the figure, first, in step S201, a correlation value val related to a picture to be encoded is detected. The correlation value is desirably an index indicating the complexity of the encoding target picture. In the first embodiment, the sum of absolute values of pixels of the difference image calculated by motion compensation is used. In addition, orthogonal transformation may be performed on the difference image, and the absolute value sum of the transform coefficients may be used as the correlation value.

ステップS202において、相関値valに応じたQpが設定される。続いて、ステップS203で、当該ピクチャについて量子化パラメータQpを用いて符号化する。符号化対象ピクチャの符号化が終了した後、ステップS204において、ピクチャ符号量が目標符号量以下であるか否かが判定される。   In step S202, Qp corresponding to the correlation value val is set. Subsequently, in step S203, the picture is encoded using the quantization parameter Qp. After the encoding of the encoding target picture is completed, it is determined in step S204 whether the picture code amount is equal to or less than the target code amount.

ピクチャ符号量が目標符号量を超えていると判定されると、ステップS205でQp=Qp+1とし、ステップS203で再度、符号化を行う。以降、ステップS204でピクチャ符号量が目標符号量以下であると判定されるまで、同様の処理を繰り返す。   If it is determined that the picture code amount exceeds the target code amount, Qp = Qp + 1 is set in step S205, and encoding is performed again in step S203. Thereafter, the same processing is repeated until it is determined in step S204 that the picture code amount is equal to or less than the target code amount.

ピクチャ符号量が目標符号量以下であると判定されると、当該ピクチャの符号化処理を終了する。   When it is determined that the picture code amount is equal to or less than the target code amount, the encoding process of the picture is ended.

ステップS202において、相関値valの値に応じてQpが決定されることについて、図3を用いてさらに詳しく説明する。   The determination of Qp in accordance with the correlation value val in step S202 will be described in more detail with reference to FIG.

相関値valは符号化対象となる信号に対して算出した値であり、フレーム内符号化においてはイントラ予測後の差分画像の画素値の絶対値和、フレーム間符号化においては動き補償後の差分画像の画素値の絶対値和とする。画像の画素値の分布は広範囲にわたっており、画像によるばらつきも大きいが、差分画像の画素値はラプラス分布と呼ばれるゼロを中心とした非常に狭い範囲に分布し、画像によるばらつきも小さくなる。符号化対象となる差分画像の画素値の絶対値和は、符号化における画像の複雑さを示しており、量子化後の発生符号量に対し、一定の比例関係を見ることができる。また、H.264において、量子化パラメータQpが6増加すると、量子化ステップが2倍になる性質を持っている。量子化ステップが2倍になった場合、局所的な誤差はあるものの、画像全体では発生符号量は1/2倍になると考えられる。これらのことから、Qp、符号化対象画像の複雑さとしての指標である差分画像の画素値の絶対値和、及び発生符号量には一定の関係が存在する。   The correlation value val is a value calculated with respect to a signal to be encoded. In intra-frame encoding, the sum of absolute values of pixel values of a difference image after intra prediction. In inter-frame encoding, a difference after motion compensation. The absolute value sum of the pixel values of the image. The pixel value distribution of the image is wide, and there is a large variation depending on the image, but the pixel value of the difference image is distributed in a very narrow range centered on zero called the Laplace distribution, and the variation due to the image is also small. The absolute value sum of the pixel values of the difference image to be encoded indicates the complexity of the image in encoding, and a certain proportional relationship can be seen with respect to the generated code amount after quantization. H. In H.264, when the quantization parameter Qp increases by 6, the quantization step is doubled. When the quantization step is doubled, the generated code amount is considered to be ½ times in the entire image although there is a local error. For these reasons, there is a certain relationship between Qp, the sum of absolute values of the pixel values of the difference image, which is an index as the complexity of the encoding target image, and the generated code amount.

いま、発生符号量を固定の値としたとき、Qpと相関値valの関係を図3のように定義する。前述のように、差分画像の画素値は、画像によらず特定の分布になる事から、val_tとQp_tの値は、使用する量子化マトリクス、目標とする発生符号量が決まれば、テスト画像から実際にQpと発生符号量の統計を取ることで算出する事ができる。すなわち、符号化開始前に、val_tとQp_tはあらかじめ設定する事ができる。例えば、量子化マトリクスに、H.264標準のマトリクスを使用し、ピクチャの目標発生符号量を1000ビット、val_tを30000としたとき、Qp_t=26に設定される。起点であるval_tとQp_tが決定されれば、同図に示す関係から相関値valとQpのテーブルを生成することが出来る。   Now, assuming that the generated code amount is a fixed value, the relationship between Qp and the correlation value val is defined as shown in FIG. As described above, since the pixel values of the difference image have a specific distribution regardless of the image, the values of val_t and Qp_t can be obtained from the test image if the quantization matrix to be used and the target generated code amount are determined. It can be calculated by actually taking statistics of Qp and the amount of generated code. That is, val_t and Qp_t can be set in advance before the start of encoding. For example, H. When a H.264 standard matrix is used, a target generated code amount of a picture is 1000 bits, and val_t is 30000, Qp_t = 26 is set. If the starting points val_t and Qp_t are determined, a table of correlation values val and Qp can be generated from the relationship shown in FIG.

したがって、符号化時に決定する目標発生符号量を基に、val_tとQp_tの値を決定し、その後、量子化パラメータと発生符号量の関係を用いて、図3に示す関係を表すテーブルを、符号化を開始する前にあらかじめ作成する。   Therefore, the values of val_t and Qp_t are determined based on the target generated code amount determined at the time of encoding, and then a table representing the relationship shown in FIG. 3 is expressed using the relationship between the quantization parameter and the generated code amount. Create in advance before starting.

ステップS202では、あらかじめ作成したテーブルを用いて、相関値valに応じたQpを決定する。   In step S202, Qp corresponding to the correlation value val is determined using a table created in advance.

なお、本実施の形態1では、図3に示す関係を表すテーブルを作成するとしたが、相関値valと量子化パラメータQpとの関係を表す関係式をあらかじめ導出し、関係式に基づき、相関値valに応じたQpを決定するとしてもよい。   In the first embodiment, the table representing the relationship shown in FIG. 3 is created. However, a relational expression representing the relation between the correlation value val and the quantization parameter Qp is derived in advance, and the correlation value is based on the relational expression. Qp corresponding to val may be determined.

本実施の形態1の符号化方法は、画像を複数の領域に分割し、領域毎に並列して符号化を行う場合にも、非常に効果的である。   The encoding method according to the first embodiment is very effective even when an image is divided into a plurality of regions and encoding is performed in parallel for each region.

例えば、符号化対象ピクチャを図4に示すように4つの領域310〜313に分割し、ステップS203において、各領域を並列で符号化することにより、符号化を大幅に高速化することができる。   For example, the encoding target picture is divided into four areas 310 to 313 as shown in FIG. 4, and each area is encoded in parallel in step S <b> 203, so that the encoding speed can be greatly increased.

このように、本実施の形態1の符号化方法は、画像の相関値を動き補償により算出された差分画像の画素の絶対値和より求め、符号化時の目標発生符号量を基に、相関値と量子化パラメータとの関係を導出し、導出した関係を基に、算出した相関値を用いて量子化パラメータを決定し、その量子化パラメータを用いて、符号化を行うことによって、符号化時に用いる量子化パラメータを適切に設定することができ、演算量の増加を極力抑えることができる。   As described above, in the encoding method of the first embodiment, the correlation value of the image is obtained from the absolute value sum of the pixels of the difference image calculated by motion compensation, and the correlation is based on the target generated code amount at the time of encoding. By deriving the relationship between the value and the quantization parameter, determining the quantization parameter using the calculated correlation value based on the derived relationship, and performing the encoding using the quantization parameter The quantization parameter used sometimes can be set appropriately, and an increase in the amount of calculation can be suppressed as much as possible.

(実施の形態2)
実施の形態2に係る符号化方法を実行するPCの構成に関しては、実施の形態1と同様であり、説明を省略する。
(Embodiment 2)
The configuration of the PC that executes the encoding method according to the second embodiment is the same as that of the first embodiment, and a description thereof will be omitted.

実施の形態2に係る動画像の符号化方法の動作について、図5に示すフローチャートを用いて説明する。   The operation of the moving picture coding method according to Embodiment 2 will be described using the flowchart shown in FIG.

同図において、ステップS400は、シーケンスに対して1度だけ実行される。ステップS402〜S409はフレーム画像、またはフィールド画像ごとに繰り返し実行される。   In the figure, step S400 is executed only once for the sequence. Steps S402 to S409 are repeatedly executed for each frame image or field image.

まず、ステップS400でQp_init、及びQp_prevの初期値として、(系が有する最大のQp)/2を設定する。この例では、Qp_init=Qp_prev=31とする。ステップS402で、符号化対象ピクチャと直前に符号化されたピクチャとの相関値valを検出する。相関値としては、符号化対象ピクチャと、その直前に符号化されたピクチャとの相関を示す指標となるものが望ましく、本実施の形態2では、当該ピクチャと直前に符号化したピクチャとの差分画像の絶対値和を用いる。この他にも差分画像に直交変換を行い、変換係数の絶対値和を相関値として用いても構わない。   First, in step S400, (the maximum Qp that the system has) / 2 is set as the initial value of Qp_init and Qp_prev. In this example, Qp_init = Qp_prev = 31. In step S402, a correlation value val between the encoding target picture and the picture encoded immediately before is detected. The correlation value is preferably an index indicating the correlation between the current picture to be coded and the picture coded immediately before. In the second embodiment, the difference between the picture and the picture coded immediately before is desirable. Use the sum of absolute values of the image. In addition, orthogonal transformation may be performed on the difference image, and the absolute value sum of the transform coefficients may be used as the correlation value.

ステップS403において、相関値valが特定の閾値以下であるか否かが判定される。valが特定の閾値以下であると判定された場合、当該ピクチャは直前に符号化されたピクチャと相関が高いとみなされ、当該ピクチャの最適Qpは直前に符号化されたピクチャのQpであるQp_prevに近い値を取ると予想される。これにより、ステップS404で、Qp=Qp_prevとする。   In step S403, it is determined whether or not the correlation value val is equal to or less than a specific threshold value. If it is determined that val is equal to or less than a specific threshold, the picture is considered to have a high correlation with the picture coded immediately before, and the optimum Qp of the picture is Qp_prev which is the Qp of the picture coded immediately before. Expected to be close to. Accordingly, in step S404, Qp = Qp_prev is set.

これとは逆に、相関値valが特定の閾値より大きいと判定された場合、当該ピクチャは直前に符号化されたピクチャと相関が低いとみなされ、当該ピクチャの最適QpはQp_prevから外れた値を取ると予想される。これにより、ステップS405で、Qp=Qp_initとする。   On the other hand, if it is determined that the correlation value val is greater than a specific threshold, the picture is considered to have a low correlation with the picture coded immediately before, and the optimum Qp of the picture is a value deviating from Qp_prev. Expected to take. Thereby, in step S405, Qp = Qp_init is set.

続いて、ステップS406で、当該ピクチャについて量子化パラメータQpを用いて符号化する。符号化対象ピクチャの符号化が終了した後、ステップS407において、ピクチャ符号量が目標符号量以下であるか否かが判定される。   Subsequently, in step S406, the picture is encoded using the quantization parameter Qp. After the encoding of the encoding target picture is completed, it is determined in step S407 whether or not the picture code amount is equal to or less than the target code amount.

ピクチャ符号量が目標符号量を超えていると判定されると、ステップS408でQp=Qp+1とし、ステップS406で再度、符号化を行う。以降、ステップS407でピクチャ符号量が目標符号量以下であると判定されるまで、同様の処理を繰り返す。   If it is determined that the picture code amount exceeds the target code amount, Qp = Qp + 1 is set in step S408, and encoding is performed again in step S406. Thereafter, the same processing is repeated until it is determined in step S407 that the picture code amount is equal to or less than the target code amount.

ピクチャ符号量が目標符号量以下であると判定されると、ステップS409でQp_prev=Qpとし、当該ピクチャの符号化処理を終了する。   If it is determined that the picture code amount is equal to or less than the target code amount, Qp_prev = Qp is set in step S409, and the encoding process of the picture is ended.

ステップS403〜S405において、相関値valの値に応じてQpが決定されることについて、図6を用いてさらに詳しく説明する。   The determination of Qp according to the correlation value val in steps S403 to S405 will be described in more detail with reference to FIG.

図6において、ピクチャ0、ピクチャ1、およびピクチャ2は連続する動画の一部であり、ピクチャ2でシーンチェンジが発生している。ピクチャ0、1、2の最適Qpは、それぞれ、26、26、35であった。これはピクチャ0に対し、目標符号量を超えない最大の符号量を与えるQpが26であったことを示している。   In FIG. 6, picture 0, picture 1, and picture 2 are part of a continuous moving image, and a scene change has occurred in picture 2. The optimum Qp for pictures 0, 1 and 2 were 26, 26 and 35, respectively. This indicates that Qp which gives the maximum code amount not exceeding the target code amount for picture 0 is 26.

各ピクチャの相関値valが、それぞれ、ピクチャ0で1000、ピクチャ1で1000、ピクチャ2で40000、また、閾値が20000であったとする。このとき、ステップS403は、以下に示す判定を行う。   Assume that the correlation value val of each picture is 1000 for picture 0, 1000 for picture 1, 40000 for picture 2, and a threshold value 20000. At this time, step S403 performs the following determination.

まずピクチャ0について、相関値valが1000であり、閾値20000より小さいため、直前に符号化されたピクチャとの相関が高いとみなされる。これによりピクチャ0のQpは、Qp_prevの値である26に設定される。   First, since the correlation value val for picture 0 is 1000 and is smaller than the threshold value 20000, it is considered that the correlation with the picture coded immediately before is high. As a result, Qp of picture 0 is set to 26, which is the value of Qp_prev.

続いてピクチャ1について、相関値valが1000であり、閾値20000より小さいため、直前に符号化されたピクチャとの相関が高いとみなされる。これによりピクチャ1のQpは、Qp_prevの値である26に設定される。   Subsequently, for picture 1, since the correlation value val is 1000 and is smaller than the threshold value 20000, it is considered that the correlation with the picture coded immediately before is high. As a result, Qp of picture 1 is set to 26, which is the value of Qp_prev.

続いてピクチャ2について、相関値valが40000であり、閾値20000より大きいため、直前に符号化されたピクチャとの相関が低いとみなされる。これによりピクチャ2のQpは、Qp_initの値である31に設定される。   Subsequently, for picture 2, since the correlation value val is 40000 and is larger than the threshold value 20000, it is considered that the correlation with the picture coded immediately before is low. As a result, Qp of picture 2 is set to 31, which is the value of Qp_init.

これに対し従来例では、画像の相関にかかわらず直前に符号化されたピクチャのQpが使用されるため、各ピクチャのQpは全て26となる。従来例と本実施の形態2において、各ピクチャに対し符号化を行ったとき、ピクチャの符号化終了までに要する符号化回数について比較を行う。   On the other hand, in the conventional example, the Qp of the picture encoded immediately before is used regardless of the correlation of the images, so that the Qp of each picture is 26. In the conventional example and the second embodiment, when each picture is encoded, the number of encodings required until the end of the picture encoding is compared.

まずピクチャ0について、最適Qpは26である。従来例において、Qp=26としてステップS603で符号化を行う。ステップS605でピクチャ発生符号量と目標符号量の比較を行い、ピクチャ発生符号量が目標符号量以下であると判定され、符号化を終了する。当該ピクチャの符号化終了までに要した符号化回数は1回である。本実施の形態2において、Qp=26としてステップS406で符号化を行う。ステップS407でピクチャ発生符号量と目標符号量の比較を行い、ピクチャ発生符号量が目標符号量以下であると判定され、符号化を終了する。当該ピクチャの符号化終了までに要した符号化回数は1回である。   First, for picture 0, the optimum Qp is 26. In the conventional example, encoding is performed in step S603 with Qp = 26. In step S605, the picture generation code amount is compared with the target code amount, it is determined that the picture generation code amount is equal to or less than the target code amount, and the encoding is terminated. The number of encodings required until the end of encoding the picture is one. In the second embodiment, encoding is performed in step S406 with Qp = 26. In step S407, the picture generation code amount is compared with the target code amount, it is determined that the picture generation code amount is equal to or less than the target code amount, and the encoding is terminated. The number of encodings required until the end of encoding the picture is one.

続いてピクチャ1について、最適Qpは26である。従来例において、Qp=26としてステップS603で符号化を行う。ステップS605でピクチャ発生符号量と目標符号量の比較を行い、ピクチャ発生符号量が目標符号量以下であると判定され、符号化を終了する。当該ピクチャの符号化終了までに要した符号化回数は1回である。本実施の形態2において、Qp=26としてステップS406で符号化を行う。ステップS407でピクチャ発生符号量と目標符号量の比較を行い、ピクチャ発生符号量が目標符号量以下であると判定され、符号化を終了する。当該ピクチャの符号化終了までに要した符号化回数は1回である。   Subsequently, for picture 1, the optimum Qp is 26. In the conventional example, encoding is performed in step S603 with Qp = 26. In step S605, the picture generation code amount is compared with the target code amount, it is determined that the picture generation code amount is equal to or less than the target code amount, and the encoding is terminated. The number of encodings required until the end of encoding the picture is one. In the second embodiment, encoding is performed in step S406 with Qp = 26. In step S407, the picture generation code amount is compared with the target code amount, it is determined that the picture generation code amount is equal to or less than the target code amount, and the encoding is terminated. The number of encodings required until the end of encoding the picture is one.

続いてピクチャ2について、最適Qpは35である。従来例において、Qp=26としてステップS603で符号化を行う。ステップS605でピクチャ発生符号量と目標符号量の比較を行い、ピクチャ発生符号量が目標符号量以下でないと判定され、ステップS604でQp=27に更新される。Qp=27としてステップS603で符号化を行う。以降、同様の処理を行い、Qp=35で符号化を終了する。当該ピクチャの符号化終了までに要した符号化回数は10回である。本実施の形態2において、Qp=31としてステップS406で符号化を行う。ステップS407でピクチャ発生符号量と目標符号量の比較を行い、ピクチャ発生符号量が目標符号量以下でないと判定され、ステップS408でQp=27に更新される。Qp=27としてステップS406で符号化を行う。以降、同様の処理を行い、Qp=35で符号化を終了する。当該ピクチャの符号化終了までに要した符号化回数は5回である。   Subsequently, for picture 2, the optimum Qp is 35. In the conventional example, encoding is performed in step S603 with Qp = 26. In step S605, the picture generation code amount is compared with the target code amount, and it is determined that the picture generation code amount is not less than or equal to the target code amount. In step S604, Qp = 27 is updated. Encoding is performed in step S603 with Qp = 27. Thereafter, the same processing is performed, and the encoding is finished at Qp = 35. The number of encodings required to complete the encoding of the picture is 10 times. In the second embodiment, encoding is performed in step S406 with Qp = 31. In step S407, the picture generation code amount is compared with the target code amount, and it is determined that the picture generation code amount is not less than or equal to the target code amount. In step S408, Qp = 27 is updated. Encoding is performed in step S406 with Qp = 27. Thereafter, the same processing is performed, and the encoding is finished at Qp = 35. The number of encodings required until the end of encoding the picture is five.

本実施の形態2の符号化方法は、画像を複数の領域に分割し、領域毎に並列して符号化を行う場合にも、非常に効果的である。   The encoding method of the second embodiment is very effective even when an image is divided into a plurality of regions and encoding is performed in parallel for each region.

例えば、符号化対象ピクチャを図4に示すように4つの領域310〜313に分割し、ステップS406において、各領域を並列で符号化することにより、符号化を大幅に高速化することができる。   For example, the picture to be encoded is divided into four areas 310 to 313 as shown in FIG. 4, and each area is encoded in parallel in step S406, so that the encoding speed can be significantly increased.

以上のように、本実施の形態2の符号化方法によれば、符号化対象ピクチャと直前に符号化したピクチャとの差分画像の絶対値和から相関値を算出し、その相関値が閾値を越える場合は、量子化パラメータとして初期値を用いることによって、符号化対象ピクチャの発生符号量を目標符号量以下にするための符号化回数を減らすことができ、シーンチェンジのような画像の統計的特徴が大きく変わった場合においても演算量の増加を極力抑えることができる。   As described above, according to the encoding method of the second embodiment, the correlation value is calculated from the sum of absolute values of the difference image between the encoding target picture and the picture encoded immediately before, and the correlation value has a threshold value. If this is exceeded, by using the initial value as the quantization parameter, it is possible to reduce the number of times of encoding to make the generated code amount of the encoding target picture equal to or less than the target code amount. Even when the characteristics change greatly, an increase in the amount of calculation can be suppressed as much as possible.

本実施の形態による符号化方法によれば、シーンチェンジのような画像の統計的特徴が大きく変わった場合においても演算量の増加を極力抑えることができるため、ノンリニア編集機で動作するソフトエンコーダなどに有用である。   According to the encoding method according to the present embodiment, an increase in the amount of calculation can be suppressed as much as possible even when the statistical characteristics of an image such as a scene change greatly change. Useful for.

100 PC
101 CPU
102 ROM
103 RAM
104 操作部
105 表示部
106 記録媒体制御部
107 記録媒体
108 外部i/f部
100 PC
101 CPU
102 ROM
103 RAM
104 Operation unit 105 Display unit 106 Recording medium control unit 107 Recording medium 108 External i / f unit

Claims (10)

画像を符号化する符号化方法であって、
符号化対象の画像に関する相関値を算出する相関算出工程と、
相関値と符号化を行う際の量子化パラメータとの対応関係を基に、前記相関算出工程で算出した相関値を用いて、符号化を行う際の量子化パラメータを決定する量子化パラメータ決定工程と、
前記量子化パラメータ決定工程で決定した量子化パラメータを用いて、画像を符号化する符号化工程と、
を含む符号化方法。
An encoding method for encoding an image, comprising:
A correlation calculating step of calculating a correlation value related to an image to be encoded;
Based on the correlation between the correlation value and the quantization parameter at the time of encoding, the quantization parameter determination step for determining the quantization parameter at the time of encoding using the correlation value calculated in the correlation calculation step When,
An encoding step of encoding an image using the quantization parameter determined in the quantization parameter determination step;
An encoding method including:
画像を符号化する符号化方法であって、
符号化対象の画像に関する相関値を算出する相関算出工程と、
前記相関算出工程で算出した相関値が所定の値を超える場合は、量子化パラメータとして初期値を用い、所定の値を越えない場合は、直前に符号化する際に用いた量子化パラメータを用いる量子化パラメータ決定工程と、
前記量子化パラメータ決定工程で決定した量子化パラメータを用いて、画像を符号化する符号化工程と、
を含む符号化方法。
An encoding method for encoding an image, comprising:
A correlation calculating step of calculating a correlation value related to an image to be encoded;
When the correlation value calculated in the correlation calculation step exceeds a predetermined value, the initial value is used as the quantization parameter, and when the correlation value does not exceed the predetermined value, the quantization parameter used when encoding immediately before is used. A quantization parameter determination step;
An encoding step of encoding an image using the quantization parameter determined in the quantization parameter determination step;
An encoding method including:
前記相関検出工程は、
符号化を行う画像と直前に符号化した画像との差分画素の画像全体の絶対値に基づき、相関値を算出する
請求項1、2の何れかに記載の符号化方法。
The correlation detection step includes
The encoding method according to claim 1, wherein a correlation value is calculated based on an absolute value of an entire image of difference pixels between an image to be encoded and an image encoded immediately before.
前記相関検出工程は、
動き補償後の残差画像の画素値の絶対値に基づき、相関値を算出する
請求項1、2の何れかに記載の符号化方法。
The correlation detection step includes
The encoding method according to claim 1, wherein a correlation value is calculated based on an absolute value of a pixel value of a residual image after motion compensation.
前記符号化工程は、
符号化対象の画像を複数の領域に分割し、領域ごとに並列して符号化を行う
請求項1から4の何れかに記載の符号化方法。
The encoding step includes
The encoding method according to any one of claims 1 to 4, wherein an image to be encoded is divided into a plurality of regions, and encoding is performed in parallel for each region.
画像を符号化するコンピュータで実行可能な符号化プログラムであって、
符号化対象の画像に関する相関値を算出する相関算出工程と、
相関値と符号化を行う際の量子化パラメータとの対応関係を基に、前記相関算出工程で算出した相関値を用いて、符号化を行う際の量子化パラメータを決定する量子化パラメータ決定工程と、
前記量子化パラメータ決定工程で決定した量子化パラメータを用いて、画像を符号化する符号化工程と、
を含む符号化プログラム。
A computer-executable encoding program for encoding an image,
A correlation calculating step of calculating a correlation value related to an image to be encoded;
Based on the correlation between the correlation value and the quantization parameter at the time of encoding, the quantization parameter determination step for determining the quantization parameter at the time of encoding using the correlation value calculated in the correlation calculation step When,
An encoding step of encoding an image using the quantization parameter determined in the quantization parameter determination step;
An encoding program including
画像信号を符号化するコンピュータで実行可能な符号化プログラムであって、
符号化対象の画像に関する相関値を算出する相関算出工程と、
前記相関算出工程で算出した相関値が所定の値を超える場合は、量子化パラメータとして初期値を用い、所定の値を越えない場合は、直前に符号化する際に用いた量子化パラメータを用いる量子化パラメータ決定工程と、
前記量子化パラメータ決定工程で決定した量子化パラメータを用いて、画像を符号化する符号化工程と、
を含む符号化プログラム。
A computer-executable encoding program for encoding an image signal,
A correlation calculating step of calculating a correlation value related to an image to be encoded;
When the correlation value calculated in the correlation calculation step exceeds a predetermined value, the initial value is used as the quantization parameter, and when the correlation value does not exceed the predetermined value, the quantization parameter used when encoding immediately before is used. A quantization parameter determination step;
An encoding step of encoding an image using the quantization parameter determined in the quantization parameter determination step;
An encoding program including
前記相関検出工程は、
符号化を行う画像と直前に符号化した画像との差分画素の画像全体の絶対値に基づき、相関値を算出する
請求項6、7の何れかに記載の符号化プログラム。
The correlation detection step includes
The encoding program according to any one of claims 6 and 7, wherein a correlation value is calculated based on an absolute value of an entire image of difference pixels between an image to be encoded and an image encoded immediately before.
前記相関検出工程は、
動き補償後の残差画像の画素値の絶対値に基づき、相関値を算出する
請求項6、7の何れかに記載の符号化プログラム。
The correlation detection step includes
The encoding program according to any one of claims 6 and 7, wherein a correlation value is calculated based on an absolute value of a pixel value of a residual image after motion compensation.
前記符号化工程は、
符号化対象の画像を複数の領域に分割し、領域ごとに並列して符号化を行う
請求項6から9の何れかに記載の符号化プログラム。
The encoding step includes
The encoding program according to any one of claims 6 to 9, wherein an encoding target image is divided into a plurality of regions, and encoding is performed in parallel for each region.
JP2009259621A 2009-11-13 2009-11-13 Encoding method, and encoding program Pending JP2011109216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009259621A JP2011109216A (en) 2009-11-13 2009-11-13 Encoding method, and encoding program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009259621A JP2011109216A (en) 2009-11-13 2009-11-13 Encoding method, and encoding program

Publications (1)

Publication Number Publication Date
JP2011109216A true JP2011109216A (en) 2011-06-02

Family

ID=44232264

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009259621A Pending JP2011109216A (en) 2009-11-13 2009-11-13 Encoding method, and encoding program

Country Status (1)

Country Link
JP (1) JP2011109216A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019176361A1 (en) * 2018-03-13 2019-09-19 株式会社日立国際電気 Video-encoding device and video-encoding method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019176361A1 (en) * 2018-03-13 2019-09-19 株式会社日立国際電気 Video-encoding device and video-encoding method
JP2019161424A (en) * 2018-03-13 2019-09-19 株式会社日立国際電気 Video encoder and video coding method

Similar Documents

Publication Publication Date Title
US8848799B2 (en) Utilizing thresholds and early termination to achieve fast motion estimation in a video encoder
JP6016332B2 (en) Image processing apparatus and image processing method
JP2007306619A (en) Computer execution method and recording medium for processing video image
JP2016226001A (en) Decoder and decoding method
KR20070110517A (en) Encoding device and dynamic image recording system having the encoding device
JP2007189276A (en) Image compression apparatus and image compression program
JPH07107300A (en) Picture encoding device
CN102187678A (en) Encoding method and encoding device for compression encoding of moving images
US11438594B2 (en) Block-based picture fusion for contextual segmentation and processing
CN112449182A (en) Video encoding method, device, equipment and storage medium
CN103517074A (en) Image encoding apparatus and control method thereof
JP3812808B2 (en) Skip region detection type moving image encoding apparatus and recording medium
JP2011109216A (en) Encoding method, and encoding program
TWI517673B (en) Dynamic image predictive coding method, dynamic image predictive coding program, dynamic image prediction decoding device, dynamic image prediction decoding method and dynamic image prediction decoding program
KR100907707B1 (en) High-speed extraction method of thumbnail images in H.264 / ACC compressed region, apparatus therefor, and recording medium recording the same
US20040042550A1 (en) Encoding system conversion apparatus and method for same
US11546597B2 (en) Block-based spatial activity measures for pictures
JP6080077B2 (en) Image encoding method and image encoding apparatus
JP2897035B2 (en) Video coding control method
RU2782583C1 (en) Block-based image merging for context segmentation and processing
JP2008098980A (en) Moving image encoding apparatus
JP5244479B2 (en) Image coding apparatus and image coding method
JPH08331556A (en) Image coder and image coding method
JP2009021786A (en) Image encoding device and method
JP4793150B2 (en) Video signal processing apparatus, video signal information processing method, and program