JP2014042139A - Coding device, coding method and program - Google Patents

Coding device, coding method and program Download PDF

Info

Publication number
JP2014042139A
JP2014042139A JP2012183155A JP2012183155A JP2014042139A JP 2014042139 A JP2014042139 A JP 2014042139A JP 2012183155 A JP2012183155 A JP 2012183155A JP 2012183155 A JP2012183155 A JP 2012183155A JP 2014042139 A JP2014042139 A JP 2014042139A
Authority
JP
Japan
Prior art keywords
block
search
motion vector
motion
image
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
JP2012183155A
Other languages
Japanese (ja)
Other versions
JP5906993B2 (en
Inventor
Hidetoshi Matsumura
秀敏 松村
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2012183155A priority Critical patent/JP5906993B2/en
Publication of JP2014042139A publication Critical patent/JP2014042139A/en
Application granted granted Critical
Publication of JP5906993B2 publication Critical patent/JP5906993B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain a suppressed capacity of a reference image storage unit, an improved coding efficiency and a suppressed readout data amount from the storage unit, with satisfactory balance.SOLUTION: Among a plurality of blocks obtained when dividing a processing target frame image into blocks of processing units for a second motion search, a block in which a higher coding efficiency (Yes in step 104) is obtained by using a first motion vector than using a second motion vector is determined to be a specific block for the second motion search (step 112) within a range not exceeding an upper limit value in regard to the total value of a direct readout data amount when a reference frame image is read out directly without intervention of a reference image storage unit. Other blocks than the specific block are determined to be an unspecific block for the second motion search using the second motion vector (step 114).

Description

開示の技術は、動画像の符号化装置、符号化方法、及びプログラムに関する。   The disclosed technology relates to a moving image encoding device, an encoding method, and a program.

動き探索処理は、処理対象となっているブロック(ここでは、元ブロックと呼ぶ)と類似したブロックを参照画像の中から探し出す処理である。例えば、まず、参照画像の中から元ブロックと同じサイズの多数の候補ブロックを抽出する。次に、各候補ブロックについて元ブロックとの類似度の評価指標(SAD(差分絶対値和)や動きベクトルから求められる符号化コスト等、又は複数の評価指標を組み合わせて得られる値)を算出する。そして、該算出した評価指標値に基づき、最も良いと評価された候補ブロックを指し示す動きベクトルを出力する。   The motion search process is a process of searching a reference image for a block similar to a block to be processed (here, called an original block). For example, first, a large number of candidate blocks having the same size as the original block are extracted from the reference image. Next, for each candidate block, an evaluation index (SAD (sum of absolute differences), encoding cost obtained from a motion vector, or a value obtained by combining a plurality of evaluation indices) is calculated. . Then, based on the calculated evaluation index value, a motion vector indicating the candidate block evaluated to be the best is output.

フレーム間予測による符号化効率を向上させるためには、動き探索処理において、より元ブロックに類似した候補ブロックを抽出することが求められる。それには候補ブロックを抽出する画像領域(以下、探索範囲と呼ぶ)が広いほど望ましい。しかし、探索範囲を広げれば広げるほど元画像との間の類似度の評価指標を算出する回数が増大し、動き探索処理に要する演算量、フレームメモリに格納された参照画像から候補ブロックを取り出すときの読出データ量が増加し、メモリ帯域を圧迫する。動き探索処理の演算量、及びメモリからの読出処理は、動画像の符号化処理全体の中で相当の割合を占めるため、これを削減する様々な技術が存在する。   In order to improve the coding efficiency by inter-frame prediction, it is required to extract candidate blocks more similar to the original block in the motion search process. For that purpose, it is desirable that the image area (hereinafter referred to as the search range) from which candidate blocks are extracted is wider. However, when the search range is expanded, the number of times of calculating the similarity evaluation index with the original image increases, and the amount of calculation required for motion search processing and when extracting candidate blocks from the reference image stored in the frame memory The amount of read data increases, and the memory bandwidth is reduced. The calculation amount of the motion search process and the read process from the memory occupy a considerable proportion in the entire moving picture encoding process, and various techniques exist for reducing this.

参照画像を記憶する主記憶部と、動き探索を行う動き探索部と、の間に、参照バッファメモリ(以下、参照画像記憶部という)を設ける技術が知られている。参照画像記憶部には、フレームバッファメモリ(以下、単に記憶部という)から部分的に読出された参照画像が転送され記憶される。動き探索部は、参照画像を参照画像記憶部から読出して、動き探索を行う。これにより、参照画像の読み込みに要する記憶部の帯域が抑制される。   A technique is known in which a reference buffer memory (hereinafter referred to as a reference image storage unit) is provided between a main storage unit that stores a reference image and a motion search unit that performs a motion search. In the reference image storage unit, a reference image partially read from a frame buffer memory (hereinafter simply referred to as a storage unit) is transferred and stored. The motion search unit reads a reference image from the reference image storage unit and performs a motion search. Thereby, the bandwidth of the storage unit required for reading the reference image is suppressed.

また、動き探索の手法の1つとして、階層探索法も知られている。例えば、一段階目の動き探索では原画像を縮小した画像等を用いて、広い探索範囲についておおよその動きベクトルを導出する。二段階目の動き探索では原画像と参照画像とを用いて、一段階目の動き探索結果の動きベクトルが指す点を中心とした狭い探索範囲について詳細に動き予測を行う。この階層探索法では、多数の候補領域との間で類似度指標の算出を行う一段階目の動き予測を縮小画像で行うため、演算量を大幅に削減可能である。   A hierarchical search method is also known as one of motion search methods. For example, in the first-stage motion search, an approximate motion vector is derived for a wide search range using an image obtained by reducing the original image. In the second stage motion search, using the original image and the reference image, motion prediction is performed in detail for a narrow search range centered on the point indicated by the motion vector of the first stage motion search result. In this hierarchical search method, since the first-stage motion prediction for calculating the similarity index between a large number of candidate regions is performed with the reduced image, the amount of calculation can be greatly reduced.

特開2009−152710号公報JP 2009-152710 A 特開2012−4710号公報JP 2012-4710 A 特開平7−203462号公報JP-A-7-203462

しかしながら、上記参照画像記憶部を使用する技術では、参照画像内の複数の処理ブロックラインを参照画像記憶部に保持する必要があるため、その容量は大きなものとなる。メモリ容量を削減するには動き探索処理の探索範囲を狭めることが望ましい。一方、符号化効率の観点からは探索範囲は広くすることが望ましい。   However, in the technique using the reference image storage unit, it is necessary to hold a plurality of processing block lines in the reference image in the reference image storage unit, so that the capacity is large. In order to reduce the memory capacity, it is desirable to narrow the search range of the motion search process. On the other hand, it is desirable to widen the search range from the viewpoint of coding efficiency.

開示の技術は、一つの側面として、参照画像記憶部の容量の抑制、符号化効率の向上、及び記憶部からの読出データ量の抑制の各々をバランスよく実現することを目的とする。   An object of the disclosed technique is to achieve, in a balanced manner, suppression of the capacity of the reference image storage unit, improvement of encoding efficiency, and suppression of the amount of read data from the storage unit.

開示の技術において、第1動き探索部は、第1処理及び第2処理を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行う。第1動き探索部は、第1処理では、縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める。第1動き探索部は、第2処理では、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める。   In the disclosed technology, the first motion search unit performs the first motion search including the first process and the second process for each block that is the processing unit of the first motion search in the processing target frame image of the moving image. Do. In the first process, the first motion search unit searches for the first motion vector with reference to the first search range in the reduced reference frame image to obtain the encoding efficiency. In the second process, the first motion search unit searches for a second motion vector by referring to a second search range smaller than the first search range in the reduced reference frame image and included in the first search range. The encoding efficiency is obtained.

また、参照画像記憶部は、前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する。   The reference image storage unit stores a reference image partially read from a storage unit that stores a reference frame image referred to in the second motion search performed based on the processing result of the first motion search. .

制御部は、前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させる。このとき、制御部は、各ブロック毎に、前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を前記参照画像記憶部に記憶させる。   The control unit stores the reference image in the reference image storage unit before starting the second motion search of each block for each block that is a processing unit of the second motion search in the processing target frame image. Let At this time, the control unit causes the reference image storage unit to store the reference image including the search range of the second motion search set based on the second motion vector for each block.

判定部は、前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを特定ブロックとして判定する。特定ブロックは、前記第1動きベクトルを用いて前記第2動き探索を行うブロックである。なお、判定部は、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記特定ブロックを判定する。   The determination unit encodes the first motion vector rather than the second motion vector among a plurality of blocks when the processing target frame image is divided into blocks that are processing units of the second motion search. A block with high efficiency is determined as a specific block. The specific block is a block that performs the second motion search using the first motion vector. The determination unit determines the specific block within a range in which the total value of the directly read data amount when the reference frame image is directly read from the storage unit without going through the reference image storage unit does not exceed the upper limit value. judge.

また、判定部は、前記特定ブロック以外のブロックを、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックとして判定する。   The determination unit determines a block other than the specific block as a non-specific block that performs the second motion search using the second motion vector.

第2動き探索部は、前記判定部において前記特定ブロックと判定されたブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う。なお、第2動き探索部は、少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照する。   The second motion search unit refers to a search range image set based on the first motion vector in the reference frame image for the block determined as the specific block by the determination unit, and determines a motion vector. The second motion search to be searched is performed. The second motion search unit refers to the image directly read from the storage unit without going through the reference image storage unit when referring to at least an image not stored in the reference image storage unit.

また、第2動き探索部は、前記非特定ブロックと判定されたブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する第2動き探索を行う。   In addition, the second motion search unit is configured to search for the block determined to be the non-specific block based on the second motion vector among the reference images stored in the reference image storage unit. A second motion search for searching for a motion vector with reference to the image is performed.

開示の技術は、一つの側面として、参照画像記憶部の容量の抑制、符号化効率の向上、及び記憶部からの読出データ量の抑制の各々をバランスよく実現することができる、という効果を有する。   As one aspect, the disclosed technology has an effect that each of suppression of the capacity of the reference image storage unit, improvement of encoding efficiency, and suppression of the amount of read data from the storage unit can be realized in a balanced manner. .

実施形態に係る符号化装置の概略構成図である。It is a schematic block diagram of the encoding apparatus which concerns on embodiment. 第1動き探索部の概略構成図である。It is a schematic block diagram of a 1st motion search part. 参照画像メモリ回路の概略構成図である。It is a schematic block diagram of a reference image memory circuit. 第2動き探索部の概略構成図である。It is a schematic block diagram of a 2nd motion search part. 処理対象のブロックB1についての第2動き探索の処理開始直前の参照画像メモリの記憶状態を模式的に示す図である。It is a figure which shows typically the memory | storage state of the reference image memory just before the process start of the 2nd motion search about the block B1 to be processed. ブロックB1の次に処理対象とされるブロックB2についての第2動き探索の処理開始直前の参照画像メモリの記憶状態を模式的に示す図である。It is a figure which shows typically the memory | storage state of the reference image memory just before the process start of the 2nd motion search about the block B2 made into a process target next to the block B1. 図5及び図6に示す更新制御例とは異なる更新制御例において、処理対象のブロックB1についての第2動き探索の処理開始直前の参照画像メモリの記憶状態を模式的に示す図である。FIG. 7 is a diagram schematically illustrating the storage state of the reference image memory immediately before the start of the second motion search process for the processing target block B1 in an update control example different from the update control examples illustrated in FIGS. 5 and 6. 図5及び図6に示す更新制御例とは異なる更新制御例において、ブロックB1の次に処理対象とされるブロックB2についての第2動き探索の処理開始直前の参照画像メモリの記憶状態を模式的に示す図である。In the update control example different from the update control examples shown in FIGS. 5 and 6, the storage state of the reference image memory immediately before the start of the second motion search process for the block B2 to be processed next to the block B1 is schematically shown. FIG. 判定部により実行される判定処理の一例を示すフローチャートである。It is a flowchart which shows an example of the determination process performed by the determination part. 特定ブロック判定処理の一例を示すフローチャートである。It is a flowchart which shows an example of a specific block determination process. 符号化装置の各構成要素の処理のタイミングを示すタイミングチャートの一例を示す図である。It is a figure which shows an example of the timing chart which shows the timing of the process of each component of an encoding apparatus. 特定ブロック判定処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of a specific block determination process. 合成範囲を例示した図である。It is the figure which illustrated the synthetic | combination range. 特定ブロック判定処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of a specific block determination process. 図14で示した特定ブロック判定処理の内容を各ステップ毎に模式的に示した模式図である。It is the schematic diagram which showed typically the content of the specific block determination process shown in FIG. 14 for every step. 4つのブロックw、x、y、zの配置例を示す図である。It is a figure which shows the example of arrangement | positioning of four blocks w, x, y, and z. 3つのブロックの配置例及び各ブロックの探索範囲の一例を示す図である。It is a figure which shows an example of arrangement | positioning of three blocks, and an example of the search range of each block. 図17Aに示す各ブロックの処理期間毎に、参照バッファに保持される領域を模式的に表わした図である。It is the figure which represented typically the area | region hold | maintained at a reference buffer for every processing period of each block shown to FIG. 17A. 動き探索及びメインメモリへのアクセスをパイプライン的に処理を行う様子を示す図である。It is a figure which shows a mode that a motion search and the access to the main memory are processed in a pipeline. 特定ブロック判定処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of a specific block determination process. 符号化装置の判定部の機能をコンピュータにより実現し、第1動き探索部及び主符号化処理部の機能を、コンピュータに設けられた符号化部により実現する場合の構成図である。It is a block diagram in case the function of the determination part of an encoding apparatus is implement | achieved by a computer, and the function of a 1st motion search part and a main encoding process part is implement | achieved by the encoding part provided in the computer.

以下、図面を参照して開示の技術の実施形態の一例を詳細に説明する。   Hereinafter, an example of an embodiment of the disclosed technology will be described in detail with reference to the drawings.

図1には、本実施形態に係る符号化装置1が示されている。符号化装置1は、例えばMPEG2やH.264等の規格に従って動画像を符号化する装置であって、縮小部10、第1動き探索部11、判定部12、主符号化処理部13、メモリコントローラ14、メインメモリ15を備えている。なお、符号化装置1の各機能部は例えば電子回路等で実現することができ、例えば半導体集積回路、より詳しくはASIC(Application Specific Integrated Circuit)等で実現してもよい。   FIG. 1 shows an encoding apparatus 1 according to this embodiment. The encoding device 1 is, for example, MPEG2 or H.264. This is a device that encodes a moving image according to a standard such as H.264, and includes a reduction unit 10, a first motion search unit 11, a determination unit 12, a main encoding processing unit 13, a memory controller 14, and a main memory 15. Each functional unit of the encoding device 1 can be realized by, for example, an electronic circuit, and may be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC (Application Specific Integrated Circuit).

メインメモリ15は、例えば、SDRAM(Synchronous Dynamic Random Access Memory)等のメモリモジュールとすることができる。メインメモリ15には、縮小画メモリ16、原画メモリ17、及びフレームメモリ18の各記憶領域が設けられている。   The main memory 15 can be a memory module such as SDRAM (Synchronous Dynamic Random Access Memory). The main memory 15 is provided with storage areas of a reduced image memory 16, an original image memory 17, and a frame memory 18.

メインメモリ15は、メモリコントローラ14に接続されている。メモリコントローラ14は、書込要求や読出要求を受信して、該受信した要求に応じてメインメモリ15に対する読み書き(メモリ制御)を行う。   The main memory 15 is connected to the memory controller 14. The memory controller 14 receives a write request or a read request, and performs reading / writing (memory control) with respect to the main memory 15 in accordance with the received request.

縮小部10及び第1動き探索部11は、二段階の動き探索処理を含むフレーム間予測符号化処理において、一段階目の動き探索(以下、第1動き探索という)を行うための構成要素である。ここで、フレーム間予測符号化は、異なる時刻のフレーム画像に基づいて予測画像を生成し、符号化対象の画像と予測画像の差分(誤差)画像を符号化する周知の方法である。   The reduction unit 10 and the first motion search unit 11 are components for performing a first-stage motion search (hereinafter referred to as a first motion search) in an inter-frame prediction encoding process including a two-stage motion search process. is there. Here, inter-frame predictive coding is a well-known method of generating a predicted image based on frame images at different times and encoding a difference (error) image between the image to be encoded and the predicted image.

縮小部10には、符号化処理前の動画像に含まれるフレーム画像(以下、符号化処理後のフレーム画像と区別するため、原画像と呼称する)が入力される。縮小部10は、原画像を縮小した縮小画像を生成し、メモリコントローラ14を介してメインメモリ15の縮小画メモリ16に記憶する。   A frame image included in a moving image before encoding processing (hereinafter, referred to as an original image to be distinguished from a frame image after encoding processing) is input to the reduction unit 10. The reduction unit 10 generates a reduced image obtained by reducing the original image, and stores the reduced image in the reduced image memory 16 of the main memory 15 via the memory controller 14.

なお、原画像は、メモリコントローラ14を介してメインメモリ15の原画メモリ17にも記憶される。   The original image is also stored in the original image memory 17 of the main memory 15 via the memory controller 14.

第1動き探索部11は、メモリコントローラ14を介して縮小画メモリ16から縮小画像を読出し、該読出した縮小画像を用いて動き探索を行う。以下、第1動き探索部11が行う動き探索を第1動き探索と呼称する。   The first motion search unit 11 reads a reduced image from the reduced image memory 16 via the memory controller 14, and performs a motion search using the read reduced image. Hereinafter, the motion search performed by the first motion search unit 11 is referred to as a first motion search.

第1動き探索部11は、第1動き探索の処理単位として予め定められたブロック(領域)毎に、第1動き探索を行う。第1動き探索部11は、参照フレーム画像を部分的に参照して第1動き探索を行う。本実施形態において、参照フレーム画像は、処理対象のブロックを含む原画像(処理対象フレーム画像)と異なる時刻の原画像を縮小した縮小画像とされる。第1動き探索では、縮小画像内の第1探索範囲の画像を参照して動きベクトルを探索する第1処理と、縮小画像内の第2探索範囲の画像を参照して動きベクトルを探索する第2処理とが行われる。ここで、動きベクトルとは、参照フレーム画像から選択されたブロックと処理対象のブロックとの相対的な位置関係(ずれ量及びずれ方向)を示すデータをいう。また、ブロックとは、画像を複数の領域に分割したときの各領域、或いは各領域の画像をいう。なお、第2探索範囲は、第1探索範囲より小さく第1探索範囲に含まれるものとする。第1探索範囲のサイズ及び位置と、第2探索範囲のサイズ及び位置は、処理対象のブロックのサイズ及び位置に応じて予め定められている。   The first motion search unit 11 performs a first motion search for each block (region) predetermined as a processing unit of the first motion search. The first motion search unit 11 performs a first motion search by partially referring to the reference frame image. In the present embodiment, the reference frame image is a reduced image obtained by reducing an original image at a different time from the original image including the processing target block (processing target frame image). In the first motion search, a first process for searching for a motion vector with reference to an image in the first search range in the reduced image, and a first process for searching for a motion vector with reference to an image in the second search range in the reduced image. Two processes are performed. Here, the motion vector refers to data indicating the relative positional relationship (deviation amount and deviation direction) between the block selected from the reference frame image and the block to be processed. A block refers to each area when an image is divided into a plurality of areas, or an image of each area. Note that the second search range is smaller than the first search range and is included in the first search range. The size and position of the first search range and the size and position of the second search range are determined in advance according to the size and position of the block to be processed.

また、第1動き探索では、左から右へ向かう方向へ処理対象のブロックが順次切替えられる。また、画像の右端のブロックまで処理が終了すると、1ライン下の行の左端のブロックに処理対象が切替えられる。また、第1動き探索の処理対象とされるブロックは、例えば符号化装置1に信号発生部を設け、信号発生部により所定の時間間隔で発生した切替信号により順次切替えられることができる。   In the first motion search, the blocks to be processed are sequentially switched in the direction from left to right. When the processing is completed up to the rightmost block of the image, the processing target is switched to the leftmost block in the line one line below. Further, the block to be processed in the first motion search can be sequentially switched by a switching signal generated at a predetermined time interval by the signal generating unit provided in the encoding device 1, for example.

図2に、第1動き探索部11の概略構成図の一例を示す。第1動き探索部11は、保持部36、制御部37、算出部38、原画バッファ39、及び参照バッファ40を備えている。   FIG. 2 shows an example of a schematic configuration diagram of the first motion search unit 11. The first motion search unit 11 includes a holding unit 36, a control unit 37, a calculation unit 38, an original image buffer 39, and a reference buffer 40.

制御部37は、信号発生部から所定の時間間隔で発生する切替信号を受信する等により切替えタイミングが到来すると、第1動き探索部11を構成する各構成要素を制御して、第1動き探索の処理対象が次のブロックに切替わるようにする。また、メモリコントローラ14に対して読出要求を出力する。これにより、メインメモリ15の縮小画メモリ16から、切替えにより次に第1動き探索の処理対象とされる原画像の縮小画像内のブロックの画像が読出されて原画バッファ39に蓄積される。また、メインメモリ15から、切替え以前に処理対象とされた原画像の縮小画像内の第1探索範囲に対応する画像が参照画像として参照バッファ40に蓄積される。   When the switching timing arrives, for example, by receiving a switching signal generated at a predetermined time interval from the signal generation unit, the control unit 37 controls each component constituting the first motion search unit 11 to perform the first motion search. The processing target is switched to the next block. In addition, a read request is output to the memory controller 14. As a result, the image of the block in the reduced image of the original image to be processed next for the first motion search is read out from the reduced image memory 16 of the main memory 15 and stored in the original image buffer 39. Further, an image corresponding to the first search range in the reduced image of the original image that has been processed before switching is stored in the reference buffer 40 as a reference image from the main memory 15.

具体的には、制御部37は、メモリコントローラ14に対する読出要求に読出対象の範囲、及び読出した画像の格納先アドレスを含めて出力し、原画バッファ39及び参照バッファ40の更新を行う。メモリコントローラ14は、読出要求により指定された読出対象の範囲の縮小画像を読出して、読出要求により指定された格納先アドレスに格納する。   Specifically, the control unit 37 outputs the read request to the memory controller 14 including the range to be read and the storage destination address of the read image, and updates the original image buffer 39 and the reference buffer 40. The memory controller 14 reads the reduced image in the range to be read designated by the read request and stores it in the storage destination address designated by the read request.

原画バッファ39及び参照バッファ40は、例えば、FIFOメモリ(先入れ先出し型メモリ)としてもよい。この場合、不要となったブロックの記憶領域が未使用領域とされ、メインメモリ15から読出された画像を記憶する記憶先となり得る。   The original image buffer 39 and the reference buffer 40 may be, for example, a FIFO memory (a first-in first-out memory). In this case, the storage area of the block that has become unnecessary is set as an unused area and can be a storage destination for storing an image read from the main memory 15.

さらに、制御部37は、算出部38での評価値算出対象となり、保持部36で保持される対象となる動きベクトルを次々に生成して、算出部38及び保持部36へと送る。   Further, the control unit 37 sequentially generates motion vectors to be evaluated by the calculation unit 38 and held by the holding unit 36, and sends the motion vectors to the calculation unit 38 and the holding unit 36.

算出部38は、原画バッファ39に記憶されている処理対象のブロックの画像と、参照バッファ40に記憶されている処理対象とは異なる時刻の参照フレーム画像内の第1探索範囲から、制御部37から送られてきた動きベクトルを元に選択されたブロック(以下、候補ブロックという)とを比較する。そして、算出部38は、各候補ブロックと、処理対象のブロックとの類似度の評価値として、SAD(差分絶対値和:Sum of Absolute Differences)を算出する。   The calculation unit 38 controls the control unit 37 from the image of the block to be processed stored in the original image buffer 39 and the first search range in the reference frame image at a time different from the processing target stored in the reference buffer 40. Is compared with a block selected based on the motion vector sent from (hereinafter referred to as a candidate block). Then, the calculation unit 38 calculates SAD (Sum of Absolute Differences) as an evaluation value of the similarity between each candidate block and the block to be processed.

なお、第2探索範囲は第1探索範囲に含まれるため、算出部38は、第2探索範囲に含まれる各候補ブロックについてSADを別途算出しなくてもよい。また、ここでは、算出部38がSADを算出する例について説明したが、SSD(差分二乗和:Sum of Squared Differences)、SATD(Sum of Absolute Transformed Differences)等、他の評価値を算出するようにしてもよい。また、動きベクトルの影響を考慮した評価値を算出するようにしても良い。また、他の周知の技術を用いて良い。   Since the second search range is included in the first search range, the calculation unit 38 does not have to separately calculate SAD for each candidate block included in the second search range. Although the example in which the calculation unit 38 calculates SAD has been described here, other evaluation values such as SSD (Sum of Squared Differences) and SATD (Sum of Absolute Transformed Differences) are calculated. May be. Further, an evaluation value considering the influence of the motion vector may be calculated. Other known techniques may be used.

保持部36は、各ブロックで最初に制御部37から送られてくる動きベクトルと、この動きベクトルを元に算出部38で算出された評価値とを無条件で第1処理結果候補として保持する。以降は、算出部38から評価値が送られてくるごとに、保持されている第一処理結果候補の評価値と比較する。比較の結果、新たに送られてきた評価値が保持されている評価値よりも良かった場合は、その評価値と、その評価値に対応する動きベクトルとで第一処理結果候補を更新する。この処理を制御部37から送られる全てのベクトルと、そのベクトルについて算出部38で算出された評価値について繰り返すことで、最終的には、このブロックの動きベクトル候補の中で最良の評価値を示す動きベクトルと対応する評価値とが第1処理結果候補が保持されるので、該保持されている第1処理結果候補がこのブロックにおける第1動き探索の第1処理の動きベクトル及び評価値として選択される。   The holding unit 36 unconditionally holds the motion vector sent from the control unit 37 first in each block and the evaluation value calculated by the calculation unit 38 based on this motion vector as the first processing result candidate. . Thereafter, each time an evaluation value is sent from the calculation unit 38, it is compared with the evaluation value of the held first processing result candidate. As a result of the comparison, if the newly sent evaluation value is better than the stored evaluation value, the first processing result candidate is updated with the evaluation value and the motion vector corresponding to the evaluation value. This process is repeated for all the vectors sent from the control unit 37 and the evaluation values calculated by the calculation unit 38 for the vectors, so that the best evaluation value among the motion vector candidates of this block is finally obtained. Since the first processing result candidate is held with the motion vector indicated and the corresponding evaluation value, the held first processing result candidate is used as the motion vector and evaluation value of the first processing of the first motion search in this block. Selected.

また、保持部36は、第2処理においては、制御部37から送られてくる動きベクトルのうち第2探索範囲に属するものと、その動きベクトルについて算出部38で算出される評価値とについてのみ、上記保持部36の第1処理の動作説明において述べた「最初の候補の保持」と、「より良い評価値を示した値での更新」とを行う。第2処理においても、保持され更新される候補(第2処理結果候補)は、第1処理結果候補同様に動きベクトルと評価値との組とされる。最終的には、このブロックの第2探索範囲内の動きベクトル候補の中で最良の評価値を示す動きベクトルと対応する評価値とが第2処理結果候補として保持されるので、該保持されている第2処理結果候補がこのブロックにおける第1動き探索の第2処理の動きベクトル及び評価値として選択される。   Further, in the second process, the holding unit 36 includes only the motion vectors sent from the control unit 37 that belong to the second search range and the evaluation values calculated by the calculation unit 38 for the motion vectors. Then, “holding the first candidate” and “updating with a value indicating a better evaluation value” described in the explanation of the operation of the first process of the holding unit 36 are performed. Also in the second process, a candidate to be held and updated (second process result candidate) is a set of a motion vector and an evaluation value, like the first process result candidate. Eventually, the motion vector indicating the best evaluation value among the motion vector candidates in the second search range of this block and the corresponding evaluation value are held as the second processing result candidates. The second processing result candidate is selected as the motion vector and evaluation value of the second processing of the first motion search in this block.

以下では、第1処理で探索された動きベクトルを第1動きベクトルと呼称し、第2処理で探索された動きベクトルを第2動きベクトルと呼称する。また、第1動きベクトルに対応するSADを第1評価値と呼称し、第2動きベクトルに対応するSADを第2評価値と呼称する。第1動きベクトル、第1評価値、第2動きベクトル、及び第2評価値の各々は、判定部12に出力される。   Hereinafter, the motion vector searched in the first process is referred to as a first motion vector, and the motion vector searched in the second process is referred to as a second motion vector. In addition, the SAD corresponding to the first motion vector is referred to as a first evaluation value, and the SAD corresponding to the second motion vector is referred to as a second evaluation value. Each of the first motion vector, the first evaluation value, the second motion vector, and the second evaluation value is output to the determination unit 12.

なお、判定部12に出力される第1評価値及び第2評価値は、SADではなくSSD、SATD、動きベクトルの影響を考量した評価値、その他周知の技術によるものなど、符号化効率を示すと考えられる値であれば特に限定されない。   Note that the first evaluation value and the second evaluation value output to the determination unit 12 indicate coding efficiency such as SSD, SATD, an evaluation value that considers the influence of a motion vector, and other well-known techniques, not SAD. If it is a value considered that, it will not specifically limit.

このように、第1動き探索部11では、第1動き探索に縮小画像を用いるため、演算量が大幅に削減され、動き探索が効率化する。   As described above, since the first motion search unit 11 uses the reduced image for the first motion search, the amount of calculation is greatly reduced, and the motion search becomes efficient.

なお、本実施形態では、第1動き探索において、処理対象のブロックが含まれる処理対象フレーム画像とは異なる時刻のフレーム画像の縮小画像が参照フレーム画像として用いられたが、これに限定されない。例えば、第1動き探索において、処理対象のブロックが含まれる処理対象フレーム画像とは異なる時刻のフレーム画像の復号画像の縮小画像を、参照フレーム画像として用いてもよい。復号画像は、後述する主符号化処理部13において生成される。   In the present embodiment, in the first motion search, a reduced image of a frame image at a time different from that of the processing target frame image including the processing target block is used as the reference frame image. However, the present invention is not limited to this. For example, in the first motion search, a reduced image of a decoded image of a frame image at a time different from that of the processing target frame image including the processing target block may be used as the reference frame image. The decoded image is generated in the main encoding processing unit 13 described later.

第1動き探索部11で探索された第1動きベクトル及び第2動きベクトルの何れかが後述する主符号化処理部13において行われる第2動き探索に用いられるが、どちらの動きベクトルを用いるかは、判定部12の判定結果に依存する。   Either the first motion vector or the second motion vector searched by the first motion search unit 11 is used for the second motion search performed in the main encoding processing unit 13 to be described later. Which motion vector is used? Depends on the determination result of the determination unit 12.

判定部12は、1つのフレーム画像に含まれる第2動き探索の処理単位となる複数のブロックの各々が、第1動きベクトルを用いて第2動き探索を行うブロック(以下、特定ブロックという)と、第2動きベクトルを用いて第2動き探索を行うブロック(以下、非特定ブロックという)の何れであるかを判定する。判定方法の具体例は後述する。判定部12は、判定結果として、特定ブロックと判定したブロックについては、第1動きベクトルを主符号化処理部13に出力し、非特定ブロックと判定したブロックについては、第2動きベクトルを主符号化処理部13に出力する。以下、第1動きベクトル及び第2動きベクトルのうち、判定部12から判定結果として出力された動きベクトルを判定動きベクトルと呼称する。   The determination unit 12 includes a block (hereinafter, referred to as a specific block) in which each of a plurality of blocks serving as a second motion search processing unit included in one frame image performs a second motion search using the first motion vector. Then, it is determined which of the blocks (hereinafter, referred to as non-specific blocks) is subjected to the second motion search using the second motion vector. A specific example of the determination method will be described later. As a determination result, the determination unit 12 outputs the first motion vector to the main encoding processing unit 13 for the block determined as the specific block, and the second motion vector as the main code for the block determined as the non-specific block. To the processing unit 13. Hereinafter, of the first motion vector and the second motion vector, the motion vector output as a determination result from the determination unit 12 is referred to as a determination motion vector.

主符号化処理部13は、予測誤差画像生成部20、直交変換・量子化部21、逆直交変換・逆量子化部22、復号画像生成部23、フィルタ部24、第2動き探索部25、及びフレーム間予測部26を備えている。更にまた、主符号化処理部13は、参照画像メモリ回路27、フレーム内予測モード決定部28、フレーム内予測部29、切替部30、及びエントロピー符号化部31も備えている。   The main encoding processing unit 13 includes a prediction error image generation unit 20, an orthogonal transform / quantization unit 21, an inverse orthogonal transform / inverse quantization unit 22, a decoded image generation unit 23, a filter unit 24, a second motion search unit 25, And an inter-frame prediction unit 26. The main encoding processing unit 13 further includes a reference image memory circuit 27, an intra-frame prediction mode determination unit 28, an intra-frame prediction unit 29, a switching unit 30, and an entropy encoding unit 31.

予測誤差画像生成部20には、原画像が符号化対象として供給される。   The prediction error image generation unit 20 is supplied with the original image as an encoding target.

また、予測誤差画像生成部20には、フレーム間予測部26或いはフレーム内予測部29からから予測画像が供給される。予測画像については後述する。予測誤差画像生成部20は、符号化対象の画像と、予測画像との差分を示す差分情報を演算し、この差分情報を予測誤差画像の情報として直交変換・量子化部21に供給する。このように、予測誤差画像生成部20において予測誤差画像が生成される。   The prediction error image generation unit 20 is supplied with a prediction image from the inter-frame prediction unit 26 or the intra-frame prediction unit 29. The predicted image will be described later. The prediction error image generation unit 20 calculates difference information indicating the difference between the image to be encoded and the prediction image, and supplies this difference information to the orthogonal transform / quantization unit 21 as prediction error image information. As described above, the prediction error image generation unit 20 generates a prediction error image.

直交変換・量子化部21は、供給された予測誤差画像の情報に変換処理を施し、予測誤差画像を水平及び垂直方向の周波数成分に分離する。更に、直交変換・量子化部21は、変換処理で得られた各周波数成分の情報を量子化する。直交変換・量子化部21は、該情報を量子化することにより予測誤差画像の符号量を低減する。直交変換・量子化部21は、量子化後の情報を逆直交変換・逆量子化部22及びエントロピー符号化部31に供給する。   The orthogonal transform / quantization unit 21 performs conversion processing on the supplied prediction error image information, and separates the prediction error image into frequency components in the horizontal and vertical directions. Further, the orthogonal transform / quantization unit 21 quantizes information on each frequency component obtained by the transform process. The orthogonal transform / quantization unit 21 reduces the code amount of the prediction error image by quantizing the information. The orthogonal transform / quantization unit 21 supplies the quantized information to the inverse orthogonal transform / inverse quantization unit 22 and the entropy coding unit 31.

逆直交変換・逆量子化部22は、直交変換・量子化部21からから供給された情報を逆量子化した後、逆変換処理する。ここで、逆変換処理とは、直交変換・量子化部21で行われる変換処理と逆方向に変換する処理をいう。   The inverse orthogonal transform / inverse quantization unit 22 performs inverse transform processing after dequantizing the information supplied from the orthogonal transform / quantization unit 21. Here, the inverse transform process refers to a process for transforming in the opposite direction to the transform process performed by the orthogonal transform / quantization unit 21.

逆直交変換・逆量子化部22によって復号処理が行われることにより、符号化前の予測誤差画像と対応する誤差画像の情報が得られる。該情報を再生予測誤差画像と呼称する。   By performing decoding processing by the inverse orthogonal transform / inverse quantization unit 22, information of an error image corresponding to a prediction error image before encoding is obtained. This information is called a reproduction prediction error image.

復号画像生成部23には、逆直交変換・逆量子化部22で生成された再生予測誤差画像が供給される。また、復号画像生成部23には、フレーム間予測部26或いはフレーム内予測部29から予測画像が供給される。復号画像生成部23は、再生予測誤差画像と予測画像とを加算することにより、符号化対象の画像を復号した画像(復号画像)を生成する。生成された復号画像は、フィルタ部24に出力される他、フレーム内予測符号化(後述)においてはフレーム内予測モード決定部28及びフレーム内予測部29にも出力される。   The decoded image generation unit 23 is supplied with the reproduction prediction error image generated by the inverse orthogonal transform / inverse quantization unit 22. The decoded image generation unit 23 is supplied with a predicted image from the inter-frame prediction unit 26 or the intra-frame prediction unit 29. The decoded image generation unit 23 generates an image (decoded image) obtained by decoding the image to be encoded by adding the reproduction prediction error image and the predicted image. In addition to being output to the filter unit 24, the generated decoded image is also output to the intra-frame prediction mode determination unit 28 and the intra-frame prediction unit 29 in intra-frame prediction encoding (described later).

フィルタ部24は、復号画像生成部23で生成された復号画像にフィルタ処理を施し、メモリコントローラ14を介してメインメモリ15のフレームメモリ18に格納する。符号化処理は、ブロック単位で処理されるため、ブロックの境界部分にノイズが生じることがある。フィルタ部24は、該符号化により生じたノイズを低減する。   The filter unit 24 performs a filtering process on the decoded image generated by the decoded image generation unit 23 and stores it in the frame memory 18 of the main memory 15 via the memory controller 14. Since the encoding process is performed in units of blocks, noise may occur at the boundary between blocks. The filter unit 24 reduces noise generated by the encoding.

フレームメモリ18は、フィルタ部24から供給された復号画像の各々が蓄積されるメモリである。フレームメモリ18に蓄積された復号画像は、後述する第2動き探索部25及びフレーム間予測部26において、他のフレーム画像を符号化するときの動きベクトル検出や動き補償等で参照される。復号画像を参照する際には、後述する参照画像メモリ回路27を介して参照する場合と、フレームメモリ18から直接読出して参照する場合とがある。詳細は後述する。   The frame memory 18 is a memory in which each decoded image supplied from the filter unit 24 is accumulated. The decoded image stored in the frame memory 18 is referred to by a second motion search unit 25 and an inter-frame prediction unit 26, which will be described later, for motion vector detection and motion compensation when encoding other frame images. When referring to the decoded image, there are a case where it is referred to via a reference image memory circuit 27 to be described later, and a case where it is directly read from the frame memory 18 for reference. Details will be described later.

フレーム内予測モード決定部28及びフレーム内予測部29は、フレーム内予測符号化方法で符号化を行うときの予測画像をブロック単位で生成するための構成要素である。ここで、フレーム内予測符号化方法は、他のフレーム画像を用いず、符号化対象となるフレーム画像の情報のみで画像を符号化・復号する方法である。具体的には、1枚のフレーム画像を複数のブロックに分割したときの符号化対象のブロックの周辺のブロックの画像から、所定方向に沿って近傍の画像の動きを推定して、符号化対象のブロックの画像を予測し、符号化対象のブロックの画像との差分を符号化する。   The intra-frame prediction mode determination unit 28 and the intra-frame prediction unit 29 are components for generating a predicted image for each block when encoding is performed using the intra-frame prediction encoding method. Here, the intra-frame predictive encoding method is a method of encoding / decoding an image using only information of a frame image to be encoded without using another frame image. Specifically, the motion of a neighboring image along a predetermined direction is estimated from an image of a block around the block to be encoded when one frame image is divided into a plurality of blocks, and the object to be encoded The block image is predicted, and the difference from the encoding target block image is encoded.

フレーム内予測モード決定部28は、符号化対象の原画像に応じて、フレーム内予測符号化方法で符号化を行うときの予測モードを決定する。   The intra-frame prediction mode determination unit 28 determines a prediction mode when encoding is performed by the intra-frame prediction encoding method according to the original image to be encoded.

フレーム内予測部29は、フレーム内予測モード決定部28で決定された予測モードで、フレーム内予測モード決定部28を介して入力された原画像に基づき、符号化対象のブロックの画像を予測して、該予測した予測画像を出力する。   The intra-frame prediction unit 29 predicts the image of the block to be encoded based on the original image input via the intra-frame prediction mode determination unit 28 in the prediction mode determined by the intra-frame prediction mode determination unit 28. Then, the predicted image is output.

第2動き探索部25、フレーム間予測部26、及び参照画像メモリ回路27は、二段階の動き探索処理を含むフレーム間予測符号化処理において、二段階目の動き探索(以下、第2動き探索という)を行うための構成要素である。なお、第2動き探索では、前述した復号画像が参照フレーム画像とされ、該参照フレーム画像が部分的に参照されて動き探索が行われる。復号画像は、縮小せず等倍で用いられる。   The second motion search unit 25, the inter-frame prediction unit 26, and the reference image memory circuit 27 perform the second-stage motion search (hereinafter referred to as the second motion search) in the inter-frame prediction encoding process including the two-stage motion search process. For example). In the second motion search, the above-described decoded image is used as a reference frame image, and the reference frame image is partially referenced to perform a motion search. The decoded image is used at the same magnification without being reduced.

また、第2動き探索でも、第1動き探索と同様に、処理対象フレーム内で左から右へ向かう方向へ処理対象のブロックが順次切替えられる。また、画像の右端のブロックまで処理が終了すると、1ライン下の行の左端のブロックに処理対象が切替えられる。また、第2動き探索の処理対象とされるブロックは、例えば第2動き探索部25に信号発生部を設け、該信号発生部により所定の時間間隔で発生した切替信号により順次切替えられるようにしてもよい。   Also, in the second motion search, similarly to the first motion search, the processing target blocks are sequentially switched in the direction from left to right in the processing target frame. When the processing is completed up to the rightmost block of the image, the processing target is switched to the leftmost block in the line one line below. In addition, for example, the second motion search processing block is provided with a signal generation unit in the second motion search unit 25 and is sequentially switched by a switching signal generated at a predetermined time interval by the signal generation unit. Also good.

なお、第1動き探索の処理単位のブロックを元の倍率に戻したときのサイズと、第2動き探索の処理単位のブロックのサイズは、同じであってもよいし、異なっていてもよい。以下では、第1動き探索の処理単位のブロックの元の倍率に戻したときのサイズと、第2動き探索の処理単位のブロックのサイズとが同じである場合を例に挙げて説明する。   Note that the size when the block of the first motion search processing unit is returned to the original magnification and the size of the block of the second motion search processing unit may be the same or different. Hereinafter, a case where the size of the block of the first motion search processing unit returned to the original magnification and the size of the block of the second motion search processing unit are the same will be described as an example.

参照画像メモリ回路27は、図3に示すように、制御部41及び参照画像メモリ42を備えている。参照画像メモリ42は、例えば、SRAM(Static Random Access Memory)等のメモリモジュールとすることができ、復号画像が記憶されるフレームメモリ18から部分的に読出された画像が参照画像として記憶される。参照画像メモリ42は、制御部41に接続されている。制御部41は、参照画像メモリ42に対する読み書き(メモリ制御)を行う。   As shown in FIG. 3, the reference image memory circuit 27 includes a control unit 41 and a reference image memory 42. The reference image memory 42 may be a memory module such as an SRAM (Static Random Access Memory), for example, and an image partially read from the frame memory 18 in which the decoded image is stored is stored as a reference image. The reference image memory 42 is connected to the control unit 41. The control unit 41 performs reading / writing (memory control) with respect to the reference image memory 42.

参照画像メモリ42には、第2動き探索において、処理対象のブロックを非特定ブロックとしたときに探索範囲として設定される可能性がある範囲(以下、設定可能範囲という)の画像が参照画像として記憶される。設定可能範囲は、第1動き探索で用いられた第2探索範囲を含み、該第2探索範囲よりも若干大きなサイズとすることもできる。例えば、第2探索範囲より数画素分外側の範囲が設定可能範囲としてもよい。ただし、設定可能範囲は第1探索範囲よりも小さい。   In the reference image memory 42, an image in a range (hereinafter referred to as a settable range) that may be set as a search range when the processing target block is a non-specific block in the second motion search is used as a reference image. Remembered. The settable range includes the second search range used in the first motion search, and may be a size slightly larger than the second search range. For example, a range that is several pixels outside the second search range may be set as the settable range. However, the settable range is smaller than the first search range.

参照画像メモリ回路27の制御部41は、切替えタイミングが到来すると、少なくとも切替直後に第2動き探索の処理対象とされるブロックに対応する設定可能範囲の参照画像が参照画像メモリ42に記憶された状態となるように更新制御を行うものとする。制御部41は、参照画像メモリ42の更新制御として、メモリコントローラ14に対して読出要求を出力して、必要な範囲の参照画像を取得し、参照画像メモリ42に書込む(記憶する)と共に、参照画像メモリ42から不要な範囲の参照画像を消去する制御を行う。   When the switching timing arrives, the control unit 41 of the reference image memory circuit 27 stores in the reference image memory 42 a reference image in a settable range corresponding to a block to be processed for the second motion search at least immediately after the switching. It is assumed that update control is performed so as to be in a state. As an update control of the reference image memory 42, the control unit 41 outputs a read request to the memory controller 14, acquires a reference image in a necessary range, writes (stores) it in the reference image memory 42, and Control for deleting an unnecessary range of reference images from the reference image memory 42 is performed.

ここで、参照画像メモリ42の更新制御の一例について、図5及び図6を参照して説明する。   Here, an example of update control of the reference image memory 42 will be described with reference to FIGS. 5 and 6.

図5は、処理対象のブロックB1についての第2動き探索の処理開始直前の参照画像メモリ42の記憶状態を模式的に示す図である。また、図6は、ブロックB1の次に処理対象とされるブロックB2についての第2動き探索の処理開始直前の参照画像メモリ42の記憶状態を模式的に示す図である。   FIG. 5 is a diagram schematically showing the storage state of the reference image memory 42 immediately before the start of the second motion search process for the block B1 to be processed. FIG. 6 is a diagram schematically showing the storage state of the reference image memory 42 immediately before the start of the second motion search process for the block B2 to be processed next to the block B1.

図5において、領域80は、処理対象ブロックB1と同位置のブロックを示す。領域81は、ブロックB1の設定可能範囲を示す。領域82は、参照画像メモリ42に記憶されている領域である。領域82は、ブロックB1より前に処理対象とされた各ブロックの設定可能範囲を合成した合成範囲のうち、ブロックB1及びブロックB1より後に処理対象とされるブロックの設定可能範囲の何れかと重複する領域でもある。   In FIG. 5, a region 80 indicates a block at the same position as the processing target block B1. An area 81 indicates a settable range of the block B1. The area 82 is an area stored in the reference image memory 42. The area 82 overlaps any one of the settable ranges of the blocks to be processed after the block B1 and the block B1 among the combined ranges obtained by combining the settable ranges of the blocks to be processed before the block B1. It is also an area.

領域83は、処理対象ブロックB1の処理が終了して、次のブロックB2の処理を開始する直前に参照画像メモリ42に追加される領域である。領域84は、領域83の追加と同時に参照画像メモリ42から消去される領域である。   The area 83 is an area added to the reference image memory 42 immediately after the processing of the processing target block B1 is finished and immediately before the processing of the next block B2 is started. The area 84 is an area that is deleted from the reference image memory 42 simultaneously with the addition of the area 83.

次に、図6において、領域85は、処理対象ブロックB2と同位置のブロックを示す。領域86は、ブロックB2の設定可能範囲を示す。領域87は、参照画像メモリ42に記憶されている領域である。領域88は、ブロックB2より前に処理対象とされた各ブロックの設定可能範囲を合成した合成範囲のうち、ブロックB2及びブロックB2より後に処理対象とされるブロックの設定可能範囲の何れかと重複する。   Next, in FIG. 6, a region 85 indicates a block at the same position as the processing target block B2. An area 86 indicates a settable range of the block B2. The area 87 is an area stored in the reference image memory 42. The area 88 overlaps any one of the settable ranges of the blocks to be processed after the block B2 and the block B2 out of the combined range obtained by combining the settable ranges of the blocks to be processed before the block B2. .

領域88は、処理対象ブロックB2の処理が終了して、次のブロックB3の処理を開始する直前に参照画像メモリ42に追加される領域である。領域89は、領域88の追加と同時に参照画像メモリ42から消去される領域である。   The area 88 is an area added to the reference image memory 42 immediately after the processing of the processing target block B2 is completed and immediately before the processing of the next block B3 is started. The area 89 is an area that is deleted from the reference image memory 42 at the same time that the area 88 is added.

図5及び図6から明らかなように、第2動き探索の処理対象のブロックが次のブロックに切替えられる際に、該切替以降に処理対象とされる各ブロックの設定可能範囲の何れにも含まれない参照画像が参照画像メモリ42から消去される。また、次のブロックの設定可能範囲には含まれるものの、参照画像メモリ42に未だ記憶されていない参照画像がフレームメモリ18から読出されて参照画像メモリ42に記憶される。なお、例えば、消去すべき参照画像が記憶されている領域に、上述した新たに追加する参照画像を上書きすることで、参照画像を消去することができる。   As is apparent from FIGS. 5 and 6, when the block to be processed in the second motion search is switched to the next block, it is included in any of the settable ranges of each block to be processed after the switching. Reference images that are not stored are deleted from the reference image memory 42. A reference image that is included in the settable range of the next block but is not yet stored in the reference image memory 42 is read from the frame memory 18 and stored in the reference image memory 42. For example, the reference image can be erased by overwriting the newly added reference image in the area where the reference image to be erased is stored.

上記図5及び図6を参照して説明した更新制御方法では、あるブロックの探索範囲として使用された参照画像領域が、何れのブロックの探索範囲でも使用されなくなるまで参照画像メモリ42内に残る構成とされる。従って、フレームメモリ18に対するアクセス量(読出データ量)を抑制できる。   In the update control method described with reference to FIGS. 5 and 6 above, the reference image area used as the search range of a certain block remains in the reference image memory 42 until it is not used in the search range of any block. It is said. Therefore, the access amount (read data amount) to the frame memory 18 can be suppressed.

次に、参照画像メモリ42への更新制御の他の例について、図7及び図8を参照して説明する。   Next, another example of update control to the reference image memory 42 will be described with reference to FIGS.

図7は、処理対象のブロックB1についての第2動き探索の処理開始直前の参照画像メモリ42の記憶状態を模式的に示す図である。また、図8は、ブロックB1の次に処理対象とされるブロックB2についての第2動き探索の処理開始直前の参照画像メモリ42の記憶状態を模式的に示す図である。   FIG. 7 is a diagram schematically showing the storage state of the reference image memory 42 immediately before the start of the second motion search process for the block B1 to be processed. FIG. 8 is a diagram schematically showing the storage state of the reference image memory 42 immediately before the start of the second motion search process for the block B2 to be processed next to the block B1.

図7において、領域90は、処理対象ブロックB1と同位置のブロックを示す。領域91は、ブロックB1の設定可能範囲を示す。領域92は、参照画像メモリ42に記憶されている領域である。領域92は、ブロックB1の設定可能範囲に等しい。   In FIG. 7, an area 90 indicates a block at the same position as the processing target block B1. An area 91 indicates a settable range of the block B1. The area 92 is an area stored in the reference image memory 42. The area 92 is equal to the settable range of the block B1.

領域93は、処理対象ブロックB1の処理が終了して、次のブロックB2の処理を開始する直前に参照画像メモリ42に追加される領域である。領域94は、領域93の追加と同時に参照画像メモリ42から消去される領域である。   The area 93 is an area added to the reference image memory 42 immediately after the processing of the processing target block B1 is finished and immediately before the processing of the next block B2 is started. The area 94 is an area that is deleted from the reference image memory 42 at the same time as the addition of the area 93.

次に、図6において、領域95は、処理対象ブロックB2と同位置のブロックを示す。領域96は、ブロックB2の設定可能範囲を示す。領域97は、参照画像メモリ42に記憶されている領域である。領域96は、ブロックB2の設定可能範囲に等しい。   Next, in FIG. 6, an area 95 indicates a block at the same position as the processing target block B2. An area 96 indicates a settable range of the block B2. An area 97 is an area stored in the reference image memory 42. The area 96 is equal to the settable range of the block B2.

領域98は、処理対象ブロックB2の処理が終了して、次のブロックB3の処理を開始する直前に参照画像メモリ42に追加される領域である。領域99は、領域98の追加と同時に参照画像メモリ42から消去される領域である。   The area 98 is an area added to the reference image memory 42 immediately after the processing of the processing target block B2 is finished and immediately before the processing of the next block B3 is started. The area 99 is an area that is deleted from the reference image memory 42 simultaneously with the addition of the area 98.

図7及び図8から明らかなように、第2動き探索の処理対象のブロックが次のブロックに切替えられる際に、該次のブロックの設定可能範囲が参照画像メモリ42から消去される。また、該次のブロックの設定可能範囲に含まれるものの、参照画像メモリ42に未だ記憶されていない参照画像がフレームメモリ18から読出されて参照画像メモリ42に記憶される。なお、例えば、消去すべき参照画像が記憶されている領域に、上述した新たに追加する参照画像を上書きすることで、参照画像を消去することができる。   As is apparent from FIGS. 7 and 8, when the block to be processed in the second motion search is switched to the next block, the settable range of the next block is deleted from the reference image memory 42. A reference image that is included in the settable range of the next block but is not yet stored in the reference image memory 42 is read from the frame memory 18 and stored in the reference image memory 42. For example, the reference image can be erased by overwriting the newly added reference image in the area where the reference image to be erased is stored.

上記図7及び図8を参照して説明した更新制御方法では、処理対象のブロックを切替えるとき(参照画像メモリ42を更新するとき)に、次に処理対象となるブロックの設定可能範囲に含まれる範囲の参照画像が、参照画像メモリ42内に残される。次に処理対象となるブロックの設定可能範囲に含まれない参照画像は削除されるため、参照画像メモリ42の容量抑制を図ることができる。   In the update control method described with reference to FIGS. 7 and 8 above, when the block to be processed is switched (when the reference image memory 42 is updated), it is included in the settable range of the block to be processed next. A range of reference images is left in the reference image memory 42. Since the reference image not included in the settable range of the block to be processed next is deleted, the capacity of the reference image memory 42 can be reduced.

第2動き探索部25は、第2動き探索の処理単位となるブロック毎に、判定部12から入力された判定動きベクトルに応じた探索範囲で、第2動き探索を行う。ただし、判定動きベクトルは、縮小画像から探索された動きベクトルであるため、元の倍率に戻した状態で用いられる。例えば、水平方向及び垂直方向それぞれで1/d倍された縮小画像から第1動き探索が行われた場合には、判定動きベクトルが示す水平方向及び垂直方向の各値をd倍して用いる。   The second motion search unit 25 performs a second motion search within a search range corresponding to the determination motion vector input from the determination unit 12 for each block that is a processing unit of the second motion search. However, since the determination motion vector is a motion vector searched from the reduced image, it is used in a state where the original magnification is restored. For example, when the first motion search is performed from a reduced image multiplied by 1 / d in each of the horizontal direction and the vertical direction, each value in the horizontal direction and the vertical direction indicated by the determination motion vector is multiplied by d and used.

第2動き探索では、前述したように参照画像として復号画像が部分的に用いられる。本実施形態では、第2動き探索部25は、参照すべき参照画像が参照画像メモリ42に記憶されている場合には、該参照画像メモリ42から読出された参照画像を参照する。また、第2動き探索部25は、参照すべき参照画像が参照画像メモリ42に記憶されていない場合には、参照画像メモリ42を介さずにフレームメモリ18から直接読出された参照画像を参照する。   In the second motion search, the decoded image is partially used as the reference image as described above. In the present embodiment, when the reference image to be referred to is stored in the reference image memory 42, the second motion search unit 25 refers to the reference image read from the reference image memory 42. Further, when the reference image to be referred to is not stored in the reference image memory 42, the second motion search unit 25 refers to the reference image directly read from the frame memory 18 without using the reference image memory 42. .

図4に、第2動き探索部25の概略構成図の一例を示す。第2動き探索部25は、保持部44、制御部45、算出部46、切替部47、原画バッファ48、及び参照バッファ49を備えている。   FIG. 4 shows an example of a schematic configuration diagram of the second motion search unit 25. The second motion search unit 25 includes a holding unit 44, a control unit 45, a calculation unit 46, a switching unit 47, an original image buffer 48, and a reference buffer 49.

制御部45は、信号発生部から所定の時間間隔で発生する切替信号を受信する等により切替えタイミングが到来すると、第2動き探索部25を構成する各構成要素を制御して、第2動き探索の処理対象が次のブロックに切替わるようにする。   When the switching timing arrives, for example, by receiving a switching signal generated at a predetermined time interval from the signal generation unit, the control unit 45 controls each component constituting the second motion search unit 25 to control the second motion search. The processing target is switched to the next block.

また、上記切替タイミングが到来すると、制御部45は、メモリコントローラ14に対して、原画像内の処理対象のブロックの画像を要求する読出要求を出力する。該読出要求には、読出す範囲と、読出した画像の格納先アドレスとが指定されている。これにより、原画メモリ17から処理対象のブロックの画像が読出され原画バッファ48に格納される。   Further, when the switching timing comes, the control unit 45 outputs a read request for requesting an image of a block to be processed in the original image to the memory controller 14. The read request specifies a read range and a storage address of the read image. As a result, the image of the block to be processed is read from the original image memory 17 and stored in the original image buffer 48.

また、上記切替タイミングが到来すると、制御部45は、判定部12から入力された判定動きベクトルに基づいて設定される探索範囲の参照画像の読出要求を出力する。該読出要求には、読出す範囲と、読出した画像の格納先アドレスとが指定されている。なお、本実施形態では、制御部45は、処理対象のブロックの位置及びサイズに応じて、判定動きベクトルが指す点を含む所定のサイズの範囲を第2動き探索の探索範囲として設定するように構成されている。例えば、判定動きベクトルの中心から、水平方向に±X画素、垂直方向に±Y画素を含むサイズの範囲を探索範囲とすることができる。   Further, when the switching timing comes, the control unit 45 outputs a request for reading a reference image in the search range set based on the determination motion vector input from the determination unit 12. The read request specifies a read range and a storage address of the read image. In the present embodiment, the control unit 45 sets a predetermined size range including the point indicated by the determination motion vector as the search range of the second motion search according to the position and size of the block to be processed. It is configured. For example, a range of a size including ± X pixels in the horizontal direction and ± Y pixels in the vertical direction from the center of the determination motion vector can be set as the search range.

なお、処理対象のブロックの位置及びサイズは、制御部45が事前に把握しているため、結局、判定部12から出力される判定動きベクトルに応じて第2動き探索における探索範囲が定まることとなる。なお、第2動き探索における探索範囲は、第1動き探索で用いられた第2探索範囲を縮小前の倍率に戻したときの範囲よりも小さな範囲とされる。   The position and size of the block to be processed are known in advance by the control unit 45, so that the search range in the second motion search is determined according to the determination motion vector output from the determination unit 12. Become. Note that the search range in the second motion search is a range smaller than the range when the second search range used in the first motion search is returned to the magnification before reduction.

参照画像メモリ回路27の制御部41は、制御部45から出力された探索範囲の読出要求を取得し、該取得した読出要求に応じて読出制御を行う。具体的には、制御部41は、読出要求された探索範囲の参照画像うち、参照画像メモリ42に記憶されている参照画像については、参照画像メモリ42から参照画像を読出して参照バッファ49に格納する。また、制御部41は、読出要求された探索範囲の参照画像のうち参照画像メモリ42に記憶されていない参照画像については、メモリコントローラ14に対して読出要求を出力し、フレームメモリ18から参照画像を直接読出して参照バッファ49に格納させる。これにより、参照バッファ49に、探索範囲の参照画像が格納される。   The control unit 41 of the reference image memory circuit 27 acquires a search range read request output from the control unit 45 and performs read control according to the acquired read request. Specifically, for the reference image stored in the reference image memory 42 among the reference images in the search range requested to be read, the control unit 41 reads the reference image from the reference image memory 42 and stores it in the reference buffer 49. To do. Further, the control unit 41 outputs a read request to the memory controller 14 for reference images that are not stored in the reference image memory 42 among the reference images in the search range requested to be read, and the reference image is output from the frame memory 18. Are directly read out and stored in the reference buffer 49. As a result, the reference image of the search range is stored in the reference buffer 49.

なお、参照画像メモリ42には、設定可能範囲の参照画像が記憶されているため、判定動きベクトルが第2動きベクトルである場合には、判定動きベクトルに基づいて設定された探索範囲に含まれる参照画像は、全て参照画像メモリ42に記憶されている。従って、フレームメモリ18から直接参照画像を取得することはない。判定動きベクトルが第1動きベクトルである場合には、設定可能範囲に含まれない範囲を含む範囲が探索範囲とされることから、判定動きベクトルに応じた探索範囲に含まれる参照画像の少なくとも一部が、参照画像メモリ42に記憶されていない状態となる。従って、この場合には、フレームメモリ18に直接アクセスして参照バッファ49に必要な参照画像を取得して記憶する。   Since the reference image memory 42 stores reference images in the settable range, if the determination motion vector is the second motion vector, it is included in the search range set based on the determination motion vector. All the reference images are stored in the reference image memory 42. Therefore, the reference image is not acquired directly from the frame memory 18. When the determination motion vector is the first motion vector, a range including a range that is not included in the settable range is set as the search range. Therefore, at least one of the reference images included in the search range corresponding to the determination motion vector. Are not stored in the reference image memory 42. Accordingly, in this case, the frame memory 18 is directly accessed, and a reference image necessary for the reference buffer 49 is acquired and stored.

これにより、処理対象となるブロックを処理する直前に、該処理対象となるブロックに対応する探索範囲の参照画像が、参照バッファ49に格納される。   Thus, immediately before processing the block to be processed, the reference image in the search range corresponding to the block to be processed is stored in the reference buffer 49.

なお、参照バッファ49への参照画像の格納方法はこれに限定されない。例えば、読出要求された探索範囲の参照画像の少なくとも一部が、参照画像メモリ42に記憶されていない場合には、制御部41は読出要求された参照画像の全てをフレームメモリ18から直接読出して参照バッファ49に格納させるようにしてもよい。すなわち、本実施形態では、第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも参照画像メモリ42に記憶されていない画像については、参照画像メモリ42を介さずにフレームメモリ18から直接読出された画像が参照されることになる。   Note that the method of storing the reference image in the reference buffer 49 is not limited to this. For example, when at least a part of the reference image of the search range requested to be read is not stored in the reference image memory 42, the control unit 41 directly reads all the reference images requested to be read from the frame memory 18. You may make it store in the reference buffer 49. FIG. That is, in the present embodiment, at least an image that is not stored in the reference image memory 42 among images in the search range set based on the first motion vector is directly from the frame memory 18 without going through the reference image memory 42. The read image is referred to.

原画バッファ48及び参照バッファ49は、例えば、FIFOメモリ(先入れ先出し型メモリ)としてもよい。   The original image buffer 48 and the reference buffer 49 may be, for example, a FIFO memory (a first-in first-out memory).

さらに、制御部45は、算出部46での評価値算出対象となり、保持部44で保持される対象となる動きベクトルを次々に生成して、算出部46、保持部44、小数ベクトル予測画生成部50、及び切替部47へと送る。   Further, the control unit 45 sequentially generates motion vectors to be evaluated by the calculation unit 46 and held by the holding unit 44, and the calculation unit 46, the holding unit 44, and the decimal vector prediction image generation To the unit 50 and the switching unit 47.

小数ベクトル予測画生成部50は、例えば、第2動き探索で各ブロックに対して小数画素精度の動きベクトルを探索する場合に、規格により規定された方式又は別の方式により参照画像の補間処理を行って、小数座標の画素を有する小数予測画像を生成する。   For example, when searching for a motion vector with decimal pixel precision for each block in the second motion search, the decimal vector prediction image generation unit 50 performs reference image interpolation processing according to a method prescribed by the standard or another method. Then, a decimal prediction image having pixels with decimal coordinates is generated.

切替部47は、第2動き探索で小数画素精度で動きベクトルを探索する場合には、小数ベクトル予測画生成部50で生成された小数予測画像を参照画像として算出部46に入力する。切替部47は、整数画素精度で動きベクトルを探索する場合には、参照バッファ49に記憶されている画像を参照画像として算出部46に入力する。   When searching for a motion vector with decimal pixel accuracy in the second motion search, the switching unit 47 inputs the decimal prediction image generated by the decimal vector prediction image generation unit 50 to the calculation unit 46 as a reference image. When searching for a motion vector with integer pixel accuracy, the switching unit 47 inputs an image stored in the reference buffer 49 to the calculation unit 46 as a reference image.

算出部46は、原画バッファ39に記憶されている処理対象のブロックの画像と、切替部47から入力された探索範囲の参照画像から、制御部45から送られてきた動きベクトルを元に選択されたブロック(以下、候補ブロックという)とを比較する。そして、算出部46は、各候補ブロックと処理対象のブロックとの類似度の評価値として、SAD(差分絶対値和)を算出する。なお、ここでは、算出部46がSADを算出する例について説明したが、SSD(二乗誤差和)、SATD等、他の評価値を算出するようにしてもよい。また、動きベクトルの影響を考慮した評価値を算出するようにしても良い。また、他の周知の技術を用いて良い。   The calculation unit 46 is selected based on the motion vector transmitted from the control unit 45 from the image of the block to be processed stored in the original image buffer 39 and the reference image of the search range input from the switching unit 47. Block (hereinafter referred to as candidate block). Then, the calculation unit 46 calculates SAD (sum of absolute differences) as an evaluation value of the degree of similarity between each candidate block and the block to be processed. Here, an example in which the calculation unit 46 calculates SAD has been described, but other evaluation values such as SSD (Square Error Sum), SATD, and the like may be calculated. Further, an evaluation value considering the influence of the motion vector may be calculated. Other known techniques may be used.

保持部44は、各ブロックで最初に制御部45から送られてくる動きベクトルと、この動きベクトルを元に算出部46で算出された評価値とを無条件で処理結果候補として保持する。以降は、算出部46から評価値が送られてくるごとに、保持されている処理結果候補の評価値と比較する。比較の結果、新たに送られてきた評価値が保持されている評価値よりも良かった場合は、その評価値と、その評価値に対応する動きベクトルとで処理結果候補を更新する。この処理を制御部45から送られる全ての動きベクトルと、その動きベクトルについて算出部46で算出された評価値について繰り返すことで、最終的には、このブロックの動きベクトル候補の中で最良の評価値を示す動きベクトルと対応する評価値とが処理結果候補として保持されるので、この候補がこのブロックにおける動きベクトル及び評価値として選択される。   The holding unit 44 unconditionally holds the motion vector first sent from the control unit 45 in each block and the evaluation value calculated by the calculation unit 46 based on this motion vector as processing result candidates. Thereafter, each time an evaluation value is sent from the calculation unit 46, the evaluation value of the stored processing result candidate is compared. As a result of the comparison, if the newly sent evaluation value is better than the stored evaluation value, the processing result candidate is updated with the evaluation value and the motion vector corresponding to the evaluation value. By repeating this process for all the motion vectors sent from the control unit 45 and the evaluation values calculated by the calculation unit 46 for the motion vectors, the best evaluation among the motion vector candidates of this block is finally obtained. Since the motion vector indicating the value and the corresponding evaluation value are held as processing result candidates, this candidate is selected as the motion vector and evaluation value in this block.

フレーム間予測部26は、第2動き探索部25で探索され入力された動きベクトルに基づき、第2動き探索部25に含まれる参照バッファ49から参照画像を取得して、周知の動き補償を行い、予測画像を生成する。すなわち、本実施形態では、フレーム間予測部26が、参照画像を参照画像メモリ42から取得する構成としている。   The inter-frame prediction unit 26 acquires a reference image from the reference buffer 49 included in the second motion search unit 25 based on the motion vector searched and input by the second motion search unit 25, and performs known motion compensation. Generate a predicted image. That is, in this embodiment, the inter-frame prediction unit 26 acquires the reference image from the reference image memory 42.

なお、フレーム間予測部26が用いる参照画像の一部又は全てを、フレームメモリ18に直接アクセスして取得してもよい。動き補償では、参照画像の候補ブロックの各々が参照される動き探索と異なり、頻繁な読出しは行われないため、フレーム間予測部26が動き補償のためフレームメモリ18に直接アクセスしたとしても、メモリ帯域の圧迫の度合いは動き探索よりも小さい。   Note that some or all of the reference images used by the inter-frame prediction unit 26 may be acquired by directly accessing the frame memory 18. In motion compensation, unlike the motion search in which each of the candidate blocks of the reference image is referred to, frequent readout is not performed. Therefore, even if the inter-frame prediction unit 26 directly accesses the frame memory 18 for motion compensation, the memory bandwidth The degree of compression is smaller than that of motion search.

主符号化処理部13の切替部30は、フレーム内予測部29で生成された予測画像及びフレーム間予測部26で生成された予測画像の一方を選択して予測誤差画像生成部20及び復号画像生成部23に出力する。切替部30は、例えば外部の制御部により制御され、切替えられる。   The switching unit 30 of the main encoding processing unit 13 selects one of the prediction image generated by the intra-frame prediction unit 29 and the prediction image generated by the inter-frame prediction unit 26 to select the prediction error image generation unit 20 and the decoded image. The data is output to the generation unit 23. The switching unit 30 is controlled and switched by, for example, an external control unit.

エントロピー符号化部31には、直交変換・量子化部21から量子化後の予測誤差画像の情報が入力される。更にまた、エントロピー符号化部31には、フレーム内予測モード決定部28で決定された予測モードや、第2動き探索部25で探索された動きベクトルが、サイド情報として入力される。エントロピー符号化部31は、予測誤差画像の情報とサイド情報とをエントロピー符号化する。エントロピー符号化とは、シンボルの出現頻度に応じて、可変長の符号を割り当て符号化する処理をいう。エントロピー符号化により生成された符号化信号(ビットストリーム)は、予め定められた出力先に出力される。   Information of the prediction error image after quantization is input to the entropy encoding unit 31 from the orthogonal transform / quantization unit 21. Furthermore, the prediction mode determined by the intra-frame prediction mode determination unit 28 and the motion vector searched by the second motion search unit 25 are input to the entropy encoding unit 31 as side information. The entropy encoding unit 31 performs entropy encoding on the prediction error image information and the side information. Entropy coding is a process of assigning and coding a variable-length code according to the appearance frequency of a symbol. An encoded signal (bit stream) generated by entropy encoding is output to a predetermined output destination.

次に、判定部12の判定処理について詳細に説明する。   Next, the determination process of the determination unit 12 will be described in detail.

図9は、判定部12により実行される判定処理の一例を示すフローチャートである。図9に示す判定処理は、1フレーム画像毎に行われる。   FIG. 9 is a flowchart illustrating an example of determination processing executed by the determination unit 12. The determination process shown in FIG. 9 is performed for each frame image.

ステップ100において、判定部12は、集合Scを空集合とし、パラメータmに0をセットする。ここで、パラメータmは、1フレーム画像を第2動き探索の処理単位となる複数のブロックに分割したときの各ブロックを識別するための識別番号であり、0から「1フレーム画像のブロック総数−1」までの整数値を取り得る。   In step 100, the determination unit 12 sets the set Sc to be an empty set and sets 0 to the parameter m. Here, the parameter m is an identification number for identifying each block when the 1-frame image is divided into a plurality of blocks that are processing units of the second motion search, and from 0 to “total number of blocks of 1-frame image− It can be an integer value up to “1”.

ステップ102において、判定部12は、ブロックBmの第1動きベクトル、第1指標値、第2動きベクトル、及び第2指標値を取得する。   In step 102, the determination unit 12 acquires the first motion vector, the first index value, the second motion vector, and the second index value of the block Bm.

ステップ104において、判定部12は、第1動きベクトルの方が第2動きベクトルより符号化効率が高いか否かを判断する。ここでは、ステップ102で取得した第1指標値及び第2指標値を用いる。本実施形態では、第1指標値及び第2指標値共にSADであるため、評価指標は小さいほど符号化効率が高い(評価が良い)ことを示す。従って、第1指標値が第2指標値よりも小さい場合には、第1動きベクトルの方が第2動きベクトルより符号化効率が高いと判断される。第1指標値及び第2指標値がSSDや符号化コストを示す値である場合も同様である。判定部12は、ステップ104において肯定判断した場合には、ステップ106に進む。   In step 104, the determination unit 12 determines whether or not the first motion vector has higher encoding efficiency than the second motion vector. Here, the first index value and the second index value acquired in step 102 are used. In this embodiment, since both the first index value and the second index value are SAD, the smaller the evaluation index, the higher the encoding efficiency (the better the evaluation). Therefore, when the first index value is smaller than the second index value, it is determined that the first motion vector has higher encoding efficiency than the second motion vector. The same applies to the case where the first index value and the second index value are values indicating SSD and coding cost. If the determination unit 12 makes a positive determination in step 104, the determination unit 12 proceeds to step 106.

ステップ106において、判定部12は、ブロックBmを集合Scに加える。判定部12は、ステップ106の処理後、ステップ108に進む。また、判定部12は、ステップ104において否定判断した場合には、ステップ106をスキップしてステップ108に進む。   In step 106, the determination unit 12 adds the block Bm to the set Sc. The determination unit 12 proceeds to step 108 after the process of step 106. If the determination unit 12 makes a negative determination in step 104, the determination unit 12 skips step 106 and proceeds to step 108.

ステップ108において、判定部12は、パラメータmに1を加算する。   In step 108, the determination unit 12 adds 1 to the parameter m.

ステップ110において、判定部12は、パラメータmが、1フレーム画像のブロック総数と等しいか否かを判断する。前述したように、パラメータmは、0から「1フレーム画像のブロック総数−1」までの整数値を取り得る。従って、パラメータmが1フレーム画像のブロック総数と等しくなった場合には、1フレーム画像に含まれるブロックの全てが処理済みとなったことを意味する。   In step 110, the determination unit 12 determines whether or not the parameter m is equal to the total number of blocks of one frame image. As described above, the parameter m can take an integer value from 0 to “the total number of blocks of one frame image−1”. Therefore, when the parameter m becomes equal to the total number of blocks in one frame image, it means that all the blocks included in the one frame image have been processed.

判定部12は、ステップ110において否定判断した場合には、ステップ102に戻って、次のブロックBmについて、上記と同様の処理を行う。一方、判定部12は、ステップ110において肯定判断した場合には、ステップ112に進み、特定ブロック判定処理を実行する。   If the determination unit 12 makes a negative determination in step 110, the determination unit 12 returns to step 102 and performs the same processing as described above for the next block Bm. On the other hand, if the determination unit 12 makes an affirmative determination in step 110, the determination unit 12 proceeds to step 112 and executes a specific block determination process.

ステップ112の特定ブロック判定処理の一例を図10に示す。   An example of the specific block determination process in step 112 is shown in FIG.

ステップ200において、判定部12は、集合Scに含まれるブロックを、第1動きベクトルの符号化効率が高い順にソートする。ここでは、第1動きベクトルの符号化効率を示す値に基づいてソートする。   In step 200, the determination unit 12 sorts the blocks included in the set Sc in descending order of coding efficiency of the first motion vector. Here, sorting is performed based on a value indicating the coding efficiency of the first motion vector.

第1動きベクトルのx成分をvx1、y成分をvy1とし、第1評価値をv1とし、第2動きベクトルのx成分をvx2、y成分をvy2とし、第2評価値をv2とし、関数の出力をfとしたときの、符号化効率を示す値を導出する関数例を以下に示す。   The x component of the first motion vector is vx1, the y component is vy1, the first evaluation value is v1, the x component of the second motion vector is vx2, the y component is vy2, the second evaluation value is v2, and the function An example of a function for deriving a value indicating the coding efficiency when the output is f is shown below.

f=v1 ・・・式1
f=v1−v2 ・・・式2
f=v1−v2+α・g(vx1,vy1) ・・・式3
f=v1−v2+β・h(vx1,vy1、vx2,vy2) ・・・式4
f = v1 Formula 1
f = v1-v2 Expression 2
f = v1−v2 + α · g (vx1, vy1) Equation 3
f = v1−v2 + β · h (vx1, vy1, vx2, vy2) Equation 4

ここで、式3の関数g及び関数hは、着目するブロックについて第1動きベクトルを採用したときに増加するメインメモリ15のメモリ帯域(具体的には、フレームメモリ18からの直接読出データ量)に比例する値を返す関数である。また、α、及びβは、予め定められた正の定数である。   Here, the function g and the function h in Expression 3 are the memory bandwidth of the main memory 15 that increases when the first motion vector is adopted for the block of interest (specifically, the amount of data directly read from the frame memory 18). This function returns a value proportional to. Α and β are predetermined positive constants.

ここで、第1評価値v1及び第2評価値v2は、その値が小さいほど符号化効率が高い(良い結果を示す)ものとし(例えばSAD)、関数の出力fも、その値が小さいほど符号化効率が高いものとする。   Here, the first evaluation value v1 and the second evaluation value v2 are assumed to have higher encoding efficiency (showing good results) as the values are smaller (for example, SAD), and the output f of the function is smaller as the values are smaller. Assume that encoding efficiency is high.

判定部12は、関数の出力値fが小さいものほど上位となるようにソートする。   The determination unit 12 sorts such that the smaller the output value f of the function, the higher the value.

なお、ここでは、第1評価値がSADである場合を例に挙げたが、SSDや符号化コストであってもよい。この場合も、当該SSDや符号化コストを、符号化効率を示す値としてそのまま用いてソートしてもよい。   Here, although the case where the first evaluation value is SAD has been described as an example, SSD or encoding cost may be used. In this case as well, the SSD or encoding cost may be sorted as it is as a value indicating the encoding efficiency.

ステップ202において、判定部12は、上記ソートされた状態で、上位N個のブロックを特定ブロックとして判定する。Nは、参照画像メモリ42をフレームメモリ18から直接参照画像を読み出して参照バッファ49に格納するときの直接読出データ量の合計値が予め設定された上限値を超えないように予め設定された値である。ここでは、1つの特定ブロックについて、参照画像メモリ42を介さずにフレームメモリ18から直接参照画像を読み出すときの直接読出データ量を一律cとして、「c×N=予め設定された上限値DN」となるようにNを設定した。これにより、参照画像メモリ42の更新時のフレームメモリ18へのアクセス以外の、参照画像メモリ42に保持されていない探索範囲の取得のためのフレームメモリ18へのアクセスによる直接読出データ量を、上限値DN以下に抑えることが可能となる。   In step 202, the determination unit 12 determines the top N blocks as specific blocks in the sorted state. N is a value set in advance so that the total value of the directly read data amount when the reference image memory 42 reads the reference image directly from the frame memory 18 and stores it in the reference buffer 49 does not exceed a preset upper limit value. It is. Here, for one specific block, “c × N = predetermined upper limit DN”, where c is the amount of direct read data when the reference image is directly read from the frame memory 18 without using the reference image memory 42. N was set so that As a result, the amount of direct read data by access to the frame memory 18 for obtaining the search range not held in the reference image memory 42 other than access to the frame memory 18 at the time of updating the reference image memory 42 is limited to the upper limit. It becomes possible to suppress it below the value DN.

参照画像メモリ42の更新方法にもよるが、特定ブロックに判定されると第1動きベクトルに基づいて設定される探索範囲には、参照画像メモリ42に保持されていない範囲が含まれる可能性が高い。従って、あまりに多くのブロックを特定ブロックと判定すると、直接読出データ量が増えてメモリ帯域を圧迫する。そこで、本実施形態では、特定ブロックの数の上限値を設けるようにしている。   Depending on the updating method of the reference image memory 42, the search range set based on the first motion vector when determined as a specific block may include a range not held in the reference image memory 42. high. Therefore, if too many blocks are determined as specific blocks, the amount of read data directly increases and the memory bandwidth is compressed. Therefore, in this embodiment, an upper limit value for the number of specific blocks is provided.

以下、参照画像メモリ42を介さずにフレームメモリ18から直接参照画像を読み出して参照バッファ49に格納することを、「直接読出し」と呼称する。   Hereinafter, reading the reference image directly from the frame memory 18 without passing through the reference image memory 42 and storing it in the reference buffer 49 is referred to as “direct reading”.

上記により、上記直接読出データ量の合計値が予め設定された上限値を超えない範囲内で、第2動きベクトルよりも第1動きベクトルの方が符号化効率が高いブロックが、特定ブロックとして判定される。図10を用いて例示した特定ブロック判定処理を採用した場合には、簡単なアルゴリズムで特定ブロックを判定できる。   As described above, a block in which the first motion vector has higher encoding efficiency than the second motion vector is determined as a specific block within a range where the total value of the directly read data amount does not exceed a preset upper limit value. Is done. When the specific block determination process exemplified with reference to FIG. 10 is adopted, the specific block can be determined with a simple algorithm.

図9において、ステップ112の後は、ステップ114の処理が実行される。   In FIG. 9, after step 112, the process of step 114 is executed.

ステップ114において、判定部12は、1フレーム画像に含まれるブロックのうち、ステップ112において特定ブロックと判定されたブロック以外の全てのブロックを非特定ブロックと判定する。ここでは、集合Scに含まれるブロックのうち特定ブロックとして判定されなかったブロック、及び集合Scに含まれないブロックの各々が非特定ブロックと判定される。   In step 114, the determination unit 12 determines all blocks other than the block determined as the specific block in step 112 among the blocks included in the one-frame image as non-specific blocks. Here, each of a block that is not determined as a specific block among blocks included in the set Sc and a block that is not included in the set Sc are determined as non-specific blocks.

ステップ116において、判定部12は、判定結果を第2動き探索部25に出力する。すなわち、判定部12は、判定結果として、特定ブロックと判定したブロックについては、第1動きベクトルを主符号化処理部13に出力し、非特定ブロックと判定したブロックについては、第2動きベクトルを主符号化処理部13に出力する。   In step 116, the determination unit 12 outputs the determination result to the second motion search unit 25. That is, the determination unit 12 outputs, as a determination result, the first motion vector for the block determined to be a specific block to the main encoding processing unit 13 and the second motion vector for the block determined to be a non-specific block. The result is output to the main encoding processing unit 13.

ここで、図11に、符号化方式H.264に対応した符号化装置1の各構成要素の処理のタイミングを示すタイミングチャートの一例を示す。   Here, FIG. 2 shows an example of a timing chart showing processing timing of each component of the encoding device 1 corresponding to H.264.

図11において、縮小部10は各フレーム画像の原画像に対して図示されるタイミングで縮小処理を施す。なお、図示される符号I0、B1、B2、P3…は、各フレーム画像を表わす識別符号である。なお、図11においてIxは、フレーム内予測符号化方式により符号化するフレーム画像を表わす。また、図11においてBxは、主にフレーム間予測符号化方式により符号化するフレーム画像であって、主に先に符号化した2つのフレーム画像から予測するBフレームのフレーム画像を示す。また、図11において、Pxは、主にフレーム間予測符号化方式により符号化するフレーム画像であって、主に先に符号化した1つのフレーム画像から予測するPフレームのフレーム画像を示す。   In FIG. 11, the reduction unit 10 performs a reduction process on the original image of each frame image at the timing shown in the figure. In addition, the code | symbol I0, B1, B2, P3 ... shown in figure is an identification code showing each frame image. In FIG. 11, Ix represents a frame image to be encoded by the intra-frame predictive encoding method. In FIG. 11, Bx is a frame image encoded mainly by the inter-frame predictive encoding method, and mainly indicates a frame image of a B frame predicted from the two previously encoded frame images. In FIG. 11, Px is a frame image encoded mainly by the inter-frame predictive encoding method, and mainly indicates a frame image of a P frame predicted from one previously encoded frame image.

また、ここでは、フレーム画像I0より前に符号化処理されるフレーム画像については図示を省略した。   Further, here, the illustration of the frame image encoded before the frame image I0 is omitted.

第1動き探索部11は、図11に示すタイミングで、各フレーム画像の各ブロックについて、第1動き探索を行う。Bフレームについては、前方参照画像及び後方参照画像に示されるように、互いに異なる時刻の2つの参照画像が参照される。Pフレームについては、前方参照画像に示されるように、1つの参照画像が参照される。例えば、フレーム画像P3の各ブロックは、フレーム画像I0に含まれるブロックを参照画像として上述した第1動き探索が行われる。   The first motion search unit 11 performs a first motion search for each block of each frame image at the timing shown in FIG. As for the B frame, as shown in the forward reference image and the backward reference image, two reference images at different times are referred to. As for the P frame, as shown in the forward reference image, one reference image is referred to. For example, each block of the frame image P3 is subjected to the first motion search described above using the block included in the frame image I0 as a reference image.

判定部12は、図11のタイミングチャート内にt1で示すように、あるフレーム画像(t1ではP3)に対する第1動き探索が終了した後に、そのフレーム画像の各ブロックについて、特定ブロック及び非特定ブロックの判定を行う。   As indicated by t1 in the timing chart of FIG. 11, the determination unit 12 performs a specific block and a non-specific block for each block of the frame image after the first motion search for a certain frame image (P3 in t1) is completed. Judgment is made.

第2動き探索部25は、判定部12による判定が終了した後に、そのフレーム画像の各ブロックについて、第2動き探索を行う。図11のタイミングチャート内でt2で示すように、フレーム画像P3に対する第2動き探索は、判定部12による判定が終了した後に行われている。なお、第2動き探索部25は、判定部12の判定手法にもよるが、通常は、1フレーム画像の全ブロックの判定が終了した後に、該フレーム画像の第2動き探索を行う。   The second motion search unit 25 performs a second motion search for each block of the frame image after the determination by the determination unit 12 is completed. As indicated by t2 in the timing chart of FIG. 11, the second motion search for the frame image P3 is performed after the determination by the determination unit 12 is completed. Note that, although depending on the determination method of the determination unit 12, the second motion search unit 25 normally performs the second motion search of the frame image after the determination of all the blocks of the one frame image is completed.

参照画像メモリ42は処理対象のブロックが切替わる毎に更新されるが、参照画像メモリ42には処理対象のブロックの処理中に参照するフレーム画像の参照画像が記憶されるように制御される。従って、フレーム画像P3の各ブロックを符号化する際に参照画像メモリ42に記憶される参照画像は、フレーム画像I0の復号画像とされる。   The reference image memory 42 is updated every time a block to be processed is switched, but the reference image memory 42 is controlled so that a reference image of a frame image to be referred to during processing of the block to be processed is stored. Therefore, the reference image stored in the reference image memory 42 when encoding each block of the frame image P3 is a decoded image of the frame image I0.

以上説明したように、本実施形態では、二段階の動き探索を行い、二段階目の動き探索の非特定ブロックにおける探索処理では、一段階目の第1探索範囲よりも狭い範囲が探索範囲とされる。従って、参照画像メモリ42のメモリ容量を削減できる。更にまた、第1動きベクトルの方が第2動きベクトルよりも符号化効率が高いN個のブロックについては、第1動きベクトルを用いた第2動き探索が行われるため、符号化効率を向上させることができる。すなわち、フレームメモリ18から直接読出しを全く行わない場合に比べて画質の向上が見込まれる。更に、上記Nは、直接読出しの際の直接読出データ量の合計値が上限値を超えないように予め設定された値であるため、フレームメモリ18からの読出データ量の抑制を図ることもできる。このように、上記実施形態では、参照画像メモリ42の容量の抑制、符号化効率の向上、及びフレームメモリ18の読出データ量の抑制の各々をバランスよく実現することができる。   As described above, in this embodiment, a two-step motion search is performed, and in the search process in the non-specific block of the second-step motion search, a range narrower than the first search range of the first step is the search range. Is done. Therefore, the memory capacity of the reference image memory 42 can be reduced. Furthermore, since the second motion search using the first motion vector is performed for N blocks in which the first motion vector has higher encoding efficiency than the second motion vector, the encoding efficiency is improved. be able to. That is, the image quality is expected to be improved as compared with the case where no direct reading is performed from the frame memory 18. Further, N is a value set in advance so that the total value of the direct read data amount at the time of direct reading does not exceed the upper limit value, so that it is possible to suppress the read data amount from the frame memory 18. . Thus, in the above embodiment, each of the suppression of the capacity of the reference image memory 42, the improvement of the encoding efficiency, and the suppression of the read data amount of the frame memory 18 can be realized in a balanced manner.

なお、上記ステップ112において行われる特定ブロック判定処理の内容は、上記説明した内容に限定されない。例えば、度数分布又はヒストグラムを生成して判定してもよい。   In addition, the content of the specific block determination process performed in the said step 112 is not limited to the content demonstrated above. For example, determination may be made by generating a frequency distribution or a histogram.

図12は、ヒストグラムを用いた特定ブロック判定処理の流れを示すフローチャートである。図12に示す特定ブロック判定処理は、上記図10を参照して例示した特定ブロック判定処理に代えて実行することができる。   FIG. 12 is a flowchart showing the flow of specific block determination processing using a histogram. The specific block determination process shown in FIG. 12 can be executed instead of the specific block determination process illustrated with reference to FIG.

ステップ210において、判定部12は、集合Scに含まれるブロックについて、第1動きベクトルの符号化効率を示す値のヒストグラムを生成する。ヒストグラムには複数の階級が含まれるが、階級の幅は特に限定されない。符号化効率を示す値は、上記式1〜式4で例示した関数の値等を用いることができる。ステップ210により、例えば、符号化効率を示す値に基づく各階級毎に、ブロックの度数(個数)が示されたヒストグラムが生成される。   In step 210, the determination unit 12 generates a histogram of values indicating the coding efficiency of the first motion vector for the blocks included in the set Sc. The histogram includes a plurality of classes, but the class width is not particularly limited. As the value indicating the coding efficiency, the values of the functions exemplified in the above formulas 1 to 4 can be used. In step 210, for example, a histogram indicating the frequency (number) of blocks is generated for each class based on a value indicating the coding efficiency.

ステップ212において、判定部12は、パラメータDtに0をセットし、パラメータkに0をセットする。パラメータDtは、符号化効率を示す値が高い順に上位の階級から各階級の度数を加算していったときの累計値を計時するパラメータである。パラメータkは、階級を識別するための識別番号である。パラメータkは、「0から階級総数−1」までの値を取り得る。符号化効率を示す値が小さい(符号化効率が高い)階級ほど上位の階級となり、kは小さくなる。   In step 212, the determination unit 12 sets 0 to the parameter Dt and 0 to the parameter k. The parameter Dt is a parameter for measuring the cumulative value when the frequency of each class is added from the upper class in descending order of the value indicating the coding efficiency. The parameter k is an identification number for identifying the class. The parameter k can take a value from “0 to the total number of classes−1”. The lower the value indicating the encoding efficiency (higher encoding efficiency), the higher the class, and the smaller k.

ステップ214において、判定部12は、ヒストグラムの階級kの度数Dkを取得する。   In step 214, the determination unit 12 acquires the frequency Dk of the class k of the histogram.

ステップ216において、判定部12は、DtにDkを加算した値をDtにセットする。   In step 216, the determination unit 12 sets a value obtained by adding Dk to Dt to Dt.

ステップ218において、判定部12は、Dtが予め定められた上限値N以下であるか否かを判断する。Nは、前述したように、直接読出しにおいて直接読出データ量の合計値が予め設定された上限値を超えないように予め設定された値である。   In step 218, the determination unit 12 determines whether or not Dt is equal to or less than a predetermined upper limit value N. As described above, N is a value set in advance so that the total value of the directly read data amount does not exceed a preset upper limit value in direct reading.

判定部12は、ステップ218において肯定判断した場合には、ステップ220に進み、パラメータkに1を加算し、ステップ214に戻る。これにより、次の階級kについて、上記と同様の処理が行われる。   If the determination unit 12 makes a positive determination in step 218, the process proceeds to step 220, 1 is added to the parameter k, and the process returns to step 214. As a result, the same processing as described above is performed for the next class k.

また、判定部12は、ステップ218において否定判断した場合には、ステップ222に進み、階級kより上位の階級に含まれるブロックを特定ブロックとして判定する。   If the determination unit 12 makes a negative determination in step 218, the determination unit 12 proceeds to step 222 and determines a block included in a class higher than the class k as a specific block.

すなわち、ステップ218において否定判断された場合、現在の階級kの度数Dkを加算したときの累計値を示すパラメータDtは上限値Nを越えてしまっているが、当該階級kの1つ上位の階級k−1までの累計値は上限値N以下となっていることを示す。   That is, when a negative determination is made in step 218, the parameter Dt indicating the cumulative value when the frequency Dk of the current class k is added exceeds the upper limit value N, but the class one higher than the class k. It indicates that the cumulative value up to k−1 is equal to or less than the upper limit value N.

従って、ここでは、階級kより上位の階級、すなわち、階級0から階級k−1までの各階級に含まれるブロックを特定ブロックとして判定する。   Accordingly, here, the blocks included in the classes higher than the class k, that is, the classes from the class 0 to the class k−1 are determined as the specific blocks.

なお、ここでは、ヒストグラムを生成する例について説明したが、ヒストグラムを生成するまでもなく、度数分布を生成して上記と同様に処理してもよい。階級の幅を定義して、各階級毎の度数をカウントしさえすれば、上記と同様に処理できるためである。このように、度数分布或いはヒストグラムを生成して行う特定ブロックを判定する場合には、図10を参照して説明した特定ブロック判定処理で必要なソートを行わずに済むため、判定処理を効率的に行うことができる。   Although an example of generating a histogram has been described here, a frequency distribution may be generated and processed in the same manner as described above without generating a histogram. This is because if the width of the class is defined and the frequency for each class is counted, processing can be performed in the same manner as described above. As described above, when determining a specific block to be performed by generating a frequency distribution or a histogram, it is not necessary to perform the sort necessary for the specific block determination process described with reference to FIG. Can be done.

また、特定ブロック判定処理において、以下のように特定ブロックを判定してもよい。例えば、図13に示すように、両隣のブロックB1、B2が特定ブロックと判定されたブロックBaについては、ブロックBaの処理時にもブロックB1、B2の探索範囲に含まれる参照画像を参照バッファ49に保持しておいて流用することができる。すなわち、ブロックBaについて第2動き探索を行うときの探索範囲によっては、ブロックBaの第2動き探索のために直接読出しを行わなくても第1動きベクトルを用いた探索を行うことができる。この場合、ブロックBaを特定ブロックとして扱っても、メモリ帯域を圧迫することはない。従って、両隣が特定ブロックと判定されたブロックBaの第1動きベクトルが第2動きベクトルより符号化効率が高い場合に、ブロックBaについての第1動きベクトルに基づく探索範囲によっては、ブロックBaも直接読出し可能な特定ブロックと判定してもよい。ブロックBaを特定ブロックとして判定しない場合に比べて符号化効率が向上し、画質の向上が見込まれる。   In the specific block determination process, the specific block may be determined as follows. For example, as shown in FIG. 13, for the block Ba in which the adjacent blocks B1 and B2 are determined to be specific blocks, the reference image included in the search range of the blocks B1 and B2 is stored in the reference buffer 49 even when the block Ba is processed. It can be retained and reused. That is, depending on the search range when performing the second motion search for the block Ba, the search using the first motion vector can be performed without performing direct reading for the second motion search of the block Ba. In this case, even if the block Ba is treated as a specific block, the memory bandwidth is not compressed. Therefore, when the first motion vector of the block Ba determined to be a specific block on both sides has higher encoding efficiency than the second motion vector, the block Ba is also directly dependent on the search range based on the first motion vector for the block Ba. You may determine with the specific block which can be read. Compared with the case where the block Ba is not determined as a specific block, the coding efficiency is improved and the image quality is expected to be improved.

図14は、両隣のブロックが特定ブロックと判定されたブロックについても特定ブロックと判定するか否かを判定する特定ブロック判定処理の流れを示すフローチャートである。図14に示す特定ブロック判定処理は、上記図10を参照して例示した特定ブロック判定処理に代えて行うことができる。   FIG. 14 is a flowchart showing the flow of specific block determination processing for determining whether or not a block for which both adjacent blocks are determined to be specific blocks is also determined as a specific block. The specific block determination process shown in FIG. 14 can be performed instead of the specific block determination process illustrated with reference to FIG.

ステップ230において、判定部12は、集合Sbを空集合とし、パラメータnに0をセットする。   In step 230, the determination unit 12 sets the set Sb as an empty set and sets 0 to the parameter n.

ステップ232において、判定部12は、集合Scから集合Sbを除いた集合から、符号化効率が最も高いブロックBbを選択する。ここでは、上記式1〜式4等により例示した、符号化効率を示す値を導出する関数fを用い、fの値が最も小さいブロックを選択する。なお、集合Scは、図9のステップ104において、第1動きベクトルの方が第2動きベクトルより符号化効率が高いと判定したブロックの集合である。   In step 232, the determination unit 12 selects a block Bb having the highest coding efficiency from the set obtained by removing the set Sb from the set Sc. Here, the function f that derives a value indicating the coding efficiency exemplified by the above formulas 1 to 4 is used, and the block having the smallest value of f is selected. Note that the set Sc is a set of blocks determined in step 104 in FIG. 9 that the first motion vector is higher in encoding efficiency than the second motion vector.

ステップ234において、判定部12は、n+1>Nであるか否かを判断する。Nは、上述したように、直接読出しの際の直接読出データ量の合計値が上限値を超えないように予め設定された値である。   In step 234, the determination unit 12 determines whether or not n + 1> N. As described above, N is a value set in advance so that the total value of the directly read data amount at the time of direct reading does not exceed the upper limit value.

判定部12は、ステップ234において否定判断した場合には、ステップ236に進み、ステップ236において、ブロックBbを集合Sbに加え、nに1を加算する。   When the determination unit 12 makes a negative determination in step 234, the process proceeds to step 236, and in step 236, the block Bb is added to the set Sb, and 1 is added to n.

ステップ238において、判定部12は、集合Scと集合Sbとが等しいか否かを判断する。判定部12は、ステップ238において否定判断した場合には、ステップ240に進む。   In step 238, the determination unit 12 determines whether or not the set Sc and the set Sb are equal. If the determination unit 12 makes a negative determination in step 238, the determination unit 12 proceeds to step 240.

ステップ240において、判定部12は、集合Scから集合Sbを除いた集合に、第2動き探索の処理方向において両隣のブロックが特定ブロックである(すなわち両隣のブロックが集合Sbに含まれる)ブロックBaがあるか否かを判断する。   In step 240, the determination unit 12 determines that the block Ba is a specific block in the processing direction of the second motion search (that is, both adjacent blocks are included in the set Sb). Judge whether there is.

判定部12は、ステップ240において肯定判断した場合には、ステップ242に進み、ブロックBaに対する合成範囲rを導出する。ここで、合成範囲rとは、ブロックBaの両隣の特定ブロックをブロックB1、及びブロックB2としたときの、以下の3つの範囲を合成した合成範囲をいう。   If the determination unit 12 makes an affirmative determination in step 240, the determination unit 12 proceeds to step 242 and derives a synthesis range r for the block Ba. Here, the synthesis range r refers to a synthesis range obtained by synthesizing the following three ranges when the specific blocks on both sides of the block Ba are the block B1 and the block B2.

・ブロックB1の第2動き探索における探索範囲
・ブロックB2の第2動き探索における探索範囲
・ブロックBaの第2動き探索中に参照画像メモリ42に保持されている範囲
A search range in the second motion search of block B1 A search range in the second motion search of block B2 A range held in the reference image memory 42 during the second motion search of block Ba

合成範囲rの一例を図13に示す。図13において、300は、ブロックBaの第2動き探索処理中に参照画像メモリ42に記憶されている保持範囲を示す。302は、ブロックB1の第2動き探索の探索範囲を示す。304は、ブロックB2の第2動き探索の探索範囲を示す。306は、ブロックBaの第2動き探索の探索範囲を示す。308は、合成範囲rを示す。302、304、306の各探索範囲は、何れも第1動きベクトルにより設定される探索範囲である。   An example of the synthesis range r is shown in FIG. In FIG. 13, reference numeral 300 denotes a holding range stored in the reference image memory 42 during the second motion search process of the block Ba. Reference numeral 302 denotes a search range of the second motion search of the block B1. Reference numeral 304 denotes a search range of the second motion search of the block B2. Reference numeral 306 denotes a search range of the second motion search of the block Ba. Reference numeral 308 denotes a synthesis range r. Each of the search ranges 302, 304, and 306 is a search range set by the first motion vector.

なお、両隣が特定ブロックであるブロックが複数存在した場合には、そのうちの1つを抽出し、該抽出したブロックBaに対する合成範囲rを導出する。   If there are a plurality of blocks whose specific blocks are on both sides, one of them is extracted, and a synthesis range r for the extracted block Ba is derived.

ステップ244において、判定部12は、ブロックBaが第2動き探索の処理対象とされたときの第1動きベクトルに基づいて設定される探索範囲が、合成範囲rに含まれるか否かを判断する。   In step 244, the determination unit 12 determines whether or not the synthesis range r includes a search range set based on the first motion vector when the block Ba is set as a second motion search processing target. .

判定部12は、ステップ244において肯定判断した場合には、ステップ246において、ブロックBaを集合Sbに加え(すなわち、ブロックBaを特定ブロックの集合に加え)、ステップ238に戻る。判定部12は、ステップ238で否定判断した場合には、ステップ240に進み、両隣が特定ブロックであるブロックのうち、未だ抽出していないブロックを抽出して、上記ステップ242以降の処理を繰り返す。   If the determination unit 12 makes an affirmative determination in step 244, in step 246, the block Ba is added to the set Sb (that is, the block Ba is added to the set of specific blocks), and the process returns to step 238. If the determination unit 12 makes a negative determination in step 238, the process proceeds to step 240, where blocks that have not yet been extracted from among the blocks whose both neighbors are specific blocks are extracted, and the processes after step 242 are repeated.

一方、判定部12は、ステップ244において否定判断した場合には、ステップ246をスキップしてステップ240に戻り、両隣が特定ブロックであるブロックのうち、未だ抽出していないブロックを抽出して、上記ステップ242以降の処理を繰り返す。   On the other hand, if the determination unit 12 makes a negative determination in step 244, the process skips step 246 and returns to step 240, extracts blocks that have not been extracted from among the blocks whose both neighbors are specific blocks, and The processing after step 242 is repeated.

また、判定部12は、ステップ240において否定判断した場合には、ステップ232に戻り、上記と同様の処理を繰り返す。   If the determination unit 12 makes a negative determination in step 240, the determination unit 12 returns to step 232 and repeats the same processing as described above.

また、判定部12は、ステップ234において肯定判断した場合には、ブロックBbを集合Sbには加えずに、ステップ248に進む。   If the determination unit 12 makes an affirmative determination in step 234, the process proceeds to step 248 without adding the block Bb to the set Sb.

ステップ248において、判定部12は、集合Sbに含まれるブロックを特定ブロックとして判定する。   In step 248, the determination unit 12 determines a block included in the set Sb as a specific block.

また、判定部12は、ステップ238において肯定判断した場合には、集合Scに含まれる全てのブロックが特定ブロックの集合である集合Sbに加えられたことを示している。従って、判定部12は、ステップ248に進み、集合Sbに含まれるブロックを特定ブロックとして判定する。   If the determination unit 12 makes a positive determination in step 238, it indicates that all blocks included in the set Sc have been added to the set Sb, which is a set of specific blocks. Therefore, the determination unit 12 proceeds to step 248, and determines the blocks included in the set Sb as specific blocks.

以下、図15の模式図を参照し、集合Sc及び集合Sbに含まれるブロックの具体例を挙げて、上記図14を参照して説明した特定ブロック判定処理の流れを説明する。また、ここでは、Nが3である場合を例に挙げる。また、ステップ248より前の、ステップ230からステップ246までの処理を、特定ブロックを判定するための「集合操作処理」と呼称する。nは2とする。   Hereinafter, the flow of the specific block determination process described with reference to FIG. 14 will be described with reference to the schematic diagram of FIG. 15 and specific examples of the blocks included in the set Sc and the set Sb. Here, a case where N is 3 is taken as an example. Further, the processing from step 230 to step 246 prior to step 248 is referred to as “set operation processing” for determining a specific block. n is 2.

図15(1)に示すように、集合Scには、ブロックw、x、y、zの4つのブロックが含まれている。特定ブロック判定処理の最初のステップであるステップ230において、集合Sbを空集合として設定し、nには0をセットする。なお、ブロックwの関数fの値は100、ブロックxの関数fの値は1000、ブロックyの関数fの値は101、ブロックzの関数fの値は200である。ここで、図16に、4つのブロックw、x、y、zの配置例を示す。第2動き探索は、前述したように左から右方向に実行され、右端のブロックの動き探索が行われた後は、1つ下の行の左端のブロックの動き探索が行われるものとする。なお、図16に示す各ブロックの左上端部から伸びる矢印は、第1動き探索において探索された各ブロックの第1動きベクトルを示す。   As shown in FIG. 15A, the set Sc includes four blocks w, x, y, and z. In step 230, which is the first step of the specific block determination process, the set Sb is set as an empty set, and n is set to 0. The value of the function f of the block w is 100, the value of the function f of the block x is 1000, the value of the function f of the block y is 101, and the value of the function f of the block z is 200. Here, FIG. 16 shows an arrangement example of four blocks w, x, y, and z. As described above, the second motion search is performed from left to right, and after the motion search of the rightmost block is performed, the motion search of the leftmost block in the next lower row is performed. Note that the arrow extending from the upper left end of each block shown in FIG. 16 indicates the first motion vector of each block searched in the first motion search.

図15(2)に示すように、ステップ232において、ブロックBbが選択される。図15(2)に示すように、集合Scから集合Sbを除いた集合においてfの値が最も小さいブロックは、ブロックwであるため、ブロックwがブロックBbとして選択される。この段階では、nは0である。   As shown in FIG. 15 (2), in step 232, the block Bb is selected. As shown in FIG. 15 (2), since the block having the smallest value of f in the set excluding the set Sb from the set Sc is the block w, the block w is selected as the block Bb. At this stage, n is 0.

図15(3)に示すように、次のステップ234において、n+1>Nを満たさないため、集合操作処理が続行される。   As shown in FIG. 15 (3), in the next step 234, since n + 1> N is not satisfied, the set operation processing is continued.

図15(4)に示すように、ステップ235において、ブロックBbが集合Sbに追加される。また、nに1が加算され、nは1となる。   As shown in FIG. 15 (4), in step 235, the block Bb is added to the set Sb. Also, 1 is added to n, and n becomes 1.

図15(5)に示すように、ステップ238において、集合Scと集合Sbとが等しくないため、集合操作処理が続行される。ステップ240において、ブロックBaに該当するブロックはないと判断される。   As shown in FIG. 15 (5), in step 238, the set Sc and the set Sb are not equal, so the set operation processing is continued. In step 240, it is determined that there is no block corresponding to the block Ba.

従って、図15(6)に示すように、ステップ240において否定判断されるため、ステップ232に戻る。   Accordingly, as shown in FIG. 15 (6), since a negative determination is made in step 240, the process returns to step 232.

図15(7)に示すように、図15(6)の後のステップ232において、ブロックBbが選択される。図15(6)に示すように、集合Scから集合Sbを除いた集合においてfの値が最も小さいブロックは、ブロックyであるため、ブロックyがブロックBbとして選択される。この段階では、nは1である。   As shown in FIG. 15 (7), in step 232 after FIG. 15 (6), the block Bb is selected. As shown in FIG. 15 (6), since the block having the smallest value of f in the set obtained by removing the set Sb from the set Sc is the block y, the block y is selected as the block Bb. At this stage, n is 1.

図15(8)に示すように、次のステップ234において、n+1>Nを満たさないため、集合操作処理が続行される。   As shown in FIG. 15 (8), in the next step 234, since n + 1> N is not satisfied, the set operation processing is continued.

図15(9)に示すように、ステップ235において、ブロックBbが集合Sbに追加される。また、nに1が加算され、nは2となる。   As shown in FIG. 15 (9), in step 235, the block Bb is added to the set Sb. Also, 1 is added to n, and n becomes 2.

図15(10)に示すように、ステップ238において、集合Scと集合Sbとが等しくないため、集合操作処理が続行される。ステップ240において、ブロックBaに該当するブロックがあると判断される。図15及び図16に示す例では、ブロックxがブロックBaとして判断され選択される。その後、ブロックBaについて合成範囲rが導出される。例えば、図13に示すように合成範囲rが導出され、ブロックBaの第1動きベクトルに基づく探索範囲が図13に示す範囲となった場合には、ステップ244において、ブロックBaの探索範囲は合成範囲rに含まれると判断される。従って、ステップ246において、ブロックBaが集合Sbに追加される。   As shown in FIG. 15 (10), in step 238, the set operation is continued because the set Sc and the set Sb are not equal. In step 240, it is determined that there is a block corresponding to the block Ba. In the example shown in FIGS. 15 and 16, the block x is determined and selected as the block Ba. Thereafter, a synthesis range r is derived for the block Ba. For example, when the synthesis range r is derived as shown in FIG. 13 and the search range based on the first motion vector of the block Ba becomes the range shown in FIG. 13, in step 244, the search range of the block Ba is synthesized. It is determined to be included in the range r. Accordingly, in step 246, the block Ba is added to the set Sb.

図15(11)に示すように、次のステップ240において他のBaに該当するブロックはないため、否定判断され、ステップ232に戻る。   As shown in FIG. 15 (11), since there is no block corresponding to another Ba in the next step 240, a negative determination is made and the process returns to step 232.

図15(12)に示すように、ステップ232において、ブロックBbが選択される。図15(12)に示すように、集合Scから集合Sbを除いた集合においてfの値が最も小さいブロックは、ブロックzであるため、ブロックzがブロックBbとして選択される。この段階では、nは2である。   As shown in FIG. 15 (12), in step 232, the block Bb is selected. As shown in FIG. 15 (12), since the block having the smallest value of f in the set obtained by excluding the set Sb from the set Sc is the block z, the block z is selected as the block Bb. At this stage, n is 2.

図15(13)に示すように、次のステップ234において、n+1>Nを満たすため、集合操作処理は終了となり、ステップ248の処理に移行する。   As shown in FIG. 15 (13), in the next step 234, since n + 1> N is satisfied, the set operation processing ends, and the processing proceeds to step 248.

上記図13〜図15を参照して説明した特定ブロック判定処理では、ブロックBbを集合Sbに追加する毎に、ブロックBaが存在するか否か判定している。そして、ブロックBaが存在すれば、該ブロックBaを集合Sbへと追加するようにしている。   In the specific block determination process described with reference to FIGS. 13 to 15 above, every time the block Bb is added to the set Sb, it is determined whether or not the block Ba exists. If the block Ba exists, the block Ba is added to the set Sb.

ところで、前述したように、1つのブロックについての動き探索は、算出部38による多数のSAD算出処理を含むものである。このSAD算出処理で使用される原画像は、1つのSADを算出する毎にフレームメモリ18から取得するのではなく、第2動き探索部25の内部に設けた原画バッファ39から算出部38へと出力される。参照画像についても同様に、1つのブロックについての動き探索において使用する参照画像を予め参照バッファ49に格納してから該ブロックの動き探索を開始する。   Incidentally, as described above, the motion search for one block includes a large number of SAD calculation processes by the calculation unit 38. The original image used in this SAD calculation process is not acquired from the frame memory 18 every time one SAD is calculated, but from the original image buffer 39 provided in the second motion search unit 25 to the calculation unit 38. Is output. Similarly, for a reference image, a reference image used in motion search for one block is stored in the reference buffer 49 in advance, and motion search for the block is started.

従って、あるブロックの動き探索が終了した後、次のブロックの動き探索を開始するまでの間に、参照バッファ49の内容が更新される。   Therefore, the content of the reference buffer 49 is updated after the motion search for a certain block is completed and before the motion search for the next block is started.

このように参照バッファ49を使用する構成において、両隣が特定ブロックとされたブロックBaの第2動き探索において、両隣のブロックの探索範囲の参照画像を流用(参照)するための機能を第2動き探索部25に設けることができる。以下、この機能を便宜的に「参照画キャッシュ機能」と呼称する。   In the configuration using the reference buffer 49 in this way, in the second motion search of the block Ba in which both neighbors are specified blocks, the function for diverting (referring to) the reference image in the search range of the neighbor blocks is the second motion search. The search unit 25 can be provided. Hereinafter, this function is referred to as “reference picture cache function” for convenience.

参照画キャッシュ機能では、1つ前に第2動き探索の処理対象とされたブロックで参照した範囲の参照画像を参照バッファ49に保持しておき、次に処理対象とされるブロックでもその範囲(の一部)を参照画像として使用する。参照画キャッシュ機能により、フレームメモリ18から参照画像を取得しなくても、参照バッファ49に保持されている参照画像を用いることで、探索範囲の参照画像を参照できる。   In the reference image cache function, the reference image of the range referred to by the block previously processed as the second motion search is held in the reference buffer 49, and the range ( Is used as a reference image. With the reference image cache function, the reference image in the search range can be referred to by using the reference image held in the reference buffer 49 without acquiring the reference image from the frame memory 18.

第2動き探索部25の制御部45は、上述したように、第2動き探索の処理対象となるブロックを切替えるタイミングで、参照画像メモリ回路27の制御部41に対する読出要求を出力する。制御部45は、該読出要求に読出対象の範囲、及び参照バッファ49に対する格納先アドレスの指定を含めて出力し、参照バッファ49に対するデータの格納及び消去のタイミングを制御し、参照画キャッシュ機能を実現する。   As described above, the control unit 45 of the second motion search unit 25 outputs a read request to the control unit 41 of the reference image memory circuit 27 at the timing of switching the block to be processed for the second motion search. The control unit 45 outputs the read request including the range to be read and the designation of the storage destination address for the reference buffer 49, controls the timing for storing and erasing data in the reference buffer 49, and controls the reference picture cache function. Realize.

ここで、図17A、図17Bを参照して、第2動き探索部25の制御部45により行われる参照画キャッシュ機能について説明する。ここでは、第2動き探索の処理対象となる連続した3つのブロックBw、Bx、Byを例に挙げて説明する。   Here, the reference picture cache function performed by the control unit 45 of the second motion search unit 25 will be described with reference to FIGS. 17A and 17B. Here, a description will be given by taking, as an example, three consecutive blocks Bw, Bx, and By that are processing targets of the second motion search.

図17Aにおいて、ブロックBwの探索範囲は、領域a及び領域bを含む。ブロックByの探索範囲は、領域d及び領域eを含む。ブロックBxの探索範囲は、領域c、領域b、及び領域dを含む。すなわち、領域bは、ブロックBwの探索範囲及びブロックBxの探索範囲が重なる部分であり、領域dは、ブロックByの探索範囲及びブロックBxの探索範囲が重なる部分である。   In FIG. 17A, the search range of the block Bw includes a region a and a region b. The search range of the block By includes a region d and a region e. The search range of the block Bx includes a region c, a region b, and a region d. That is, the region b is a portion where the search range of the block Bw and the search range of the block Bx overlap, and the region d is a portion where the search range of the block By and the search range of the block Bx overlap.

以下、説明を簡単にするため、図17Aに示した各探索範囲の全てが、参照画像メモリ42に記憶されていない範囲である(直接読出しが必要な範囲である)ものと仮定して説明する。   Hereinafter, in order to simplify the description, it is assumed that all of the search ranges shown in FIG. 17A are ranges that are not stored in the reference image memory 42 (a range that requires direct reading). .

図17Bは、各ブロックの処理期間毎に、参照バッファ49に保持される領域を模式的に表わした図である。(1)が、参照画キャッシュ機能を実行した場合を示し、(2)が、参照画キャッシュ機能を実行しない場合を示している。   FIG. 17B is a diagram schematically showing an area held in the reference buffer 49 for each processing period of each block. (1) shows the case where the reference picture cache function is executed, and (2) shows the case where the reference picture cache function is not executed.

まず、参照画キャッシュ機能を実行しない(2)について説明する。まず、ブロックBwの第2動き探索の前(t1の前)に、ブロックBwの探索範囲(領域a及び領域b)が参照バッファ49に保持される。また、原画バッファ48も更新される。   First, (2) in which the reference image cache function is not executed will be described. First, the search range (region a and region b) of the block Bw is held in the reference buffer 49 before the second motion search of the block Bw (before t1). The original picture buffer 48 is also updated.

ブロックBwの第2動き探索が終了した後、ブロックBxの第2動き探索の前に(すなわちt2において)、領域a及び領域bが、参照バッファ49から消去され、領域bが、再度フレームメモリ18から読出されて参照バッファ49に格納される。これにより、ブロックBxの第2動き探索の前に、ブロックBxの探索範囲(領域b、領域c、領域d)が参照バッファ49に保持される。また、原画バッファ48も更新される。   After the second motion search of the block Bw is finished and before the second motion search of the block Bx (that is, at t2), the region a and the region b are deleted from the reference buffer 49, and the region b is again stored in the frame memory 18 And stored in the reference buffer 49. Thereby, the search range (region b, region c, region d) of the block Bx is held in the reference buffer 49 before the second motion search of the block Bx. The original picture buffer 48 is also updated.

ブロックBxの第2動き探索が終了した後、ブロックByの第2動き探索の前に(すなわちt4において)、領域b、領域c、及び領域dが、参照バッファ49から消去され、領域dが、再度フレームメモリ18から読出されて参照バッファ49に格納される。これにより、ブロックByの第2動き探索の前に、ブロックByの探索範囲(領域d及び領域e)が参照バッファ49に保持される。また、原画バッファ48も更新される。   After the second motion search of the block Bx is finished and before the second motion search of the block By (ie, at t4), the region b, the region c, and the region d are deleted from the reference buffer 49, and the region d is It is read again from the frame memory 18 and stored in the reference buffer 49. Thereby, the search range (region d and region e) of the block By is held in the reference buffer 49 before the second motion search of the block By. The original picture buffer 48 is also updated.

図17Bの(2)に例示した構成では、フレームメモリ18に対するアクセス量が増える。従って、例えば、図10や図12を参照して説明した特定ブロック判定処理により特定ブロックを判定する場合等に採用することができる。   In the configuration illustrated in (2) of FIG. 17B, the amount of access to the frame memory 18 increases. Therefore, for example, it can be employed when a specific block is determined by the specific block determination process described with reference to FIGS. 10 and 12.

次に、参照画キャッシュ機能を実行する(1)について説明する。まず、(2)の場合と同様に、ブロックBwの第2動き探索の前に(t1の前に)、ブロックBwの探索範囲(領域a及び領域b)が参照バッファ49に保持される。また、原画バッファ48も更新される。   Next, (1) for executing the reference image cache function will be described. First, as in the case of (2), the search range (region a and region b) of the block Bw is held in the reference buffer 49 before the second motion search of the block Bw (before t1). The original picture buffer 48 is also updated.

ブロックBwの第2動き探索が終了した後、ブロックBxの第2動き探索の前に(すなわちt2において)、原画バッファ48が更新される。また、ブロックBxの処理で参照されない領域aは、参照バッファ49から消去される。更にまた、領域bは、ブロックBxの処理においても参照されるため、参照バッファ49から削除されることなく、そのまま保持される。従って、(1)の場合には、ブロックBxの探索前に、領域bを再度フレームメモリ18から読出して参照バッファ49に格納する必要はない。   After the second motion search of the block Bw ends, the original picture buffer 48 is updated before the second motion search of the block Bx (that is, at t2). Further, the area a that is not referred to in the processing of the block Bx is erased from the reference buffer 49. Furthermore, since the area b is also referred to in the processing of the block Bx, it is retained without being deleted from the reference buffer 49. Therefore, in the case of (1), it is not necessary to read the region b from the frame memory 18 again and store it in the reference buffer 49 before searching for the block Bx.

ブロックBxの第2動き探索が終了した後、ブロックByの第2動き探索の前に(すなわちt4において)、原画バッファ48が更新される。また、ブロックByの処理で参照されない領域b及び領域cは、参照バッファ49から消去される。更にまた、領域dは、ブロックByの処理においても参照されるため、参照バッファ49から削除されることなく、そのまま保持される。従って、(1)の場合には、ブロックByの探索前に、領域dを再度フレームメモリ18から読出して参照バッファ49に格納する必要はない。   After the second motion search of the block Bx ends, the original buffer 48 is updated before the second motion search of the block By (that is, at t4). In addition, the area b and the area c that are not referred to in the processing of the block By are deleted from the reference buffer 49. Furthermore, since the area d is also referred to in the processing of the block By, it is held as it is without being deleted from the reference buffer 49. Therefore, in the case of (1), it is not necessary to read the region d from the frame memory 18 again and store it in the reference buffer 49 before searching for the block By.

すなわち、第2動き探索部25の制御部45は、あるブロックの第2動き検出探索で使用した参照画像のうち、次のブロックの第2動き探索でも使用される領域については、次のブロックの第2動き探索が終了するまで参照バッファ49に保持されるよう制御する。次のブロックの第2動き探索では、該参照バッファ49に保持された領域を再利用することで、該再利用領域をフレームメモリ18から読み込まないようにしている。   That is, the control unit 45 of the second motion search unit 25 uses the next block of the reference image used in the second motion search of the next block for the region used in the second motion search of the next block. Control is performed so as to be held in the reference buffer 49 until the second motion search is completed. In the second motion search of the next block, the area held in the reference buffer 49 is reused so that the reuse area is not read from the frame memory 18.

図17Bの(2)に例示した構成では、フレームメモリ18に対するアクセス量が抑制される。従って、隣のブロックで読み込まれた範囲を参照画像として流用する場合に採用することができる。なお、(2)に例示した構成は、図10や図12を参照して説明した特定ブロック判定処理により特定ブロックを判定した場合であっても採用可能である。   In the configuration illustrated in (2) of FIG. 17B, the access amount to the frame memory 18 is suppressed. Therefore, it can be adopted when a range read in an adjacent block is used as a reference image. The configuration illustrated in (2) can be employed even when a specific block is determined by the specific block determination process described with reference to FIGS. 10 and 12.

なお、上記例では、原画バッファ48及び参照バッファ49をシングルバッファ構成とし、各ブロックの動き探索と、原画バッファ48及び参照バッファ49の更新とを交互に行う場合を例に挙げて説明したが、これに限定されない。例えば、原画バッファ48及び参照バッファ49の各々をダブルバッファ構成とし、図18に示すように、パイプライン的に処理を行うように構成してもよい。   In the above example, the original image buffer 48 and the reference buffer 49 are configured as a single buffer, and the motion search of each block and the update of the original image buffer 48 and the reference buffer 49 are alternately described as an example. It is not limited to this. For example, each of the original image buffer 48 and the reference buffer 49 may have a double buffer configuration, and may be configured to perform processing in a pipeline manner as shown in FIG.

また、上記説明した各例では、フレームメモリ18から直接探索範囲の参照画像を読出して参照バッファ49に格納するときの直接読出データ量が一律cであると仮定してNの値を設定し、特定ブロックを判定する例について説明したが、これに限定されない。例えば、フレームメモリ18から直接探索範囲の参照画像を読出すときの直接読出データ量を各ブロック毎に導出し、該導出した直接読出データ量の合計値が直接読出データ量の上限値DNを越えない範囲内で特定ブロックを判定するようにしてもよい。   In each example described above, the value of N is set assuming that the amount of directly read data when the reference image in the search range is directly read from the frame memory 18 and stored in the reference buffer 49 is uniform, Although the example which determines a specific block was demonstrated, it is not limited to this. For example, the direct read data amount when the reference image in the direct search range is read from the frame memory 18 is derived for each block, and the total value of the derived direct read data amounts exceeds the upper limit DN of the direct read data amount. You may make it determine a specific block within the range which does not exist.

ここで、図14を参照して例示した特定ブロック判定処理を、上記直接読出データ量をブロック毎に導出して判定する処理に変更した変形例を図19に示す。   Here, FIG. 19 shows a modification in which the specific block determination process exemplified with reference to FIG. 14 is changed to a process in which the direct read data amount is derived and determined for each block.

ステップ260及びステップ262の処理内容は、図14のステップ230及びステップ232と同じであるため、説明を省略する。   The processing contents of step 260 and step 262 are the same as those of step 230 and step 232 of FIG.

ステップ262の後、ステップ264において、判定部12は、ブロックBbの直接読出データ量dnを計算して導出する。直接読出データ量dnの計算方法は特に限定されないが、例えば、直接読出しを行う範囲の大きさをパラメータとする関数を予め用意しておき、該関数を用いて算出してもよい。   After step 262, in step 264, the determination unit 12 calculates and derives the direct read data amount dn of the block Bb. A method for calculating the direct read data amount dn is not particularly limited. For example, a function using the size of a range in which direct reading is performed as a parameter may be prepared in advance and calculated using the function.

上記関数は、直接読出しを行う範囲が大きいほど、値が大きくなる関数とすることができる。なお、直接読出しを行う範囲は、ブロックBbの第1動きベクトルに応じて設定される探索範囲から、参照画像メモリ42に記憶されている範囲を除外して求めればよい。   The above function can be a function whose value increases as the direct reading range increases. Note that the direct reading range may be obtained by excluding the range stored in the reference image memory 42 from the search range set according to the first motion vector of the block Bb.

ステップ266では、判定部12は、n+dn>DNであるか否かを判断する。DNは、直接読出しの際の直接読出データ量の合計値の上限値である。   In step 266, the determination unit 12 determines whether or not n + dn> DN. DN is an upper limit value of the total value of the direct read data amount at the time of direct reading.

ステップ266で否定判断した場合には、判定部12は、ステップ268において、ブロックBbを集合Sbに加え、nにdnを加算する。また、ステップ266で肯定判断した場合には、判定部12は、ステップ280に進む。なお、ステップ270からステップ280までの処理は、上記図14を参照して説明したステップ236からステップ248までの処理と同じであるため、説明を省略する。   If a negative determination is made in step 266, the determination unit 12 adds the block Bb to the set Sb in step 268 and adds dn to n. If the determination in step 266 is affirmative, the determination unit 12 proceeds to step 280. Note that the processing from step 270 to step 280 is the same as the processing from step 236 to step 248 described with reference to FIG.

このように、直接読出データ量を一律cとして直接読出データ量の合計値を算出するのではなく、実際に各ブロック毎に計算しながら特定ブロックの判定を進めて、その量をDN以下に抑えるようにしている。   In this way, the total value of the direct read data amount is not calculated with the direct read data amount being uniformly c, but the determination of the specific block is advanced while actually calculating for each block, and the amount is suppressed to DN or less. I am doing so.

直接読出データ量を一律cとする場合には、実際の直接読出データ量が変動しても直接読出データ量の合計値が上限値を超えないようNを低めに設定して運用する可能性があるが、これではメモリ帯域に余裕があっても特定ブロックが少なめに判定されてしまう。しかしながら、ブロック毎に直接読出データ量を計算する構成とすれば、より正確に合計値を計算できるため、DNを上限値そのもの或いは上限値に近い値に設定できる。これにより、より多くのブロックを特定ブロックと判定できる。   When the direct read data amount is uniformly c, even if the actual direct read data amount fluctuates, there is a possibility that the total value of the direct read data amount may be set low so that the total value does not exceed the upper limit value. However, in this case, even if there is a margin in the memory bandwidth, the number of specific blocks is determined to be small. However, if the read data amount is directly calculated for each block, the total value can be calculated more accurately, so that DN can be set to the upper limit value itself or a value close to the upper limit value. Thereby, more blocks can be determined as specific blocks.

なお、図10を参照して説明した特定ブロック判定処理においても同様に、直接読出データ量を一律cとせずに、ブロック毎に計算して判定してもよい。具体的には、ステップ202に代えて、以下の処理を行う。判定部12は、符号化効率が高いブロックから順に直接読出データ量を計算して累計していく。そして、判定部12は、直接読出データ量の累計値が上限値を超えたとき、符号化効率が最も高いブロックから上記累計値が上限値を超えたブロックより1つ上位のブロックまでの各ブロックを特定ブロックと判定してもよい。   Similarly, in the specific block determination process described with reference to FIG. 10, the direct read data amount may be calculated and determined for each block instead of being uniformly c. Specifically, instead of step 202, the following processing is performed. The determination unit 12 directly calculates and accumulates the read data amount in order from the block with the highest coding efficiency. Then, when the cumulative value of the directly read data amount exceeds the upper limit value, the determination unit 12 determines each block from the block with the highest coding efficiency to the block one higher than the block whose cumulative value exceeds the upper limit value. May be determined as a specific block.

また、図12を参照して説明した特定ブロック判定処理においても同様に、直接読出データ量を一律cとせずに、ブロック毎に計算して判定してもよい。例えば、図10のステップ214からステップ218の処理に代えて、以下の処理を行う。   Similarly, in the specific block determination process described with reference to FIG. 12, the direct read data amount may be calculated and determined for each block instead of being uniformly c. For example, instead of the processing from step 214 to step 218 in FIG.

判定部12は、ステップ214の処理に代えて、ヒストグラムの階級kに含まれる各ブロックの直接読出データ量を計算し、該階級kの直接読出データ量の合計値値Tkを計算する処理を行う。次に、判定部12は、ステップ216の処理に代えて、DtにTkを加算する処理を行う。次に、判定部12は、ステップ218の処理に代えて、Dt≦DNであるか否かを判定する。判定部12は、Dt≦DNである場合には、ステップ220に進み、Dt≦DNでない場合には、ステップ222に進む。   Instead of the process of step 214, the determination unit 12 calculates the direct read data amount of each block included in the histogram class k and performs a process of calculating the total value Tk of the direct read data amount of the class k. . Next, the determination unit 12 performs a process of adding Tk to Dt instead of the process of step 216. Next, the determination unit 12 determines whether or not Dt ≦ DN, instead of the process of step 218. The determination unit 12 proceeds to step 220 when Dt ≦ DN, and proceeds to step 222 when Dt ≦ DN is not satisfied.

以上説明した特定ブロック判定処理の変形例によっても、上記と同様の効果が得られる。   The same effect as described above can be obtained by the modification of the specific block determination process described above.

上記実施形態では、第1動き探索の処理単位のブロック(以下、第1ブロック)を元の倍率に戻したときのサイズと、第2動き探索の処理単位のブロック(以下、第2ブロック)のサイズが、同じである場合について説明したが、異なっていてもよい。仮に第2ブロックのサイズが、縮小前の第1ブロックのサイズよりも大きい場合には、以下のように処理してもよい。まず、第2ブロックに対応する複数の第1ブロックの第1動きベクトル、第1評価値、第2動きベクトル、第2評価値の各々の平均値を計算する。この4つの平均値を判定部12で用いて特定ブロックを判定する。処理方法は上記説明したように行えばよい。また、仮に第2ブロックのサイズが、縮小前の第1ブロックのサイズよりも小さい場合には、第2ブロックに該当する第1ブロックの第1動き探索の探索結果をそのまま用いればよい。   In the above embodiment, the size when the block of the first motion search processing unit (hereinafter referred to as the first block) is returned to the original magnification and the block of the processing unit of the second motion search (hereinafter referred to as the second block). Although the case where the sizes are the same has been described, they may be different. If the size of the second block is larger than the size of the first block before reduction, the following processing may be performed. First, an average value of each of the first motion vector, the first evaluation value, the second motion vector, and the second evaluation value of the plurality of first blocks corresponding to the second block is calculated. The determination unit 12 uses these four average values to determine a specific block. The processing method may be performed as described above. Further, if the size of the second block is smaller than the size of the first block before reduction, the search result of the first motion search of the first block corresponding to the second block may be used as it is.

更にまた、図20に示すように、符号化装置1の判定部12の機能をコンピュータにより実現し、第1動き探索部11及び主符号化処理部13の機能を、コンピュータに設けられた符号化部71により実現してもよい。   Furthermore, as shown in FIG. 20, the function of the determination unit 12 of the encoding device 1 is realized by a computer, and the functions of the first motion search unit 11 and the main encoding processing unit 13 are encoded by a computer. It may be realized by the unit 71.

コンピュータ60はCPU(Central Processing Unit)61、プログラムを記憶した不揮発性のプログラム記憶部62、メインメモリ15、画像処理部64、外部IF(Interface)66、画像入力IF67、及び符号化部71を備えている。メインメモリ15は、メモリコントローラ14に接続されている。そして、CPU61、プログラム記憶部62、メモリコントローラ14、画像処理部64、外部IF66、画像入力IF67、符号化部71は、バス70を介して互いに接続されている。図20に示すメモリコントローラ14及びメインメモリ15は、図1を用いて説明したメモリコントローラ14及びメインメモリ15に対応する。   The computer 60 includes a CPU (Central Processing Unit) 61, a nonvolatile program storage unit 62 that stores programs, a main memory 15, an image processing unit 64, an external IF (Interface) 66, an image input IF 67, and an encoding unit 71. ing. The main memory 15 is connected to the memory controller 14. The CPU 61, the program storage unit 62, the memory controller 14, the image processing unit 64, the external IF 66, the image input IF 67, and the encoding unit 71 are connected to each other via a bus 70. The memory controller 14 and the main memory 15 shown in FIG. 20 correspond to the memory controller 14 and the main memory 15 described with reference to FIG.

プログラム記憶部62には、判定部12の判定処理を実行するための判定プログラムが記憶されている。   The program storage unit 62 stores a determination program for executing the determination process of the determination unit 12.

CPU61は、プログラム記憶部62から判定プログラムを読み出してメインメモリ15に展開し、判定プログラムのプロセスを実行する。CPU61が判定プログラムのプロセスを実行することで、図1に示した判定部12の機能が実現される。なお、CPU61が実行するプログラムを展開するメモリは、メインメモリ15とは異なるメモリであってもよい。   The CPU 61 reads out the determination program from the program storage unit 62 and develops it in the main memory 15 to execute the determination program process. The function of the determination unit 12 illustrated in FIG. 1 is realized by the CPU 61 executing the determination program process. Note that the memory for developing the program executed by the CPU 61 may be a memory different from the main memory 15.

外部IF66は、記録メディア68及び操作パネルコントローラ69のインタフェースである。画像入力IF67は、動画像等を入力するためのインタフェースである。   The external IF 66 is an interface between the recording medium 68 and the operation panel controller 69. The image input IF 67 is an interface for inputting a moving image or the like.

符号化部71は、ASIC等のハードウェアにより、第1動き探索部11及び主符号化処理部13の機能を実現する。   The encoding unit 71 realizes the functions of the first motion search unit 11 and the main encoding processing unit 13 by hardware such as ASIC.

このような構成によっても、上記と同様に作用する。   Such a configuration also acts in the same manner as described above.

なお、上記では判定プログラムがプログラム記憶部62に記憶されている態様を説明したが、判定プログラムは、CD−ROMや、USBを介して接続可能なフラッシュメモリ等の可搬型の記録媒体に記録されている形態で提供することも可能である。   In the above description, the determination program is stored in the program storage unit 62. However, the determination program is recorded on a portable recording medium such as a CD-ROM or a flash memory connectable via USB. It is also possible to provide it in the form.

本明細書に記載された全ての文献、特許出願及び技術規格は、個々の文献、特許出願及び技術規格が参照により取り込まれることが具体的かつ個々に記された場合と同程度に、本明細書中に参照により取り込まれる。   All documents, patent applications and technical standards mentioned in this specification are to the same extent as if each individual document, patent application and technical standard were specifically and individually stated to be incorporated by reference. Incorporated by reference in the book.

以上の実施形態に関し、更に以下の付記を開示する。   Regarding the above embodiment, the following additional notes are disclosed.

(付記1)
縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める第1処理と、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める第2処理と、を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行う第1動き探索部と、
前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する参照画像記憶部と、
前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、
前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させる制御部と、
前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを、前記第1動きベクトルを用いて前記第2動き探索を行う特定ブロックとして判定し、前記特定ブロック以外のブロックを、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックとして判定する判定部と、
前記判定部において前記特定ブロックと判定されたブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照し、前記第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照して動きベクトルを探索する前記第2動き探索を行い、前記判定部において前記非特定ブロックと判定されたブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う第2動き探索部と、
を備えた符号化装置。
(Appendix 1)
A first process for searching for a first motion vector with reference to a first search range in the reduced reference frame image to obtain an encoding efficiency, and a first process smaller than the first search range in the reduced reference frame image. A second motion vector is searched for a second motion vector with reference to a second search range included in one search range, and encoding efficiency is obtained. A first motion search unit for each block that is a processing unit of the first motion search;
A reference image storage unit for storing a reference image partially read from a storage unit for storing a reference frame image referred to in a second motion search performed based on the processing result of the first motion search;
For each block that is a processing unit of the second motion search in the processing target frame image,
A control unit that stores the reference image including the search range of the second motion search set based on the second motion vector in the reference image storage unit before starting the second motion search of each block;
The reference frame image is directly read from the storage unit without going through the reference image storage unit among a plurality of blocks when the processing target frame image is divided into blocks which are processing units of the second motion search. A block in which the first motion vector has higher encoding efficiency than the second motion vector within a range in which the total value of the directly read data amount does not exceed the upper limit value, using the first motion vector A determination unit that determines as a specific block that performs the second motion search, and determines a block other than the specific block as a non-specific block that performs the second motion search using the second motion vector;
The block determined as the specific block by the determination unit is set based on the first motion vector with reference to an image in a search range set based on the first motion vector in the reference frame image. When referring to at least an image that is not stored in the reference image storage unit among images in the search range, a motion vector is searched by referring to an image directly read from the storage unit without going through the reference image storage unit. The second motion search is performed, and the block determined as the non-specific block by the determination unit is set based on the second motion vector among the reference images stored in the reference image storage unit. A second motion search unit for performing the second motion search for searching for a motion vector with reference to an image of the search range to be performed;
An encoding device comprising:

(付記2)
前記判定部は、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い順に上位N個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)のブロックを前記特定ブロックとして判定するか、又は、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い方から順に前記直接読出データ量を累計したときの累計値が前記上限値を越えない範囲内で、前記第1動きベクトルの符号化効率が高いブロックから順に前記特定ブロックとして判定する
付記1に記載の符号化装置。
(Appendix 2)
The determination unit selects a block having a higher encoding efficiency for the first motion vector than the second motion vector among the plurality of blocks, and selects the first motion vector of the selected blocks. The top N blocks (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value) are determined as the specific block in descending order of coding efficiency, or Among the selected blocks, the code of the first motion vector is within a range where the cumulative value when the direct read data amount is accumulated in order from the highest coding efficiency of the first motion vector does not exceed the upper limit value. The encoding device according to appendix 1, wherein the specific blocks are determined in order from the block having the highest conversion efficiency.

(付記3)
前記判定部は、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックについて、各ブロックの第1動きベクトルの符号化効率を示す値の度数分布又はヒストグラムを生成し、前記生成した度数分布又はヒストグラムの前記値が示す符号化効率が高い順に上位の階級から度数を加算していき、度数の累計値がN(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定するか、又は、前記値が示す符号化効率が高い順に上位の階級から各ブロックの前記直接読出データ量を加算していき、その累計値が前記上限値を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定する
付記1に記載の符号化装置。
(Appendix 3)
The determination unit selects a block in which the first motion vector has higher encoding efficiency than the second motion vector among the plurality of blocks, and the first motion vector of each block is selected for the selected block. A frequency distribution or histogram of values indicating the coding efficiency of the generated frequency distribution or histogram is generated, the frequencies are added from the higher rank in order of the coding efficiency indicated by the value of the generated frequency distribution or histogram, the cumulative value of the frequency is Whether the block included in each of the classes higher than the class exceeding N (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value) is determined as the specific block Alternatively, the direct reading data amount of each block is added from the upper class in descending order of the coding efficiency indicated by the value, and the cumulative value exceeds the upper limit value. Encoding apparatus according to note 1 determines blocks included in each class of higher as the specific block.

(付記4)
前記判定部は、
前記複数のブロックのうち、既に前記特定ブロックと判定されたブロックを除くブロックから、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを抽出し、該抽出したブロックの中で前記第1動きベクトルの符号化効率が最も高いブロックを前記特定ブロックとして判定する第1判定処理と、
前記第1判定処理が1回実行される毎に、両隣が前記特定ブロックとされたブロックを選択し、該選択したブロックの各々について、前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される第3探索範囲が、前記両隣の特定ブロックが前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される探索範囲の各々と、前記両隣が前記特定ブロックとされたブロックの前記第2動き探索の処理中に前記参照画像記憶部に記憶されている範囲との合成範囲に含まれるか否かを判定し、前記第3探索範囲が前記合成範囲に含まれると判定したブロックを、前記特定ブロックとして判定する第2判定処理とを、
前記第1の判定処理においてN個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)の特定ブロックが判定されるまで繰り返し行うか、又は、前記第1判定処理で前記特定ブロックと判定されたブロックの前記直接読出データ量の合計値が前記上限値を越えない範囲内で繰り返し行う
付記1に記載の符号化装置。
(Appendix 4)
The determination unit
A block having a higher encoding efficiency of the first motion vector than the second motion vector is extracted from blocks excluding the block that has already been determined to be the specific block among the plurality of blocks, and the extracted block A first determination process for determining a block having the highest coding efficiency of the first motion vector as the specific block,
Each time the first determination process is executed once, the blocks whose both neighbors are the specific blocks are selected, and each of the selected blocks is the second motion search processing target. A third search range set based on one motion vector, each of the search ranges set based on the first motion vector when the adjacent blocks on both sides are set as the second motion search processing target; Determining whether or not the neighbor is included in a synthesis range with a range stored in the reference image storage unit during the second motion search process of the block determined as the specific block; A second determination process for determining, as the specific block, a block whose range is determined to be included in the synthesis range,
Repeatedly until N specific blocks are determined in the first determination process (N is an integer set in advance so that the total value of the directly read data amounts does not exceed the upper limit value), or The encoding apparatus according to claim 1, wherein the encoding is performed repeatedly within a range in which a total value of the direct read data amounts of the blocks determined as the specific block in the first determination process does not exceed the upper limit value.

(付記5)
前記制御部は、前記第2動き探索の処理対象のブロックが次のブロックに切替えられる際に、前記次のブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性がない参照画像を前記参照画像記憶部から消去し、前記次のブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性があるものの、前記参照画像記憶部に未だ記憶されていない参照画像を前記記憶部から読出して前記参照画像記憶部に記憶する制御を行う
付記1〜付記4の何れか1項記載の符号化装置。
(Appendix 5)
The control unit, when the block to be processed in the second motion search is switched to the next block, a reference image that may not be set as a search range when the next block is the non-specific block Is deleted from the reference image storage unit, and a reference image that is not yet stored in the reference image storage unit may be set as a search range when the next block is the non-specific block. The encoding apparatus according to any one of Supplementary Note 1 to Supplementary Note 4, wherein control is performed to read out from the storage unit and store the read-out in the reference image storage unit.

(付記6)
前記制御部は、前記第2動き探索の処理対象のブロックが次のブロックに切替えられる際に、該切替以降に処理対象とされる各ブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性がない参照画像を前記参照画像記憶部から消去し、前記次のブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性があるものの、前記参照画像記憶部に未だ記憶されていない参照画像を前記記憶部から読出して前記参照画像記憶部に記憶する
付記1〜付記4の何れか1項記載の符号化装置。
(Appendix 6)
The control unit is set as a search range when the block to be processed in the second motion search is switched to the next block, and each block to be processed after the switching is set as the non-specific block. The reference image that is not likely to be deleted is erased from the reference image storage unit and may be set as a search range when the next block is the non-specific block, but is still stored in the reference image storage unit The encoding apparatus according to claim 1, wherein a reference image that has not been read is read from the storage unit and stored in the reference image storage unit.

(付記7)
縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める第1処理と、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める第2処理と、を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行い、
前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する参照画像記憶部に、前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させ、
前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを、前記第1動きベクトルを用いて前記第2動き探索を行う特定ブロックとして判定し、前記特定ブロック以外のブロックを、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックとして判定し、
前記特定ブロックと判定されたブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照し、前記第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照して動きベクトルを探索する前記第2動き探索を行い、前記非特定ブロックと判定されたブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う、
符号化方法。
(Appendix 7)
A first process for searching for a first motion vector with reference to a first search range in the reduced reference frame image to obtain an encoding efficiency, and a first process smaller than the first search range in the reduced reference frame image. A second motion vector is searched for a second motion vector with reference to a second search range included in one search range, and encoding efficiency is obtained. It is performed for each block that is a processing unit of the first motion search,
The reference image storage unit that stores the reference image partially read from the storage unit that stores the reference frame image referred to in the second motion search performed based on the processing result of the first motion search includes the process. The reference image including the search range of the second motion search that is set based on the second motion vector for each block that is a processing unit of the second motion search in the target frame image, Store in the reference image storage unit before the start of the second motion search,
The reference frame image is directly read from the storage unit without going through the reference image storage unit among a plurality of blocks when the processing target frame image is divided into blocks which are processing units of the second motion search. A block in which the first motion vector has higher encoding efficiency than the second motion vector within a range in which the total value of the directly read data amount does not exceed the upper limit value, using the first motion vector Determining as a specific block for performing the second motion search, determining a block other than the specific block as a non-specific block for performing the second motion search using the second motion vector;
For the block determined to be the specific block, the image of the search range set based on the first motion vector is referenced with reference to the image of the search range set based on the first motion vector in the reference frame image. When referring to at least an image not stored in the reference image storage unit among the images, the second search is made for a motion vector by referring to an image directly read from the storage unit without going through the reference image storage unit. For a block determined as a non-specific block by performing a motion search, refer to an image in a search range set based on the second motion vector among the reference images stored in the reference image storage unit. And performing the second motion search for searching for a motion vector.
Encoding method.

(付記8)
前記特定ブロックの判定において、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い順に上位N個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)のブロックを前記特定ブロックとして判定するか、又は、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い方から順に前記直接読出データ量を累計したときの累計値が前記上限値を越えない範囲内で、前記第1動きベクトルの符号化効率が高いブロックから順に前記特定ブロックとして判定する
付記7に記載の符号化方法。
(Appendix 8)
In the determination of the specific block, a block in which the first motion vector has higher encoding efficiency than the second motion vector is selected from the plurality of blocks, and the first motion is selected from the selected blocks. The top N blocks (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit) are determined as the specific blocks in descending order of vector encoding efficiency, or In the selected block, the first motion vector is within a range in which the cumulative value when the direct read data amount is accumulated in order from the highest coding efficiency of the first motion vector does not exceed the upper limit value. The encoding method according to appendix 7, wherein the specific block is determined in order from the block having the highest encoding efficiency.

(付記9)
前記特定ブロックの判定において、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックについて、各ブロックの第1動きベクトルの符号化効率を示す値の度数分布又はヒストグラムを生成し、前記生成した度数分布又はヒストグラムの前記値が示す符号化効率が高い順に上位の階級から度数を加算していき、度数の累計値がN(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定するか、又は、前記値が示す符号化効率が高い順に上位の階級から各ブロックの前記直接読出データ量を加算していき、その累計値が前記上限値を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定する
付記7に記載の符号化方法。
(Appendix 9)
In the determination of the specific block, a block in which the first motion vector has a higher encoding efficiency than the second motion vector is selected from the plurality of blocks, and the first block of each block is selected for the selected block. Generate a frequency distribution or histogram of values indicating the coding efficiency of the motion vector, add the frequencies from the upper rank in descending order of the coding efficiency indicated by the value of the generated frequency distribution or histogram, and accumulate the frequencies A block included in each of the classes higher than the class whose value exceeds N (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value) is determined as the specific block. Or the direct read data amount of each block is added from the upper class in descending order of the coding efficiency indicated by the value, and the cumulative value is Encoding method according to determining Appendix 7 blocks contained from class beyond a value to each of the class of higher as the specific block.

(付記10)
前記特定ブロックの判定において、前記複数のブロックのうち、既に前記特定ブロックと判定されたブロックを除くブロックから、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを抽出し、該抽出したブロックの中で前記第1動きベクトルの符号化効率が最も高いブロックを前記特定ブロックとして判定する第1判定処理と、
前記第1判定処理が1回実行される毎に、両隣が前記特定ブロックとされたブロックを選択し、該選択したブロックの各々について、前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される第3探索範囲が、前記両隣の特定ブロックが前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される探索範囲の各々と、前記両隣が前記特定ブロックとされたブロックの前記第2動き探索の処理中に前記参照画像記憶部に記憶されている範囲との合成範囲に含まれるか否かを判定し、前記第3探索範囲が前記合成範囲に含まれると判定したブロックを、前記特定ブロックとして判定する第2判定処理とを、
前記第1の判定処理においてN個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)の特定ブロックが判定されるまで繰り返し行うか、又は、前記第1判定処理で前記特定ブロックと判定されたブロックの前記直接読出データ量の合計値が前記上限値を越えない範囲内で繰り返し行う
付記7に記載の符号化方法。
(Appendix 10)
In the determination of the specific block, out of the plurality of blocks excluding blocks that have already been determined as the specific block, the first motion vector has a higher encoding efficiency than the second motion vector. A first determination process of extracting and determining a block having the highest coding efficiency of the first motion vector among the extracted blocks as the specific block;
Each time the first determination process is executed once, the blocks whose both neighbors are the specific blocks are selected, and each of the selected blocks is the second motion search processing target. A third search range set based on one motion vector, each of the search ranges set based on the first motion vector when the adjacent blocks on both sides are set as the second motion search processing target; Determining whether or not the neighbor is included in a synthesis range with a range stored in the reference image storage unit during the second motion search process of the block determined as the specific block; A second determination process for determining, as the specific block, a block whose range is determined to be included in the synthesis range,
Repeatedly until N specific blocks are determined in the first determination process (N is an integer set in advance so that the total value of the directly read data amounts does not exceed the upper limit value), or The encoding method according to claim 7, wherein the encoding is performed repeatedly within a range in which a total value of the direct read data amounts of the blocks determined as the specific block in the first determination process does not exceed the upper limit value.

(付記11)
縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める第1処理と、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める第2処理と、を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行う第1動き探索部、前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する参照画像記憶部、前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、
前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させる制御部、及び前記第1動きベクトルを用いて前記第2動き探索を行う特定ブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照し、前記第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照して動きベクトルを探索する前記第2動き探索を行い、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う第2動き探索部、を備えた装置の前記第1動き探索部の処理結果を取得するコンピュータに、
前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを前特定ブロックとして判定し、前記特定ブロック以外のブロックを前記非特定ブロックとして判定し、該判定結果を前記第2動き探索部に供給する
処理を実行させるためのプログラム又はプログラムを記録した記録媒体。
(Appendix 11)
A first process for searching for a first motion vector with reference to a first search range in the reduced reference frame image to obtain an encoding efficiency, and a first process smaller than the first search range in the reduced reference frame image. A second motion vector is searched for a second motion vector with reference to a second search range included in one search range, and encoding efficiency is obtained. A first motion search unit that is performed for each block that is a processing unit of the first motion search, and a storage unit that stores a reference frame image that is referred to in the second motion search performed based on the processing result of the first motion search A reference image storage unit that stores a reference image partially read out from each of the blocks to be a processing unit of the second motion search in the processing target frame image,
A control unit that stores the reference image including the search range of the second motion search set based on the second motion vector in the reference image storage unit before starting the second motion search of each block; and For a specific block for performing the second motion search using the first motion vector, refer to an image in a search range set based on the first motion vector in the reference frame image, and the first motion vector When referring to at least an image that is not stored in the reference image storage unit among images in the search range set based on the image, the image directly read from the storage unit is referred to without going through the reference image storage unit. For the non-specific block that performs the second motion search for searching for a motion vector and performs the second motion search using the second motion vector, the reference image A second motion search unit for performing the second motion search for searching for a motion vector with reference to an image in a search range set based on the second motion vector among the reference images stored in a storage unit; A computer for obtaining a processing result of the first motion search unit of the apparatus comprising:
The reference frame image is directly read from the storage unit without going through the reference image storage unit among a plurality of blocks when the processing target frame image is divided into blocks which are processing units of the second motion search. A block in which the first motion vector has a higher encoding efficiency than the second motion vector within a range in which the total value of the directly read data amount does not exceed an upper limit value, A program for recording a program or a program for executing a process of determining a block other than a block as the non-specific block and supplying the determination result to the second motion search unit.

(付記12)
前記処理では、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い順に上位N個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)のブロックを前記特定ブロックとして判定するか、又は、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い方から順に前記直接読出データ量を累計したときの累計値が前記上限値を越えない範囲内で、前記第1動きベクトルの符号化効率が高いブロックから順に前記特定ブロックとして判定する
付記7に記載のプログラム又はプログラムを記録した記録媒体。
(Appendix 12)
In the processing, a block in which the first motion vector has higher encoding efficiency than the second motion vector is selected from the plurality of blocks, and the code of the first motion vector is selected from the selected blocks. The top N blocks (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value) are determined as the specific blocks in descending order of the conversion efficiency, or the selection The first motion vector is encoded within a range in which the cumulative value when the amount of the directly read data is accumulated in order from the block having the highest coding efficiency of the first motion vector is within the range not exceeding the upper limit value. The program according to appendix 7, or a recording medium on which the program is recorded, is determined as the specific block in order from the block having the highest efficiency.

(付記13)
前記処理では、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックについて、各ブロックの第1動きベクトルの符号化効率を示す値の度数分布又はヒストグラムを生成し、前記生成した度数分布又はヒストグラムの前記値が示す符号化効率が高い順に上位の階級から度数を加算していき、度数の累計値がN(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定するか、又は、前記値が示す符号化効率が高い順に上位の階級から各ブロックの前記直接読出データ量を加算していき、その累計値が前記上限値を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定する
付記7に記載のプログラム又はプログラムを記録した記録媒体。
(Appendix 13)
In the processing, a block in which the first motion vector has higher encoding efficiency than the second motion vector is selected from the plurality of blocks, and the first motion vector of each block is selected for the selected block. A frequency distribution or histogram of values indicating the coding efficiency is generated, and the frequencies are added from the higher rank in order from the highest coding efficiency indicated by the value of the generated frequency distribution or histogram. (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value). Alternatively, the direct read data amount of each block is added from the upper class in the descending order of the coding efficiency indicated by the value, and the cumulative value exceeds the upper limit. Recording medium for recording a description of a program or programs to determine note 7 blocks included in each of the classes of the upper as the specific block.

(付記14)
前記処理では、
前記複数のブロックのうち、既に前記特定ブロックと判定されたブロックを除くブロックから、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを抽出し、該抽出したブロックの中で前記第1動きベクトルの符号化効率が最も高いブロックを前記特定ブロックとして判定する第1判定処理と、
前記第1判定処理が1回実行される毎に、両隣が前記特定ブロックとされたブロックを選択し、該選択したブロックの各々について、前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される第3探索範囲が、前記両隣の特定ブロックが前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される探索範囲の各々と、前記両隣が前記特定ブロックとされたブロックの前記第2動き探索の処理中に前記参照画像記憶部に記憶されている範囲との合成範囲に含まれるか否かを判定し、前記第3探索範囲が前記合成範囲に含まれると判定したブロックを、前記特定ブロックとして判定する第2判定処理とを、
前記第1の判定処理においてN個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)の特定ブロックが判定されるまで繰り返し行うか、又は、前記第1判定処理で前記特定ブロックと判定されたブロックの前記直接読出データ量の合計値が前記上限値を越えない範囲内で繰り返し行う
付記7に記載のプログラム又はプログラムを記録した記録媒体。
(Appendix 14)
In the process,
A block having a higher encoding efficiency of the first motion vector than the second motion vector is extracted from blocks excluding the block that has already been determined to be the specific block among the plurality of blocks, and the extracted block A first determination process for determining a block having the highest coding efficiency of the first motion vector as the specific block,
Each time the first determination process is executed once, the blocks whose both neighbors are the specific blocks are selected, and each of the selected blocks is the second motion search processing target. A third search range set based on one motion vector, each of the search ranges set based on the first motion vector when the adjacent blocks on both sides are set as the second motion search processing target; Determining whether or not the neighbor is included in a synthesis range with a range stored in the reference image storage unit during the second motion search process of the block determined as the specific block; A second determination process for determining, as the specific block, a block whose range is determined to be included in the synthesis range,
Repeatedly until N specific blocks are determined in the first determination process (N is an integer set in advance so that the total value of the directly read data amounts does not exceed the upper limit value), or The program according to claim 7 or a recording medium on which the program is recorded is repeatedly performed within a range in which a total value of the direct read data amounts of the blocks determined as the specific block in the first determination process does not exceed the upper limit value.

