JP5848993B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP5848993B2
JP5848993B2 JP2012049556A JP2012049556A JP5848993B2 JP 5848993 B2 JP5848993 B2 JP 5848993B2 JP 2012049556 A JP2012049556 A JP 2012049556A JP 2012049556 A JP2012049556 A JP 2012049556A JP 5848993 B2 JP5848993 B2 JP 5848993B2
Authority
JP
Japan
Prior art keywords
image
code amount
lower limit
macroblocks
macroblock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012049556A
Other languages
Japanese (ja)
Other versions
JP2013187634A (en
Inventor
敏充 達可
敏充 達可
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
MegaChips Corp
Original Assignee
MegaChips 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 MegaChips Corp filed Critical MegaChips Corp
Priority to JP2012049556A priority Critical patent/JP5848993B2/en
Publication of JP2013187634A publication Critical patent/JP2013187634A/en
Application granted granted Critical
Publication of JP5848993B2 publication Critical patent/JP5848993B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置に関し、特に、画像圧縮における符号量制御アルゴリズムに関する。   The present invention relates to an image processing apparatus, and more particularly to a code amount control algorithm in image compression.

下記特許文献1には、背景技術に係る画像処理装置が開示されている。当該画像処理装置では、直前に処理したY個(例えば1120個)のマクロブロックに関する発生符号量と、1フレーム未満のX個(例えば1200個)のマクロブロックあたりの目標符号量とに基づいて、直後に処理するN個(例えば80個)のマクロブロックに関して使用可能な許容符号量が求められる。また、直後に処理するN個のマクロブロックに関して使用が予想される予想符号量が求められる。そして、許容符号量と予想符号量とに基づいて、処理対象のマクロブロックに関する量子化パラメータが設定される。   Patent Document 1 below discloses an image processing apparatus according to the background art. In the image processing apparatus, based on the generated code amount related to Y (for example, 1120) macroblocks processed immediately before and the target code amount per X (for example, 1200) macroblocks less than one frame, An allowable code amount that can be used for N (for example, 80) macroblocks to be processed immediately after is obtained. Also, an expected code amount that is expected to be used for N macroblocks to be processed immediately after is obtained. Then, based on the allowable code amount and the expected code amount, a quantization parameter related to the processing target macroblock is set.

特開2011−217112号公報JP 2011-217112 A

しかし、上記特許文献1に開示された画像処理装置によると、処理する画像が静止画から動画に切り替わった直後に、画質の劣化が生じる場合がある。以下、具体的に説明する。   However, according to the image processing apparatus disclosed in Patent Document 1, image quality may be deteriorated immediately after an image to be processed is switched from a still image to a moving image. This will be specifically described below.

図9は、処理する画像が静止画から動画に切り替わった前後のフレームを示す図である。処理する画像が静止画の場合には発生符号量がゼロ又はそれに近いため、静止画の最終フレームの下端領域R1に関する発生符号量はゼロ又は非常に小さくなっている。従って、静止画から動画に切り替わった時点において、許容符号量は最大値又は非常に大きくなっている。そのため、動画の先頭フレームの上端領域R2に関しては量子化パラメータが過度に小さく設定され、それに伴って、領域R2における発生符号量は急激に大きくなる。その結果、領域R2に続く領域R3に関しては許容符号量が急激に小さくなるため、量子化パラメータが過度に大きく設定される。このように、量子化パラメータが過度に小さく設定される領域R2と過度に大きく設定される領域R3とが繰り返されることにより、量子化パラメータが一定レベルに安定するまで画質の劣化が生じる。   FIG. 9 is a diagram illustrating frames before and after the image to be processed is switched from a still image to a moving image. When the image to be processed is a still image, the generated code amount is zero or close to it, and therefore the generated code amount related to the lower end region R1 of the final frame of the still image is zero or very small. Therefore, the allowable code amount is the maximum value or very large at the time of switching from the still image to the moving image. Therefore, the quantization parameter is set to be excessively small for the upper end region R2 of the first frame of the moving image, and accordingly, the generated code amount in the region R2 increases rapidly. As a result, for the region R3 that follows the region R2, the allowable code amount decreases rapidly, so that the quantization parameter is set excessively large. As described above, the region R2 in which the quantization parameter is set to be excessively small and the region R3 in which the quantization parameter is set to be excessively large are repeated, so that the image quality is deteriorated until the quantization parameter is stabilized at a certain level.

本発明はかかる問題を解決するために成されたものであり、処理する画像が静止画から動画に切り替わった直後における画質の劣化を回避することが可能な画像処理装置を得ることを目的とする。   The present invention has been made to solve such a problem, and an object thereof is to provide an image processing apparatus capable of avoiding deterioration in image quality immediately after an image to be processed is switched from a still image to a moving image. .

本発明の第1の態様に係る画像処理装置は、画像信号に対する量子化処理を含むエンコード処理を実行するエンコーダと、前記量子化処理における量子化パラメータを制御する制御部と、を備え、前記制御部は、直前の第1の所定数のマクロブロックに関して使用した発生符号量を求める第1の処理部と、1フレーム内に含まれるマクロブロックの総数未満の第2の所定数以下のマクロブロックあたりの目標符号量と、前記第1の処理部によって求められた前記発生符号量とに基づいて、現在の処理対象のマクロブロックを含む直後の第3の所定数のマクロブロックに関して使用可能な許容符号量を求める第2の処理部と、前記第3の所定数のマクロブロックに関して使用が予想される予想符号量を求める第3の処理部と、前記第2の処理部によって求められた前記許容符号量と、前記第3の処理部によって求められた前記予想符号量とに基づいて、現在の処理対象のマクロブロックに関する量子化パラメータを設定する第4の処理部と、を有し、前記第1の処理部は、前記第1の所定数のマクロブロックに関して、各マクロブロックの発生符号量が、予め設定された下限値以下である場合は、当該マクロブロックの発生符号量を当該下限値とすることを特徴とするものである。   An image processing apparatus according to a first aspect of the present invention includes: an encoder that performs an encoding process including a quantization process for an image signal; and a control unit that controls a quantization parameter in the quantization process. A first processing unit that obtains a generated code amount used for the immediately preceding first predetermined number of macroblocks, and a second predetermined number or less of macroblocks less than the total number of macroblocks included in one frame Based on the target code amount and the generated code amount obtained by the first processing unit, the allowable code that can be used for the third predetermined number of macroblocks immediately after including the current macroblock to be processed A second processing unit for determining the amount; a third processing unit for determining an expected code amount expected to be used for the third predetermined number of macroblocks; and the second processing unit. Therefore, a fourth processing unit that sets a quantization parameter related to the current macroblock to be processed, based on the allowable code amount obtained by the third processing unit and the expected code amount obtained by the third processing unit; And when the generated code amount of each macroblock is less than or equal to a preset lower limit for the first predetermined number of macroblocks, the first processing unit generates the generated code of the macroblock The amount is set as the lower limit value.

第1の態様に係る画像処理装置によれば、第1の処理部は、第1の所定数のマクロブロックに関して、各マクロブロックの発生符号量が、予め設定された下限値以下である場合は、当該マクロブロックの発生符号量を当該下限値とする。そのため、処理する画像が静止画であることにより実際の発生符号量がゼロ又はそれに近い場合であっても、第1の処理部はある程度の符号量が発生したものとみなす。従って、処理する画像が静止画から動画に切り替わった時点において許容符号量は過度に大きくはなっていないため、第4の処理部によって量子化パラメータが過度に小さく設定されることはない。その結果、処理する画像が静止画から動画に切り替わった直後において、量子化パラメータが過度に小さく設定される領域と過度に大きく設定される領域とが繰り返されるという事態は発生しないため、画質の劣化を回避することが可能となる。   According to the image processing apparatus according to the first aspect, the first processing unit, when the generated code amount of each macroblock is less than or equal to a preset lower limit value with respect to the first predetermined number of macroblocks The generated code amount of the macroblock is set as the lower limit value. For this reason, even if the actual generated code amount is zero or close to it because the image to be processed is a still image, the first processing unit regards that a certain amount of code has occurred. Accordingly, since the allowable code amount is not excessively large when the image to be processed is switched from the still image to the moving image, the quantization parameter is not set excessively small by the fourth processing unit. As a result, immediately after the image to be processed is switched from a still image to a moving image, an area where the quantization parameter is set too small and an area where the quantization parameter is set too large do not occur. Can be avoided.

本発明の第2の態様に係る画像処理装置は、第1の態様に係る画像処理装置において特に、処理する画像が静止画である場合に設定される前記下限値は、処理する画像が動画である場合に設定される前記下限値と同一であることを特徴とするものである。   The image processing apparatus according to the second aspect of the present invention is the image processing apparatus according to the first aspect, in particular, the lower limit value set when the image to be processed is a still image, and the image to be processed is a moving image. It is the same as the lower limit value set in some cases.

第2の態様に係る画像処理装置によれば、処理する画像が静止画である場合と動画である場合とで、同一の下限値が設定される。従って、画像に応じて下限値を変動させる必要がないため、構成及び処理の簡略化を図ることが可能となる。   According to the image processing apparatus according to the second aspect, the same lower limit value is set when the image to be processed is a still image and when it is a moving image. Therefore, since it is not necessary to change the lower limit value according to the image, it is possible to simplify the configuration and processing.

本発明の第3の態様に係る画像処理装置は、第2の態様に係る画像処理装置において特に、前記下限値は、1マクロブロックあたりの目標符号量の20%以上25%以下の範囲内に設定されることを特徴とするものである。   In the image processing device according to the third aspect of the present invention, in particular, in the image processing device according to the second aspect, the lower limit value is in the range of 20% to 25% of the target code amount per macroblock. It is characterized by being set.

第3の態様に係る画像処理装置によれば、下限値は、1マクロブロックあたりの目標符号量の20%以上25%以下の範囲内に設定される。下限値をこの範囲内に設定することにより、動画の先頭フレームの上端領域と、それに続く領域との双方において、画質の劣化を効果的に回避することが可能となる。   According to the image processing apparatus according to the third aspect, the lower limit value is set in a range of 20% to 25% of the target code amount per macroblock. By setting the lower limit value within this range, it is possible to effectively avoid degradation of image quality in both the upper end area of the first frame of the moving image and the subsequent area.

本発明の第4の態様に係る画像処理装置は、第1の態様に係る画像処理装置において特に、前記下限値は、処理する画像が静止画である場合と動画である場合とで異なる値に設定され、処理する画像が静止画である場合に設定される前記下限値は、処理する画像が動画である場合に設定される前記下限値よりも大きいことを特徴とするものである。   In the image processing device according to the fourth aspect of the present invention, in particular, in the image processing device according to the first aspect, the lower limit value is different depending on whether the image to be processed is a still image or a moving image. The lower limit set when the image to be processed is a still image is larger than the lower limit set when the image to be processed is a moving image.

第4の態様に係る画像処理装置によれば、処理する画像が静止画である場合に設定される下限値は、処理する画像が動画である場合に設定される下限値よりも大きい。従って、処理する画像が静止画である場合には、下限値をある程度大きい値に設定することにより、処理する画像が静止画から動画に切り替わった直後における画質の劣化を効果的に回避することが可能となる。また、処理する画像が静止画から動画に切り替わった後に動画を処理する場合には、下限値を小さい値(ゼロでもよい)に設定することにより、下限値による影響を受けることなく動画を通常に処理することができ、その結果、下限値を設定することに伴う動画像の画質の劣化を回避することが可能となる。   According to the image processing device of the fourth aspect, the lower limit value set when the image to be processed is a still image is larger than the lower limit value set when the image to be processed is a moving image. Therefore, when the image to be processed is a still image, setting the lower limit value to a certain large value can effectively avoid the deterioration of image quality immediately after the image to be processed is switched from the still image to the moving image. It becomes possible. Also, when processing a movie after the image to be processed has been switched from a still image to a movie, set the lower limit value to a small value (may be zero) so that the movie can be made normal without being affected by the lower limit value. As a result, it is possible to avoid the deterioration of the image quality of the moving image due to the setting of the lower limit value.

本発明によれば、処理する画像が静止画から動画に切り替わった直後における画質の劣化を回避することが可能な画像処理装置を得ることができる。   ADVANTAGE OF THE INVENTION According to this invention, the image processing apparatus which can avoid degradation of the image quality immediately after the image to process switches from a still image to a moving image can be obtained.

マクロブロック単位でのエンコード処理の一例を示す図である。It is a figure which shows an example of the encoding process per macroblock. 本発明の実施の形態に係る画像処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing apparatus which concerns on embodiment of this invention. 図2に示した制御部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the control part shown in FIG. 図3に示した第3処理部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the 3rd process part shown in FIG. パラメータセットの例を示す図である。It is a figure which shows the example of a parameter set. 属性値の決定手法の一例を示すフローチャートである。It is a flowchart which shows an example of the determination method of an attribute value. パラメータセットの選択手法の一例を示す図である。It is a figure which shows an example of the selection method of a parameter set. 変形例に係る画像処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing apparatus which concerns on a modification. 処理する画像が静止画から動画に切り替わった前後のフレームを示す図である。It is a figure which shows the frame before and after the image to process switches from a still image to a moving image.

以下、本発明の実施の形態について、図面を用いて詳細に説明する。なお、異なる図面において同一の符号を付した要素は、同一又は相応する要素を示すものとする。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In addition, the element which attached | subjected the same code | symbol in different drawing shall show the same or corresponding element.

図1は、マクロブロック単位でのエンコード処理の一例を示す図である。図1には、行方向(横方向)に1280画素、列方向(縦方向)に720画素を有する1フレームの画像を例示している。1フレームは、行方向に16画素ごと、列方向に16画素ごとにマクロブロックとして分割される。従って、1フレームは、行方向に80個、列方向に45個のマクロブロックに分割される。なお、1行分に相当する80個のマクロブロックの集合は、マクロブロックラインと称される。   FIG. 1 is a diagram illustrating an example of an encoding process in units of macroblocks. FIG. 1 illustrates an image of one frame having 1280 pixels in the row direction (horizontal direction) and 720 pixels in the column direction (vertical direction). One frame is divided into macroblocks every 16 pixels in the row direction and every 16 pixels in the column direction. Therefore, one frame is divided into 80 macroblocks in the row direction and 45 macroblocks in the column direction. A set of 80 macroblocks corresponding to one row is called a macroblock line.

図2は、本発明の実施の形態に係る画像処理装置1の構成を示すブロック図である。図2に示すように、画像処理装置1は、画像生成部4、エンコーダ2、及び制御部3を備えて構成されている。画像生成部4は、画像を生成し、その画像信号S1をエンコーダ2に入力する。エンコーダ2は、MPEG−2、MPEG−4、又はH.264等の動画像に関する規格に準拠しており、圧縮符号化前の画像信号S1に対して量子化処理及び符号化処理等の画像処理を施すことにより、圧縮符号化後の画像信号S4を出力する。画像信号S4は、画像処理装置1から無線LAN等によって表示装置(図示しない)に伝送され、表示装置において画像(静止画及び動画を含む)が表示される。   FIG. 2 is a block diagram showing a configuration of the image processing apparatus 1 according to the embodiment of the present invention. As shown in FIG. 2, the image processing apparatus 1 includes an image generation unit 4, an encoder 2, and a control unit 3. The image generation unit 4 generates an image and inputs the image signal S 1 to the encoder 2. The encoder 2 can be MPEG-2, MPEG-4, or H.264. The image signal S4 after compression encoding is output by performing image processing such as quantization processing and encoding processing on the image signal S1 before compression encoding. To do. The image signal S4 is transmitted from the image processing apparatus 1 to a display device (not shown) via a wireless LAN or the like, and an image (including a still image and a moving image) is displayed on the display device.

制御部3には、画像信号S1,S4が入力されるとともに、1マクロブロックあたりの最大許容符号量を示す信号S2Aと、1マクロブロックあたりの目標符号量を示す信号S2Bとが入力される。ここで、1マクロブロックあたりの最大許容符号量は、画像処理装置1から表示装置への最大ビットレート(例えば9Mbps)と、画像のフレームレート(例えば60fps)と、1フレーム内のマクロブロックの総数(例えば3600個)とに基づいて算出される。同様に、1マクロブロックあたりの目標符号量は、画像処理装置1から表示装置への目標ビットレート(例えば8.1Mbps)と、画像のフレームレートと、1フレーム内のマクロブロックの総数とに基づいて算出される。制御部3は、これらの信号S1,S2A,S2B,S4に基づいて、エンコーダ2内での量子化処理における量子化パラメータを、制御信号S3によって制御する。本実施の形態に係る画像処理装置1においては、許容伝送遅延に相当するX個のマクロブロック(例えば15マクロブロックラインに含まれる1200個のマクロブロック)に関する発生符号量が、X個のマクロブロックに関する最大許容符号量(例えば、9000000/60/3=50000ビット)を超えないように、量子化パラメータを制御する。   The control unit 3 receives the image signals S1 and S4 and also receives a signal S2A indicating the maximum allowable code amount per macroblock and a signal S2B indicating the target code amount per macroblock. Here, the maximum allowable code amount per macroblock is the maximum bit rate (for example, 9 Mbps) from the image processing apparatus 1 to the display apparatus, the frame rate of the image (for example, 60 fps), and the total number of macroblocks in one frame. (For example, 3600). Similarly, the target code amount per macroblock is based on the target bit rate (for example, 8.1 Mbps) from the image processing apparatus 1 to the display apparatus, the frame rate of the image, and the total number of macroblocks in one frame. Is calculated. Based on these signals S1, S2A, S2B, and S4, the control unit 3 controls the quantization parameter in the quantization process in the encoder 2 with the control signal S3. In the image processing apparatus 1 according to the present embodiment, the generated code amount for X macroblocks corresponding to the allowable transmission delay (for example, 1200 macroblocks included in the 15 macroblock lines) is X macroblocks. The quantization parameter is controlled so as not to exceed the maximum allowable code amount (for example, 9000000/60/3 = 50000 bits).

図3は、図2に示した制御部3の構成例を示すブロック図である。図3の接続関係で示すように、制御部3は、第1処理部11、第2処理部12、第3処理部13、及び第4処理部14を備えて構成されている。   FIG. 3 is a block diagram illustrating a configuration example of the control unit 3 illustrated in FIG. 2. As shown by the connection relationship in FIG. 3, the control unit 3 includes a first processing unit 11, a second processing unit 12, a third processing unit 13, and a fourth processing unit 14.

第1処理部11は、画像信号S4に基づいて、直前に処理したY個のマクロブロックに関して使用した発生符号量を求める。具体的には、Y個のマクロブロックの各々に関する発生符号量をそれぞれ求め、それらを合計することにより、Y個のマクロブロックに関する発生符号量を算出する。算出したY個のマクロブロックに関する発生符号量は、信号S11として第1処理部11から第2処理部12に入力される。   The first processing unit 11 obtains the generated code amount used for the Y macroblocks processed immediately before based on the image signal S4. Specifically, the generated code amount for each of the Y macroblocks is obtained, and the generated code amounts for the Y macroblocks are calculated by summing them. The calculated generated code amount for Y macroblocks is input from the first processing unit 11 to the second processing unit 12 as a signal S11.

ここで、信号S5が第1処理部11に入力されることにより、1マクロブロックあたりの発生符号量に関する所定の下限値Mが予め設定されている。第1処理部11は、Y個のマクロブロックに関する発生符号量を算出するに際して、各マクロブロックの発生符号量が下限値M以下である場合は、当該マクロブロックの発生符号量を下限値Mとして扱う。下限値Mは、現在の処理対象の画像が静止画である場合と動画である場合とで共通の値に設定されている。   Here, when the signal S5 is input to the first processing unit 11, a predetermined lower limit M regarding the generated code amount per macroblock is set in advance. When the generated code amount for each of the macroblocks is equal to or lower than the lower limit value M when calculating the generated code amount for the Y macroblocks, the first processing unit 11 sets the generated code amount of the macroblock as the lower limit value M. deal with. The lower limit value M is set to a common value when the current processing target image is a still image and when it is a moving image.

図9を参照して、下限値Mは、動画の先頭フレームの上端領域R2と、それに続く領域R3(及びそれ以降の領域)との双方において、画質の劣化を効果的に回避し得る最適値に設定される。下限値Mが小さ過ぎると、領域R2に関する発生符号量が大きくなり、領域R3に関する発生符号量が小さくなるため、領域R3の画質が劣化する。下限値Mが大き過ぎると、領域R2に関する発生符号量が小さくなり、領域R3に関する発生符号量が大きくなるため、領域R2の画質が劣化する。また、下限値Mが大き過ぎると、領域R3以降において動画を通常に処理する際に、あるマクロブロックの実際の発生符号量が下限値M以下であっても、そのマクロブロックの発生符号量は下限値Mとして扱われるため、量子化パラメータが適正値よりも大きく設定されて画質が劣化する。   Referring to FIG. 9, lower limit value M is an optimum value that can effectively avoid deterioration in image quality in both the upper end region R2 of the first frame of the moving image and the subsequent region R3 (and subsequent regions). Set to If the lower limit value M is too small, the generated code amount related to the region R2 becomes large and the generated code amount related to the region R3 becomes small, so that the image quality of the region R3 deteriorates. If the lower limit M is too large, the amount of generated code related to the region R2 becomes small and the amount of generated code related to the region R3 increases, so that the image quality of the region R2 deteriorates. On the other hand, if the lower limit value M is too large, when a moving image is normally processed after the region R3, even if the actual generated code amount of a certain macroblock is less than or equal to the lower limit value M, the generated code amount of the macroblock is Since it is handled as the lower limit value M, the quantization parameter is set larger than the appropriate value, and the image quality deteriorates.

下限値Mの最適値は、実験又はシミュレーション等によって求めればよく、本実施の形態の例では、1マクロブロックあたりの目標符号量の20%以上25%以下の範囲内の任意の値に設定される。本実施の形態の例では、1マクロブロックあたりの目標符号量が約41.7ビット(=9000000/60/80/45)であるため、下限値Mは約8.3〜10.4ビットの範囲内で設定される。下限値が例えば10ビットに設定された場合において、第1処理部11は、直前Y個のマクロブロック内の特定のマクロブロックに関する発生符号量が10ビット以下であった場合には、そのマクロブロックにおいて10ビットの符号量が発生したものとして扱う。   The optimum value of the lower limit value M may be obtained by experiment or simulation, and in the example of the present embodiment, it is set to an arbitrary value within the range of 20% to 25% of the target code amount per macroblock. The In the example of the present embodiment, the target code amount per macroblock is about 41.7 bits (= 9000000/60/80/45), so the lower limit M is about 8.3 to 10.4 bits. Set within the range. In the case where the lower limit value is set to 10 bits, for example, the first processing unit 11 determines that the macro block when the generated code amount related to a specific macro block in the immediately preceding Y macro blocks is 10 bits or less. Are treated as if a 10-bit code amount has occurred.

第2処理部12は、信号S2A,S2Bに基づいて、X個のマクロブロックあたりの目標符号量を求める。また、第2処理部12は、求めた目標符号量と、第1処理部11から入力されたY個のマクロブロックに関する発生符号量とに基づいて、直後に処理するN個のマクロブロック(例えば、現在の処理対象のマクロブロックを先頭とする、1マクロブロックラインに含まれる80個のマクロブロック)に関して使用可能な許容符号量を求める。求めた許容符号量は、信号S12として第2処理部12から第4処理部14に入力される。   The second processing unit 12 obtains a target code amount per X macroblocks based on the signals S2A and S2B. Further, the second processing unit 12 performs N macroblocks (for example, immediately after processing) based on the calculated target code amount and the generated code amount related to the Y macroblocks input from the first processing unit 11 (for example, The allowable code amount that can be used with respect to the current macro block to be processed (80 macro blocks included in one macro block line) is obtained. The obtained allowable code amount is input from the second processing unit 12 to the fourth processing unit 14 as a signal S12.

ここで、第2処理部12は、既に発生符号量が求まっているマクロブロックの個数(Y個)が、許容伝送遅延に相当するマクロブロックの個数(X個)から、発生符号量の予想が可能なマクロブロックの個数(N個)を差し引いた値以上である場合(つまりY≧X−Nの関係を満たす場合)には、X個のマクロブロックに関する目標符号量から、直前のX−N個のマクロブロックに関して使用した発生符号量を差し引いた値を、直後に処理するN個のマクロブロックに関して使用可能な許容符号量とする。一方、既に発生符号量が求まっているマクロブロックの個数(Y個)が、許容伝送遅延に相当するマクロブロックの個数(X個)から、発生符号量の予想が可能なマクロブロックの個数(N個)を差し引いた値未満である場合(つまりY<X−Nの関係を満たす場合)には、Y+N個のマクロブロックに関する目標符号量から、直前のY個のマクロブロックに関して使用した発生符号量を差し引いた値を、直後に処理するN個のマクロブロックに関して使用可能な許容符号量とする。従って、Y≧X−Nの関係を満たす場合であっても、Y<X−Nの関係を満たす場合であっても、許容符号量を適切に求めることができる。   Here, the second processing unit 12 predicts the amount of generated code from the number of macroblocks (X) corresponding to the allowable transmission delay because the number of generated macroblocks (Y) is already determined. If the number is equal to or greater than the value obtained by subtracting the number of possible macroblocks (N) (that is, the relationship Y ≧ XN), the immediately preceding XN is calculated from the target code amount for X macroblocks. A value obtained by subtracting the generated code amount used for the macroblocks is set as an allowable code amount usable for the N macroblocks to be processed immediately after. On the other hand, the number of macroblocks whose generated code amount has already been determined (Y) is the number of macroblocks (N) from which the generated code amount can be predicted from the number of macroblocks (X) corresponding to the allowable transmission delay. Is less than the value obtained by subtracting (number of), that is, when the relationship of Y <XN is satisfied, the generated code amount used for the immediately preceding Y macroblocks from the target code amount for Y + N macroblocks. A value obtained by subtracting is used as an allowable code amount usable for N macroblocks to be processed immediately after. Therefore, even when the relationship of Y ≧ X−N is satisfied or when the relationship of Y <X−N is satisfied, the allowable code amount can be appropriately obtained.

第3処理部13は、画像信号S1に基づいて、直後N個のマクロブロックに関して使用が予想される予想符号量を求める(詳細は後述)。求めた予想符号量は、信号S13として第3処理部13から第4処理部14に入力される。   The third processing unit 13 obtains an expected code amount that is expected to be used for the immediately subsequent N macroblocks based on the image signal S1 (details will be described later). The obtained expected code amount is input from the third processing unit 13 to the fourth processing unit 14 as a signal S13.

第4処理部14は、第2処理部12から入力された許容符号量と、第3処理部13から入力された予想符号量とに基づいて、現在の処理対象のマクロブロックに関する量子化パラメータを設定する(詳細は後述)。設定した量子化パラメータは、信号S3として第4処理部14から図2に示したエンコーダ2に入力される。   Based on the allowable code amount input from the second processing unit 12 and the expected code amount input from the third processing unit 13, the fourth processing unit 14 determines the quantization parameter related to the current macroblock to be processed. Set (details will be described later). The set quantization parameter is input from the fourth processing unit 14 to the encoder 2 shown in FIG. 2 as the signal S3.

図4は、図3に示した第3処理部13の構成例を示すブロック図である。図4の接続関係で示すように、第3処理部13は、全体評価値演算部21、部分評価値演算部22、ソベルフィルタ処理部23、予想符号量演算部24、及び記憶部25を備えて構成されている。   FIG. 4 is a block diagram illustrating a configuration example of the third processing unit 13 illustrated in FIG. 3. As shown in the connection relationship of FIG. 4, the third processing unit 13 includes an overall evaluation value calculation unit 21, a partial evaluation value calculation unit 22, a Sobel filter processing unit 23, an expected code amount calculation unit 24, and a storage unit 25. Configured.

全体評価演算部21は、画像信号S1に基づいて、直後N個のマクロブロックの各々について、各マクロブロックの全体領域(縦16画素×横16画素)に関する活発性評価値act1を算出する。ここで、活発性評価値は、マクロブロック内における画素値のばらつきの度合いを示す指標であり、例えば、そのマクロブロックの輝度平均値と各画素の輝度値との差分絶対値和を、そのマクロブロック内の画素数で除算した値として得られる。このように活発性評価値act1を用いることにより、全体が滑らかである属性のマクロブロック(つまり画質の劣化が目立つマクロブロック)に関しては、小さい量子化パラメータ(つまり大きい符号量)を見積もることにより、適切な予想符号量を求めることができる。   Based on the image signal S1, the overall evaluation calculation unit 21 calculates an activity evaluation value act1 relating to the entire area of each macroblock (vertical 16 pixels × horizontal 16 pixels) for each of the immediately following N macroblocks. Here, the activity evaluation value is an index indicating the degree of variation of the pixel value in the macroblock. For example, the sum of absolute differences between the luminance average value of the macroblock and the luminance value of each pixel is calculated as the macroblock luminance value. Obtained as a value divided by the number of pixels in the block. By using the activity evaluation value act1 in this way, for a macroblock having an attribute that is smooth as a whole (that is, a macroblock in which deterioration in image quality is conspicuous), by estimating a small quantization parameter (that is, a large code amount), An appropriate expected code amount can be obtained.

部分評価値演算部22は、画像信号S1に基づいて、直後N個のマクロブロックの各々について、各マクロブロックの複数の部分領域に関する活発性評価値の最小値act2を算出する。つまり、各マクロブロックの上辺を含む縦4画素×横16画素の領域、下辺を含む縦4画素×横16画素の領域、左辺を含む縦16画素×横4画素の領域、及び右辺を含む縦16画素×横4画素の領域に関する活発性評価値をそれぞれ算出し、その最小値act2を求める。このように最小値act2を用いることにより、例えば、全体が複雑であり、文字領域を含んでおらず、かつ滑らかな部分を一部に含んでいない属性のマクロブロック(つまり画質の劣化が目立たないマクロブロック)に関しては、大きい量子化パラメータ(つまり小さい符号量)を見積もることにより、適切な予想符号量を求めることができる。また、例えば、全体が複雑であり、文字領域を含んでいないが、滑らかな部分を一部に含んでいる属性のマクロブロック(つまり滑らかな部分において画質の劣化が目立つマクロブロック)に関しては、やや小さい量子化パラメータ(つまりやや大きい符号量)を見積もることにより、適切な予想符号量を求めることができる。   The partial evaluation value calculation unit 22 calculates the minimum value act2 of the activity evaluation values for the plurality of partial areas of each macroblock for each of the N macroblocks immediately after, based on the image signal S1. That is, a vertical 4 pixel × horizontal 16 pixel region including the upper side of each macroblock, a vertical 4 pixel × horizontal 16 pixel region including the lower side, a vertical 16 pixel × horizontal 4 pixel region including the left side, and a vertical side including the right side. The activity evaluation values for the area of 16 pixels × 4 horizontal pixels are calculated, and the minimum value act2 is obtained. By using the minimum value act2 in this way, for example, a macroblock having an attribute that is complex as a whole, does not include a character area, and does not include a smooth portion (that is, deterioration in image quality is not noticeable). For a macro block, an appropriate expected code amount can be obtained by estimating a large quantization parameter (that is, a small code amount). In addition, for example, with respect to a macroblock having an attribute that is complex as a whole and does not include a character area but includes a smooth portion in part (that is, a macroblock in which deterioration in image quality is conspicuous in a smooth portion) By estimating a small quantization parameter (that is, a slightly large code amount), an appropriate expected code amount can be obtained.

ソベルフィルタ処理部23は、画像信号S1に基づいて、直後N個のマクロブロックの各々について、各マクロブロックの複数の部分領域に関して、ソベルフィルタを用いてエッジ抽出処理を実行し、そのフィルタ結果の最大値Sobelを求める。つまり、各マクロブロックの上辺を含む縦4画素×横16画素の領域、下辺を含む縦4画素×横16画素の領域、左辺を含む縦16画素×横4画素の領域、及び右辺を含む縦16画素×横4画素の領域に関してエッジ抽出処理を実行し、そのフィルタ結果の最大値Sobelを求める。このように最大値Sobelを用いることにより、例えば、全体が複雑であり、かつ文字領域を一部に含んでいる属性のマクロブロック(つまり文字領域において画質の劣化が目立つマクロブロック)に関しては、中程度の量子化パラメータ(つまり中程度の符号量)を見積もることにより、適切な予想符号量を求めることができる。   Based on the image signal S1, the Sobel filter processing unit 23 performs edge extraction processing using a Sobel filter for each of the plurality of partial areas of each macroblock for each of the N macroblocks immediately after the image signal S1. The maximum value Sobel is obtained. That is, a vertical 4 pixel × horizontal 16 pixel region including the upper side of each macroblock, a vertical 4 pixel × horizontal 16 pixel region including the lower side, a vertical 16 pixel × horizontal 4 pixel region including the left side, and a vertical side including the right side. Edge extraction processing is executed for an area of 16 pixels × 4 horizontal pixels, and the maximum value Sobel of the filter result is obtained. By using the maximum value Sobel in this way, for example, with respect to a macroblock having an attribute that is complicated as a whole and includes a character area in part (that is, a macroblock in which deterioration in image quality is conspicuous in the character area), By estimating a certain quantization parameter (that is, a medium code amount), an appropriate expected code amount can be obtained.

図5は、図4に示した記憶部25に記憶されているパラメータセットの例を示す図である。複数のパラメータセットQPS0〜QPS7の各々には、マクロブロックの属性値ACT0〜ACT4に対応して量子化パラメータがそれぞれ設定されている。例えばパラメータセットQPS4に関しては、属性値ACT0に対応して値「38」の量子化パラメータが設定されており、属性値ACT1に対応して「20」の量子化パラメータが設定されており、属性値ACT2に対応して「38」の量子化パラメータが設定されており、属性値ACT3に対応して「44」の量子化パラメータが設定されており、属性値ACT4に対応して「26」の量子化パラメータが設定されている。また、例えばパラメータセットQPS7に関しては、属性値ACT0〜ACT4に対応して「51」の量子化パラメータが設定されている。   FIG. 5 is a diagram illustrating an example of a parameter set stored in the storage unit 25 illustrated in FIG. In each of the plurality of parameter sets QPS0 to QPS7, quantization parameters are respectively set corresponding to the macroblock attribute values ACT0 to ACT4. For example, for the parameter set QPS4, a quantization parameter of value “38” is set corresponding to the attribute value ACT0, a quantization parameter of “20” is set corresponding to the attribute value ACT1, and the attribute value A quantization parameter of “38” is set corresponding to ACT2, a quantization parameter of “44” is set corresponding to attribute value ACT3, and a quantization parameter of “26” corresponding to attribute value ACT4. Parameter is set. For example, for the parameter set QPS7, a quantization parameter of “51” is set corresponding to the attribute values ACT0 to ACT4.

また、量子化パラメータが基準値(例えばH.264の規格上の最大値である「51」)に設定された場合に発生が想定される符号量(基準符号量)が、マクロブロックの属性値ACT0〜ACT4に対応してそれぞれ設定されている。この例では、属性値ACT0に対応して32ビット、属性値ACT1に対応して4ビット、属性値ACT2に対応して32ビット、属性値ACT3に対応して32ビット、及び属性値ACT4に対応して8ビットの基準符号量が、それぞれ設定されている。基準符号量を適切に設定することにより、複数のパラメータセットQPS0〜QPS7の各々に関して、適切な予想符号量を求めることができる。   In addition, a code amount (reference code amount) that is assumed to be generated when the quantization parameter is set to a reference value (for example, “51” which is the maximum value in the standard of H.264) is the attribute value of the macroblock. They are set corresponding to ACT0 to ACT4. In this example, 32 bits corresponding to attribute value ACT0, 4 bits corresponding to attribute value ACT1, 32 bits corresponding to attribute value ACT2, 32 bits corresponding to attribute value ACT3, and attribute value ACT4 Thus, an 8-bit reference code amount is set for each. By appropriately setting the reference code amount, an appropriate expected code amount can be obtained for each of the plurality of parameter sets QPS0 to QPS7.

図4を参照して、予想符号量演算部24は、直後N個のマクロブロックの各々について、全体評価値演算部21によって求められた活発性評価値act1と、部分評価値演算部22によって求められた最小値act2と、ソベルフィルタ処理部23によって求められた最大値Sobelと、記憶部25から読み出したパラメータセットとに基づいて、直後N個のマクロブロックに関して使用が予想される予想符号量を求める。具体的には以下の通りである。   With reference to FIG. 4, the expected code amount calculation unit 24 calculates the activity evaluation value act1 obtained by the overall evaluation value calculation unit 21 and the partial evaluation value calculation unit 22 for each of the N macroblocks immediately after. Based on the obtained minimum value act2, the maximum value Sobel obtained by the Sobel filter processing unit 23, and the parameter set read from the storage unit 25, the expected code amount expected to be used for the immediately following N macroblocks is calculated. Ask. Specifically, it is as follows.

予想符号量演算部24は、まず、直後N個のマクロブロックの各々について、属性値を決定する。図6は、属性値の決定手法の一例を示すフローチャートである。図6のフローチャートで示すように、各マクロブロックの属性値は、活発性評価値act1が「2」以下であるという第1の条件を満たす場合には属性値ACT1に決定され、第1の条件を満たさず活発性評価値act1が「6」以下であるという第2の条件を満たす場合には属性値ACT4に決定され、第2の条件を満たさず最大値Sobelが「120」以上であるという第3の条件を満たす場合には属性値ACT0に決定され、第3の条件を満たさず最小値act2が「5」以下であるという第4の条件を満たす場合には属性値ACT2に決定され、第4の条件を満たさない場合には属性値ACT3に決定される。予想符号量演算部24は、直後N個のマクロブロックの中に、各属性値ACT0〜ACT4に決定されたマクロブロックが何個ずつ含まれているかをカウントする。   The expected code amount calculation unit 24 first determines an attribute value for each of the N macroblocks immediately after. FIG. 6 is a flowchart illustrating an example of an attribute value determination method. As shown in the flowchart of FIG. 6, the attribute value of each macroblock is determined to be the attribute value ACT1 when the first condition that the activity evaluation value act1 is “2” or less is satisfied, and the first condition If the second condition that the activity evaluation value act1 is “6” or less is not satisfied, the attribute value ACT4 is determined, and the second value is not satisfied and the maximum value Sobel is “120” or more. When the third condition is satisfied, the attribute value ACT0 is determined. When the fourth condition that the third condition is not satisfied and the minimum value act2 is “5” or less is determined, the attribute value ACT2 is determined. When the fourth condition is not satisfied, the attribute value ACT3 is determined. The expected code amount calculation unit 24 counts how many macroblocks determined by the attribute values ACT0 to ACT4 are included in the immediately following N macroblocks.

予想符号量演算部24は、次に、パラメータセットQPS0〜QPS6の各々を適用した場合の、直後N個のマクロブロックの合計の予想符号量をそれぞれ算出する。図5に示したように、パラメータセットQPS0〜QPS6の量子化パラメータは、「20」、「26」、「32」、「38」、「44」、及び「51」のいずれかに設定されている。また、H.264の規格により、量子化パラメータが「6」だけ小さくなれば、量子化精度は2倍になる。従って、量子化パラメータが「20」、「26」、「32」、「38」、「44」、及び「51」に設定された場合に発生が想定される符号量は、それぞれ基準符号量の32倍、16倍、8倍、4倍、2倍、及び1倍となる。従って、直後N個のマクロブロックの中に、属性値ACT0,ACT1,ACT2,ACT3,ACT4に決定されたマクロブロックがそれぞれK0個、K1個、K2個、K3個、K4個ずつ含まれている場合において、例えばパラメータセットQPS4を適用した場合の合計の予想符号量は、32(ビット)×4(倍)×K0(個)+4×32×K1+32×4×K2+32×2×K3+8×16×K4なる演算によって求まる。予想符号量演算部24は、他のパラメータセットQPS0〜QPS3,QPS5,QPS6を適用した場合の合計の予想符号量についても、上記と同様に算出する。そして、各パラメータセットQPS0〜QPS6を適用した場合の合計の予想符号量を、信号S13として図3に示した第4処理部14に入力する。   Next, the predicted code amount calculation unit 24 calculates the total predicted code amount of the immediately following N macroblocks when each of the parameter sets QPS0 to QPS6 is applied. As shown in FIG. 5, the quantization parameter of the parameter set QPS0 to QPS6 is set to any one of “20”, “26”, “32”, “38”, “44”, and “51”. Yes. H. According to the H.264 standard, if the quantization parameter is reduced by “6”, the quantization accuracy is doubled. Therefore, when the quantization parameter is set to “20”, “26”, “32”, “38”, “44”, and “51”, the code amount assumed to be generated is the reference code amount, respectively. It becomes 32 times, 16 times, 8 times, 4 times, 2 times, and 1 time. Therefore, immediately after the N macroblocks, the macroblocks determined to have the attribute values ACT0, ACT1, ACT2, ACT3, and ACT4 are included in K0, K1, K2, K3, and K4, respectively. In this case, for example, when the parameter set QPS4 is applied, the total expected code amount is 32 (bits) × 4 (times) × K0 (pieces) + 4 × 32 × K1 + 32 × 4 × K2 + 32 × 2 × K3 + 8 × 16 × K4 It is obtained by the following operation. The expected code amount calculation unit 24 also calculates the total expected code amount when the other parameter sets QPS0 to QPS3, QPS5, and QPS6 are applied in the same manner as described above. Then, the total expected code amount when each of the parameter sets QPS0 to QPS6 is applied is input to the fourth processing unit 14 shown in FIG. 3 as a signal S13.

図7は、第4処理部14によるパラメータセットの選択手法の一例を示す図である。直後N個のマクロブロックに関する許容符号量は、X個のマクロブロックに関する目標符号量から、直前に処理したX−N個のマクロブロックに関する発生符号量を差し引いた値として得られる。   FIG. 7 is a diagram illustrating an example of a parameter set selection method performed by the fourth processing unit 14. The allowable code amount for the N macroblocks immediately after is obtained as a value obtained by subtracting the generated code amount for the XN macroblocks processed immediately before from the target code amount for the X macroblocks.

第4処理部14は、複数のパラメータセットQPS0〜QPS6のうち、予想符号量が許容符号量以下で最大となるパラメータセットを選択する。図7に示した例では、パラメータセットQPS4が選択される。そして、第4処理部14は、選択したパラメータセットQPS4に基づいて、現在の処理対象のマクロブロックに関する量子化パラメータを設定する。例えば、現在の処理対象のマクロブロックの属性値が属性値ACT0である場合には、当該マクロブロックに関する量子化パラメータを、図5においてQPS4とACT0との交点に規定されている「38」に設定する。この例によれば、発生符号量を目標符号量以下に抑えつつ、可能な限り画質を向上することができる。   The fourth processing unit 14 selects a parameter set that has the maximum expected code amount below the allowable code amount among the plurality of parameter sets QPS0 to QPS6. In the example shown in FIG. 7, the parameter set QPS4 is selected. And the 4th process part 14 sets the quantization parameter regarding the macroblock of the now process target based on selected parameter set QPS4. For example, when the attribute value of the current macroblock to be processed is the attribute value ACT0, the quantization parameter for the macroblock is set to “38” defined at the intersection of QPS4 and ACT0 in FIG. To do. According to this example, it is possible to improve the image quality as much as possible while suppressing the generated code amount below the target code amount.

他の例として、第4処理部14は、複数のパラメータセットQPS0〜QPS6のうち、予想符号量が許容符号量に最も近いパラメータセットを選択する。図7に示した例では、パラメータセットQPS3が選択される。そして、第4処理部14は、選択したパラメータセットQPS3に基づいて、現在の処理対象のマクロブロックに関する量子化パラメータを設定する。例えば、現在の処理対象のマクロブロックの属性値が属性値ACT0である場合には、当該マクロブロックに関する量子化パラメータを、図5においてQPS3とACT0との交点に規定されている「32」に設定する。この例によれば、発生符号量を目標符号量に近付けることができるため、安定した符号量制御を行うことが可能となる。なお、この例において、予想符号量が許容符号量を超えることにより、発生符号量と予想符号量との和が目標符号量の例えば105%以上となる場合には、許容符号量を超える予想符号量となるパラメータセットの選択を禁止してもよい。   As another example, the fourth processing unit 14 selects a parameter set whose predicted code amount is closest to the allowable code amount from among a plurality of parameter sets QPS0 to QPS6. In the example shown in FIG. 7, the parameter set QPS3 is selected. And the 4th process part 14 sets the quantization parameter regarding the macroblock of the now process target based on selected parameter set QPS3. For example, if the attribute value of the current macroblock to be processed is the attribute value ACT0, the quantization parameter for the macroblock is set to “32” defined at the intersection of QPS3 and ACT0 in FIG. To do. According to this example, since the generated code amount can be brought close to the target code amount, stable code amount control can be performed. In this example, when the expected code amount exceeds the allowable code amount, and the sum of the generated code amount and the expected code amount is, for example, 105% or more of the target code amount, the expected code exceeding the allowable code amount. Selection of parameter sets that are quantities may be prohibited.

また、複数のパラメータセットQPS0〜QPS6のうち予想符号量が最小となるパラメータセットQPS6を選択しても、予想符号量が許容符号量を超える場合には、第4処理部14は、図5に示したパラメータセットQPS7を選択する。パラメータセットQPS7が選択された場合には、現在の処理対象のマクロブロックに関する量子化パラメータは、規格上の最大値である「51」に設定される。   In addition, when the predicted code amount exceeds the allowable code amount even when the parameter set QPS6 having the smallest predicted code amount is selected from among the plurality of parameter sets QPS0 to QPS6, the fourth processing unit 14 performs processing illustrated in FIG. The indicated parameter set QPS7 is selected. When the parameter set QPS7 is selected, the quantization parameter related to the current macroblock to be processed is set to “51” which is the maximum value in the standard.

<変形例>
図8は、変形例に係る画像処理装置1の構成を示すブロック図である。画像生成部4から制御部3に対して、現在生成している画像が静止画であるか動画であるかを示す信号S6が入力されている。これにより、制御部3は、現在処理している画像が静止画であるか動画であるか(つまり各フレームが静止画のフレームであるか動画のフレームであるか)を判別することができる。
<Modification>
FIG. 8 is a block diagram illustrating a configuration of the image processing apparatus 1 according to the modification. A signal S6 indicating whether the currently generated image is a still image or a moving image is input from the image generation unit 4 to the control unit 3. Thereby, the control unit 3 can determine whether the currently processed image is a still image or a moving image (that is, whether each frame is a still image frame or a moving image frame).

上記実施の形態では、下限値Mは、処理する画像が静止画である場合と動画である場合とで共通の値に設定された。これに対して本変形例では、処理する画像が静止画である場合と動画である場合とで下限値Mを異なる値に設定する。下限値Mは、一例として、処理する画像が静止画である場合には1マクロブロックあたりの目標符号量の50%程度に設定され、処理する画像が動画である場合にはゼロに設定される。図9を参照して、第1処理部11は、領域R1に関する発生符号量を求める場合には、領域R1は静止画のフレームであるために下限値Mを50%に設定する。また、領域R2,R3に関する発生符号量を求める場合には、領域R2,R3は動画のフレームであるために下限値Mをゼロに設定する。   In the above embodiment, the lower limit value M is set to a common value between the case where the image to be processed is a still image and the case where the image is a moving image. On the other hand, in this modification, the lower limit M is set to a different value depending on whether the image to be processed is a still image or a moving image. For example, the lower limit M is set to about 50% of the target code amount per macroblock when the image to be processed is a still image, and is set to zero when the image to be processed is a moving image. . Referring to FIG. 9, when determining the amount of generated code related to region R1, first processing unit 11 sets lower limit M to 50% because region R1 is a frame of a still image. Further, when the amount of generated code related to the regions R2 and R3 is obtained, the lower limit value M is set to zero because the regions R2 and R3 are frames of moving images.

<まとめ>
このように本実施の形態に係る画像処理装置1によれば、第1処理部11は、直前に処理したY個のマクロブロックに関して、各マクロブロックの発生符号量が、予め設定された下限値M以下である場合は、当該マクロブロックの発生符号量を当該下限値Mとする。そのため、処理する画像が静止画であることにより実際の発生符号量がゼロ又はそれに近い場合であっても、第1処理部11はある程度の符号量が発生したものとみなす。従って、処理する画像が静止画から動画に切り替わった時点において許容符号量は過度に大きくはなっていないため、第4処理部14によって量子化パラメータが過度に小さく設定されることはない。その結果、処理する画像が静止画から動画に切り替わった直後において、量子化パラメータが過度に小さく設定される領域と過度に大きく設定される領域とが繰り返されるという事態は発生しないため、画質の劣化を回避することが可能となる。
<Summary>
As described above, according to the image processing apparatus 1 according to the present embodiment, the first processing unit 11 sets the generated code amount of each macroblock for the Y macroblocks processed immediately before the preset lower limit value. If it is equal to or less than M, the generated code amount of the macroblock is set to the lower limit value M. Therefore, even if the actual generated code amount is zero or close to it because the image to be processed is a still image, the first processing unit 11 regards that a certain amount of code has occurred. Accordingly, since the allowable code amount is not excessively large when the image to be processed is switched from the still image to the moving image, the quantization parameter is not set excessively small by the fourth processing unit 14. As a result, immediately after the image to be processed is switched from a still image to a moving image, an area where the quantization parameter is set too small and an area where the quantization parameter is set too large do not occur. Can be avoided.

また、本実施の形態に係る画像処理装置1によれば、処理する画像が静止画である場合と動画である場合とで、同一の下限値Mが設定される。従って、画像に応じて下限値Mを変動させる必要がないため、構成及び処理の簡略化を図ることが可能となる。   Further, according to the image processing apparatus 1 according to the present embodiment, the same lower limit value M is set for the case where the image to be processed is a still image and the case where the image is a moving image. Therefore, it is not necessary to change the lower limit value M according to the image, so that the configuration and processing can be simplified.

また、本実施の形態に係る画像処理装置1によれば、下限値Mは、1マクロブロックあたりの目標符号量の20%以上25%以下の範囲内に設定される。下限値Mをこの範囲内に設定することにより、動画の先頭フレームの上端領域R2と、それに続く領域R3との双方において、画質の劣化を効果的に回避することが可能となる。   Further, according to the image processing apparatus 1 according to the present embodiment, the lower limit value M is set within the range of 20% to 25% of the target code amount per macroblock. By setting the lower limit value M within this range, it is possible to effectively avoid deterioration in image quality in both the upper end region R2 of the first frame of the moving image and the subsequent region R3.

また、変形例に係る画像処理装置1によれば、処理する画像が静止画である場合に設定される下限値Mは、処理する画像が動画である場合に設定される下限値Mよりも大きい。従って、処理する画像が静止画である場合には、下限値Mをある程度大きい値に設定することにより、処理する画像が静止画から動画に切り替わった直後における画質の劣化を効果的に回避することが可能となる。また、処理する画像が静止画から動画に切り替わった後に動画を処理する場合には、下限値Mを小さい値(ゼロでもよい)に設定することにより、下限値Mによる影響を受けることなく動画を通常に処理することができ、その結果、下限値Mを設定することに伴う動画像の画質の劣化を回避することが可能となる。   Further, according to the image processing device 1 according to the modification, the lower limit value M set when the image to be processed is a still image is larger than the lower limit value M set when the image to be processed is a moving image. . Therefore, when the image to be processed is a still image, the lower limit value M is set to a somewhat large value to effectively avoid deterioration in image quality immediately after the image to be processed is switched from a still image to a moving image. Is possible. In addition, when a moving image is processed after the image to be processed is switched from a still image to a moving image, by setting the lower limit value M to a small value (may be zero), the moving image is not affected by the lower limit value M. Processing can be performed normally, and as a result, it is possible to avoid the deterioration of the image quality of the moving image associated with setting the lower limit value M.

1 画像処理装置
2 エンコーダ
3 制御部
11 第1処理部
12 第2処理部
13 第3処理部
14 第4処理部

DESCRIPTION OF SYMBOLS 1 Image processing apparatus 2 Encoder 3 Control part 11 1st process part 12 2nd process part 13 3rd process part 14 4th process part

Claims (4)

画像信号に対する量子化処理を含むエンコード処理を実行するエンコーダと、
前記量子化処理における量子化パラメータを制御する制御部と、
を備え、
前記制御部は、
直前の第1の所定数のマクロブロックに関して使用した発生符号量を求める第1の処理部と、
1フレーム内に含まれるマクロブロックの総数未満の第2の所定数以下のマクロブロックあたりの目標符号量と、前記第1の処理部によって求められた前記発生符号量とに基づいて、現在の処理対象のマクロブロックを含む直後の第3の所定数のマクロブロックに関して使用可能な許容符号量を求める第2の処理部と、
前記第3の所定数のマクロブロックに関して使用が予想される予想符号量を求める第3の処理部と、
前記第2の処理部によって求められた前記許容符号量と、前記第3の処理部によって求められた前記予想符号量とに基づいて、現在の処理対象のマクロブロックに関する量子化パラメータを設定する第4の処理部と、
を有し、
前記第1の処理部は、前記第1の所定数のマクロブロックに関して、各マクロブロックの発生符号量が、予め設定された下限値以下である場合は、当該マクロブロックの発生符号量を当該下限値とする、画像処理装置。
An encoder that performs encoding processing including quantization processing on an image signal;
A control unit for controlling a quantization parameter in the quantization process;
With
The controller is
A first processing unit for determining a generated code amount used for the immediately preceding first predetermined number of macroblocks;
Based on a target code amount per second macroblock that is less than or equal to a second predetermined number less than the total number of macroblocks included in one frame and the generated code amount obtained by the first processing unit, A second processing unit that obtains an allowable code amount that can be used for a third predetermined number of macroblocks immediately after including the target macroblock;
A third processing unit for obtaining an expected code amount expected to be used for the third predetermined number of macroblocks;
Based on the allowable code amount obtained by the second processing unit and the expected code amount obtained by the third processing unit, a quantization parameter relating to a current macroblock to be processed is set. 4 processing units;
Have
When the generated code amount of each macroblock is less than or equal to a preset lower limit for the first predetermined number of macroblocks, the first processing unit determines the generated code amount of the macroblock as the lower limit. An image processing apparatus as a value.
処理する画像が静止画である場合に設定される前記下限値は、処理する画像が動画である場合に設定される前記下限値と同一である、請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the lower limit value set when the image to be processed is a still image is the same as the lower limit value set when the image to be processed is a moving image. 前記下限値は、1マクロブロックあたりの目標符号量の20%以上25%以下の範囲内に設定される、請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the lower limit value is set within a range of 20% to 25% of a target code amount per macroblock. 前記下限値は、処理する画像が静止画である場合と動画である場合とで異なる値に設定され、
処理する画像が静止画である場合に設定される前記下限値は、処理する画像が動画である場合に設定される前記下限値よりも大きい、請求項1に記載の画像処理装置。

The lower limit value is set to a different value depending on whether the image to be processed is a still image or a moving image,
The image processing apparatus according to claim 1, wherein the lower limit value set when the image to be processed is a still image is larger than the lower limit value set when the image to be processed is a moving image.

JP2012049556A 2012-03-06 2012-03-06 Image processing device Expired - Fee Related JP5848993B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012049556A JP5848993B2 (en) 2012-03-06 2012-03-06 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012049556A JP5848993B2 (en) 2012-03-06 2012-03-06 Image processing device

Publications (2)

Publication Number Publication Date
JP2013187634A JP2013187634A (en) 2013-09-19
JP5848993B2 true JP5848993B2 (en) 2016-01-27

Family

ID=49388732

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012049556A Expired - Fee Related JP5848993B2 (en) 2012-03-06 2012-03-06 Image processing device

Country Status (1)

Country Link
JP (1) JP5848993B2 (en)

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04316294A (en) * 1991-04-16 1992-11-06 Matsushita Electric Ind Co Ltd Variable-length coding circuit
JPH09107543A (en) * 1995-10-11 1997-04-22 Fujitsu Ltd Quantizer control system
JP3807157B2 (en) * 1999-06-25 2006-08-09 日本ビクター株式会社 Encoding apparatus and encoding method
JP3669277B2 (en) * 2000-03-08 2005-07-06 三菱電機株式会社 Encoding apparatus and encoding method
KR100341063B1 (en) * 2000-06-28 2002-06-20 송문섭 Rate control apparatus and method for real-time video communication
JP2005012630A (en) * 2003-06-20 2005-01-13 Matsushita Electric Ind Co Ltd Image encoding apparatus
US7680182B2 (en) * 2004-08-17 2010-03-16 Panasonic Corporation Image encoding device, and image decoding device
JP4091582B2 (en) * 2004-09-06 2008-05-28 株式会社東芝 Moving picture coding apparatus and moving picture coding method
JP5491936B2 (en) * 2010-03-31 2014-05-14 株式会社メガチップス Image processing device

Also Published As

Publication number Publication date
JP2013187634A (en) 2013-09-19

Similar Documents

Publication Publication Date Title
JP5484083B2 (en) Image processing device
JP4246723B2 (en) Intraframe predictive coding control method, intraframe predictive coding control apparatus, intraframe predictive coding control program, and computer-readable recording medium storing the program
JP5502336B2 (en) Video signal encoding apparatus and video signal encoding method
JP5491936B2 (en) Image processing device
JP5988577B2 (en) Image coding apparatus, image coding method, and program
EP1919222A1 (en) De-blocking filtering method of image data and de-blocking filter
US20130058420A1 (en) Decoding apparatus, decoding method, and computer-readable storage medium
JP6373033B2 (en) Encoding apparatus and encoding method
JP5342391B2 (en) Image processing device
TWI506965B (en) A coding apparatus, a decoding apparatus, a coding / decoding system, a coding method, and a decoding method
JP5748225B2 (en) Moving picture coding method, moving picture coding apparatus, and moving picture coding program
US7375770B2 (en) Method for luminance transition improvement
JP5848993B2 (en) Image processing device
JP4676508B2 (en) Quantization matrix switching method, video encoding device, and video encoding program
JP5930781B2 (en) Image processing device
JP2007336075A (en) Block distortion reducing device
JP2006128744A (en) Blockiness reducing device
JP5492058B2 (en) Image processing device
US20150010061A1 (en) Video encoding method, device and program
JP6239838B2 (en) Moving picture encoding apparatus, control method thereof, and imaging apparatus
JP6758977B2 (en) Image processing equipment, image processing methods and programs
JP2017005505A (en) Video encoding device, video encoding method and video encoding program
JP5655480B2 (en) Video encoding device
JP2001157207A (en) Image encoder
JP6012307B2 (en) Moving picture coding apparatus, control method therefor, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150227

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151014

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151130

R150 Certificate of patent or registration of utility model

Ref document number: 5848993

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees