JP2009182810A - Target code amount calculating apparatus, method, and program - Google Patents

Target code amount calculating apparatus, method, and program Download PDF

Info

Publication number
JP2009182810A
JP2009182810A JP2008020992A JP2008020992A JP2009182810A JP 2009182810 A JP2009182810 A JP 2009182810A JP 2008020992 A JP2008020992 A JP 2008020992A JP 2008020992 A JP2008020992 A JP 2008020992A JP 2009182810 A JP2009182810 A JP 2009182810A
Authority
JP
Japan
Prior art keywords
image data
target code
code amount
encoding
region
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.)
Granted
Application number
JP2008020992A
Other languages
Japanese (ja)
Other versions
JP5157490B2 (en
Inventor
Meguri Takada
巡 高田
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2008020992A priority Critical patent/JP5157490B2/en
Publication of JP2009182810A publication Critical patent/JP2009182810A/en
Application granted granted Critical
Publication of JP5157490B2 publication Critical patent/JP5157490B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a target code amount calculating apparatus calculating a target code amount per an area to be encoded so as to reduce a difference in image quality between image data encoding areas when encoding and transmitting some areas in one frame. <P>SOLUTION: A total target code amount calculating part 2 calculates a total target code amount or a target code amount for the entire of each area to which image data is transmitted. A compressibility calculating part 3 divides the total target code amount by a sum data amount before encoding each area to which the image data is transmitted to calculate a compressibility. An area-based target code amount calculating part 4 multiplies a data amount before encoding by the compressibility per area to which the image data is transmitted to calculate the target code amount per area. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像データの符号化における符号化後のデータ量の最大許容値を表す目標符号量を算出する目標符号量算出装置、目標符号量算出方法および目標符号量算出プログラムに関する。   The present invention relates to a target code amount calculation device, a target code amount calculation method, and a target code amount calculation program for calculating a target code amount that represents a maximum allowable value of the amount of data after encoding in encoding of image data.

画像データを送受信する装置が種々提案されている。例えば、特許文献1には、画像データを送受信するシンクライアントおよびサーバが記載されている。   Various devices for transmitting and receiving image data have been proposed. For example, Patent Document 1 describes a thin client and a server that transmit and receive image data.

また、通信ネットワークを介して画像データを送受信する場合、データ量を圧縮するために画像データを符号化する場合がある。画像データを符号化する画像処理装置が、例えば、特許文献2に記載されている。特許文献2に記載の画像処理装置は、量子化およびデータの符号化を行い、符号化処理を進行しながら符号化データの量をカウントする。そして、符号化処理の途中で符号化データのデータ量が設定された目標符号量をオーバーする場合、量子化ステップを変更して符号化処理を再開し、既に符号化されたデータについても、再符号化を行う。   Further, when image data is transmitted / received via a communication network, the image data may be encoded in order to compress the data amount. An image processing apparatus that encodes image data is described in Patent Document 2, for example. The image processing apparatus described in Patent Document 2 performs quantization and data encoding, and counts the amount of encoded data while the encoding process proceeds. If the data amount of the encoded data exceeds the set target code amount in the middle of the encoding process, the quantization step is changed and the encoding process is resumed. Encoding is performed.

特開2004−228877号公報(段落0036−0041、図1)JP 2004-228877 A (paragraphs 0036-0041, FIG. 1) 特開2004−320479号公報(段落0044,0045、図3)Japanese Patent Laying-Open No. 2004-320479 (paragraphs 0044 and 0045, FIG. 3)

送信側装置と受信側装置とが画像データを送受信するシステムにおいて、符号化後のデータ量を目標符号量以下に抑えるように画像データを符号化する画像処理を送信側装置で行ってから、受信側装置に向けて送信するとする。この場合、送受信される符号化後のデータ量を目標符号量以下に制御しやすくなる。   In a system in which image data is transmitted and received between a transmission-side device and a reception-side device, image processing for encoding image data is performed at the transmission-side device so that the amount of encoded data is kept below the target code amount, and then reception is performed. Suppose that it is transmitted to the side device. In this case, it becomes easy to control the encoded data amount to be transmitted and received to be equal to or less than the target code amount.

また、画像データを他の装置に送信する態様として、画像のうち更新された領域を含む矩形領域の画像データを符号化して送信する送信態様が考えられる。この送信態様では、一部の領域の画像しか更新されていない場合に、画像全体を表す画像データを全て符号化して送信する必要がなくなり、一部の画像データを符号化して送信すればよいので、送信するデータ量を減らすことができる。   Further, as a mode of transmitting image data to another apparatus, a transmission mode of encoding and transmitting image data of a rectangular area including an updated area in the image is conceivable. In this transmission mode, when only a part of the image of the area is updated, it is not necessary to encode and transmit all the image data representing the entire image, and it is only necessary to encode and transmit a part of the image data. The amount of data to be transmitted can be reduced.

しかし、画像内において、更新された領域が複数あり、各領域の画像データをそれぞれ同じ目標符号量以下に符号化する場合、更新された個々の領域の面積の違いにより、符号化データの画質が領域毎に異なってしまうことがある。例えば、ある一画面内において、二つの領域A,Bが更新されたとする。この領域A,Bの面積は同程度であるとは限らないため、領域A,Bの画像データ量も同程度であるとは限らない。このような画像データを、それぞれ同じ目標符号量以下になるように符号化することにより、符号データの画質が領域Aと領域Bとで異なってしまうことがある。これらの領域における符号化したデータを復号すると、1つの画像中に属する領域間で互いに画質が異なることになってしまう。   However, when there are a plurality of updated regions in the image and the image data of each region is encoded to the same target code amount or less, the image quality of the encoded data is reduced due to the difference in the area of each updated region. May vary from region to region. For example, assume that two areas A and B are updated in one screen. Since the areas of the regions A and B are not necessarily the same, the image data amounts of the regions A and B are not necessarily the same. If such image data is encoded so as to be equal to or less than the same target code amount, the image quality of the code data may differ between the region A and the region B. If the encoded data in these areas is decoded, the image quality will be different between areas belonging to one image.

そこで、本発明は、1フレーム内の一部の領域を符号化して送信するときに、画像データを符号化する領域同士の間での画質の差を少なくするように、符号化対象の領域毎に目標符号量を算出することができる目標符号量算出装置、目標符号量算出方法および目標符号量算出プログラムを提供することを目的とする。   In view of this, the present invention relates to each encoding target region so as to reduce a difference in image quality between regions in which image data is encoded when a part of the region in one frame is encoded and transmitted. It is an object of the present invention to provide a target code amount calculation device, a target code amount calculation method, and a target code amount calculation program that can calculate a target code amount.

本発明の目標符号量算出装置は、1フレーム内の領域であって通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を算出する目標符号量算出装置であって、前記通信ネットワークの通信帯域を、予め定められたフレームレートで除算することにより、画像データが送信される各領域全体に対する目標符号量である全体目標符号量を算出する全体目標符号量算出手段と、前記全体目標符号量を、画像データが送信される前記各領域の符号化前の画像データの総データ量で除算することにより、画像データを符号化するときの圧縮率を算出する圧縮率算出手段と、画像データが送信される個々の領域毎に、当該領域の符号化前の画像データのデータ量に、前記圧縮率算出手段が算出した圧縮率を乗算して、当該領域の画像データを符号化するときの目標符号量を算出する領域別目標符号量算出手段とを備えることを特徴とする。   A target code amount calculation apparatus according to the present invention calculates a target code amount when encoding image data in an area within one frame in which image data is transmitted via a communication network. An overall target code amount for calculating an overall target code amount that is a target code amount for the entire region in which image data is transmitted by dividing the communication band of the communication network by a predetermined frame rate. And calculating a compression rate when encoding the image data by dividing the overall target code amount by the total data amount of the image data before encoding in each region to which the image data is transmitted. For each area where image data is transmitted, the compression rate calculation means multiplies the data amount of the image data before encoding in the area by the compression ratio calculated by the compression ratio calculation means. To, characterized in that it comprises a region-specific target code amount calculation means for calculating a target code amount when encoding the image data of the region.

また、本発明の目標符号量算出方法は、1フレーム内の領域であって通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を算出する目標符号量算出方法であって、前記通信ネットワークの通信帯域を、予め定められたフレームレートで除算することにより、画像データが送信される各領域全体に対する目標符号量である全体目標符号量を算出し、前記全体目標符号量を、画像データが送信される前記各領域の符号化前の画像データの総データ量で除算することにより、画像データを符号化するときの圧縮率を算出し、画像データが送信される個々の領域毎に、当該領域の符号化前の画像データのデータ量に、算出した圧縮率を乗算して、当該領域の画像データを符号化するときの目標符号量を算出することを特徴とする。   Further, the target code amount calculation method of the present invention is a target code amount for calculating a target code amount when encoding image data in an area within one frame and where image data is transmitted via a communication network. A calculation method, wherein a communication band of the communication network is divided by a predetermined frame rate to calculate an overall target code amount that is a target code amount for each entire region in which image data is transmitted, By dividing the overall target code amount by the total amount of image data before encoding of each area in which image data is transmitted, the compression rate when encoding the image data is calculated, and the image data is transmitted For each individual area, the target code amount when encoding the image data of the area is obtained by multiplying the data amount of the image data before the encoding of the area by the calculated compression rate. Characterized in that it out.

また、本発明の目標符号量算出プログラムは、1フレーム内の領域であって通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を算出するコンピュータに搭載される目標符号量算出プログラムであって、前記コンピュータに、前記通信ネットワークの通信帯域を、予め定められたフレームレートで除算することにより、画像データが送信される各領域全体に対する目標符号量である全体目標符号量を算出する全体目標符号量算出処理、前記全体目標符号量を、画像データが送信される前記各領域の符号化前の画像データの総データ量で除算することにより、画像データを符号化するときの圧縮率を算出する圧縮率算出処理、および、画像データが送信される個々の領域毎に、当該領域の符号化前の画像データのデータ量に、前記圧縮率算出処理で算出した圧縮率を乗算して、当該領域の画像データを符号化するときの目標符号量を算出する領域別目標符号量算出処理を実行させることを特徴とする。   The target code amount calculation program of the present invention is installed in a computer that calculates a target code amount when encoding image data in an area within one frame and where image data is transmitted via a communication network. The target code amount calculation program is a target code amount for the entire area in which image data is transmitted by dividing the communication bandwidth of the communication network by a predetermined frame rate to the computer. Overall target code amount calculation processing for calculating the overall target code amount, dividing the overall target code amount by the total data amount of the image data before encoding in each of the areas to which the image data is transmitted. Compression rate calculation processing for calculating the compression rate when encoding, and encoding of each region for each region where image data is transmitted Multiplying the data amount of the image data by the compression rate calculated in the compression rate calculation processing to execute a target code amount calculation processing for each region that calculates a target code amount when encoding the image data of the region It is characterized by that.

本発明によれば、1フレーム内の一部の領域を符号化して送信するときに、画像データを符号化する領域同士の間での画質の差を少なくするように、符号化対象の領域毎に目標符号量を算出することができる。   According to the present invention, when encoding and transmitting a partial area in one frame, each encoding target area is reduced so as to reduce a difference in image quality between areas in which image data is encoded. It is possible to calculate the target code amount.

以下、本発明の実施形態を図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the drawings.

実施形態1.
本発明の目標符号量算出装置は、画像データを符号化する処理における符号化後のデータ量の最大許容量を表す目標符号量を算出する。この目標符号量に応じて符号化されたデータは、通信ネットワークを介して画像データの受信側装置に向けて送信される。本発明の目標符号量算出装置は、1フレーム内の領域であって、通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を、それぞれの領域毎に算出する。また、1フレーム内の領域であって、通信ネットワークを介して画像データが送信される領域とは、具体的には、1フレームの中で、画像が更新された領域を含む領域である。図1は、画像データが符号化され送信される領域の例を示す模式図である。フレーム81内の領域のうち、破線で示した領域82,83において画像が更新され、領域82,83以外の領域では画像が更新されていないとする。この場合、領域82,83の画像データが符号化され、受信側装置に送信される。この例において、本発明の目標符号量算出装置は、領域82,83それぞれに対して、個別に目標符号量を算出する。そして、領域82,83の画像データは、各領域毎に目標符号量に応じて符号化され、送信される。
Embodiment 1. FIG.
The target code amount calculation apparatus of the present invention calculates a target code amount that represents the maximum allowable amount of data after encoding in the process of encoding image data. The data encoded according to the target code amount is transmitted to the image data receiving device via the communication network. The target code amount calculation apparatus according to the present invention calculates a target code amount for each region when encoding image data in a region within one frame and where image data is transmitted via a communication network. calculate. In addition, the area within one frame and where image data is transmitted via the communication network is specifically an area including an area in which an image is updated in one frame. FIG. 1 is a schematic diagram illustrating an example of an area where image data is encoded and transmitted. It is assumed that the image is updated in the regions 82 and 83 indicated by the broken lines among the regions in the frame 81, and the image is not updated in the regions other than the regions 82 and 83. In this case, the image data in the areas 82 and 83 is encoded and transmitted to the receiving side apparatus. In this example, the target code amount calculation apparatus of the present invention calculates the target code amount individually for each of the regions 82 and 83. The image data in the areas 82 and 83 is encoded and transmitted according to the target code amount for each area.

なお、図1に示す例では、画像データが符号化され送信される領域を2つ示しているが、1フレーム内において、画像データが符号化され送信される領域の数は特に限定されず、1つであっても、3つ以上であってもよい。   In the example shown in FIG. 1, two areas in which image data is encoded and transmitted are shown. However, the number of areas in which image data is encoded and transmitted in one frame is not particularly limited. There may be one or three or more.

図2は、本発明の目標符号量算出装置の第1の実施形態を示すブロック図である。本発明の目標符号量算出装置1は、全体目標符号量算出部(全体目標符号量算出手段)2と、圧縮率算出部(圧縮率算出手段)3と、領域別目標符号量算出部(領域別目標符号量算出手段)4とを備える。   FIG. 2 is a block diagram showing the first embodiment of the target code amount calculation apparatus of the present invention. The target code amount calculation apparatus 1 of the present invention includes an overall target code amount calculation unit (overall target code amount calculation unit) 2, a compression rate calculation unit (compression rate calculation unit) 3, and a target code amount calculation unit for each region (region A separate target code amount calculation means) 4.

全体目標符号量算出部2は、符号化された画像データが送信される通信ネットワークの通信帯域と、予め定められたフレームレートとに基づいて、全体目標符号量を算出する。全体目標符号量は、画像データが送信される各領域全体に対する目標符号量である。図1に示す例では、全体目標符号量は、画像データが送信される各領域81,82の画像データ全体を符号化するときにおける、許容し得る符号化後のデータ量の最大値(上限値)である。通信ネットワークの通信帯域は、例えば、外部から入力されればよい。また、フレームレートは、画像データの受信側装置のフレームレートであり、例えば、目標符号量算出装置1が備える記憶装置(図示せず。)に予め記憶させておけばよい。全体目標符号量算出部2は、通信ネットワークの通信帯域をフレームレートで除算することによって、全体目標符号量を算出する。   The overall target code amount calculation unit 2 calculates the overall target code amount based on a communication band of a communication network to which encoded image data is transmitted and a predetermined frame rate. The overall target code amount is a target code amount for each entire region in which image data is transmitted. In the example illustrated in FIG. 1, the overall target code amount is the maximum allowable amount of data after encoding (upper limit value) when encoding the entire image data in each of the regions 81 and 82 to which image data is transmitted. ). The communication band of the communication network may be input from the outside, for example. The frame rate is the frame rate of the image data receiving device, and may be stored in advance in a storage device (not shown) included in the target code amount calculation device 1, for example. The overall target code amount calculation unit 2 calculates the overall target code amount by dividing the communication band of the communication network by the frame rate.

圧縮率算出部3は、画像データが送信される各領域の画像データを符号化するときの圧縮率を算出する。圧縮率算出部3は、全体目標符号量算出部2によって算出された全体目標符号量を、画像データが送信される各領域の符号化前の画像データの総データ量で除算して圧縮率を求める。例えば、図1に示す例では、全体目標符号量を、各領域81,82それぞれの符号化前の画像データ量の合計で除算することにより圧縮率を算出する。本実施形態において圧縮率算出部3が算出した圧縮率は、各領域の画像データを領域毎に符号化する際における共通の圧縮率である。   The compression rate calculation unit 3 calculates the compression rate when encoding the image data of each region to which the image data is transmitted. The compression rate calculation unit 3 divides the overall target code amount calculated by the overall target code amount calculation unit 2 by the total data amount of the image data before encoding in each region to which the image data is transmitted, and thereby calculates the compression rate. Ask. For example, in the example shown in FIG. 1, the compression rate is calculated by dividing the overall target code amount by the sum of the image data amounts before encoding of the regions 81 and 82. In the present embodiment, the compression rate calculated by the compression rate calculation unit 3 is a common compression rate when the image data of each region is encoded for each region.

なお、画像データが送信される個々の領域における符号化前のデータ量は、外部から指定されてもよい。あるいは、目標符号量算出装置自身が、画像データが符号化され送信対象となる個々の領域(すなわち、1フレーム内において画像が書き換えられた領域)を特定し、各領域の画像データ量、およびその総データ量を計算してもよい。   Note that the amount of data before encoding in each region to which image data is transmitted may be designated from the outside. Alternatively, the target code amount calculation device itself identifies individual regions (that is, regions in which an image is rewritten within one frame) encoded with image data, and the amount of image data in each region and The total amount of data may be calculated.

領域別目標符号量算出部4は、画像データが送信される各領域毎に、それぞれの領域の画像データを符号化するときの目標符号量を算出する。領域別目標符号量算出部4は、画像データが送信される個々の領域をそれぞれ選択し、その領域の符号化前の画像データのデータ量に、圧縮率算出部3が算出した圧縮率を乗じることによって、領域毎の目標符号量を算出する。   The target code amount calculation unit 4 for each region calculates a target code amount for encoding the image data of each region for each region to which the image data is transmitted. The region-specific target code amount calculation unit 4 selects each region to which image data is transmitted, and multiplies the data amount of the image data before encoding in that region by the compression rate calculated by the compression rate calculation unit 3. Thus, the target code amount for each region is calculated.

全体目標符号量算出部2、圧縮率算出部3、領域別目標符号量算出部4は、例えば、プログラム(目標符号量算出プログラム)に従って動作するCPUによって実現されていてもよい。   The overall target code amount calculation unit 2, the compression rate calculation unit 3, and the region-specific target code amount calculation unit 4 may be realized by, for example, a CPU that operates according to a program (target code amount calculation program).

次に、動作について説明する。図3は、本発明の目標符号量算出装置の処理経過の一例を示すフローチャートである。まず、全体目標符号量算出部2は、通信ネットワークの通信帯域を受信装置側のフレームレートで除算することによって、全体目標符号量を算出する(ステップS61)。既に説明したように、通信ネットワークの通信帯域は、例えば、外部から入力されればよい。また、フレームレートは、例えば、目標符号量算出装置1が備える記憶装置(図示せず。)に予め記憶させておけばよい。   Next, the operation will be described. FIG. 3 is a flowchart showing an example of processing progress of the target code amount calculation apparatus of the present invention. First, the overall target code amount calculation unit 2 calculates the overall target code amount by dividing the communication band of the communication network by the frame rate on the receiving device side (step S61). As already described, the communication band of the communication network may be input from the outside, for example. The frame rate may be stored in advance in a storage device (not shown) provided in the target code amount calculation device 1, for example.

次に、圧縮率算出部3は、ステップS61で算出された全体目標符号量を、画像データが送信される各領域の符号化前の画像データの総データ量で除算することによって、符号化の際の圧縮率を算出する(ステップS62)。   Next, the compression rate calculation unit 3 divides the overall target code amount calculated in step S61 by the total data amount of the image data before encoding in each region to which the image data is transmitted, thereby performing encoding. The compression ratio is calculated (step S62).

次に、領域別目標符号量算出部4は、画像データが送信される個々の領域をそれぞれ選択し、その領域の符号化前の画像データのデータ量にステップS62で求めた圧縮率を乗算することによって、それぞれの領域毎の目標符号量を算出する(ステップS63)。   Next, the region-specific target code amount calculation unit 4 selects each region to which image data is transmitted, and multiplies the data amount of the image data before encoding in that region by the compression rate obtained in step S62. Thus, the target code amount for each area is calculated (step S63).

以上の動作によって求めた各領域毎の目標符号量を用いて、それぞれの領域の画像データを順次、目標符号量以下に符号化すればよい。この処理は、目標符号量算出装置自身が行ってもよく、また他の装置が行ってもよい。   Using the target code amount for each region obtained by the above operation, the image data of each region may be sequentially encoded below the target code amount. This process may be performed by the target code amount calculation apparatus itself or by another apparatus.

次に、本発明の動作について、具体例を挙げて説明する。以下に示す例では、通信ネットワークにおける通信帯域が3000kbpsであり、予め定められたフレームレートが30fpsであるとする。また、図4は、画像データが符号化され送信される領域の例を示す模式図であり、フレーム90内の領域のうち、破線で示した3つの矩形領域91〜93において画像が書き換えられ、矩形領域91〜93の画像データが符号されて送信されるものとする。以下、矩形領域91,92,93をそれぞれ、第1領域、第2領域、第3領域と記す。なお、図4に内に括弧で示した数値は、矩形領域の頂点部分の画素の座標である。   Next, the operation of the present invention will be described with a specific example. In the example shown below, it is assumed that the communication bandwidth in the communication network is 3000 kbps and the predetermined frame rate is 30 fps. FIG. 4 is a schematic diagram showing an example of an area where image data is encoded and transmitted. Among the areas in the frame 90, the image is rewritten in three rectangular areas 91 to 93 indicated by broken lines. It is assumed that the image data of the rectangular areas 91 to 93 is encoded and transmitted. Hereinafter, the rectangular areas 91, 92, and 93 are referred to as a first area, a second area, and a third area, respectively. Note that the numerical values shown in parentheses in FIG. 4 are the coordinates of the pixel at the apex of the rectangular area.

まず、全体目標符号量算出部2は、通信ネットワークの通信帯域3000kbpsをフレームレート30fpsで除算して、全体目標符号量を算出する(ステップS61)。本例では、全体目標符号量は、3000kbps/30fps=100kbitである。この全体目標符号量100kbitは、「第1領域91、第2領域92および第3領域93の画像データ全体を符号化するときには、符号化後のデータ量が100kbitを越えないように符号化する。」ということを表している。   First, the overall target code amount calculation unit 2 calculates the overall target code amount by dividing the communication bandwidth of 3000 kbps of the communication network by the frame rate of 30 fps (step S61). In this example, the overall target code amount is 3000 kbps / 30 fps = 100 kbit. The overall target code amount 100 kbit is “when encoding the entire image data of the first area 91, the second area 92, and the third area 93, the encoded data quantity does not exceed 100 kbit. ".

次に、圧縮率算出部3は、ステップS61で算出された全体目標符号量100kbitを、画像データが送信される第1領域91、第2領域92および第3領域93の符号化前の画像データの総データ量で除算し、圧縮率を算出する(ステップS62)。   Next, the compression rate calculation unit 3 uses the overall target code amount 100 kbit calculated in step S61 as the image data before encoding the first area 91, the second area 92, and the third area 93 to which the image data is transmitted. Is divided by the total data amount to calculate the compression rate (step S62).

例えば、第1領域91に属する画素のx座標の範囲が100〜299であり、y座標の範囲が100〜299であり、第1領域91に属する画素数が200×200=40000であるとする。また、第2領域92に属する画素のx座標の範囲が400〜799であり、y座標の範囲が200〜599であり、第2領域92に属する画素数が400×400=160000であるとする。さらに、第3領域93に属する画素のx座標の範囲が900〜1023であり、y座標の範囲が700〜767であり、第3領域93に属する画素数が124×68=8432であるとする。また、符号化前における1画素当たりのデータ量が24bitであるとする。この場合、3つの矩形領域91〜93の符号化前における総データ量は、24×(40000+160000+8432)=5002368bit、すなわち、約5002kbitである。圧縮率算出部3は、全体目標符号量100kbitをこのデータ量5002kbitで除算し、圧縮率100/5002を求める。100/5002は約1/50であり、以下、求めた圧縮率を便宜的に1/50として説明する。   For example, the x coordinate range of pixels belonging to the first area 91 is 100 to 299, the y coordinate range is 100 to 299, and the number of pixels belonging to the first area 91 is 200 × 200 = 40000. . In addition, the x coordinate range of pixels belonging to the second area 92 is 400 to 799, the y coordinate range is 200 to 599, and the number of pixels belonging to the second area 92 is 400 × 400 = 16000. . Furthermore, the x coordinate range of the pixels belonging to the third region 93 is 900 to 1023, the y coordinate range is 700 to 767, and the number of pixels belonging to the third region 93 is 124 × 68 = 8432. . Further, it is assumed that the data amount per pixel before encoding is 24 bits. In this case, the total data amount of the three rectangular areas 91 to 93 before encoding is 24 × (40000 + 16000 + 8432) = 5006868 bits, that is, about 5002 kbit. The compression rate calculation unit 3 divides the overall target code amount 100 kbit by the data amount 5002 kbit to obtain a compression rate 100/5002. 100/5002 is about 1/50, and hereinafter, the obtained compression ratio will be described as 1/50 for convenience.

圧縮率算出後、領域別目標符号量算出部4は、各矩形領域91〜93をぞれぞれ選択し、領域毎の目標符号量を算出する(ステップS63)。例えば、第1領域91の画素数は40000であり、1画素当たりのデータ量は24ビットであるので、第1領域91のデータ量は24bit×40000=960kbitである。領域別目標符号量算出部4は、このデータ量に圧縮率1/50を乗じて、第1領域91の符号化時における目標符号量を計算する。よって、第1領域91の目標符号量は、19.2kbitとなる。同様に、第2領域92の画素数は160000であるので、データ量は24bit×160000=3840kbitである。領域別目標符号量算出部4は、このデータ量に圧縮率1/50を乗じて、第2領域92の符号化時における目標符号量を計算する。よって、第2領域92の目標符号量は76.8kbitである。同様に、第3領域93の画素数は8432であるので、データ量は24bit×8432=202kbit(202368bit)である。領域別目標符号量算出部4は、このデータ量に圧縮率1/50を乗じて、第3領域93の符号化時における目標符号量を計算する。よって、第3領域93の目標符号量は、4kbitである。   After calculating the compression rate, the target code amount calculation unit 4 for each region selects each of the rectangular regions 91 to 93, and calculates the target code amount for each region (step S63). For example, since the number of pixels in the first area 91 is 40000 and the data amount per pixel is 24 bits, the data amount in the first area 91 is 24 bits × 40000 = 960 kbits. The region-specific target code amount calculation unit 4 multiplies the data amount by a compression ratio of 1/50 to calculate a target code amount at the time of encoding the first region 91. Therefore, the target code amount of the first area 91 is 19.2 kbit. Similarly, since the number of pixels in the second area 92 is 160000, the data amount is 24 bits × 160000 = 3840 kbits. The region-specific target code amount calculation unit 4 multiplies the data amount by the compression ratio 1/50 to calculate the target code amount at the time of encoding the second region 92. Therefore, the target code amount of the second area 92 is 76.8 kbit. Similarly, since the number of pixels in the third region 93 is 8432, the data amount is 24 bits × 8432 = 202 kbit (202368 bits). The region-specific target code amount calculation unit 4 multiplies the data amount by the compression ratio 1/50 to calculate the target code amount at the time of encoding the third region 93. Therefore, the target code amount of the third area 93 is 4 kbit.

よって、第1領域91の画像データ960kbitを符号化するときには、符号化後のデータ量が19.2kbit以下になるように符号化すればよい。他の矩形領域92,93の画像データを符号化するときにも、符号化後のデータ量が矩形領域の目標符号量以下になるように符号化すればよい。   Therefore, when the image data 960 kbit of the first area 91 is encoded, it is only necessary that the encoded data amount is 19.2 kbit or less. Even when the image data of the other rectangular areas 92 and 93 is encoded, the encoding may be performed so that the encoded data amount is equal to or less than the target code amount of the rectangular area.

本発明によれば、圧縮率算出部3が、全体目標符号量を、各領域の符号化前の画像データの総データ量で除算して圧縮率を求める。そして、領域別目標符号量算出部4が、領域毎に、領域の符号化前のデータ量にその圧縮率を乗じて、個々の領域に応じた目標符号量を算出する。よって、圧縮率を共通にして領域毎の目標符号量を計算することになるので、同一フレーム内の各領域同士で符号化後の画像データの画質の差が少なくなるように、各領域の目標符号量を求めることができる。   According to the present invention, the compression rate calculation unit 3 calculates the compression rate by dividing the overall target code amount by the total data amount of the image data before encoding in each region. Then, the target code amount calculation unit 4 for each region calculates a target code amount corresponding to each region by multiplying the data amount before region encoding by the compression rate for each region. Therefore, since the target code amount for each area is calculated with a common compression rate, the target of each area is set so that the difference in image quality of the image data after encoding between areas in the same frame is reduced. The code amount can be obtained.

実施形態2.
第1の実施形態の目標符号量算出装置は、画像データの圧縮率を領域間で共通化して目標符号量を定める。符号化後のデータ量が目標符号量以下になるように領域の画像データを符号化したとしても、符号化後のデータ量が目標符号量よりも大きくなってしまうことがある。この場合、各領域を全て符号化したときのデータ量を全体目標符号量以下に抑えるためには、他の領域における圧縮率を高める必要が生じる。また、符号化を行った結果、ある領域における符号化後のデータ量を、その領域の目標符号量よりも大幅に少なくすることができる場合もある。そのような場合、未だ符号化を行っていない領域の圧縮率を下げ、その領域の画質を高めることができる。
Embodiment 2. FIG.
The target code amount calculation apparatus according to the first embodiment determines the target code amount by sharing the compression rate of image data between regions. Even if the image data of the region is encoded such that the encoded data amount is equal to or less than the target code amount, the encoded data amount may be larger than the target code amount. In this case, in order to suppress the data amount when all the regions are encoded to be equal to or less than the overall target code amount, it is necessary to increase the compression rate in other regions. In addition, as a result of encoding, the amount of data after encoding in a certain region may be significantly less than the target code amount in that region. In such a case, it is possible to reduce the compression rate of an area that has not yet been encoded and improve the image quality of that area.

第2の実施形態の目標符号量算出装置は、画像データの符号化が完了した領域がある場合、画像データの符号化が完了していない各領域に対する圧縮率を再計算し、再計算後の圧縮率で、画像データの符号化が完了していない各領域の目標符号量を算出し直す。   The target code amount calculation apparatus according to the second embodiment recalculates the compression rate for each area where the encoding of the image data is not completed when there is an area where the encoding of the image data is completed. Based on the compression rate, the target code amount of each area where the encoding of the image data is not completed is recalculated.

図5は、本発明の目標符号量算出装置の第2の実施形態を示すブロック図である。本実施形態の目標符号量算出装置は、全体目標符号量算出部2と、圧縮率算出部3と、領域別目標符号量算出部4と、減算部(減算手段)5とを備える。第1の実施形態の構成要素と同様の構成要素については、図2と同一の符号を付し、詳細な説明を省略する。ただし、圧縮率算出部3および領域別目標符号量算出部4は、第1の実施形態で説明した処理に加え、画像データが送信される各領域のうち画像データの符号化が完了している領域(以下、符号化完了領域と記す。)がある場合には、後述の処理も実行する。   FIG. 5 is a block diagram showing a second embodiment of the target code amount calculation apparatus of the present invention. The target code amount calculation apparatus of the present embodiment includes an overall target code amount calculation unit 2, a compression rate calculation unit 3, a region-specific target code amount calculation unit 4, and a subtraction unit (subtraction unit) 5. Constituent elements similar to those of the first embodiment are denoted by the same reference numerals as those in FIG. 2, and detailed description thereof is omitted. However, in addition to the processing described in the first embodiment, the compression rate calculation unit 3 and the region-specific target code amount calculation unit 4 have completed encoding of image data in each region to which image data is transmitted. If there is a region (hereinafter referred to as an encoding completion region), the processing described later is also executed.

減算部5は、符号化完了領域がある場合、全体目標符号量から、符号化完了領域の符号化後の画像データの総量を減算する。全体目標符号量から符号化完了領域の符号化後の画像データの総量を減算した結果は、未だ符号化されていない各領域全体に対する目標符号量を意味する。   When there is an encoding completion region, the subtraction unit 5 subtracts the total amount of image data after encoding in the encoding completion region from the overall target code amount. The result of subtracting the total amount of image data after encoding in the encoding completion region from the total target code amount means the target code amount for each entire region that has not yet been encoded.

例えば、図4に示す例において、各矩形領域91〜93全体に対する全体目標符号量(Pとする。)を算出して、個々の矩形領域91〜93の目標符号量を算出したとする。さらに、その後、第1領域93の画像データを符号化したときに、符号化後のデータ量がD1であったとする。この場合、減算部5は、最初に求めた全体目標符号量Pから、符号化完了領域である第1領域91の符号化後のデータ量D1を減算し、P−D1を求める。このP−D1は、符号化されていない第2領域92および第3領域93全体に対する目標符号量であり、第2領域92および第3領域93の符号化後のデータ量がP−D1以下であれば、3つの矩形領域91〜93の符号化後のデータ量はP以下に抑えられることになる。   For example, in the example shown in FIG. 4, it is assumed that the overall target code amount (P) is calculated for each of the rectangular regions 91 to 93 and the target code amount of each rectangular region 91 to 93 is calculated. Furthermore, after that, when the image data of the first area 93 is encoded, it is assumed that the encoded data amount is D1. In this case, the subtracting unit 5 subtracts the encoded data amount D1 of the first area 91, which is the encoding completion area, from the overall target code quantity P obtained first to obtain P-D1. This P-D1 is the target code amount for the second region 92 and the third region 93 that are not encoded, and the encoded data amount of the second region 92 and the third region 93 is equal to or less than P-D1. If there is, the data amount after the encoding of the three rectangular areas 91 to 93 is suppressed to P or less.

また、同様に、第1領域だけでなく、第2の領域の画像データの符号化も完了し、第2領域における符号化後のデータ量がD2であったとする。この場合、減算部5は、最初に求めた全体目標符号量Pから、符号化完了領域である第1領域91および第2領域92の符号化後の画像データの総量(D1+D2)を減算し、P−(D1+D2)を求める。このP−(D1+D2)は、符号化されていない第3領域93に対する目標符号量である。   Similarly, it is assumed that not only the first area but also the image data of the second area has been encoded, and the encoded data amount in the second area is D2. In this case, the subtracting unit 5 subtracts the total amount (D1 + D2) of the encoded image data of the first region 91 and the second region 92, which are the encoding completion regions, from the overall target code amount P obtained first. P- (D1 + D2) is obtained. This P− (D1 + D2) is the target code amount for the third region 93 that is not encoded.

このように、減算部5は、画像データが送信される各領域のうち、ある一つの領域における符号化処理が完了して、符号化完了領域が一つ増える度に、最初に求めた全体目標符号量から、符号化完了領域の符号化後の画像データの総量を減算する処理を行う。   In this way, the subtraction unit 5 first calculates the overall target every time the encoding process is completed in one area among the areas where the image data is transmitted and the encoding completion area is increased by one. A process of subtracting the total amount of image data after encoding in the encoding completion area from the code amount is performed.

第2の実施形態における圧縮率算出部3は、最初に圧縮率を算出するときには、第1の実施形態と同様に全体目標符号量算出部2によって導出された全体目標符号量を用いて圧縮率を算出する。また、圧縮率算出部3は、個々の領域毎に順次、符号化処理が行われ、画像データが送信される各領域のうち未だ画像データの符号化が行われていない領域がある場合、減算後の全体目標符号量を、符号化が行われていない各領域における符号化前の画像データの総量で除算して、圧縮率を算出し直す。すなわち、最初に求めた全体目標符号量から各符号化完了領域の符号化後の画像データ量を減算した結果を、符号化が行われていない各領域の画像データの総量で除算して、新たに圧縮率を計算する。   When calculating the compression rate for the first time, the compression rate calculation unit 3 in the second embodiment uses the overall target code amount derived by the overall target code amount calculation unit 2 in the same manner as in the first embodiment. Is calculated. In addition, the compression rate calculation unit 3 performs the subtraction when the encoding process is sequentially performed for each area and there is an area where the image data is not yet encoded among the areas to which the image data is transmitted. The subsequent overall target code amount is divided by the total amount of image data before encoding in each region where encoding is not performed, and the compression rate is recalculated. That is, the result of subtracting the encoded image data amount of each encoding completion region from the initially obtained overall target code amount is divided by the total amount of image data of each region that has not been encoded, and a new Calculate the compression ratio.

第2の実施形態における領域別目標符号量算出部4は、最初に各領域の目標符号量を算出するときには、第1の実施形態と同様に目標符号量を計算する。その後、画像データが送信される領域における符号化が行われ、圧縮率算出部3が圧縮率を計算し直したときには、その圧縮率を用いて、符号化が行われていない領域における目標符号量を、それぞれの領域毎に算出し直す。領域別目標符号量算出部4は、未だ画像データの符号化が行われていない個々の領域毎に、その領域の符号化前の画像データのデータ量に新たな圧縮率を乗じて、それぞれの領域の目標符号量を算出し直す。   When calculating the target code amount for each region for the first time, the region-specific target code amount calculation unit 4 in the second embodiment calculates the target code amount in the same manner as in the first embodiment. Thereafter, encoding is performed in a region where image data is transmitted, and when the compression rate calculation unit 3 recalculates the compression rate, the target code amount in a region where encoding is not performed using the compression rate. Is recalculated for each region. The area-specific target code amount calculation unit 4 multiplies the data amount of the image data before encoding of the area by the new compression rate for each area where the image data is not yet encoded. Recalculate the target code amount of the region.

減算部5は、例えば、全体目標符号量算出部2、圧縮率算出部3、領域別目標符号量算出部4として動作するCPUによって実現され、そのCPUがプログラムに従って減算部5としての処理を行ってもよい。   The subtracting unit 5 is realized by, for example, a CPU that operates as the overall target code amount calculating unit 2, the compression rate calculating unit 3, and the region-specific target code amount calculating unit 4, and the CPU performs processing as the subtracting unit 5 according to a program. May be.

次に、動作について説明する。
最初に各領域の目標符号量を算出するまでの動作は、第1の実施形態と同様であり、ステップS61〜S63の処理を行う。その後、一つの領域の符号化が完了する毎に、以下に示す目標符号量再計算処理を繰り返す。ただし、画像データが送信される全ての領域について符号化が完了したときには、目標符号量再計算処理を行わなくてよい。
Next, the operation will be described.
The operation until the target code amount for each region is calculated for the first time is the same as that in the first embodiment, and the processes in steps S61 to S63 are performed. Thereafter, every time encoding of one region is completed, the target code amount recalculation process shown below is repeated. However, the target code amount recalculation process does not have to be performed when encoding is completed for all the areas in which image data is transmitted.

図6は、目標符号量再計算処理の例を示すフローチャートである。一つの領域の符号化が完了すると、減算部5は、最初に求めた全体目標符号量から、符号化完了領域の符号化後の画像データの総量を減算する(ステップS65)。   FIG. 6 is a flowchart illustrating an example of target code amount recalculation processing. When encoding of one region is completed, the subtracting unit 5 subtracts the total amount of image data after encoding in the encoding completion region from the overall target code amount obtained first (step S65).

次に、圧縮率算出部3は、ステップS65における減算結果を、符号化が行われていない各領域における符号化前の画像データの総量で除算することによって、圧縮率を算出し直す(ステップS66)。   Next, the compression rate calculation unit 3 recalculates the compression rate by dividing the subtraction result in step S65 by the total amount of image data before encoding in each region that has not been encoded (step S66). ).

続いて、領域別目標符号量算出部4は、未だ画像データの符号化が行われていない個々の領域毎に、その領域における画像データ量に新たな圧縮率を乗じて、符号化が行われていない各領域の目標符号量を算出し直す(ステップS67)。   Subsequently, the target code amount calculation unit 4 for each region performs encoding by multiplying the image data amount in the region by a new compression rate for each region where the image data is not yet encoded. The target code amount of each area that has not been calculated is recalculated (step S67).

次に、本実施形態の動作について、具体例を挙げて説明する。以下に示す例では、第1の実施形態で例示した具体例と同様に、図4を用いて説明する。第1の実施形態で説明した具体例と同様に、ステップS61で全体目標符号量を100kbitと算出し、ステップS62,S63の処理を行って、各矩形領域61〜63の目標符号量を計算したとする。その後、第1領域91の画像データを、目標符号量(19.2kbit)以下になるように符号化した結果、第1領域91の符号化後のデータ量が16kbitであったとする。   Next, the operation of this embodiment will be described with a specific example. The example shown below will be described with reference to FIG. 4 as in the specific example illustrated in the first embodiment. Similar to the specific example described in the first embodiment, the overall target code amount is calculated as 100 kbits in step S61, and the processes of steps S62 and S63 are performed to calculate the target code amounts of the rectangular areas 61 to 63. And After that, the image data in the first area 91 is encoded to be equal to or less than the target code amount (19.2 kbit), and as a result, the encoded data amount in the first area 91 is 16 kbit.

このとき、減算部5は、最初に求めた全体目標符号量(100kbit)から号化完了領域の符号化後の画像データの総量を減算する。本例では、第1領域91のみを符号化しているので、100kbitから16kbitを減算し、減算結果として84kbitを得る(ステップS65)。   At this time, the subtracting unit 5 subtracts the total amount of image data after encoding in the encoding completion area from the overall target code amount (100 kbit) obtained first. In this example, since only the first area 91 is encoded, 16 kbit is subtracted from 100 kbit, and 84 kbit is obtained as a subtraction result (step S65).

次に、圧縮率算出部3は、その減算結果(84kbit)を、符号化が行われていない第2領域92および第3領域93の符号化前の画像データの総量で除算し、圧縮率を算出し直す。第1の実施形態の具体例で述べたように、第2領域92、第3領域93の画素数がそれぞれ160000,8432であり、1画素のデータ量が24ビットであるとすると、第2領域92および第3領域93の符号化前のデータ量の合計は、24×(160000+8432)=4042368bit=4042.368kbitとなる。よって、圧縮率算出部3は、84/4042.368を計算し、新たな圧縮率を求める(ステップS66)。84/4042.368=約1/48であるので、以下、新たな圧縮率を便宜的に1/48として説明する。   Next, the compression rate calculation unit 3 divides the subtraction result (84 kbit) by the total amount of image data before encoding in the second region 92 and the third region 93 that have not been encoded, and calculates the compression rate. Recalculate. As described in the specific example of the first embodiment, assuming that the number of pixels in the second region 92 and the third region 93 is 160000 and 8432, respectively, and the data amount of one pixel is 24 bits, The total amount of data before encoding in 92 and the third area 93 is 24 × (160000 + 8432) = 4042368 bits = 4042.368 kbits. Therefore, the compression rate calculation unit 3 calculates 84 / 4042.368 and obtains a new compression rate (step S66). Since 84 / 4042.368 = about 1/48, the following description will be made assuming that the new compression rate is 1/48 for convenience.

次に、領域別目標符号量算出部4は、まだ符号化が行われていない第2領域92および第3領域93の目標符号量を計算する(ステップS67)。領域別目標符号量算出部4は、第2領域92のデータ量(3840kbit)に1/48を乗じて、新たな目標符号量を80kbitとする。同様に、領域別目標符号量算出部4は、第3領域93のデータ量(202kbit)に1/48を乗じて、新たな目標符号量を4.2kbitとする。   Next, the region-specific target code amount calculation unit 4 calculates the target code amounts of the second region 92 and the third region 93 that have not been encoded (step S67). The region-specific target code amount calculation unit 4 multiplies the data amount (3840 kbit) of the second region 92 by 1/48 to set the new target code amount to 80 kbit. Similarly, the region-specific target code amount calculation unit 4 multiplies the data amount (202 kbit) of the third region 93 by 1/48 to obtain a new target code amount of 4.2 kbit.

また、さらに第2領域92等を符号化したときにもステップS65〜S66の動作を行えばよい。   Further, the operations of steps S65 to S66 may be performed when the second region 92 and the like are further encoded.

本実施形態によれば、一つの領域の符号化が完了する毎に圧縮率を算出し直し、新たな圧縮率に応じて、符号化の済んでいない領域の目標符号量を再計算するので、個々の領域を符号化するときの符号量制御を高精度化することができる。例えば、ある領域の画像が非常に単純であり、符号化の結果、圧縮率算出部3が計算した圧縮率よりも高い圧縮率で圧縮できたとする。すると、他の領域の圧縮率を低くして、他の領域の符号化後の画質を向上させることができる。また、例えば、ある領域の符号化の結果、目標符号量以下に符号化できなかったとする。この場合、他の領域の圧縮率を高くするように制御することができる。   According to this embodiment, every time encoding of one region is completed, the compression rate is recalculated, and the target code amount of the region that has not been encoded is recalculated according to the new compression rate. It is possible to increase the accuracy of code amount control when encoding each region. For example, it is assumed that an image in a certain area is very simple and can be compressed at a compression rate higher than the compression rate calculated by the compression rate calculation unit 3 as a result of encoding. Then, the compression rate of the other area can be lowered, and the image quality after encoding of the other area can be improved. In addition, for example, it is assumed that encoding cannot be performed below the target code amount as a result of encoding in a certain area. In this case, it is possible to control so as to increase the compression rate of other regions.

第2の実施形態では、各領域の圧縮率が互いに異なる場合が生じるが、各領域の目標符号量を一律に定める場合に比べ、各領域間の符号化後の画質の差は少なくなる。よって、第2の実施の形態では、符号化後の画質の差を各領域間で少なくしつつ、個々の領域を符号化するときの符号量制御を高精度化できる。   In the second embodiment, there are cases where the compression rates of the respective regions differ from each other, but the difference in image quality after encoding between the respective regions is smaller than when the target code amount of each region is uniformly determined. Therefore, in the second embodiment, it is possible to increase the accuracy of code amount control when encoding individual areas while reducing the difference in image quality after encoding between the areas.

以下、第1の実施形態および第2の実施形態の変形例について説明する。   Hereinafter, modifications of the first embodiment and the second embodiment will be described.

第1の実施形態および第2の実施形態において、領域別目標符号量算出部4は、画像データの符号化が行われていない領域における符号化前の画像データのデータ量が所定の閾値以下であるならば、その領域の目標符号量を、目標符号量のとり得る最大値に定めてもよい。   In the first embodiment and the second embodiment, the region-specific target code amount calculation unit 4 has a data amount of image data before encoding in a region where image data is not encoded being equal to or less than a predetermined threshold. If there is, the target code amount of the area may be set to the maximum value that the target code amount can take.

目標符号量のとり得る最大値とは、画像データの符号化を行う装置において目標符号量の上限値として定められている値である。画像データの符号化を行う装置において、目標符号量を無限大に設定可能であれば、目標符号量のとり得る最大値は無限大となる。そのように目標符号量を大きな値(最大値)に定めれば、画像データが送信される領域に関する符号化を行う際、圧縮率は低くなり、その領域に関する画質は向上することになる。   The maximum value that the target code amount can take is a value that is determined as the upper limit value of the target code amount in an apparatus that encodes image data. In a device that encodes image data, if the target code amount can be set to infinity, the maximum value that the target code amount can take is infinite. If the target code amount is set to a large value (maximum value) in this way, when encoding is performed for an area in which image data is transmitted, the compression rate is lowered, and the image quality for that area is improved.

また、符号化前の画像データのデータ量が所定の閾値以下となる領域は、面積が所定値以下の領域であるということができる。そのようなデータ量の少ない領域では、高い圧縮率で圧縮を行わなくても、各領域全体を符号化したときの符号化後のデータ量への影響は小さい。すなわち、各領域全体を符号化したときの符号量の増加が著しくなるわけではない。また、フレーム内において、そのような微少面積の画像更新は、例えば、カーソルやアイコン等のような精細度が重視されるオブジェクトの周辺で多く発生する。また、こうしたオブジェクトの精細度が大きく低下すると、フレームレートが維持できたとしても操作性に支障が生じることが多い。符号化前の画像データのデータ量が所定の閾値以下となる領域では目標符号量を最大値に定めることで、そのような微少面積の領域の符号化後の画質を一定以上維持することができる。   Further, it can be said that the area where the data amount of the image data before encoding is equal to or smaller than the predetermined threshold is an area whose area is equal to or smaller than the predetermined value. In such a region with a small amount of data, even if the compression is not performed at a high compression rate, the influence on the data amount after encoding when the entire region is encoded is small. That is, the increase in the amount of code when the entire area is encoded does not become significant. In addition, in the frame, such an image update with a very small area frequently occurs in the vicinity of an object such as a cursor, an icon, or the like where definition is important. In addition, when the definition of such an object is greatly reduced, operability is often hindered even if the frame rate can be maintained. By setting the target code amount to the maximum value in a region where the data amount of image data before encoding is equal to or less than a predetermined threshold, the image quality after encoding of such a small area region can be maintained above a certain level. .

また、上記の各実施形態において、目標符号量算出装置自身が1フレーム内において画像が書き換えられた領域を判定し、画像データが送信される領域を特定してもよい。図7は、目標符号量算出装置が、1フレーム内において画像データが送信される領域を特定する領域特定部(領域特定手段)6を備える場合の構成例を示すブロック図である。上記の各実施形態と同様の構成要素は、図2、図5と同一の符号を付して説明を省略する。   In each of the above embodiments, the target code amount calculation apparatus itself may determine an area where an image has been rewritten within one frame and specify an area where image data is transmitted. FIG. 7 is a block diagram illustrating a configuration example in the case where the target code amount calculation apparatus includes an area specifying unit (area specifying unit) 6 that specifies an area in which image data is transmitted in one frame. Constituent elements similar to those in the above embodiments are given the same reference numerals as those in FIGS. 2 and 5 and description thereof is omitted.

領域特定部6は、1フレーム内において画像が更新された領域を含む矩形領域を、画像データが送信される領域として特定する。領域特定部6がそのような領域を特定する方法の例を説明する。   The area specifying unit 6 specifies a rectangular area including an area in which an image is updated in one frame as an area to which image data is transmitted. An example of how the area specifying unit 6 specifies such an area will be described.

図8は、1フレーム内において画像が送信される領域の例を示す説明図である。図8において斜線で示した部分96は、フレーム95において画像が書き換えられた部分であり、白色で示した部分は画像が書き換えられていない部分である。領域特定部6は、画像が更新された部分96を含む矩形領域97を、画像データを符号化して送信する領域として特定する。   FIG. 8 is an explanatory diagram illustrating an example of an area in which an image is transmitted within one frame. In FIG. 8, a hatched portion 96 is a portion where the image is rewritten in the frame 95, and a white portion is a portion where the image is not rewritten. The area specifying unit 6 specifies the rectangular area 97 including the portion 96 where the image is updated as an area for encoding and transmitting image data.

ここでは、フレームにおいて、x軸は右方向に伸び、右側の画素ほどx座標の座標値が大きいものとする。また、y軸は下方向に伸び、下側の画素ほどy座標の座標値が大きいものとする。   Here, in the frame, the x-axis extends in the right direction, and the right-side pixel has a larger coordinate value of the x-coordinate. The y-axis extends downward, and the lower pixel has a larger y-coordinate value.

領域特定部6は、1行目から最終行目までを順に選択し、選択した行において書き換えられた画素があるか否かを判定する。以下、便宜的に、書き換えられた画素が存在する行を更新行と呼び、書き換えられた画素が存在しない行を非更新行と呼ぶ。領域特定部6は、直前の行が非更新行であり、選択した行が更新行である場合、その行を更新行の先頭とする。また、直前の行が更新行であり、選択した行が非更新行である場合、その直前の行を更新行の末尾とする。ただし、このような場合、連続する更新行の間に、わずかな行数の非更新行が存在すると、矩形領域97としてフレームから切り出される領域数が多くなりすぎる可能性がある。従って、領域特定部6は、更新行から非更新行に切り替わった場合、さらに行を選択して更新行か否かを判定する処理を続け、更新行から非更新行に変わった後、非更新行が所定数以上連続しているという条件が満たされる場合に、その更新行を更新行の末尾と判定してもよい。領域特定部6は、更新行の末尾を特定した後、再び、非更新行から更新行に切り替わったならば、再度、更新行の先頭および末尾を特定していく処理を繰り返す。図9は、更新行の先頭および末尾の例を示す説明図である。領域特定部6は、図9に例示するような更新行の先頭および末尾を特定していく。   The area specifying unit 6 sequentially selects from the first line to the last line, and determines whether or not there is a rewritten pixel in the selected line. Hereinafter, for convenience, a row in which the rewritten pixel exists is referred to as an updated row, and a row in which the rewritten pixel does not exist is referred to as a non-updated row. When the immediately preceding line is a non-updated line and the selected line is an updated line, the area specifying unit 6 sets that line as the head of the updated line. When the immediately preceding line is an updated line and the selected line is a non-updated line, the immediately preceding line is set as the end of the updated line. However, in such a case, if there are a small number of non-updated rows between successive update rows, there is a possibility that the number of regions cut out from the frame as the rectangular region 97 becomes too large. Accordingly, when the area specifying unit 6 switches from the update line to the non-update line, the region specifying unit 6 continues the process of selecting another line and determining whether or not it is an update line, and after changing from the update line to the non-update line, May be determined to be the end of the update row when the condition that the number of is continuous for a predetermined number or more is satisfied. After specifying the end of the update line, the area specifying unit 6 repeats the process of specifying the start and end of the update line again when switching from the non-update line to the update line. FIG. 9 is an explanatory diagram illustrating an example of the beginning and the end of an update line. The area specifying unit 6 specifies the beginning and end of the update line as illustrated in FIG.

続いて、領域特定部6は、更新行の先頭から末尾までの連続する更新行のグループ毎に、1列目(本例では最も左側の列とする。)から最終列(本例では最も右側の列とする。)までを順に選択し、選択した列において書き換えられた画素があるか否かを判定する。以下、便宜的に、書き換えられた画素が存在する列を更新列と呼び、書き換えられた画素が存在しない列を非更新列と呼ぶ。領域特定部6は、直前の列が非更新列であり、選択した列が更新列である場合、その列を更新列の左端とする。また、領域特定部6は、直前の列が更新列であり、選択した列が非更新列である場合、その直前の更新列を更新列の右端とする。ただし、このような場合、連続する更新列の間に、わずかな列数の非更新列が存在すると、矩形領域97としてフレームから切り出される領域数が多くなりすぎる可能性がある。従って、領域特定部6は、更新列から非更新列に切り替わった場合、さらに列を選択して更新列か否かを判定する処理を続け、更新列から非更新列に変わった後、非更新列が所定数以上連続しているという条件が満たされる場合に、その更新列を更新列の右端と判定してもよい。領域特定部6は、更新列の右端を特定した後、再び、非更新列から更新列に切り替わったならば、再度、更新列の左端および右端を特定していく処理を繰り返す。図10は、更新列の左端および右端の例を示す説明図であり、図10において破線で示した縦線が更新列の左端および右端を表している。領域特定部6は、図10に例示するような更新列の左端および右端を特定していく。   Subsequently, the area specifying unit 6 performs the update from the first column (the leftmost column in this example) to the last column (the rightmost in this example) for each group of consecutive update rows from the beginning to the end of the update row. Are sequentially selected, and it is determined whether or not there is a rewritten pixel in the selected column. Hereinafter, for convenience, a column in which the rewritten pixel exists is referred to as an updated column, and a column in which the rewritten pixel does not exist is referred to as a non-updated column. When the immediately preceding column is a non-update column and the selected column is an update column, the area specifying unit 6 sets the column as the left end of the update column. Further, when the immediately preceding column is an updated column and the selected column is a non-updated column, the region specifying unit 6 sets the immediately preceding updated column as the right end of the updated column. However, in such a case, if there are a small number of non-update columns between successive update columns, the number of regions cut out from the frame as the rectangular region 97 may be too large. Therefore, when the region specifying unit 6 switches from the update column to the non-update column, the region specifying unit 6 further selects a column and determines whether or not the column is an update column. When the condition that a predetermined number of columns are continuous is satisfied, the updated column may be determined as the right end of the updated column. After specifying the right end of the update column, the area specifying unit 6 repeats the process of specifying the left end and the right end of the update column again when the non-update column is switched to the update column again. FIG. 10 is an explanatory diagram showing an example of the left end and the right end of the update column, and the vertical lines shown by broken lines in FIG. 10 represent the left end and the right end of the update column. The area specifying unit 6 specifies the left end and the right end of the update sequence as illustrated in FIG.

次に、領域特定部6は、更新行の先頭および末尾と、更新列の左端および右端に囲まれた範囲を順次1つずつ選択する。図10に示す例では、3つの範囲を順次1つずつ選択する。   Next, the area specifying unit 6 sequentially selects the range surrounded by the beginning and end of the update row and the left end and right end of the update column one by one. In the example shown in FIG. 10, the three ranges are selected one by one sequentially.

領域特定部6は、選択した範囲内における各列を順に抽出し、個々の列における更新画素(更新された画素)の上端および下端を特定する。さらに、領域特定部6は、各列における更新画素の上端のうち最も上側の画素のy座標と、各列における更新画素の下端のうち最も下側の画素のy座標とを特定する。領域特定部6は、その最上部の画素のy座標から最下部の画素のy座標までの範囲と、更新列の左端のx座標から右端のx座標までの範囲の矩形領域を、画像データを送信する領域として特定する。   The area specifying unit 6 sequentially extracts each column in the selected range, and specifies the upper end and the lower end of the update pixel (updated pixel) in each column. Further, the region specifying unit 6 specifies the y coordinate of the uppermost pixel among the upper ends of the update pixels in each column and the y coordinate of the lowermost pixel among the lower ends of the update pixels in each column. The region specifying unit 6 converts the image data into a rectangular region in a range from the y coordinate of the uppermost pixel to the y coordinate of the lowermost pixel and a range from the left end x coordinate to the right end x coordinate of the update sequence. Identifies the area to be transmitted.

図11は、更新行の先頭および末尾と更新列の左端および右端とに囲まれた範囲の例を示す説明図である。例えば、図11に例示する範囲を選択した場合、領域特定部6は、図11に例示する列101,111等の各列を順に抽出し、各列の更新画素の上端および下端を特定する。例えば、列101を抽出した場合には、更新画素の上端として画素102を特定し、更新画素の下端として画素103を特定する。そして、領域特定部6は、各列の更新画素の上端102,112等のうち最も上側の画素(本例では画素112)のy座標を特定する。また、各列の更新画素の下端103,113等のうち最も下側の画素のy座標を特定する。そして、画素112のy座標から画素113のy座標までの範囲と、更新列の左端のx座標から右端のx座標までの範囲の矩形領域を、画像データが送信される領域として特定する。   FIG. 11 is an explanatory diagram illustrating an example of a range surrounded by the beginning and end of the update row and the left end and right end of the update column. For example, when the range illustrated in FIG. 11 is selected, the region specifying unit 6 sequentially extracts each column such as the columns 101 and 111 illustrated in FIG. 11 and specifies the upper end and the lower end of the update pixel in each column. For example, when the column 101 is extracted, the pixel 102 is specified as the upper end of the update pixel, and the pixel 103 is specified as the lower end of the update pixel. Then, the region specifying unit 6 specifies the y coordinate of the uppermost pixel (pixel 112 in this example) among the upper ends 102 and 112 of the update pixels in each column. Further, the y coordinate of the lowermost pixel among the lower ends 103, 113, etc., of the update pixel in each column is specified. Then, a range from the y-coordinate of the pixel 112 to the y-coordinate of the pixel 113 and a rectangular region from the left end x coordinate to the right end x coordinate of the update sequence are specified as regions to which image data is transmitted.

以上の動作により、画像データが送信される各領域を特定した後、第1の実施形態や第2の実施形態等で説明した動作により、各領域毎の目標符号量を算出すればよい。   After specifying each region to which image data is transmitted by the above operation, the target code amount for each region may be calculated by the operation described in the first embodiment, the second embodiment, or the like.

また、ここで説明した領域特定方法は例示であり、領域特定方法は上記の方法に限定されない。領域特定部6は、1フレーム内から高さおよび幅が一定の矩形領域(例えば、縦横それぞれの画素数が64画素の矩形領域)を順に取り出し、その矩形領域に更新画素が含まれていれば、その矩形領域を、画像データが送信される領域として特定してもよい。   The region specifying method described here is an exemplification, and the region specifying method is not limited to the above method. The area specifying unit 6 sequentially takes out a rectangular area having a constant height and width from one frame (for example, a rectangular area having 64 pixels in both vertical and horizontal directions), and if an update pixel is included in the rectangular area The rectangular area may be specified as an area to which image data is transmitted.

領域特定部6は、例えば、全体目標符号量算出部2、圧縮率算出部3、領域別目標符号量算出部4として動作するCPUによって実現され、そのCPUがプログラムに従って領域特定部6としての処理を行ってもよい。   The area specifying unit 6 is realized, for example, by a CPU that operates as the overall target code amount calculating unit 2, the compression rate calculating unit 3, and the area-specific target code amount calculating unit 4, and the CPU performs processing as the area specifying unit 6 according to a program. May be performed.

また、上記の各実施形態において、目標符号量算出装置自身が各領域における画像データの符号化を行ってもよい。図12は、目標符号量算出装置が領域毎に画像データを符号する領域符号化部(領域符号化手段)7を備える場合の構成例を示すブロック図である。上記の各実施形態と同様の構成要素は、図2、図5、図7と同一の符号を付して説明を省略する。なお、図12では、領域特定部6を示していないが、上述の領域特定部6を備えていてもよい。   In each of the above embodiments, the target code amount calculation device itself may encode the image data in each region. FIG. 12 is a block diagram illustrating a configuration example in a case where the target code amount calculation apparatus includes a region encoding unit (region encoding unit) 7 that encodes image data for each region. Constituent elements similar to those in each of the above embodiments are given the same reference numerals as those in FIGS. 2, 5, and 7, and description thereof is omitted. In FIG. 12, the area specifying unit 6 is not shown, but the above-described area specifying unit 6 may be provided.

領域符号化部7は、領域別目標符号量算出部4が定めた目標符号量以下の符号量に画像データを符号化する処理を、画像データが送信される各領域毎に行う。図13は、領域符号化部7の例を示すブロック図である。なお、以下では、領域符号化部7が画像データをハフマン符号に変換する場合を例にして説明する。領域符号化部7は、ウェーブレット変換部12と、中間符号生成部13と、第1の判定部14と、第2の判定部15と、再量子化部16と、符号化部17とを備える。   The region encoding unit 7 performs a process of encoding the image data to a code amount equal to or less than the target code amount determined by the region-specific target code amount calculation unit 4 for each region where the image data is transmitted. FIG. 13 is a block diagram illustrating an example of the region encoding unit 7. In the following, a case where the region encoding unit 7 converts image data into a Huffman code will be described as an example. The region encoding unit 7 includes a wavelet transform unit 12, an intermediate code generation unit 13, a first determination unit 14, a second determination unit 15, a requantization unit 16, and an encoding unit 17. .

ウェーブレット変換部12は、1フレーム内の画像データが送信される個々の領域に対して、画像データを所定の分解レベル数までウェーブレット変換する処理を行う。この「所定の分解レベル数」を“N”と記す。また、図面中において、分解レベル数をRlevelと記す場合がある。図14は、ウェーブレット変換を模式的に示す説明図である。ウェーブレット変換部12は、領域の画像データ100をウェーブレット変換する。1回のウェーブレット変換により得られる係数の種類には、LL成分、LH成分、HL成分、HH成分があり、ウェーブレット変換部12は、LL成分に対して、再帰的にウェーブレット変換を行う。以下、LH成分、HL成分、HH成分をまとめてxxと記す。また、分解レベル数がkのときのLL成分、xx成分を、それぞれ「kLL成分」、「kxx成分」と記す。図14では、分解レベル数1のxx成分(1xx)と、分解レベル数2のLL成分(2LL)およびxx成分(2xx)とを示している。また、図14では、分解レベル数“2”までのウェーブレット変換を例示しているが、ウェーブレット変換部12がウェーブレット変換を行うときの分解レベル数は2に限定されず、3以上の分解レベル数までウェーブレット変換を行ってもよい。以下の説明では、ウェーブレット変換後の係数(ウェーブレット係数)がYUV形式で表され、Y,U,Vの各値を有するようにウェーブレット変換を行う場合を例にして説明する。   The wavelet transform unit 12 performs a process for wavelet transforming the image data up to a predetermined number of decomposition levels for each region to which the image data in one frame is transmitted. This “predetermined number of decomposition levels” is denoted as “N”. In the drawings, the number of decomposition levels may be written as Rlevel. FIG. 14 is an explanatory diagram schematically showing the wavelet transform. The wavelet transform unit 12 performs wavelet transform on the area image data 100. The types of coefficients obtained by one wavelet transform include LL component, LH component, HL component, and HH component, and the wavelet transform unit 12 recursively performs wavelet transform on the LL component. Hereinafter, the LH component, the HL component, and the HH component are collectively referred to as xx. Further, the LL component and the xx component when the number of decomposition levels is k are referred to as “kLL component” and “kxx component”, respectively. FIG. 14 shows an xx component (1xx) having a decomposition level number 1, an LL component (2LL) and an xx component (2xx) having a decomposition level number 2. 14 illustrates wavelet transformation up to the number of decomposition levels “2”. However, the number of decomposition levels when the wavelet transform unit 12 performs wavelet transformation is not limited to 2, and the number of decomposition levels equal to or greater than 3. Wavelet transformation may be performed up to. In the following description, an example will be described in which wavelet transformation is performed so that coefficients after wavelet transformation (wavelet coefficients) are expressed in YUV format and have Y, U, and V values.

中間符号生成部13は、ウェーブレット変換によって得られた係数に対して所定の量子化ステップで量子化を行った値であるかまたはウェーブレット変換によって得られた係数自体である中間データ(以下、中間符号と記す。)を生成する。ここでは、ウェーブレット変換よって得られた係数に対して量子化を行った結果を中間符号とする場合を例にして説明する。よって、本例では、中間符号生成部13は、ウェーブレット係数に含まれるY,U,Vの値をそれぞれ所定の量子化ステップで量子化し、その量子化の結果を中間符号とする。以下、量子化ステップをQステップと記す。   The intermediate code generation unit 13 is a value obtained by quantizing the coefficient obtained by the wavelet transform in a predetermined quantization step or the coefficient itself obtained by the wavelet transform (hereinafter referred to as intermediate code). .) Is generated. Here, a case where the result obtained by quantizing the coefficient obtained by the wavelet transform is an intermediate code will be described as an example. Therefore, in this example, the intermediate code generation unit 13 quantizes the values of Y, U, and V included in the wavelet coefficients in a predetermined quantization step, and sets the quantization result as an intermediate code. Hereinafter, the quantization step is referred to as Q step.

中間符号生成部13による中間符号生成処理についてより詳しく説明する。1xx成分、2xx成分等の中間符号生成対象の成分毎に、中間符号生成時の所定のQステップおよびデッドゾーンが定められている。中間符号生成部13は、絶対値が所定のデッドゾーン以下である画像データの値を0に量子化する。例えば、1xx成分に含まれるあるYの絶対値がデッドゾーン以下であれば、そのYを0に量子化する。また、中間符号生成部13は、絶対値が所定のデッドゾーンを越える範囲を、所定のQステップ毎に区切る。そして、それらの各範囲に属する画像データの値を、その範囲の中央値に量子化する。例えば、デッドゾーンおよびQステップがいずれも2であるとする。この場合、絶対値が2を越える範囲(すなわち、−2未満の範囲および2より大きい範囲)を、Qステップである2毎に区切り、“−4〜−2”、“2〜4”、“4〜6”等の範囲を定める。そして、1xx成分に含まれるあるYが“2〜4”等の範囲に属していれば、Yの値をその範囲の中央値に量子化する。ここでは、1xx成分に含まれるYを例示したが、U,Vの量子化も同様に行う。また、1xx成分以外の成分に関する量子化処理も同様である。   The intermediate code generation process by the intermediate code generation unit 13 will be described in more detail. Predetermined Q steps and dead zones at the time of intermediate code generation are determined for each intermediate code generation target component such as a 1xx component and a 2xx component. The intermediate code generation unit 13 quantizes the value of the image data whose absolute value is equal to or less than a predetermined dead zone to 0. For example, if the absolute value of a certain Y included in the 1xx component is equal to or less than the dead zone, the Y is quantized to 0. Further, the intermediate code generation unit 13 divides a range in which the absolute value exceeds a predetermined dead zone every predetermined Q steps. Then, the values of the image data belonging to each of these ranges are quantized to the median value of the ranges. For example, it is assumed that the dead zone and the Q step are both 2. In this case, a range in which the absolute value exceeds 2 (that is, a range of less than −2 and a range of greater than 2) is divided into two Q steps, “−4 to −2”, “2 to 4”, “ Define a range such as 4-6 ″. If a certain Y included in the 1xx component belongs to a range such as “2 to 4”, the value of Y is quantized to the median value of the range. Here, Y included in the 1xx component is illustrated, but U and V quantization is performed in the same manner. The same applies to the quantization processing for components other than the 1xx component.

また、中間符号生成部13は、連長解析を行った結果を中間符号の中に含めてもよい。すなわち、連長解析の結果も中間符号(中間データ)としてよい。連長解析は、同一のデータが連続して並んでいる場合にその連続数をカウントする処理である。連長解析の態様として、量子化後のY,U,Vの値がいずれも0である画素が連続する場合、その連続数をカウントする態様がある。あるいは、量子化後のY,U,Vの組み合わせが同一となる画素が連続する場合、その連続数をカウントしてもよい。図15は、ウェーブレット係数から生成した中間符号を模式的に示す説明図である。図15では連長解析によりカウントした連続数を“len”と表している。中間符号生成部13は、例えば、2LL成分、2xx成分、1xx成分に含まれるY,U,Vを上述の様に量子化し、2LL中間符号、2xx中間符号、1xx中間符号等を生成する。また、量子化後のY,U,Vに対して連長解析を行い、その結果(カウントした連続数“len”)を中間符号に含めてもよい。以下、中間符号にlenを含める場合を例にして説明する。   Further, the intermediate code generation unit 13 may include the result of the run length analysis in the intermediate code. That is, the result of the run length analysis may also be an intermediate code (intermediate data). The run length analysis is a process of counting the number of consecutive data when the same data is continuously arranged. As an aspect of the run length analysis, there is an aspect in which the number of consecutive pixels is counted when pixels whose Y, U, and V values after quantization are all 0 are consecutive. Alternatively, when pixels having the same combination of Y, U, and V after quantization are continuous, the number of consecutive pixels may be counted. FIG. 15 is an explanatory diagram schematically showing an intermediate code generated from wavelet coefficients. In FIG. 15, the continuous number counted by the run length analysis is expressed as “len”. For example, the intermediate code generation unit 13 quantizes Y, U, and V included in the 2LL component, the 2xx component, and the 1xx component as described above, and generates a 2LL intermediate code, a 2xx intermediate code, a 1xx intermediate code, and the like. Alternatively, the run length analysis may be performed on the quantized Y, U, and V, and the result (the counted number of consecutive “len”) may be included in the intermediate code. Hereinafter, a case where len is included in the intermediate code will be described as an example.

また、符号化データから得られる画像の最高画質を規定する分解レベル数(mとする。)が予め定められている。ここで、mは1以上N以下の整数である。中間符号生成部13は、分解レベル数m〜NのLL成分、および分解レベル数1〜Nのxx成分を対象にして、中間符号を生成する。換言すれば、(m)LL成分、(m+1)LL成分、・・・、NLL成分、および1xx成分、2xx成分、・・・、Nxx成分を対象にして中間符号を生成する。 Also, the decomposition level number defining the highest quality of the image obtained from the coded data (a m i.) Is predetermined. Here, mi is an integer of 1 or more and N or less. The intermediate code generation unit 13 generates an intermediate code for the LL component having the decomposition level number m i to N and the xx component having the decomposition level number 1 to N. In other words, an intermediate code is generated for (m i ) LL component, (m i +1) LL component,..., NLL component, 1xx component, 2xx component,.

第1の判定部14は、定められた範囲の分解レベル数の中間データのうちxx成分(すなわちLL成分以外の成分)を符号化するか否かを判定する処理を行う。   The first determination unit 14 performs a process of determining whether or not to encode the xx component (that is, the component other than the LL component) in the intermediate data of the number of decomposition levels in a predetermined range.

第1の判定部14は、この判定を行うために、中間符号の生成対象となる上記の各成分(分解レベル数m〜NのLL成分、および分解レベル数1〜Nのxx成分)毎に、量子化に用いる個々の範囲における中間符号の発生頻度(発生数)をカウントする。具体的には、第1の判定部14は、絶対値が所定のデッドゾーン以下となる範囲で量子化されたデータの発生頻度をY,U,V毎にカウントする。また、絶対値がそのデッドゾーンを越える範囲を所定のQステップ毎に区切った個々の範囲毎で量子化されたデータの発生頻度をY,U,V毎にカウントする。 The first determination section 14 to make this determination, (xx components of the LL component of the decomposition level number m i to N, and the division level number 1 to N) generates subject to the above respective components of the intermediate code for each In addition, the frequency (number of occurrences) of intermediate codes in each range used for quantization is counted. Specifically, the first determination unit 14 counts the occurrence frequency of data quantized in a range where the absolute value is equal to or less than a predetermined dead zone for each of Y, U, and V. Further, the frequency of occurrence of data quantized for each range obtained by dividing the range in which the absolute value exceeds the dead zone for each predetermined Q step is counted for each of Y, U, and V.

図16は、各範囲において量子化されたデータの発生頻度をカウントした結果を示す情報(以下、頻度表と記す。)の例を示す説明図である。図16では、2LL中間符号のY,Uの頻度表の例を示している。図16に示す各頻度表の左側の列は、量子化された結果を示し、右側の列は、その値に量子化されたデータ(図16の例ではYまたはU)の発生頻度を表している。すなわち、図16に例示する2LL中間符号のYの例では、絶対値がデッドゾーン以下の範囲に属し0に量子化されたYのデータが230個あり、255を中央値とする範囲に属し255に量子化されたYのデータが44個あることを示している。   FIG. 16 is an explanatory diagram illustrating an example of information (hereinafter referred to as a frequency table) indicating the result of counting the frequency of occurrence of quantized data in each range. FIG. 16 shows an example of the frequency table of Y and U of the 2LL intermediate code. The left column of each frequency table shown in FIG. 16 shows the quantized result, and the right column shows the frequency of occurrence of data quantized to that value (Y or U in the example of FIG. 16). Yes. That is, in the example of Y of the 2LL intermediate code illustrated in FIG. 16, there are 230 pieces of Y data whose absolute value belongs to the range below the dead zone and is quantized to 0, and belongs to the range whose central value is 255. Indicates that there are 44 Y data quantized.

第1の判定部14は、各頻度表からハフマンテーブルを生成する。図17は、ハフマンテーブルの例を示す説明図である。図17では、2LL中間符号のYについてのハフマンテーブルを例示している。第1の判定部14は、2LL中間符号のYの頻度表から、図17に例示するようなハフマンテーブルを生成する。また、同様に、他の頻度表からもそれぞれハフマンテーブルを生成する。図17に示すように、ハフマンテーブルは、量子化された各値(図17に示す例では、0〜255)と、その値から変換される符号とを含む。第1の判定部14は、量子化された値と符号が一対一に対応し、かつ、発生頻度が大きい値ほど符号のビット長が短くなるように符号を定め、量子化後の値と符号とを対応付けたハフマンテーブルを生成する。ハフマン符号を生成することで、量子化された各データの値(図16に示す例では0〜255)毎のハフマン符号のビット長が定まる。第1の判定部14は、各ハフマン符号毎に、ハフマン符号のビット長と、対応する発生頻度との積を求め、その総和を計算する。また、中間符号にlenが含まれる場合、各lenを符号化したときのビット長(例えばガンマ符号化したときのビット長)も、上記の総和に加算する。第1の判定部14は、1xx成分から(N−1)xx成分までの各xx成分および(N−1)LL成分に関して、これらの総和を求める。その総計が、符号量の目標符号量となる閾値よりも大きい場合、第1の判定部14は、定められた範囲の各分解レベル数を大きい順に選択し、選択した分解レベル数の中間データのxx成分を符号化した時のデータ量を推定し、その推定されたデータ量に応じて、その中間データのxx成分を符号化するか否かを判定する。この判定の動作フローについては、図19および図20を用いて後述する。   The first determination unit 14 generates a Huffman table from each frequency table. FIG. 17 is an explanatory diagram illustrating an example of a Huffman table. FIG. 17 illustrates a Huffman table for Y of the 2LL intermediate code. The first determination unit 14 generates a Huffman table as illustrated in FIG. 17 from the Y frequency table of the 2LL intermediate code. Similarly, Huffman tables are also generated from other frequency tables. As shown in FIG. 17, the Huffman table includes each quantized value (0 to 255 in the example shown in FIG. 17) and a code converted from the value. The first determination unit 14 determines the code so that the quantized value and the code have a one-to-one correspondence and the bit frequency of the code is shortened as the frequency of occurrence increases. To generate a Huffman table. By generating the Huffman code, the bit length of the Huffman code for each quantized data value (0 to 255 in the example shown in FIG. 16) is determined. For each Huffman code, the first determination unit 14 obtains the product of the bit length of the Huffman code and the corresponding occurrence frequency, and calculates the sum. If the len is included in the intermediate code, the bit length when each len is encoded (for example, the bit length when gamma-coded) is also added to the above sum. The 1st determination part 14 calculates | requires these sum regarding each xx component from a 1xx component to a (N-1) xx component, and a (N-1) LL component. When the total is larger than the threshold value that is the target code amount of the code amount, the first determination unit 14 selects the number of decomposition levels in a predetermined range in descending order, and the intermediate data of the selected number of decomposition levels A data amount when the xx component is encoded is estimated, and whether or not the xx component of the intermediate data is encoded is determined according to the estimated data amount. The operation flow of this determination will be described later with reference to FIGS. 19 and 20.

第2の判定部15は、上記の定められた範囲の分解レベル数よりも小さい各分解レベル数の中間符号のxx成分(LL成分以外の成分)に対して、再量子化を行うか否かを判断する。再量子化を行うか否かの判断対象となる分解レベル数の最大値をmとする。この場合、上述の定められた範囲の分解レベル数は、m+1〜Nの範囲の分解レベル数である。 The second determination unit 15 determines whether or not to re-quantize the xx component (component other than the LL component) of the intermediate code of each decomposition level number that is smaller than the number of decomposition levels in the predetermined range. Judging. Let m q be the maximum value of the number of decomposition levels for which it is determined whether or not to perform requantization. In this case, the number of decomposition levels in the above defined range is the number of decomposition levels in the range of m q +1 to N.

再量子化部16は、第2の判定部15が再量子化を行うと判定した場合、定められた範囲の分解レベル数(すなわちm+1〜N)よりも小さい各分解レベル数(1〜m)の中間符号のうちxx成分を再量子化する。 When the second determination unit 15 determines that requantization is performed, the requantization unit 16 determines the number of decomposition levels (1 to 1) smaller than the number of decomposition levels in a predetermined range (that is, m q +1 to N). The xx component of the intermediate code of m q ) is requantized.

符号化部17は、中間符号および再量子化部16によって中間符号から再量子化された値をハフマン符号に符号化する。また、中間符号にlen(連長解析でカウントされた連続数)が含まれている場合、そのlenも符号化する。この場合、符号化部17は、例えば、lenをガンマ符号に符号化すればよい。lenを2進数で表したときのビット長をlとすると、符号化部17は、その2進数のビットの先頭に“l−1”個の0を付加することで、lenをガンマ符号に変換する。符号化部17が中間符号または再量子化の結果をハフマン符号に変換し、lenを例えばガンマ符号に変換することにより、画像データが符号化されることになる。   The encoding unit 17 encodes the value requantized from the intermediate code by the intermediate code and the requantization unit 16 into a Huffman code. Further, when len (continuous number counted by continuous length analysis) is included in the intermediate code, the len is also encoded. In this case, the encoding part 17 should just encode len to a gamma code, for example. If the bit length when len is expressed in binary number is l, the encoding unit 17 converts len to gamma code by adding “l−1” 0s to the head of the binary bit. To do. The encoding unit 17 converts the intermediate code or the result of requantization into a Huffman code, and converts len into, for example, a gamma code, whereby image data is encoded.

図18は、ハフマン符号化の結果の例を模式的に示す説明図である。図18では、2LL成分、2xx成分および1xx成分について符号化を行った場合を例示している。符号化前のデータにY,U,Vだけでなくlenも含まれる場合、Y,U,V,lenそれぞれの符号化データが2LL成分等の符号化結果に含まれる。   FIG. 18 is an explanatory diagram schematically illustrating an example of the result of Huffman coding. FIG. 18 illustrates a case where encoding is performed on the 2LL component, the 2xx component, and the 1xx component. When the data before encoding includes len as well as Y, U, and V, the encoded data of Y, U, V, and len are included in the encoding result of the 2LL component or the like.

ウェーブレット変換部12と、中間符号生成部13と、第1の判定部14と、第2の判定部15と、再量子化部16と、符号化部17とを含む領域符号化部7は、例えば、全体目標符号量算出部2、圧縮率算出部3、領域別目標符号量算出部4として動作するCPUによって実現され、そのCPUがプログラムに従って領域符号化部7としての処理を行ってもよい。   A region encoding unit 7 including a wavelet transform unit 12, an intermediate code generation unit 13, a first determination unit 14, a second determination unit 15, a requantization unit 16, and an encoding unit 17, For example, it may be realized by a CPU that operates as the overall target code amount calculation unit 2, the compression rate calculation unit 3, and the region-specific target code amount calculation unit 4, and the CPU may perform processing as the region encoding unit 7 according to a program. .

次に、領域符号化部7の動作について説明する。図19および図20は、領域符号化部7の処理経過の一例を示すフローチャートである。なお、フローチャート中に記載した「出力」とは、「符号化処理」を表している。   Next, the operation of the region encoding unit 7 will be described. FIG. 19 and FIG. 20 are flowcharts showing an example of processing progress of the region encoding unit 7. Note that “output” described in the flowchart represents “encoding processing”.

まず、ウェーブレット変換部12が、画像が送信される領域の画像データに対して、分解レベル数Nまでウェーブレット変換を行う。   First, the wavelet transform unit 12 performs wavelet transform on the image data in the area where the image is transmitted up to the decomposition level number N.

そして、中間符号生成部13は、分解レベル数m〜NのLL成分、および分解レベル数1〜Nのxx成分を対象にして中間符号を生成する。すなわち、中間符号生成部13は、それらの成分に含まれるY,U,Vを、成分の種類に応じて定められるデッドゾーンおよびQステップに応じて量子化する。既に説明したように、中間符号生成部13は、絶対値が所定のデッドゾーン以下であるY,U,Vを0に量子化する。また、絶対値が所定のデッドゾーンを越える範囲をQステップ毎に区切り、各範囲に属するY,U,Vをその範囲の中央値に量子化する。また、例えば、Y,U,Vの組み合わせが同一となる画素が連続する場合、その連続数(len)をカウントする。中間符号生成部13は、このY,U,Vの量子化結果およびlenを中間符号として、目標符号量算出装置が備える記憶装置(図示せず。)に記憶させる。 Then, the intermediate code generation unit 13 generates an intermediate code with respect to the LL component having the decomposition level number m i to N and the xx component having the decomposition level number 1 to N. That is, the intermediate code generation unit 13 quantizes Y, U, and V included in these components according to the dead zone and Q step determined according to the type of component. As already described, the intermediate code generation unit 13 quantizes Y, U, and V whose absolute values are equal to or less than a predetermined dead zone to 0. Further, a range where the absolute value exceeds a predetermined dead zone is divided every Q steps, and Y, U, and V belonging to each range are quantized to a median value of the range. Further, for example, when pixels having the same combination of Y, U, and V are consecutive, the number of consecutive (len) is counted. The intermediate code generation unit 13 stores the Y, U, and V quantization results and len as intermediate codes in a storage device (not shown) included in the target code amount calculation device.

また、第1の判定部14は、中間符号を生成した分解レベル数m〜NのLL成分、および分解レベル数1〜Nのxx成分の中間符号を対象として、Y,U,Vそれぞれの頻度表を生成し、目標符号量算出装置が備える記憶装置(図示せず。)に記憶させる。第1の判定部14は、各成分に含まれるY,U,V毎に、デッドゾーンおよびQステップによって定まる各範囲での発生頻度をカウントすることによって頻度表を生成すればよい(以上、ステップS1)。 Further, the first determination unit 14 targets each of Y, U, and V for the intermediate code of the decomposition level number m i to N that generated the intermediate code and the intermediate code of the decomposition level number 1 to N of the xx component. A frequency table is generated and stored in a storage device (not shown) included in the target code amount calculation device. The first determination unit 14 may generate a frequency table by counting the frequency of occurrence in each range determined by the dead zone and the Q step for each of Y, U, and V included in each component (the above step). S1).

次に、第1の判定部14は、m(符号化データから得られる画像の最高画質を規定する分解レベル数)を変数mに代入する(ステップS2)。ステップS2で設定されるmは、ステップS3〜S7の制御に用いられる。 Next, the first determination unit 14 substitutes m i (the number of decomposition levels that defines the highest image quality of the image obtained from the encoded data) into the variable m (step S2). M set in step S2 is used for the control in steps S3 to S7.

ステップS2の後、第1の判定部14は、m<Nとなっているか否かを判定する(ステップS3)。変数mがN未満であれば(ステップS3のY)、第1の判定部14は、分解レベル数mのLL成分(mLL成分)および分解レベル数1〜mのxx成分(1xx〜mxx成分)の中間符号を符号化したときの符号量を推定する。このとき、第1の判定部14は、これらの各成分のY,U,Vそれぞれの頻度表からハフマンテーブル(図17参照)を生成し、各ハフマン符号毎に、ハフマン符号のビット長と、対応するY,UまたはVの発生頻度とを乗じ、その乗算結果の総和を計算する。さらに、本例では、lenが中間符号に含まれているので、中間符号に含まれる各lenを符号(例えばガンマ符号)に変換したときの符号量もその総和に加算する。第1の判定部14は、各成分毎にこの総和を求め、それらの合計を計算する(ステップS4)。この合計値は、mLL成分および1xx〜mxx成分の中間符号を符号化したときの推定符号量である。なお、推定符号量とは、中間符号を符号化した後のデータ量として推定される値である。   After step S2, the first determination unit 14 determines whether m <N is satisfied (step S3). If the variable m is less than N (Y in Step S3), the first determination unit 14 determines the LL component (mLL component) with the decomposition level number m and the xx component (1xx to mxx component) with the decomposition level number 1 to m. The code amount when the intermediate code is encoded is estimated. At this time, the first determination unit 14 generates a Huffman table (see FIG. 17) from the frequency tables of Y, U, and V of these components, and for each Huffman code, the bit length of the Huffman code, Multiply the corresponding occurrence frequency of Y, U, or V, and calculate the sum of the multiplication results. Furthermore, in this example, since len is included in the intermediate code, the code amount when each len included in the intermediate code is converted into a code (for example, a gamma code) is also added to the sum. The 1st determination part 14 calculates | requires this sum for every component, and calculates those sum total (step S4). This total value is an estimated code amount when the intermediate code of the mLL component and the 1xx to mxx components is encoded. The estimated code amount is a value estimated as the data amount after encoding the intermediate code.

続いて、第1の判定部14は、その推定符号量が、符号化の対象としている領域の目標符号量より大きいか否かを判定する(ステップS5)。このように、領域別目標符号量算出部4が算出した目標符号量は、ステップS5において閾値として用いられる。また、後述のステップS13,S19においても閾値として用いられる。   Subsequently, the first determination unit 14 determines whether or not the estimated code amount is larger than the target code amount of the region to be encoded (step S5). Thus, the target code amount calculated by the region-specific target code amount calculation unit 4 is used as a threshold value in step S5. It is also used as a threshold value in steps S13 and S19 described later.

推定符号量が目標符号量以下である場合(ステップS5のN)、ステップS9に移行する。ステップS9において、符号化部17は、mLLの中間符号をハフマン符号に変換する。符号化部17は、ステップS4で生成したmLL成分のY,U,Vに対応するハフマンテーブルを用いて、mLL中間符号のY,U,Vを、対応するハフマン符号に変換すればよい(ステップS9)。さらに、符号化部17は、mxx、(m−1)xx、・・・、1xxの各成分の中間符号もハフマン符号に変換する(ステップS10)。mxxから1xxまでの各中間符号のY,U,Vについても、ステップS4で生成したハフマンテーブルを用いて、対応するハフマン符号に変換すればよい。また、符号化部17は、ステップS9,S10において、各中間符号中のlenを例えばガンマ符号に符号化する。   When the estimated code amount is less than or equal to the target code amount (N in step S5), the process proceeds to step S9. In step S9, the encoding unit 17 converts the MLL intermediate code into a Huffman code. The encoding unit 17 may convert the Y, U, V of the mLL intermediate code into the corresponding Huffman code using the Huffman table corresponding to Y, U, V of the mLL component generated in step S4 (step S4). S9). Further, the encoding unit 17 converts the intermediate codes of the components mxx, (m−1) xx,..., 1xx into Huffman codes (step S10). The intermediate codes Y, U, and V from mxx to 1xx may be converted into corresponding Huffman codes using the Huffman table generated in step S4. In addition, in steps S9 and S10, the encoding unit 17 encodes len in each intermediate code into, for example, a gamma code.

推定符号量が目標符号量よりも大きい場合(ステップS5のY)、第1の判定部14は、変数mの値を1インクリメントし(ステップS7)、ステップS3以降の処理を繰り返す。変数mを1インクリメントして再度ステップS3からステップS4に移行した場合、以前のステップS4で符号量を求めた成分については再度、符号量を求め直す必要はなく、インクリメント後のmが示すmLL成分およびmxx成分を求めて、mLL成分および1xx〜mxx成分の総符号量を推定すればよい。   When the estimated code amount is larger than the target code amount (Y in step S5), the first determination unit 14 increments the value of the variable m by 1 (step S7), and repeats the processes after step S3. When the variable m is incremented by 1 and the process proceeds from step S3 to step S4 again, it is not necessary to obtain the code amount again for the component for which the code amount was obtained in the previous step S4, and the mLL component indicated by m after the increment And the mxx component are obtained, and the total code amount of the mLL component and the 1xx to mxx components may be estimated.

また、ステップS3において、m=Nであると判定した場合(ステップS3のN)、再量子化処理(ステップS8)を行う。図20に示すステップS11以降の処理は、このステップS8の再量子化処理を表している。すなわち、ステップS3でm=Nであるならば、ステップS11(図20参照)に移行する。   If it is determined in step S3 that m = N (N in step S3), requantization processing (step S8) is performed. The process after step S11 shown in FIG. 20 represents the requantization process of step S8. That is, if m = N in step S3, the process proceeds to step S11 (see FIG. 20).

ステップS11に移行したということは、分解レベル数“N−1”の中間符号のLL成分および分解レベル数1から“N−1”までの中間符号のxx成分を符号化したときの符号推定量が目標符号量よりも大きい。このとき、第1の判定部14は、符号化部17にNLL成分を符号化させる(ステップS11)。符号化部17は、NLL中間符号のY,U,Vそれぞれの頻度表からハフマンテーブルを生成し、そのY,U,Vをそれぞれ対応するハフマン符号に変換する。また、符号化部17は、NLL中間符号に含まれる各lenを、例えばガンマ符号に符号化する。   The transition to step S11 means that the code estimation amount when the LL component of the intermediate code of the decomposition level number “N−1” and the xx component of the intermediate code from the decomposition level number 1 to “N−1” is encoded. Is larger than the target code amount. At this time, the first determination unit 14 causes the encoding unit 17 to encode the NLL component (step S11). The encoding unit 17 generates a Huffman table from the frequency tables of Y, U, and V of the NLL intermediate code, and converts the Y, U, and V into corresponding Huffman codes. The encoding unit 17 encodes each len included in the NLL intermediate code into, for example, a gamma code.

次に、第1の判定部14は、Nを変数mに代入する(ステップS12)。ステップS12で設定されるmは、ステップS13〜S21の制御に用いられる。   Next, the 1st determination part 14 substitutes N to the variable m (step S12). M set in step S12 is used for the control in steps S13 to S21.

ステップS12の後、第1の判定部14は、m≦mとなっているか否かを判定する(ステップS13)。m≦mが成立していなければ(ステップS13のN)、変数mが示す分解レベル数のxx成分(すなわち、mxx成分)の符号量を推定する(ステップS14)。ステップS14では、mxx成分のY,U,Vそれぞれの頻度表からハフマンテーブルを生成し、各ハフマン符号毎に、ハフマン符号のビット長と、対応するY,UまたはVの発生頻度とを乗じ、その乗算結果の総和を計算する。そして、各lenを符号化したときのビット長もその総和に加算すればよい。なお、ステップS4で、mxx成分の推定符号量を計算済であるならば、その推定符号量を参照してもよい。 After step S12, the first determination unit 14 determines whether m ≦ m q is satisfied (step S13). If m ≦ m q does not hold (N in step S13), the code amount of the xx component (that is, the mxx component) of the number of decomposition levels indicated by the variable m is estimated (step S14). In step S14, a Huffman table is generated from the frequency tables of Y, U, and V of the mxx component, and for each Huffman code, the bit length of the Huffman code is multiplied by the occurrence frequency of the corresponding Y, U, or V, The sum of the multiplication results is calculated. The bit length when each len is encoded may be added to the sum. If the estimated code amount of the mxx component has been calculated in step S4, the estimated code amount may be referred to.

続いて、第1の判定部14は、ステップS14で求めた符号推定量と、既に符号化した符号データのデータ量との合計が、目標符号量よりも大きくなっているか否かを判定する(ステップS15)。その合計が目標符号量よりも大きければ(ステップS15のY)、処理を終了する。また、その合計が目標符号量以下であれば(ステップS15のN)、符号化部17にそのmxx成分を符号化させる(ステップS16)。符号化部17は、ステップS14で符号量推定に用いたmxx成分のY,U,Vに対応するハフマンテーブルを用いて、mxx成分のY,U,Vを対応するハフマン符号に変換する。また、符号化部17は、mxx成分中のlenを例えばガンマ符号に符号化する。   Subsequently, the first determination unit 14 determines whether or not the sum of the code estimation amount obtained in step S14 and the data amount of already encoded code data is larger than the target code amount ( Step S15). If the sum is larger than the target code amount (Y in step S15), the process is terminated. If the sum is equal to or less than the target code amount (N in step S15), the encoding unit 17 encodes the mxx component (step S16). The encoding unit 17 converts the mxx component Y, U, and V into the corresponding Huffman code using the Huffman table corresponding to the mxx component Y, U, and V used for the code amount estimation in step S14. The encoding unit 17 encodes len in the mxx component into, for example, a gamma code.

続いて、第1の判定部14は、変数mの値を1減算し(ステップS17)、ステップS13以降の処理を繰り返す。ステップS13からステップS17のループ処理を繰り返すことで、第1の判定部14は、ステップS14に移行する毎に、定められた範囲の分解レベル数(すなわちm+1〜N)を、大きい順に選択し、そのxx成分の符号量を推定することになる。 Subsequently, the first determination unit 14 subtracts 1 from the value of the variable m (step S17), and repeats the processing after step S13. By repeating the loop processing from step S13 to step S17, the first determination unit 14 selects the number of decomposition levels in a predetermined range (that is, m q +1 to N) in descending order every time the process proceeds to step S14. Then, the code amount of the xx component is estimated.

また、ステップS17で変数mの値を1減算した結果、ステップS13においてm≦mであると判定したならば(ステップS13のY)、ステップS18に移行する。したがって、ステップS18以降では、mの値はmとなっている。 If it is determined in step S17 that the value of the variable m is subtracted by 1 and m ≦ mq is determined in step S13 (Y in step S13), the process proceeds to step S18. Therefore, after step S18, the value of m is mq .

ステップS18では、第2の判定部8は、ステップS18移行時のmが示す分解レベル数のxx成分(すなわちmxx成分)から、1xx成分までの各xx成分の中間符号を符号化したときの符号量を推定する。最初にステップS18に移行した場合(すなわち、まだステップS20の再量子化を行っていない場合)には、mxx〜1xxの各成分の中間符号を符号化したときの符号量を推定する。また、ステップS20の再量子化処理後にステップS18に移行した場合には、再量子化後のmxx〜1xxの各成分の中間符号の符号量を推定する。   In step S18, the second determination unit 8 encodes the intermediate code of each xx component from the xx component (that is, the mxx component) of the decomposition level number indicated by m at the time of transition to step S18 to the 1xx component. Estimate the amount. When the process first proceeds to step S18 (that is, when the requantization of step S20 has not been performed yet), the code amount when the intermediate code of each component of mxx to 1xx is encoded is estimated. When the process proceeds to step S18 after the requantization process in step S20, the code amount of the intermediate code of each component of mxx to 1xx after the requantization is estimated.

各成分の中間符号の符号量を推定する場合には、各成分のY,U,Vそれぞれの頻度表からハフマンテーブルを生成し、各ハフマン符号毎に、ハフマン符号のビット長と、対応するY,UまたはVの発生頻度とを乗じ、その乗算結果の総和を計算し、さらに、各lenを符号化したときのビット長もその総和に加算すればよい。   When estimating the code amount of the intermediate code of each component, a Huffman table is generated from the frequency tables of Y, U, and V of each component, and for each Huffman code, the bit length of the Huffman code and the corresponding Y , U or V occurrence frequency, the sum of the multiplication results is calculated, and the bit length when each len is encoded may be added to the sum.

なお、ステップS20の再量子化では、再量子化後のY,U,Vの頻度表も作成する。ステップS20からステップS18に移行した場合、その頻度表を用いてハフマンテーブルを生成すればよい。   In the requantization in step S20, a frequency table of Y, U, and V after requantization is also created. When the process proceeds from step S20 to step S18, a Huffman table may be generated using the frequency table.

ステップS18の後、第2の判定部8は、ステップS18で求めたmxx〜1xxを符号化したときの符号量および、既に符号化した符号データのデータ量との合計が、目標符号量よりも大きくなっているか否かを判定する(ステップS19)。   After step S18, the second determination unit 8 determines that the sum of the code amount obtained by encoding mxx to 1xx obtained in step S18 and the data amount of the already encoded code data is larger than the target code amount. It is determined whether or not it is larger (step S19).

その合計が目標符号量よりも大きいならば、第2の判定部8は再量子化を行うと判定し、ステップS20に移行する(ステップS19のY)。   If the sum is larger than the target code amount, the second determination unit 8 determines to perform re-quantization, and proceeds to step S20 (Y in step S19).

また、その合計が目標符号量以下であるならば、第2の判定部8は再量子化を行わないと判定し、ステップS21に移行する(ステップS19のN)。   If the total is equal to or less than the target code amount, the second determination unit 8 determines not to re-quantize, and proceeds to step S21 (N in step S19).

ステップS21では、符号化部17は、ステップS18での符号量推定に用いたハフマンテーブルを用いて、mxx成分から1xx成分のY,U,Vを、対応するハフマン符号に変換する。また、符号化部17は、各成分中のlenを例えばガンマ符号に符号化する。   In step S21, the encoding unit 17 converts the Yxx, Uxx, and 1xx components from the mxx component into the corresponding Huffman codes using the Huffman table used for the code amount estimation in step S18. The encoding unit 17 encodes len in each component into, for example, a gamma code.

また、ステップS20では、再量子化部16は、1xx中間符号からmxx中間符号までのY,U,Vを再量子化する。ステップS18以降におけるmはmであるので、1xx中間符号からmxx中間符号までのY,U,Vを再量子化する。再量子化部16は、再量子化処理を行うときに、例えば、既に選択したQステップ以上のQステップや、既に選択したデッドゾーン以上のデッドゾーンを新たに定める。 In step S20, the requantization unit 16 requantizes Y, U, and V from the 1xx intermediate code to the mxx intermediate code. Since m in step S18 and thereafter is m q , Y, U, and V from the 1xx intermediate code to the m q xx intermediate code are requantized. When performing the requantization process, the requantization unit 16 newly determines, for example, a Q step that is already selected Q step or higher, or a dead zone that is already selected dead zone or higher.

ステップS20において、再量子化部16は、1xxからmxxまでの各成分毎に、新たなデッドゾーンを定める。このとき、再量子化部16は、hを0以上の整数とし、ステップS1で中間符号を生成したときに用いたデッドゾーンおよびQステップをそれぞれdz,qsとすると、dz+h・qsを新たなデッドゾーンに定める。そして、再量子化部16は、絶対値がその新たなデッドゾーン以下である中間符号(Y,U,V)の値を0に再量子化する。 In step S20, the requantization unit 16 determines a new dead zone for each component from 1xx to m q xx. At this time, the re-quantization unit 16 sets dz + h · qs as a new dead, assuming that h is an integer greater than or equal to 0, and the dead zone and Q step used when the intermediate code is generated in step S1 are dz and qs, respectively. Set in the zone. Then, the requantization unit 16 requantizes the value of the intermediate code (Y, U, V) whose absolute value is equal to or less than the new dead zone to 0.

また、再量子化部16は、1xx〜mxxまでの各成分毎に、新たなQステップを定める。このとき、再量子化部16は、nを0以上の整数とすると、上記のqsを用いて、qs・(2n+1)を新たなQステップに定めることが好ましい。そして、絶対値が上記の新たなデッドゾーンを越える範囲を新たなQステップ(qs・(2n+1))毎に区切り、範囲を定める。そして、各範囲に属する1xx〜mxxまでの各成分の中間符号(Y,U,V)を、その範囲の中央値に量子化する。新たなQステップをqs・(2n+1)とすることが好ましい理由は、そのようにQステップを定めることで、新たに定める範囲の中央値が、ステップS1で量子化するときに用いた範囲の中央値と一致するので、符号化データの画質劣化を防止することができるためである。Qステップをqs・(2n+1)として定めた新たな範囲は、ステップS1量子化するときに用いた範囲を組み合わせた範囲となっている。 Further, the requantization unit 16 determines a new Q step for each component from 1xx to m q xx. At this time, it is preferable that the requantization unit 16 sets qs · (2n + 1) as a new Q step using the above qs, where n is an integer of 0 or more. Then, the range in which the absolute value exceeds the new dead zone is divided for each new Q step (qs · (2n + 1)) to determine the range. Then, the intermediate codes (Y, U, V) of each component from 1xx to m q xx belonging to each range are quantized to the median value of the range. The reason why it is preferable to set the new Q step to qs · (2n + 1) is that the Q value is determined in this way, so that the median value of the newly determined range is the center of the range used when quantizing in step S1. This is because the image quality of the encoded data can be prevented from deteriorating because it matches the value. The new range in which the Q step is defined as qs · (2n + 1) is a range obtained by combining the ranges used when the step S1 is quantized.

ただし、ステップS1で中間符号を導出する際のQステップが1である場合には、ステップS20では、任意の値(ただし、1以上の整数)を新たなQステップとしてよい。ステップS1におけるQステップが1であるならば、新たに定めるQステップの値によらず、新たに定める範囲の中央値が、ステップS1で量子化するときに用いた範囲の中央値と一致するためである。   However, if the Q step for deriving the intermediate code in step S1 is 1, an arbitrary value (however, an integer of 1 or more) may be set as a new Q step in step S20. If the Q step in step S1 is 1, the median value of the newly defined range matches the median value of the range used when quantizing in step S1, regardless of the value of the newly defined Q step. It is.

また、ステップS20において、第2の判定部15は、中間符号を再量子化して得た新たなY,U,Vの頻度表をそれぞれ生成する。再量子化に用いた範囲は、絶対値がデッドゾーン以下の範囲と、その範囲以外を新たなQステップで区切って定めた個々の範囲である。これらの範囲はいずれも、ステップS1で中間符号を生成するときに用いた範囲を組み合わせたものであり、ステップS1での量子化に用いた範囲に対応する。そして、ステップS1における各範囲(例えば、0に量子化する範囲、1に量子化する範囲等)における頻度表は既にステップS1で導出されている。従って、第2の判定部15は、ステップS20での量子化のために定めた個々の範囲に対応する、ステップS1で用いた各範囲を特定し、その各範囲における発生頻度の和を、新たな範囲における発生頻度とすればよい。このように発生頻度を定めることにより、新たな範囲で量子化されたY,U,Vの発生頻度をカウントし直さなくて済む。   In step S20, the second determination unit 15 generates new Y, U, and V frequency tables obtained by requantizing the intermediate code. The ranges used for requantization are individual ranges determined by dividing an absolute value of the dead zone or less by a new Q step. Each of these ranges is a combination of the ranges used when generating the intermediate code in step S1, and corresponds to the range used for quantization in step S1. Then, the frequency table in each range (for example, a range to be quantized to 0, a range to be quantized to 1, etc.) in step S1 has already been derived in step S1. Therefore, the second determination unit 15 specifies each range used in step S1 corresponding to each range defined for quantization in step S20, and newly calculates the sum of the occurrence frequencies in each range. The occurrence frequency may be within a certain range. By determining the occurrence frequency in this way, it is not necessary to recount the occurrence frequencies of Y, U, and V quantized in a new range.

図21は、ステップS20における頻度表導出を模式的に示す説明図である。図21に示す上段のヒストグラムは、ステップS1で中間符号生成のための量子化において、各範囲の中央値に量子化されたデータ(例えばYとする。)の発生頻度を示している。また、図21に示す下段のヒストグラムは、ステップS20の再量子化において、各範囲の中央値に量子化されたデータの発生頻度を示している。また、図21において、A〜IおよびS〜Uは、量子化後の中央値の例示である。ステップS20の再量子化処理で、再量子化部16が、新たなQステップおよびデッドゾーンから範囲を区切った結果、A,B,Cそれぞれを中央値とする3つの範囲を組み合わせて、Sを中央値とする一つの範囲を定め、その範囲に属するデータ(Y)を中央値Sに量子化したとする。この場合、第2の判定部15は、図21の上段のヒストグラムのように表される頻度表において、値Aに量子化したデータ数、値Bに量子化したデータ数、および値Cに量子化したデータ数の和を計算し、その3つの範囲に対応する新たな範囲(Sを中央値とする範囲)に属し値Sに量子化したデータの発生頻度を計算すればよい。他の範囲における発生頻度も同様に計算すればよい。このように再量子化後の発生頻度を計算することにより、各範囲におけるデータの発生頻度をカウントし直さなくて済むので、処理を高速化することができる。   FIG. 21 is an explanatory diagram schematically showing frequency table derivation in step S20. The upper histogram shown in FIG. 21 indicates the frequency of occurrence of data quantized to the median value of each range (for example, Y) in the quantization for generating the intermediate code in step S1. Further, the lower histogram shown in FIG. 21 indicates the frequency of occurrence of data quantized to the median value of each range in the requantization in step S20. In FIG. 21, A to I and S to U are examples of median values after quantization. In the requantization process in step S20, the requantization unit 16 divides the range from the new Q step and the dead zone, and as a result, combines three ranges with A, B, and C as median values, It is assumed that one range as the median value is defined and data (Y) belonging to the range is quantized to the median value S. In this case, the second determination unit 15 uses the number of data quantized to value A, the number of data quantized to value B, and the quantum to value C in the frequency table represented as the upper histogram in FIG. The sum of the number of converted data may be calculated, and the frequency of occurrence of data that belongs to a new range (a range with S as the median) corresponding to the three ranges and is quantized to the value S may be calculated. The occurrence frequency in other ranges may be calculated similarly. By calculating the occurrence frequency after requantization in this way, it is not necessary to recount the occurrence frequency of data in each range, so that the processing can be speeded up.

他の範囲におけるデータの発生頻度も同様である。なお、上記のように、新たなデッドゾーンをdz+h・qsとし、新たなQステップをqs・(2n+1)とすれば、新たな範囲における中央値は、中間符号生成時の量子化における中央値と等しくなる。例えば、図21に示す例では、S=B,T=E,U=Hとなる。   The same applies to the occurrence frequency of data in other ranges. As described above, if the new dead zone is dz + h · qs and the new Q step is qs · (2n + 1), the median in the new range is the median in the quantization at the time of intermediate code generation. Will be equal. For example, in the example shown in FIG. 21, S = B, T = E, and U = H.

上記のステップS20の後、ステップS18以降の処理を繰り返す。第2の判定部15は、ステップS20で頻度表を新たに生成している。第2の判定部15は、その後のステップS18ではその頻度表を用いて、ステップS20で量子化された値の符号を示すハフマンテーブルを生成する。このとき、第2の判定部15は、ステップS1における量子化後の各値(すなわち、ステップS1で生成された各中間符号)を、それぞれ新たな頻度表から生成したハフマンテーブル内の新たな符号に対応づければよい。   After the above step S20, the processes after step S18 are repeated. The second determination unit 15 newly generates a frequency table in step S20. In the subsequent step S18, the second determination unit 15 uses the frequency table to generate a Huffman table indicating the sign of the value quantized in step S20. At this time, the second determination unit 15 uses the new value in the Huffman table generated from the new frequency table for each value after quantization in Step S1 (that is, each intermediate code generated in Step S1). Should be associated with.

図22は、中間符号の値と再量子化後に導出した符号との対応付けを示す説明図である。例えば、図22に例示する再量子化前の中間符号−1,0,1を、0に再量子化したとする。この場合、第2の判定部15は、再量子化後の0等の各値の頻度表からハフマンテーブルを導出する。このハフマンテーブルでは、中間符号0に対応する符号が0であったとする。すると、第2の判定部15は、元の中間符号−1,0,1それぞれに、新たな符号0を対応付ける。例えば、元の中間符号−1,0,1に応じた各符号“100”,“0”,“101”をそれぞれ新たな符号“0”に置換する。このように処理することにより、元の中間符号−1,1からも、0と同じ符号を参照することができる。そして、中間符号を書き換えることなく、再量子化後の値に応じたハフマン符号を生成することができる。   FIG. 22 is an explanatory diagram showing the association between the value of the intermediate code and the code derived after requantization. For example, it is assumed that the intermediate code −1, 0, 1 before re-quantization illustrated in FIG. 22 is re-quantized to 0. In this case, the second determination unit 15 derives a Huffman table from the frequency table of each value such as 0 after requantization. In this Huffman table, it is assumed that the code corresponding to the intermediate code 0 is 0. Then, the second determination unit 15 associates a new code 0 with each of the original intermediate codes −1, 0, 1. For example, each code “100”, “0”, “101” corresponding to the original intermediate code-1, 0, 1 is replaced with a new code “0”. By processing in this way, the same code as 0 can be referred to from the original intermediate codes -1,1. Then, a Huffman code corresponding to the value after requantization can be generated without rewriting the intermediate code.

再量子化処理を行うことにより、ハフマン符号のビット数を減少させることができる。よって、ステップS18〜S20のループ処理を繰り返すことで、符号化後の総符号量を減少させることができる。そして、推定される総符号量が目標符号量以下となったときに、ステップS21に移行して符号化処理を行えばよい。   By performing the requantization process, the number of bits of the Huffman code can be reduced. Therefore, the total code amount after encoding can be reduced by repeating the loop processing of steps S18 to S20. Then, when the estimated total code amount becomes equal to or less than the target code amount, the process proceeds to step S21 and the encoding process may be performed.

また、ステップS20の再量子化処理でデッドゾーンの値を大きくした結果、全ての中間符号(Y,U,V)を一つの値(0)に量子化する場合がある。この場合、符号化部17は、ステップS21において、符号化処理を禁止してもよい。すなわち、再量子化によって、全ての中間符号が0に量子化された場合、符号化部17は、再量子化後のY,U,Vの値をハフマン符号に変換することなく処理を終了してよい。また、lenを符号化する処理も実行しなくてよい。このように、全てのY,U,Vがいずれも0に量子化される場合には、符号化処理を行わないことによって、処理量を削減することができる。   In addition, as a result of increasing the dead zone value in the requantization process in step S20, all intermediate codes (Y, U, V) may be quantized to one value (0). In this case, the encoding unit 17 may prohibit the encoding process in step S21. That is, when all the intermediate codes are quantized to 0 by requantization, the encoding unit 17 ends the process without converting the values of Y, U, and V after the requantization into Huffman codes. It's okay. Also, the process of encoding len need not be executed. As described above, when all of Y, U, and V are quantized to 0, the processing amount can be reduced by not performing the encoding process.

以上のような符号化方法では、定められた範囲の分解レベル数(m+1〜N)について、第1の判定部14がxx成分の符号化を行うと判定したときに、そのxx成分を符号化しておく。そして、その分解レベル数よりも低い分解レベル数(1〜m)を符号化したときの符号量に応じて、その分解レベル数(1〜m)の中間符号を再量子化する。よって、ウェーブレット変換によって得た各分解レベル数の一部について再量子化をするので、処理負荷を抑制しながら、符号量が目標符号量以下になるように制御することができる。 In the encoding method as described above, when the first determination unit 14 determines to encode the xx component for the number of decomposition levels (m q +1 to N) in a predetermined range, the xx component is Encode it. Then, the intermediate code of the decomposition level number (1 to m q ) is requantized according to the code amount when the decomposition level number (1 to m q ) lower than the decomposition level number is encoded. Therefore, since re-quantization is performed for a part of the number of decomposition levels obtained by the wavelet transform, it is possible to control the code amount to be equal to or less than the target code amount while suppressing the processing load.

また、再量子化処理では、中間符号を導出する際に用いるデッドゾーンおよびQステップから定まる範囲を組み合わせた範囲を定め、その新たな各範囲内の値を範囲の中央値に量子化する。このように、新たな範囲を、中間符号導出時の範囲を組み合わせた範囲として求めるので、新たな頻度表を求める際に、中間符号導出時にカウントした結果の和を求めればよい(図21参照)。よって、処理負荷を抑制し、また、処理を高速化することができる。   In the requantization process, a range obtained by combining the dead zone used when deriving the intermediate code and the range determined from the Q step is determined, and the value in each new range is quantized to the median value of the range. In this way, the new range is obtained as a range combining the range at the time of deriving the intermediate code, and therefore, when obtaining a new frequency table, the sum of the results counted at the time of deriving the intermediate code may be obtained (see FIG. 21). . Therefore, the processing load can be suppressed and the processing speed can be increased.

また、再量子化処理におけるQステップを、qs・(2n+1)と定めることで、再量子化後の値を中間符号の値と一致させることができ、符号化データの画質劣化を防止することができる。   In addition, by defining the Q step in the requantization process as qs · (2n + 1), the value after requantization can be made to match the value of the intermediate code, and deterioration of the image quality of the encoded data can be prevented. it can.

既に説明したように、領域別目標符号量算出部4は、画像が送信される領域における符号化前の画像データのデータ量が所定の閾値以下であるならば、その領域の目標符号量を、目標符号量のとり得る最大値に定めてもよい。この場合、上記のステップS5では必ず推定符号量が目標符号量以下であると判定され、ステップS9に移行することになる。この結果、データ量が所定の閾値以下となる小さな領域では、圧縮率を低めて、画質を向上させることとなる。   As already described, if the data amount of the image data before encoding in the region where the image is transmitted is equal to or less than a predetermined threshold, the region-specific target code amount calculation unit 4 The maximum value that the target code amount can take may be set. In this case, it is always determined in step S5 that the estimated code amount is equal to or less than the target code amount, and the process proceeds to step S9. As a result, in a small area where the data amount is equal to or less than a predetermined threshold, the compression rate is lowered and the image quality is improved.

上記の説明では、中間データを生成するときに(例えばステップS1において)、ウェーブレット変換によって得られた係数に対して量子化を行った結果を中間符号とする場合を例にして説明したが、ウェーブレット変換によって得られた係数(ウェーブレット係数)自体を中間符号としてもよい。具体的には、予め決められた分解レベル数以上の成分に関しては、ウェーブレット係数自体を中間データとしてもよい。例えば、分解レベル数Nまでウェーブレット変換を行った場合、分解レベル数“N−T”以上N以下のウェーブレット係数をそのまま中間符号とし、分解レベル数“N−T”未満のウェーブレット係数についてはステップS1で説明したようにウェーブレット係数を量子化した結果を中間符号としてもよい。ウェーブレット係数をそのまま中間符号とする分解レベル数“N−T”〜“T”は、符号化後のデータに要求される画質や圧縮率に応じて予め決めておけばよい。また、LL成分についてはウェーブレット係数をそのまま中間符号とし、xx成分についてはウェーブレット係数をステップS1で説明したように量子化したデータを中間符号としてもよい。   In the above description, when intermediate data is generated (for example, in step S1), the result of quantizing the coefficient obtained by the wavelet transform is described as an example of an intermediate code. Coefficients (wavelet coefficients) obtained by the conversion may be used as intermediate codes. Specifically, the wavelet coefficient itself may be used as intermediate data for a component having a predetermined number of decomposition levels or more. For example, when the wavelet transform is performed up to the decomposition level number N, the wavelet coefficients having the decomposition level number “N−T” or more and N or less are used as intermediate codes, and the wavelet coefficients less than the decomposition level number “N−T” are processed in step S1. As described above, the result of quantizing the wavelet coefficients may be used as the intermediate code. The number of decomposition levels “N−T” to “T” using wavelet coefficients as intermediate codes as they are may be determined in advance according to the image quality and compression rate required for the encoded data. The wavelet coefficient may be used as an intermediate code for the LL component, and the data obtained by quantizing the wavelet coefficient as described in step S1 may be used as the intermediate code for the xx component.

既に説明した実施形態では、画像データが送信される各領域のうち画像データの符号化が完了している符号化完了領域がある場合に、符号化完了領域の符号化後の画像データの総量を全体目標符号量から減算する減算手段を備え、圧縮率算出手段が、減算手段による減算が行われ、画像データが送信される各領域のうち未だ画像データの符号化が行われていない領域がある場合に、減算手段による減算後の全体目標符号量を符号化が行われていない領域の符号化前の画像データの総量で除算することにより、圧縮率を算出し、領域別目標符号量算出手段は、符号化が行われていない領域の符号化前の画像データのデータ量に、圧縮率算出手段が算出したその圧縮率を乗算して、符号化が行われていない領域の画像データを符号化するときの目標符号量を算出する構成が開示されている。   In the embodiment described above, when there is an encoding completion area in which encoding of image data is completed among the areas where image data is transmitted, the total amount of image data after encoding in the encoding completion area is calculated. There are subtracting means for subtracting from the overall target code amount, and the compression rate calculating means performs subtraction by the subtracting means, and there are areas where image data is not yet encoded among the areas where image data is transmitted. In this case, the overall target code amount after subtraction by the subtracting unit is divided by the total amount of image data before encoding in a region where encoding is not performed, thereby calculating a compression rate, and target code amount calculating unit for each region Is obtained by multiplying the amount of image data before encoding in an unencoded area by the compression rate calculated by the compression rate calculating means to encode the image data in the unencoded area. Eyes when turning Configured to calculate the amount of codes is disclosed.

また、上記の実施形態には、領域別目標符号量算出手段が、画像データの符号化が行われていない領域であって、符号化前の画像データのデータ量が所定の閾値以下である領域に対して、目標符号量を、目標符号量のとり得る最大値と定める構成が開示されている。   In the above embodiment, the target code amount calculation unit for each region is a region where the image data is not encoded, and the data amount of the image data before encoding is a predetermined threshold value or less. On the other hand, a configuration is disclosed in which the target code amount is defined as the maximum value that the target code amount can take.

また、上記の実施形態には、画像データが送信される各領域毎に、領域別目標符号量算出手段が定めた目標符号量以下の符号量に画像データを符号化する領域符号化手段を備える構成が開示されている。   Further, the above embodiment includes a region encoding unit that encodes image data to a code amount equal to or less than the target code amount determined by the region-specific target code amount calculation unit for each region to which the image data is transmitted. A configuration is disclosed.

また、上記の実施形態には、1フレーム内の更新された領域を含む矩形領域を、画像データが送信される領域として特定する領域特定手段を備える構成が開示されている。   Further, the above embodiment discloses a configuration including an area specifying unit that specifies a rectangular area including an updated area in one frame as an area to which image data is transmitted.

本発明は、例えば、符号化後のデータ量が目標符号量以下となるように画像データを符号化する符号化処理において利用される目標符号量を算出する目標符号量算出装置に好適に適用される。   The present invention is suitably applied to, for example, a target code amount calculation apparatus that calculates a target code amount used in an encoding process for encoding image data so that the encoded data amount is equal to or less than the target code amount. The

画像データが符号化され送信される領域の例を示す模式図である。It is a schematic diagram which shows the example of the area | region where image data is encoded and transmitted. 本発明の目標符号量算出装置の第1の実施形態を示すブロック図である。It is a block diagram which shows 1st Embodiment of the target code amount calculation apparatus of this invention. 本発明の目標符号量算出装置の処理経過の一例を示すフローチャートである。It is a flowchart which shows an example of the process progress of the target code amount calculation apparatus of this invention. 画像データが符号化され送信される領域の例を示す模式図である。It is a schematic diagram which shows the example of the area | region where image data is encoded and transmitted. 本発明の目標符号量算出装置の第2の実施形態を示すブロック図である。It is a block diagram which shows 2nd Embodiment of the target code amount calculation apparatus of this invention. 目標符号量再計算処理の例を示すフローチャートである。It is a flowchart which shows the example of a target code amount recalculation process. 領域特定部を備える場合の構成例を示すブロック図である。It is a block diagram which shows the structural example in the case of providing an area | region specific part. 1フレーム内において画像が送信される領域の例を示す説明図である。It is explanatory drawing which shows the example of the area | region where an image is transmitted within 1 frame. 更新行の先頭および末尾の例を示す説明図である。It is explanatory drawing which shows the example of the head and the end of an update line. 更新列の左端および右端の例を示す説明図である。It is explanatory drawing which shows the example of the left end of an update column, and a right end. 更新行の先頭および末尾と更新列の左端および右端とに囲まれた範囲の例を示す説明図である。It is explanatory drawing which shows the example of the range enclosed by the head and tail of an update line, and the left end and right end of an update column. 領域符号化部を備える場合の構成例を示すブロック図である。It is a block diagram which shows the structural example in the case of providing an area | region encoding part. 領域符号化部の例を示すブロック図である。It is a block diagram which shows the example of an area | region encoding part. ウェーブレット変換を模式的に示す説明図である。It is explanatory drawing which shows a wavelet transformation typically. ウェーブレット係数から生成した中間符号を模式的に示す説明図である。It is explanatory drawing which shows typically the intermediate code produced | generated from the wavelet coefficient. 頻度表の例を示す説明図である。It is explanatory drawing which shows the example of a frequency table. ハフマンテーブルの例を示す説明図である。It is explanatory drawing which shows the example of a Huffman table. ハフマン符号化の結果の例を模式的に示す説明図である。It is explanatory drawing which shows the example of the result of a Huffman encoding typically. 領域符号化部の処理経過の一例を示すフローチャートである。It is a flowchart which shows an example of the process progress of an area | region encoding part. 領域符号化部の処理経過の一例を示すフローチャートである。It is a flowchart which shows an example of the process progress of an area | region encoding part. 頻度表導出を模式的に示す説明図である。It is explanatory drawing which shows frequency table derivation typically. 中間符号の値と再量子化後に導出した符号との対応付けを示す説明図である。It is explanatory drawing which shows matching with the code | cord | chord derived after the value of the intermediate code and requantization.

符号の説明Explanation of symbols

1 目標符号量算出装置
2 全体目標符号量算出部
3 圧縮率算出部
4 領域別目標符号量算出部
5 減算部
6 領域特定部
7 領域符号化部
DESCRIPTION OF SYMBOLS 1 Target code amount calculation apparatus 2 Overall target code amount calculation part 3 Compression rate calculation part 4 Target code amount calculation part according to area | region 5 Subtraction part 6 Area | region specific | specification part 7 Area | region encoding part

Claims (9)

1フレーム内の領域であって通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を算出する目標符号量算出装置であって、
前記通信ネットワークの通信帯域を、予め定められたフレームレートで除算することにより、画像データが送信される各領域全体に対する目標符号量である全体目標符号量を算出する全体目標符号量算出手段と、
前記全体目標符号量を、画像データが送信される前記各領域の符号化前の画像データの総データ量で除算することにより、画像データを符号化するときの圧縮率を算出する圧縮率算出手段と、
画像データが送信される個々の領域毎に、当該領域の符号化前の画像データのデータ量に、前記圧縮率算出手段が算出した圧縮率を乗算して、当該領域の画像データを符号化するときの目標符号量を算出する領域別目標符号量算出手段とを備える
ことを特徴とする目標符号量算出装置。
A target code amount calculation device for calculating a target code amount when encoding image data in an area within one frame and where image data is transmitted via a communication network,
An overall target code amount calculating means for calculating an overall target code amount, which is a target code amount for the entire region in which image data is transmitted, by dividing the communication band of the communication network by a predetermined frame rate;
Compression rate calculation means for calculating a compression rate when encoding image data by dividing the overall target code amount by the total data amount of image data before encoding of each region in which the image data is transmitted When,
For each area where image data is transmitted, the image data of the area is encoded by multiplying the data amount of the image data before encoding of the area by the compression ratio calculated by the compression ratio calculation means. And a target code amount calculation unit for each region that calculates a target code amount at that time.
画像データが送信される各領域のうち画像データの符号化が完了している符号化完了領域がある場合に、符号化完了領域の符号化後の画像データの総量を全体目標符号量から減算する減算手段を備え、
前記圧縮率算出手段は、前記減算手段による減算が行われ、画像データが送信される各領域のうち未だ画像データの符号化が行われていない領域がある場合に、前記減算手段による減算後の全体目標符号量を符号化が行われていない領域の符号化前の画像データの総量で除算することにより、圧縮率を算出し、
前記領域別目標符号量算出手段は、符号化が行われていない領域の符号化前の画像データのデータ量に、前記圧縮率算出手段が算出した前記圧縮率を乗算して、符号化が行われていない領域の画像データを符号化するときの目標符号量を算出する
請求項1に記載の目標符号量算出装置。
When there is an encoding completion area in which encoding of image data has been completed in each area to which image data is transmitted, the total amount of image data after encoding in the encoding completion area is subtracted from the overall target code quantity. With subtraction means,
The compression rate calculation means performs subtraction by the subtraction means, and when there is an area in which image data is not yet encoded among the areas to which image data is transmitted, By dividing the overall target code amount by the total amount of image data before encoding in a region that has not been encoded, the compression rate is calculated,
The target code amount calculation unit for each region performs encoding by multiplying the data amount of image data before encoding in an unencoded region by the compression rate calculated by the compression rate calculation unit. The target code amount calculation device according to claim 1, wherein a target code amount is calculated when encoding image data of an undisclosed area.
前記領域別目標符号量算出手段は、
画像データの符号化が行われていない領域であって、符号化前の画像データのデータ量が所定の閾値以下である領域に対して、目標符号量を、目標符号量のとり得る最大値と定める
請求項1または請求項2に記載の目標符号量算出装置。
The region-specific target code amount calculating means includes:
For a region in which image data is not encoded and the amount of image data before encoding is equal to or less than a predetermined threshold, the target code amount is set to the maximum value that the target code amount can take. The target code amount calculation apparatus according to claim 1 or 2.
画像データが送信される各領域毎に、前記領域別目標符号量算出手段が定めた目標符号量以下の符号量に画像データを符号化する領域符号化手段を備える
請求項1から請求項3のうちのいずれか1項に記載の目標符号量算出装置。
The region coding means for coding the image data to a code amount equal to or less than the target code amount determined by the region-specific target code amount calculation means for each region in which the image data is transmitted. The target code amount calculation apparatus according to any one of the above.
1フレーム内の更新された領域を含む矩形領域を、画像データが送信される領域として特定する領域特定手段を備える
請求項1から請求項4のうちのいずれか1項に記載の目標符号量算出装置。
The target code amount calculation according to any one of claims 1 to 4, further comprising region specifying means for specifying a rectangular region including an updated region in one frame as a region to which image data is transmitted. apparatus.
1フレーム内の領域であって通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を算出する目標符号量算出方法であって、
前記通信ネットワークの通信帯域を、予め定められたフレームレートで除算することにより、画像データが送信される各領域全体に対する目標符号量である全体目標符号量を算出し、
前記全体目標符号量を、画像データが送信される前記各領域の符号化前の画像データの総データ量で除算することにより、画像データを符号化するときの圧縮率を算出し、
画像データが送信される個々の領域毎に、当該領域の符号化前の画像データのデータ量に、算出した圧縮率を乗算して、当該領域の画像データを符号化するときの目標符号量を算出する
ことを特徴とする目標符号量算出方法。
A target code amount calculation method for calculating a target code amount when encoding image data in an area within one frame and where image data is transmitted via a communication network,
By dividing the communication bandwidth of the communication network by a predetermined frame rate, a total target code amount that is a target code amount for the entire region where image data is transmitted is calculated,
By dividing the overall target code amount by the total data amount of the image data before encoding of each region in which the image data is transmitted, a compression rate when encoding the image data is calculated,
For each region where image data is transmitted, the target code amount when encoding the image data of the region is calculated by multiplying the data amount of the image data before encoding of the region by the calculated compression rate. A target code amount calculation method, characterized by: calculating.
画像データが送信される各領域のうち画像データの符号化が完了している符号化完了領域がある場合に、符号化完了領域の符号化後の画像データの総量を全体目標符号量から減算し、
前記減算後、画像データが送信される各領域のうち未だ画像データの符号化が行われていない領域がある場合に、前記減算後の全体目標符号量を符号化が行われていない領域の符号化前の画像データの総量で除算することにより、圧縮率を算出し、
符号化が行われていない領域の符号化前の画像データのデータ量に、算出した前記圧縮率を乗算して、符号化が行われていない領域の画像データを符号化するときの目標符号量を算出する
請求項6に記載の目標符号量算出方法。
When there is an encoding completion area in which encoding of image data has been completed in each area to which image data is transmitted, the total amount of image data after encoding in the encoding completion area is subtracted from the overall target code quantity. ,
After the subtraction, if there is a region where the image data is not yet encoded among the regions where the image data is transmitted, the code of the region where the overall target code amount after the subtraction is not encoded Calculate the compression rate by dividing by the total amount of image data before conversion,
The target code amount when encoding the image data in the non-encoded area by multiplying the data amount of the image data before encoding in the non-encoded area by the calculated compression rate The target code amount calculation method according to claim 6.
1フレーム内の領域であって通信ネットワークを介して画像データが送信される領域の画像データを符号化するときの目標符号量を算出するコンピュータに搭載される目標符号量算出プログラムであって、
前記コンピュータに、
前記通信ネットワークの通信帯域を、予め定められたフレームレートで除算することにより、画像データが送信される各領域全体に対する目標符号量である全体目標符号量を算出する全体目標符号量算出処理、
前記全体目標符号量を、画像データが送信される前記各領域の符号化前の画像データの総データ量で除算することにより、画像データを符号化するときの圧縮率を算出する圧縮率算出処理、および、
画像データが送信される個々の領域毎に、当該領域の符号化前の画像データのデータ量に、前記圧縮率算出処理で算出した圧縮率を乗算して、当該領域の画像データを符号化するときの目標符号量を算出する領域別目標符号量算出処理
を実行させるための目標符号量算出プログラム。
A target code amount calculation program installed in a computer for calculating a target code amount when encoding image data in an area within one frame and where image data is transmitted via a communication network,
In the computer,
An overall target code amount calculation process for calculating an overall target code amount, which is a target code amount for the entire region in which image data is transmitted, by dividing the communication band of the communication network by a predetermined frame rate;
A compression rate calculation process for calculating a compression rate when encoding image data by dividing the overall target code amount by the total data amount of image data before encoding of each region in which the image data is transmitted ,and,
For each area where image data is transmitted, the image data of the area is encoded by multiplying the data amount of the image data before encoding of the area by the compression ratio calculated in the compression ratio calculation process. A target code amount calculation program for executing a region-specific target code amount calculation process for calculating a target code amount at the time.
前記コンピュータに、
画像データが送信される各領域のうち画像データの符号化が完了している符号化完了領域がある場合に、符号化完了領域の符号化後の画像データの総量を全体目標符号量から減算する減算処理、
前記減算処理の後、画像データが送信される各領域のうち未だ画像データの符号化が行われていない領域がある場合に、前記減算処理後の全体目標符号量を符号化が行われていない領域の符号化前の画像データの総量で除算することにより、圧縮率を算出する圧縮率再計算処理、および
符号化が行われていない領域の符号化前の画像データのデータ量に、前記圧縮率再計算処理で算出した前記圧縮率を乗算して、符号化が行われていない領域の画像データを符号化するときの目標符号量を算出する領域別目標符号量再計算処理
を実行させる請求項8に記載の目標符号量算出プログラム。
In the computer,
When there is an encoding completion area in which encoding of image data has been completed in each area to which image data is transmitted, the total amount of image data after encoding in the encoding completion area is subtracted from the overall target code quantity. Subtraction processing,
After the subtraction process, when there is an area where the image data is not yet encoded among the areas where the image data is transmitted, the overall target code amount after the subtraction process is not encoded. By dividing by the total amount of image data before encoding the region, the compression rate is recalculated to calculate the compression rate, and the data amount of the image data before encoding in the region that has not been encoded is A region-specific target code amount recalculation process for calculating a target code amount for encoding image data in a region that has not been encoded by multiplying the compression rate calculated in the rate recalculation processing. Item 9. The target code amount calculation program according to Item 8.
JP2008020992A 2008-01-31 2008-01-31 Target code amount calculation device, target code amount calculation method, and target code amount calculation program Active JP5157490B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008020992A JP5157490B2 (en) 2008-01-31 2008-01-31 Target code amount calculation device, target code amount calculation method, and target code amount calculation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008020992A JP5157490B2 (en) 2008-01-31 2008-01-31 Target code amount calculation device, target code amount calculation method, and target code amount calculation program

Publications (2)

Publication Number Publication Date
JP2009182810A true JP2009182810A (en) 2009-08-13
JP5157490B2 JP5157490B2 (en) 2013-03-06

Family

ID=41036402

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008020992A Active JP5157490B2 (en) 2008-01-31 2008-01-31 Target code amount calculation device, target code amount calculation method, and target code amount calculation program

Country Status (1)

Country Link
JP (1) JP5157490B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8638243B2 (en) 2010-03-03 2014-01-28 Mitsubishi Electric Corporation Data compression device, data compression method, and medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002199397A (en) * 2000-12-26 2002-07-12 Nec Corp Moving image encoding system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002199397A (en) * 2000-12-26 2002-07-12 Nec Corp Moving image encoding system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8638243B2 (en) 2010-03-03 2014-01-28 Mitsubishi Electric Corporation Data compression device, data compression method, and medium

Also Published As

Publication number Publication date
JP5157490B2 (en) 2013-03-06

Similar Documents

Publication Publication Date Title
JP5461419B2 (en) Pixel predicted value generation procedure automatic generation method, image encoding method, image decoding method, apparatus thereof, program thereof, and recording medium on which these programs are recorded
CN107481295B (en) Image compression system of convolutional neural network based on dynamic byte length distribution
US8351693B2 (en) Image compression apparatus and computer-readable recording medium recorded with image compression program
CN104639946A (en) Apparatus and method for processing image
JPWO2009075245A1 (en) Image quality evaluation system, apparatus, method and program used therefor
JP2911682B2 (en) Motion compensation using the minimum number of bits per motion block as a criterion for block matching
CN107666472B (en) Method and apparatus for hybrid digital-analog coding
JP2020102704A (en) Image encoding device, control method of the same, and program
JP5157490B2 (en) Target code amount calculation device, target code amount calculation method, and target code amount calculation program
JP2009044483A (en) Image-encoding apparatus
CN107205151B (en) Coding and decoding device and method based on mixed distortion measurement criterion
EP2273776A1 (en) Image data compression apparatus, decompression apparatus, compression method, decompression method, and program
CN113422957B (en) Quantization method, apparatus, device and storage medium in video coding
JPH1198512A (en) Image coder and image coding method
JP4911053B2 (en) Image data quantization apparatus, image data quantization method, and image data quantization program
JP2013223206A (en) Image encoding device and image decoding device and program
JP4911052B2 (en) Image processing apparatus, image processing method, and image processing program
JP2014143655A (en) Image encoder, image decoder and program
JP2003209842A (en) Method for two-dimensional orthogonal transform and quantization, and apparatus and program thereof
JP2013187692A (en) Image processing device and image processing method
JP2011109385A (en) Image encoder
JP2939869B2 (en) Image encoding device and image decoding device
US11670008B2 (en) Processing display data for transmission
JPH09200778A (en) Method and device for encoding video signal
CN115100031B (en) Image processing method and image processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111208

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120117

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120314

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121113

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121126

R150 Certificate of patent or registration of utility model

Ref document number: 5157490

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151221

Year of fee payment: 3