1 符号化装置
10 縮小部
11 第1動き探索部
12 判定部
13 主符号化処理部
14 メモリコントローラ
15 メインメモリ
16 縮小画メモリ
17 原画メモリ
18 フレームメモリ
25 第2動き探索部
26 フレーム間予測部
27 参照画像メモリ回路
31 エントロピー符号化部
41 制御部
42 参照画像メモリ
60 コンピュータ
61 CPU
62 プログラム記憶部
71 符号化部
DESCRIPTION OF SYMBOLS 1 Encoding apparatus 10 Reduction part 11 1st motion search part 12 Judgment part 13 Main encoding process part 14 Memory controller 15 Main memory 16 Reduced picture memory 17 Original picture memory 18 Frame memory 25 2nd motion search part 26 Inter frame prediction part 27 Reference image memory circuit 31 Entropy encoding unit 41 Control unit 42 Reference image memory 60 Computer 61 CPU
62 Program storage unit 71 Coding unit

Claims (8)

縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める第1処理と、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める第2処理と、を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行う第1動き探索部と、
前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する参照画像記憶部と、
前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、
前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させる制御部と、
前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを、前記第1動きベクトルを用いて前記第2動き探索を行う特定ブロックとして判定し、前記特定ブロック以外のブロックを、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックとして判定する判定部と、
前記判定部において前記特定ブロックと判定されたブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照し、前記第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照して動きベクトルを探索する前記第2動き探索を行い、前記判定部において前記非特定ブロックと判定されたブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う第2動き探索部と、
を備えた符号化装置。
A first process for searching for a first motion vector with reference to a first search range in the reduced reference frame image to obtain an encoding efficiency, and a first process smaller than the first search range in the reduced reference frame image. A second motion vector is searched for a second motion vector with reference to a second search range included in one search range, and encoding efficiency is obtained. A first motion search unit for each block that is a processing unit of the first motion search;
A reference image storage unit for storing a reference image partially read from a storage unit for storing a reference frame image referred to in a second motion search performed based on the processing result of the first motion search;
For each block that is a processing unit of the second motion search in the processing target frame image,
A control unit that stores the reference image including the search range of the second motion search set based on the second motion vector in the reference image storage unit before starting the second motion search of each block;
The reference frame image is directly read from the storage unit without going through the reference image storage unit among a plurality of blocks when the processing target frame image is divided into blocks which are processing units of the second motion search. A block in which the first motion vector has higher encoding efficiency than the second motion vector within a range in which the total value of the directly read data amount does not exceed the upper limit value, using the first motion vector A determination unit that determines as a specific block that performs the second motion search, and determines a block other than the specific block as a non-specific block that performs the second motion search using the second motion vector;
The block determined as the specific block by the determination unit is set based on the first motion vector with reference to an image in a search range set based on the first motion vector in the reference frame image. When referring to at least an image that is not stored in the reference image storage unit among images in the search range, a motion vector is searched by referring to an image directly read from the storage unit without going through the reference image storage unit. The second motion search is performed, and the block determined as the non-specific block by the determination unit is set based on the second motion vector among the reference images stored in the reference image storage unit. A second motion search unit for performing the second motion search for searching for a motion vector with reference to an image of the search range to be performed;
An encoding device comprising:
前記判定部は、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い順に上位N個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)のブロックを前記特定ブロックとして判定するか、又は、前記選択したブロックのうち、前記第1動きベクトルの符号化効率が高い方から順に前記直接読出データ量を累計したときの累計値が前記上限値を越えない範囲内で、前記第1動きベクトルの符号化効率が高いブロックから順に前記特定ブロックとして判定する
請求項1に記載の符号化装置。
The determination unit selects a block having a higher encoding efficiency for the first motion vector than the second motion vector among the plurality of blocks, and selects the first motion vector of the selected blocks. The top N blocks (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value) are determined as the specific block in descending order of coding efficiency, or Among the selected blocks, the code of the first motion vector is within a range where the cumulative value when the direct read data amount is accumulated in order from the highest coding efficiency of the first motion vector does not exceed the upper limit value. The encoding apparatus according to claim 1, wherein the specific blocks are determined in order from the block having the highest conversion efficiency.
前記判定部は、前記複数のブロックのうち、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを選択し、前記選択したブロックについて、各ブロックの第1動きベクトルの符号化効率を示す値の度数分布又はヒストグラムを生成し、前記生成した度数分布又はヒストグラムの前記値が示す符号化効率が高い順に上位の階級から度数を加算していき、度数の累計値がN(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定するか、又は、前記値が示す符号化効率が高い順に上位の階級から各ブロックの前記直接読出データ量を加算していき、その累計値が前記上限値を越えた階級より上位の階級の各々に含まれるブロックを前記特定ブロックとして判定する
請求項1に記載の符号化装置。
The determination unit selects a block in which the first motion vector has higher encoding efficiency than the second motion vector among the plurality of blocks, and the first motion vector of each block is selected for the selected block. A frequency distribution or histogram of values indicating the coding efficiency of the generated frequency distribution or histogram is generated, the frequencies are added from the higher rank in order of the coding efficiency indicated by the value of the generated frequency distribution or histogram, the cumulative value of the frequency is Whether the block included in each of the classes higher than the class exceeding N (N is an integer set in advance so that the total value of the directly read data amount does not exceed the upper limit value) is determined as the specific block Alternatively, the direct reading data amount of each block is added from the upper class in descending order of the coding efficiency indicated by the value, and the cumulative value exceeds the upper limit value. The encoding apparatus according to claim 1 determines blocks included in each class of higher as the specific block.
前記判定部は、
前記複数のブロックのうち、既に前記特定ブロックと判定されたブロックを除くブロックから、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを抽出し、該抽出したブロックの中で前記第1動きベクトルの符号化効率が最も高いブロックを前記特定ブロックとして判定する第1判定処理と、
前記第1判定処理が1回実行される毎に、両隣が前記特定ブロックとされたブロックを選択し、該選択したブロックの各々について、前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される第3探索範囲が、前記両隣の特定ブロックが前記第2動き探索の処理対象とされたときの前記第1動きベクトルに基づいて設定される探索範囲の各々と、前記両隣が前記特定ブロックとされたブロックの前記第2動き探索の処理中に前記参照画像記憶部に記憶されている範囲との合成範囲に含まれるか否かを判定し、前記第3探索範囲が前記合成範囲に含まれると判定したブロックを、前記特定ブロックとして判定する第2判定処理とを、
前記第1の判定処理においてN個(Nは、前記直接読出データ量の合計値が前記上限値を超えないように予め設定された整数)の特定ブロックが判定されるまで繰り返し行うか、又は、前記第1判定処理で前記特定ブロックと判定されたブロックの前記直接読出データ量の合計値が前記上限値を越えない範囲内で繰り返し行う
請求項1に記載の符号化装置。
The determination unit
A block having a higher encoding efficiency of the first motion vector than the second motion vector is extracted from blocks excluding the block that has already been determined to be the specific block among the plurality of blocks, and the extracted block A first determination process for determining a block having the highest coding efficiency of the first motion vector as the specific block,
Each time the first determination process is executed once, the blocks whose both neighbors are the specific blocks are selected, and each of the selected blocks is the second motion search processing target. A third search range set based on one motion vector, each of the search ranges set based on the first motion vector when the adjacent blocks on both sides are set as the second motion search processing target; Determining whether or not the neighbor is included in a synthesis range with a range stored in the reference image storage unit during the second motion search process of the block determined as the specific block; A second determination process for determining, as the specific block, a block whose range is determined to be included in the synthesis range,
Repeatedly until N specific blocks are determined in the first determination process (N is an integer set in advance so that the total value of the directly read data amounts does not exceed the upper limit value), or The encoding apparatus according to claim 1, wherein the encoding is performed repeatedly within a range in which a total value of the direct read data amounts of the blocks determined as the specific block in the first determination process does not exceed the upper limit value.
前記制御部は、前記第2動き探索の処理対象のブロックが次のブロックに切替えられる際に、前記次のブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性がない参照画像を前記参照画像記憶部から消去し、前記次のブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性があるものの、前記参照画像記憶部に未だ記憶されていない参照画像を前記記憶部から読出して前記参照画像記憶部に記憶する制御を行う
請求項1〜請求項4の何れか1項記載の符号化装置。
The control unit, when the block to be processed in the second motion search is switched to the next block, a reference image that may not be set as a search range when the next block is the non-specific block Is deleted from the reference image storage unit, and a reference image that is not yet stored in the reference image storage unit may be set as a search range when the next block is the non-specific block. The encoding device according to any one of claims 1 to 4, wherein control is performed to read from the storage unit and store the read-out image in the reference image storage unit.
前記制御部は、前記第2動き探索の処理対象のブロックが次のブロックに切替えられる際に、該切替以降に処理対象とされる各ブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性がない参照画像を前記参照画像記憶部から消去し、前記次のブロックを前記非特定ブロックとしたときに探索範囲として設定される可能性があるものの、前記参照画像記憶部に未だ記憶されていない参照画像を前記記憶部から読出して前記参照画像記憶部に記憶する
請求項1〜請求項4の何れか1項記載の符号化装置。
The control unit is set as a search range when the block to be processed in the second motion search is switched to the next block, and each block to be processed after the switching is set as the non-specific block. The reference image that is not likely to be deleted is erased from the reference image storage unit and may be set as a search range when the next block is the non-specific block, but is still stored in the reference image storage unit The encoding device according to any one of claims 1 to 4, wherein a reference image that has not been read is read from the storage unit and stored in the reference image storage unit.
縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める第1処理と、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める第2処理と、を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行い、
前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する参照画像記憶部に、前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させ、
前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを、前記第1動きベクトルを用いて前記第2動き探索を行う特定ブロックとして判定し、前記特定ブロック以外のブロックを、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックとして判定し、
前記特定ブロックと判定されたブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照し、前記第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照して動きベクトルを探索する前記第2動き探索を行い、前記非特定ブロックと判定されたブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う、
符号化方法。
A first process for searching for a first motion vector with reference to a first search range in the reduced reference frame image to obtain an encoding efficiency, and a first process smaller than the first search range in the reduced reference frame image. A second motion vector is searched for a second motion vector with reference to a second search range included in one search range, and encoding efficiency is obtained. It is performed for each block that is a processing unit of the first motion search,
The reference image storage unit that stores the reference image partially read from the storage unit that stores the reference frame image referred to in the second motion search performed based on the processing result of the first motion search includes the process. The reference image including the search range of the second motion search that is set based on the second motion vector for each block that is a processing unit of the second motion search in the target frame image, Store in the reference image storage unit before the start of the second motion search,
The reference frame image is directly read from the storage unit without going through the reference image storage unit among a plurality of blocks when the processing target frame image is divided into blocks which are processing units of the second motion search. A block in which the first motion vector has higher encoding efficiency than the second motion vector within a range in which the total value of the directly read data amount does not exceed the upper limit value, using the first motion vector Determining as a specific block for performing the second motion search, determining a block other than the specific block as a non-specific block for performing the second motion search using the second motion vector;
For the block determined to be the specific block, the image of the search range set based on the first motion vector is referenced with reference to the image of the search range set based on the first motion vector in the reference frame image. When referring to at least an image not stored in the reference image storage unit among the images, the second search is made for a motion vector by referring to an image directly read from the storage unit without going through the reference image storage unit. For a block determined as a non-specific block by performing a motion search, refer to an image in a search range set based on the second motion vector among the reference images stored in the reference image storage unit. And performing the second motion search for searching for a motion vector.
Encoding method.
縮小した参照フレーム画像内の第1探索範囲を参照して第1動きベクトルを探索し、符号化効率を求める第1処理と、前記縮小した参照フレーム画像内の前記第1探索範囲より小さく前記第1探索範囲に含まれる第2探索範囲を参照して第2動きベクトルを探索し、符号化効率を求める第2処理と、を含む第1動き探索を、動画像の処理対象フレーム画像内の前記第1動き探索の処理単位とされるブロック毎に行う第1動き探索部、前記第1動き探索の処理結果に基づいて行われる第2動き探索で参照される参照フレーム画像が記憶される記憶部から部分的に読出された参照画像を記憶する参照画像記憶部、前記処理対象フレーム画像内の前記第2動き探索の処理単位とされるブロック毎に、
前記第2動きベクトルに基づいて設定される前記第2動き探索の探索範囲を含む前記参照画像を、各ブロックの前記第2動き探索の開始前に前記参照画像記憶部に記憶させる制御部、及び前記第1動きベクトルを用いて前記第2動き探索を行う特定ブロックについては、前記参照フレーム画像のうち前記第1動きベクトルに基づいて設定される探索範囲の画像を参照し、前記第1動きベクトルに基づいて設定される探索範囲の画像のうち少なくとも前記参照画像記憶部に記憶されていない画像を参照するときには、前記参照画像記憶部を介さずに前記記憶部から直接読出された画像を参照して動きベクトルを探索する前記第2動き探索を行い、前記第2動きベクトルを用いて前記第2動き探索を行う非特定ブロックについては、前記参照画像記憶部に記憶されている前記参照画像のうち、前記第2動きベクトルに基づいて設定される探索範囲の画像を参照して動きベクトルを探索する前記第2動き探索を行う第2動き探索部、を備えた装置の前記第1動き探索部の処理結果を取得するコンピュータに、
前記処理対象フレーム画像を前記第2動き探索の処理単位とされるブロックに分割したときの複数のブロックのうち、前記参照画像記憶部を介さずに前記記憶部から前記参照フレーム画像を直接読出すときの直接読出データ量の合計値が上限値を超えない範囲内で、前記第2動きベクトルよりも前記第1動きベクトルの方が符号化効率が高いブロックを前特定ブロックとして判定し、前記特定ブロック以外のブロックを前記非特定ブロックとして判定し、該判定結果を前記第2動き探索部に供給する
処理を実行させるためのプログラム。
A first process for searching for a first motion vector with reference to a first search range in the reduced reference frame image to obtain an encoding efficiency, and a first process smaller than the first search range in the reduced reference frame image. A second motion vector is searched for a second motion vector with reference to a second search range included in one search range, and encoding efficiency is obtained. A first motion search unit that is performed for each block that is a processing unit of the first motion search, and a storage unit that stores a reference frame image that is referred to in the second motion search performed based on the processing result of the first motion search A reference image storage unit that stores a reference image partially read out from each of the blocks to be a processing unit of the second motion search in the processing target frame image,
A control unit that stores the reference image including the search range of the second motion search set based on the second motion vector in the reference image storage unit before starting the second motion search of each block; and For a specific block for performing the second motion search using the first motion vector, refer to an image in a search range set based on the first motion vector in the reference frame image, and the first motion vector When referring to at least an image that is not stored in the reference image storage unit among images in the search range set based on the image, the image directly read from the storage unit is referred to without going through the reference image storage unit. For the non-specific block that performs the second motion search for searching for a motion vector and performs the second motion search using the second motion vector, the reference image A second motion search unit for performing the second motion search for searching for a motion vector with reference to an image in a search range set based on the second motion vector among the reference images stored in a storage unit; A computer for obtaining a processing result of the first motion search unit of the apparatus comprising:
The reference frame image is directly read from the storage unit without going through the reference image storage unit among a plurality of blocks when the processing target frame image is divided into blocks which are processing units of the second motion search. A block in which the first motion vector has a higher encoding efficiency than the second motion vector within a range in which the total value of the directly read data amount does not exceed an upper limit value, A program for determining a block other than a block as the non-specific block and supplying the determination result to the second motion search unit.
JP2012183155A 2012-08-22 2012-08-22 Encoding apparatus, encoding method, and program Expired - Fee Related JP5906993B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012183155A JP5906993B2 (en) 2012-08-22 2012-08-22 Encoding apparatus, encoding method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012183155A JP5906993B2 (en) 2012-08-22 2012-08-22 Encoding apparatus, encoding method, and program

Publications (2)

Publication Number Publication Date
JP2014042139A true JP2014042139A (en) 2014-03-06
JP5906993B2 JP5906993B2 (en) 2016-04-20

Family

ID=50394071

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012183155A Expired - Fee Related JP5906993B2 (en) 2012-08-22 2012-08-22 Encoding apparatus, encoding method, and program

Country Status (1)

Country Link
JP (1) JP5906993B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015226199A (en) * 2014-05-28 2015-12-14 富士通株式会社 Dynamic image coding device, dynamic image coding method and dynamic image coding program
WO2016143336A1 (en) * 2015-03-10 2016-09-15 日本電気株式会社 Device for encoding moving image, method for encoding moving image and recording medium storing program for encoding moving image
JP2021524116A (en) * 2018-08-24 2021-09-09 シャンハイ センスタイム インテリジェント テクノロジー カンパニー リミテッド Dynamic motion detection method, dynamic motion control method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008061156A (en) * 2006-09-04 2008-03-13 Fujitsu Ltd Motion picture processing apparatus
JP2008141288A (en) * 2006-11-30 2008-06-19 Fujitsu Ltd Motion vector detection device and motion vector detection method
WO2008136178A1 (en) * 2007-04-26 2008-11-13 Panasonic Corporation Motion detection apparatus, motion detection method, and motion detection program
JP2011071622A (en) * 2009-09-24 2011-04-07 Fujitsu Ltd Motion detection circuit
JP2012004710A (en) * 2010-06-15 2012-01-05 Fujitsu Ltd Motion vector detection circuit, moving image encoding apparatus, and motion vector detection method
JP2012142865A (en) * 2011-01-05 2012-07-26 Sony Corp Image processing apparatus and image processing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008061156A (en) * 2006-09-04 2008-03-13 Fujitsu Ltd Motion picture processing apparatus
JP2008141288A (en) * 2006-11-30 2008-06-19 Fujitsu Ltd Motion vector detection device and motion vector detection method
WO2008136178A1 (en) * 2007-04-26 2008-11-13 Panasonic Corporation Motion detection apparatus, motion detection method, and motion detection program
JP2011071622A (en) * 2009-09-24 2011-04-07 Fujitsu Ltd Motion detection circuit
JP2012004710A (en) * 2010-06-15 2012-01-05 Fujitsu Ltd Motion vector detection circuit, moving image encoding apparatus, and motion vector detection method
JP2012142865A (en) * 2011-01-05 2012-07-26 Sony Corp Image processing apparatus and image processing method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015226199A (en) * 2014-05-28 2015-12-14 富士通株式会社 Dynamic image coding device, dynamic image coding method and dynamic image coding program
WO2016143336A1 (en) * 2015-03-10 2016-09-15 日本電気株式会社 Device for encoding moving image, method for encoding moving image and recording medium storing program for encoding moving image
JP2021524116A (en) * 2018-08-24 2021-09-09 シャンハイ センスタイム インテリジェント テクノロジー カンパニー リミテッド Dynamic motion detection method, dynamic motion control method and device
JP7127202B2 (en) 2018-08-24 2022-08-29 シャンハイ センスタイム インテリジェント テクノロジー カンパニー リミテッド Dynamic motion detection method, dynamic motion control method and device

Also Published As

Publication number Publication date
JP5906993B2 (en) 2016-04-20

Similar Documents

Publication Publication Date Title
CA3131447C (en) Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
US20150085918A1 (en) Image coding device, image coding method, and image coding integrated circuit
US8654847B2 (en) Video decoding device, video decoding method, video decoding program, and video decoding integrated circuit
TW201830972A (en) Low-complexity sign prediction for video coding
CN102036067B (en) Moving image encoding apparatus and control method thereof
KR20170125086A (en) Image prediction method and related apparatus
JP2007281630A (en) Motion detector, motion detecting method, integrated circuit for detecting motion and image encoder
JP2009147807A (en) Image processing apparatus
JP6344398B2 (en) Moving picture coding apparatus, moving picture coding method, and moving picture coding program
JP5906993B2 (en) Encoding apparatus, encoding method, and program
EP2953357A1 (en) Video encoding method, decoding method and apparatus
JP5938935B2 (en) Moving picture coding apparatus and moving picture coding method
JPWO2007055013A1 (en) Image decoding apparatus and method, and image encoding apparatus
CN103327340B (en) A kind of integer searches method and device
JP2007166545A (en) Motion vector detection device and method
JP2007325119A (en) Image processing apparatus and method
JP6740549B2 (en) Moving picture coding apparatus, method, program, and moving picture coding system
JP5299319B2 (en) Motion vector detection device
JP5222049B2 (en) Motion vector search apparatus and control method thereof
US10129543B2 (en) Image compressing device and image compressing method
JP2012120108A (en) Interpolation image generating apparatus and program, and moving image decoding device and program
CN111083485B (en) Utilization of affine mode motion information
JP2006203556A (en) Motion vector detection device, motion compensation device, motion vector detection method, and computer program
JP2010021892A (en) Motion vector search device and control method thereof, and moving image imaging apparatus
JP2008072608A (en) Apparatus and method for encoding image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150512

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160210

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160307

R150 Certificate of patent or registration of utility model

Ref document number: 5906993

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees